diff --git a/.gitignore b/.gitignore index a02213b2..33239fe2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ tools/runner/bin tools/runner/build_mac -/tools/runner/build_linux +tools/runner/build_linux +tools/runner/build_win32 +.DS_Store diff --git a/CHANGELOG b/CHANGELOG deleted file mode 100644 index cf769891..00000000 --- a/CHANGELOG +++ /dev/null @@ -1,51 +0,0 @@ -Cocos2d-Lua-Community v4.0.1 Release - -[新增] LuaGameRunner添加Log to File功能。 -[新增] 集成lua-protobuf(https://github.com/starwing/lua-protobuf) -[新增] TiledMap添加collection of images类型的tileset支持。 -[新增] TiledMap添加对编辑器碰撞数据的解析支持。 -[新增] Linux支持。(注:EditBox实现不完整) -[新增] shader添加setUniformXXX绑定函数。 -[新增] 添加LuaLoadChunksFromZIP绑定。 -[新增] NodeEx.lua添加对鼠标事件的支持。 -[新增] Mac添加系统字体描边支持。 -[新增] 新加一个异步tcp的实现,用来替代SimpleTCP和LuaSocket。 -[新增] 新加network.createHTTPDownload,直接下载到文件。 - -[改进] 优化Lua搜索路径,去掉系统路径。 -[改进] 同步3.7中Luaj的改进。 -[改进] DragonBone的类的public变量改为Lua的set/get封装方式。 -[改进] FairyGUI runtime和Luabinding的大量改进。 -[改进] Spine runtime同步到3.8最新代码。 -[改进] 同步4.7对ccui.RichText的排版修正。 -[改进] RenderTexture内存泄漏和crash修正。 -[改进] auto batch MaterialID 排序修正。 -[改进] Win32 fix for FileUtils::listFilesRecursively returning no results. -[改进] Fix Label::draw skips drawing when batchNodes are more than one and have empty quads. -[改进] ListView innercontainer size fix, when inner item was scaled -[改进] 改进RDAudio::pause(),优化Android下暂停的性能损耗。 -[改进] Android 显示刘海区域。 -[改进] pb解析double和float再优化,fix android release版本crash. -[改进] Mac和Linux使用64位luajit,解决最新mac系统(PANIC: unprotected error in call to Lua API (not enough memory)) -[改进] update luajit and tool to luajit master commit 2020.7.13 -[改进] FileUtils的writeStringToFile绑定添加异步回调。 - -[修正] NodeEx.lua的触摸事件点击只调用Node的hitTest,避免调用ccui.Widget的hitTest产生不正确的判断。 -[修正] iOS和mac的archive不弹出Organizer 界面的问题。 -[修正] ccui.Button 设置字体顺序导致的size不对。 -[修正] 部分Android模拟器的Directx模式下,红屏的问题。 -[修正] DrawNode和label未响应自定义blendFunc. -[修正] lua_spSkeletonData中的内存泄漏。 -[修正] Mac的LuaGameRunner可ctrl+c 复制log。 -[修正] mac editbox crash fix when dealloc. -[修正] Android权限申请crash fix。 -[修正] Cocos2d.lua sync fix from 3.7 - -Cocos2d-Lua-Community v4.0.0 Release - -[Overview] First release of Cocos2d-Lua-Community, a improved of Cocos2d-x 4.0, - and easy to use Lua game engine. - The Lua "frameworks" compatible with Quick-Cocos2dx-Community v3.7.x. -[new] New developed "LuaGameRunner", replace old Player. Keep It Simple and Stupid. -[new] iOS and Mac support metal. -[new] Use CMake for all platforms. \ No newline at end of file diff --git a/CHANGELOG.txt b/CHANGELOG.txt new file mode 100644 index 00000000..4b5bc507 --- /dev/null +++ b/CHANGELOG.txt @@ -0,0 +1,191 @@ +Cocos2d-Lua-Community v4.0.5 Release + +[新增] 添加3.7支持的 ccui.Button:setTitleOffset 接口。 +[新增] 添加龙骨、editbox测试案例。 +[新增] ubuntu 22.04编译支持。感谢bwaiox(bwaiox@gmail.com)。 +[新增] fairygui GImage lua binding补全。 +[新增] 修正RichText在部分机器上崩溃的bug。 + +[改进] captureNode取代内部的render(), 因RenderTexture::end已包含。 +[改进] Android工程升级, androidx替代android.support, 并默认编译64位。 +[改进] EventMouse去垃圾数据。 + +[修正] 在某些情况下OpenGL矩形裁剪闪屏。 +[修正] getWritablePath在win32下不支持中文路径的问题。 +[修正] Cocos2dConstants.lua中的cc.KeyCode修正,并添加cc.MouseButton定义。 +[修正] Crypto.md5File错误的使用解密之后的数据进行计算,导致热md5判断错误。 + +Cocos2d-Lua-Community v4.0.4 Release + +[新增] win32 系统字体支持描边。 + +[改进] Spine 绑定setTimeScale,setTrackTime,getAnimationEnd,getAnimationStart。 +[改进] cc.Label 下划线渲染改进,连续的下换线之间至少1像素的间隔。 +[改进] win32 重载FileUtils::writeDataToFile,正确设置文件创建时间。 +[改进] SpriteFrameCache中正确判断isSpriteFramesWithFileLoaded,优化plist性能。 +[改进] fgui的GGraph添加setPolygonPoints实现画多边形。 +[改进] TextureCache::addImageAsync添加pixelFormat参数,同时display.addImageAsync添加默认的pixelFormat参数。 +[改进] cc.Node去掉无用的_setLocalZOrder。 +[改进] fgui 的FUILabel添加letterSpacing支持。 +[改进] s_function_ref_id回收池,避免爆掉。 +[改进] GuiConstants.lua中的ccui变量统一风格。 +[改进] 去掉texturepacker plist的的aliases,eraseFrame缓存数据修正,改进缓存性能。 +[改进] Node:setNodeEventEnabled优化,避免重复执行。 +[改进] 改名CHANGELOG和VERSION,避免新版mac xcode编译错误。 +[改进] FileUtils:getDataFromFile 绑定回调函数。 +[改进] 优化AppBase:exit(),不需要os.exit()了。 +[改进] Mac的getWritablePath改到 ~/Library/Application Support/BundleIdentifier 下。 +[改进] cc.Label TTF 默认关闭抗锯齿,setTTFScaleFactor能提供更好的字体多分辨率适配效果。 + +[修正] Apple Silicon运行崩溃。 +[修正] cc.Sprite 使用自定义shader时,如果没有设置u_texture1,Mac的metal运行错误。 +[修正] 同步3.7.x改进,修正事件分发对ProtectedNode顺序不确定的bug。 +[修正] fgui进度条和滑动条显示科学计数法的bug。 +[修正] fgui的slider在min value不为0时,显示错误的bug。 +[修正] lua binding中ResourceData返回值的绑定。 +[修正] display.lua中错误的 cc.TEXTURE2D_PIXEL_FORMAT_xxx. +[修正] editbox setTTFScaleFactor后nativeFont字体大小不对的问题。 +[修正] tolua.fullgc。 +[修正] ListView::interceptTouchEvent,正确获取_curSelectedIndex。 +[修正] FUISprite::initWithSpriteFrame 没有刷新的bug。 +[修正] cc.Label enableBold 错误。 +[修正] Tiled map 的ObjectGroup-position-Offset解析错误。 +[修正] Android videoplayer bugfix。 +[修正] CCSprite没有重置 unflippedOffset的bug。 +[修正] win32 宏snprintf修正,避免有可能产生的随机崩溃。 +[修正] EditBox build error on Mac OS 12.x。 +[修正] fgui UIPackage::loadAtlas 预加载bug。 + +Cocos2d-Lua-Community v4.0.3 Release + +[新增] add support for mac m1. +[新增] audio support mp3 audio file. +[新增] add cc.backendProgramType define to RendererConstants.lua. +[新增] FairyGUI binding completion. + +[改进] addSpriteFramesWithFile binding worning fix. +[改进] openssl update to 1.1.0l. +[改进] glfw update to 3.3.4. +[改进] remove updateShaders, builtinProgram is faster then new a program. +[改进] Win32 use VSync, old sleep may make frame skipping. +[改进] cc.FileUtils:isFileExistInternal() work with chinese directory. +[改进] Win32 LuaGameRunner work with chinese directory. +[改进] Spine Allow ownership of AttachmentLoader to be passed to SkeletonBinary and SkeletonJson. +[改进] RenderTexture render sync, async may crash in may case with render cmd was freed. +[改进] Spine add binding api: setDefaultMix. +[改进] TMX add convert for ellipse object. +[改进] add display.newSector. +[改进] optimized plist loading. +[改进] Mat4_translate binding fix, camera's AdditionalTransform fix. +[改进] FairyGUI remove windowSizeListener, it may do evil on PC game. +[改进] TMX object layer's tile animation key use id, and fix schedule start or stop check. +[改进] FairyGUI 优化fgui纹理加载. +[改进] Culling work with user camera and fix camera scaled culling error. +[改进] add binding for FairyGUI FUISprite. +[改进] AsyncTCP support host use domain name. +[改进] Android project add PROP_NDK_VERSION and PROP_BUILD_TOOLS_VERSION. + +[修正] cc.utils:findChild() & add cc.utils:gettime() binding fix. +[修正] revert GLView-desktop fullscreen, center use current monitor. +[修正] FairyGUI GLoader3D fix Spine node pos. +[修正] FairyGUI official bugfix sync. +[修正] binding fix for getBuiltinProgram. +[修正] cc.Sprite:setTexture never change custom shader setting. +[修正] FontFreeType remove force mono render, it not ok for all ttf font. +[修正] fix jpeg header file missmatch. +[修正] some bugfix sync from 3.7.x +[修正] some bugfix snc from Cocos2d-x. +[修正] FairyGUI send move event correctly. +[修正] 修复调用display.newScale9Sprite时的参数和新版引擎不兼容的bug. +[修正] fix FairyGUI GTreeNode create 接口读取lua参数取值错误. +[修正] CCLabel correctly set _maxLineWidth when use TTFScaleFactor. +[修正] CCActionTimeline sync 3.7.x bugfix. +[修正] TMX getPositionAt use float. + +Cocos2d-Lua-Community v4.0.2 Release + +[新增] FairyGUI UIConfig、UIObjectFactory、GSlider、GProgressBar等lua接口绑定。 +[新增] TMXTiledMap绑定getTilesets。 +[新增] spine event luabinding 同时导出当前值和默认值。 +[新增] Image同步3.7的getColorAt函数绑定。 +[新增] 音频输出添加aac支持。 +[新增] TTF加入分辨率自适应开关,自动用合适的字体大小进行渲染,保持高清显示。 +[新增] LayerColor添加自定义shader支持。 +[新增] EventTouch新增setTouches绑定。 + +[改进] FairyGUI runtime 同步。 +[改进] Spine 3.8 runtime 同步。 +[改进] 同步3.7 iOS音频被电话打断的恢复处理。 +[改进] OpenAL库去dlopen。 +[改进] cmake寻找iconv用ICONV_LIBRARY。 +[改进] iOS & Mac remove respondsToSelector & performSelector。 +[改进] update luajit to 2021.1.12。 +[改进] utils绑定captureNode,captureScreen,并支持返回image对象。 +[改进] 去framework.protobuf路径修正,注意导出工具也需要对应修改。 +[改进] 同步3.7的ClippingRectangleNode嵌套,RenderTexture混用渲染异常修正。 + +[修正] FairyGUI runtime 各种填坑。 +[修正] CocosStudio 骨骼skin 渲染crash fix。 +[修正] Android pb 解析crash fix。 +[修正] Metal截图回掉crash fix。 +[修正] TMX 的tsx嵌套解析修正。 +[修正] TMX 帧动画解析以及渲染修正。 +[修正] TMX 修改黑线处理方式,防止纹理抖动。 +[修正] TMX objectgroup解析修正。 +[修正] 修正创建工程时,iOS 横竖屏参数设置无效。 +[修正] apple的getPathForDirectory实现修正。 +[修正] audio stop潜在内存泄漏修正。 +[修正] 修正freetype渲染simsun.ttc的小字体时花屏的bug。 +[修正] Luaj 回调lua自动在cocos thread中运行,解决回调crash。 + +Cocos2d-Lua-Community v4.0.1 Release + +[新增] LuaGameRunner添加Log to File功能。 +[新增] 集成lua-protobuf(https://github.com/starwing/lua-protobuf) +[新增] TiledMap添加collection of images类型的tileset支持。 +[新增] TiledMap添加对编辑器碰撞数据的解析支持。 +[新增] Linux支持。(注:EditBox实现不完整) +[新增] shader添加setUniformXXX绑定函数。 +[新增] 添加LuaLoadChunksFromZIP绑定。 +[新增] NodeEx.lua添加对鼠标事件的支持。 +[新增] Mac添加系统字体描边支持。 +[新增] 新加一个异步tcp的实现,用来替代SimpleTCP和LuaSocket。 +[新增] 新加network.createHTTPDownload,直接下载到文件。 + +[改进] 优化Lua搜索路径,去掉系统路径。 +[改进] 同步3.7中Luaj的改进。 +[改进] DragonBone的类的public变量改为Lua的set/get封装方式。 +[改进] FairyGUI runtime和Luabinding的大量改进。 +[改进] Spine runtime同步到3.8最新代码。 +[改进] 同步4.7对ccui.RichText的排版修正。 +[改进] RenderTexture内存泄漏和crash修正。 +[改进] auto batch MaterialID 排序修正。 +[改进] Win32 fix for FileUtils::listFilesRecursively returning no results. +[改进] Fix Label::draw skips drawing when batchNodes are more than one and have empty quads. +[改进] ListView innercontainer size fix, when inner item was scaled +[改进] 改进RDAudio::pause(),优化Android下暂停的性能损耗。 +[改进] Android 显示刘海区域。 +[改进] pb解析double和float再优化,fix android release版本crash. +[改进] Mac和Linux使用64位luajit,解决最新mac系统(PANIC: unprotected error in call to Lua API (not enough memory)) +[改进] update luajit and tool to luajit master commit 2020.7.13 +[改进] FileUtils的writeStringToFile绑定添加异步回调。 + +[修正] NodeEx.lua的触摸事件点击只调用Node的hitTest,避免调用ccui.Widget的hitTest产生不正确的判断。 +[修正] iOS和mac的archive不弹出Organizer 界面的问题。 +[修正] ccui.Button 设置字体顺序导致的size不对。 +[修正] 部分Android模拟器的Directx模式下,红屏的问题。 +[修正] DrawNode和label未响应自定义blendFunc. +[修正] lua_spSkeletonData中的内存泄漏。 +[修正] Mac的LuaGameRunner可ctrl+c 复制log。 +[修正] mac editbox crash fix when dealloc. +[修正] Android权限申请crash fix。 +[修正] Cocos2d.lua sync fix from 3.7 + +Cocos2d-Lua-Community v4.0.0 Release + +[Overview] First release of Cocos2d-Lua-Community, a improved of Cocos2d-x 4.0, + and easy to use Lua game engine. + The Lua "frameworks" compatible with Quick-Cocos2dx-Community v3.7.x. +[new] New developed "LuaGameRunner", replace old Player. Keep It Simple and Stupid. +[new] iOS and Mac support metal. +[new] Use CMake for all platforms. diff --git a/README.md b/README.md index 4f788ab8..5dd0a2be 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,7 @@ Cocos2d-Lua-Community is a improved of Cocos2d-x 4.0, and easy to use Lua game e ## Lua Game Runner -> Binary of LuaGameRunner is distribute in SkyDrive's Cocos2d-Lua-Community.zip, GitHub ONLY have the source code. - -> 链接: https://pan.baidu.com/s/162CmRTXFOSEChF6D5IJQzQ 提取码: 89jt +> Binary of LuaGameRunner is distribute https://github.com/u0u0/Cocos2d-Lua-Community/releases LuaGameRunner is a replacement of old Player. I just "Keep It Simple and Stupid". diff --git a/VERSION b/VERSION deleted file mode 100644 index 28c2698d..00000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -Cocos2d-Lua-Community 4.0.1 Release diff --git a/VERSION.txt b/VERSION.txt new file mode 100644 index 00000000..bc2ef7c1 --- /dev/null +++ b/VERSION.txt @@ -0,0 +1 @@ +Cocos2d-Lua-Community 4.0.5 Release diff --git a/cmake/Modules/CocosConfigDefine.cmake b/cmake/Modules/CocosConfigDefine.cmake index 12f1300a..0a0d672b 100644 --- a/cmake/Modules/CocosConfigDefine.cmake +++ b/cmake/Modules/CocosConfigDefine.cmake @@ -123,5 +123,9 @@ endfunction() target_compile_options(${target} PUBLIC /MP ) + elseif(LINUX) + target_compile_options(${target} + PUBLIC -fPIE + ) endif() endfunction() diff --git a/cmake/Modules/CocosConfigDepend.cmake b/cmake/Modules/CocosConfigDepend.cmake index a56ec54f..a8466f0c 100644 --- a/cmake/Modules/CocosConfigDepend.cmake +++ b/cmake/Modules/CocosConfigDepend.cmake @@ -6,7 +6,7 @@ macro(cocos2dx_depend) list(APPEND PLATFORM_SPECIFIC_LIBS ws2_32 userenv psapi winmm Version Iphlpapi opengl32) elseif(LINUX) # need review those libs: X11 Xi Xrandr Xxf86vm Xinerama Xcursor rt m - list(APPEND PLATFORM_SPECIFIC_LIBS dl X11 Xi Xrandr Xxf86vm Xinerama Xcursor rt m) + list(APPEND PLATFORM_SPECIFIC_LIBS dl X11 Xi Xrandr Xxf86vm Xinerama Xcursor rt m cap z ssl iconv crypto) # use older cmake style on below linux libs cocos_find_package(Fontconfig FONTCONFIG REQUIRED) cocos_find_package(GTK3 GTK3 REQUIRED) diff --git a/cocos/2d/CCCameraBackgroundBrush.cpp b/cocos/2d/CCCameraBackgroundBrush.cpp index 01ad2074..50585045 100644 --- a/cocos/2d/CCCameraBackgroundBrush.cpp +++ b/cocos/2d/CCCameraBackgroundBrush.cpp @@ -425,7 +425,8 @@ bool CameraBackgroundSkyBoxBrush::init() // disable blend pipelineDescriptor.blendDescriptor.blendEnabled = false; - layout->setAttribute(shaderinfos::attribute::ATTRIBUTE_NAME_POSITION, 0, backend::VertexFormat::FLOAT3, 0, false); + auto attrNameLoc = _programState->getAttributeLocation(shaderinfos::attribute::ATTRIBUTE_NAME_POSITION); + layout->setAttribute(shaderinfos::attribute::ATTRIBUTE_NAME_POSITION, attrNameLoc, backend::VertexFormat::FLOAT3, 0, false); layout->setLayout(sizeof(Vec3)); initBuffer(); diff --git a/cocos/2d/CCFontAtlas.cpp b/cocos/2d/CCFontAtlas.cpp index 5818b2c2..17336c9c 100644 --- a/cocos/2d/CCFontAtlas.cpp +++ b/cocos/2d/CCFontAtlas.cpp @@ -125,11 +125,12 @@ FontAtlas::~FontAtlas() releaseTextures(); delete []_currentPageData; + CC_SAFE_DELETE_ARRAY(_currentPageDataRGBA); #if CC_TARGET_PLATFORM != CC_PLATFORM_WIN32 && CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID if (_iconv) { - iconv_close(_iconv); + iconv_close((iconv_t)_iconv); _iconv = nullptr; } #endif @@ -248,7 +249,7 @@ void FontAtlas::conversionU32TOGB2312(const std::u32string& u32Text, std::unorde #else if (_iconv == nullptr) { - _iconv = iconv_open("GBK//TRANSLIT", "UTF-32LE"); + _iconv = (void *)iconv_open("GBK//TRANSLIT", "UTF-32LE"); } if (_iconv == (iconv_t)-1) @@ -262,7 +263,7 @@ void FontAtlas::conversionU32TOGB2312(const std::u32string& u32Text, std::unorde size_t inLen = strLen * 2; size_t outLen = gb2312StrSize; - iconv(_iconv, (char**)&pin, &inLen, &pout, &outLen); + iconv((iconv_t)_iconv, (char**)&pin, &inLen, &pout, &outLen); } #endif } @@ -415,15 +416,6 @@ bool FontAtlas::prepareLetterDefinitions(const std::u32string& utf32Text) auto tex = new (std::nothrow) Texture2D; initTextureWithZeros(tex); - - if (_antialiasEnabled) - { - tex->setAntiAliasTexParameters(); - } - else - { - tex->setAliasTexParameters(); - } addTexture(tex, _currentPage); tex->release(); @@ -496,6 +488,14 @@ void FontAtlas::updateTextureContent(backend::PixelFormat format, int startY) void FontAtlas::addTexture(Texture2D *texture, int slot) { + if (_antialiasEnabled) + { + texture->setAntiAliasTexParameters(); + } + else + { + texture->setAliasTexParameters(); + } texture->retain(); _atlasTextures[slot] = texture; } diff --git a/cocos/2d/CCFontFreeType.cpp b/cocos/2d/CCFontFreeType.cpp index 99cd8cd8..dfec3ec2 100644 --- a/cocos/2d/CCFontFreeType.cpp +++ b/cocos/2d/CCFontFreeType.cpp @@ -108,7 +108,6 @@ FontFreeType::FontFreeType(bool distanceFieldEnabled /* = false */, float outlin , _lineHeight(0) , _fontAtlas(nullptr) , _usedGlyphs(GlyphCollection::ASCII) -, _renderMono(false) { if (outline > 0.0f) { @@ -180,7 +179,6 @@ bool FontFreeType::createFontObject(const std::string &fontName, float fontSize) // store the face globally _fontRef = face; _lineHeight = static_cast((_fontRef->size->metrics.ascender - _fontRef->size->metrics.descender) >> 6); - _renderMono = fontSize <= 16.0f; // font size <= 16.0, use mono render the font // done and good return true; } @@ -214,14 +212,13 @@ FontAtlas * FontFreeType::createFontAtlas() { if (_fontAtlas == nullptr) { _fontAtlas = new (std::nothrow) FontAtlas(*this); -// _fontAtlas->setAliasTexParameters(); // uncomment this line to close AntiAlias + _fontAtlas->setAliasTexParameters(); // ONLY close AntiAlias for TTF if (_fontAtlas && _usedGlyphs != GlyphCollection::DYNAMIC) { std::u32string utf32; if (StringUtils::UTF8ToUTF32(getGlyphCollection(), utf32)) { _fontAtlas->prepareLetterDefinitions(utf32); } } -// this->autorelease(); } return _fontAtlas; @@ -301,11 +298,6 @@ unsigned char* FontFreeType::getGlyphBitmap(uint64_t theChar, long &outWidth, lo // chinese char show messy in simsun.ttc with size 12, need FT_LOAD_NO_BITMAP to fix it. FT_Int32 flag = FT_LOAD_RENDER | FT_LOAD_NO_AUTOHINT | FT_LOAD_NO_BITMAP; - if (_renderMono) { - flag |= FT_LOAD_MONOCHROME; // small font size, load 1bit bitmap - _distanceFieldEnabled = false; // auto disable glow - _outlineSize = 0.0f; // audo disabled outline - } if (_distanceFieldEnabled) { flag |= FT_LOAD_NO_HINTING; } @@ -588,7 +580,7 @@ void FontFreeType::renderCharAt(unsigned char *dest,int posX, int posY, unsigned } delete [] bitmap; } else { - if (_renderMono) { + if (_fontRef->glyph->bitmap.pixel_mode == FT_PIXEL_MODE_MONO) { int pitch = _fontRef->glyph->bitmap.pitch; for (long y = 0; y < bitmapHeight; ++y) { for (int x = 0; x < bitmapWidth; ++x) { diff --git a/cocos/2d/CCFontFreeType.h b/cocos/2d/CCFontFreeType.h index 5271a76e..5013ab0b 100644 --- a/cocos/2d/CCFontFreeType.h +++ b/cocos/2d/CCFontFreeType.h @@ -103,7 +103,6 @@ class CC_DLL FontFreeType : public Font GlyphCollection _usedGlyphs; std::string _customGlyphs; - bool _renderMono; }; /// @endcond diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index c3df286b..a0cfaed4 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -839,7 +839,11 @@ void Label::setMaxLineWidth(float maxLineWidth) { if (_labelWidth == 0 && _maxLineWidth != maxLineWidth) { - _maxLineWidth = maxLineWidth; + if (_currentLabelType == LabelType::STRING_TEXTURE || _currentLabelType == LabelType::TTF) { + _maxLineWidth = maxLineWidth * s_TTFScaleFactor; + } else { + _maxLineWidth = maxLineWidth; + } _contentDirty = true; } } @@ -861,7 +865,7 @@ void Label::setDimensions(float width, float height) _labelDimensions.width = width; _labelDimensions.height = height; - _maxLineWidth = width; + _maxLineWidth = _labelWidth; _contentDirty = true; if(_overflow == Overflow::SHRINK){ @@ -1298,9 +1302,11 @@ void Label::enableBold() if (!_boldEnabled) { // bold is implemented with outline - enableShadow(Color4B::WHITE, Size(0.9f, 0), 0); + enableShadow(_textColor, Size(0.9f, 0), 0); // add one to kerning - setAdditionalKerning(_additionalKerning+1); + if (_currentLabelType != LabelType::STRING_TEXTURE) { + setAdditionalKerning(_additionalKerning + 1); + } _boldEnabled = true; } } @@ -1370,7 +1376,9 @@ void Label::disableEffect(LabelEffect effect) case cocos2d::LabelEffect::BOLD: if (_boldEnabled) { _boldEnabled = false; - _additionalKerning -= 1; + if (_currentLabelType != LabelType::STRING_TEXTURE) { + _additionalKerning -= 1; + } disableEffect(LabelEffect::SHADOW); } break; @@ -1407,14 +1415,18 @@ void Label::createSpriteForSystemFont(const FontDefinition& fontDef) auto texture = new (std::nothrow) Texture2D; texture->initWithString(_utf8Text.c_str(), fontDef); - _textSprite = Sprite::createWithTexture(texture); + texture->release(); //set camera mask using label's camera mask, because _textSprite may be null when setting camera mask to label _textSprite->setCameraMask(getCameraMask()); _textSprite->setGlobalZOrder(getGlobalZOrder()); _textSprite->setAnchorPoint(Vec2::ANCHOR_BOTTOM_LEFT); - this->setContentSize(_textSprite->getContentSize()); - texture->release(); + // fix size to even numbers, label center not in float pos. + auto size = _textSprite->getContentSize(); + size.width = ((int)size.width % 2 == 0) ? (int)size.width : ((int)size.width + 1); + size.height = ((int)size.height % 2 == 0) ? (int)size.height : ((int)size.height + 1); + this->setContentSize(size); + if (_blendFuncDirty) { _textSprite->setBlendFunc(_blendFunc); @@ -1521,7 +1533,7 @@ void Label::updateContent() } } - if (_underlineNode) + if (_underlineNode && _utf8Text.size() > 0) { _underlineNode->clear(); @@ -1543,7 +1555,7 @@ void Label::updateContent() // Github issue #15214. Uses _displayedColor instead of _textColor for the underline. // This is to have the same behavior of SystemFonts. Color4F color = _underlineColor4B.a > 0 ? Color4F(_underlineColor4B) : Color4F(_displayedColor); - _underlineNode->drawLine(Vec2(_linesOffsetX[i],y), Vec2(_linesWidth[i] + _linesOffsetX[i],y), color); + _underlineNode->drawLine(Vec2(_linesOffsetX[i] + 1, y), Vec2(_linesWidth[i] + _linesOffsetX[i] - 1, y), color); } } else if (_textSprite) @@ -1552,13 +1564,12 @@ void Label::updateContent() float y = 0; const auto spriteSize = _textSprite->getContentSize(); _underlineNode->setLineWidth(spriteSize.height/6); - if (_strikethroughEnabled) // FIXME: system fonts don't report the height of the font correctly. only the size of the texture, which is POT y += spriteSize.height / 2; // FIXME: Might not work with different vertical alignments Color4F color = _underlineColor4B.a > 0 ? Color4F(_underlineColor4B) : Color4F(_textSprite->getDisplayedColor()); - _underlineNode->drawLine(Vec2(0.0f,y), Vec2(spriteSize.width,y), color); + _underlineNode->drawLine(Vec2(0.0f + 1, y), Vec2(spriteSize.width - 1, y), color); } } @@ -1713,18 +1724,14 @@ void Label::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) { return; } - // Don't do calculate the culling if the transform was not updated - bool transformUpdated = flags & FLAGS_TRANSFORM_DIRTY; + #if CC_USE_CULLING + // Don't calculate the culling if the transform was not updated auto visitingCamera = Camera::getVisitingCamera(); - auto defaultCamera = Camera::getDefaultCamera(); - if (visitingCamera == defaultCamera) { - _insideBounds = (transformUpdated || visitingCamera->isViewProjectionUpdated()) ? renderer->checkVisibility(transform, _contentSize) : _insideBounds; - } + if (visitingCamera == nullptr) + _insideBounds = true; else - { - _insideBounds = renderer->checkVisibility(transform, _contentSize); - } + _insideBounds = ((flags & FLAGS_TRANSFORM_DIRTY) || visitingCamera->isViewProjectionUpdated()) ? renderer->checkVisibility(transform, _contentSize) : _insideBounds; if (_insideBounds) #endif @@ -2027,23 +2034,20 @@ float Label::getLineSpacing() const void Label::setAdditionalKerning(float space) { - - if (_currentLabelType != LabelType::STRING_TEXTURE) - { + if (_currentLabelType != LabelType::STRING_TEXTURE) { if (_additionalKerning != space) { _additionalKerning = space; _contentDirty = true; } - } - else + } else { CCLOG("Label::setAdditionalKerning not supported on LabelType::STRING_TEXTURE"); + } } float Label::getAdditionalKerning() const { CCASSERT(_currentLabelType != LabelType::STRING_TEXTURE, "Not supported system font!"); - return _additionalKerning; } @@ -2167,6 +2171,9 @@ void Label::setTextColor(const Color4B &color) _textColorF.g = _textColor.g / 255.0f; _textColorF.b = _textColor.b / 255.0f; _textColorF.a = _textColor.a / 255.0f; + if (_boldEnabled) { + enableShadow(color, Size(0.9f, 0), 0); // update bold color + } } void Label::updateColor() @@ -2223,8 +2230,12 @@ const Size& Label::getContentSize() const } // system font and TTF if (_currentLabelType == LabelType::STRING_TEXTURE || _currentLabelType == LabelType::TTF) { - const_cast(&_ttfContentSize)->setSize(ceil(_contentSize.width / s_TTFScaleFactor), - ceil(_contentSize.height / s_TTFScaleFactor)); + // fix size to even numbers, label center not in float pos. + int w = ceil(_contentSize.width / s_TTFScaleFactor); + int h = ceil(_contentSize.height / s_TTFScaleFactor); + w = (w % 2 == 0) ? w : (w + 1); + h = (h % 2 == 0) ? h : (h + 1); + const_cast(&_ttfContentSize)->setSize(w, h); // const_cast make const function happy return _ttfContentSize; } return _contentSize; @@ -2307,10 +2318,10 @@ FontDefinition Label::_getFontDefinition() const systemFontDef._stroke._strokeEnabled = false; } -#if (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) && (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) && (CC_TARGET_PLATFORM != CC_PLATFORM_IOS) +#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) if (systemFontDef._stroke._strokeEnabled) { - CCLOGERROR("Stroke Currently only supported on Mac, iOS and Android!"); + CCLOGERROR("SystemFont Stroke Currently not support on Linux!"); } systemFontDef._stroke._strokeEnabled = false; #endif diff --git a/cocos/2d/CCLabelAtlas.cpp b/cocos/2d/CCLabelAtlas.cpp index 9fa24cad..f0069376 100644 --- a/cocos/2d/CCLabelAtlas.cpp +++ b/cocos/2d/CCLabelAtlas.cpp @@ -215,8 +215,10 @@ void LabelAtlas::setString(const std::string &label) _string = label; this->updateAtlasValues(); + // fix size to even numbers, label center not in float pos. Size s = Size(len * _itemWidth, _itemHeight); - + s.width = ((int)s.width % 2 == 0) ? (int)s.width : ((int)s.width + 1); + s.height = ((int)s.height % 2 == 0) ? (int)s.height : ((int)s.height + 1); this->setContentSize(s); _quadsToDraw = len; diff --git a/cocos/2d/CCLabelTextFormatter.cpp b/cocos/2d/CCLabelTextFormatter.cpp index 168401a6..f69d7698 100644 --- a/cocos/2d/CCLabelTextFormatter.cpp +++ b/cocos/2d/CCLabelTextFormatter.cpp @@ -300,6 +300,9 @@ bool Label::multilineTextWrap(const std::functionreorderChild(this, z); @@ -271,13 +272,6 @@ void Node::setLocalZOrder(std::int32_t z) _eventDispatcher->setDirtyForNode(this); } -/// zOrder setter : private method -/// used internally to alter the zOrder variable. DON'T call this method manually -void Node::_setLocalZOrder(std::int32_t z) -{ - _localZOrder = z; -} - void Node::updateOrderOfArrival() { _orderOfArrival = (++s_globalOrderOfArrival); @@ -990,7 +984,7 @@ void Node::addChild(Node *child, int zOrder) void Node::addChild(Node *child) { CCASSERT( child != nullptr, "Argument must be non-nil"); - this->addChild(child, child->getLocalZOrder(), child->_name); + this->addChild(child, child->_localZOrder, child->_name); } void Node::removeFromParent() @@ -1055,6 +1049,33 @@ void Node::removeChildByName(const std::string &name, bool cleanup) } } +void Node::removeChildrenByTag(int tag, bool cleanup/* = true */) +{ + CCASSERT(tag != Node::INVALID_TAG, "Invalid tag"); + + for (int i = _children.size() - 1; i >= 0; i--) { + auto child = _children.at(i); + if (child->_tag == tag) { + this->removeChild(child, cleanup); + } + } +} + +void Node::removeChildrenByName(const std::string& name, bool cleanup/* = true */) +{ + CCASSERT(!name.empty(), "Invalid name"); + + std::hash h; + size_t hash = h(name); + for (int i = _children.size() - 1; i >= 0; i--) { + auto child = _children.at(i); + // Different strings may have the same hash code, but can use it to compare first for speed + if (child->_hashOfName == hash && child->_name.compare(name) == 0) { + this->removeChild(child, cleanup); + } + } +} + void Node::removeAllChildren() { this->removeAllChildrenWithCleanup(true); @@ -1137,7 +1158,7 @@ void Node::insertChild(Node* child, int z) _transformUpdated = true; _reorderChildDirty = true; _children.pushBack(child); - child->_setLocalZOrder(z); + child->_localZOrder = z; } void Node::reorderChild(Node *child, int zOrder) @@ -1145,7 +1166,7 @@ void Node::reorderChild(Node *child, int zOrder) CCASSERT( child != nullptr, "Child must be non-nil"); _reorderChildDirty = true; child->updateOrderOfArrival(); - child->_setLocalZOrder(zOrder); + child->_localZOrder = zOrder; } void Node::sortAllChildren() @@ -1587,6 +1608,11 @@ void Node::pause() // override me void Node::update(float fDelta) { + if (_componentContainer && !_componentContainer->isEmpty()) + { + _componentContainer->visit(fDelta); + } + #if CC_ENABLE_SCRIPT_BINDING if (0 != _updateScriptHandler) { @@ -1596,11 +1622,6 @@ void Node::update(float fDelta) ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event); } #endif - - if (_componentContainer && !_componentContainer->isEmpty()) - { - _componentContainer->visit(fDelta); - } } // MARK: coordinates @@ -1901,11 +1922,10 @@ Component* Node::getComponent(const std::string& name) bool Node::addComponent(Component *component) { // lazy alloc - if (!_componentContainer) + if (!_componentContainer) { _componentContainer = new (std::nothrow) ComponentContainer(this); - - // should enable schedule update, then all components can receive this call back - scheduleUpdate(); + scheduleUpdate(); // ONLY need scheduleUpdate once. + } return _componentContainer->add(component); } diff --git a/cocos/2d/CCNode.h b/cocos/2d/CCNode.h index 08d85e42..f1958e1d 100644 --- a/cocos/2d/CCNode.h +++ b/cocos/2d/CCNode.h @@ -5,6 +5,7 @@ Copyright (c) 2011 Zynga Inc. Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. + Copyright (c) 2021 cocos2d-lua.org http://www.cocos2d-x.org @@ -167,12 +168,6 @@ class CC_DLL Node : public Ref * @param localZOrder The local Z order value. */ virtual void setLocalZOrder(std::int32_t localZOrder); - - /* - Helper function used by `setLocalZOrder`. Don't use it unless you know what you are doing. - @js NA - */ - virtual void _setLocalZOrder(std::int32_t z); /** !!! ONLY FOR INTERNAL USE * Sets the arrival order when this node has a same ZOrder with other children. @@ -890,6 +885,20 @@ class CC_DLL Node : public Ref * @param cleanup True if all running actions and callbacks on the child node will be cleanup, false otherwise. */ virtual void removeChildByName(const std::string &name, bool cleanup = true); + /** + * Removes children from the container by tag value. It will also cleanup all running actions depending on the cleanup parameter. + * + * @param name A string that identifies children nodes. + * @param cleanup True if all running actions and callbacks on the child node will be cleanup, false otherwise. + */ + virtual void removeChildrenByTag(int tag, bool cleanup = true); + /** + * Removes a child from the container by tag value. It will also cleanup all running actions depending on the cleanup parameter. + * + * @param name A string that identifies a child node. + * @param cleanup True if all running actions and callbacks on the child node will be cleanup, false otherwise. + */ + virtual void removeChildrenByName(const std::string& name, bool cleanup = true); /** * Removes all children from the container with a cleanup. * @@ -929,11 +938,11 @@ class CC_DLL Node : public Ref { static_assert(std::is_base_of::value, "Node::sortNodes: Only accept derived of Node!"); #if CC_64BITS - std::sort(std::begin(nodes), std::end(nodes), [](_T* n1, _T* n2) { + std::stable_sort(std::begin(nodes), std::end(nodes), [](_T* n1, _T* n2) { return (n1->_localZOrder$Arrival < n2->_localZOrder$Arrival); }); #else - std::sort(std::begin(nodes), std::end(nodes), [](_T* n1, _T* n2) { + std::stable_sort(std::begin(nodes), std::end(nodes), [](_T* n1, _T* n2) { return (n1->_localZOrder == n2->_localZOrder && n1->_orderOfArrival < n2->_orderOfArrival) || n1->_localZOrder < n2->_localZOrder; }); #endif diff --git a/cocos/2d/CCProtectedNode.h b/cocos/2d/CCProtectedNode.h index 0bb7be2b..1acbab0f 100644 --- a/cocos/2d/CCProtectedNode.h +++ b/cocos/2d/CCProtectedNode.h @@ -5,6 +5,7 @@ Copyright (c) 2011 Zynga Inc. Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. + Copyright (c) 2021 cocos2d-lua.org http://www.cocos2d-x.org @@ -183,6 +184,7 @@ class CC_DLL ProtectedNode : public Node virtual void disableCascadeOpacity()override; virtual void setCameraMask(unsigned short mask, bool applyChildren = true) override; virtual void setGlobalZOrder(float globalZOrder) override; + virtual Vector& getProtectedChildren() { return _protectedChildren; }; CC_CONSTRUCTOR_ACCESS: ProtectedNode(); virtual ~ProtectedNode(); diff --git a/cocos/2d/CCRenderTexture.cpp b/cocos/2d/CCRenderTexture.cpp index aae7c01f..2394d1e5 100644 --- a/cocos/2d/CCRenderTexture.cpp +++ b/cocos/2d/CCRenderTexture.cpp @@ -637,8 +637,18 @@ void RenderTexture::end() CCASSERT(nullptr != director, "Director is null when setting matrix stack"); Renderer *renderer = director->getRenderer(); + // render may call from touch event callback, and it not in Director drawScene circle. + // need beginFrame for metal render backend, or render will crash + bool isInitFramed = renderer->isBeginFrame(); + if (!isInitFramed) { + renderer->beginFrame(); + } renderer->addCommand(&_endCommand); renderer->popGroup(); + renderer->render(); + if (!isInitFramed) { + renderer->endFrame(); + } director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); diff --git a/cocos/2d/CCScene.cpp b/cocos/2d/CCScene.cpp index 4df4f5b2..e11ab9f5 100644 --- a/cocos/2d/CCScene.cpp +++ b/cocos/2d/CCScene.cpp @@ -4,6 +4,7 @@ Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. +Copyright (c) 2021 cocos2d-lua.org http://www.cocos2d-x.org @@ -184,9 +185,9 @@ void Scene::render(Renderer* renderer, const Mat4& eyeTransform, const Mat4* eye continue; Camera::_visitingCamera = camera; - if (Camera::_visitingCamera->getCameraFlag() == CameraFlag::DEFAULT) + if (camera->getCameraFlag() == CameraFlag::DEFAULT) { - defaultCamera = Camera::_visitingCamera; + defaultCamera = camera; } // There are two ways to modify the "default camera" with the eye Transform: @@ -199,9 +200,8 @@ void Scene::render(Renderer* renderer, const Mat4& eyeTransform, const Mat4* eye if (eyeProjection) camera->setAdditionalProjection(*eyeProjection * camera->getProjectionMatrix().getInversed()); - camera->setAdditionalTransform(eyeTransform.getInversed()); director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); - director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, Camera::_visitingCamera->getViewProjectionMatrix()); + director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION, camera->getViewProjectionMatrix()); camera->apply(); //clear background with max depth diff --git a/cocos/2d/CCSprite.cpp b/cocos/2d/CCSprite.cpp index dc1404a4..11ebee17 100644 --- a/cocos/2d/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -4,6 +4,7 @@ Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. +Copyright (c) 2021 cocos2d-lua.org http://www.cocos2d-x.org @@ -176,6 +177,8 @@ bool Sprite::initWithFile(const std::string& filename) } _fileName = filename; + _fileType = 0; + _unflippedOffsetPositionFromCenter = Vec2::ZERO; Texture2D *texture = _director->getTextureCache()->addImage(filename); if (texture) @@ -198,6 +201,8 @@ bool Sprite::initWithFile(const std::string &filename, const Rect& rect) return false; _fileName = filename; + _fileType = 0; + _unflippedOffsetPositionFromCenter = Vec2::ZERO; Texture2D *texture = _director->getTextureCache()->addImage(filename); if (texture) @@ -375,15 +380,6 @@ void Sprite::setVertexLayout() vertexLayout->setLayout(sizeof(V3F_C4B_T2F)); } -void Sprite::updateShaders(const char* vert, const char* frag) -{ - auto* program = backend::Device::getInstance()->newProgram(vert, frag); - auto programState = new (std::nothrow) backend::ProgramState(program); - setProgramState(programState); - CC_SAFE_RELEASE(programState); - CC_SAFE_RELEASE(program); -} - void Sprite::setProgramState(backend::ProgramType type) { if(_programState != nullptr && @@ -419,8 +415,26 @@ void Sprite::setProgramState(backend::ProgramState *programState) void Sprite::setTexture(Texture2D *texture) { + auto updatePS = true; auto isETC1 = texture && texture->getAlphaTextureName(); - setProgramState((isETC1) ? backend::ProgramType::ETC1 : backend::ProgramType::POSITION_TEXTURE_COLOR); + if (_programState) { + auto type = _programState->getProgram()->getProgramType(); + if (type == backend::ProgramType::CUSTOM_PROGRAM) { + updatePS = false; // keep custom shader + } else if (isETC1) { + if ((type == backend::ProgramType::ETC1 || type == backend::ProgramType::ETC1_GRAY)) { + updatePS = false; // keep gray + } + } else { + if (type == backend::ProgramType::POSITION_TEXTURE_COLOR || type == backend::ProgramType::GRAY_SCALE) { + updatePS = false; // keep gray + } + } + } + if (updatePS) { + setProgramState((isETC1) ? backend::ProgramType::ETC1 : backend::ProgramType::POSITION_TEXTURE_COLOR); + } + CCASSERT(! _batchNode || (texture && texture == _batchNode->getTexture()), "CCSprite: Batched sprites should use the same texture as the batchnode"); // accept texture==nil as argument CCASSERT( !texture || dynamic_cast(texture), "setTexture expects a Texture2D. Invalid argument"); @@ -463,9 +477,14 @@ void Sprite::updateProgramStateTexture() auto programState = _trianglesCommand.getPipelineDescriptor().programState; programState->setTexture(_textureLocation, 0, _texture->getBackendTexture()); auto alphaTexture = _texture->getAlphaTexture(); - if(alphaTexture && alphaTexture->getBackendTexture()) - { - programState->setTexture(_alphaTextureLocation, 1, alphaTexture->getBackendTexture()); + // may ETC1 or user defined shader used u_texture1. + if (_alphaTextureLocation.location[0] != -1 || _alphaTextureLocation.location[1] != -1) { + if(alphaTexture && alphaTexture->getBackendTexture()) { + programState->setTexture(_alphaTextureLocation, 1, alphaTexture->getBackendTexture()); + } else { + // set a default texture into location to make metal render happy. + programState->setTexture(_alphaTextureLocation, 1, _texture->getBackendTexture()); + } } } @@ -1108,14 +1127,10 @@ void Sprite::draw(Renderer *renderer, const Mat4 &transform, uint32_t flags) #if CC_USE_CULLING // Don't calculate the culling if the transform was not updated auto visitingCamera = Camera::getVisitingCamera(); - auto defaultCamera = Camera::getDefaultCamera(); if (visitingCamera == nullptr) _insideBounds = true; - else if (visitingCamera == defaultCamera) - _insideBounds = ((flags & FLAGS_TRANSFORM_DIRTY) || visitingCamera->isViewProjectionUpdated()) ? renderer->checkVisibility(transform, _contentSize) : _insideBounds; else - // XXX: this always return true since - _insideBounds = renderer->checkVisibility(transform, _contentSize); + _insideBounds = ((flags & FLAGS_TRANSFORM_DIRTY) || visitingCamera->isViewProjectionUpdated()) ? renderer->checkVisibility(transform, _contentSize) : _insideBounds; if(_insideBounds) #endif diff --git a/cocos/2d/CCSprite.h b/cocos/2d/CCSprite.h index 157d34d8..68d09554 100644 --- a/cocos/2d/CCSprite.h +++ b/cocos/2d/CCSprite.h @@ -421,6 +421,7 @@ class CC_DLL Sprite : public Node, public TextureProtocol * Set ProgramState */ virtual void setProgramState(backend::ProgramState *programState) override; + void setProgramState(backend::ProgramType type); /** * Get current ProgramState @@ -623,7 +624,6 @@ CC_CONSTRUCTOR_ACCESS : virtual bool initWithFile(const std::string& filename, const Rect& rect); virtual void setVertexLayout(); - virtual void updateShaders(const char* vert, const char* frag); protected: virtual void updateColor() override; @@ -641,7 +641,6 @@ CC_CONSTRUCTOR_ACCESS : void updateStretchFactor(); void populateTriangle(int quadIndex, const V3F_C4B_T2F_Quad& quad); void setMVPMatrixUniform(); - void setProgramState(backend::ProgramType type); // // Data used when the sprite is rendered using a SpriteSheet // diff --git a/cocos/2d/CCSpriteBatchNode.cpp b/cocos/2d/CCSpriteBatchNode.cpp index b88e7e9e..38feb569 100644 --- a/cocos/2d/CCSpriteBatchNode.cpp +++ b/cocos/2d/CCSpriteBatchNode.cpp @@ -107,26 +107,14 @@ bool SpriteBatchNode::initWithTexture(Texture2D *tex, ssize_t capacity/* = DEFAU _children.reserve(capacity); _descendants.reserve(capacity); - - updateShaders(positionTextureColor_vert, positionTextureColor_frag); - + // Builtin Program is shared and faster then create a new program + auto* program = backend::Program::getBuiltinProgram(backend::ProgramType::POSITION_TEXTURE_COLOR); + auto programState = new (std::nothrow) backend::ProgramState(program); + setProgramState(programState); + CC_SAFE_RELEASE_NULL(programState); return true; } -void SpriteBatchNode::updateShaders(const std::string &vertexShader, const std::string &fragmentShader) -{ - auto& pipelineDescriptor = _quadCommand.getPipelineDescriptor(); - auto* program = backend::Device::getInstance()->newProgram(vertexShader, fragmentShader); - CC_SAFE_RELEASE(_programState); - _programState = new (std::nothrow) backend::ProgramState(program); - pipelineDescriptor.programState = _programState; - - CC_SAFE_RELEASE(program); - - setVertexLayout(); - setUniformLocation(); -} - void SpriteBatchNode::setUniformLocation() { CCASSERT(_programState, "programState should not be nullptr"); diff --git a/cocos/2d/CCSpriteBatchNode.h b/cocos/2d/CCSpriteBatchNode.h index f0a82187..445668f1 100644 --- a/cocos/2d/CCSpriteBatchNode.h +++ b/cocos/2d/CCSpriteBatchNode.h @@ -266,8 +266,6 @@ class CC_DLL SpriteBatchNode : public Node, public TextureProtocol void updateBlendFunc(); void setVertexLayout(); void setUniformLocation(); - - virtual void updateShaders(const std::string& vertexShader, const std::string& fragmentShader); TextureAtlas *_textureAtlas = nullptr; BlendFunc _blendFunc; diff --git a/cocos/2d/CCSpriteFrameCache.cpp b/cocos/2d/CCSpriteFrameCache.cpp index 57bd730a..c10bdb68 100644 --- a/cocos/2d/CCSpriteFrameCache.cpp +++ b/cocos/2d/CCSpriteFrameCache.cpp @@ -6,6 +6,7 @@ Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. +Copyright (c) 2022 cocos2d-lua.org http://www.cocos2d-x.org @@ -69,7 +70,6 @@ void SpriteFrameCache::destroyInstance() bool SpriteFrameCache::init() { - _spriteFramesAliases.reserve(20); _spriteFramesCache.init(); return true; } @@ -221,19 +221,6 @@ void SpriteFrameCache::addSpriteFramesWithDictionary(ValueMap& dictionary, Textu Rect textureRect = RectFromString(frameDict["textureRect"].asString()); bool textureRotated = frameDict["textureRotated"].asBool(); - // get aliases - ValueVector& aliases = frameDict["aliases"].asValueVector(); - - for(const auto &value : aliases) { - std::string oneAlias = value.asString(); - if (_spriteFramesAliases.find(oneAlias) != _spriteFramesAliases.end()) - { - CCLOGWARN("cocos2d: WARNING: an alias with name %s already exists", oneAlias.c_str()); - } - - _spriteFramesAliases[oneAlias] = Value(spriteFrameName); - } - // create frame spriteFrame = SpriteFrame::createWithTexture(texture, Rect(textureRect.origin.x, textureRect.origin.y, spriteSize.width, spriteSize.height), @@ -329,6 +316,13 @@ void SpriteFrameCache::addSpriteFramesWithDictionary(ValueMap& dict, const std:: void SpriteFrameCache::addSpriteFramesWithFile(const std::string& plist, Texture2D *texture) { + CCASSERT(!plist.empty(), "plist filename should not be nullptr"); + CCASSERT(texture, "texture should not be nil"); + if (isSpriteFramesWithFileLoaded(plist)) + { + return; + } + std::string fullPath = FileUtils::getInstance()->fullPathForFilename(plist); ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(fullPath); @@ -343,7 +337,13 @@ void SpriteFrameCache::addSpriteFramesWithFileContent(const std::string& plist_c void SpriteFrameCache::addSpriteFramesWithFile(const std::string& plist, const std::string& textureFileName) { - CCASSERT(textureFileName.size()>0, "texture name should not be null"); + CCASSERT(!plist.empty(), "plist filename should not be nullptr"); + CCASSERT(textureFileName.size() > 0, "texture name should not be null"); + if (isSpriteFramesWithFileLoaded(plist)) + { + return; + } + const std::string fullPath = FileUtils::getInstance()->fullPathForFilename(plist); ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(fullPath); addSpriteFramesWithDictionary(dict, textureFileName, plist); @@ -352,6 +352,10 @@ void SpriteFrameCache::addSpriteFramesWithFile(const std::string& plist, const s void SpriteFrameCache::addSpriteFramesWithFile(const std::string& plist) { CCASSERT(!plist.empty(), "plist filename should not be nullptr"); + if (isSpriteFramesWithFileLoaded(plist)) + { + return; + } std::string fullPath = FileUtils::getInstance()->fullPathForFilename(plist); if (fullPath.empty()) @@ -410,7 +414,6 @@ void SpriteFrameCache::addSpriteFrame(SpriteFrame* frame, const std::string& fra void SpriteFrameCache::removeSpriteFrames() { - _spriteFramesAliases.clear(); _spriteFramesCache.clear(); } @@ -445,15 +448,6 @@ void SpriteFrameCache::removeSpriteFrameByName(const std::string& name) if (name.empty()) return; - // Is this an alias ? - bool foundAlias = _spriteFramesAliases.find(name) != _spriteFramesAliases.end(); - std::string key = foundAlias ? _spriteFramesAliases[name].asString() : ""; - - if (!key.empty()) - { - _spriteFramesAliases.erase(key); - } - _spriteFramesCache.eraseFrame(name); } @@ -524,23 +518,7 @@ SpriteFrame* SpriteFrameCache::getSpriteFrameByName(const std::string& name) SpriteFrame* frame = _spriteFramesCache.at(name); if (!frame) { - // try alias dictionary - if (_spriteFramesAliases.find(name) != _spriteFramesAliases.end()) - { - std::string key = _spriteFramesAliases[name].asString(); - if (!key.empty()) - { - frame = _spriteFramesCache.at(key); - if (!frame) - { - CCLOG("cocos2d: SpriteFrameCache: Frame aliases '%s' isn't found", key.c_str()); - } - } - } - else - { - CCLOG("cocos2d: SpriteFrameCache: Frame '%s' isn't found", name.c_str()); - } + CCLOG("cocos2d: SpriteFrameCache: Frame '%s' isn't found", name.c_str()); } return frame; } @@ -626,19 +604,6 @@ void SpriteFrameCache::reloadSpriteFramesWithDictionary(ValueMap& dictionary, Te Rect textureRect = RectFromString(frameDict["textureRect"].asString()); bool textureRotated = frameDict["textureRotated"].asBool(); - // get aliases - ValueVector& aliases = frameDict["aliases"].asValueVector(); - - for (const auto &value : aliases) { - std::string oneAlias = value.asString(); - if (_spriteFramesAliases.find(oneAlias) != _spriteFramesAliases.end()) - { - CCLOGWARN("cocos2d: WARNING: an alias with name %s already exists", oneAlias.c_str()); - } - - _spriteFramesAliases[oneAlias] = Value(spriteFrameName); - } - // create frame spriteFrame = SpriteFrame::createWithTexture(texture, Rect(textureRect.origin.x, textureRect.origin.y, spriteSize.width, spriteSize.height), @@ -658,9 +623,7 @@ bool SpriteFrameCache::reloadTexture(const std::string& plist) if (_spriteFramesCache.isPlistUsed(plist)) { _spriteFramesCache.erasePlistIndex(plist); - } - else - { + } else { //If one plist has't be loaded, we don't load it here. return false; } @@ -669,7 +632,6 @@ bool SpriteFrameCache::reloadTexture(const std::string& plist) ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(fullPath); string texturePath(""); - if (dict.find("metadata") != dict.end()) { ValueMap& metadataDict = dict["metadata"].asValueMap(); @@ -677,20 +639,16 @@ bool SpriteFrameCache::reloadTexture(const std::string& plist) texturePath = metadataDict["textureFileName"].asString(); } - if (!texturePath.empty()) - { + if (!texturePath.empty()) { // build texture path relative to plist file texturePath = FileUtils::getInstance()->fullPathFromRelativeFile(texturePath, plist); - } - else - { + } else { // build texture path by replacing file extension texturePath = plist; // remove .xxx size_t startPos = texturePath.find_last_of('.'); - if(startPos != string::npos) - { + if(startPos != string::npos) { texturePath = texturePath.erase(startPos); } @@ -702,22 +660,17 @@ bool SpriteFrameCache::reloadTexture(const std::string& plist) if (Director::getInstance()->getTextureCache()->reloadTexture(texturePath)) texture = Director::getInstance()->getTextureCache()->getTextureForKey(texturePath); - if (texture) - { + if (texture) { reloadSpriteFramesWithDictionary(dict, texture, plist); - } - else - { + } else { CCLOG("cocos2d: SpriteFrameCache: Couldn't load texture"); } return true; } - void SpriteFrameCache::PlistFramesCache::insertFrame(const std::string &plist, const std::string &frame, SpriteFrame *spriteFrame) { _spriteFrames.insert(frame, spriteFrame); //add SpriteFrame - _indexPlist2Frames[plist].insert(frame); //insert index plist->[frameName] _indexFrame2plist[frame] = plist; //insert index frameName->plist } @@ -733,9 +686,10 @@ bool SpriteFrameCache::PlistFramesCache::eraseFrame(const std::string &frame) _indexPlist2Frames[plist].erase(frame); //update index plist->[frameNames] _indexFrame2plist.erase(itFrame); //update index frame->plist // erase plist index if all frames was erased - if (_indexFrame2plist.empty()) + if (_indexPlist2Frames[plist].empty()) { _indexPlist2Frames.erase(plist); + _isPlistFull.erase(plist); } return true; } @@ -749,8 +703,6 @@ bool SpriteFrameCache::PlistFramesCache::eraseFrames(const std::vectorsecond.size() > 0; -} +} SpriteFrame * SpriteFrameCache::PlistFramesCache::at(const std::string &frame) { return _spriteFrames.at(frame); } + Map& SpriteFrameCache::PlistFramesCache::getSpriteFrames() { return _spriteFrames; diff --git a/cocos/2d/CCSpriteFrameCache.h b/cocos/2d/CCSpriteFrameCache.h index f7135ed5..7627eb42 100644 --- a/cocos/2d/CCSpriteFrameCache.h +++ b/cocos/2d/CCSpriteFrameCache.h @@ -6,6 +6,7 @@ Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. +Copyright (c) 2022 cocos2d-lua.org http://www.cocos2d-x.org @@ -96,7 +97,8 @@ class CC_DLL SpriteFrameCache : public Ref public: PlistFramesCache() { } void init() { - _spriteFrames.reserve(20); clear(); + _spriteFrames.reserve(20); + clear(); } /** Record SpriteFrame with plist and frame name, add frame name * and plist to index @@ -301,7 +303,6 @@ class CC_DLL SpriteFrameCache : public Ref void reloadSpriteFramesWithDictionary(ValueMap& dictionary, Texture2D *texture, const std::string &plist); - ValueMap _spriteFramesAliases; PlistFramesCache _spriteFramesCache; }; diff --git a/cocos/2d/CCTMXLayer.cpp b/cocos/2d/CCTMXLayer.cpp index 5948602b..1bcb4d96 100644 --- a/cocos/2d/CCTMXLayer.cpp +++ b/cocos/2d/CCTMXLayer.cpp @@ -3,7 +3,7 @@ Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. Copyright (c) 2013-2016 Chukong Technologies Inc. -Copyright (c) 2020 cocos2d-lua.org +Copyright (c) 2020-2023 cocos2d-lua.org http://www.cocos2d-x.org @@ -173,10 +173,10 @@ bool TMXLayer::initWithLayerInfo(TMXObjectGroup *layerInfo, TMXTiledMap *tileMap // draw image object if ("tile" == objectType) { int gid = dict["gid"].asUnsignedInt(); - intptr_t z = getZForPos(pos); - Sprite *tile = createTileSprite(z, gid); - setupTileAnimation(tile, pos, gid); - tile->setTag(dict["id"].asUnsignedInt()); + int id = dict["id"].asInt(); + Sprite *tile = createTileSprite(id, gid); + setupTileAnimation(tile, pos, gid, id); + tile->setTag(id); tile->setUserData((void *)&dict); //for sort // fix size Size textureSize = tile->getContentSize(); @@ -251,7 +251,7 @@ bool TMXLayer::initWithLayerInfo(TMXObjectGroup *layerInfo, TMXTiledMap *tileMap label->setVisible(dict["visible"].asBool()); label->setTag(dict["id"].asUnsignedInt()); label->setUserData((void *)&dict); // for sort - } else if ("rectangle" == objectType) { + } else if ("rectangle" == objectType || "ellipse" == objectType) { if (TMXOrientationIso == _layerOrientation) { // It's a prism in cocos2d-x, need convert to polygon. Vec2 zero = getPositionForObject(Vec2(0, 0)); @@ -339,6 +339,7 @@ bool TMXLayer::initCommon(Vec2 &layerOffset, TMXTiledMap *tileMap) _layerOrientation = tileMap->getMapOrientation(); _staggerAxis = tileMap->getStaggerAxis(); _staggerIndex = tileMap->getStaggerIndex(); + _renderOrder = tileMap->getRenderOrder(); _hexSideLength = tileMap->getHexSideLength(); // offset (after layer orientation is set); @@ -382,6 +383,7 @@ TMXLayer::TMXLayer() ,_layerOrientation(TMXOrientationOrtho) ,_staggerAxis(TMXStaggerAxis_Y) ,_staggerIndex(TMXStaggerIndex_Even) +,_renderOrder(TMXRenderOrder_RightDown) ,_hexSideLength(0) ,_tileMap(nullptr) ,_layerType(TMX_LAYER_UNDEFINED) @@ -403,11 +405,11 @@ void TMXLayer::setupTiles() for (int y = 0; y < _layerSize.height; y++) { for (int x = 0; x < _layerSize.width; x++) { Vec2 pos(x, y); - intptr_t z = getZForPos(pos); - int gid = _tiles[z]; // Only support little endian stored gid + int index = getIndex(pos); + int gid = _tiles[index]; // Only support little endian stored gid if (gid != 0) { - Sprite *tile = createTileSprite(z, gid); - setupTileAnimation(tile, pos, gid); + Sprite *tile = createTileSprite(index, gid); + setupTileAnimation(tile, pos, gid, index); } } } @@ -422,7 +424,7 @@ Value TMXLayer::getProperty(const std::string& propertyName) const return Value(); } -Sprite *TMXLayer::createTileSprite(intptr_t z, uint32_t gid) +Sprite *TMXLayer::createTileSprite(int index, uint32_t gid) { TMXTilesetInfo *tileset = _tileMap->getTilesetByGID(gid); TMXTilesetImage *tilesetImage = tileset->getImageForGID(gid); @@ -431,7 +433,7 @@ Sprite *TMXLayer::createTileSprite(intptr_t z, uint32_t gid) rect = CC_RECT_PIXELS_TO_POINTS(rect); Sprite *tile = Sprite::createWithTexture(texture, rect, false, true); tile->setCameraMask(getCameraMask()); - _tileSprites.insert(std::pair(z, tile)); + _tileSprites.insert(std::pair(index, tile)); addChild(tile); return tile; } @@ -491,13 +493,13 @@ void TMXLayer::setupTileSprite(Sprite* sprite, const Vec2& pos, uint32_t gid) } // init tile's animation -void TMXLayer::setupTileAnimation(Sprite* sprite, const Vec2& pos, uint32_t gid) +void TMXLayer::setupTileAnimation(Sprite* sprite, const Vec2& pos, uint32_t gid, int index) { - intptr_t z = getZForPos(pos); - auto it = _tilesAniData.find(z); + int size = _tilesAniData.size(); + auto it = _tilesAniData.find(index); if (it != _tilesAniData.end()) { // remove old data delete it->second; - _tilesAniData.erase(z); + _tilesAniData.erase(index); } Value prop = _tileMap->getPropertiesForGID(gid); if (prop.getType() == Value::Type::MAP) { @@ -520,16 +522,18 @@ void TMXLayer::setupTileAnimation(Sprite* sprite, const Vec2& pos, uint32_t gid) gid = tileid; // real render gid } } - _tilesAniData.insert(std::pair(z, data)); + _tilesAniData.insert(std::pair(index, data)); } } setupTileSprite(sprite, pos, gid);// do for real gid // start or stop schedule - if (_tilesAniData.size() == 1) { - schedule(CC_SCHEDULE_SELECTOR(TMXLayer::tilesUpdate), 0); - } else if (_tilesAniData.size() == 0) { - unschedule(CC_SCHEDULE_SELECTOR(TMXLayer::tilesUpdate)); + if (size != _tilesAniData.size()){ + if (_tilesAniData.size() == 1) { + schedule(CC_SCHEDULE_SELECTOR(TMXLayer::tilesUpdate), 0); + } else if (_tilesAniData.size() == 0) { + unschedule(CC_SCHEDULE_SELECTOR(TMXLayer::tilesUpdate)); + } } } @@ -561,14 +565,14 @@ Sprite * TMXLayer::getTileAt(const Vec2& pos) CCASSERT(_tiles, "TMXLayer: the tiles map has been released"); CCASSERT(_layerType == TMX_LAYER_TILE, "TMXLayer: invalid layer type"); - intptr_t z = getZForPos(pos); - auto it = _tileSprites.find(z); + int index = getIndex(pos); + auto it = _tileSprites.find(index); if (it == _tileSprites.end()) { Sprite *tile = nullptr; - int gid = _tiles[z]; + int gid = _tiles[index]; if (gid != 0) { // try create it - tile = createTileSprite(z, gid); - setupTileAnimation(tile, pos, gid); + tile = createTileSprite(index, gid); + setupTileAnimation(tile, pos, gid, index); } return tile; } @@ -582,7 +586,7 @@ uint32_t TMXLayer::getTileGIDAt(const Vec2& pos, TMXTileFlags* flags/* = nullptr CCASSERT(_layerType == TMX_LAYER_TILE, "TMXLayer: invalid layer type"); // Bits on the far end of the 32-bit global tile ID are used for tile flags - uint32_t tile = _tiles[getZForPos(pos)]; + uint32_t tile = _tiles[getIndex(pos)]; // issue1264, flipped tiles can be changed dynamically if (flags) { *flags = (TMXTileFlags)(tile & kTMXFlipedAll); @@ -591,9 +595,9 @@ uint32_t TMXLayer::getTileGIDAt(const Vec2& pos, TMXTileFlags* flags/* = nullptr return (tile & kTMXFlippedMask); } -intptr_t TMXLayer::getZForPos(const Vec2& pos) const +int TMXLayer::getIndex(const Vec2& pos) const { - intptr_t z = -1; + int index = -1; int newX = pos.x; // fix correct render ordering in Hexagonal maps when stagger axis == x if (_staggerAxis == TMXStaggerAxis_X && _layerOrientation == TMXOrientationHex) { @@ -610,10 +614,10 @@ intptr_t TMXLayer::getZForPos(const Vec2& pos) const newX = pos.x * 2 + 1; } } - z = (newX + pos.y * _layerSize.width); + index = (newX + pos.y * _layerSize.width); - CCASSERT(z != -1, "Invalid Z"); - return z; + CCASSERT(index != -1, "Invalid index"); + return index; } // TMXLayer - adding / remove tiles @@ -633,19 +637,19 @@ void TMXLayer::setTileGID(uint32_t gid, const Vec2& pos, TMXTileFlags flags) if (currentGID != gid || currentFlags != flags) { uint32_t gidAndFlags = gid | flags; - intptr_t z = getZForPos(pos); + int index = getIndex(pos); Sprite *tile = nullptr; - auto it = _tileSprites.find(z); + auto it = _tileSprites.find(index); if (it != _tileSprites.end()) { tile = it->second; } if (tile) { setTileTexture(tile, gidAndFlags); } else { - tile = createTileSprite(z, gidAndFlags); + tile = createTileSprite(index, gidAndFlags); } - setupTileAnimation(tile, pos, gidAndFlags); - _tiles[z] = gidAndFlags; + setupTileAnimation(tile, pos, gidAndFlags, index); + _tiles[index] = gidAndFlags; } } @@ -655,22 +659,22 @@ void TMXLayer::removeTileAt(const Vec2& pos, bool cleanGID) CCASSERT(_tiles, "TMXLayer: the tiles map has been released"); CCASSERT(_layerType == TMX_LAYER_TILE, "TMXLayer: invalid layer type"); - intptr_t z = getZForPos(pos); - auto it = _tileSprites.find(z); + int index = getIndex(pos); + auto it = _tileSprites.find(index); if (it != _tileSprites.end()) { it->second->removeFromParent(); - _tileSprites.erase(z); + _tileSprites.erase(index); } - auto itdata = _tilesAniData.find(z); + auto itdata = _tilesAniData.find(index); if (itdata != _tilesAniData.end()) { delete itdata->second; - _tilesAniData.erase(z); + _tilesAniData.erase(index); if (_tilesAniData.size() == 0) { unschedule(CC_SCHEDULE_SELECTOR(TMXLayer::tilesUpdate)); } } if (cleanGID) { - _tiles[z] = 0; + _tiles[index] = 0; } } @@ -706,7 +710,7 @@ Vec2 TMXLayer::calculateLayerOffset(const Vec2& pos) Vec2 TMXLayer::getPositionAt(const Vec2& pos, uint32_t gid) { - int newX = pos.x; + float newX = pos.x; // fix correct render ordering in Hexagonal maps when stagger axis == x if (_staggerAxis == TMXStaggerAxis_X && _layerOrientation == TMXOrientationHex) { if (_staggerIndex == TMXStaggerIndex_Odd) { @@ -855,27 +859,34 @@ Vec2 TMXLayer::getPositionForObject(const Vec2& pos) int TMXLayer::getLocalZForPos(const Vec2& pos) const { int ret = 0; - int maxVal = 0; - switch (_layerOrientation) { - case TMXOrientationOrtho: - ret = static_cast(-(_layerSize.height - pos.y)); + int x = static_cast(pos.x); + int y = static_cast(pos.y); + int width = static_cast(_layerSize.width); + int height = static_cast(_layerSize.height); + + if (_layerOrientation == TMXOrientationIso) { + y = x + y; + width = width + height; + height = width; + } + + switch (_renderOrder) { + case TMXRenderOrder_RightDown: + ret = x + y * width; break; - case TMXOrientationIso: - maxVal = static_cast(_layerSize.width + _layerSize.height); - ret = static_cast(-(maxVal - (pos.x + pos.y))); + case TMXRenderOrder_RightUp: + ret = x + (height - y - 1) * width; break; - case TMXOrientationStaggered: - ret = static_cast(-(_layerSize.height - pos.y)); + case TMXRenderOrder_LeftDown: + ret = (width - x - 1) + y * width; break; - case TMXOrientationHex: - ret = static_cast(-(_layerSize.height - pos.y)); + case TMXRenderOrder_LeftUp: + ret = (width - x - 1) + (height - y - 1) * width; break; default: - CCASSERT(0, "TMX invalid value"); + CCASSERT(0, "TMX invalid layer render order"); break; } - -// printf("x:%d, y:%d, z:%d\n", (int)pos.x, (int)pos.y, ret); return ret; } diff --git a/cocos/2d/CCTMXLayer.h b/cocos/2d/CCTMXLayer.h index 1657412b..f6dd9af5 100644 --- a/cocos/2d/CCTMXLayer.h +++ b/cocos/2d/CCTMXLayer.h @@ -3,6 +3,7 @@ Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. Copyright (c) 2013-2016 Chukong Technologies Inc. +Copyright (c) 2020-2023 cocos2d-lua.org http://www.cocos2d-x.org @@ -200,18 +201,6 @@ class CC_DLL TMXLayer : public Node */ void setTiles(uint32_t* tiles) { _tiles = tiles; }; - /** Layer orientation, which is the same as the map orientation. - * - * @return Layer orientation, which is the same as the map orientation. - */ - int getLayerOrientation() const { return _layerOrientation; } - - /** Set layer orientation, which is the same as the map orientation. - * - * @param orientation Layer orientation,which is the same as the map orientation. - */ - void setLayerOrientation(int orientation) { _layerOrientation = orientation; } - /** Properties from the layer. They can be added using Tiled. * * @return Properties from the layer. They can be added using Tiled. @@ -243,11 +232,11 @@ class CC_DLL TMXLayer : public Node Vec2 getPositionForObject(const Vec2& pos); Vec2 calculateLayerOffset(const Vec2& offset); - intptr_t getZForPos(const Vec2& pos) const; - Sprite *createTileSprite(intptr_t z, uint32_t gid); + int getIndex(const Vec2& pos) const; + Sprite *createTileSprite(int index, uint32_t gid); void setTileTexture(Sprite* sprite, uint32_t gid); void setupTileSprite(Sprite* sprite, const Vec2& pos, uint32_t gid); - void setupTileAnimation(Sprite* sprite, const Vec2& pos, uint32_t gid); + void setupTileAnimation(Sprite* sprite, const Vec2& pos, uint32_t gid, int index); // play tile's animation void tilesUpdate(float dt); @@ -266,15 +255,17 @@ class CC_DLL TMXLayer : public Node /** pointer to the map of tiles */ uint32_t* _tiles; /** all tiles's sprite */ - std::map _tileSprites; + std::map _tileSprites; /** tiles's doing animation */ - std::map _tilesAniData; + std::map _tilesAniData; /** Layer orientation, which is the same as the map orientation */ int _layerOrientation; /** Stagger Axis */ int _staggerAxis; /** Stagger Index */ int _staggerIndex; + /** render Order */ + int _renderOrder; /** Hex side length*/ int _hexSideLength; /** properties from the layer. They can be added using Tiled */ diff --git a/cocos/2d/CCTMXTiledMap.cpp b/cocos/2d/CCTMXTiledMap.cpp index d4c3f3d1..78a69d2c 100644 --- a/cocos/2d/CCTMXTiledMap.cpp +++ b/cocos/2d/CCTMXTiledMap.cpp @@ -3,7 +3,7 @@ Copyright (c) 2009-2010 Ricardo Quesada Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. Copyright (c) 2013-2016 Chukong Technologies Inc. -Copyright (c) 2020 cocos2d-lua.org +Copyright (c) 2020-2023 cocos2d-lua.org http://www.cocos2d-x.org @@ -93,6 +93,11 @@ TMXTiledMap::TMXTiledMap() ,_tileSize(Size::ZERO) ,_tmxFile("") ,_setupTiles(true) +,_mapOrientation(TMXOrientationOrtho) +,_staggerAxis(TMXStaggerAxis_Y) +,_staggerIndex(TMXStaggerIndex_Even) +,_renderOrder(TMXRenderOrder_RightDown) +,_hexSideLength(0) { } @@ -170,6 +175,7 @@ void TMXTiledMap::buildWithMapInfo(TMXMapInfo* mapInfo) _mapOrientation = mapInfo->getOrientation(); _staggerAxis = mapInfo->getStaggerAxis(); _staggerIndex = mapInfo->getStaggerIndex(); + _renderOrder = mapInfo->getRenderOrder(); _hexSideLength = mapInfo->getHexSideLength(); _objectGroups = mapInfo->getObjectGroups(); _properties = mapInfo->getProperties(); @@ -228,7 +234,7 @@ void TMXTiledMap::buildWithMapInfo(TMXMapInfo* mapInfo) } std::string objectType = dict["objectType"].asString(); - if ("rectangle" == objectType) { + if ("rectangle" == objectType || "ellipse" == objectType) { if (gridOrientation == "isometric") { // It's a prism in cocos2d-x, need convert to polygon. Vec2 zero = getPositionForTileObject(gridOrientation, gridSize, Vec2(0, 0)); diff --git a/cocos/2d/CCTMXTiledMap.h b/cocos/2d/CCTMXTiledMap.h index e7199928..eefb0d45 100644 --- a/cocos/2d/CCTMXTiledMap.h +++ b/cocos/2d/CCTMXTiledMap.h @@ -3,7 +3,7 @@ Copyright (c) 2009-2010 Ricardo Quesada Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. Copyright (c) 2013-2016 Chukong Technologies Inc. -Copyright (c) 2020 cocos2d-lua.org +Copyright (c) 2020-2023 cocos2d-lua.org http://www.cocos2d-x.org @@ -80,6 +80,14 @@ enum TMXStaggerIndex_Even, }; +enum +{ + TMXRenderOrder_RightDown, + TMXRenderOrder_RightUp, + TMXRenderOrder_LeftDown, + TMXRenderOrder_LeftUp, +}; + /** @brief TMXTiledMap knows how to parse and render a TMX map. * It adds support for the TMX tiled map format used by http://www.mapeditor.org @@ -195,6 +203,9 @@ class CC_DLL TMXTiledMap : public Node /** Map staggerIndex */ int getStaggerIndex() const { return _staggerIndex; } void setStaggerIndex(int staggerIndex) { _staggerIndex = staggerIndex; } + /** Map renderOrder */ + int getRenderOrder() const { return _renderOrder; } + void setRenderOrder(int renderOrder) { _renderOrder = renderOrder; } /** Map hexSideLength */ int getHexSideLength() const { return _hexSideLength; } void setHexSideLength(int hexSideLength) { _hexSideLength = hexSideLength; } @@ -251,6 +262,8 @@ class CC_DLL TMXTiledMap : public Node int _staggerAxis; /** Stagger Index */ int _staggerIndex; + /** Render Order */ + int _renderOrder; /** Hex side length*/ int _hexSideLength; /** object groups */ diff --git a/cocos/2d/CCTMXXMLParser.cpp b/cocos/2d/CCTMXXMLParser.cpp index b16094dc..6c9084b9 100644 --- a/cocos/2d/CCTMXXMLParser.cpp +++ b/cocos/2d/CCTMXXMLParser.cpp @@ -4,7 +4,7 @@ Copyright (c) 2009-2010 Ricardo Quesada Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. Copyright (c) 2013-2016 Chukong Technologies Inc. -Copyright (c) 2020 cocos2d-lua.org +Copyright (c) 2020-2023 cocos2d-lua.org http://www.cocos2d-x.org @@ -227,6 +227,7 @@ TMXMapInfo::TMXMapInfo() : _orientation(TMXOrientationOrtho) , _staggerAxis(TMXStaggerAxis_Y) , _staggerIndex(TMXStaggerIndex_Even) +, _renderOrder(TMXRenderOrder_RightDown) , _hexSideLength(0) , _mapSize(Size::ZERO) , _tileSize(Size::ZERO) @@ -320,6 +321,17 @@ void TMXMapInfo::startElement(void* /*ctx*/, const char *name, const char **atts } else if (staggerIndex == "even") { _staggerIndex = TMXStaggerIndex_Even; } + + std::string renderorderStr = attributeDict["renderorder"].asString(); + if (renderorderStr == "right-down") { + _renderOrder = TMXRenderOrder_RightDown; + } else if (renderorderStr == "right-up") { + _renderOrder = TMXRenderOrder_RightUp; + } else if (renderorderStr == "left-down") { + _renderOrder = TMXRenderOrder_LeftDown; + } else if (renderorderStr == "left-up") { + _renderOrder = TMXRenderOrder_LeftUp; + } float hexSideLength = attributeDict["hexsidelength"].asFloat(); _hexSideLength = hexSideLength; @@ -482,14 +494,14 @@ void TMXMapInfo::startElement(void* /*ctx*/, const char *name, const char **atts // The parent element is now "layer" _parentElement = TMXPropertyGroup; } else if (elementName == "objectgroup") { - if (_parentElement == TMXPropertyMap) { + if (_parentElement == TMXPropertyMap || _parentElement == TMXPropertyGroup) { // ObjectGroup Layer TMXObjectGroup *objectGroup = new (std::nothrow) TMXObjectGroup(); objectGroup->setGroupName(attributeDict["name"].asString()); Vec2 positionOffset; - positionOffset.x = attributeDict["offsetx"].asFloat() * _tileSize.width; - positionOffset.y = attributeDict["offsety"].asFloat() * _tileSize.height; + positionOffset.x = attributeDict["offsetx"].asFloat(); + positionOffset.y = attributeDict["offsety"].asFloat(); objectGroup->setPositionOffset(positionOffset); Value& visibleValue = attributeDict["visible"]; diff --git a/cocos/2d/CCTMXXMLParser.h b/cocos/2d/CCTMXXMLParser.h index f433f800..79a46f06 100644 --- a/cocos/2d/CCTMXXMLParser.h +++ b/cocos/2d/CCTMXXMLParser.h @@ -3,7 +3,7 @@ Copyright (c) 2009-2010 Ricardo Quesada Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. Copyright (c) 2013-2016 Chukong Technologies Inc. -Copyright (c) 2020 cocos2d-lua.org +Copyright (c) 2020-2023 cocos2d-lua.org http://www.cocos2d-x.org @@ -245,6 +245,9 @@ class CC_DLL TMXMapInfo : public Ref, public SAXDelegator /// map stagger index int getStaggerIndex() const { return _staggerIndex; } + + /// map renderorder + int getRenderOrder() const { return _renderOrder; } /// map hexsidelength int getHexSideLength() const { return _hexSideLength; } @@ -294,6 +297,8 @@ class CC_DLL TMXMapInfo : public Ref, public SAXDelegator int _staggerAxis; ///map staggerIndex int _staggerIndex; + ///map renderorder + int _renderOrder; ///map hexsidelength int _hexSideLength; /// map width & height diff --git a/cocos/CMakeLists.txt b/cocos/CMakeLists.txt index 375fe86d..c344b3b4 100644 --- a/cocos/CMakeLists.txt +++ b/cocos/CMakeLists.txt @@ -110,7 +110,6 @@ set(COCOS_SRC cocos2d.cpp ${COCOS_NETWORK_SRC} ${COCOS_EDITOR_SUPPORT_SRC} ${COCOS_EXTENSIONS_SRC} - ${COCOS_STORAGE_SRC} ) list(APPEND COCOS_SRC ${COCOS_HEADER}) @@ -137,6 +136,7 @@ target_include_directories(cocos2d PRIVATE ${COCOS2DX_ROOT_PATH}/cocos/editor-support/fairygui PRIVATE ${COCOS2DX_ROOT_PATH}/external/libogg PRIVATE ${COCOS2DX_ROOT_PATH}/external/libvorbis + PRIVATE ${COCOS2DX_ROOT_PATH}/external/minimp3 INTERFACE ${COCOS2DX_ROOT_PATH}/cocos/base INTERFACE ${COCOS2DX_ROOT_PATH}/cocos/audio/include INTERFACE ${COCOS2DX_ROOT_PATH}/cocos/platform/${PLATFORM_FOLDER} diff --git a/cocos/audio/CMakeLists.txt b/cocos/audio/CMakeLists.txt index 46127306..08b0587b 100644 --- a/cocos/audio/CMakeLists.txt +++ b/cocos/audio/CMakeLists.txt @@ -2,10 +2,12 @@ set(AUDIO_SRC audio/RDAudio.cpp audio/RDAudioOgg.cpp audio/RDAudioAAC.cpp + audio/RDAudioMP3.cpp ) set(AUDIO_HEADER audio/RDAudio.h audio/RDAudioOgg.h audio/RDAudioAAC.h + audio/RDAudioMP3.h ) diff --git a/cocos/audio/RDAudio.cpp b/cocos/audio/RDAudio.cpp index d468b98f..14b44a6d 100644 --- a/cocos/audio/RDAudio.cpp +++ b/cocos/audio/RDAudio.cpp @@ -18,6 +18,7 @@ #include "cocos/audio/RDAudio.h" #include "cocos/audio/RDAudioOgg.h" #include "cocos/audio/RDAudioAAC.h" +#include "cocos/audio/RDAudioMP3.h" #include "cocos2d.h" // singleton stuff @@ -161,6 +162,13 @@ void RDAudio::threadLoop() &asyncStruct->channels, &asyncStruct->rate, &asyncStruct->size); + } else if (ext == ".mp3") { + rtn = decodeMP3(data.getBytes(), + data.getSize(), + &asyncStruct->pcmData, + &asyncStruct->channels, + &asyncStruct->rate, + &asyncStruct->size); } if (rtn < 0) { diff --git a/cocos/audio/RDAudioMP3.cpp b/cocos/audio/RDAudioMP3.cpp new file mode 100644 index 00000000..d4bcb999 --- /dev/null +++ b/cocos/audio/RDAudioMP3.cpp @@ -0,0 +1,56 @@ +// Copyright 2021 KeNan Liu +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include +#include +#include + +#include "RDAudioMP3.h" + +#define MINIMP3_IMPLEMENTATION +#define MINIMP3_FLOAT_OUTPUT +#include "minimp3_ex.h" + +int decodeMP3(unsigned char *mp3Data, + int mp3Size, + unsigned char **pcmData, + int *pcmChannels, + int *pcmRate, + int *pcmSize) +{ + mp3dec_t mp3d; + mp3dec_file_info_t info; + memset(&info, 0, sizeof(info)); + + int ret = mp3dec_load_buf(&mp3d, mp3Data, mp3Size, &info, 0, 0); + if(0 != ret) { + printf("error: mp3dec_load_buf %d\n", ret); + return -1; + } + + int size = info.samples * sizeof(int16_t); + int16_t* buffer = (int16_t *)malloc(size); + if (!buffer) { + printf("error: decodeMP3 not enough memory\n"); + return -1; + } + mp3dec_f32_to_s16(info.buffer, buffer, info.samples); + free(info.buffer); + + *pcmData = (unsigned char*)buffer; + *pcmChannels = info.channels; + *pcmRate = info.hz; + *pcmSize = size; + return 0; +} diff --git a/cocos/audio/RDAudioMP3.h b/cocos/audio/RDAudioMP3.h new file mode 100644 index 00000000..d5aa8db5 --- /dev/null +++ b/cocos/audio/RDAudioMP3.h @@ -0,0 +1,33 @@ +// Copyright 2021 KeNan Liu +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef __RDAudioMP3_H__ +#define __RDAudioMP3_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +int decodeMP3(unsigned char *mp3Data, + int mp3Size, + unsigned char **pcmData, + int *pcmChannels, + int *pcmRate, + int *pcmSize); + +#ifdef __cplusplus +} +#endif + +#endif // __RDAudioMP3_H__ diff --git a/cocos/base/CCDirector.cpp b/cocos/base/CCDirector.cpp index abc50fa2..ab654358 100644 --- a/cocos/base/CCDirector.cpp +++ b/cocos/base/CCDirector.cpp @@ -4,6 +4,7 @@ Copyright (c) 2010-2013 cocos2d-x.org Copyright (c) 2011 Zynga Inc. Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. +Copyright (c) 2022 cocos2d-lua.org http://www.cocos2d-x.org @@ -650,12 +651,16 @@ void Director::purgeCachedData() if (s_SharedDirector->getOpenGLView()) { - SpriteFrameCache::getInstance()->removeUnusedSpriteFrames(); + // SpriteFrame need be free by removeSpriteFramesFromFile(plist) + // removeUnusedSpriteFrames() use ref count == 1 is unsafe method for app layer. _textureCache->removeUnusedTextures(); // Note: some tests such as ActionsTest are leaking refcounted textures // There should be no test textures left in the cache - log("%s\n", _textureCache->getCachedTextureInfo().c_str()); +#if COCOS2D_DEBUG >= 1 + string info = _textureCache->getCachedTextureInfo(); + log("%s", info.c_str()); +#endif } FileUtils::getInstance()->purgeCachedEntries(); } diff --git a/cocos/base/CCEventDispatcher.cpp b/cocos/base/CCEventDispatcher.cpp index 9ab5dfce..2d163918 100644 --- a/cocos/base/CCEventDispatcher.cpp +++ b/cocos/base/CCEventDispatcher.cpp @@ -1,6 +1,7 @@ /**************************************************************************** Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. + Copyright (c) 2021 cocos2d-lua.org http://www.cocos2d-x.org @@ -35,10 +36,11 @@ #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC || CC_TARGET_PLATFORM == CC_PLATFORM_LINUX || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) #include "base/CCEventListenerController.h" #endif -#include "2d/CCScene.h" #include "base/CCDirector.h" #include "base/CCEventType.h" #include "2d/CCCamera.h" +#include "2d/CCScene.h" +#include "2d/CCProtectedNode.h" #define DUMP_LISTENER_ITEM_PRIORITY_INFO 0 @@ -224,66 +226,79 @@ EventDispatcher::~EventDispatcher() void EventDispatcher::visitTarget(Node* node, bool isRootNode) { - node->sortAllChildren(); + Node* child = nullptr; + node->sortAllChildren(); // call before get getChildren, to get right order + Vector& children = node->getChildren(); + + ProtectedNode *pNode = dynamic_cast(node); + Vector empty; // android need a var to be ref. + Vector& pchildren = empty; // avoid null ref + if (pNode) { + pNode->sortAllProtectedChildren(); // call before get getChildren, to get right order + pchildren = pNode->getProtectedChildren(); + } + // visit children zOrder < 0 int i = 0; - node->sortAllChildren(); - auto& children = node->getChildren(); - - auto childrenCount = children.size(); + for (; i < children.size(); i++ ) { + child = children.at(i); + if (child && child->getLocalZOrder() < 0) { + visitTarget(child, false); + } else { + break; + } + } - if(childrenCount > 0) - { - Node* child = nullptr; - // visit children zOrder < 0 - for( ; i < childrenCount; i++ ) - { - child = children.at(i); - - if ( child && child->getLocalZOrder() < 0 ) + // visit Protected children zOrder < 0 + int j = 0; + if (pNode) { + for (; j < pchildren.size(); j++ ) { + child = pchildren.at(j); + if (child && child->getLocalZOrder() < 0) { visitTarget(child, false); - else + } else { break; + } } - - if (_nodeListenersMap.find(node) != _nodeListenersMap.end()) - { - _globalZOrderNodeMap[node->getGlobalZOrder()].push_back(node); - } - - for( ; i < childrenCount; i++ ) - { - child = children.at(i); - if (child) + } + + // visit self + if (_nodeListenersMap.find(node) != _nodeListenersMap.end()) { + _globalZOrderNodeMap[node->getGlobalZOrder()].push_back(node); + } + + // visit Protected children zOrder >= 0 + if (pNode) { + for (; j < pchildren.size(); j++) { + child = pchildren.at(j); + if (child) { visitTarget(child, false); + } } } - else - { - if (_nodeListenersMap.find(node) != _nodeListenersMap.end()) - { - _globalZOrderNodeMap[node->getGlobalZOrder()].push_back(node); + + // visit children zOrder >= 0 + for (; i < children.size(); i++) { + child = children.at(i); + if (child) { + visitTarget(child, false); } } - - if (isRootNode) - { + + if (isRootNode) { std::vector globalZOrders; globalZOrders.reserve(_globalZOrderNodeMap.size()); - for (const auto& e : _globalZOrderNodeMap) - { + for (const auto& e : _globalZOrderNodeMap) { globalZOrders.push_back(e.first); } - std::stable_sort(globalZOrders.begin(), globalZOrders.end(), [](const float a, const float b){ + std::stable_sort(globalZOrders.begin(), globalZOrders.end(), [](const float a, const float b) { return a < b; }); - for (const auto& globalZ : globalZOrders) - { - for (const auto& n : _globalZOrderNodeMap[globalZ]) - { + for (const auto& globalZ : globalZOrders) { + for (const auto& n : _globalZOrderNodeMap[globalZ]) { _nodePriorityMap[n] = ++_nodePriorityIndex; } } diff --git a/cocos/base/CCEventMouse.cpp b/cocos/base/CCEventMouse.cpp index 8e3f17f5..4824cc90 100644 --- a/cocos/base/CCEventMouse.cpp +++ b/cocos/base/CCEventMouse.cpp @@ -33,53 +33,26 @@ EventMouse::EventMouse(MouseEventType mouseEventCode) : Event(Type::MOUSE) , _mouseEventType(mouseEventCode) , _mouseButton(MouseButton::BUTTON_UNSET) -, _x(0.0f) -, _y(0.0f) , _scrollX(0.0f) , _scrollY(0.0f) -, _startPointCaptured(false) { -}; - -// returns the current touch location in screen coordinates -Vec2 EventMouse::getLocationInView() const -{ - return _point; } -// returns the previous touch location in screen coordinates -Vec2 EventMouse::getPreviousLocationInView() const -{ - return _prevPoint; +void EventMouse::setCursorPosition(float x, float y) +{ + _point.set(x, y); } -// returns the start touch location in screen coordinates -Vec2 EventMouse::getStartLocationInView() const -{ - return _startPoint; +// returns the current touch location in screen coordinates +Vec2 EventMouse::getLocationInView() const +{ + return _point; } // returns the current touch location in OpenGL coordinates Vec2 EventMouse::getLocation() const -{ - return Director::getInstance()->convertToGL(_point); -} - -// returns the previous touch location in OpenGL coordinates -Vec2 EventMouse::getPreviousLocation() const -{ - return Director::getInstance()->convertToGL(_prevPoint); -} - -// returns the start touch location in OpenGL coordinates -Vec2 EventMouse::getStartLocation() const -{ - return Director::getInstance()->convertToGL(_startPoint); +{ + return Director::getInstance()->convertToGL(_point); } -// returns the delta position between the current location and the previous location in OpenGL coordinates -Vec2 EventMouse::getDelta() const -{ - return getLocation() - getPreviousLocation(); -} NS_CC_END diff --git a/cocos/base/CCEventMouse.h b/cocos/base/CCEventMouse.h index aa47de5a..2cde5ac0 100644 --- a/cocos/base/CCEventMouse.h +++ b/cocos/base/CCEventMouse.h @@ -69,7 +69,6 @@ class CC_DLL EventMouse : public Event BUTTON_8 = 7 }; - /** Constructor. * * @param mouseEventCode A given mouse event type. @@ -77,120 +76,65 @@ class CC_DLL EventMouse : public Event */ EventMouse(MouseEventType mouseEventCode); - /** Set mouse scroll data. + /** Set mouse scroll data. ONLY be call by GLFW * * @param scrollX The scroll data of x axis. * @param scrollY The scroll data of y axis. */ void setScrollData(float scrollX, float scrollY) { _scrollX = scrollX; _scrollY = scrollY; } + /** Get mouse scroll data of x axis. * * @return The scroll data of x axis. */ float getScrollX() const { return _scrollX; } + /** Get mouse scroll data of y axis. * * @return The scroll data of y axis. */ float getScrollY() const { return _scrollY; } - /** Set the cursor position. + /** Set the cursor position. ONLY be call by GLFW * * @param x The x coordinate of cursor position. * @param y The y coordinate of cursor position. * @js setLocation */ - void setCursorPosition(float x, float y) { - _x = x; - _y = y; - _prevPoint = _point; - _point.x = x; - _point.y = y; - if (!_startPointCaptured) - { - _startPoint = _point; - _startPointCaptured = true; - } - } - - /** Set mouse button. + void setCursorPosition(float x, float y); + + /** Set mouse button. ONLY be call by GLFW * * @param button a given mouse button. * @js setButton */ void setMouseButton(MouseButton button) { _mouseButton = button; } + /** Get mouse button. * * @return The mouse button. * @js getButton */ MouseButton getMouseButton() const { return _mouseButton; } - /** Get the cursor position of x axis. - * - * @return The x coordinate of cursor position. - * @js getLocationX - */ - float getCursorX() const { return _x; } - /** Get the cursor position of y axis. - * - * @return The y coordinate of cursor position. - * @js getLocationY - */ - float getCursorY() const { return _y; } /** Returns the current touch location in OpenGL coordinates. * * @return The current touch location in OpenGL coordinates. */ Vec2 getLocation() const; - /** Returns the previous touch location in OpenGL coordinates. - * - * @return The previous touch location in OpenGL coordinates. - * @js NA - */ - Vec2 getPreviousLocation() const; - /** Returns the start touch location in OpenGL coordinates. - * - * @return The start touch location in OpenGL coordinates. - * @js NA - */ - Vec2 getStartLocation() const; - /** Returns the delta of 2 current touches locations in screen coordinates. - * - * @return The delta of 2 current touches locations in screen coordinates. - */ - Vec2 getDelta() const; + /** Returns the current touch location in screen coordinates. * * @return The current touch location in screen coordinates. */ Vec2 getLocationInView() const; - /** Returns the previous touch location in screen coordinates. - * - * @return The previous touch location in screen coordinates. - * @js NA - */ - Vec2 getPreviousLocationInView() const; - /** Returns the start touch location in screen coordinates. - * - * @return The start touch location in screen coordinates. - * @js NA - */ - Vec2 getStartLocationInView() const; - private: MouseEventType _mouseEventType; MouseButton _mouseButton; - float _x; - float _y; float _scrollX; float _scrollY; - - bool _startPointCaptured; - Vec2 _startPoint; Vec2 _point; - Vec2 _prevPoint; friend class EventListenerMouse; }; diff --git a/cocos/base/CCEventTouch.cpp b/cocos/base/CCEventTouch.cpp index 2f2b06cb..cfa76e66 100644 --- a/cocos/base/CCEventTouch.cpp +++ b/cocos/base/CCEventTouch.cpp @@ -34,4 +34,12 @@ EventTouch::EventTouch() _touches.reserve(MAX_TOUCHES); } +void EventTouch::setTouches(const std::vector& touches) +{ + for (auto& touch : _touches) { + touch->release(); // release the touch object. + } + _touches = touches; +}; + NS_CC_END diff --git a/cocos/base/CCEventTouch.h b/cocos/base/CCEventTouch.h index 1c0598ad..ccbdc8ec 100644 --- a/cocos/base/CCEventTouch.h +++ b/cocos/base/CCEventTouch.h @@ -38,7 +38,6 @@ NS_CC_BEGIN class Touch; -#define TOUCH_PERF_DEBUG 1 /** @class EventTouch * @brief Touch event. @@ -75,7 +74,6 @@ class CC_DLL EventTouch : public Event */ const std::vector& getTouches() const { return _touches; } -#if TOUCH_PERF_DEBUG /** Set the event code. * * @param eventCode A given EventCode. @@ -85,8 +83,7 @@ class CC_DLL EventTouch : public Event * * @param touches A given touches vector. */ - void setTouches(const std::vector& touches) { _touches = touches; }; -#endif + void setTouches(const std::vector& touches); private: EventCode _eventCode; diff --git a/cocos/base/ccMacros.h b/cocos/base/ccMacros.h index 3db3d902..5e20395f 100644 --- a/cocos/base/ccMacros.h +++ b/cocos/base/ccMacros.h @@ -287,7 +287,7 @@ CC_ASSERT(__gl_error_code == GL_NO_ERROR, "Error"); \ /** https://github.com/google/protobuf/blob/master/src/google/protobuf/io/coded_stream.h **/ /******************************************************************************************/ #ifdef _MSC_VER - #if defined(_M_IX86) + #if defined(_M_IX86) || defined(_M_X64) #define CC_LITTLE_ENDIAN 1 #else #define CC_LITTLE_ENDIAN 0 diff --git a/cocos/base/ccUtils.cpp b/cocos/base/ccUtils.cpp index 85b28919..14f9b8bc 100644 --- a/cocos/base/ccUtils.cpp +++ b/cocos/base/ccUtils.cpp @@ -152,7 +152,6 @@ void captureNode(Node* startNode, std::function imageCallback, flo sprite->visit(); finalRtx->end(); } - Director::getInstance()->getRenderer()->render(); finalRtx->newImage(imageCallback); }; diff --git a/cocos/cocos2d.cpp b/cocos/cocos2d.cpp index c6eaed5d..95e9d7e6 100644 --- a/cocos/cocos2d.cpp +++ b/cocos/cocos2d.cpp @@ -4,7 +4,7 @@ Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. -Copyright (c) 2020-2021 cocos2d-lua.org +Copyright (c) 2020-2023 cocos2d-lua.org http://www.cocos2d-x.org @@ -33,7 +33,7 @@ NS_CC_BEGIN CC_DLL const char* cocos2dVersion() { - return "Cocos2d-Lua-Community 4.0.1 Release"; + return "Cocos2d-Lua-Community 4.0.5 Release"; } NS_CC_END diff --git a/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.cpp b/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.cpp index be0e600a..6d1abf07 100644 --- a/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.cpp +++ b/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.cpp @@ -1,6 +1,7 @@ /**************************************************************************** Copyright (c) 2013 cocos2d-x.org Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. +Copyright (c) 2021 cocos2d-lua.org http://www.cocos2d-x.org @@ -194,39 +195,36 @@ ActionTimeline* ActionTimeline::clone() const void ActionTimeline::step(float delta) { - if (!_playing || _timelineMap.size() == 0 || _duration == 0) - { + if (!_playing || _timelineMap.size() == 0 || _duration == 0) { return; } - _time += delta * _timeSpeed; - float deltaCurrFrameTime = std::abs(_time - _currentFrame * _frameInternal); - if (deltaCurrFrameTime < _frameInternal) - return; + + int preFrame = _currentFrame; + bool isEnd = false; + if (_startFrame > _endFrame) { // play reversed + _time -= delta * _timeSpeed; + isEnd = _time <= _endFrame* _frameInternal; + } else { + _time += delta * _timeSpeed; + isEnd = _time >= _endFrame * _frameInternal; + } + _currentFrame = (int)(_time / _frameInternal); + if (isEnd) { + _currentFrame = _endFrame; // stop at the last frame + } - const float endtoffset = _time - _endFrame * _frameInternal; - if (endtoffset < _frameInternal) - { - _currentFrame = (int)(_time / _frameInternal); - stepToFrame(_currentFrame); - emitFrameEndCallFuncs(_currentFrame); - if (endtoffset >= 0 && _lastFrameListener != nullptr) // last frame - _lastFrameListener(); + stepToFrame(_currentFrame); + for (int i = preFrame + 1; i <= _currentFrame; i++) { + emitFrameEndCallFuncs(i); } - else - { + + if (isEnd) { + if (_lastFrameListener != nullptr) + _lastFrameListener(); + _playing = _loop; if (!_playing) - { _time = _endFrame * _frameInternal; - if (_currentFrame != _endFrame) - { - _currentFrame = _endFrame; - stepToFrame(_currentFrame); - emitFrameEndCallFuncs(_currentFrame); - if (_lastFrameListener != nullptr) // last frame - _lastFrameListener(); - } - } else gotoFrameAndPlay(_startFrame, _endFrame, _loop); } diff --git a/cocos/editor-support/cocostudio/CCBone.cpp b/cocos/editor-support/cocostudio/CCBone.cpp index 1c3af054..acf27b3b 100644 --- a/cocos/editor-support/cocostudio/CCBone.cpp +++ b/cocos/editor-support/cocostudio/CCBone.cpp @@ -144,7 +144,7 @@ void Bone::setBoneData(BoneData *boneData) } _name = _boneData->name; - _setLocalZOrder(_boneData->zOrder); + _localZOrder = _boneData->zOrder; _displayManager->initDisplayList(boneData); } diff --git a/cocos/editor-support/cocostudio/CMakeLists.txt b/cocos/editor-support/cocostudio/CMakeLists.txt index 740516c7..f09df8d2 100644 --- a/cocos/editor-support/cocostudio/CMakeLists.txt +++ b/cocos/editor-support/cocostudio/CMakeLists.txt @@ -146,7 +146,6 @@ set(COCOS_CS_SRC editor-support/cocostudio/WidgetReader/LoadingBarReader/LoadingBarReader.cpp editor-support/cocostudio/WidgetReader/ListViewReader/ListViewReader.cpp editor-support/cocostudio/WidgetReader/TextFieldReader/TextFieldReader.cpp - editor-support/cocostudio/WidgetReader/WidgetReader.cpp editor-support/cocostudio/WidgetReader/CheckBoxReader/CheckBoxReader.cpp editor-support/cocostudio/WidgetReader/SliderReader/SliderReader.cpp editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.cpp @@ -174,7 +173,6 @@ set(COCOS_CS_SRC editor-support/cocostudio/ActionTimeline/CCBoneNode.cpp editor-support/cocostudio/ActionTimeline/CCSkeletonNode.cpp editor-support/cocostudio/ActionTimeline/CCSkinNode.cpp - editor-support/cocostudio/FlatBuffersSerialize.cpp editor-support/cocostudio/WidgetReader/ArmatureNodeReader/ArmatureNodeReader.cpp editor-support/cocostudio/WidgetReader/TabControlReader/TabControlReader.cpp ) diff --git a/cocos/editor-support/dragonBones/cocos2dx/CCArmatureDisplay.cpp b/cocos/editor-support/dragonBones/cocos2dx/CCArmatureDisplay.cpp index 63380d09..5e84af02 100755 --- a/cocos/editor-support/dragonBones/cocos2dx/CCArmatureDisplay.cpp +++ b/cocos/editor-support/dragonBones/cocos2dx/CCArmatureDisplay.cpp @@ -125,59 +125,15 @@ DBCCSprite* DBCCSprite::create() return sprite; } -bool DBCCSprite::_checkVisibility(const cocos2d::Mat4& transform, const cocos2d::Size& size, const cocos2d::Rect& rect) -{ - auto scene = cocos2d::Director::getInstance()->getRunningScene(); - - //If draw to Rendertexture, return true directly. - // only cull the default camera. The culling algorithm is valid for default camera. - if (!scene || (scene && scene->getDefaultCamera() != cocos2d::Camera::getVisitingCamera())) - return true; - - auto director = cocos2d::Director::getInstance(); - cocos2d::Rect visiableRect(director->getVisibleOrigin(), director->getVisibleSize()); - - // transform center point to screen space - float hSizeX = size.width / 2; - float hSizeY = size.height / 2; - - cocos2d::Vec3 v3p(hSizeX, hSizeY, 0); - - transform.transformPoint(&v3p); - cocos2d::Vec2 v2p = cocos2d::Camera::getVisitingCamera()->projectGL(v3p); - - // convert content size to world coordinates - float wshw = std::max(fabsf(hSizeX * transform.m[0] + hSizeY * transform.m[4]), fabsf(hSizeX * transform.m[0] - hSizeY * transform.m[4])); - float wshh = std::max(fabsf(hSizeX * transform.m[1] + hSizeY * transform.m[5]), fabsf(hSizeX * transform.m[1] - hSizeY * transform.m[5])); - - // enlarge visible rect half size in screen coord - visiableRect.origin.x -= wshw; - visiableRect.origin.y -= wshh; - visiableRect.size.width += wshw * 2; - visiableRect.size.height += wshh * 2; - bool ret = visiableRect.containsPoint(v2p); - return ret; -} - void DBCCSprite::draw(cocos2d::Renderer* renderer, const cocos2d::Mat4& transform, uint32_t flags) { -#if CC_USE_CULLING -#if COCOS2D_VERSION >= 0x00031400 - const auto& rect = _polyInfo.getRect(); -#else - const auto& rect = _polyInfo.rect; -#endif - - // Don't do calculate the culling if the transform was not updated +#if CC_USE_CULLING + // Don't calculate the culling if the transform was not updated auto visitingCamera = cocos2d::Camera::getVisitingCamera(); - auto defaultCamera = cocos2d::Camera::getDefaultCamera(); - if (visitingCamera == defaultCamera) { - _insideBounds = ((flags & FLAGS_TRANSFORM_DIRTY) || visitingCamera->isViewProjectionUpdated()) ? _checkVisibility(transform, _contentSize, rect) : _insideBounds; - } + if (visitingCamera == nullptr) + _insideBounds = true; else - { - _insideBounds = _checkVisibility(transform, _contentSize, rect); - } + _insideBounds = ((flags & FLAGS_TRANSFORM_DIRTY) || visitingCamera->isViewProjectionUpdated()) ? renderer->checkVisibility(transform, _contentSize) : _insideBounds; if (_insideBounds) #endif diff --git a/cocos/editor-support/dragonBones/cocos2dx/CCArmatureDisplay.h b/cocos/editor-support/dragonBones/cocos2dx/CCArmatureDisplay.h index fcb80fb7..74c83426 100755 --- a/cocos/editor-support/dragonBones/cocos2dx/CCArmatureDisplay.h +++ b/cocos/editor-support/dragonBones/cocos2dx/CCArmatureDisplay.h @@ -124,11 +124,6 @@ class DBCCSprite : public cocos2d::Sprite DBCCSprite() {} virtual ~DBCCSprite() {} - /** - * Modify for polyInfo rect - */ - bool _checkVisibility(const cocos2d::Mat4& transform, const cocos2d::Size& size, const cocos2d::Rect& rect); - public: /** * Modify for polyInfo rect diff --git a/cocos/editor-support/fairygui/Controller.cpp b/cocos/editor-support/fairygui/Controller.cpp index 62ef9fc8..ba4496b4 100644 --- a/cocos/editor-support/fairygui/Controller.cpp +++ b/cocos/editor-support/fairygui/Controller.cpp @@ -184,7 +184,7 @@ void GController::setup(ByteBuffer* buffer) { for (int i = 0; i < cnt; i++) { - int nextPos = buffer->readShort(); + int nextPos = buffer->readUshort(); nextPos += buffer->getPos(); ControllerAction* action = ControllerAction::createAction(buffer->readByte()); diff --git a/cocos/editor-support/fairygui/FieldTypes.h b/cocos/editor-support/fairygui/FieldTypes.h index 7fc71cf4..09c1c4c7 100644 --- a/cocos/editor-support/fairygui/FieldTypes.h +++ b/cocos/editor-support/fairygui/FieldTypes.h @@ -71,7 +71,7 @@ enum class ScrollType BOTH }; -enum ScrollBarDisplayType +enum class ScrollBarDisplayType { DEFAULT, VISIBLE, diff --git a/cocos/editor-support/fairygui/GComboBox.cpp b/cocos/editor-support/fairygui/GComboBox.cpp index 71b4bf4d..b9f8a43a 100644 --- a/cocos/editor-support/fairygui/GComboBox.cpp +++ b/cocos/editor-support/fairygui/GComboBox.cpp @@ -350,7 +350,7 @@ void GComboBox::setup_afterAdd(ByteBuffer* buffer, int beginPos) { if (!hasIcon) { - for (int i = 0; i < (int)_items.size() - 1; i++) + for (int j = 0; j < (int)_items.size() - 1; j++) _icons.push_back(STD_STRING_EMPTY); } _icons.push_back(*str); diff --git a/cocos/editor-support/fairygui/GComponent.cpp b/cocos/editor-support/fairygui/GComponent.cpp index 08fe166e..7c42b5e6 100644 --- a/cocos/editor-support/fairygui/GComponent.cpp +++ b/cocos/editor-support/fairygui/GComponent.cpp @@ -1193,7 +1193,7 @@ void GComponent::constructFromResource(std::vector* objectPool, int po int controllerCount = buffer->readShort(); for (int i = 0; i < controllerCount; i++) { - int nextPos = buffer->readShort(); + int nextPos = buffer->readUshort(); nextPos += buffer->getPos(); GController* controller = new GController(); @@ -1211,7 +1211,7 @@ void GComponent::constructFromResource(std::vector* objectPool, int po int childCount = buffer->readShort(); for (int i = 0; i < childCount; i++) { - int dataLen = buffer->readShort(); + int dataLen = buffer->readUshort(); int curPos = buffer->getPos(); if (objectPool != nullptr) @@ -1261,7 +1261,7 @@ void GComponent::constructFromResource(std::vector* objectPool, int po for (int i = 0; i < childCount; i++) { - int nextPos = buffer->readShort(); + int nextPos = buffer->readUshort(); nextPos += buffer->getPos(); buffer->seek(buffer->getPos(), 3); @@ -1275,7 +1275,7 @@ void GComponent::constructFromResource(std::vector* objectPool, int po for (int i = 0; i < childCount; i++) { - int nextPos = buffer->readShort(); + int nextPos = buffer->readUshort(); nextPos += buffer->getPos(); child = _children.at(i); @@ -1315,7 +1315,7 @@ void GComponent::constructFromResource(std::vector* objectPool, int po int transitionCount = buffer->readShort(); for (int i = 0; i < transitionCount; i++) { - int nextPos = buffer->readShort(); + int nextPos = buffer->readUshort(); nextPos += buffer->getPos(); Transition* trans = new Transition(this); diff --git a/cocos/editor-support/fairygui/GGraph.cpp b/cocos/editor-support/fairygui/GGraph.cpp index d31a6b61..8548ed5a 100644 --- a/cocos/editor-support/fairygui/GGraph.cpp +++ b/cocos/editor-support/fairygui/GGraph.cpp @@ -68,19 +68,7 @@ void GGraph::drawPolygon(int lineSize, const cocos2d::Color4F& lineColor, const _lineSize = lineSize; _lineColor = lineColor; _fillColor = fillColor; - if (_polygonPoints == nullptr) - _polygonPoints = new std::vector(); - else - _polygonPoints->clear(); - float h = getHeight(); - _polygonPointOffset = h; - for (int i = 0; i < count; i++) - { - Vec2 pt = *(points + i); - pt.y = h - pt.y; - _polygonPoints->push_back(*(points + i)); - } - updateShape(); + setPolygonPoints(points, count); } void GGraph::drawRegularPolygon(int lineSize, const cocos2d::Color4F& lineColor, const cocos2d::Color4F& fillColor, @@ -103,6 +91,7 @@ void GGraph::drawRegularPolygon(int lineSize, const cocos2d::Color4F& lineColor, } else if (_distances != nullptr) _distances->clear(); + updateShape(); } void GGraph::updateShape() @@ -148,7 +137,6 @@ void GGraph::updateShape() _shape->drawPolygon(_polygonPoints->data(), (int)_polygonPoints->size(), _fillColor, _lineSize * 0.5f, _lineColor); break; } - case 4: { float h = getHeight(); @@ -194,6 +182,24 @@ void GGraph::setColor(const cocos2d::Color3B& value) updateShape(); } +void GGraph::setPolygonPoints(const cocos2d::Vec2* points, int count) +{ + if (_polygonPoints == nullptr) + _polygonPoints = new std::vector(); + else + _polygonPoints->clear(); + float h = getHeight(); + _polygonPointOffset = h; + for (int i = 0; i < count; i++) + { + Vec2 pt = *(points + i); + pt.y = h - pt.y; + _polygonPoints->push_back(pt); + } + updateShape(); +} + + cocos2d::Value GGraph::getProp(ObjectPropID propId) { switch (propId) diff --git a/cocos/editor-support/fairygui/GGraph.h b/cocos/editor-support/fairygui/GGraph.h index 244b0f5e..03ddbcd3 100644 --- a/cocos/editor-support/fairygui/GGraph.h +++ b/cocos/editor-support/fairygui/GGraph.h @@ -23,7 +23,7 @@ class GGraph : public GObject cocos2d::Color3B getColor() const; void setColor(const cocos2d::Color3B& value); - + void setPolygonPoints(const cocos2d::Vec2* points, int count); virtual cocos2d::Value getProp(ObjectPropID propId) override; virtual void setProp(ObjectPropID propId, const cocos2d::Value& value) override; diff --git a/cocos/editor-support/fairygui/GList.cpp b/cocos/editor-support/fairygui/GList.cpp index ecf7705c..a1487932 100644 --- a/cocos/editor-support/fairygui/GList.cpp +++ b/cocos/editor-support/fairygui/GList.cpp @@ -56,6 +56,11 @@ GList::~GList() scrollItemToViewOnClick = false; } +void GList::setDefaultItem(const std::string& value) +{ + _defaultItem = UIPackage::normalizeURL(value); +} + void GList::setLayout(ListLayoutType value) { if (_layout != value) @@ -1082,7 +1087,6 @@ void GList::setNumItems(int value) if (_virtualListChanged != 0) CALL_LATER_CANCEL(GList, doRefreshVirtualList); - //����ˢ�� doRefreshVirtualList(); } else @@ -2484,7 +2488,7 @@ void GList::readItems(ByteBuffer* buffer) int itemCount = buffer->readShort(); for (int i = 0; i < itemCount; i++) { - int nextPos = buffer->readShort(); + int nextPos = buffer->readUshort(); nextPos += buffer->getPos(); str = buffer->readSP(); diff --git a/cocos/editor-support/fairygui/GList.h b/cocos/editor-support/fairygui/GList.h index 27bfabf0..f77e4675 100644 --- a/cocos/editor-support/fairygui/GList.h +++ b/cocos/editor-support/fairygui/GList.h @@ -20,7 +20,7 @@ class GList : public GComponent CREATE_FUNC(GList); const std::string& getDefaultItem() const { return _defaultItem; } - void setDefaultItem(const std::string& value) { _defaultItem = value; } + void setDefaultItem(const std::string& value); ListLayoutType getLayout() const { return _layout; } void setLayout(ListLayoutType value); diff --git a/cocos/editor-support/fairygui/GLoader.cpp b/cocos/editor-support/fairygui/GLoader.cpp index 9ef2c615..a30f029b 100644 --- a/cocos/editor-support/fairygui/GLoader.cpp +++ b/cocos/editor-support/fairygui/GLoader.cpp @@ -321,7 +321,7 @@ void GLoader::clearContent() if (_content2 != nullptr) { _displayObject->removeChild(_content2->displayObject()); - CC_SAFE_RELEASE(_content2); + CC_SAFE_RELEASE_NULL(_content2); } ((FUISprite*)_content)->clearContent(); diff --git a/cocos/editor-support/fairygui/GLoader3D.cpp b/cocos/editor-support/fairygui/GLoader3D.cpp index 1d7054c1..8c5e17d8 100644 --- a/cocos/editor-support/fairygui/GLoader3D.cpp +++ b/cocos/editor-support/fairygui/GLoader3D.cpp @@ -43,7 +43,7 @@ void GLoader3D::handleInit() _container = FUIContainer::create(); _container->retain(); - _container->setAnchorPoint(Vec2(0, 1)); + _container->setAnchorPoint(Vec2::ZERO); _displayObject->addChild(_container); } @@ -203,13 +203,14 @@ void GLoader3D::loadFromPackage() skeletonAni = spine::SkeletonAnimation::createWithBinaryFile(_contentItem->file, atlasFile); else skeletonAni = spine::SkeletonAnimation::createWithJsonFile(_contentItem->file, atlasFile); - skeletonAni->setPosition(_contentItem->skeletonAnchor->x, -_contentItem->skeletonAnchor->y); + skeletonAni->setPosition(_contentItem->skeletonAnchor->x, _contentItem->height-_contentItem->skeletonAnchor->y); skeletonAni->retain(); _content = skeletonAni; _container->addChild(_content); onChangeSpine(); + updateLayout(); } else { @@ -280,6 +281,11 @@ void GLoader3D::onExternalLoadFailed() void GLoader3D::clearContent() { clearErrorState(); + if (_content != nullptr) + { + _container->removeChild(_content); + CC_SAFE_RELEASE_NULL(_content); + } _contentItem = nullptr; } @@ -467,4 +473,4 @@ GObject* GLoader3D::hitTest(const Vec2& worldPoint, const Camera* camera) return nullptr; } -NS_FGUI_END \ No newline at end of file +NS_FGUI_END diff --git a/cocos/editor-support/fairygui/GMovieClip.cpp b/cocos/editor-support/fairygui/GMovieClip.cpp index bcb0001e..73fb6832 100644 --- a/cocos/editor-support/fairygui/GMovieClip.cpp +++ b/cocos/editor-support/fairygui/GMovieClip.cpp @@ -237,9 +237,6 @@ void ActionMovieClip::step(float dt) auto frames = _animation->getFrames(); int frameCount = (int)frames.size(); - if (frameCount == 0) - return; - if (frameCount == 0 || _status == 3) return; @@ -248,8 +245,6 @@ void ActionMovieClip::step(float dt) _frameElapsed += dt; float tt = (frames.at(_frame)->getDelayUnits() + ((_frame == 0 && _repeatedCount > 0) ? _repeatDelay : 0)) * _animation->getDelayPerUnit(); - if (_frame == 0 && _repeatedCount > 0) - tt += _repeatDelay; if (_frameElapsed < tt) return; @@ -387,8 +382,6 @@ void ActionMovieClip::advance(float time) while (true) { float tt = (frames.at(_frame)->getDelayUnits() + ((_frame == 0 && _repeatedCount > 0) ? _repeatDelay : 0)) * _animation->getDelayPerUnit(); - if (_frame == 0 && _repeatedCount > 0) - tt += _repeatDelay; if (time < tt) { _frameElapsed = 0; diff --git a/cocos/editor-support/fairygui/GObject.cpp b/cocos/editor-support/fairygui/GObject.cpp index 8a42eeb5..6d26d2a3 100644 --- a/cocos/editor-support/fairygui/GObject.cpp +++ b/cocos/editor-support/fairygui/GObject.cpp @@ -894,7 +894,7 @@ void GObject::setup_afterAdd(ByteBuffer* buffer, int beginPos) int cnt = buffer->readShort(); for (int i = 0; i < cnt; i++) { - int nextPos = buffer->readShort(); + int nextPos = buffer->readUshort(); nextPos += buffer->getPos(); GearBase* gear = getGear(buffer->readByte()); diff --git a/cocos/editor-support/fairygui/GProgressBar.cpp b/cocos/editor-support/fairygui/GProgressBar.cpp index 6a6441fd..2414b75d 100644 --- a/cocos/editor-support/fairygui/GProgressBar.cpp +++ b/cocos/editor-support/fairygui/GProgressBar.cpp @@ -71,11 +71,11 @@ void GProgressBar::tweenValue(double value, float duration) { double oldValule; - GTweener* twener = GTween::getTween(this, TweenPropType::Progress); - if (twener != nullptr) + GTweener* tweener = GTween::getTween(this, TweenPropType::Progress); + if (tweener != nullptr) { - oldValule = twener->value.d; - twener->kill(false); + oldValule = tweener->value.d; + tweener->kill(false); } else oldValule = _value; @@ -88,11 +88,16 @@ void GProgressBar::tweenValue(double value, float duration) void GProgressBar::update(double newValue) { - float percent; - if (_max == _min) - percent = 0; - else - percent = clampf((newValue - _min) / (_max - _min), 0, 1); + float percent = 0.0f; + if (_max > _min) { + if (newValue <= _min) { + percent = 0.0f; + } else if (newValue >= _max) { + percent = 1.0f; + } else { + percent = (newValue - _min) / (_max - _min); + } + } if (_titleObject != nullptr) { @@ -100,19 +105,19 @@ void GProgressBar::update(double newValue) switch (_titleType) { case ProgressTitleType::PERCENT: - oss << floor(percent * 100) << "%"; + oss << int(percent * 100) << "%"; break; case ProgressTitleType::VALUE_MAX: - oss << floor(newValue) << "/" << floor(_max); + oss << int(newValue) << "/" << int(_max); break; case ProgressTitleType::VALUE: - oss << floor(newValue); + oss << int(newValue); break; case ProgressTitleType::MAX: - oss << floor(_max); + oss << int(_max); break; } _titleObject->setText(oss.str()); diff --git a/cocos/editor-support/fairygui/GRoot.cpp b/cocos/editor-support/fairygui/GRoot.cpp index 65d355f5..84e8c588 100644 --- a/cocos/editor-support/fairygui/GRoot.cpp +++ b/cocos/editor-support/fairygui/GRoot.cpp @@ -30,8 +30,7 @@ GRoot* GRoot::create(Scene* scene, int zOrder) } } -GRoot::GRoot() : _windowSizeListener(nullptr), - _inputProcessor(nullptr), +GRoot::GRoot() : _inputProcessor(nullptr), _modalLayer(nullptr), _modalWaitPane(nullptr), _tooltipWin(nullptr), @@ -46,9 +45,6 @@ GRoot::~GRoot() CC_SAFE_RELEASE(_defaultTooltipWin); CC_SAFE_RELEASE(_modalLayer); CALL_LATER_CANCEL(GRoot, doShowTooltipsWin); - - if (_windowSizeListener) - Director::getInstance()->getEventDispatcher()->removeEventListener(_windowSizeListener); } void GRoot::showWindow(Window* win) @@ -535,9 +531,6 @@ bool GRoot::initWithScene(cocos2d::Scene* scene, int zOrder) _inputProcessor = new InputProcessor(this); _inputProcessor->setCaptureCallback(CC_CALLBACK_1(GRoot::onTouchEvent, this)); -#ifdef CC_PLATFORM_PC - _windowSizeListener = Director::getInstance()->getEventDispatcher()->addCustomEventListener(GLViewImpl::EVENT_WINDOW_RESIZED, CC_CALLBACK_0(GRoot::onWindowSizeChanged, this)); -#endif onWindowSizeChanged(); scene->addChild(_displayObject, zOrder); diff --git a/cocos/editor-support/fairygui/GRoot.h b/cocos/editor-support/fairygui/GRoot.h index 5b5186f2..140ae19c 100644 --- a/cocos/editor-support/fairygui/GRoot.h +++ b/cocos/editor-support/fairygui/GRoot.h @@ -81,7 +81,6 @@ class GRoot : public GComponent CALL_LATER_FUNC(GRoot, doShowTooltipsWin); - cocos2d::EventListener* _windowSizeListener; InputProcessor* _inputProcessor; GGraph* _modalLayer; diff --git a/cocos/editor-support/fairygui/GSlider.cpp b/cocos/editor-support/fairygui/GSlider.cpp index 3215da24..a6b2a53a 100644 --- a/cocos/editor-support/fairygui/GSlider.cpp +++ b/cocos/editor-support/fairygui/GSlider.cpp @@ -78,7 +78,7 @@ void GSlider::setWholeNumbers(bool value) void GSlider::update() { - float percent = MIN(_value / _max, 1); + float percent = MIN((_value - _min) / (_max - _min), 1); updateWithPercent(percent, false); } @@ -112,19 +112,19 @@ void GSlider::updateWithPercent(float percent, bool manual) switch (_titleType) { case ProgressTitleType::PERCENT: - oss << floor(percent * 100) << "%"; + oss << int(percent * 100) << "%"; break; case ProgressTitleType::VALUE_MAX: - oss << floor(_value) << "/" << floor(_max); + oss << int(_value) << "/" << int(_max); break; case ProgressTitleType::VALUE: - oss << _value; + oss << int(_value); break; case ProgressTitleType::MAX: - oss << _max; + oss << int(_max); break; } _titleObject->setText(oss.str()); diff --git a/cocos/editor-support/fairygui/GTree.cpp b/cocos/editor-support/fairygui/GTree.cpp index e896bbc1..d7cf7d4d 100644 --- a/cocos/editor-support/fairygui/GTree.cpp +++ b/cocos/editor-support/fairygui/GTree.cpp @@ -94,7 +94,12 @@ void GTree::createCell(GTreeNode* node) GComponent* child = getItemPool()->getObject(url)->as(); CCASSERT(child, "Unable to create tree cell"); child->_treeNode = node; - node->setCell(child); + if (node->_cell != child) + { + CC_SAFE_RELEASE(node->_cell); + node->_cell = child; + CC_SAFE_RETAIN(node->_cell); + } GObject* indentObj = node->_cell->getChild("indent"); if (indentObj != nullptr) @@ -366,7 +371,7 @@ void GTree::readItems(ByteBuffer* buffer) int cnt = buffer->readShort(); for (int i = 0; i < cnt; i++) { - nextPos = buffer->readShort(); + nextPos = buffer->readUshort(); nextPos += buffer->getPos(); str = buffer->readS(); diff --git a/cocos/editor-support/fairygui/GTreeNode.cpp b/cocos/editor-support/fairygui/GTreeNode.cpp index 2ff78eb1..e54d2aa7 100644 --- a/cocos/editor-support/fairygui/GTreeNode.cpp +++ b/cocos/editor-support/fairygui/GTreeNode.cpp @@ -295,16 +295,4 @@ void GTreeNode::setTree(GTree* value) } } -void GTreeNode::setCell(GComponent* value) -{ - if (_cell != value) - { - CC_SAFE_RELEASE(_cell); - _cell = value; - CC_SAFE_RETAIN(_cell); - if (_cell) - _cell->setData(this); - } -} - NS_FGUI_END diff --git a/cocos/editor-support/fairygui/GTreeNode.h b/cocos/editor-support/fairygui/GTreeNode.h index ba781dfe..1b6d9dd1 100644 --- a/cocos/editor-support/fairygui/GTreeNode.h +++ b/cocos/editor-support/fairygui/GTreeNode.h @@ -54,7 +54,6 @@ class GTreeNode : public cocos2d::Ref bool init(bool isFolder, const std::string& resURL); int moveChild(GTreeNode* child, int oldIndex, int index); void setTree(GTree* value); - void setCell(GComponent* value); GTree* _tree; GTreeNode* _parent; diff --git a/cocos/editor-support/fairygui/ScrollPane.cpp b/cocos/editor-support/fairygui/ScrollPane.cpp index f316f969..91b0772f 100644 --- a/cocos/editor-support/fairygui/ScrollPane.cpp +++ b/cocos/editor-support/fairygui/ScrollPane.cpp @@ -60,7 +60,8 @@ _yPos(0), _floating(false), _dontClipMargin(false), _mouseWheelEnabled(true), -_hover(false) +_hover(false), +_dragged(false) { _owner = owner; diff --git a/cocos/editor-support/fairygui/Transition.cpp b/cocos/editor-support/fairygui/Transition.cpp index a294f9ea..1ae2ff8f 100644 --- a/cocos/editor-support/fairygui/Transition.cpp +++ b/cocos/editor-support/fairygui/Transition.cpp @@ -1357,7 +1357,7 @@ void Transition::setup(ByteBuffer* buffer) int cnt = buffer->readShort(); for (int i = 0; i < cnt; i++) { - int dataLen = buffer->readShort(); + int dataLen = buffer->readUshort(); int curPos = buffer->getPos(); buffer->seek(curPos, 0); diff --git a/cocos/editor-support/fairygui/TranslationHelper.cpp b/cocos/editor-support/fairygui/TranslationHelper.cpp index de46e83c..0fdfbfef 100644 --- a/cocos/editor-support/fairygui/TranslationHelper.cpp +++ b/cocos/editor-support/fairygui/TranslationHelper.cpp @@ -57,7 +57,7 @@ void TranslationHelper::translateComponent(PackageItem* item) int childCount = buffer->readShort(); for (int i = 0; i < childCount; i++) { - int dataLen = buffer->readShort(); + int dataLen = buffer->readUshort(); int curPos = buffer->getPos(); buffer->seek(curPos, 0); @@ -85,7 +85,7 @@ void TranslationHelper::translateComponent(PackageItem* item) int gearCnt = buffer->readShort(); for (int j = 0; j < gearCnt; j++) { - int nextPos = buffer->readShort(); + int nextPos = buffer->readUshort(); nextPos += buffer->getPos(); if (buffer->readByte() == 6) //gearText @@ -238,7 +238,7 @@ void TranslationHelper::translateComponent(PackageItem* item) int itemCount = buffer->readShort(); for (int j = 0; j < itemCount; j++) { - int nextPos = buffer->readShort(); + int nextPos = buffer->readUshort(); nextPos += buffer->getPos(); if ((it = strings.find(elementId + "-" + Value(j).asString())) != strings.end()) diff --git a/cocos/editor-support/fairygui/UIObjectFactory.cpp b/cocos/editor-support/fairygui/UIObjectFactory.cpp index 7ebab2c5..0af49cb3 100644 --- a/cocos/editor-support/fairygui/UIObjectFactory.cpp +++ b/cocos/editor-support/fairygui/UIObjectFactory.cpp @@ -111,7 +111,7 @@ GObject* UIObjectFactory::newObject(ObjectType type) case ObjectType::TREE: return GTree::create(); - + case ObjectType::LOADER3D: return GLoader3D::create(); diff --git a/cocos/editor-support/fairygui/UIPackage.cpp b/cocos/editor-support/fairygui/UIPackage.cpp index 77af85d9..c7316190 100644 --- a/cocos/editor-support/fairygui/UIPackage.cpp +++ b/cocos/editor-support/fairygui/UIPackage.cpp @@ -513,7 +513,7 @@ bool UIPackage::loadPackage(ByteBuffer* buffer) cnt = buffer->readShort(); for (int i = 0; i < cnt; i++) { - int nextPos = buffer->readShort(); + int nextPos = buffer->readUshort(); nextPos += buffer->getPos(); const string& itemId = buffer->readS(); @@ -601,54 +601,42 @@ void* UIPackage::getItemAsset(PackageItem* item) void UIPackage::loadAtlas(PackageItem* item) { - Image* image = new Image(); -#if COCOS2D_VERSION < 0x00031702 - Image::setPNGPremultipliedAlphaEnabled(false); -#endif - if (!image->initWithImageFile(item->file)) - { - item->texture = _emptyTexture; - _emptyTexture->retain(); - delete image; -#if COCOS2D_VERSION < 0x00031702 - Image::setPNGPremultipliedAlphaEnabled(true); -#endif - CCLOGWARN("FairyGUI: texture '%s' not found in %s", item->file.c_str(), _name.c_str()); - return; - } -#if COCOS2D_VERSION < 0x00031702 - Image::setPNGPremultipliedAlphaEnabled(true); -#endif - - Texture2D* tex = new Texture2D(); - tex->initWithImage(image); - item->texture = tex; - delete image; - - string alphaFilePath; - string ext = FileUtils::getInstance()->getFileExtension(item->file); - size_t pos = item->file.find_last_of('.'); - if (pos != -1) - alphaFilePath = item->file.substr(0, pos) + "!a" + ext; - else - alphaFilePath = item->file + "!a" + ext; - - bool hasAlphaTexture = ToolSet::isFileExist(alphaFilePath); - if (hasAlphaTexture) - { - image = new Image(); - if (!image->initWithImageFile(alphaFilePath)) - { - delete image; + TextureCache* textureCache = Director::getInstance()->getTextureCache(); + Texture2D* tex = textureCache->getTextureForKey(item->file); + if (tex) { + item->texture = tex; + } else { + tex = textureCache->addImage(item->file); + if (!tex) { + item->texture = _emptyTexture; + _emptyTexture->retain(); + CCLOGWARN("FairyGUI: texture '%s' not found in %s", item->file.c_str(), _name.c_str()); return; } - - tex = new Texture2D(); - tex->initWithImage(image); - item->texture->setAlphaTexture(tex); - tex->release(); - delete image; + item->texture = tex; + + // check if has Alpha Texture + string alphaFilePath; + string ext = FileUtils::getInstance()->getFileExtension(item->file); + size_t pos = item->file.find_last_of('.'); + if (pos != -1) + alphaFilePath = item->file.substr(0, pos) + "!a" + ext; + else + alphaFilePath = item->file + "!a" + ext; + + bool hasAlphaTexture = ToolSet::isFileExist(alphaFilePath); + if (hasAlphaTexture) { + Image *image = new Image(); + if (image->initWithImageFile(alphaFilePath)) { + Texture2D *alphaTex = new Texture2D(); + alphaTex->initWithImage(image); + tex->setAlphaTexture(alphaTex); + alphaTex->release(); + } + delete image; + } } + tex->retain(); } AtlasSprite* UIPackage::getSprite(const std::string& spriteId) @@ -722,7 +710,7 @@ void UIPackage::loadMovieClip(PackageItem* item) for (int i = 0; i < frameCount; i++) { - int nextPos = buffer->readShort(); + int nextPos = buffer->readUshort(); nextPos += buffer->getPos(); Rect rect; @@ -794,7 +782,7 @@ void UIPackage::loadFont(PackageItem* item) int cnt = buffer->readInt(); for (int i = 0; i < cnt; i++) { - int nextPos = buffer->readShort(); + int nextPos = buffer->readUshort(); nextPos += buffer->getPos(); memset(&def, 0, sizeof(def)); diff --git a/cocos/editor-support/fairygui/Window.cpp b/cocos/editor-support/fairygui/Window.cpp index 4bd37d3c..1d4b40df 100644 --- a/cocos/editor-support/fairygui/Window.cpp +++ b/cocos/editor-support/fairygui/Window.cpp @@ -242,6 +242,9 @@ void Window::doHideAnimation() void Window::closeEventHandler(EventContext * context) { + if (UIConfig::onMusicCallback) { + UIConfig::onMusicCallback("closeButton"); // Use for play close btn sound. + } hide(); } diff --git a/cocos/editor-support/fairygui/display/FUILabel.cpp b/cocos/editor-support/fairygui/display/FUILabel.cpp index 809e1654..145a074a 100644 --- a/cocos/editor-support/fairygui/display/FUILabel.cpp +++ b/cocos/editor-support/fairygui/display/FUILabel.cpp @@ -98,11 +98,15 @@ void FUILabel::applyTextFormat() //else //Cant call this, cocos will do setRotationSkew(0)! // disableEffect(LabelEffect::ITALICS); - if (_textFormat->bold && _currentLabelType != LabelType::STRING_TEXTURE) + if (_textFormat->bold) enableBold(); else disableEffect(LabelEffect::BOLD); + if (_currentLabelType != LabelType::STRING_TEXTURE) { + setAdditionalKerning(_textFormat->letterSpacing); + } + setLineSpacing(_textFormat->lineSpacing); setHorizontalAlignment(_textFormat->align); setVerticalAlignment(_textFormat->verticalAlign); diff --git a/cocos/editor-support/fairygui/display/FUISprite.cpp b/cocos/editor-support/fairygui/display/FUISprite.cpp index ed0918ae..f9b4f973 100644 --- a/cocos/editor-support/fairygui/display/FUISprite.cpp +++ b/cocos/editor-support/fairygui/display/FUISprite.cpp @@ -103,9 +103,9 @@ void FUISprite::setGrayed(bool value) #if COCOS2D_VERSION >= 0x00040000 auto isETC1 = getTexture() && getTexture()->getAlphaTextureName(); if (value) { - Sprite::updateShaders(positionTextureColor_vert, (isETC1)?etc1Gray_frag:grayScale_frag); + Sprite::setProgramState(isETC1 ? backend::ProgramType::ETC1_GRAY : backend::ProgramType::GRAY_SCALE); } else { - Sprite::updateShaders(positionTextureColor_vert, (isETC1)?etc1_frag:positionTextureColor_frag); + Sprite::setProgramState(isETC1 ? backend::ProgramType::ETC1 : backend::ProgramType::POSITION_TEXTURE_COLOR); } #else GLProgramState* glState = nullptr; @@ -175,6 +175,14 @@ void FUISprite::setContentSize(const Size& size) Sprite::setContentSize(size); } +bool FUISprite::initWithSpriteFrame(SpriteFrame* spriteFrame) +{ + // calls super + bool ret = Sprite::initWithSpriteFrame(spriteFrame); + setupFill(); // need update fill display, fix by u0u0 + return ret; +} + void FUISprite::setupFill() { if (_fillMethod == FillMethod::Horizontal || _fillMethod == FillMethod::Vertical) @@ -496,18 +504,10 @@ void FUISprite::draw(cocos2d::Renderer* renderer, const cocos2d::Mat4& transform #if CC_USE_CULLING // Don't calculate the culling if the transform was not updated auto visitingCamera = Camera::getVisitingCamera(); - auto defaultCamera = Camera::getDefaultCamera(); - if (visitingCamera == nullptr) { + if (visitingCamera == nullptr) _insideBounds = true; - } - else if (visitingCamera == defaultCamera) { - _insideBounds = ((flags & FLAGS_TRANSFORM_DIRTY) || visitingCamera->isViewProjectionUpdated()) ? renderer->checkVisibility(transform, _contentSize) : _insideBounds; - } else - { - // XXX: this always return true since - _insideBounds = renderer->checkVisibility(transform, _contentSize); - } + _insideBounds = ((flags & FLAGS_TRANSFORM_DIRTY) || visitingCamera->isViewProjectionUpdated()) ? renderer->checkVisibility(transform, _contentSize) : _insideBounds; if(_insideBounds) #endif diff --git a/cocos/editor-support/fairygui/display/FUISprite.h b/cocos/editor-support/fairygui/display/FUISprite.h index 8cf1bfde..77d603b5 100644 --- a/cocos/editor-support/fairygui/display/FUISprite.h +++ b/cocos/editor-support/fairygui/display/FUISprite.h @@ -34,6 +34,7 @@ class FUISprite : public cocos2d::Sprite void setScaleByTile(bool value); virtual void setContentSize(const cocos2d::Size& size) override; + virtual bool initWithSpriteFrame(cocos2d::SpriteFrame* spriteFrame) override; protected: virtual void draw(cocos2d::Renderer *renderer, const cocos2d::Mat4 &transform, uint32_t flags) override; diff --git a/cocos/editor-support/fairygui/event/InputProcessor.cpp b/cocos/editor-support/fairygui/event/InputProcessor.cpp index e5c20838..948a1d89 100644 --- a/cocos/editor-support/fairygui/event/InputProcessor.cpp +++ b/cocos/editor-support/fairygui/event/InputProcessor.cpp @@ -286,8 +286,16 @@ GObject* InputProcessor::clickTest(TouchInfo* touch, GObject* target) return nullptr; GObject* obj = touch->downTargets[0].ptr(); - if (obj && obj->onStage()) + if (obj && obj->onStage()) { + if (touch->touch) { + auto camera = Camera::getVisitingCamera(); + Vec2 pt = touch->touch->getLocation(); + if (obj != obj->hitTest(pt, camera)) { + return nullptr; // upTarget is not same with downTarget + } + } return obj; + } obj = target; while (obj != nullptr) @@ -330,6 +338,14 @@ void InputProcessor::touchUp(cocos2d::Touch *touch, cocos2d::Event *event) onTouchEnded(touch, event); } +void InputProcessor::mouseMove(float x, float y) +{ + cocos2d::EventMouse* event = new cocos2d::EventMouse(cocos2d::EventMouse::MouseEventType::MOUSE_MOVE); + event->autorelease(); + event->setCursorPosition(x, y); + onMouseMove(event); +} + bool InputProcessor::onTouchBegan(Touch *touch, Event* /*unusedEvent*/) { if (!(_owner->isTouchable() && _owner->isVisible())) { @@ -405,7 +421,7 @@ void InputProcessor::onTouchMoved(Touch *touch, Event* /*unusedEvent*/) } } if (!done) - _owner->dispatchEvent(UIEventType::TouchMove); + target->dispatchEvent(UIEventType::TouchMove); } _activeProcessor = nullptr; @@ -529,7 +545,7 @@ void InputProcessor::onMouseDown(cocos2d::EventMouse * event) return; auto camera = Camera::getVisitingCamera(); - Vec2 pt(event->getCursorX(), event->getCursorY()); + Vec2 pt = event->getLocationInView(); GObject* target = _owner->hitTest(pt, camera); if (!target) target = _owner; @@ -559,7 +575,7 @@ void InputProcessor::onMouseUp(cocos2d::EventMouse * event) return; auto camera = Camera::getVisitingCamera(); - Vec2 pt(event->getCursorX(), event->getCursorY()); + Vec2 pt = event->getLocationInView(); GObject* target = _owner->hitTest(pt, camera); if (!target) target = _owner; @@ -620,13 +636,13 @@ void InputProcessor::onMouseUp(cocos2d::EventMouse * event) void InputProcessor::onMouseMove(cocos2d::EventMouse * event) { TouchInfo* ti = getTouch(0); - Vec2 npos = UIRoot->worldToRoot(Vec2(event->getCursorX(), event->getCursorY())); + Vec2 pt = event->getLocationInView(); + Vec2 npos = UIRoot->worldToRoot(pt); if (std::abs(ti->pos.x - npos.x) < 1 && std::abs(ti->pos.y - npos.y) < 1) return; auto camera = Camera::getVisitingCamera(); - Vec2 pt(event->getCursorX(), event->getCursorY()); GObject* target = _owner->hitTest(pt, camera); if (!target) target = _owner; @@ -660,7 +676,7 @@ void InputProcessor::onMouseMove(cocos2d::EventMouse * event) } } if (!done) - _owner->dispatchEvent(UIEventType::TouchMove); + target->dispatchEvent(UIEventType::TouchMove); } _activeProcessor = nullptr; @@ -669,7 +685,7 @@ void InputProcessor::onMouseMove(cocos2d::EventMouse * event) void InputProcessor::onMouseScroll(cocos2d::EventMouse * event) { auto camera = Camera::getVisitingCamera(); - Vec2 pt(event->getCursorX(), event->getCursorY()); + Vec2 pt = event->getLocationInView(); GObject* target = _owner->hitTest(pt, camera); if (!target) target = _owner; @@ -751,4 +767,4 @@ void TouchInfo::reset() touchMonitors.clear(); } -NS_FGUI_END \ No newline at end of file +NS_FGUI_END diff --git a/cocos/editor-support/fairygui/event/InputProcessor.h b/cocos/editor-support/fairygui/event/InputProcessor.h index 38af30bf..b8fe7ff6 100644 --- a/cocos/editor-support/fairygui/event/InputProcessor.h +++ b/cocos/editor-support/fairygui/event/InputProcessor.h @@ -36,7 +36,8 @@ class InputProcessor bool touchDown(cocos2d::Touch *touch, cocos2d::Event *event); void touchMove(cocos2d::Touch *touch, cocos2d::Event *event); void touchUp(cocos2d::Touch *touch, cocos2d::Event *event); - + void mouseMove(float x, float y); + private: bool onTouchBegan(cocos2d::Touch * touch, cocos2d::Event *); void onTouchMoved(cocos2d::Touch * touch, cocos2d::Event *); diff --git a/cocos/editor-support/fairygui/tween/TweenPropType.cpp b/cocos/editor-support/fairygui/tween/TweenPropType.cpp index ff4f24d4..861bdb1d 100644 --- a/cocos/editor-support/fairygui/tween/TweenPropType.cpp +++ b/cocos/editor-support/fairygui/tween/TweenPropType.cpp @@ -8,58 +8,57 @@ USING_NS_CC; void TweenPropTypeUtils::setProps(GObject * target, TweenPropType propType, const TweenValue & value) { - GObject* g = dynamic_cast(target); - if (g == nullptr) + if (target == nullptr) return; switch (propType) { case TweenPropType::X: - g->setX(value.x); + target->setX(value.x); break; case TweenPropType::Y: - g->setY(value.x); + target->setY(value.x); break; case TweenPropType::Position: - g->setPosition(value.x, value.y); + target->setPosition(value.x, value.y); break; case TweenPropType::Width: - g->setWidth(value.x); + target->setWidth(value.x); break; case TweenPropType::Height: - g->setHeight(value.x); + target->setHeight(value.x); break; case TweenPropType::Size: - g->setSize(value.x, value.y); + target->setSize(value.x, value.y); break; case TweenPropType::ScaleX: - g->setScaleX(value.x); + target->setScaleX(value.x); break; case TweenPropType::ScaleY: - g->setScaleY(value.x); + target->setScaleY(value.x); break; case TweenPropType::Scale: - g->setScale(value.x, value.y); + target->setScale(value.x, value.y); break; case TweenPropType::Rotation: - g->setRotation(value.x); + target->setRotation(value.x); break; case TweenPropType::Alpha: - g->setAlpha(value.x); + target->setAlpha(value.x); break; case TweenPropType::Progress: - g->as()->update(value.d); + target->as()->update(value.d); break; default: break; @@ -68,59 +67,40 @@ void TweenPropTypeUtils::setProps(GObject * target, TweenPropType propType, cons void TweenPropTypeUtils::setProps(cocos2d::Node * target, TweenPropType propType, const TweenValue & value) { - GObject* g = dynamic_cast(target); - if (g == nullptr) - return; - switch (propType) { case TweenPropType::X: - g->setX(value.x); + target->setPositionX(value.x); break; case TweenPropType::Y: - g->setY(value.x); + target->setPositionY(value.x); break; case TweenPropType::Position: - g->setPosition(value.x, value.y); - break; - - case TweenPropType::Width: - g->setWidth(value.x); - break; - - case TweenPropType::Height: - g->setHeight(value.x); - break; - - case TweenPropType::Size: - g->setSize(value.x, value.y); + target->setPosition(value.x, value.y); break; case TweenPropType::ScaleX: - g->setScaleX(value.x); + target->setScaleX(value.x); break; case TweenPropType::ScaleY: - g->setScaleY(value.x); + target->setScaleY(value.x); break; case TweenPropType::Scale: - g->setScale(value.x, value.y); + target->setScale(value.x, value.y); break; case TweenPropType::Rotation: - g->setRotation(value.x); + target->setRotation(value.x); break; case TweenPropType::Alpha: - g->setAlpha(value.x); + target->setOpacity(value.x); break; - case TweenPropType::Progress: - g->as()->update(value.d); - break; default: break; } diff --git a/cocos/editor-support/spine/AnimationState.cpp b/cocos/editor-support/spine/AnimationState.cpp index 5980ea72..6185b885 100644 --- a/cocos/editor-support/spine/AnimationState.cpp +++ b/cocos/editor-support/spine/AnimationState.cpp @@ -288,15 +288,6 @@ void EventQueue::drain() { _drainDisabled = false; } -const int Subsequent = 0; -const int First = 1; -const int HoldSubsequent = 2; -const int HoldFirst = 3; -const int HoldMix = 4; - -const int Setup = 1; -const int Current = 2; - AnimationState::AnimationState(AnimationStateData *data) : _data(data), _queue(EventQueue::newEventQueue(*this, _trackEntryPool)), diff --git a/cocos/editor-support/spine/AnimationState.h b/cocos/editor-support/spine/AnimationState.h index 8f165da5..300edf0a 100644 --- a/cocos/editor-support/spine/AnimationState.h +++ b/cocos/editor-support/spine/AnimationState.h @@ -387,6 +387,14 @@ namespace spine { void enableQueue(); private: + static const int Subsequent = 0; + static const int First = 1; + static const int HoldSubsequent = 2; + static const int HoldFirst = 3; + static const int HoldMix = 4; + + static const int Setup = 1; + static const int Current = 2; AnimationStateData* _data; diff --git a/cocos/editor-support/spine/Atlas.h b/cocos/editor-support/spine/Atlas.h index 21ec5ce9..81636616 100644 --- a/cocos/editor-support/spine/Atlas.h +++ b/cocos/editor-support/spine/Atlas.h @@ -116,7 +116,7 @@ class SP_API Atlas : public SpineObject { Vector &getPages(); Vector &getRegions(); - + private: Vector _pages; Vector _regions; diff --git a/cocos/editor-support/spine/EventData.cpp b/cocos/editor-support/spine/EventData.cpp index 6c03797b..433f03a7 100644 --- a/cocos/editor-support/spine/EventData.cpp +++ b/cocos/editor-support/spine/EventData.cpp @@ -51,7 +51,7 @@ const spine::String &spine::EventData::getName() const { return _name; } -int spine::EventData::getIntValue() { +int spine::EventData::getIntValue() const { return _intValue; } @@ -59,7 +59,7 @@ void spine::EventData::setIntValue(int inValue) { _intValue = inValue; } -float spine::EventData::getFloatValue() { +float spine::EventData::getFloatValue() const { return _floatValue; } @@ -67,7 +67,7 @@ void spine::EventData::setFloatValue(float inValue) { _floatValue = inValue; } -const spine::String &spine::EventData::getStringValue() { +const spine::String &spine::EventData::getStringValue() const { return _stringValue; } @@ -75,7 +75,7 @@ void spine::EventData::setStringValue(const spine::String &inValue) { this->_stringValue = inValue; } -const spine::String &spine::EventData::getAudioPath() { +const spine::String &spine::EventData::getAudioPath() const { return _audioPath; } @@ -84,7 +84,7 @@ void spine::EventData::setAudioPath(const spine::String &inValue) { } -float spine::EventData::getVolume() { +float spine::EventData::getVolume() const { return _volume; } @@ -92,7 +92,7 @@ void spine::EventData::setVolume(float inValue) { _volume = inValue; } -float spine::EventData::getBalance() { +float spine::EventData::getBalance() const { return _balance; } diff --git a/cocos/editor-support/spine/EventData.h b/cocos/editor-support/spine/EventData.h index 9140f54b..58770e32 100644 --- a/cocos/editor-support/spine/EventData.h +++ b/cocos/editor-support/spine/EventData.h @@ -48,27 +48,27 @@ class SP_API EventData : public SpineObject { /// The name of the event, which is unique within the skeleton. const String &getName() const; - int getIntValue(); + int getIntValue() const; void setIntValue(int inValue); - float getFloatValue(); + float getFloatValue() const; void setFloatValue(float inValue); - const String &getStringValue(); + const String &getStringValue() const; void setStringValue(const String &inValue); - const String &getAudioPath(); + const String &getAudioPath() const; void setAudioPath(const String &inValue); - float getVolume(); + float getVolume() const; void setVolume(float inValue); - float getBalance(); + float getBalance() const; void setBalance(float inValue); diff --git a/cocos/editor-support/spine/SkeletonAnimation.cpp b/cocos/editor-support/spine/SkeletonAnimation.cpp index 77f55abe..9a8f1288 100644 --- a/cocos/editor-support/spine/SkeletonAnimation.cpp +++ b/cocos/editor-support/spine/SkeletonAnimation.cpp @@ -166,6 +166,10 @@ void SkeletonAnimation::setMix (const std::string& fromAnimation, const std::str _state->getData()->setMix(fromAnimation.c_str(), toAnimation.c_str(), duration); } +void SkeletonAnimation::setDefaultMix (float duration) { + _state->getData()->setDefaultMix(duration); +} + TrackEntry* SkeletonAnimation::setAnimation (int trackIndex, const std::string& name, bool loop) { Animation* animation = _skeleton->getData()->findAnimation(name.c_str()); if (!animation) { diff --git a/cocos/editor-support/spine/SkeletonAnimation.h b/cocos/editor-support/spine/SkeletonAnimation.h index 218217bb..6d706d71 100644 --- a/cocos/editor-support/spine/SkeletonAnimation.h +++ b/cocos/editor-support/spine/SkeletonAnimation.h @@ -73,6 +73,7 @@ class SkeletonAnimation: public SkeletonRenderer { void setAnimationStateData (AnimationStateData* stateData); void setMix (const std::string& fromAnimation, const std::string& toAnimation, float duration); + void setDefaultMix (float duration); TrackEntry* setAnimation (int trackIndex, const std::string& name, bool loop); TrackEntry* addAnimation (int trackIndex, const std::string& name, bool loop, float delay = 0); diff --git a/cocos/editor-support/spine/SkeletonBinary.cpp b/cocos/editor-support/spine/SkeletonBinary.cpp index 5ba11f66..ac61ab83 100644 --- a/cocos/editor-support/spine/SkeletonBinary.cpp +++ b/cocos/editor-support/spine/SkeletonBinary.cpp @@ -98,8 +98,8 @@ SkeletonBinary::SkeletonBinary(Atlas *atlasArray) : _attachmentLoader( } -SkeletonBinary::SkeletonBinary(AttachmentLoader *attachmentLoader) : _attachmentLoader(attachmentLoader), _error(), - _scale(1), _ownsLoader(false) +SkeletonBinary::SkeletonBinary(AttachmentLoader* attachmentLoader, bool ownsLoader) : _attachmentLoader(attachmentLoader), _error(), +_scale(1), _ownsLoader(ownsLoader) { assert(_attachmentLoader != NULL); } @@ -281,8 +281,16 @@ SkeletonData *SkeletonBinary::readSkeletonData(const unsigned char *binary, cons } /* Skins. */ - for (size_t i = 0, n = (size_t)readVarint(input, true); i < n; ++i) - skeletonData->_skins.add(readSkin(input, false, skeletonData, nonessential)); + for (size_t i = 0, n = (size_t)readVarint(input, true); i < n; ++i) { + Skin* skin = readSkin(input, false, skeletonData, nonessential); + if (skin) + skeletonData->_skins.add(skin); + else { + delete input; + delete skeletonData; + return NULL; + } + } /* Linked meshes. */ for (int i = 0, n = _linkedMeshes.size(); i < n; ++i) { @@ -470,7 +478,12 @@ Skin *SkeletonBinary::readSkin(DataInput *input, bool defaultSkin, SkeletonData for (int ii = 0, nn = readVarint(input, true); ii < nn; ++ii) { String name(readStringRef(input, skeletonData)); Attachment *attachment = readAttachment(input, skin, slotIndex, name, skeletonData, nonessential); - if (attachment) skin->setAttachment(slotIndex, String(name), attachment); + if (attachment) + skin->setAttachment(slotIndex, String(name), attachment); + else { + delete skin; + return nullptr; + } } } return skin; @@ -488,6 +501,10 @@ Attachment *SkeletonBinary::readAttachment(DataInput *input, Skin *skin, int slo String path(readStringRef(input, skeletonData)); if (path.isEmpty()) path = name; RegionAttachment *region = _attachmentLoader->newRegionAttachment(*skin, String(name), String(path)); + if (!region) { + setError("Error reading attachment: ", name.buffer()); + return nullptr; + } region->_path = path; region->_rotation = readFloat(input); region->_x = readFloat(input) * _scale; @@ -504,6 +521,10 @@ Attachment *SkeletonBinary::readAttachment(DataInput *input, Skin *skin, int slo case AttachmentType_Boundingbox: { int vertexCount = readVarint(input, true); BoundingBoxAttachment *box = _attachmentLoader->newBoundingBoxAttachment(*skin, String(name)); + if (!box) { + setError("Error reading attachment: ", name.buffer()); + return nullptr; + } readVertices(input, static_cast(box), vertexCount); if (nonessential) { /* Skip color. */ @@ -519,6 +540,10 @@ Attachment *SkeletonBinary::readAttachment(DataInput *input, Skin *skin, int slo if (path.isEmpty()) path = name; mesh = _attachmentLoader->newMeshAttachment(*skin, String(name), String(path)); + if (!mesh) { + setError("Error reading attachment: ", name.buffer()); + return nullptr; + } mesh->_path = path; readColor(input, mesh->getColor()); vertexCount = readVarint(input, true); @@ -543,6 +568,10 @@ Attachment *SkeletonBinary::readAttachment(DataInput *input, Skin *skin, int slo if (path.isEmpty()) path = name; MeshAttachment *mesh = _attachmentLoader->newMeshAttachment(*skin, String(name), String(path)); + if (!mesh) { + setError("Error reading attachment: ", name.buffer()); + return nullptr; + } mesh->_path = path; readColor(input, mesh->getColor()); String skinName(readStringRef(input, skeletonData)); @@ -559,7 +588,11 @@ Attachment *SkeletonBinary::readAttachment(DataInput *input, Skin *skin, int slo return mesh; } case AttachmentType_Path: { - PathAttachment *path = _attachmentLoader->newPathAttachment(*skin, String(name)); + PathAttachment* path = _attachmentLoader->newPathAttachment(*skin, String(name)); + if (!path) { + setError("Error reading attachment: ", name.buffer()); + return nullptr; + } path->_closed = readBoolean(input); path->_constantSpeed = readBoolean(input); int vertexCount = readVarint(input, true); @@ -577,7 +610,11 @@ Attachment *SkeletonBinary::readAttachment(DataInput *input, Skin *skin, int slo return path; } case AttachmentType_Point: { - PointAttachment *point = _attachmentLoader->newPointAttachment(*skin, String(name)); + PointAttachment* point = _attachmentLoader->newPointAttachment(*skin, String(name)); + if (!point) { + setError("Error reading attachment: ", name.buffer()); + return nullptr; + } point->_rotation = readFloat(input); point->_x = readFloat(input) * _scale; point->_y = readFloat(input) * _scale; @@ -592,7 +629,11 @@ Attachment *SkeletonBinary::readAttachment(DataInput *input, Skin *skin, int slo case AttachmentType_Clipping: { int endSlotIndex = readVarint(input, true); int vertexCount = readVarint(input, true); - ClippingAttachment *clip = _attachmentLoader->newClippingAttachment(*skin, name); + ClippingAttachment* clip = _attachmentLoader->newClippingAttachment(*skin, name); + if (!clip) { + setError("Error reading attachment: ", name.buffer()); + return nullptr; + } readVertices(input, static_cast(clip), vertexCount); clip->_endSlot = skeletonData->_slots[endSlotIndex]; if (nonessential) { @@ -603,7 +644,7 @@ Attachment *SkeletonBinary::readAttachment(DataInput *input, Skin *skin, int slo return clip; } } - return NULL; + return nullptr; } void SkeletonBinary::readVertices(DataInput *input, VertexAttachment *attachment, int vertexCount) { diff --git a/cocos/editor-support/spine/SkeletonBinary.h b/cocos/editor-support/spine/SkeletonBinary.h index 88af8bd7..0a59f308 100644 --- a/cocos/editor-support/spine/SkeletonBinary.h +++ b/cocos/editor-support/spine/SkeletonBinary.h @@ -68,7 +68,7 @@ namespace spine { explicit SkeletonBinary(Atlas* atlasArray); - explicit SkeletonBinary(AttachmentLoader* attachmentLoader); + explicit SkeletonBinary(AttachmentLoader* attachmentLoader, bool ownsLoader = false); ~SkeletonBinary(); diff --git a/cocos/editor-support/spine/SkeletonJson.cpp b/cocos/editor-support/spine/SkeletonJson.cpp index 18be34c9..54f94c6a 100644 --- a/cocos/editor-support/spine/SkeletonJson.cpp +++ b/cocos/editor-support/spine/SkeletonJson.cpp @@ -84,8 +84,8 @@ SkeletonJson::SkeletonJson(Atlas *atlas) : _attachmentLoader(new(__FILE__, __LIN _scale(1), _ownsLoader(true) {} -SkeletonJson::SkeletonJson(AttachmentLoader *attachmentLoader) : _attachmentLoader(attachmentLoader), _scale(1), - _ownsLoader(false) +SkeletonJson::SkeletonJson(AttachmentLoader *attachmentLoader, bool ownsLoader) : _attachmentLoader(attachmentLoader), _scale(1), + _ownsLoader(ownsLoader) { assert(_attachmentLoader != NULL); } diff --git a/cocos/editor-support/spine/SkeletonJson.h b/cocos/editor-support/spine/SkeletonJson.h index b719855a..aeb60f5b 100644 --- a/cocos/editor-support/spine/SkeletonJson.h +++ b/cocos/editor-support/spine/SkeletonJson.h @@ -57,7 +57,7 @@ class SP_API SkeletonJson : public SpineObject { public: explicit SkeletonJson(Atlas *atlas); - explicit SkeletonJson(AttachmentLoader *attachmentLoader); + explicit SkeletonJson(AttachmentLoader *attachmentLoader, bool ownsLoader = false); ~SkeletonJson(); diff --git a/cocos/editor-support/spine/SkeletonRenderer.cpp b/cocos/editor-support/spine/SkeletonRenderer.cpp index 46d571e2..44792762 100644 --- a/cocos/editor-support/spine/SkeletonRenderer.cpp +++ b/cocos/editor-support/spine/SkeletonRenderer.cpp @@ -1029,13 +1029,14 @@ namespace { bool cullRectangle(Renderer* renderer, const Mat4& transform, const cocos2d::Rect& rect) { - if (Camera::getVisitingCamera() == nullptr) + auto camera = Camera::getVisitingCamera(); + if (camera == nullptr) return false; auto director = Director::getInstance(); auto scene = director->getRunningScene(); - if (!scene || (scene && Camera::getDefaultCamera() != Camera::getVisitingCamera())) + if (!scene) return false; Rect visibleRect(director->getVisibleOrigin(), director->getVisibleSize()); @@ -1045,11 +1046,13 @@ namespace { float hSizeY = rect.size.height/2; Vec3 v3p(rect.origin.x + hSizeX, rect.origin.y + hSizeY, 0); transform.transformPoint(&v3p); - Vec2 v2p = Camera::getVisitingCamera()->projectGL(v3p); + Vec2 v2p = camera->projectGL(v3p); // convert content size to world coordinates float wshw = std::max(fabsf(hSizeX * transform.m[0] + hSizeY * transform.m[4]), fabsf(hSizeX * transform.m[0] - hSizeY * transform.m[4])); float wshh = std::max(fabsf(hSizeX * transform.m[1] + hSizeY * transform.m[5]), fabsf(hSizeX * transform.m[1] - hSizeY * transform.m[5])); + wshw /= camera->getScaleX(); + wshh /= camera->getScaleY(); // enlarge visible rect half size in screen coord visibleRect.origin.x -= wshw; diff --git a/cocos/editor-support/spine/Slot.cpp b/cocos/editor-support/spine/Slot.cpp index bc024ec8..4edf8b76 100644 --- a/cocos/editor-support/spine/Slot.cpp +++ b/cocos/editor-support/spine/Slot.cpp @@ -55,8 +55,8 @@ Slot::Slot(SlotData &data, Bone &bone) : void Slot::setToSetupPose() { _color.set(_data.getColor()); - if (_hasDarkColor) _darkColor.set(_data.getDarkColor()); - + if (_hasDarkColor) _darkColor.set(_data.getDarkColor()); + const String &attachmentName = _data.getAttachmentName(); if (attachmentName.length() > 0) { _attachment = NULL; diff --git a/cocos/network/AsyncTCP.cpp b/cocos/network/AsyncTCP.cpp index f86d2fe0..429ee120 100755 --- a/cocos/network/AsyncTCP.cpp +++ b/cocos/network/AsyncTCP.cpp @@ -67,7 +67,7 @@ static void printErrno(const char *prefix) #endif } -static int checkIPv6(const char *hostname, bool &isIpv6) +static int getHostInfo(const char *hostname, std::string &ipAddr, bool &isIpv6) { struct addrinfo *iterator = NULL, *resolved = NULL; struct addrinfo hints; @@ -85,7 +85,7 @@ static int checkIPv6(const char *hostname, bool &isIpv6) isIpv6 = false; for (iterator = resolved; iterator; iterator = iterator->ai_next) { - char hbuf[NI_MAXHOST]; + char hbuf[NI_MAXHOST] = {0}; ret = getnameinfo(iterator->ai_addr, (socklen_t) iterator->ai_addrlen, hbuf, (socklen_t) sizeof(hbuf), NULL, 0, NI_NUMERICHOST); if (ret) { @@ -93,6 +93,7 @@ static int checkIPv6(const char *hostname, bool &isIpv6) printf("== AsyncTCP getnameinfo error:%d\n", ret); return ret; } + ipAddr = hbuf; if (iterator->ai_family == AF_INET6) { isIpv6 = true; break; @@ -242,13 +243,14 @@ void AsyncTCP::socketThread() // 1. check dns isIpv6 notify(EVENT_CONNECTING, nullptr, 0); bool isIpv6; - if (checkIPv6(_host.c_str(), isIpv6)) { + std::string ipAddr; + if (getHostInfo(_host.c_str(), ipAddr, isIpv6)) { notify(EVENT_FAILED, nullptr, 0); return; // get error in checkIPv6 } // 2. open socket - if (openTCP(isIpv6) < 0) { + if (openTCP(ipAddr, isIpv6) < 0) { closeTCP(); notify(EVENT_FAILED, nullptr, 0); return; // open error @@ -329,7 +331,7 @@ int AsyncTCP::sendTCP(unsigned char *buff, size_t size) return 0; } -int AsyncTCP::openTCP(bool isIpv6) +int AsyncTCP::openTCP(std::string &ipAddr, bool isIpv6) { int ret; @@ -365,7 +367,7 @@ int AsyncTCP::openTCP(bool isIpv6) memset(&servaddr6, 0, sizeof(servaddr6)); servaddr6.sin6_family = AF_INET6; servaddr6.sin6_port = htons(_port); - ret = inet_pton(AF_INET6, _host.c_str(), &servaddr6.sin6_addr); + ret = inet_pton(AF_INET6, ipAddr.c_str(), &servaddr6.sin6_addr); if (ret <= 0) { printErrno("inet_pton AF_INET6"); return -1; @@ -376,7 +378,7 @@ int AsyncTCP::openTCP(bool isIpv6) memset(&servaddr, 0, sizeof(servaddr)); servaddr.sin_family = AF_INET; servaddr.sin_port = htons(_port); - ret = inet_pton(AF_INET, _host.c_str(), &servaddr.sin_addr); + ret = inet_pton(AF_INET, ipAddr.c_str(), &servaddr.sin_addr); if (ret <= 0) { printErrno("inet_pton AF_INET"); return -1; diff --git a/cocos/network/AsyncTCP.h b/cocos/network/AsyncTCP.h index fd68774c..c4005bba 100755 --- a/cocos/network/AsyncTCP.h +++ b/cocos/network/AsyncTCP.h @@ -71,7 +71,7 @@ class AsyncTCP : public cocos2d::Ref void socketThread(); void notify(int state, unsigned char *msg, size_t size); // call on socketThread - int openTCP(bool isIpv6); // call on socketThread + int openTCP(std::string &ipAddr, bool isIpv6); // call on socketThread void closeTCP(); // call on socketThread int recvTCP(); // call on socketThread int sendTCP(unsigned char *buff, size_t size); // call on socketThread diff --git a/cocos/physics/CCPhysicsWorld.cpp b/cocos/physics/CCPhysicsWorld.cpp index bc4dbf56..80c4eed3 100644 --- a/cocos/physics/CCPhysicsWorld.cpp +++ b/cocos/physics/CCPhysicsWorld.cpp @@ -195,7 +195,7 @@ static void DrawCircle(cpVect p, cpFloat /*a*/, cpFloat r, cpSpaceDebugColor out const Color4F outlineColor(outline.r, outline.g, outline.b, outline.a); DrawNode* drawNode = static_cast(data); float radius = PhysicsHelper::cpfloat2float(r); - Vec2 centre = PhysicsHelper::cpv2point(p); + Vec2 center = PhysicsHelper::cpv2point(p); static const int CIRCLE_SEG_NUM = 12; Vec2 seg[CIRCLE_SEG_NUM] = {}; @@ -204,7 +204,7 @@ static void DrawCircle(cpVect p, cpFloat /*a*/, cpFloat r, cpSpaceDebugColor out { float angle = (float)i * M_PI / (float)CIRCLE_SEG_NUM * 2.0f; Vec2 d(radius * cosf(angle), radius * sinf(angle)); - seg[i] = centre + d; + seg[i] = center + d; } drawNode->drawPolygon(seg, CIRCLE_SEG_NUM, fillColor, 1, outlineColor); } diff --git a/cocos/platform/CCPlatformMacros.h b/cocos/platform/CCPlatformMacros.h index 433929df..292de0cd 100644 --- a/cocos/platform/CCPlatformMacros.h +++ b/cocos/platform/CCPlatformMacros.h @@ -296,6 +296,8 @@ private: varType varName; public: virtual inline varType get##funName() const { #elif defined(__has_attribute) #if __has_attribute(format) #define CC_FORMAT_PRINTF(formatPos, argPos) __attribute__((__format__(printf, formatPos, argPos))) + #else + #define CC_FORMAT_PRINTF(formatPos, argPos) #endif // __has_attribute(format) #else #define CC_FORMAT_PRINTF(formatPos, argPos) diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java index d07ec86f..69052b9e 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java @@ -36,11 +36,10 @@ of this software and associated documentation files (the "Software"), to deal import android.os.Message; import android.os.PowerManager; import android.preference.PreferenceManager.OnActivityResultListener; -import android.support.v4.content.ContextCompat; +import androidx.core.content.ContextCompat; import android.util.Log; import android.view.View; import android.view.ViewGroup; -import android.view.Window; import android.view.WindowManager; import android.net.Uri; import android.provider.Settings; diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxJavascriptJavaBridge.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxJavascriptJavaBridge.java deleted file mode 100644 index 6b6655e6..00000000 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxJavascriptJavaBridge.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2013-2016 Chukong Technologies Inc. - * Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -package org.cocos2dx.lib; - -public class Cocos2dxJavascriptJavaBridge { - public static native int evalString(String value); -} diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java index 93ea3e3b..f460344c 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxVideoView.java @@ -62,6 +62,7 @@ public class Cocos2dxVideoView extends SurfaceView implements MediaPlayerControl */ private int mCurrentState = STATE_IDLE; private int mTargetState = STATE_IDLE; + private boolean isComplete = false; // All the stuff we need for playing and showing a video private SurfaceHolder mSurfaceHolder = null; @@ -570,7 +571,7 @@ public void setOnErrorListener(OnErrorListener l) public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { - boolean isValidState = (mTargetState == STATE_PLAYING); + boolean isValidState = (mTargetState == STATE_PLAYING) || !isComplete; boolean hasValidSize = (mVideoWidth == w && mVideoHeight == h); if (mMediaPlayer != null && isValidState && hasValidSize) { if (mSeekWhenPrepared != 0) { @@ -590,7 +591,10 @@ public void surfaceDestroyed(SurfaceHolder holder) { // after we return from this we can't use the surface any more mSurfaceHolder = null; - + if (mMediaPlayer != null) { + isComplete = mMediaPlayer.getCurrentPosition() == mMediaPlayer.getDuration(); + mSeekWhenPrepared = mMediaPlayer.getCurrentPosition(); + } release(true); } }; diff --git a/cocos/platform/android/libcocos2dx/build.gradle b/cocos/platform/android/libcocos2dx/build.gradle index a5d921cf..37022c1e 100644 --- a/cocos/platform/android/libcocos2dx/build.gradle +++ b/cocos/platform/android/libcocos2dx/build.gradle @@ -22,9 +22,11 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } + buildToolsVersion PROP_BUILD_TOOLS_VERSION + ndkVersion PROP_NDK_VERSION } dependencies { implementation fileTree(dir: '../java/libs', include: ['*.jar']) - implementation 'com.android.support:support-v4:26.1.0' + implementation 'androidx.legacy:legacy-support-v4:1.0.0' } diff --git a/cocos/platform/apple/CCFileUtils-apple.mm b/cocos/platform/apple/CCFileUtils-apple.mm index 843a34fd..f9bb03ea 100644 --- a/cocos/platform/apple/CCFileUtils-apple.mm +++ b/cocos/platform/apple/CCFileUtils-apple.mm @@ -250,11 +250,20 @@ void static checkFilePathWithCaseSensitive(const std::string& filePath) return _writablePath; } - // save to document folder - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); +#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES); // ~/Library/Application Support +#else + NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); // ~/Document +#endif NSString *documentsDirectory = [paths objectAtIndex:0]; std::string strRet = [documentsDirectory UTF8String]; strRet.append("/"); +#if CC_TARGET_PLATFORM == CC_PLATFORM_MAC + NSString* bundle = [[[NSBundle mainBundle]infoDictionary] objectForKey:@"CFBundleIdentifier"]; + strRet += [bundle UTF8String]; + strRet.append("/"); + createDirectory(strRet); // init directory +#endif return strRet; } diff --git a/cocos/platform/desktop/CCGLViewImpl-desktop.cpp b/cocos/platform/desktop/CCGLViewImpl-desktop.cpp index fd65a79e..aafebf94 100644 --- a/cocos/platform/desktop/CCGLViewImpl-desktop.cpp +++ b/cocos/platform/desktop/CCGLViewImpl-desktop.cpp @@ -307,9 +307,7 @@ bool GLViewImpl::initWithRect(const std::string& viewName, Rect rect, float fram int neededHeight = (int)(rect.size.height * _frameZoomFactor); _mainWindow = glfwCreateWindow(neededWidth, neededHeight, _viewName.c_str(), _monitor, nullptr); - - if (_mainWindow == nullptr) - { + if (!_mainWindow) { std::string message = "Can't create window"; if (!_glfwError.empty()) { @@ -384,6 +382,10 @@ bool GLViewImpl::initWithRect(const std::string& viewName, Rect rect, float fram // setViewPortInPoints(0, 0, neededWidth, neededHeight); // #endif + + // center the window + const GLFWvidmode *mode = glfwGetVideoMode(_monitor ? _monitor : glfwGetPrimaryMonitor()); + glfwSetWindowPos(_mainWindow, (mode->width - realW) / 2, (mode->height - realH) / 2); return true; } @@ -1010,6 +1012,21 @@ static bool glew_dynamic_binding() } return true; } + +#include "GL/wglew.h" +static void setGlewSwapInterval(int value) +{ + PFNWGLGETEXTENSIONSSTRINGEXTPROC wglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)wglGetProcAddress("wglGetExtensionsStringEXT"); + if (strstr(wglGetExtensionsStringEXT(), "WGL_EXT_swap_control") == NULL) { + log("OpenGL: not support SwapInterval."); + return; // not support swap control + } + + PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)wglGetProcAddress("wglSwapIntervalEXT");; + PFNWGLGETSWAPINTERVALEXTPROC wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)wglGetProcAddress("wglGetSwapIntervalEXT"); + wglSwapIntervalEXT(value); + log("OpenGL: SwapInterval %s.", wglGetSwapIntervalEXT() == 1 ? "enabled" : "disabled"); +} #endif // helper @@ -1049,6 +1066,7 @@ bool GLViewImpl::initGlew() ccMessageBox("No OpenGL framebuffer support. Please upgrade the driver of your video card.", "OpenGL error"); return false; } + setGlewSwapInterval(1); #endif //#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) #endif //#if (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) diff --git a/cocos/platform/ios/CCEAGLView-ios.mm b/cocos/platform/ios/CCEAGLView-ios.mm index 926cdeff..e39cc14b 100644 --- a/cocos/platform/ios/CCEAGLView-ios.mm +++ b/cocos/platform/ios/CCEAGLView-ios.mm @@ -69,6 +69,7 @@ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE #import "base/CCTouch.h" #import "base/CCIMEDispatcher.h" #import "renderer/backend/metal/DeviceMTL.h" +#import "renderer/backend/metal/Utils.h" #import "platform/ios/CCInputView-ios.h" //CLASS IMPLEMENTATIONS: @@ -195,6 +196,8 @@ - (void) layoutSubviews size_.width *= self.contentScaleFactor; size_.height *= self.contentScaleFactor; + cocos2d::backend::Utils::resizeDefaultAttachmentTexture(size_.width, size_.height); + // Avoid flicker. Issue #350 if ([NSThread isMainThread]) { diff --git a/cocos/platform/mac/CCGLViewImpl-mac.mm b/cocos/platform/mac/CCGLViewImpl-mac.mm index d67a9862..ab11abcf 100644 --- a/cocos/platform/mac/CCGLViewImpl-mac.mm +++ b/cocos/platform/mac/CCGLViewImpl-mac.mm @@ -306,9 +306,7 @@ of this software and associated documentation files (the "Software"), to deal int neededHeight = rect.size.height * _frameZoomFactor; _mainWindow = glfwCreateWindow(neededWidth, neededHeight, _viewName.c_str(), _monitor, nullptr); - - if (_mainWindow == nullptr) - { + if (!_mainWindow) { std::string message = "Can't create window"; if (!_glfwError.empty()) { @@ -378,7 +376,9 @@ of this software and associated documentation files (the "Software"), to deal glfwSetWindowFocusCallback(_mainWindow, GLFWEventHandler::onGLFWWindowFocusCallback); setFrameSize(rect.size.width, rect.size.height); - + // center the window + const GLFWvidmode *mode = glfwGetVideoMode(_monitor ? _monitor : glfwGetPrimaryMonitor()); + glfwSetWindowPos(_mainWindow, (mode->width - realW) / 2, (mode->height - realH) / 2); return true; } @@ -496,7 +496,7 @@ of this software and associated documentation files (the "Software"), to deal GLFWwindow* window = this->getWindow(); glfwSetWindowIcon(window, iconsCount, images); - CC_SAFE_DELETE(images); + CC_SAFE_DELETE_ARRAY(images); for (auto& icon: icons) { CC_SAFE_DELETE(icon); } diff --git a/cocos/platform/win32/CCApplication-win32.cpp b/cocos/platform/win32/CCApplication-win32.cpp index 7b23dcab..af011f35 100644 --- a/cocos/platform/win32/CCApplication-win32.cpp +++ b/cocos/platform/win32/CCApplication-win32.cpp @@ -45,7 +45,6 @@ Application::Application() , _accelTable(nullptr) { _instance = GetModuleHandle(nullptr); - _animationInterval.QuadPart = 0; CC_ASSERT(! sm_pSharedApplication); sm_pSharedApplication = this; } @@ -72,12 +71,6 @@ int Application::run() timeBeginPeriod(wTimerRes); } - // Main message loop: - LARGE_INTEGER nLast; - LARGE_INTEGER nNow; - - QueryPerformanceCounter(&nLast); - initGLContextAttrs(); // Initialize instance and cocos2d. @@ -92,33 +85,13 @@ int Application::run() // Retain glview to avoid glview being released in the while loop glview->retain(); - LONGLONG interval = 0LL; - LONG waitMS = 0L; - - LARGE_INTEGER freq; - QueryPerformanceFrequency(&freq); - while(!glview->windowShouldClose()) { - QueryPerformanceCounter(&nNow); - interval = nNow.QuadPart - nLast.QuadPart; - if (interval >= _animationInterval.QuadPart) - { - nLast.QuadPart = nNow.QuadPart; - director->mainLoop(); - glview->pollEvents(); - } - else - { - // The precision of timer on Windows is set to highest (1ms) by 'timeBeginPeriod' from above code, - // but it's still not precise enough. For example, if the precision of timer is 1ms, - // Sleep(3) may make a sleep of 2ms or 4ms. Therefore, we subtract 1ms here to make Sleep time shorter. - // If 'waitMS' is equal or less than 1ms, don't sleep and run into next loop to - // boost CPU to next frame accurately. - waitMS = static_cast((_animationInterval.QuadPart - interval) * 1000LL / freq.QuadPart - 1L); - if (waitMS > 1L) - Sleep(waitMS); - } + // frame controll by glew SwapInterval. + // boost to fill swapbuffer, avoid frame skipping by not fill in time. + // refer to setGlewSwapInterval(1); + director->mainLoop(); + glview->pollEvents(); } // Director should still do a cleanup if the window was closed manually. @@ -142,9 +115,7 @@ int Application::run() void Application::setAnimationInterval(float interval) { - LARGE_INTEGER freq; - QueryPerformanceFrequency(&freq); - _animationInterval.QuadPart = (LONGLONG)(interval * freq.QuadPart); + // not support, controll by SwapInterval. } ////////////////////////////////////////////////////////////////////////// diff --git a/cocos/platform/win32/CCApplication-win32.h b/cocos/platform/win32/CCApplication-win32.h index d750fe77..e2e4dd0f 100644 --- a/cocos/platform/win32/CCApplication-win32.h +++ b/cocos/platform/win32/CCApplication-win32.h @@ -102,7 +102,6 @@ class CC_DLL Application : public ApplicationProtocol protected: HINSTANCE _instance; HACCEL _accelTable; - LARGE_INTEGER _animationInterval; std::string _resourceRootPath; std::string _startupScriptFilename; diff --git a/cocos/platform/win32/CCDevice-win32.cpp b/cocos/platform/win32/CCDevice-win32.cpp index 4db28594..a8a478c2 100644 --- a/cocos/platform/win32/CCDevice-win32.cpp +++ b/cocos/platform/win32/CCDevice-win32.cpp @@ -2,6 +2,7 @@ Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. +Copyright (c) 2021 cocos2d-lua.org http://www.cocos2d-x.org @@ -93,7 +94,6 @@ class BitmapDC pwszBuffer[nLen] = '\0'; } while (0); return pwszBuffer; - } bool setFont(const char * pFontName = nullptr, int nSize = 0, bool enableBold = false) @@ -521,22 +521,100 @@ Data Device::getTextureDataForText(const char * text, const FontDefinition& text GetDIBits(dc.getDC(), dc.getBitmap(), 0, height, dataBuf, (LPBITMAPINFO)&bi, DIB_RGB_COLORS); - COLORREF textColor = (textDefinition._fontFillColor.b << 16 | textDefinition._fontFillColor.g << 8 | textDefinition._fontFillColor.r) & 0x00ffffff; - float alpha = textDefinition._fontAlpha / 255.0f; - COLORREF * pPixel = nullptr; - for (int y = 0; y < height; ++y) - { - pPixel = (COLORREF *)dataBuf + y * width; - for (int x = 0; x < width; ++x) - { - COLORREF& clr = *pPixel; - clr = ((BYTE)(GetRValue(clr) * alpha) << 24) | textColor; - ++pPixel; + BYTE srcRed = textDefinition._fontFillColor.r; + BYTE srcGreen = textDefinition._fontFillColor.g; + BYTE srcBlue = textDefinition._fontFillColor.b; + float srcAlphaScale = textDefinition._fontAlpha / 255.0f; + + COLORREF* pPixel = nullptr; + bool isDone = false; + if (textDefinition._stroke._strokeSize > 0.0f) { + BYTE dstRed = textDefinition._stroke._strokeColor.r; + BYTE dstGreen = textDefinition._stroke._strokeColor.g; + BYTE dstBlue = textDefinition._stroke._strokeColor.b; + float dstAlphaScale = textDefinition._stroke._strokeAlpha / 255.0f; + + int newWidth = width + 2; + int newHeight = height + 2; + int newLen = newWidth * newHeight * 4; + unsigned char* newBuf = (unsigned char*)malloc(sizeof(unsigned char) * newLen); + + if (newBuf) { + // walk newBuf pixel + for (int j = 0; j < newHeight; ++j) { + for (int i = 0; i < newWidth; ++i) { + // convert to dataBuf pixel + int x = i - 1; + int y = j - 1; + // get the max alpha value of four corners pixel + BYTE dstAlpha = 0; // outline alpha + if (y - 1 >= 0) { + pPixel = (COLORREF*)dataBuf + (y - 1) * width; + if (x - 1 >= 0) { + dstAlpha = MAX(dstAlpha, (BYTE)(GetRValue(*(pPixel + x - 1)))); + } + if (x + 1 < width) { + dstAlpha = MAX(dstAlpha, (BYTE)(GetRValue(*(pPixel + x + 1)))); + } + } + if (y + 1 < height) { + pPixel = (COLORREF*)dataBuf + (y + 1) * width; + if (x - 1 >= 0) { + dstAlpha = MAX(dstAlpha, (BYTE)(GetRValue(*(pPixel + x - 1)))); + } + if (x + 1 < width) { + dstAlpha = MAX(dstAlpha, (BYTE)(GetRValue(*(pPixel + x + 1)))); + } + } + // get center alpha, use for src alpha + BYTE srcAlpha = 0; + if (x >= 0 && x < width && y >= 0 && y < height) { + pPixel = (COLORREF*)dataBuf + y * width + x; + srcAlpha = (BYTE)(GetRValue(*pPixel)); + } + // multi with scale factor for alpha + srcAlpha *= srcAlphaScale; + dstAlpha *= dstAlphaScale; + // srcColor blending to dstColor + float srcFactor = srcAlpha / 255.0f; // GL_SRC_ALPHA + float dstFactor = 1.0f - srcFactor; // GL_ONE_MINUS_SRC_ALPHA + pPixel = (COLORREF*)newBuf + j * newWidth + i; + BYTE pixelAlpha = (BYTE)(srcAlpha * srcFactor + dstAlpha * dstFactor); + if (pixelAlpha > 0) { + *pPixel = pixelAlpha << 24 + | (BYTE)(srcBlue * srcFactor + dstBlue * dstFactor) << 16 + | (BYTE)(srcGreen * srcFactor + dstGreen * dstFactor) << 8 + | (BYTE)(srcRed * srcFactor + dstRed * dstFactor); + } else { + *pPixel = 0; // Premultiplied need zero to transparent + } + } + } + + // return the outlined buffer + isDone = true; // mark filled + free(dataBuf); + dataBuf = newBuf; + dataLen = newLen; + width = newWidth; + height = newHeight; + hasPremultipliedAlpha = true; + } + } + + if (!isDone) { + COLORREF rgb = (srcBlue << 16 | srcGreen << 8 | srcRed) & 0x00ffffff; + for (int y = 0; y < height; ++y) { + pPixel = (COLORREF*)dataBuf + y * width; + for (int x = 0; x < width; ++x) { + COLORREF& clr = *(pPixel + x); + clr = ((BYTE)(GetRValue(clr) * srcAlphaScale) << 24) | rgb; + } } + hasPremultipliedAlpha = false; } ret.fastSet(dataBuf, dataLen); - hasPremultipliedAlpha = false; } while (0); return ret; diff --git a/cocos/platform/win32/CCFileUtils-win32.cpp b/cocos/platform/win32/CCFileUtils-win32.cpp index 2349f3eb..74803bfa 100644 --- a/cocos/platform/win32/CCFileUtils-win32.cpp +++ b/cocos/platform/win32/CCFileUtils-win32.cpp @@ -155,7 +155,7 @@ bool FileUtilsWin32::isFileExistInternal(const std::string& strFilePath) const return false; // not a file } else { WIN32_FIND_DATAA ffd; - HANDLE hFind = FindFirstFileA(strPath.c_str(), &ffd); + HANDLE hFind = FindFirstFileA(getSuitableFOpen(strPath).c_str(), &ffd); if (hFind != INVALID_HANDLE_VALUE) { FindClose(hFind); } @@ -221,6 +221,28 @@ FileUtils::Status FileUtilsWin32::getContents(const std::string& filename, Resiz return FileUtils::Status::OK; } +// override to set file create time, windows need do it manually. +bool FileUtilsWin32::writeDataToFile(const Data& data, const std::string& fullPath) const { + // https://docs.microsoft.com/en-us/windows/win32/sysinfo/changing-a-file-time-to-the-current-time + HANDLE fileHandle = ::CreateFile(StringUtf8ToWideChar(fullPath).c_str(), GENERIC_WRITE | FILE_WRITE_ATTRIBUTES, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr); + if (fileHandle == INVALID_HANDLE_VALUE) + return false; + + DWORD dwWrited; + ::WriteFile(fileHandle, data.getBytes(), data.getSize(), &dwWrited, NULL); + + FILETIME ft; + SYSTEMTIME st; + BOOL f; + + ::GetSystemTime(&st); // Gets the current system time + ::SystemTimeToFileTime(&st, &ft); // Converts the current system time to file time format + f = ::SetFileTime(fileHandle, &ft, &ft, &ft); + + ::CloseHandle(fileHandle); + return f; +} + std::string FileUtilsWin32::getPathForFilename(const std::string& filename, const std::string& resolutionDirectory, const std::string& searchPath) const { std::string unixFileName = convertPathFormatToUnixStyle(filename); @@ -384,7 +406,16 @@ string FileUtilsWin32::getWritablePath() const retPath = retPath.substr(0, retPath.rfind(L"\\") + 1); } - return convertPathFormatToUnixStyle(StringWideCharToUtf8(retPath)); + // convert WCHAR with CP_ACP to UTF8 + std::string ret; + int nNum = WideCharToMultiByte(CP_ACP, 0, retPath.c_str(), -1, nullptr, 0, nullptr, FALSE); + char* utf8String = new char[nNum + 1]; + utf8String[0] = 0; + nNum = WideCharToMultiByte(CP_ACP, 0, retPath.c_str(), -1, utf8String, nNum + 1, nullptr, FALSE); + ret = utf8String; + delete[] utf8String; + + return convertPathFormatToUnixStyle(ret); } bool FileUtilsWin32::renameFile(const std::string &oldfullpath, const std::string& newfullpath) const @@ -543,5 +574,4 @@ bool FileUtilsWin32::removeDirectory(const std::string& dirPath) const } return false; } - NS_CC_END diff --git a/cocos/platform/win32/CCFileUtils-win32.h b/cocos/platform/win32/CCFileUtils-win32.h index b64cab3b..bd43e057 100644 --- a/cocos/platform/win32/CCFileUtils-win32.h +++ b/cocos/platform/win32/CCFileUtils-win32.h @@ -51,6 +51,7 @@ class CC_DLL FileUtilsWin32 : public FileUtils virtual bool isAbsolutePath(const std::string& strPath) const override; virtual std::string getSuitableFOpen(const std::string& filenameUtf8) const override; virtual long getFileSize(const std::string &filepath); + virtual bool writeDataToFile(const Data& data, const std::string& fullPath) const override; protected: virtual bool isFileExistInternal(const std::string& strFilePath) const override; diff --git a/cocos/platform/win32/CCStdC-win32.h b/cocos/platform/win32/CCStdC-win32.h index 45114e86..764488f5 100644 --- a/cocos/platform/win32/CCStdC-win32.h +++ b/cocos/platform/win32/CCStdC-win32.h @@ -47,12 +47,6 @@ typedef SSIZE_T ssize_t; #endif #endif -#if _MSC_VER < 1900 -#ifndef snprintf -#define snprintf _snprintf -#endif -#endif - #endif // __MINGW32__ #include @@ -62,6 +56,12 @@ typedef SSIZE_T ssize_t; #include #include +#ifndef __MINGW32__ +#ifndef snprintf +#define snprintf _snprintf // must after #include , _snprintf is safty +#endif +#endif // __MINGW32__ + #ifndef M_PI #define M_PI 3.14159265358 #endif diff --git a/cocos/renderer/CCRenderer.cpp b/cocos/renderer/CCRenderer.cpp index 4e81ec3d..c12e08d3 100644 --- a/cocos/renderer/CCRenderer.cpp +++ b/cocos/renderer/CCRenderer.cpp @@ -1,6 +1,7 @@ /**************************************************************************** Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. + Copyright (c) 2021 cocos2d-lua.org http://www.cocos2d-x.org @@ -377,10 +378,12 @@ void Renderer::render() void Renderer::beginFrame() { _commandBuffer->beginFrame(); + _isBeginFrame = true; } void Renderer::endFrame() { + _isBeginFrame = false; _commandBuffer->endFrame(); #ifdef CC_USE_METAL @@ -721,11 +724,10 @@ bool Renderer::checkVisibility(const Mat4 &transform, const Size &size) { auto director = Director::getInstance(); auto scene = director->getRunningScene(); + auto camera = Camera::getVisitingCamera(); //If draw to Rendertexture, return true directly. - // only cull the default camera. The culling algorithm is valid for default camera. - if (!scene || (scene && scene->_defaultCamera != Camera::getVisitingCamera())) - return true; + if (!scene) return true; Rect visibleRect(director->getVisibleOrigin(), director->getVisibleSize()); @@ -734,11 +736,13 @@ bool Renderer::checkVisibility(const Mat4 &transform, const Size &size) float hSizeY = size.height/2; Vec3 v3p(hSizeX, hSizeY, 0); transform.transformPoint(&v3p); - Vec2 v2p = Camera::getVisitingCamera()->projectGL(v3p); + Vec2 v2p = camera->projectGL(v3p); // convert content size to world coordinates float wshw = std::max(fabsf(hSizeX * transform.m[0] + hSizeY * transform.m[4]), fabsf(hSizeX * transform.m[0] - hSizeY * transform.m[4])); float wshh = std::max(fabsf(hSizeX * transform.m[1] + hSizeY * transform.m[5]), fabsf(hSizeX * transform.m[1] - hSizeY * transform.m[5])); + wshw /= camera->getScaleX(); + wshh /= camera->getScaleY(); // enlarge visible rect half size in screen coord visibleRect.origin.x -= wshw; diff --git a/cocos/renderer/CCRenderer.h b/cocos/renderer/CCRenderer.h index 97624587..a1085e57 100644 --- a/cocos/renderer/CCRenderer.h +++ b/cocos/renderer/CCRenderer.h @@ -405,6 +405,10 @@ class CC_DLL Renderer /** returns whether or not a rectangle is visible or not */ bool checkVisibility(const Mat4& transform, const Size& size); + bool isBeginFrame() { return _isBeginFrame;}; + void beginFrame(); /// Indicate the begining of a frame + void endFrame(); /// Finish a frame. + protected: friend class Director; friend class GroupCommand; @@ -452,9 +456,6 @@ class CC_DLL Renderer void drawMeshCommand(RenderCommand* command); void captureScreen(RenderCommand* command); - void beginFrame(); /// Indicate the begining of a frame - void endFrame(); /// Finish a frame. - ///Draw the previews queued triangles and flush previous context void flush(); @@ -532,6 +533,7 @@ class CC_DLL Renderer //the flag for checking whether renderer is rendering bool _isRendering = false; bool _isDepthTestFor2D = false; + bool _isBeginFrame = false; GroupCommandManager* _groupCommandManager = nullptr; diff --git a/cocos/renderer/CCTexture2D.cpp b/cocos/renderer/CCTexture2D.cpp index 921397bc..2eeff103 100644 --- a/cocos/renderer/CCTexture2D.cpp +++ b/cocos/renderer/CCTexture2D.cpp @@ -524,8 +524,8 @@ bool Texture2D::initWithString(const char *text, const FontDefinition& textDefin return false; } -#if (CC_TARGET_PLATFORM != CC_PLATFORM_MAC) && (CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID) && (CC_TARGET_PLATFORM != CC_PLATFORM_IOS) - CCASSERT(textDefinition._stroke._strokeEnabled == false, "Currently stroke only supported on Mac, iOS and Android!"); +#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX) + CCASSERT(textDefinition._stroke._strokeEnabled == false, "SystemFont Stroke Currently not support on Linux!"); #endif PixelFormat pixelFormat = g_defaultAlphaPixelFormat; @@ -560,6 +560,7 @@ bool Texture2D::initWithString(const char *text, const FontDefinition& textDefin } _hasPremultipliedAlpha = hasPremultipliedAlpha; + setAliasTexParameters(); return ret; } diff --git a/cocos/renderer/CCTextureCache.cpp b/cocos/renderer/CCTextureCache.cpp index 1e83a324..f5a914c1 100644 --- a/cocos/renderer/CCTextureCache.cpp +++ b/cocos/renderer/CCTextureCache.cpp @@ -4,6 +4,7 @@ Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. +Copyright (c) 2021-2022 cocos2d-lua.org http://www.cocos2d-x.org @@ -42,7 +43,6 @@ THE SOFTWARE. #include "base/ccUtils.h" #include "base/CCNinePatchImageParser.h" #include "renderer/backend/Device.h" -//#include "renderer/backend/StringUtils.h" using namespace std; @@ -88,12 +88,15 @@ std::string TextureCache::getDescription() const struct TextureCache::AsyncStruct { public: - AsyncStruct - ( const std::string& fn,const std::function& f, - const std::string& key ) - : filename(fn), callback(f),callbackKey( key ), - pixelFormat(Texture2D::getDefaultAlphaPixelFormat()), - loadSuccess(false) + AsyncStruct(const std::string& fn, + const std::function& f, + const std::string& key, + backend::PixelFormat fmt) + : filename(fn) + , callback(f) + , callbackKey(key) + , pixelFormat(fmt) + , loadSuccess(false) {} std::string filename; @@ -105,41 +108,6 @@ struct TextureCache::AsyncStruct bool loadSuccess; }; -/** - The addImageAsync logic follow the steps: - - find the image has been add or not, if not add an AsyncStruct to _requestQueue (GL thread) - - get AsyncStruct from _requestQueue, load res and fill image data to AsyncStruct.image, then add AsyncStruct to _responseQueue (Load thread) - - on schedule callback, get AsyncStruct from _responseQueue, convert image to texture, then delete AsyncStruct (GL thread) - - the Critical Area include these members: - - _requestQueue: locked by _requestMutex - - _responseQueue: locked by _responseMutex - - the object's life time: - - AsyncStruct: construct and destruct in GL thread - - image data: new in Load thread, delete in GL thread(by Image instance) - - Note: - - all AsyncStruct referenced in _asyncStructQueue, for unbind function use. - - How to deal add image many times? - - At first, this situation is abnormal, we only ensure the logic is correct. - - If the image has been loaded, the after load image call will return immediately. - - If the image request is in queue already, there will be more than one request in queue, - - In addImageAsyncCallback, will deduplicate the request to ensure only create one texture. - - Does process all response in addImageAsyncCallback consume more time? - - Convert image to texture faster than load image from disk, so this isn't a - problem. - - Call unbindImageAsync(path) to prevent the call to the callback when the - texture is loaded. - */ -void TextureCache::addImageAsync(const std::string &path, const std::function& callback) -{ - addImageAsync( path, callback, path ); -} - /** The addImageAsync logic follow the steps: - find the image has been add or not, if not add an AsyncStruct to _requestQueue (GL thread) @@ -172,7 +140,10 @@ void TextureCache::addImageAsync(const std::string &path, const std::function& callback, const std::string& callbackKey) +void TextureCache::addImageAsync(const std::string& path, + const std::function& callback, + const std::string& callbackKey, + backend::PixelFormat pixelFormat) { Texture2D *texture = nullptr; @@ -210,13 +181,13 @@ void TextureCache::addImageAsync(const std::string &path, const std::function ul(_requestMutex); _requestQueue.push_back(data); + ul.unlock(); _sleepCondition.notify_one(); } @@ -652,16 +623,14 @@ std::string TextureCache::getCachedTextureInfo() const unsigned int totalBytes = 0; for (auto& texture : _textures) { - - memset(buftmp, 0, sizeof(buftmp)); - - Texture2D* tex = texture.second; unsigned int bpp = tex->getBitsPerPixelForFormat(); // Each texture takes up width * height * bytesPerPixel bytes. auto bytes = tex->getPixelsWide() * tex->getPixelsHigh() * bpp / 8; totalBytes += bytes; count++; + + memset(buftmp, 0, sizeof(buftmp)); snprintf(buftmp, sizeof(buftmp) - 1, "\"%s\" rc=%lu id=%p %lu x %lu @ %ld bpp => %lu KB\n", texture.first.c_str(), (long)tex->getReferenceCount(), @@ -674,6 +643,7 @@ std::string TextureCache::getCachedTextureInfo() const buffer += buftmp; } + memset(buftmp, 0, sizeof(buftmp)); 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)); buffer += buftmp; diff --git a/cocos/renderer/CCTextureCache.h b/cocos/renderer/CCTextureCache.h index 52dcd239..2c6b7577 100644 --- a/cocos/renderer/CCTextureCache.h +++ b/cocos/renderer/CCTextureCache.h @@ -4,6 +4,7 @@ Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2011 Zynga Inc. Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. +Copyright (c) 2021 cocos2d-lua.org http://www.cocos2d-x.org @@ -93,19 +94,10 @@ class CC_DLL TextureCache : public Ref @param filepath The file path. */ Texture2D* addImage(const std::string &filepath); - - /** Returns a Texture2D object given a file image. - * If the file image was not previously loaded, it will create a new Texture2D object and it will return it. - * 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. - * The callback will be called from the main thread, so it is safe to create any cocos2d object from the callback. - * Supported image extensions: .png, .jpg - @param filepath The file path. - @param callback A callback function would be invoked after the image is loaded. - @since v0.8 - */ - virtual void addImageAsync(const std::string &filepath, const std::function& callback); - - void addImageAsync(const std::string &path, const std::function& callback, const std::string& callbackKey ); + void addImageAsync(const std::string &path, + const std::function& callback, + const std::string& callbackKey, + backend::PixelFormat pixelFormat = backend::PixelFormat::RGBA8888); /** Unbind a specified bound image asynchronous callback. * In the case an object who was bound to an image asynchronous callback was destroyed before the callback is invoked, diff --git a/cocos/renderer/backend/ProgramState.cpp b/cocos/renderer/backend/ProgramState.cpp index 878d8c5b..f47a05c0 100644 --- a/cocos/renderer/backend/ProgramState.cpp +++ b/cocos/renderer/backend/ProgramState.cpp @@ -248,11 +248,6 @@ backend::UniformLocation ProgramState::getUniformLocation(const std::string& uni return _program->getUniformLocation(uniform); } -void ProgramState::setCallbackUniform(const backend::UniformLocation& uniformLocation,const UniformCallback& callback) -{ - _callbackUniforms[uniformLocation] = callback; -} - void ProgramState::setUniform(const backend::UniformLocation& uniformLocation, const void* data, std::size_t size) { switch (uniformLocation.shaderStage) diff --git a/cocos/renderer/backend/ProgramState.h b/cocos/renderer/backend/ProgramState.h index ff45a25d..9c847858 100644 --- a/cocos/renderer/backend/ProgramState.h +++ b/cocos/renderer/backend/ProgramState.h @@ -75,8 +75,6 @@ struct TextureInfo class ProgramState : public Ref { public: - using UniformCallback = std::function; - /** * @param program Specifies the program. */ @@ -135,13 +133,6 @@ class ProgramState : public Ref */ inline int getAttributeLocation(Attribute name) const { return _program->getAttributeLocation(name); } - /** - * A callback to update unifrom. - * @param uniformLocation Specifies the uniform location. - * @param unifromCallback Specifies a callback function to update the uniform. - */ - void setCallbackUniform(const backend::UniformLocation&, const UniformCallback &); - /** * Set texture. * @param uniformLocation Specifies texture location. @@ -170,12 +161,6 @@ class ProgramState : public Ref */ inline const std::unordered_map& getFragmentTextureInfos() const { return _fragmentTextureInfos; } - /** - * Get the uniform callback function. - * @return Uniform callback funciton. - */ - inline const std::unordered_map& getCallbackUniforms() const { return _callbackUniforms; } - /** * Get vertex uniform buffer. The buffer store all the vertex uniform's data. * @param[out] buffer Specifies the pointer points to a vertex uniform storage. @@ -318,7 +303,6 @@ class ProgramState : public Ref void applyAutoBinding(const std::string &, const std::string &); backend::Program* _program = nullptr; - std::unordered_map _callbackUniforms; char* _vertexUniformBuffer = nullptr; char* _fragmentUniformBuffer = nullptr; std::size_t _vertexUniformBufferSize = 0; diff --git a/cocos/renderer/backend/metal/CommandBufferMTL.h b/cocos/renderer/backend/metal/CommandBufferMTL.h index edc44d15..c05ca94c 100644 --- a/cocos/renderer/backend/metal/CommandBufferMTL.h +++ b/cocos/renderer/backend/metal/CommandBufferMTL.h @@ -193,7 +193,6 @@ class CommandBufferMTL : public CommandBuffer unsigned int _renderTargetWidth = 0; unsigned int _renderTargetHeight = 0; - dispatch_semaphore_t _frameBoundarySemaphore; RenderPassDescriptor _prevRenderPassDescriptor; NSAutoreleasePool* _autoReleasePool = nil; }; diff --git a/cocos/renderer/backend/metal/CommandBufferMTL.mm b/cocos/renderer/backend/metal/CommandBufferMTL.mm index e43760b8..5547293c 100644 --- a/cocos/renderer/backend/metal/CommandBufferMTL.mm +++ b/cocos/renderer/backend/metal/CommandBufferMTL.mm @@ -213,19 +213,16 @@ inline int clamp(int value, int min, int max) { CommandBufferMTL::CommandBufferMTL(DeviceMTL* deviceMTL) : _mtlCommandQueue(deviceMTL->getMTLCommandQueue()) -, _frameBoundarySemaphore(dispatch_semaphore_create(MAX_INFLIGHT_BUFFER)) { } CommandBufferMTL::~CommandBufferMTL() { - dispatch_semaphore_signal(_frameBoundarySemaphore); } void CommandBufferMTL::beginFrame() { _autoReleasePool = [[NSAutoreleasePool alloc] init]; - dispatch_semaphore_wait(_frameBoundarySemaphore, DISPATCH_TIME_FOREVER); _mtlCommandBuffer = [_mtlCommandQueue commandBuffer]; [_mtlCommandBuffer enqueue]; @@ -362,13 +359,8 @@ inline int clamp(int value, int min, int max) { [_mtlCommandBuffer presentDrawable:DeviceMTL::getCurrentDrawable()]; _drawableTexture = DeviceMTL::getCurrentDrawable().texture; - [_mtlCommandBuffer addCompletedHandler:^(id commandBuffer) { - // GPU work is complete - // Signal the semaphore to start the CPU work - dispatch_semaphore_signal(_frameBoundarySemaphore); - }]; - [_mtlCommandBuffer commit]; + [_mtlCommandBuffer waitUntilCompleted]; [_mtlCommandBuffer release]; DeviceMTL::resetCurrentDrawable(); [_autoReleasePool drain]; @@ -450,13 +442,6 @@ inline int clamp(int value, int min, int max) { { if (_programState) { - auto &callbackUniforms = _programState->getCallbackUniforms(); - - for(auto &cb : callbackUniforms) - { - cb.second(_programState, cb.first); - } - // Uniform buffer is bound to index 1. std::size_t bufferSize = 0; char* vertexBuffer = nullptr; diff --git a/cocos/renderer/backend/metal/ShaderModuleMTL.mm b/cocos/renderer/backend/metal/ShaderModuleMTL.mm index d0f8291a..5e35eba1 100644 --- a/cocos/renderer/backend/metal/ShaderModuleMTL.mm +++ b/cocos/renderer/backend/metal/ShaderModuleMTL.mm @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2018-2019 Xiamen Yaji Software Co., Ltd. + Copyright (c) 2021 cocos2d-lua.org http://www.cocos2d-x.org @@ -37,22 +38,16 @@ of this software and associated documentation files (the "Software"), to deal glslopt_ctx* ctx = glslopt_initialize(kGlslTargetMetal); glslopt_shader_type shaderType = stage == ShaderStage::VERTEX ? kGlslOptShaderVertex : kGlslOptShaderFragment; glslopt_shader* glslShader = glslopt_optimize(ctx, shaderType, source.c_str(), 0); - if (!glslShader) - { - NSLog(@"Can not translate GLSL shader to metal shader:"); - NSLog(@"%s", source.c_str()); - return; - } - - const char* metalShader = glslopt_get_output(glslShader); - if (!metalShader) - { + if (!glslopt_get_status(glslShader)) { NSLog(@"Can not get metal shader:"); NSLog(@"%s", source.c_str()); + NSLog(@"%s", glslopt_get_log(glslShader)); + glslopt_shader_delete(glslShader); glslopt_cleanup(ctx); return; } + const char* metalShader = glslopt_get_output(glslShader); // NSLog(@"%s", metalShader); parseAttibute(mtlDevice, glslShader); @@ -66,8 +61,7 @@ of this software and associated documentation files (the "Software"), to deal id library = [mtlDevice newLibraryWithSource:shader options:nil error:&error]; - if (!library) - { + if (!library) { NSLog(@"Can not compile metal shader: %@", error); NSLog(@"%s", metalShader); glslopt_shader_delete(glslShader); @@ -79,8 +73,7 @@ of this software and associated documentation files (the "Software"), to deal _mtlFunction = [library newFunctionWithName:@"xlatMtlMain1"]; else _mtlFunction = [library newFunctionWithName:@"xlatMtlMain2"]; - if (!_mtlFunction) - { + if (!_mtlFunction) { NSLog(@"metal shader is ---------------"); NSLog(@"%s", metalShader); assert(false); diff --git a/cocos/renderer/backend/metal/Utils.mm b/cocos/renderer/backend/metal/Utils.mm index a06e2b7c..4ac3a4c4 100644 --- a/cocos/renderer/backend/metal/Utils.mm +++ b/cocos/renderer/backend/metal/Utils.mm @@ -25,6 +25,8 @@ of this software and associated documentation files (the "Software"), to deal #include "Utils.h" #include "DeviceMTL.h" #include "base/CCConfiguration.h" +#include "base/CCDirector.h" +#include "base/CCScheduler.h" #define COLOR_ATTAHCMENT_PIXEL_FORMAT MTLPixelFormatBGRA8Unorm diff --git a/cocos/renderer/backend/opengl/CommandBufferGL.cpp b/cocos/renderer/backend/opengl/CommandBufferGL.cpp index e7ecfe05..35a1ed39 100644 --- a/cocos/renderer/backend/opengl/CommandBufferGL.cpp +++ b/cocos/renderer/backend/opengl/CommandBufferGL.cpp @@ -374,6 +374,7 @@ void CommandBufferGL::drawElements(PrimitiveType primitiveType, IndexFormat inde void CommandBufferGL::endRenderPass() { + glDisable(GL_SCISSOR_TEST); } void CommandBufferGL::endFrame() @@ -449,17 +450,11 @@ void CommandBufferGL::setUniforms(ProgramGL* program) const { if (_programState) { - auto& callbacks = _programState->getCallbackUniforms(); auto& uniformInfos = _programState->getProgram()->getAllActiveUniformInfo(ShaderStage::VERTEX); std::size_t bufferSize = 0; char* buffer = nullptr; _programState->getVertexUniformBuffer(&buffer, bufferSize); - for (auto &cb : callbacks) - { - cb.second(_programState, cb.first); - } - int i = 0; for(auto& iter : uniformInfos) { @@ -605,21 +600,14 @@ void CommandBufferGL::setLineWidth(float lineWidth) glLineWidth(lineWidth); else glLineWidth(1.0f); - } - void CommandBufferGL::setScissorRect(bool isEnabled, float x, float y, float width, float height) { - if(isEnabled) - { + if (isEnabled) { glEnable(GL_SCISSOR_TEST); glScissor(x, y, width, height); } - else - { - glDisable(GL_SCISSOR_TEST); - } } void CommandBufferGL::captureScreen(std::function callback) diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp index ec050d1d..a5169292 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_auto.cpp @@ -3860,46 +3860,76 @@ int lua_cocos2dx_EventTouch_setEventCode(lua_State* tolua_S) return 0; } -int lua_cocos2dx_EventTouch_constructor(lua_State* tolua_S) +int lua_cocos2dx_EventTouch_setTouches(lua_State* tolua_S) { int argc = 0; cocos2d::EventTouch* cobj = nullptr; bool ok = true; - + #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"cc.EventTouch",0,&tolua_err)) goto tolua_lerror; #endif - - - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventTouch_constructor'", nullptr); + + cobj = (cocos2d::EventTouch*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_EventTouch_setTouches'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S) - 1; + if (argc == 1) { + if(!lua_istable(tolua_S, 2)) { + tolua_error(tolua_S, "cc.EventTouch:setTouches arg 1 must table", nullptr); return 0; } - cobj = new cocos2d::EventTouch(); - cobj->autorelease(); - int ID = (int)cobj->_ID ; - int* luaID = &cobj->_luaID ; - toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,"cc.EventTouch"); - return 1; + + size_t len = lua_objlen(tolua_S, 2); + std::vector touches; + for (int i = 1; i <= len; i++) { // i in Lua index + lua_rawgeti(tolua_S, 2, i); // push cc.p() + // p.x + lua_pushstring(tolua_S, "x"); + lua_rawget(tolua_S, 3); + float x = lua_tonumber(tolua_S, -1); + // p.y + lua_pushstring(tolua_S, "y"); + lua_rawget(tolua_S, 3); + float y = lua_tonumber(tolua_S, -1); + lua_pop(tolua_S, 1); // pop cc.p() + + Touch *touch = new (std::nothrow) Touch(); + touch->setTouchInfo(i, x, y); + touches.push_back(touch); + } + cobj->setTouches(touches); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.EventTouch:EventTouch",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.EventTouch:setTouches",argc, 1); return 0; - + #if COCOS2D_DEBUG >= 1 - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_EventTouch_constructor'.",&tolua_err); +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_EventTouch_setTouches'.",&tolua_err); #endif - return 0; } - -static int lua_cocos2dx_EventTouch_finalize(lua_State* tolua_S) +int lua_cocos2dx_EventTouch_constructor(lua_State* tolua_S) { - printf("luabindings: finalizing LUA object (EventTouch)"); + cocos2d::EventTouch* cobj = nullptr; + int argc = lua_gettop(tolua_S) - 1; + if (argc == 0) { + cobj = new cocos2d::EventTouch(); + cobj->autorelease(); + int ID = (int)cobj->_ID; + int *luaID = &cobj->_luaID; + toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,"cc.EventTouch"); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.EventTouch:EventTouch",argc, 0); return 0; } @@ -3912,6 +3942,7 @@ int lua_register_cocos2dx_EventTouch(lua_State* tolua_S) tolua_function(tolua_S,"new",lua_cocos2dx_EventTouch_constructor); tolua_function(tolua_S,"getEventCode",lua_cocos2dx_EventTouch_getEventCode); tolua_function(tolua_S,"setEventCode",lua_cocos2dx_EventTouch_setEventCode); + tolua_function(tolua_S,"setTouches",lua_cocos2dx_EventTouch_setTouches); tolua_endmodule(tolua_S); std::string typeName = typeid(cocos2d::EventTouch).name(); g_luaType[typeName] = "cc.EventTouch"; @@ -5715,56 +5746,6 @@ int lua_cocos2dx_Node_removeAllComponents(lua_State* tolua_S) return 0; } -int lua_cocos2dx_Node__setLocalZOrder(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Node* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Node",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Node*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Node__setLocalZOrder'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - int arg0; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.Node:_setLocalZOrder"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Node__setLocalZOrder'", nullptr); - return 0; - } - cobj->_setLocalZOrder(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Node:_setLocalZOrder",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Node__setLocalZOrder'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_Node_setCameraMask(lua_State* tolua_S) { int argc = 0; @@ -8259,6 +8240,105 @@ int lua_cocos2dx_Node_removeChildByName(lua_State* tolua_S) return 0; } +int lua_cocos2dx_Node_removeChildrenByTag(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Node* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S, 1, "cc.Node", 0, &tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Node*)tolua_tousertype(tolua_S, 1, 0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S, "invalid 'cobj' in function 'lua_cocos2dx_Node_removeChildrenByTag'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S) - 1; + if (argc >= 1) + { + int arg0; + bool arg1 = true; + ok &= luaval_to_int32(tolua_S, 2, &arg0, "cc.Node:removeChildrenByTag"); + if (argc == 2) { + ok &= luaval_to_boolean(tolua_S, 3, &arg1, "cc.Node:removeChildrenByTag"); + } + if (!ok) { + tolua_error(tolua_S, "invalid arguments in function 'lua_cocos2dx_Node_removeChildrenByTag'", nullptr); + return 0; + } + cobj->removeChildrenByTag(arg0, arg1); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting 1~2 \n", "cc.Node:removeChildrenByTag", argc); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S, "#ferror in function 'lua_cocos2dx_Node_removeChildrenByTag'.", &tolua_err); +#endif + return 0; +} + +int lua_cocos2dx_Node_removeChildrenByName(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::Node* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isusertype(tolua_S, 1, "cc.Node", 0, &tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::Node*)tolua_tousertype(tolua_S, 1, 0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S, "invalid 'cobj' in function 'lua_cocos2dx_Node_removeChildrenByName'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S) - 1; + if (argc >= 1) + { + std::string arg0; + bool arg1 = true; + ok &= luaval_to_std_string(tolua_S, 2, &arg0, "cc.Node:removeChildrenByName"); + if (argc == 2) { + ok &= luaval_to_boolean(tolua_S, 3, &arg1, "cc.Node:removeChildrenByName"); + } + if (!ok) + { + tolua_error(tolua_S, "invalid arguments in function 'lua_cocos2dx_Node_removeChildrenByName'", nullptr); + return 0; + } + cobj->removeChildrenByName(arg0, arg1); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting 1~2 \n", "cc.Node:removeChildrenByName", argc); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S, "#ferror in function 'lua_cocos2dx_Node_removeChildrenByName'.", &tolua_err); +#endif + return 0; +} + int lua_cocos2dx_Node_setScheduler(lua_State* tolua_S) { int argc = 0; @@ -11532,7 +11612,6 @@ int lua_register_cocos2dx_Node(lua_State* tolua_S) tolua_function(tolua_S,"setScaleX",lua_cocos2dx_Node_setScaleX); tolua_function(tolua_S,"setRotationSkewX",lua_cocos2dx_Node_setRotationSkewX); tolua_function(tolua_S,"removeAllComponents",lua_cocos2dx_Node_removeAllComponents); - tolua_function(tolua_S,"_setLocalZOrder",lua_cocos2dx_Node__setLocalZOrder); tolua_function(tolua_S,"setCameraMask",lua_cocos2dx_Node_setCameraMask); tolua_function(tolua_S,"getTag",lua_cocos2dx_Node_getTag); tolua_function(tolua_S,"getNodeToWorldAffineTransform",lua_cocos2dx_Node_getNodeToWorldAffineTransform); @@ -11583,6 +11662,8 @@ int lua_register_cocos2dx_Node(lua_State* tolua_S) tolua_function(tolua_S,"getPhysicsBody",lua_cocos2dx_Node_getPhysicsBody); tolua_function(tolua_S,"getAnchorPointInPoints",lua_cocos2dx_Node_getAnchorPointInPoints); tolua_function(tolua_S,"removeChildByName",lua_cocos2dx_Node_removeChildByName); + tolua_function(tolua_S,"removeChildrenByTag", lua_cocos2dx_Node_removeChildrenByTag); + tolua_function(tolua_S,"removeChildrenByName", lua_cocos2dx_Node_removeChildrenByName); tolua_function(tolua_S,"setScheduler",lua_cocos2dx_Node_setScheduler); tolua_function(tolua_S,"stopAllActions",lua_cocos2dx_Node_stopAllActions); tolua_function(tolua_S,"getSkewX",lua_cocos2dx_Node_getSkewX); @@ -35194,65 +35275,13 @@ int lua_register_cocos2dx_EventListenerKeyboard(lua_State* tolua_S) return 1; } -int lua_cocos2dx_EventMouse_getPreviousLocationInView(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::EventMouse* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EventMouse",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::EventMouse*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_EventMouse_getPreviousLocationInView'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventMouse_getPreviousLocationInView'", nullptr); - return 0; - } - cocos2d::Vec2 ret = cobj->getPreviousLocationInView(); - vec2_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.EventMouse:getPreviousLocationInView",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_EventMouse_getPreviousLocationInView'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_EventMouse_getLocation(lua_State* tolua_S) { int argc = 0; cocos2d::EventMouse* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"cc.EventMouse",0,&tolua_err)) goto tolua_lerror; #endif @@ -35269,11 +35298,6 @@ int lua_cocos2dx_EventMouse_getLocation(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 0) { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventMouse_getLocation'", nullptr); - return 0; - } cocos2d::Vec2 ret = cobj->getLocation(); vec2_to_luaval(tolua_S, ret); return 1; @@ -35282,24 +35306,19 @@ int lua_cocos2dx_EventMouse_getLocation(lua_State* tolua_S) return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: +tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_EventMouse_getLocation'.",&tolua_err); -#endif - return 0; +#endif } + int lua_cocos2dx_EventMouse_getMouseButton(lua_State* tolua_S) { int argc = 0; cocos2d::EventMouse* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"cc.EventMouse",0,&tolua_err)) goto tolua_lerror; #endif @@ -35316,11 +35335,6 @@ int lua_cocos2dx_EventMouse_getMouseButton(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 0) { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventMouse_getMouseButton'", nullptr); - return 0; - } int ret = (int)cobj->getMouseButton(); tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; @@ -35329,315 +35343,19 @@ int lua_cocos2dx_EventMouse_getMouseButton(lua_State* tolua_S) return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: +tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_EventMouse_getMouseButton'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_EventMouse_getPreviousLocation(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::EventMouse* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EventMouse",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::EventMouse*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_EventMouse_getPreviousLocation'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventMouse_getPreviousLocation'", nullptr); - return 0; - } - cocos2d::Vec2 ret = cobj->getPreviousLocation(); - vec2_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.EventMouse:getPreviousLocation",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_EventMouse_getPreviousLocation'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_EventMouse_getDelta(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::EventMouse* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EventMouse",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::EventMouse*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_EventMouse_getDelta'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventMouse_getDelta'", nullptr); - return 0; - } - cocos2d::Vec2 ret = cobj->getDelta(); - vec2_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.EventMouse:getDelta",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_EventMouse_getDelta'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_EventMouse_setScrollData(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::EventMouse* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EventMouse",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::EventMouse*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_EventMouse_setScrollData'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 2) - { - double arg0; - double arg1; - - ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.EventMouse:setScrollData"); - - ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.EventMouse:setScrollData"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventMouse_setScrollData'", nullptr); - return 0; - } - cobj->setScrollData(arg0, arg1); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.EventMouse:setScrollData",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_EventMouse_setScrollData'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_EventMouse_getStartLocationInView(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::EventMouse* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EventMouse",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::EventMouse*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_EventMouse_getStartLocationInView'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventMouse_getStartLocationInView'", nullptr); - return 0; - } - cocos2d::Vec2 ret = cobj->getStartLocationInView(); - vec2_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.EventMouse:getStartLocationInView",argc, 0); return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_EventMouse_getStartLocationInView'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_EventMouse_getStartLocation(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::EventMouse* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EventMouse",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::EventMouse*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_EventMouse_getStartLocation'", nullptr); - return 0; - } #endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventMouse_getStartLocation'", nullptr); - return 0; - } - cocos2d::Vec2 ret = cobj->getStartLocation(); - vec2_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.EventMouse:getStartLocation",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_EventMouse_getStartLocation'.",&tolua_err); -#endif - - return 0; } -int lua_cocos2dx_EventMouse_setMouseButton(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::EventMouse* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EventMouse",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::EventMouse*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_EventMouse_setMouseButton'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::EventMouse::MouseButton arg0; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.EventMouse:setMouseButton"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventMouse_setMouseButton'", nullptr); - return 0; - } - cobj->setMouseButton(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.EventMouse:setMouseButton",argc, 1); - return 0; -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_EventMouse_setMouseButton'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_EventMouse_getLocationInView(lua_State* tolua_S) { int argc = 0; cocos2d::EventMouse* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"cc.EventMouse",0,&tolua_err)) goto tolua_lerror; #endif @@ -35654,11 +35372,6 @@ int lua_cocos2dx_EventMouse_getLocationInView(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 0) { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventMouse_getLocationInView'", nullptr); - return 0; - } cocos2d::Vec2 ret = cobj->getLocationInView(); vec2_to_luaval(tolua_S, ret); return 1; @@ -35667,24 +35380,19 @@ int lua_cocos2dx_EventMouse_getLocationInView(lua_State* tolua_S) return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: +tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_EventMouse_getLocationInView'.",&tolua_err); -#endif - return 0; +#endif } + int lua_cocos2dx_EventMouse_getScrollY(lua_State* tolua_S) { int argc = 0; cocos2d::EventMouse* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"cc.EventMouse",0,&tolua_err)) goto tolua_lerror; #endif @@ -35701,11 +35409,6 @@ int lua_cocos2dx_EventMouse_getScrollY(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 0) { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventMouse_getScrollY'", nullptr); - return 0; - } double ret = cobj->getScrollY(); tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; @@ -35714,24 +35417,19 @@ int lua_cocos2dx_EventMouse_getScrollY(lua_State* tolua_S) return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: +tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_EventMouse_getScrollY'.",&tolua_err); -#endif - return 0; +#endif } + int lua_cocos2dx_EventMouse_getScrollX(lua_State* tolua_S) { int argc = 0; cocos2d::EventMouse* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"cc.EventMouse",0,&tolua_err)) goto tolua_lerror; #endif @@ -35748,11 +35446,6 @@ int lua_cocos2dx_EventMouse_getScrollX(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 0) { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventMouse_getScrollX'", nullptr); - return 0; - } double ret = cobj->getScrollX(); tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; @@ -35761,203 +35454,10 @@ int lua_cocos2dx_EventMouse_getScrollX(lua_State* tolua_S) return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: +tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_EventMouse_getScrollX'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_EventMouse_getCursorX(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::EventMouse* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EventMouse",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::EventMouse*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_EventMouse_getCursorX'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventMouse_getCursorX'", nullptr); - return 0; - } - double ret = cobj->getCursorX(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.EventMouse:getCursorX",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_EventMouse_getCursorX'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_EventMouse_getCursorY(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::EventMouse* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EventMouse",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::EventMouse*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_EventMouse_getCursorY'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventMouse_getCursorY'", nullptr); - return 0; - } - double ret = cobj->getCursorY(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.EventMouse:getCursorY",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_EventMouse_getCursorY'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_EventMouse_setCursorPosition(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::EventMouse* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.EventMouse",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::EventMouse*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_EventMouse_setCursorPosition'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 2) - { - double arg0; - double arg1; - - ok &= luaval_to_number(tolua_S, 2,&arg0, "cc.EventMouse:setCursorPosition"); - - ok &= luaval_to_number(tolua_S, 3,&arg1, "cc.EventMouse:setCursorPosition"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventMouse_setCursorPosition'", nullptr); - return 0; - } - cobj->setCursorPosition(arg0, arg1); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.EventMouse:setCursorPosition",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_EventMouse_setCursorPosition'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_EventMouse_constructor(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::EventMouse* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - cocos2d::EventMouse::MouseEventType arg0; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.EventMouse:EventMouse"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_EventMouse_constructor'", nullptr); - return 0; - } - cobj = new cocos2d::EventMouse(arg0); - cobj->autorelease(); - int ID = (int)cobj->_ID ; - int* luaID = &cobj->_luaID ; - toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,"cc.EventMouse"); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.EventMouse:EventMouse",argc, 1); return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_EventMouse_constructor'.",&tolua_err); #endif - - return 0; -} - -static int lua_cocos2dx_EventMouse_finalize(lua_State* tolua_S) -{ - printf("luabindings: finalizing LUA object (EventMouse)"); - return 0; } int lua_register_cocos2dx_EventMouse(lua_State* tolua_S) @@ -35966,22 +35466,11 @@ int lua_register_cocos2dx_EventMouse(lua_State* tolua_S) tolua_cclass(tolua_S,"EventMouse","cc.EventMouse","cc.Event",nullptr); tolua_beginmodule(tolua_S,"EventMouse"); - tolua_function(tolua_S,"new",lua_cocos2dx_EventMouse_constructor); - tolua_function(tolua_S,"getPreviousLocationInView",lua_cocos2dx_EventMouse_getPreviousLocationInView); tolua_function(tolua_S,"getLocation",lua_cocos2dx_EventMouse_getLocation); tolua_function(tolua_S,"getMouseButton",lua_cocos2dx_EventMouse_getMouseButton); - tolua_function(tolua_S,"getPreviousLocation",lua_cocos2dx_EventMouse_getPreviousLocation); - tolua_function(tolua_S,"getDelta",lua_cocos2dx_EventMouse_getDelta); - tolua_function(tolua_S,"setScrollData",lua_cocos2dx_EventMouse_setScrollData); - tolua_function(tolua_S,"getStartLocationInView",lua_cocos2dx_EventMouse_getStartLocationInView); - tolua_function(tolua_S,"getStartLocation",lua_cocos2dx_EventMouse_getStartLocation); - tolua_function(tolua_S,"setMouseButton",lua_cocos2dx_EventMouse_setMouseButton); tolua_function(tolua_S,"getLocationInView",lua_cocos2dx_EventMouse_getLocationInView); tolua_function(tolua_S,"getScrollY",lua_cocos2dx_EventMouse_getScrollY); tolua_function(tolua_S,"getScrollX",lua_cocos2dx_EventMouse_getScrollX); - tolua_function(tolua_S,"getCursorX",lua_cocos2dx_EventMouse_getCursorX); - tolua_function(tolua_S,"getCursorY",lua_cocos2dx_EventMouse_getCursorY); - tolua_function(tolua_S,"setCursorPosition",lua_cocos2dx_EventMouse_setCursorPosition); tolua_endmodule(tolua_S); std::string typeName = typeid(cocos2d::EventMouse).name(); g_luaType[typeName] = "cc.EventMouse"; @@ -72435,59 +71924,6 @@ int lua_cocos2dx_Sprite_setBlendFunc(lua_State* tolua_S) return 0; } -int lua_cocos2dx_Sprite_updateShaders(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::Sprite* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.Sprite",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::Sprite*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Sprite_updateShaders'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 2) - { - const char* arg0; - const char* arg1; - - std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "cc.Sprite:updateShaders"); arg0 = arg0_tmp.c_str(); - - std::string arg1_tmp; ok &= luaval_to_std_string(tolua_S, 3, &arg1_tmp, "cc.Sprite:updateShaders"); arg1 = arg1_tmp.c_str(); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Sprite_updateShaders'", nullptr); - return 0; - } - cobj->updateShaders(arg0, arg1); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Sprite:updateShaders",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Sprite_updateShaders'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_Sprite_getTextureAtlas(lua_State* tolua_S) { int argc = 0; @@ -72955,7 +72391,6 @@ int lua_register_cocos2dx_Sprite(lua_State* tolua_S) tolua_function(tolua_S,"getTextureRect",lua_cocos2dx_Sprite_getTextureRect); tolua_function(tolua_S,"initWithFile",lua_cocos2dx_Sprite_initWithFile); tolua_function(tolua_S,"setBlendFunc",lua_cocos2dx_Sprite_setBlendFunc); - tolua_function(tolua_S,"updateShaders",lua_cocos2dx_Sprite_updateShaders); tolua_function(tolua_S,"getTextureAtlas",lua_cocos2dx_Sprite_getTextureAtlas); tolua_function(tolua_S,"initWithSpriteFrame",lua_cocos2dx_Sprite_initWithSpriteFrame); tolua_function(tolua_S,"isFlippedX",lua_cocos2dx_Sprite_isFlippedX); @@ -93741,76 +93176,57 @@ int lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile(lua_State* tolua_S) { int argc = 0; cocos2d::SpriteFrameCache* cobj = nullptr; - bool ok = true; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"cc.SpriteFrameCache",0,&tolua_err)) goto tolua_lerror; #endif cobj = (cocos2d::SpriteFrameCache*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) - { + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; - do{ - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.SpriteFrameCache:addSpriteFramesWithFile"); - - if (!ok) { break; } + argc = lua_gettop(tolua_S) - 1; + if (argc == 1) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2, &arg0, "cc.SpriteFrameCache:addSpriteFramesWithFile"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile'", nullptr); + return 0; + } + cobj->addSpriteFramesWithFile(arg0); + lua_settop(tolua_S, 1); + return 1; + } + if (argc == 2) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.SpriteFrameCache:addSpriteFramesWithFile"); + if (lua_isstring(tolua_S, 3)) { std::string arg1; ok &= luaval_to_std_string(tolua_S, 3,&arg1, "cc.SpriteFrameCache:addSpriteFramesWithFile"); - - if (!ok) { break; } - cobj->addSpriteFramesWithFile(arg0, arg1); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.SpriteFrameCache:addSpriteFramesWithFile"); - - if (!ok) { break; } - cobj->addSpriteFramesWithFile(arg0); - lua_settop(tolua_S, 1); - return 1; - } - }while(0); - ok = true; - do{ - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.SpriteFrameCache:addSpriteFramesWithFile"); - - if (!ok) { break; } + if (ok) cobj->addSpriteFramesWithFile(arg0, arg1); + } else { cocos2d::Texture2D* arg1; ok &= luaval_to_object(tolua_S, 3, "cc.Texture2D",&arg1, "cc.SpriteFrameCache:addSpriteFramesWithFile"); - - if (!ok) { break; } - cobj->addSpriteFramesWithFile(arg0, arg1); - lua_settop(tolua_S, 1); - return 1; + if (ok) cobj->addSpriteFramesWithFile(arg0, arg1); } - }while(0); - ok = true; - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.SpriteFrameCache:addSpriteFramesWithFile",argc, 2); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile'", nullptr); + return 0; + } + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting 1~2 \n", "cc.SpriteFrameCache:addSpriteFramesWithFile", argc); return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: +tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_SpriteFrameCache_addSpriteFramesWithFile'.",&tolua_err); -#endif - return 0; +#endif } int lua_cocos2dx_SpriteFrameCache_getSpriteFrameByName(lua_State* tolua_S) { diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_backend_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_backend_auto.cpp index b61a23ae..3d9407bd 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_backend_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_backend_auto.cpp @@ -814,34 +814,28 @@ int lua_cocos2dx_backend_Program_getBuiltinProgram(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertable(tolua_S,1,"ccb.Program",0,&tolua_err)) goto tolua_lerror; #endif argc = lua_gettop(tolua_S) - 1; - - if (argc == 1) - { - cocos2d::backend::ProgramType arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "ccb.Program:getBuiltinProgram"); - if(!ok) - { + if (argc == 1) { + unsigned int arg0; + ok &= luaval_to_uint32(tolua_S, 2,(unsigned int *)&arg0, "ccb.Program:getBuiltinProgram"); + if (!ok) { tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_backend_Program_getBuiltinProgram'", nullptr); return 0; } - cocos2d::backend::Program* ret = cocos2d::backend::Program::getBuiltinProgram(arg0); + cocos2d::backend::Program* ret = cocos2d::backend::Program::getBuiltinProgram((cocos2d::backend::ProgramType)arg0); object_to_luaval(tolua_S, "ccb.Program",(cocos2d::backend::Program*)ret); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "ccb.Program:getBuiltinProgram",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: +tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_backend_Program_getBuiltinProgram'.",&tolua_err); -#endif return 0; +#endif } static int lua_cocos2dx_backend_Program_finalize(lua_State* tolua_S) { diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_spine_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_spine_auto.cpp index fd5aed11..7fd0555e 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_spine_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_spine_auto.cpp @@ -1169,6 +1169,46 @@ int lua_cocos2dx_spine_SkeletonAnimation_setMix(lua_State* tolua_S) return 0; } +int lua_cocos2dx_spine_SkeletonAnimation_setDefaultMix(lua_State* tolua_S) +{ + int argc = 0; + spine::SkeletonAnimation* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S, 1, "sp.SkeletonAnimation", 0, &tolua_err)) goto tolua_lerror; +#endif + cobj = (spine::SkeletonAnimation*)tolua_tousertype(tolua_S, 1, 0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S, "invalid 'cobj' in function 'lua_cocos2dx_spine_SkeletonAnimation_setDefaultMix'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S) - 1; + if (argc == 1) { + double arg0; + ok &= luaval_to_number(tolua_S, 2, &arg0, "sp.SkeletonAnimation:setDefaultMix"); + if (!ok) { + tolua_error(tolua_S, "invalid arguments in function 'lua_cocos2dx_spine_SkeletonAnimation_setDefaultMix'", nullptr); + return 0; + } + cobj->setDefaultMix(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "sp.SkeletonAnimation:setDefaultMix", argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S, "#ferror in function 'lua_cocos2dx_spine_SkeletonAnimation_setDefaultMix'.", &tolua_err); +#endif + + return 0; +} int lua_cocos2dx_spine_SkeletonAnimation_addEmptyAnimation(lua_State* tolua_S) { int argc = 0; @@ -1517,6 +1557,7 @@ int lua_register_cocos2dx_spine_SkeletonAnimation(lua_State* tolua_S) tolua_beginmodule(tolua_S,"SkeletonAnimation"); tolua_function(tolua_S,"findAnimation",lua_cocos2dx_spine_SkeletonAnimation_findAnimation); tolua_function(tolua_S,"setMix",lua_cocos2dx_spine_SkeletonAnimation_setMix); + tolua_function(tolua_S,"setDefaultMix",lua_cocos2dx_spine_SkeletonAnimation_setDefaultMix); tolua_function(tolua_S,"addEmptyAnimation",lua_cocos2dx_spine_SkeletonAnimation_addEmptyAnimation); tolua_function(tolua_S,"setUpdateOnlyIfVisible",lua_cocos2dx_spine_SkeletonAnimation_setUpdateOnlyIfVisible); tolua_function(tolua_S,"setEmptyAnimation",lua_cocos2dx_spine_SkeletonAnimation_setEmptyAnimation); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.cpp index e4d7dba9..e7fba356 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_studio_auto.cpp @@ -21349,111 +21349,6 @@ int lua_register_cocos2dx_studio_ActionTimelineData(lua_State* tolua_S) g_typeCast["ActionTimelineData"] = "ccs.ActionTimelineData"; return 1; } - -int lua_cocos2dx_studio_ActionTimeline_clearFrameEndCallFuncs(lua_State* tolua_S) -{ - int argc = 0; - cocostudio::timeline::ActionTimeline* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_clearFrameEndCallFuncs'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_ActionTimeline_clearFrameEndCallFuncs'", nullptr); - return 0; - } - cobj->clearFrameEndCallFuncs(); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:clearFrameEndCallFuncs",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_clearFrameEndCallFuncs'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_studio_ActionTimeline_setAnimationEndCallFunc(lua_State* tolua_S) -{ - int argc = 0; - cocostudio::timeline::ActionTimeline* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_setAnimationEndCallFunc'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 2) - { - std::string arg0; - std::function arg1; - - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "ccs.ActionTimeline:setAnimationEndCallFunc"); - - do { - // Lambda binding for lua is not supported. - assert(false); - } while(0) - ; - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_ActionTimeline_setAnimationEndCallFunc'", nullptr); - return 0; - } - cobj->setAnimationEndCallFunc(arg0, arg1); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:setAnimationEndCallFunc",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_setAnimationEndCallFunc'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_studio_ActionTimeline_addTimeline(lua_State* tolua_S) { int argc = 0; @@ -21789,107 +21684,6 @@ int lua_cocos2dx_studio_ActionTimeline_removeTimeline(lua_State* tolua_S) return 0; } -int lua_cocos2dx_studio_ActionTimeline_clearFrameEventCallFunc(lua_State* tolua_S) -{ - int argc = 0; - cocostudio::timeline::ActionTimeline* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_clearFrameEventCallFunc'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_ActionTimeline_clearFrameEventCallFunc'", nullptr); - return 0; - } - cobj->clearFrameEventCallFunc(); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:clearFrameEventCallFunc",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_clearFrameEventCallFunc'.",&tolua_err); -#endif - - return 0; -} -int lua_cocos2dx_studio_ActionTimeline_setLastFrameCallFunc(lua_State* tolua_S) -{ - int argc = 0; - cocostudio::timeline::ActionTimeline* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_setLastFrameCallFunc'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - std::function arg0; - - do { - // Lambda binding for lua is not supported. - assert(false); - } while(0) - ; - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_ActionTimeline_setLastFrameCallFunc'", nullptr); - return 0; - } - cobj->setLastFrameCallFunc(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:setLastFrameCallFunc",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_setLastFrameCallFunc'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_studio_ActionTimeline_getTimelines(lua_State* tolua_S) { int argc = 0; @@ -22087,66 +21881,6 @@ int lua_cocos2dx_studio_ActionTimeline_resume(lua_State* tolua_S) return 0; } -int lua_cocos2dx_studio_ActionTimeline_addFrameEndCallFunc(lua_State* tolua_S) -{ - int argc = 0; - cocostudio::timeline::ActionTimeline* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_addFrameEndCallFunc'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 3) - { - int arg0; - std::string arg1; - std::function arg2; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "ccs.ActionTimeline:addFrameEndCallFunc"); - - ok &= luaval_to_std_string(tolua_S, 3,&arg1, "ccs.ActionTimeline:addFrameEndCallFunc"); - - do { - // Lambda binding for lua is not supported. - assert(false); - } while(0) - ; - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_ActionTimeline_addFrameEndCallFunc'", nullptr); - return 0; - } - cobj->addFrameEndCallFunc(arg0, arg1, arg2); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:addFrameEndCallFunc",argc, 3); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_addFrameEndCallFunc'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_studio_ActionTimeline_removeAnimationInfo(lua_State* tolua_S) { int argc = 0; @@ -22438,56 +22172,6 @@ int lua_cocos2dx_studio_ActionTimeline_isPlaying(lua_State* tolua_S) return 0; } -int lua_cocos2dx_studio_ActionTimeline_removeFrameEndCallFuncs(lua_State* tolua_S) -{ - int argc = 0; - cocostudio::timeline::ActionTimeline* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_removeFrameEndCallFuncs'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - int arg0; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "ccs.ActionTimeline:removeFrameEndCallFuncs"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_ActionTimeline_removeFrameEndCallFuncs'", nullptr); - return 0; - } - cobj->removeFrameEndCallFuncs(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:removeFrameEndCallFuncs",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_removeFrameEndCallFuncs'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_studio_ActionTimeline_gotoFrameAndPlay(lua_State* tolua_S) { int argc = 0; @@ -22738,53 +22422,6 @@ int lua_cocos2dx_studio_ActionTimeline_setTimeSpeed(lua_State* tolua_S) return 0; } -int lua_cocos2dx_studio_ActionTimeline_clearLastFrameCallFunc(lua_State* tolua_S) -{ - int argc = 0; - cocostudio::timeline::ActionTimeline* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_clearLastFrameCallFunc'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_ActionTimeline_clearLastFrameCallFunc'", nullptr); - return 0; - } - cobj->clearLastFrameCallFunc(); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:clearLastFrameCallFunc",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_clearLastFrameCallFunc'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_studio_ActionTimeline_setDuration(lua_State* tolua_S) { int argc = 0; @@ -22885,59 +22522,6 @@ int lua_cocos2dx_studio_ActionTimeline_setCurrentFrame(lua_State* tolua_S) return 0; } -int lua_cocos2dx_studio_ActionTimeline_removeFrameEndCallFunc(lua_State* tolua_S) -{ - int argc = 0; - cocostudio::timeline::ActionTimeline* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"ccs.ActionTimeline",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_removeFrameEndCallFunc'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 2) - { - int arg0; - std::string arg1; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "ccs.ActionTimeline:removeFrameEndCallFunc"); - - ok &= luaval_to_std_string(tolua_S, 3,&arg1, "ccs.ActionTimeline:removeFrameEndCallFunc"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_studio_ActionTimeline_removeFrameEndCallFunc'", nullptr); - return 0; - } - cobj->removeFrameEndCallFunc(arg0, arg1); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccs.ActionTimeline:removeFrameEndCallFunc",argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_studio_ActionTimeline_removeFrameEndCallFunc'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_studio_ActionTimeline_create(lua_State* tolua_S) { int argc = 0; @@ -23022,8 +22606,6 @@ int lua_register_cocos2dx_studio_ActionTimeline(lua_State* tolua_S) tolua_beginmodule(tolua_S,"ActionTimeline"); tolua_function(tolua_S,"new",lua_cocos2dx_studio_ActionTimeline_constructor); - tolua_function(tolua_S,"clearFrameEndCallFuncs",lua_cocos2dx_studio_ActionTimeline_clearFrameEndCallFuncs); - tolua_function(tolua_S,"setAnimationEndCallFunc",lua_cocos2dx_studio_ActionTimeline_setAnimationEndCallFunc); tolua_function(tolua_S,"addTimeline",lua_cocos2dx_studio_ActionTimeline_addTimeline); tolua_function(tolua_S,"getCurrentFrame",lua_cocos2dx_studio_ActionTimeline_getCurrentFrame); tolua_function(tolua_S,"getStartFrame",lua_cocos2dx_studio_ActionTimeline_getStartFrame); @@ -23031,28 +22613,22 @@ int lua_register_cocos2dx_studio_ActionTimeline(lua_State* tolua_S) tolua_function(tolua_S,"start",lua_cocos2dx_studio_ActionTimeline_start); tolua_function(tolua_S,"init",lua_cocos2dx_studio_ActionTimeline_init); tolua_function(tolua_S,"removeTimeline",lua_cocos2dx_studio_ActionTimeline_removeTimeline); - tolua_function(tolua_S,"clearFrameEventCallFunc",lua_cocos2dx_studio_ActionTimeline_clearFrameEventCallFunc); - tolua_function(tolua_S,"setLastFrameCallFunc",lua_cocos2dx_studio_ActionTimeline_setLastFrameCallFunc); tolua_function(tolua_S,"getTimelines",lua_cocos2dx_studio_ActionTimeline_getTimelines); tolua_function(tolua_S,"play",lua_cocos2dx_studio_ActionTimeline_play); tolua_function(tolua_S,"getAnimationInfo",lua_cocos2dx_studio_ActionTimeline_getAnimationInfo); tolua_function(tolua_S,"resume",lua_cocos2dx_studio_ActionTimeline_resume); - tolua_function(tolua_S,"addFrameEndCallFunc",lua_cocos2dx_studio_ActionTimeline_addFrameEndCallFunc); tolua_function(tolua_S,"removeAnimationInfo",lua_cocos2dx_studio_ActionTimeline_removeAnimationInfo); tolua_function(tolua_S,"getTimeSpeed",lua_cocos2dx_studio_ActionTimeline_getTimeSpeed); tolua_function(tolua_S,"addAnimationInfo",lua_cocos2dx_studio_ActionTimeline_addAnimationInfo); tolua_function(tolua_S,"getDuration",lua_cocos2dx_studio_ActionTimeline_getDuration); tolua_function(tolua_S,"gotoFrameAndPause",lua_cocos2dx_studio_ActionTimeline_gotoFrameAndPause); tolua_function(tolua_S,"isPlaying",lua_cocos2dx_studio_ActionTimeline_isPlaying); - tolua_function(tolua_S,"removeFrameEndCallFuncs",lua_cocos2dx_studio_ActionTimeline_removeFrameEndCallFuncs); tolua_function(tolua_S,"gotoFrameAndPlay",lua_cocos2dx_studio_ActionTimeline_gotoFrameAndPlay); tolua_function(tolua_S,"IsAnimationInfoExists",lua_cocos2dx_studio_ActionTimeline_IsAnimationInfoExists); tolua_function(tolua_S,"getEndFrame",lua_cocos2dx_studio_ActionTimeline_getEndFrame); tolua_function(tolua_S,"setTimeSpeed",lua_cocos2dx_studio_ActionTimeline_setTimeSpeed); - tolua_function(tolua_S,"clearLastFrameCallFunc",lua_cocos2dx_studio_ActionTimeline_clearLastFrameCallFunc); tolua_function(tolua_S,"setDuration",lua_cocos2dx_studio_ActionTimeline_setDuration); tolua_function(tolua_S,"setCurrentFrame",lua_cocos2dx_studio_ActionTimeline_setCurrentFrame); - tolua_function(tolua_S,"removeFrameEndCallFunc",lua_cocos2dx_studio_ActionTimeline_removeFrameEndCallFunc); tolua_function(tolua_S,"create", lua_cocos2dx_studio_ActionTimeline_create); tolua_endmodule(tolua_S); std::string typeName = typeid(cocostudio::timeline::ActionTimeline).name(); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_tmx_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_tmx_auto.cpp index abab37a2..49f46051 100755 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_tmx_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_tmx_auto.cpp @@ -1736,6 +1736,42 @@ int lua_cocos2dx_TMXMapInfo_getStaggerIndex(lua_State* tolua_S) return 0; } +int lua_cocos2dx_TMXMapInfo_getRenderOrder(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::TMXMapInfo* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"cc.TMXMapInfo",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::TMXMapInfo*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_TMXMapInfo_getRenderOrder'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + int ret = cobj->getRenderOrder(); + lua_pushinteger(tolua_S,(lua_Integer)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.TMXMapInfo:getRenderOrder",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_TMXMapInfo_getRenderOrder'.",&tolua_err); + return 0; +#endif +} int lua_cocos2dx_TMXMapInfo_create(lua_State* tolua_S) { int argc = 0; @@ -1835,6 +1871,7 @@ int lua_register_cocos2dx_TMXMapInfo(lua_State* tolua_S) tolua_function(tolua_S,"getMapSize",lua_cocos2dx_TMXMapInfo_getMapSize); tolua_function(tolua_S,"getProperties",lua_cocos2dx_TMXMapInfo_getProperties); tolua_function(tolua_S,"getStaggerIndex",lua_cocos2dx_TMXMapInfo_getStaggerIndex); + tolua_function(tolua_S,"getRenderOrder",lua_cocos2dx_TMXMapInfo_getRenderOrder); tolua_function(tolua_S,"create", lua_cocos2dx_TMXMapInfo_create); tolua_function(tolua_S,"createWithXML", lua_cocos2dx_TMXMapInfo_createWithXML); tolua_endmodule(tolua_S); @@ -1894,55 +1931,6 @@ int lua_cocos2dx_TMXLayer_getPositionAt(lua_State* tolua_S) return 0; } -int lua_cocos2dx_TMXLayer_setLayerOrientation(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::TMXLayer* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.TMXLayer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::TMXLayer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_TMXLayer_setLayerOrientation'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) - { - int arg0; - - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "cc.TMXLayer:setLayerOrientation"); - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_TMXLayer_setLayerOrientation'", nullptr); - return 0; - } - cobj->setLayerOrientation(arg0); - lua_settop(tolua_S, 1); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.TMXLayer:setLayerOrientation",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_TMXLayer_setLayerOrientation'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_TMXLayer_getLayerSize(lua_State* tolua_S) { int argc = 0; @@ -2032,46 +2020,6 @@ int lua_cocos2dx_TMXLayer_setMapTileSize(lua_State* tolua_S) return 0; } -int lua_cocos2dx_TMXLayer_getLayerOrientation(lua_State* tolua_S) -{ - int argc = 0; - cocos2d::TMXLayer* cobj = nullptr; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isusertype(tolua_S,1,"cc.TMXLayer",0,&tolua_err)) goto tolua_lerror; -#endif - - cobj = (cocos2d::TMXLayer*)tolua_tousertype(tolua_S,1,0); - -#if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_TMXLayer_getLayerOrientation'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - int ret = cobj->getLayerOrientation(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.TMXLayer:getLayerOrientation",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_TMXLayer_getLayerOrientation'.",&tolua_err); -#endif - - return 0; -} int lua_cocos2dx_TMXLayer_setProperties(lua_State* tolua_S) { int argc = 0; @@ -2722,10 +2670,8 @@ int lua_register_cocos2dx_TMXLayer(lua_State* tolua_S) tolua_beginmodule(tolua_S,"TMXLayer"); tolua_function(tolua_S,"getPositionAt",lua_cocos2dx_TMXLayer_getPositionAt); - tolua_function(tolua_S,"setLayerOrientation",lua_cocos2dx_TMXLayer_setLayerOrientation); tolua_function(tolua_S,"getLayerSize",lua_cocos2dx_TMXLayer_getLayerSize); tolua_function(tolua_S,"setMapTileSize",lua_cocos2dx_TMXLayer_setMapTileSize); - tolua_function(tolua_S,"getLayerOrientation",lua_cocos2dx_TMXLayer_getLayerOrientation); tolua_function(tolua_S,"setProperties",lua_cocos2dx_TMXLayer_setProperties); tolua_function(tolua_S,"setLayerName",lua_cocos2dx_TMXLayer_setLayerName); tolua_function(tolua_S,"removeTileAt",lua_cocos2dx_TMXLayer_removeTileAt); diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp index 45534aa9..021b2b9c 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_ui_auto.cpp @@ -4583,48 +4583,37 @@ int lua_cocos2dx_ui_Layout_getRenderFile(lua_State* tolua_S) { int argc = 0; cocos2d::ui::Layout* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ccui.Layout",0,&tolua_err)) goto tolua_lerror; #endif cobj = (cocos2d::ui::Layout*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) - { + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Layout_getRenderFile'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_Layout_getRenderFile'", nullptr); - return 0; - } + if (argc == 0) { cocos2d::ResourceData ret = cobj->getRenderFile(); - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; - return 1; + lua_pushinteger(tolua_S, ret.type); + lua_pushlstring(tolua_S, ret.file.c_str(), ret.file.size()); + lua_pushlstring(tolua_S, ret.plist.c_str(), ret.plist.size()); + return 3; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.Layout:getRenderFile",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: + tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Layout_getRenderFile'.",&tolua_err); -#endif - return 0; +#endif } int lua_cocos2dx_ui_Layout_isLoopFocus(lua_State* tolua_S) { @@ -6498,48 +6487,37 @@ int lua_cocos2dx_ui_Button_getDisabledFile(lua_State* tolua_S) { int argc = 0; cocos2d::ui::Button* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ccui.Button",0,&tolua_err)) goto tolua_lerror; #endif cobj = (cocos2d::ui::Button*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) - { + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Button_getDisabledFile'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_Button_getDisabledFile'", nullptr); - return 0; - } + if (argc == 0) { cocos2d::ResourceData ret = cobj->getDisabledFile(); - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; - return 1; + lua_pushinteger(tolua_S, ret.type); + lua_pushlstring(tolua_S, ret.file.c_str(), ret.file.size()); + lua_pushlstring(tolua_S, ret.plist.c_str(), ret.plist.size()); + return 3; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.Button:getDisabledFile",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: +tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Button_getDisabledFile'.",&tolua_err); -#endif - return 0; +#endif } int lua_cocos2dx_ui_Button_getZoomScale(lua_State* tolua_S) { @@ -6689,22 +6667,16 @@ int lua_cocos2dx_ui_Button_getNormalFile(lua_State* tolua_S) { int argc = 0; cocos2d::ui::Button* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ccui.Button",0,&tolua_err)) goto tolua_lerror; #endif cobj = (cocos2d::ui::Button*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) - { + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Button_getNormalFile'", nullptr); return 0; } @@ -6713,24 +6685,20 @@ int lua_cocos2dx_ui_Button_getNormalFile(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 0) { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_Button_getNormalFile'", nullptr); - return 0; - } cocos2d::ResourceData ret = cobj->getNormalFile(); - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; - return 1; + lua_pushinteger(tolua_S, ret.type); + lua_pushlstring(tolua_S, ret.file.c_str(), ret.file.size()); + lua_pushlstring(tolua_S, ret.plist.c_str(), ret.plist.size()); + return 3; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.Button:getNormalFile",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: +tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Button_getNormalFile'.",&tolua_err); -#endif - return 0; +#endif } int lua_cocos2dx_ui_Button_resetNormalRender(lua_State* tolua_S) { @@ -7737,48 +7705,37 @@ int lua_cocos2dx_ui_Button_getPressedFile(lua_State* tolua_S) { int argc = 0; cocos2d::ui::Button* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ccui.Button",0,&tolua_err)) goto tolua_lerror; #endif cobj = (cocos2d::ui::Button*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) - { + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Button_getPressedFile'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_Button_getPressedFile'", nullptr); - return 0; - } + if (argc == 0) { cocos2d::ResourceData ret = cobj->getPressedFile(); - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; - return 1; + lua_pushinteger(tolua_S, ret.type); + lua_pushlstring(tolua_S, ret.file.c_str(), ret.file.size()); + lua_pushlstring(tolua_S, ret.plist.c_str(), ret.plist.size()); + return 3; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.Button:getPressedFile",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: +tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Button_getPressedFile'.",&tolua_err); -#endif - return 0; +#endif } int lua_cocos2dx_ui_Button_getTitleLabel(lua_State* tolua_S) { @@ -8015,6 +7972,43 @@ int lua_cocos2dx_ui_Button_getTitleColor(lua_State* tolua_S) return 0; } +int lua_cocos2dx_ui_Button_setTitleOffset(lua_State* tolua_S) +{ + int argc = 0; + cocos2d::ui::Button* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"ccui.Button",0,&tolua_err)) goto tolua_lerror; +#endif + + cobj = (cocos2d::ui::Button*)tolua_tousertype(tolua_S,1,0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Button_setTitleOffset'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) + { + lua_Number x = lua_tonumber(tolua_S, 2); + lua_Number y = lua_tonumber(tolua_S, 3); + cobj->setTitleOffset(x, y); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.Button:setTitleOffset",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Button_setTitleOffset'.",&tolua_err); + return 0; +#endif +} int lua_cocos2dx_ui_Button_setPressedActionEnabled(lua_State* tolua_S) { int argc = 0; @@ -8338,6 +8332,7 @@ int lua_register_cocos2dx_ui_Button(lua_State* tolua_S) tolua_function(tolua_S,"getRendererNormal",lua_cocos2dx_ui_Button_getRendererNormal); tolua_function(tolua_S,"getTitleFontName",lua_cocos2dx_ui_Button_getTitleFontName); tolua_function(tolua_S,"getTitleColor",lua_cocos2dx_ui_Button_getTitleColor); + tolua_function(tolua_S,"setTitleOffset",lua_cocos2dx_ui_Button_setTitleOffset); tolua_function(tolua_S,"setPressedActionEnabled",lua_cocos2dx_ui_Button_setPressedActionEnabled); tolua_function(tolua_S,"setZoomScale",lua_cocos2dx_ui_Button_setZoomScale); tolua_function(tolua_S,"create", lua_cocos2dx_ui_Button_create); @@ -8353,48 +8348,37 @@ int lua_cocos2dx_ui_AbstractCheckButton_getCrossDisabledFile(lua_State* tolua_S) { int argc = 0; cocos2d::ui::AbstractCheckButton* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ccui.AbstractCheckButton",0,&tolua_err)) goto tolua_lerror; #endif cobj = (cocos2d::ui::AbstractCheckButton*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) - { + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_AbstractCheckButton_getCrossDisabledFile'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_AbstractCheckButton_getCrossDisabledFile'", nullptr); - return 0; - } + if (argc == 0) { cocos2d::ResourceData ret = cobj->getCrossDisabledFile(); - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; - return 1; + lua_pushinteger(tolua_S, ret.type); + lua_pushlstring(tolua_S, ret.file.c_str(), ret.file.size()); + lua_pushlstring(tolua_S, ret.plist.c_str(), ret.plist.size()); + return 3; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.AbstractCheckButton:getCrossDisabledFile",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: +tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_AbstractCheckButton_getCrossDisabledFile'.",&tolua_err); -#endif - return 0; +#endif } int lua_cocos2dx_ui_AbstractCheckButton_getBackDisabledFile(lua_State* tolua_S) { @@ -8404,44 +8388,34 @@ int lua_cocos2dx_ui_AbstractCheckButton_getBackDisabledFile(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ccui.AbstractCheckButton",0,&tolua_err)) goto tolua_lerror; #endif cobj = (cocos2d::ui::AbstractCheckButton*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) - { + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_AbstractCheckButton_getBackDisabledFile'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_AbstractCheckButton_getBackDisabledFile'", nullptr); - return 0; - } + if (argc == 0) { cocos2d::ResourceData ret = cobj->getBackDisabledFile(); - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; - return 1; + lua_pushinteger(tolua_S, ret.type); + lua_pushlstring(tolua_S, ret.file.c_str(), ret.file.size()); + lua_pushlstring(tolua_S, ret.plist.c_str(), ret.plist.size()); + return 3; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.AbstractCheckButton:getBackDisabledFile",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: +tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_AbstractCheckButton_getBackDisabledFile'.",&tolua_err); -#endif - return 0; +#endif } int lua_cocos2dx_ui_AbstractCheckButton_loadTextureBackGroundSelected(lua_State* tolua_S) { @@ -8581,48 +8555,37 @@ int lua_cocos2dx_ui_AbstractCheckButton_getCrossNormalFile(lua_State* tolua_S) { int argc = 0; cocos2d::ui::AbstractCheckButton* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ccui.AbstractCheckButton",0,&tolua_err)) goto tolua_lerror; #endif cobj = (cocos2d::ui::AbstractCheckButton*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) - { + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_AbstractCheckButton_getCrossNormalFile'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_AbstractCheckButton_getCrossNormalFile'", nullptr); - return 0; - } + if (argc == 0) { cocos2d::ResourceData ret = cobj->getCrossNormalFile(); - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; - return 1; + lua_pushinteger(tolua_S, ret.type); + lua_pushlstring(tolua_S, ret.file.c_str(), ret.file.size()); + lua_pushlstring(tolua_S, ret.plist.c_str(), ret.plist.size()); + return 3; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.AbstractCheckButton:getCrossNormalFile",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: +tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_AbstractCheckButton_getCrossNormalFile'.",&tolua_err); -#endif - return 0; +#endif } int lua_cocos2dx_ui_AbstractCheckButton_setSelected(lua_State* tolua_S) { @@ -8678,48 +8641,37 @@ int lua_cocos2dx_ui_AbstractCheckButton_getBackPressedFile(lua_State* tolua_S) { int argc = 0; cocos2d::ui::AbstractCheckButton* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ccui.AbstractCheckButton",0,&tolua_err)) goto tolua_lerror; #endif cobj = (cocos2d::ui::AbstractCheckButton*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) - { + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_AbstractCheckButton_getBackPressedFile'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_AbstractCheckButton_getBackPressedFile'", nullptr); - return 0; - } + if (argc == 0) { cocos2d::ResourceData ret = cobj->getBackPressedFile(); - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; - return 1; + lua_pushinteger(tolua_S, ret.type); + lua_pushlstring(tolua_S, ret.file.c_str(), ret.file.size()); + lua_pushlstring(tolua_S, ret.plist.c_str(), ret.plist.size()); + return 3; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.AbstractCheckButton:getBackPressedFile",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: +tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_AbstractCheckButton_getBackPressedFile'.",&tolua_err); -#endif - return 0; +#endif } int lua_cocos2dx_ui_AbstractCheckButton_getRendererFrontCrossDisabled(lua_State* tolua_S) { @@ -9071,48 +9023,37 @@ int lua_cocos2dx_ui_AbstractCheckButton_getBackNormalFile(lua_State* tolua_S) { int argc = 0; cocos2d::ui::AbstractCheckButton* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ccui.AbstractCheckButton",0,&tolua_err)) goto tolua_lerror; #endif cobj = (cocos2d::ui::AbstractCheckButton*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) - { + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_AbstractCheckButton_getBackNormalFile'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_AbstractCheckButton_getBackNormalFile'", nullptr); - return 0; - } + if (argc == 0) { cocos2d::ResourceData ret = cobj->getBackNormalFile(); - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; - return 1; + lua_pushinteger(tolua_S, ret.type); + lua_pushlstring(tolua_S, ret.file.c_str(), ret.file.size()); + lua_pushlstring(tolua_S, ret.plist.c_str(), ret.plist.size()); + return 3; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.AbstractCheckButton:getBackNormalFile",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: +tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_AbstractCheckButton_getBackNormalFile'.",&tolua_err); -#endif - return 0; +#endif } int lua_cocos2dx_ui_AbstractCheckButton_loadTextures(lua_State* tolua_S) { @@ -11146,48 +11087,37 @@ int lua_cocos2dx_ui_ImageView_getRenderFile(lua_State* tolua_S) { int argc = 0; cocos2d::ui::ImageView* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ccui.ImageView",0,&tolua_err)) goto tolua_lerror; #endif cobj = (cocos2d::ui::ImageView*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) - { + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_ImageView_getRenderFile'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_ImageView_getRenderFile'", nullptr); - return 0; - } + if (argc == 0) { cocos2d::ResourceData ret = cobj->getRenderFile(); - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; - return 1; + lua_pushinteger(tolua_S, ret.type); + lua_pushlstring(tolua_S, ret.file.c_str(), ret.file.size()); + lua_pushlstring(tolua_S, ret.plist.c_str(), ret.plist.size()); + return 3; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.ImageView:getRenderFile",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: +tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_ImageView_getRenderFile'.",&tolua_err); -#endif - return 0; +#endif } int lua_cocos2dx_ui_ImageView_getCapInsets(lua_State* tolua_S) { @@ -13488,48 +13418,37 @@ int lua_cocos2dx_ui_TextAtlas_getRenderFile(lua_State* tolua_S) { int argc = 0; cocos2d::ui::TextAtlas* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ccui.TextAtlas",0,&tolua_err)) goto tolua_lerror; #endif cobj = (cocos2d::ui::TextAtlas*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) - { + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextAtlas_getRenderFile'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_TextAtlas_getRenderFile'", nullptr); - return 0; - } + if (argc == 0) { cocos2d::ResourceData ret = cobj->getRenderFile(); - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; - return 1; + lua_pushinteger(tolua_S, ret.type); + lua_pushlstring(tolua_S, ret.file.c_str(), ret.file.size()); + lua_pushlstring(tolua_S, ret.plist.c_str(), ret.plist.size()); + return 3; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.TextAtlas:getRenderFile",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: +tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextAtlas_getRenderFile'.",&tolua_err); -#endif - return 0; +#endif } int lua_cocos2dx_ui_TextAtlas_setProperty(lua_State* tolua_S) { @@ -13967,48 +13886,37 @@ int lua_cocos2dx_ui_LoadingBar_getRenderFile(lua_State* tolua_S) { int argc = 0; cocos2d::ui::LoadingBar* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ccui.LoadingBar",0,&tolua_err)) goto tolua_lerror; #endif cobj = (cocos2d::ui::LoadingBar*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) - { + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_LoadingBar_getRenderFile'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_LoadingBar_getRenderFile'", nullptr); - return 0; - } + if (argc == 0) { cocos2d::ResourceData ret = cobj->getRenderFile(); - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; - return 1; + lua_pushinteger(tolua_S, ret.type); + lua_pushlstring(tolua_S, ret.file.c_str(), ret.file.size()); + lua_pushlstring(tolua_S, ret.plist.c_str(), ret.plist.size()); + return 3; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.LoadingBar:getRenderFile",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: +tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_LoadingBar_getRenderFile'.",&tolua_err); -#endif - return 0; +#endif } int lua_cocos2dx_ui_LoadingBar_setScale9Enabled(lua_State* tolua_S) { @@ -20188,48 +20096,37 @@ int lua_cocos2dx_ui_Slider_getBallNormalFile(lua_State* tolua_S) { int argc = 0; cocos2d::ui::Slider* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ccui.Slider",0,&tolua_err)) goto tolua_lerror; #endif cobj = (cocos2d::ui::Slider*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) - { + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Slider_getBallNormalFile'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_Slider_getBallNormalFile'", nullptr); - return 0; - } + if (argc == 0) { cocos2d::ResourceData ret = cobj->getBallNormalFile(); - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; - return 1; + lua_pushinteger(tolua_S, ret.type); + lua_pushlstring(tolua_S, ret.file.c_str(), ret.file.size()); + lua_pushlstring(tolua_S, ret.plist.c_str(), ret.plist.size()); + return 3; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.Slider:getBallNormalFile",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: +tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Slider_getBallNormalFile'.",&tolua_err); -#endif - return 0; +#endif } int lua_cocos2dx_ui_Slider_getSlidBallDisabledRenderer(lua_State* tolua_S) { @@ -20332,48 +20229,38 @@ int lua_cocos2dx_ui_Slider_getBallPressedFile(lua_State* tolua_S) { int argc = 0; cocos2d::ui::Slider* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ccui.Slider",0,&tolua_err)) goto tolua_lerror; #endif cobj = (cocos2d::ui::Slider*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) - { + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Slider_getBallPressedFile'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_Slider_getBallPressedFile'", nullptr); - return 0; - } + if (argc == 0) { + cocos2d::ResourceData ret = cobj->getBallPressedFile(); - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; - return 1; + lua_pushinteger(tolua_S, ret.type); + lua_pushlstring(tolua_S, ret.file.c_str(), ret.file.size()); + lua_pushlstring(tolua_S, ret.plist.c_str(), ret.plist.size()); + return 3; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.Slider:getBallPressedFile",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: +tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Slider_getBallPressedFile'.",&tolua_err); -#endif - return 0; +#endif } int lua_cocos2dx_ui_Slider_getZoomScale(lua_State* tolua_S) { @@ -20804,48 +20691,37 @@ int lua_cocos2dx_ui_Slider_getProgressBarFile(lua_State* tolua_S) { int argc = 0; cocos2d::ui::Slider* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ccui.Slider",0,&tolua_err)) goto tolua_lerror; #endif cobj = (cocos2d::ui::Slider*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) - { + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Slider_getProgressBarFile'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_Slider_getProgressBarFile'", nullptr); - return 0; - } + if (argc == 0) { cocos2d::ResourceData ret = cobj->getProgressBarFile(); - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; - return 1; + lua_pushinteger(tolua_S, ret.type); + lua_pushlstring(tolua_S, ret.file.c_str(), ret.file.size()); + lua_pushlstring(tolua_S, ret.plist.c_str(), ret.plist.size()); + return 3; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.Slider:getProgressBarFile",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: +tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Slider_getProgressBarFile'.",&tolua_err); -#endif - return 0; +#endif } int lua_cocos2dx_ui_Slider_getCapInsetsBarRenderer(lua_State* tolua_S) { @@ -21106,48 +20982,37 @@ int lua_cocos2dx_ui_Slider_getBackFile(lua_State* tolua_S) { int argc = 0; cocos2d::ui::Slider* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ccui.Slider",0,&tolua_err)) goto tolua_lerror; #endif cobj = (cocos2d::ui::Slider*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) - { + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Slider_getBackFile'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_Slider_getBackFile'", nullptr); - return 0; - } + if (argc == 0) { cocos2d::ResourceData ret = cobj->getBackFile(); - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; - return 1; + lua_pushinteger(tolua_S, ret.type); + lua_pushlstring(tolua_S, ret.file.c_str(), ret.file.size()); + lua_pushlstring(tolua_S, ret.plist.c_str(), ret.plist.size()); + return 3; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.Slider:getBackFile",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: +tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Slider_getBackFile'.",&tolua_err); -#endif - return 0; +#endif } int lua_cocos2dx_ui_Slider_isScale9Enabled(lua_State* tolua_S) { @@ -21200,48 +21065,37 @@ int lua_cocos2dx_ui_Slider_getBallDisabledFile(lua_State* tolua_S) { int argc = 0; cocos2d::ui::Slider* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ccui.Slider",0,&tolua_err)) goto tolua_lerror; #endif cobj = (cocos2d::ui::Slider*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) - { + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_Slider_getBallDisabledFile'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_Slider_getBallDisabledFile'", nullptr); - return 0; - } + if (argc == 0) { cocos2d::ResourceData ret = cobj->getBallDisabledFile(); - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; - return 1; + lua_pushinteger(tolua_S, ret.type); + lua_pushlstring(tolua_S, ret.file.c_str(), ret.file.size()); + lua_pushlstring(tolua_S, ret.plist.c_str(), ret.plist.size()); + return 3; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.Slider:getBallDisabledFile",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: +tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_Slider_getBallDisabledFile'.",&tolua_err); -#endif - return 0; +#endif } int lua_cocos2dx_ui_Slider_setCapInsetsBarRenderer(lua_State* tolua_S) { @@ -24280,48 +24134,37 @@ int lua_cocos2dx_ui_TextBMFont_getRenderFile(lua_State* tolua_S) { int argc = 0; cocos2d::ui::TextBMFont* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; -#endif - - -#if COCOS2D_DEBUG >= 1 if (!tolua_isusertype(tolua_S,1,"ccui.TextBMFont",0,&tolua_err)) goto tolua_lerror; #endif cobj = (cocos2d::ui::TextBMFont*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) - { + if (!cobj) { tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_ui_TextBMFont_getRenderFile'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) - { - if(!ok) - { - tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_TextBMFont_getRenderFile'", nullptr); - return 0; - } + if (argc == 0) { cocos2d::ResourceData ret = cobj->getRenderFile(); - #pragma warning NO CONVERSION FROM NATIVE FOR ResourceData; - return 1; + lua_pushinteger(tolua_S, ret.type); + lua_pushlstring(tolua_S, ret.file.c_str(), ret.file.size()); + lua_pushlstring(tolua_S, ret.plist.c_str(), ret.plist.size()); + return 3; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "ccui.TextBMFont:getRenderFile",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 - tolua_lerror: +tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_ui_TextBMFont_getRenderFile'.",&tolua_err); -#endif - return 0; +#endif } int lua_cocos2dx_ui_TextBMFont_setFntFile(lua_State* tolua_S) { diff --git a/cocos/scripting/lua-bindings/manual/CCLuaEngine.cpp b/cocos/scripting/lua-bindings/manual/CCLuaEngine.cpp index f5b45362..7d7600ea 100644 --- a/cocos/scripting/lua-bindings/manual/CCLuaEngine.cpp +++ b/cocos/scripting/lua-bindings/manual/CCLuaEngine.cpp @@ -34,7 +34,6 @@ #include "base/CCDirector.h" #include "base/CCEventCustom.h" -#pragma comment(lib,"lua51.lib") NS_CC_BEGIN diff --git a/cocos/scripting/lua-bindings/manual/audio/lua_audio_manual.cpp b/cocos/scripting/lua-bindings/manual/audio/lua_audio_manual.cpp index 6e5c8f57..7f9b8244 100755 --- a/cocos/scripting/lua-bindings/manual/audio/lua_audio_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/audio/lua_audio_manual.cpp @@ -126,7 +126,7 @@ static int lSourcePlay2d(lua_State *L) int isLoop = lua_toboolean(L, 3); if (sourceItem->deleted || bufferItem->deleted) { - cocos2d::log("Rapid2D_CAudioBuffer.play2d() fail for deleted!"); + cocos2d::log("Rapid2D_CAudioPlayer.play2d() fail for deleted!"); return 0; } @@ -144,7 +144,7 @@ static int lSourcePause(lua_State *L) { RDAudioItem *sourceItem = (RDAudioItem *)luaL_checkudata(L, 1, RD_AUDIO_SOURCE); if (sourceItem->deleted) { - cocos2d::log("Rapid2D_CAudioBuffer.pause() fail for deleted!"); + cocos2d::log("Rapid2D_CAudioPlayer.pause() fail for deleted!"); return 0; } alSourcePause(sourceItem->id); @@ -155,7 +155,7 @@ static int lSourceResume(lua_State *L) { RDAudioItem *sourceItem = (RDAudioItem *)luaL_checkudata(L, 1, RD_AUDIO_SOURCE); if (sourceItem->deleted) { - cocos2d::log("Rapid2D_CAudioBuffer.resume() fail for deleted!"); + cocos2d::log("Rapid2D_CAudioPlayer.resume() fail for deleted!"); return 0; } ALint stat; @@ -170,7 +170,7 @@ static int lSourceStop(lua_State *L) { RDAudioItem *sourceItem = (RDAudioItem *)luaL_checkudata(L, 1, RD_AUDIO_SOURCE); if (sourceItem->deleted) { - cocos2d::log("Rapid2D_CAudioBuffer.stop() fail for deleted!"); + cocos2d::log("Rapid2D_CAudioPlayer.stop() fail for deleted!"); return 0; } alSourceStop(sourceItem->id); @@ -183,7 +183,7 @@ static int lSourceSetVolume(lua_State *L) { RDAudioItem *sourceItem = (RDAudioItem *)luaL_checkudata(L, 1, RD_AUDIO_SOURCE); if (sourceItem->deleted) { - cocos2d::log("Rapid2D_CAudioBuffer.setVolume() fail for deleted!"); + cocos2d::log("Rapid2D_CAudioPlayer.setVolume() fail for deleted!"); return 0; } @@ -202,7 +202,7 @@ static int lSourceGetStat(lua_State *L) { RDAudioItem *sourceItem = (RDAudioItem *)luaL_checkudata(L, 1, RD_AUDIO_SOURCE); if (sourceItem->deleted) { - cocos2d::log("Rapid2D_CAudioBuffer.getStat() fail for deleted!"); + cocos2d::log("Rapid2D_CAudioPlayer.getStat() fail for deleted!"); return 0; } @@ -222,7 +222,7 @@ static int lSourceGetStat(lua_State *L) lua_pushinteger(L, 4); break; default: - cocos2d::log("Rapid2D_CAudioBuffer.getStat() failed!"); + cocos2d::log("Rapid2D_CAudioPlayer.getStat() failed!"); return 0; } return 1; diff --git a/cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.cpp b/cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.cpp index 8dc1c879..c728f03e 100644 --- a/cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/cocos2d/lua_cocos2dx_manual.cpp @@ -1,6 +1,7 @@ /**************************************************************************** Copyright (c) 2013-2016 Chukong Technologies Inc. Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. + Copyright (c) 2020-2022 cocos2d-lua.org http://www.cocos2d-x.org @@ -2084,8 +2085,8 @@ static int tolua_cocos2dx_FileUtils_getStringFromFile(lua_State* tolua_S) if (1 == argc) { - const char* arg0; - std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "cc.FileUtils:getStringFromFile"); arg0 = arg0_tmp.c_str(); + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2, &arg0, "cc.FileUtils:getStringFromFile"); if (ok) { std::string contentsOfFile = FileUtils::getInstance()->getStringFromFile(arg0); @@ -2106,52 +2107,75 @@ static int tolua_cocos2dx_FileUtils_getStringFromFile(lua_State* tolua_S) static int tolua_cocos2dx_FileUtils_getDataFromFile(lua_State* tolua_S) { - if (nullptr == tolua_S) - return 0; + if (nullptr == tolua_S) + return 0; - int argc = 0; - FileUtils* self = nullptr; - bool ok = true; + int argc = 0; + FileUtils* self = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"cc.FileUtils",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S, 1, "cc.FileUtils", 0, &tolua_err)) goto tolua_lerror; #endif - self = static_cast(tolua_tousertype(tolua_S,1,0)); + self = static_cast(tolua_tousertype(tolua_S, 1, 0)); #if COCOS2D_DEBUG >= 1 - if (nullptr == self) - { - tolua_error(tolua_S,"invalid 'self' in function 'tolua_cocos2dx_FileUtils_getDataFromFile'\n", nullptr); - return 0; - } + if (nullptr == self) + { + tolua_error(tolua_S, "invalid 'self' in function 'tolua_cocos2dx_FileUtils_getDataFromFile'\n", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S) - 1; + argc = lua_gettop(tolua_S) - 1; - if (1 == argc) - { - const char* arg0; - std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "cc.FileUtils:getDataFromFile"); arg0 = arg0_tmp.c_str(); + if (1 == argc) + { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2, &arg0, "cc.FileUtils:getDataFromFile"); + if (ok) + { + auto data = FileUtils::getInstance()->getDataFromFile(arg0); + if (!data.isNull()) + lua_pushlstring(tolua_S, reinterpret_cast(data.getBytes()), static_cast(data.getSize())); + else + lua_pushnil(tolua_S); + return 1; + } + } else if (2 == argc) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2, &arg0, "cc.FileUtils:getDataFromFile"); +#if COCOS2D_DEBUG >= 1 + ok &= toluafix_isfunction(tolua_S, 3, "LUA_FUNCTION", 0, &tolua_err); +#endif if (ok) { - auto data = FileUtils::getInstance()->getDataFromFile(arg0); - if (!data.isNull()) - lua_pushlstring(tolua_S, reinterpret_cast(data.getBytes()), static_cast(data.getSize())); - else - lua_pushnil(tolua_S); + int arg1 = toluafix_ref_function(tolua_S, 3, 0); + ScriptHandlerMgr::HandlerType handlerType = ScriptHandlerMgr::getInstance()->addCustomHandler(self, arg1); + FileUtils::getInstance()->getDataFromFile(arg0, [=](Data data) { + LuaStack* stack = LuaEngine::getInstance()->getLuaStack(); + if (!data.isNull()) + { + stack->pushString(reinterpret_cast(data.getBytes()), static_cast(data.getSize())); + } else { + stack->pushNil(); + } + stack->executeFunctionByHandler(arg1, 1); + ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)self, handlerType); + }); return 1; } - } + } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n", "cc.FileUtils:getDataFromFile", argc, 1); - return 0; + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n", "cc.FileUtils:getDataFromFile", argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'tolua_cocos2dx_FileUtils_getDataFromFile'.",&tolua_err); - return 0; + tolua_error(tolua_S, "#ferror in function 'tolua_cocos2dx_FileUtils_getDataFromFile'.", &tolua_err); + return 0; #endif } @@ -3058,7 +3082,7 @@ static int tolua_cocos2dx_EventListenerKeyboard_create(lua_State* tolua_S) return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n", "cc.EventListenerKeyboard:create", argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n", "cc.EventListenerKeyboard:create", argc, 0); return 0; #if COCOS2D_DEBUG >= 1 @@ -4771,58 +4795,69 @@ static void extendApplication(lua_State* tolua_S) static int lua_cocos2dx_TextureCache_addImageAsync(lua_State* tolua_S) { - if (nullptr == tolua_S) - return 0 ; - int argc = 0; - TextureCache* self = nullptr; + TextureCache* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"cc.TextureCache",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S, 1, "cc.TextureCache", 0, &tolua_err)) goto tolua_lerror; #endif - self = static_cast(tolua_tousertype(tolua_S,1,0)); + cobj = static_cast(tolua_tousertype(tolua_S, 1, 0)); #if COCOS2D_DEBUG >= 1 - if (nullptr == self) { - tolua_error(tolua_S,"invalid 'self' in function 'lua_cocos2dx_TextureCache_addImageAsync'\n", NULL); + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_TextureCache_addImageAsync'\n", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S) - 1; - if (2 == argc) + argc = lua_gettop(tolua_S) - 1; + if (argc >= 2) { #if COCOS2D_DEBUG >= 1 if (!tolua_isstring(tolua_S, 2, 0, &tolua_err) || - !toluafix_isfunction(tolua_S,3,"LUA_FUNCTION",0,&tolua_err)) + !toluafix_isfunction(tolua_S, 3, "LUA_FUNCTION", 0, &tolua_err)) { goto tolua_lerror; } + if (argc >= 3 && !tolua_isstring(tolua_S, 4, 0, &tolua_err)) { + goto tolua_lerror; + } + if (argc >= 4 && !tolua_isnumber(tolua_S, 5, 0, &tolua_err)) { + goto tolua_lerror; + } #endif - const char* configFilePath = tolua_tostring(tolua_S, 2, ""); - LUA_FUNCTION handler = ( toluafix_ref_function(tolua_S, 3, 0)); + const char* filePath = tolua_tostring(tolua_S, 2, ""); + LUA_FUNCTION handler = toluafix_ref_function(tolua_S, 3, 0); + const char* callkey = filePath; + backend::PixelFormat pixelFormat = Texture2D::getDefaultAlphaPixelFormat(); + if (argc >= 3) { + callkey = tolua_tostring(tolua_S, 4, ""); + } - self->addImageAsync(configFilePath, [=](Texture2D* tex){ - int ID = (tex) ? (int)tex->_ID : -1; - int* luaID = (tex) ? &tex->_luaID : nullptr; - toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)tex, "cc.Texture2D"); - LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler,1); - LuaEngine::getInstance()->removeScriptHandler(handler); - }); + if (argc >= 4) { + pixelFormat = (backend::PixelFormat)lua_tointeger(tolua_S, 5); + } + + cobj->addImageAsync(filePath, [=](cocos2d::Texture2D* tex) { + object_to_luaval(tolua_S, "cc.Texture2D", tex); + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 1); + toluafix_remove_function_by_refid(tolua_S, handler); + }, callkey, pixelFormat); return 0; } - luaL_error(tolua_S, "%s function of TextureCache has wrong number of arguments: %d, was expecting %d\n", "cc.TextureCache:addImageAsync", argc, 1); + luaL_error(tolua_S, "%s function of TextureCache has wrong number of arguments: %d, was expecting 2~5\n", "cc.TextureCache:addImageAsync", argc); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_TextureCache_addImageAsync'.",&tolua_err); -#endif + tolua_error(tolua_S, "#ferror in function 'lua_cocos2dx_TextureCache_addImageAsync'.", &tolua_err); return 0; +#endif } static void extendTextureCache(lua_State* tolua_S) @@ -6058,15 +6093,16 @@ static int tolua_cocos2d_utils_findChild(lua_State* tolua_S) { #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S, 1, "cc.Node", 0, &tolua_err) || - !tolua_isstring(tolua_S, 2, 0, &tolua_err) + if (!tolua_istable(tolua_S, 1, 0, &tolua_err) || + !tolua_isusertype(tolua_S, 2, "cc.Node", 0, &tolua_err) || + !tolua_isstring(tolua_S, 3, 0, &tolua_err) ) goto tolua_lerror; else #endif { - cocos2d::Node* node = static_cast(tolua_tousertype(tolua_S, 1, nullptr)); - std::string name = tolua_tocppstring(tolua_S, 2, ""); + cocos2d::Node* node = static_cast(tolua_tousertype(tolua_S, 2, nullptr)); + std::string name = tolua_tocppstring(tolua_S, 3, ""); auto obj = cocos2d::utils::findChild(node, name); int ID = (obj) ? (int)obj->_ID : -1; int* luaID = (obj) ? &obj->_luaID : NULL; @@ -6074,9 +6110,30 @@ static int tolua_cocos2d_utils_findChild(lua_State* tolua_S) return 1; } #if COCOS2D_DEBUG >= 1 - tolua_lerror: - tolua_error(tolua_S, "#ferror in function 'tolua_cocos2d_utils_findChild'.", &tolua_err); - return 0; +tolua_lerror: + tolua_error(tolua_S, "#ferror in function 'tolua_cocos2d_utils_findChild'.", &tolua_err); + return 0; +#endif +} + +static int tolua_cocos2d_utils_gettime(lua_State* tolua_S) +{ +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_istable(tolua_S, 1, 0, &tolua_err) || + !tolua_isnoobj(tolua_S, 2, &tolua_err)) + goto tolua_lerror; + else +#endif + { + double time = cocos2d::utils::gettime(); + lua_pushnumber(tolua_S, time); + return 1; + } +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S, "#ferror in function 'tolua_cocos2d_utils_gettime'.", &tolua_err); + return 0; #endif } @@ -6093,7 +6150,8 @@ int register_all_cocos2dx_module_manual(lua_State* tolua_S) tolua_function(tolua_S, "captureScreen", tolua_cocos2d_utils_captureScreen); tolua_function(tolua_S, "captureNode", tolua_cocos2d_utils_captureNode); tolua_function(tolua_S, "findChildren", tolua_cocos2d_utils_findChildren); - tolua_function(tolua_S, "findChild", tolua_cocos2d_utils_findChild); + tolua_function(tolua_S, "findChild", tolua_cocos2d_utils_findChild); + tolua_function(tolua_S, "gettime", tolua_cocos2d_utils_gettime); tolua_endmodule(tolua_S); tolua_endmodule(tolua_S); @@ -6549,7 +6607,7 @@ int tolua_cocos2d_Mat4_translate(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; #endif - if (argc == 1) + if (argc == 2) { #if COCOS2D_DEBUG >= 1 diff --git a/cocos/scripting/lua-bindings/manual/cocostudio/lua_cocos2dx_coco_studio_manual.cpp b/cocos/scripting/lua-bindings/manual/cocostudio/lua_cocos2dx_coco_studio_manual.cpp index 8d2dbb6d..0590a257 100644 --- a/cocos/scripting/lua-bindings/manual/cocostudio/lua_cocos2dx_coco_studio_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/cocostudio/lua_cocos2dx_coco_studio_manual.cpp @@ -35,6 +35,12 @@ #include "scripting/lua-bindings/manual/CCLuaEngine.h" #include "scripting/lua-bindings/manual/cocostudio/CustomGUIReader.h" +// HandlerType for addObjectHandler +enum { + HT_TIMELINE_FRAME_EVENT = 2000, // studio lua binding handler type begin + HT_TIMELINE_LAST_FRAME, +}; + using namespace cocostudio; class LuaArmatureWrapper:public Ref @@ -102,7 +108,7 @@ static int lua_cocos2dx_ArmatureAnimation_setMovementEventCallFunc(lua_State* L) } #endif - LUA_FUNCTION handler = ( toluafix_ref_function(L,2,0)); + LUA_FUNCTION handler = toluafix_ref_function(L,2,0); LuaArmatureWrapper* wrapper = new (std::nothrow) LuaArmatureWrapper(); wrapper->autorelease(); @@ -110,18 +116,13 @@ static int lua_cocos2dx_ArmatureAnimation_setMovementEventCallFunc(lua_State* L) Vector vec; vec.pushBack(wrapper); ScriptHandlerMgr::getInstance()->addObjectHandler((void*)wrapper, handler, ScriptHandlerMgr::HandlerType::ARMATURE_EVENT); - - self->setMovementEventCallFunc([=](Armature *armature, MovementEventType movementType, const std::string& movementID){ - + self->setMovementEventCallFunc([=](Armature *armature, MovementEventType movementType, const std::string& movementID) { if (0 != handler) { std::string strMovementID = movementID; LuaArmatureMovementEventData movementData(armature,(int)movementType, strMovementID); - - LuaArmatureWrapperEventData wrapperData(LuaArmatureWrapperEventData::LuaArmatureWrapperEventType::MOVEMENT_EVENT , (void*)&movementData); - + LuaArmatureWrapperEventData wrapperData(LuaArmatureWrapperEventData::LuaArmatureWrapperEventType::MOVEMENT_EVENT, (void*)&movementData); BasicScriptData data((void*)vec.at(0),(void*)&wrapperData); - LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::ARMATURE_EVENT, (void*)&data); } }); @@ -171,7 +172,7 @@ static int lua_cocos2dx_ArmatureAnimation_setFrameEventCallFunc(lua_State* L) } #endif - LUA_FUNCTION handler = ( toluafix_ref_function(L,2,0)); + LUA_FUNCTION handler = toluafix_ref_function(L,2,0); LuaArmatureWrapper* wrapper = new (std::nothrow) LuaArmatureWrapper(); wrapper->autorelease(); @@ -180,27 +181,20 @@ static int lua_cocos2dx_ArmatureAnimation_setFrameEventCallFunc(lua_State* L) vec.pushBack(wrapper); ScriptHandlerMgr::getInstance()->addObjectHandler((void*)wrapper, handler, ScriptHandlerMgr::HandlerType::ARMATURE_EVENT); - self->setFrameEventCallFunc([=](cocostudio::Bone *bone, const std::string& frameEventName, int originFrameIndex, int currentFrameIndex){ - if (0 != handler) { std::string strFrameEventName(frameEventName); - LuaArmatureFrameEventData frameData(bone,frameEventName,originFrameIndex,currentFrameIndex); - LuaArmatureWrapperEventData wrapperData(LuaArmatureWrapperEventData::LuaArmatureWrapperEventType::FRAME_EVENT , (void*)&frameData); - BasicScriptData data((void*)vec.at(0),(void*)&wrapperData); - LuaEngine::getInstance()->handleEvent(ScriptHandlerMgr::HandlerType::ARMATURE_EVENT, (void*)&data); } }); - + return 0; } - luaL_error(L, "'setFrameEventCallFunc' function of ArmatureAnimation has wrong number of arguments: %d, was expecting %d\n", argc, 1); #if COCOS2D_DEBUG >= 1 @@ -255,13 +249,12 @@ static int lua_cocos2dx_ArmatureDataManager_addArmatureFileInfoAsyncCallFunc(lua } #endif const char* configFilePath = tolua_tostring(L, 2, ""); - LUA_FUNCTION handler = ( toluafix_ref_function(L, 3, 0)); + LUA_FUNCTION handler = toluafix_ref_function(L, 3, 0); LuaArmatureWrapper* wrapper = new (std::nothrow) LuaArmatureWrapper(); wrapper->autorelease(); ScriptHandlerMgr::getInstance()->addObjectHandler((void*)wrapper, handler, ScriptHandlerMgr::HandlerType::ARMATURE_EVENT); - self->addArmatureFileInfoAsync(configFilePath, wrapper, CC_SCHEDULE_SELECTOR(LuaArmatureWrapper::addArmatureFileInfoAsyncCallback)); return 0; @@ -281,13 +274,12 @@ static int lua_cocos2dx_ArmatureDataManager_addArmatureFileInfoAsyncCallFunc(lua const char* plistPath = tolua_tostring(L, 3, ""); const char* configFilePath = tolua_tostring(L, 4, ""); - LUA_FUNCTION handler = ( toluafix_ref_function(L,5,0)); + LUA_FUNCTION handler = toluafix_ref_function(L,5,0); LuaArmatureWrapper* wrapper = new (std::nothrow) LuaArmatureWrapper(); wrapper->autorelease(); ScriptHandlerMgr::getInstance()->addObjectHandler((void*)wrapper, handler, ScriptHandlerMgr::HandlerType::ARMATURE_EVENT); - self->addArmatureFileInfoAsync(imagePath, plistPath,configFilePath,wrapper, CC_SCHEDULE_SELECTOR(LuaArmatureWrapper::addArmatureFileInfoAsyncCallback)); return 0; @@ -455,9 +447,6 @@ static void extendActionTimelineCache(lua_State* L) static int lua_cocos2dx_ActionTimeline_setFrameEventCallFunc(lua_State* L) { - if (nullptr == L) - return 0; - int argc = 0; cocostudio::timeline::ActionTimeline* self = nullptr; @@ -476,25 +465,27 @@ static int lua_cocos2dx_ActionTimeline_setFrameEventCallFunc(lua_State* L) #endif argc = lua_gettop(L) - 1; - if (1 == argc) - { + if (0 == argc) { + self->clearFrameEventCallFunc(); + ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)self, (ScriptHandlerMgr::HandlerType)HT_TIMELINE_FRAME_EVENT); + return 0; + } else if (1 == argc) { #if COCOS2D_DEBUG >= 1 if (!toluafix_isfunction(L,2,"LUA_FUNCTION",0,&tolua_err) ) { goto tolua_lerror; } #endif - - LUA_FUNCTION handler = ( toluafix_ref_function(L,2,0)); - self->setFrameEventCallFunc([=](cocostudio::timeline::Frame* frame){ - toluafix_pushusertype_ccobject(L, frame->_ID, &frame->_luaID, (void*)frame, getLuaTypeName(frame, "ccs.Frame")); + LUA_FUNCTION handler = toluafix_ref_function(L, 2, 0); + self->setFrameEventCallFunc([=](cocostudio::timeline::Frame* frame) { + lua_State *coroutine = LuaEngine::getInstance()->getLuaStack()->getLuaState(); + object_to_luaval(coroutine, "ccs.Frame", frame); LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 1); }); - + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)self, handler, (ScriptHandlerMgr::HandlerType)HT_TIMELINE_FRAME_EVENT); return 0; } - luaL_error(L, "'setFrameEventCallFunc' function of ActionTimeline has wrong number of arguments: %d, was expecting %d\n", argc, 1); #if COCOS2D_DEBUG >= 1 @@ -504,6 +495,56 @@ static int lua_cocos2dx_ActionTimeline_setFrameEventCallFunc(lua_State* L) return 0; } +static int lua_cocos2dx_studio_ActionTimeline_setLastFrameCallFunc(lua_State* tolua_S) +{ + int argc = 0; + cocostudio::timeline::ActionTimeline* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S, 1, "ccs.ActionTimeline", 0, &tolua_err))goto tolua_lerror; +#endif + + cobj = (cocostudio::timeline::ActionTimeline*)tolua_tousertype(tolua_S, 1, 0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S, "invalid 'cobj' in function 'lua_cocos2dx_studio_ActionTimeline_setLastFrameCallFunc'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S) - 1; + + if (0 == argc) { + cobj->clearLastFrameCallFunc(); + ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)cobj, (ScriptHandlerMgr::HandlerType)HT_TIMELINE_LAST_FRAME); + return 0; + } else if (1 == argc) { +#if COCOS2D_DEBUG >= 1 + if (!toluafix_isfunction(tolua_S, 2, "LUA_FUNCTION", 0, &tolua_err)) + { + goto tolua_lerror; + } +#endif + LUA_FUNCTION handler = (toluafix_ref_function(tolua_S, 2, 0)); + cobj->setLastFrameCallFunc([=]() { + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 0); + }); + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)cobj, handler, (ScriptHandlerMgr::HandlerType)HT_TIMELINE_LAST_FRAME); + return 0; + } + + luaL_error(tolua_S, "'setLastFrameCallFunc' function of ActionTimeline has wrong number of arguments: %d, was expecting %d\n", argc, 1); + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S, "#ferror in function 'setLastFrameCallFunc'.", &tolua_err); +#endif + return 0; +} + static void extendActionTimeline(lua_State* L) { lua_pushstring(L, "ccs.ActionTimeline"); @@ -511,6 +552,7 @@ static void extendActionTimeline(lua_State* L) if (lua_istable(L,-1)) { tolua_function(L, "setFrameEventCallFunc", lua_cocos2dx_ActionTimeline_setFrameEventCallFunc); + tolua_function(L, "setLastFrameCallFunc", lua_cocos2dx_studio_ActionTimeline_setLastFrameCallFunc); } lua_pop(L, 1); } @@ -550,6 +592,8 @@ int lua_cocos2dx_CustomGUIReader_create(lua_State* L) LUA_FUNCTION arg2 = toluafix_ref_function(L,4,0); cocostudio::CustomGUIReader* ret = cocostudio::CustomGUIReader::create(arg0, arg1, arg2); + ScriptHandlerMgr::getInstance()->addCustomHandler((void*)ret, arg1); + ScriptHandlerMgr::getInstance()->addCustomHandler((void*)ret, arg2); object_to_luaval(L, "ccs.CustomGUIReader",(cocostudio::CustomGUIReader*)ret); return 1; } diff --git a/cocos/scripting/lua-bindings/manual/cocostudio/lua_cocos2dx_csloader_manual.cpp b/cocos/scripting/lua-bindings/manual/cocostudio/lua_cocos2dx_csloader_manual.cpp index 1c371310..ddb8f365 100644 --- a/cocos/scripting/lua-bindings/manual/cocostudio/lua_cocos2dx_csloader_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/cocostudio/lua_cocos2dx_csloader_manual.cpp @@ -98,7 +98,8 @@ int lua_cocos2dx_csloader_CSLoader_createNode(lua_State* tolua_S) auto callback = [handler, tolua_S](cocos2d::Ref* ref){ if (nullptr == ref) return; - toluafix_pushusertype_ccobject(tolua_S, ref->_ID, &(ref->_luaID), (void*)ref,"cc.Ref"); + lua_State *coroutine = LuaEngine::getInstance()->getLuaStack()->getLuaState(); + object_to_luaval(coroutine, "cc.Ref", ref); LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 1); }; diff --git a/cocos/scripting/lua-bindings/manual/extra/lua_crypto_manual.cpp b/cocos/scripting/lua-bindings/manual/extra/lua_crypto_manual.cpp index 7519ef53..46335b89 100644 --- a/cocos/scripting/lua-bindings/manual/extra/lua_crypto_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/extra/lua_crypto_manual.cpp @@ -302,7 +302,8 @@ static int tolua_extra_Crypto_md5File(lua_State* tolua_S) { const char *path = (const char*)tolua_tostring(tolua_S,2,0); - Data data = FileUtils::getInstance()->getDataFromFile(path); + Data data; + FileUtils::getInstance()->getContents(path, &data); // ge raw data, not use getDataFromFile md5_state_t state; md5_byte_t digest[MD5_DIGEST_LENGTH]; char hexOutput[(MD5_DIGEST_LENGTH << 1) + 1] = { 0 }; diff --git a/cocos/scripting/lua-bindings/manual/fairygui/lua_fairygui.cpp b/cocos/scripting/lua-bindings/manual/fairygui/lua_fairygui.cpp index efdbf7c3..68be4f75 100644 --- a/cocos/scripting/lua-bindings/manual/fairygui/lua_fairygui.cpp +++ b/cocos/scripting/lua-bindings/manual/fairygui/lua_fairygui.cpp @@ -5,59 +5,103 @@ #include "FairyGUI.h" #include "utils/html/HtmlElement.h" #include "utils/html/HtmlObject.h" +#include "display/FUISprite.h" + +// HandlerType for addObjectHandler +enum { + HT_UICONFIG_MUSIC = 1000, // FairyGUI lua binding handler type begin + HT_GLIST_RENDERER, + HT_GLIST_PROVIDER, + HT_GTREE_RENDERER, + HT_GTREE_WILLEXPAND, + HT_GOBJECT_CLICKED, +}; static void margin_to_luaval(lua_State* L, const fairygui::Margin& _margin) { - lua_newtable(L); - lua_pushstring(L, "left"); - lua_pushnumber(L, (lua_Number)_margin.left); - lua_rawset(L, -3); - lua_pushstring(L, "top"); - lua_pushnumber(L, (lua_Number)_margin.top); - lua_rawset(L, -3); - lua_pushstring(L, "right"); - lua_pushnumber(L, (lua_Number)_margin.right); - lua_rawset(L, -3); - lua_pushstring(L, "bottom"); - lua_pushnumber(L, (lua_Number)_margin.bottom); - lua_rawset(L, -3); + lua_newtable(L); + lua_pushstring(L, "left"); + lua_pushnumber(L, (lua_Number)_margin.left); + lua_rawset(L, -3); + lua_pushstring(L, "top"); + lua_pushnumber(L, (lua_Number)_margin.top); + lua_rawset(L, -3); + lua_pushstring(L, "right"); + lua_pushnumber(L, (lua_Number)_margin.right); + lua_rawset(L, -3); + lua_pushstring(L, "bottom"); + lua_pushnumber(L, (lua_Number)_margin.bottom); + lua_rawset(L, -3); } -bool luaval_to_margin(lua_State* L, int lo, fairygui::Margin* outValue, const char* funcName) +static bool luaval_to_margin(lua_State* L, int lo, fairygui::Margin* outValue, const char* funcName) { - bool ok = true; + bool ok = true; - tolua_Error tolua_err; - if (!tolua_istable(L, lo, 0, &tolua_err)) { + tolua_Error tolua_err; + if (!tolua_istable(L, lo, 0, &tolua_err)) { #if COCOS2D_DEBUG >=1 - luaval_to_native_err(L, "#ferror:", &tolua_err, funcName); + luaval_to_native_err(L, "#ferror:", &tolua_err, funcName); #endif - ok = false; - } + ok = false; + } - if (ok) { - lua_pushstring(L, "left"); - lua_gettable(L, lo); - outValue->left = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1); - lua_pop(L, 1); - - lua_pushstring(L, "top"); - lua_gettable(L, lo); - outValue->top = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1); - lua_pop(L, 1); - - lua_pushstring(L, "right"); - lua_gettable(L, lo); - outValue->right = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1); - lua_pop(L, 1); - - lua_pushstring(L, "bottom"); - lua_gettable(L, lo); - outValue->bottom = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1); - lua_pop(L, 1); - } + if (ok) { + lua_pushstring(L, "left"); + lua_gettable(L, lo); + outValue->left = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushstring(L, "top"); + lua_gettable(L, lo); + outValue->top = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushstring(L, "right"); + lua_gettable(L, lo); + outValue->right = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1); + lua_pop(L, 1); + + lua_pushstring(L, "bottom"); + lua_gettable(L, lo); + outValue->bottom = lua_isnil(L, -1) ? 0 : lua_tonumber(L, -1); + lua_pop(L, 1); + } + + return ok; +} + +static bool luaval_to_array_of_float(lua_State* L, int lo, float **floats, int *count, const char* funcName) +{ + if (NULL == L) + return false; + + bool ok = true; + tolua_Error tolua_err; - return ok; + if (!tolua_istable(L, lo, 0, &tolua_err)) { +#if COCOS2D_DEBUG >=1 + luaval_to_native_err(L,"#ferror:", &tolua_err, funcName); +#endif + ok = false; + } + + if (ok) { + size_t len = lua_objlen(L, lo); + if (len > 0) { + float* array = (float*) new float[len]; + if (NULL == array) + return false; + for (size_t i = 0; i < len; ++i) { + lua_rawgeti(L, lo, i + 1); // +1 + array[i] = (float)lua_tonumber(L, -1); + lua_pop(L, 1); // -1 + } + *count = (int)len; + *floats = array; + } + } + return ok; } static int lua_fairygui_InputEvent_getTouchId(lua_State* tolua_S) @@ -89,7 +133,7 @@ static int lua_fairygui_InputEvent_getTouchId(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_InputEvent_getTouchId'.",&tolua_err); - return 0; + return 0; #endif } @@ -122,7 +166,7 @@ static int lua_fairygui_InputEvent_getProcessor(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_InputEvent_getProcessor'.",&tolua_err); - return 0; + return 0; #endif } @@ -155,7 +199,7 @@ static int lua_fairygui_InputEvent_getButton(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_InputEvent_getButton'.",&tolua_err); - return 0; + return 0; #endif } @@ -188,7 +232,7 @@ static int lua_fairygui_InputEvent_isDoubleClick(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_InputEvent_isDoubleClick'.",&tolua_err); - return 0; + return 0; #endif } @@ -221,7 +265,7 @@ static int lua_fairygui_InputEvent_getTouch(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_InputEvent_getTouch'.",&tolua_err); - return 0; + return 0; #endif } @@ -254,7 +298,7 @@ static int lua_fairygui_InputEvent_isAltDown(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_InputEvent_isAltDown'.",&tolua_err); - return 0; + return 0; #endif } @@ -287,7 +331,7 @@ static int lua_fairygui_InputEvent_getTarget(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_InputEvent_getTarget'.",&tolua_err); - return 0; + return 0; #endif } @@ -320,7 +364,7 @@ static int lua_fairygui_InputEvent_getX(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_InputEvent_getX'.",&tolua_err); - return 0; + return 0; #endif } @@ -353,7 +397,7 @@ static int lua_fairygui_InputEvent_getY(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_InputEvent_getY'.",&tolua_err); - return 0; + return 0; #endif } @@ -386,7 +430,7 @@ static int lua_fairygui_InputEvent_getMouseWheelDelta(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_InputEvent_getMouseWheelDelta'.",&tolua_err); - return 0; + return 0; #endif } @@ -419,7 +463,7 @@ static int lua_fairygui_InputEvent_isShiftDown(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_InputEvent_isShiftDown'.",&tolua_err); - return 0; + return 0; #endif } @@ -452,7 +496,7 @@ static int lua_fairygui_InputEvent_isCtrlDown(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_InputEvent_isCtrlDown'.",&tolua_err); - return 0; + return 0; #endif } @@ -485,7 +529,7 @@ static int lua_fairygui_InputEvent_getKeyCode(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_InputEvent_getKeyCode'.",&tolua_err); - return 0; + return 0; #endif } @@ -518,7 +562,7 @@ static int lua_fairygui_InputEvent_getPosition(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_InputEvent_getPosition'.",&tolua_err); - return 0; + return 0; #endif } @@ -528,20 +572,20 @@ static int lua_register_fairygui_InputEvent(lua_State* tolua_S) tolua_cclass(tolua_S,"InputEvent","fairygui.InputEvent","",nullptr); tolua_beginmodule(tolua_S,"InputEvent"); - tolua_function(tolua_S,"getTouchId",lua_fairygui_InputEvent_getTouchId); - tolua_function(tolua_S,"getProcessor",lua_fairygui_InputEvent_getProcessor); - tolua_function(tolua_S,"getButton",lua_fairygui_InputEvent_getButton); - tolua_function(tolua_S,"isDoubleClick",lua_fairygui_InputEvent_isDoubleClick); - tolua_function(tolua_S,"getTouch",lua_fairygui_InputEvent_getTouch); - tolua_function(tolua_S,"isAltDown",lua_fairygui_InputEvent_isAltDown); - tolua_function(tolua_S,"getTarget",lua_fairygui_InputEvent_getTarget); - tolua_function(tolua_S,"getX",lua_fairygui_InputEvent_getX); - tolua_function(tolua_S,"getY",lua_fairygui_InputEvent_getY); - tolua_function(tolua_S,"getMouseWheelDelta",lua_fairygui_InputEvent_getMouseWheelDelta); - tolua_function(tolua_S,"isShiftDown",lua_fairygui_InputEvent_isShiftDown); - tolua_function(tolua_S,"isCtrlDown",lua_fairygui_InputEvent_isCtrlDown); - tolua_function(tolua_S,"getKeyCode",lua_fairygui_InputEvent_getKeyCode); - tolua_function(tolua_S,"getPosition",lua_fairygui_InputEvent_getPosition); + tolua_function(tolua_S,"getTouchId",lua_fairygui_InputEvent_getTouchId); + tolua_function(tolua_S,"getProcessor",lua_fairygui_InputEvent_getProcessor); + tolua_function(tolua_S,"getButton",lua_fairygui_InputEvent_getButton); + tolua_function(tolua_S,"isDoubleClick",lua_fairygui_InputEvent_isDoubleClick); + tolua_function(tolua_S,"getTouch",lua_fairygui_InputEvent_getTouch); + tolua_function(tolua_S,"isAltDown",lua_fairygui_InputEvent_isAltDown); + tolua_function(tolua_S,"getTarget",lua_fairygui_InputEvent_getTarget); + tolua_function(tolua_S,"getX",lua_fairygui_InputEvent_getX); + tolua_function(tolua_S,"getY",lua_fairygui_InputEvent_getY); + tolua_function(tolua_S,"getMouseWheelDelta",lua_fairygui_InputEvent_getMouseWheelDelta); + tolua_function(tolua_S,"isShiftDown",lua_fairygui_InputEvent_isShiftDown); + tolua_function(tolua_S,"isCtrlDown",lua_fairygui_InputEvent_isCtrlDown); + tolua_function(tolua_S,"getKeyCode",lua_fairygui_InputEvent_getKeyCode); + tolua_function(tolua_S,"getPosition",lua_fairygui_InputEvent_getPosition); tolua_endmodule(tolua_S); std::string typeName = typeid(fairygui::InputEvent).name(); g_luaType[typeName] = "fairygui.InputEvent"; @@ -569,7 +613,7 @@ static int lua_fairygui_EventContext_preventDefault(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 0) { cobj->preventDefault(); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.EventContext:preventDefault",argc, 0); return 0; @@ -577,7 +621,7 @@ static int lua_fairygui_EventContext_preventDefault(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_EventContext_preventDefault'.",&tolua_err); - return 0; + return 0; #endif } @@ -610,7 +654,7 @@ static int lua_fairygui_EventContext_isDefaultPrevented(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_EventContext_isDefaultPrevented'.",&tolua_err); - return 0; + return 0; #endif } @@ -643,7 +687,7 @@ static int lua_fairygui_EventContext_getType(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_EventContext_getType'.",&tolua_err); - return 0; + return 0; #endif } @@ -676,7 +720,7 @@ static int lua_fairygui_EventContext_getSender(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_EventContext_getSender'.",&tolua_err); - return 0; + return 0; #endif } @@ -700,7 +744,7 @@ static int lua_fairygui_EventContext_uncaptureTouch(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 0) { cobj->uncaptureTouch(); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.EventContext:uncaptureTouch",argc, 0); return 0; @@ -708,7 +752,7 @@ static int lua_fairygui_EventContext_uncaptureTouch(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_EventContext_uncaptureTouch'.",&tolua_err); - return 0; + return 0; #endif } @@ -741,7 +785,7 @@ static int lua_fairygui_EventContext_getInput(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_EventContext_getInput'.",&tolua_err); - return 0; + return 0; #endif } @@ -765,7 +809,7 @@ static int lua_fairygui_EventContext_captureTouch(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 0) { cobj->captureTouch(); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.EventContext:captureTouch",argc, 0); return 0; @@ -773,7 +817,7 @@ static int lua_fairygui_EventContext_captureTouch(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_EventContext_captureTouch'.",&tolua_err); - return 0; + return 0; #endif } @@ -797,7 +841,7 @@ static int lua_fairygui_EventContext_stopPropagation(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 0) { cobj->stopPropagation(); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.EventContext:stopPropagation",argc, 0); return 0; @@ -805,73 +849,73 @@ static int lua_fairygui_EventContext_stopPropagation(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_EventContext_stopPropagation'.",&tolua_err); - return 0; + return 0; #endif } static int lua_fairygui_EventContext_getData(lua_State* tolua_S) { - int argc = 0; - fairygui::EventContext* cobj = nullptr; + int argc = 0; + fairygui::EventContext* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.EventContext",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.EventContext",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::EventContext*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::EventContext*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_EventContext_getData'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_EventContext_getData'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cocos2d::Ref *ret = (cocos2d::Ref *)cobj->getData(); - object_to_luaval(tolua_S, "cc.Ref", ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.EventContext:getData",argc,0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cocos2d::Ref *ret = (cocos2d::Ref *)cobj->getData(); + object_to_luaval(tolua_S, "cc.Ref", ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.EventContext:getData",argc,0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_EventContext_getData'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_EventContext_getData'.",&tolua_err); + return 0; #endif } static int lua_fairygui_EventContext_getDataValue(lua_State* tolua_S) { - int argc = 0; - fairygui::EventContext* cobj = nullptr; + int argc = 0; + fairygui::EventContext* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.EventContext",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.EventContext",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::EventContext*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::EventContext*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_EventContext_getDataValue'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_EventContext_getDataValue'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - const cocos2d::Value &ret = cobj->getDataValue(); - ccvalue_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.EventContext:getDataValue",argc,0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + const cocos2d::Value &ret = cobj->getDataValue(); + ccvalue_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.EventContext:getDataValue",argc,0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_EventContext_getDataValue'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_EventContext_getDataValue'.",&tolua_err); + return 0; #endif } @@ -881,16 +925,16 @@ static int lua_register_fairygui_EventContext(lua_State* tolua_S) tolua_cclass(tolua_S,"EventContext","fairygui.EventContext","",nullptr); tolua_beginmodule(tolua_S,"EventContext"); - tolua_function(tolua_S,"preventDefault",lua_fairygui_EventContext_preventDefault); - tolua_function(tolua_S,"isDefaultPrevented",lua_fairygui_EventContext_isDefaultPrevented); - tolua_function(tolua_S,"getType",lua_fairygui_EventContext_getType); - tolua_function(tolua_S,"getSender",lua_fairygui_EventContext_getSender); - tolua_function(tolua_S,"uncaptureTouch",lua_fairygui_EventContext_uncaptureTouch); - tolua_function(tolua_S,"getInput",lua_fairygui_EventContext_getInput); - tolua_function(tolua_S,"captureTouch",lua_fairygui_EventContext_captureTouch); - tolua_function(tolua_S,"stopPropagation",lua_fairygui_EventContext_stopPropagation); - tolua_function(tolua_S,"getData",lua_fairygui_EventContext_getData); - tolua_function(tolua_S,"getDataValue",lua_fairygui_EventContext_getDataValue); + tolua_function(tolua_S,"preventDefault",lua_fairygui_EventContext_preventDefault); + tolua_function(tolua_S,"isDefaultPrevented",lua_fairygui_EventContext_isDefaultPrevented); + tolua_function(tolua_S,"getType",lua_fairygui_EventContext_getType); + tolua_function(tolua_S,"getSender",lua_fairygui_EventContext_getSender); + tolua_function(tolua_S,"uncaptureTouch",lua_fairygui_EventContext_uncaptureTouch); + tolua_function(tolua_S,"getInput",lua_fairygui_EventContext_getInput); + tolua_function(tolua_S,"captureTouch",lua_fairygui_EventContext_captureTouch); + tolua_function(tolua_S,"stopPropagation",lua_fairygui_EventContext_stopPropagation); + tolua_function(tolua_S,"getData",lua_fairygui_EventContext_getData); + tolua_function(tolua_S,"getDataValue",lua_fairygui_EventContext_getDataValue); tolua_endmodule(tolua_S); std::string typeName = typeid(fairygui::EventContext).name(); g_luaType[typeName] = "fairygui.EventContext"; @@ -935,7 +979,7 @@ static int lua_fairygui_UIEventDispatcher_isDispatchingEvent(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIEventDispatcher_isDispatchingEvent'.",&tolua_err); - return 0; + return 0; #endif } @@ -959,7 +1003,7 @@ static int lua_fairygui_UIEventDispatcher_removeEventListeners(lua_State* tolua_ argc = lua_gettop(tolua_S)-1; if (argc == 0) { cobj->removeEventListeners(); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.UIEventDispatcher:removeEventListeners",argc, 0); return 0; @@ -967,7 +1011,7 @@ static int lua_fairygui_UIEventDispatcher_removeEventListeners(lua_State* tolua_ #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIEventDispatcher_removeEventListeners'.",&tolua_err); - return 0; + return 0; #endif } @@ -1002,32 +1046,32 @@ static int lua_fairygui_UIEventDispatcher_dispatchEvent(lua_State* tolua_S) return 1; } if (argc == 2) { - int arg0; - cocos2d::Ref *arg1; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.UIEventDispatcher:dispatchEvent"); - ok &= luaval_to_object(tolua_S, 3, "cc.Ref", &arg1, "fairygui.UIEventDispatcher:dispatchEvent"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_UIEventDispatcher_dispatchEvent'", nullptr); - return 0; - } - bool ret = cobj->dispatchEvent(arg0, (void *)arg1); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; + int arg0; + cocos2d::Ref *arg1; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.UIEventDispatcher:dispatchEvent"); + ok &= luaval_to_object(tolua_S, 3, "cc.Ref", &arg1, "fairygui.UIEventDispatcher:dispatchEvent"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_UIEventDispatcher_dispatchEvent'", nullptr); + return 0; + } + bool ret = cobj->dispatchEvent(arg0, (void *)arg1); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; } if (argc == 3) { - int arg0; - cocos2d::Ref *arg1; - cocos2d::Value arg2; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.UIEventDispatcher:dispatchEvent"); - ok &= luaval_to_object(tolua_S, 3, "cc.Ref", &arg1, "fairygui.UIEventDispatcher:dispatchEvent"); - ok &= luaval_to_ccvalue(tolua_S, 4, &arg2, "fairygui.UIEventDispatcher:dispatchEvent"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_UIEventDispatcher_dispatchEvent'", nullptr); - return 0; - } - bool ret = cobj->dispatchEvent(arg0, (void *)arg1, arg2); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; + int arg0; + cocos2d::Ref *arg1; + cocos2d::Value arg2; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.UIEventDispatcher:dispatchEvent"); + ok &= luaval_to_object(tolua_S, 3, "cc.Ref", &arg1, "fairygui.UIEventDispatcher:dispatchEvent"); + ok &= luaval_to_ccvalue(tolua_S, 4, &arg2, "fairygui.UIEventDispatcher:dispatchEvent"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_UIEventDispatcher_dispatchEvent'", nullptr); + return 0; + } + bool ret = cobj->dispatchEvent(arg0, (void *)arg1, arg2); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.UIEventDispatcher:dispatchEvent",argc, 1); return 0; @@ -1035,7 +1079,7 @@ static int lua_fairygui_UIEventDispatcher_dispatchEvent(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIEventDispatcher_dispatchEvent'.",&tolua_err); - return 0; + return 0; #endif } @@ -1070,32 +1114,32 @@ static int lua_fairygui_UIEventDispatcher_bubbleEvent(lua_State* tolua_S) return 1; } if (argc == 2) { - int arg0; - cocos2d::Ref *arg1; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.UIEventDispatcher:bubbleEvent"); - ok &= luaval_to_object(tolua_S, 3, "cc.Ref", &arg1, "fairygui.UIEventDispatcher:bubbleEvent"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_UIEventDispatcher_bubbleEvent'", nullptr); - return 0; - } - bool ret = cobj->bubbleEvent(arg0, (void *)arg1); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; + int arg0; + cocos2d::Ref *arg1; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.UIEventDispatcher:bubbleEvent"); + ok &= luaval_to_object(tolua_S, 3, "cc.Ref", &arg1, "fairygui.UIEventDispatcher:bubbleEvent"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_UIEventDispatcher_bubbleEvent'", nullptr); + return 0; + } + bool ret = cobj->bubbleEvent(arg0, (void *)arg1); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; } if (argc == 3) { - int arg0; - cocos2d::Ref *arg1; - cocos2d::Value arg2; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.UIEventDispatcher:bubbleEvent"); - ok &= luaval_to_object(tolua_S, 3, "cc.Ref", &arg1, "fairygui.UIEventDispatcher:bubbleEvent"); - ok &= luaval_to_ccvalue(tolua_S, 4, &arg2, "fairygui.UIEventDispatcher:bubbleEvent"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_UIEventDispatcher_bubbleEvent'", nullptr); - return 0; - } - bool ret = cobj->bubbleEvent(arg0, (void *)arg1, arg2); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; + int arg0; + cocos2d::Ref *arg1; + cocos2d::Value arg2; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.UIEventDispatcher:bubbleEvent"); + ok &= luaval_to_object(tolua_S, 3, "cc.Ref", &arg1, "fairygui.UIEventDispatcher:bubbleEvent"); + ok &= luaval_to_ccvalue(tolua_S, 4, &arg2, "fairygui.UIEventDispatcher:bubbleEvent"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_UIEventDispatcher_bubbleEvent'", nullptr); + return 0; + } + bool ret = cobj->bubbleEvent(arg0, (void *)arg1, arg2); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.UIEventDispatcher:bubbleEvent",argc, 1); return 0; @@ -1103,191 +1147,193 @@ static int lua_fairygui_UIEventDispatcher_bubbleEvent(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIEventDispatcher_bubbleEvent'.",&tolua_err); - return 0; + return 0; #endif } static int lua_fairygui_UIEventDispatcher_addEventListener(lua_State* L) { - int argc = 0; - fairygui::UIEventDispatcher* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::UIEventDispatcher* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L, 1, "fairygui.UIEventDispatcher", 0, &tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L, 1, "fairygui.UIEventDispatcher", 0, &tolua_err)) goto tolua_lerror; #endif - cobj = static_cast(tolua_tousertype(L, 1, 0)); + cobj = static_cast(tolua_tousertype(L, 1, 0)); #if COCOS2D_DEBUG >= 1 - if (nullptr == cobj) { - tolua_error(L, "invalid 'cobj' in function 'lua_fairygui_UIEventDispatcher_addEventListener'\n", NULL); - return 0; - } + if (nullptr == cobj) { + tolua_error(L, "invalid 'cobj' in function 'lua_fairygui_UIEventDispatcher_addEventListener'\n", NULL); + return 0; + } #endif - argc = lua_gettop(L) - 1; - if (2 == argc) { - int eventType; - ok &= luaval_to_int32(L, 2, (int *)&eventType, "fairygui.UIEventDispatcher:addEventListener"); - if (!ok) { - tolua_error(L, "invalid arguments in function 'lua_fairygui_UIEventDispatcher_addEventListener'", nullptr); - return 0; - } + argc = lua_gettop(L) - 1; + if (2 == argc) { + int eventType; + ok &= luaval_to_int32(L, 2, (int *)&eventType, "fairygui.UIEventDispatcher:addEventListener"); + if (!ok) { + tolua_error(L, "invalid arguments in function 'lua_fairygui_UIEventDispatcher_addEventListener'", nullptr); + return 0; + } #if COCOS2D_DEBUG >= 1 - if (!toluafix_isfunction(L, 3, "LUA_FUNCTION", 0, &tolua_err)) { - goto tolua_lerror; - } + if (!toluafix_isfunction(L, 3, "LUA_FUNCTION", 0, &tolua_err)) { + goto tolua_lerror; + } #endif - LUA_FUNCTION handler = (toluafix_ref_function(L, 3, 0)); - - cobj->addEventListener(eventType, [=](fairygui::EventContext* context) { - object_to_luaval(L, "fairygui.EventContext", context); + LUA_FUNCTION handler = (toluafix_ref_function(L, 3, 0)); + + cobj->addEventListener(eventType, [=](fairygui::EventContext* context) { + lua_State *coroutine = LuaEngine::getInstance()->getLuaStack()->getLuaState(); + object_to_luaval(coroutine, "fairygui.EventContext", context); LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 1); }); - ScriptHandlerMgr::getInstance()->addObjectHandler((void*)cobj, handler, (ScriptHandlerMgr::HandlerType)eventType);// fake a HandlerType - return 0; - } - if (3 == argc) { - int eventType; - int tag; - ok &= luaval_to_int32(L, 2, (int *)&eventType, "fairygui.UIEventDispatcher:addEventListener"); + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)cobj, handler, (ScriptHandlerMgr::HandlerType)eventType); + return 0; + } + if (3 == argc) { + int eventType; + int tag; + ok &= luaval_to_int32(L, 2, (int *)&eventType, "fairygui.UIEventDispatcher:addEventListener"); #if COCOS2D_DEBUG >= 1 - if (!toluafix_isfunction(L, 3, "LUA_FUNCTION", 0, &tolua_err)) { - goto tolua_lerror; - } + if (!toluafix_isfunction(L, 3, "LUA_FUNCTION", 0, &tolua_err)) { + goto tolua_lerror; + } #endif - LUA_FUNCTION handler = (toluafix_ref_function(L, 3, 0)); - ok &= luaval_to_int32(L, 4, (int *)&tag, "fairygui.UIEventDispatcher:addEventListener"); - if (!ok) { - tolua_error(L, "invalid arguments in function 'lua_fairygui_UIEventDispatcher_addEventListener'", nullptr); - return 0; - } - - cobj->addEventListener(eventType, [=](fairygui::EventContext* context) { - object_to_luaval(L, "fairygui.EventContext", context); + LUA_FUNCTION handler = (toluafix_ref_function(L, 3, 0)); + ok &= luaval_to_int32(L, 4, (int *)&tag, "fairygui.UIEventDispatcher:addEventListener"); + if (!ok) { + tolua_error(L, "invalid arguments in function 'lua_fairygui_UIEventDispatcher_addEventListener'", nullptr); + return 0; + } + + cobj->addEventListener(eventType, [=](fairygui::EventContext* context) { + lua_State *coroutine = LuaEngine::getInstance()->getLuaStack()->getLuaState(); + object_to_luaval(coroutine, "fairygui.EventContext", context); LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 1); }, fairygui::EventTag(tag)); - ScriptHandlerMgr::getInstance()->addObjectHandler((void*)cobj, handler, (ScriptHandlerMgr::HandlerType)eventType);// fake a HandlerType - return 0; - } + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)cobj, handler, (ScriptHandlerMgr::HandlerType)eventType); + return 0; + } - luaL_error(L, "'addEventListener' function of UIEventDispatcher has wrong number of arguments: %d, was expecting 2~3\n", argc); - return 0; + luaL_error(L, "'addEventListener' function of UIEventDispatcher has wrong number of arguments: %d, was expecting 2~3\n", argc); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L, "#ferror in function 'addEventListener'.", &tolua_err); - return 0; + tolua_error(L, "#ferror in function 'addEventListener'.", &tolua_err); + return 0; #endif } static int lua_fairygui_UIEventDispatcher_removeEventListener(lua_State* L) { - int argc = 0; - fairygui::UIEventDispatcher *cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::UIEventDispatcher *cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L, 1, "fairygui.UIEventDispatcher", 0, &tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L, 1, "fairygui.UIEventDispatcher", 0, &tolua_err)) goto tolua_lerror; #endif - cobj = static_cast(tolua_tousertype(L, 1, 0)); + cobj = static_cast(tolua_tousertype(L, 1, 0)); #if COCOS2D_DEBUG >= 1 - if (nullptr == cobj) { - tolua_error(L, "invalid 'cobj' in function 'lua_fairygui_UIEventDispatcher_removeEventListener'\n", NULL); - return 0; - } + if (nullptr == cobj) { + tolua_error(L, "invalid 'cobj' in function 'lua_fairygui_UIEventDispatcher_removeEventListener'\n", NULL); + return 0; + } #endif - argc = lua_gettop(L) - 1; - if (1 == argc) { - int eventType; - ok &= luaval_to_int32(L, 2, (int *)&eventType, "fairygui.UIEventDispatcher:removeEventListener"); - if (!ok) { - tolua_error(L, "invalid arguments in function 'lua_fairygui_UIEventDispatcher_removeEventListener'", nullptr); - return 0; - } - - cobj->removeEventListener(eventType); - ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)cobj, (ScriptHandlerMgr::HandlerType)eventType);// fake a HandlerType - return 0; - } - if (2 == argc) { - int eventType; - int tag; - ok &= luaval_to_int32(L, 2, (int *)&eventType, "fairygui.UIEventDispatcher:removeEventListener"); - ok &= luaval_to_int32(L, 3, (int *)&tag, "fairygui.UIEventDispatcher:removeEventListener"); - if (!ok) { - tolua_error(L, "invalid arguments in function 'lua_fairygui_UIEventDispatcher_removeEventListener'", nullptr); - return 0; - } + argc = lua_gettop(L) - 1; + if (1 == argc) { + int eventType; + ok &= luaval_to_int32(L, 2, (int *)&eventType, "fairygui.UIEventDispatcher:removeEventListener"); + if (!ok) { + tolua_error(L, "invalid arguments in function 'lua_fairygui_UIEventDispatcher_removeEventListener'", nullptr); + return 0; + } - cobj->removeEventListener(eventType, fairygui::EventTag(tag)); - ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)cobj, (ScriptHandlerMgr::HandlerType)eventType);// fake a HandlerType - return 0; - } + cobj->removeEventListener(eventType); + ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)cobj, (ScriptHandlerMgr::HandlerType)eventType);// fake a HandlerType + return 0; + } + if (2 == argc) { + int eventType; + int tag; + ok &= luaval_to_int32(L, 2, (int *)&eventType, "fairygui.UIEventDispatcher:removeEventListener"); + ok &= luaval_to_int32(L, 3, (int *)&tag, "fairygui.UIEventDispatcher:removeEventListener"); + if (!ok) { + tolua_error(L, "invalid arguments in function 'lua_fairygui_UIEventDispatcher_removeEventListener'", nullptr); + return 0; + } - luaL_error(L, "'removeEventListener' function of UIEventDispatcher has wrong number of arguments: %d, was expecting 1~2\n", argc); - return 0; + cobj->removeEventListener(eventType, fairygui::EventTag(tag)); + ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)cobj, (ScriptHandlerMgr::HandlerType)eventType);// fake a HandlerType + return 0; + } + + luaL_error(L, "'removeEventListener' function of UIEventDispatcher has wrong number of arguments: %d, was expecting 1~2\n", argc); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L, "#ferror in function 'removeEventListener'.", &tolua_err); - return 0; + tolua_error(L, "#ferror in function 'removeEventListener'.", &tolua_err); + return 0; #endif } static int lua_fairygui_UIEventDispatcher_hasEventListener(lua_State* L) { - int argc = 0; - fairygui::UIEventDispatcher *cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::UIEventDispatcher *cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L, 1, "fairygui.UIEventDispatcher", 0, &tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L, 1, "fairygui.UIEventDispatcher", 0, &tolua_err)) goto tolua_lerror; #endif - cobj = static_cast(tolua_tousertype(L, 1, 0)); + cobj = static_cast(tolua_tousertype(L, 1, 0)); #if COCOS2D_DEBUG >= 1 - if (nullptr == cobj) { - tolua_error(L, "invalid 'cobj' in function 'lua_fairygui_UIEventDispatcher_hasEventListener'\n", NULL); - return 0; - } + if (nullptr == cobj) { + tolua_error(L, "invalid 'cobj' in function 'lua_fairygui_UIEventDispatcher_hasEventListener'\n", NULL); + return 0; + } #endif - argc = lua_gettop(L) - 1; - if (1 == argc) { - int eventType; - ok &= luaval_to_int32(L, 2, (int *)&eventType, "fairygui.UIEventDispatcher:hasEventListener"); - if (!ok) { - tolua_error(L, "invalid arguments in function 'lua_fairygui_UIEventDispatcher_hasEventListener'", nullptr); - return 0; - } + argc = lua_gettop(L) - 1; + if (1 == argc) { + int eventType; + ok &= luaval_to_int32(L, 2, (int *)&eventType, "fairygui.UIEventDispatcher:hasEventListener"); + if (!ok) { + tolua_error(L, "invalid arguments in function 'lua_fairygui_UIEventDispatcher_hasEventListener'", nullptr); + return 0; + } - lua_pushboolean(L, cobj->hasEventListener(eventType)); - return 1; - } - if (2 == argc) { - int eventType; - int tag; - ok &= luaval_to_int32(L, 2, (int *)&eventType, "fairygui.UIEventDispatcher:hasEventListener"); - ok &= luaval_to_int32(L, 3, (int *)&tag, "fairygui.UIEventDispatcher:hasEventListener"); - if (!ok) { - tolua_error(L, "invalid arguments in function 'lua_fairygui_UIEventDispatcher_hasEventListener'", nullptr); - return 0; - } + lua_pushboolean(L, cobj->hasEventListener(eventType)); + return 1; + } + if (2 == argc) { + int eventType; + int tag; + ok &= luaval_to_int32(L, 2, (int *)&eventType, "fairygui.UIEventDispatcher:hasEventListener"); + ok &= luaval_to_int32(L, 3, (int *)&tag, "fairygui.UIEventDispatcher:hasEventListener"); + if (!ok) { + tolua_error(L, "invalid arguments in function 'lua_fairygui_UIEventDispatcher_hasEventListener'", nullptr); + return 0; + } - lua_pushboolean(L, cobj->hasEventListener(eventType, fairygui::EventTag(tag))); - return 1; - } + lua_pushboolean(L, cobj->hasEventListener(eventType, fairygui::EventTag(tag))); + return 1; + } - luaL_error(L, "'hasEventListener' function of UIEventDispatcher has wrong number of arguments: %d, was expecting 1~2\n", argc); - return 0; + luaL_error(L, "'hasEventListener' function of UIEventDispatcher has wrong number of arguments: %d, was expecting 1~2\n", argc); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L, "#ferror in function 'lua_fairygui_UIEventDispatcher_hasEventListener'.", &tolua_err); - return 0; + tolua_error(L, "#ferror in function 'lua_fairygui_UIEventDispatcher_hasEventListener'.", &tolua_err); + return 0; #endif } @@ -1297,13 +1343,13 @@ static int lua_register_fairygui_UIEventDispatcher(lua_State* tolua_S) tolua_cclass(tolua_S,"UIEventDispatcher","fairygui.UIEventDispatcher","cc.Ref",nullptr); tolua_beginmodule(tolua_S,"UIEventDispatcher"); - tolua_function(tolua_S,"isDispatchingEvent",lua_fairygui_UIEventDispatcher_isDispatchingEvent); - tolua_function(tolua_S,"removeEventListeners",lua_fairygui_UIEventDispatcher_removeEventListeners); - tolua_function(tolua_S,"dispatchEvent",lua_fairygui_UIEventDispatcher_dispatchEvent); - tolua_function(tolua_S,"bubbleEvent",lua_fairygui_UIEventDispatcher_bubbleEvent); - tolua_function(tolua_S,"addEventListener",lua_fairygui_UIEventDispatcher_addEventListener); - tolua_function(tolua_S,"removeEventListener",lua_fairygui_UIEventDispatcher_removeEventListener); - tolua_function(tolua_S,"hasEventListener",lua_fairygui_UIEventDispatcher_hasEventListener); + tolua_function(tolua_S,"isDispatchingEvent",lua_fairygui_UIEventDispatcher_isDispatchingEvent); + tolua_function(tolua_S,"removeEventListeners",lua_fairygui_UIEventDispatcher_removeEventListeners); + tolua_function(tolua_S,"dispatchEvent",lua_fairygui_UIEventDispatcher_dispatchEvent); + tolua_function(tolua_S,"bubbleEvent",lua_fairygui_UIEventDispatcher_bubbleEvent); + tolua_function(tolua_S,"addEventListener",lua_fairygui_UIEventDispatcher_addEventListener); + tolua_function(tolua_S,"removeEventListener",lua_fairygui_UIEventDispatcher_removeEventListener); + tolua_function(tolua_S,"hasEventListener",lua_fairygui_UIEventDispatcher_hasEventListener); tolua_endmodule(tolua_S); std::string typeName = typeid(fairygui::UIEventDispatcher).name(); g_luaType[typeName] = "fairygui.UIEventDispatcher"; @@ -1347,7 +1393,7 @@ static int lua_fairygui_GController_getPageIndexById(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GController_getPageIndexById'.",&tolua_err); - return 0; + return 0; #endif } @@ -1378,7 +1424,7 @@ static int lua_fairygui_GController_setSelectedPage(lua_State* tolua_S) return 0; } cobj->setSelectedPage(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GController:setSelectedPage",argc, 1); return 0; @@ -1386,7 +1432,7 @@ static int lua_fairygui_GController_setSelectedPage(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GController_setSelectedPage'.",&tolua_err); - return 0; + return 0; #endif } @@ -1419,7 +1465,7 @@ static int lua_fairygui_GController_getPrevisousIndex(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GController_getPrevisousIndex'.",&tolua_err); - return 0; + return 0; #endif } @@ -1449,18 +1495,18 @@ static int lua_fairygui_GController_setSelectedIndex(lua_State* tolua_S) tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GController_setSelectedIndex'", nullptr); return 0; } - if (argc > 1) { - bool arg1; - ok &= luaval_to_boolean(tolua_S, 3, &arg1, "fairygui.GController:setSelectedIndex"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GController_setSelectedIndex'", nullptr); - return 0; - } - cobj->setSelectedIndex(arg0, arg1); - } else { - cobj->setSelectedIndex(arg0); - } - return 0; + if (argc > 1) { + bool arg1; + ok &= luaval_to_boolean(tolua_S, 3, &arg1, "fairygui.GController:setSelectedIndex"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GController_setSelectedIndex'", nullptr); + return 0; + } + cobj->setSelectedIndex(arg0, arg1); + } else { + cobj->setSelectedIndex(arg0); + } + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting 1~2\n", "fairygui.GController:setSelectedIndex",argc); return 0; @@ -1468,7 +1514,7 @@ static int lua_fairygui_GController_setSelectedIndex(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GController_setSelectedIndex'.",&tolua_err); - return 0; + return 0; #endif } @@ -1508,7 +1554,7 @@ static int lua_fairygui_GController_getPageId(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GController_getPageId'.",&tolua_err); - return 0; + return 0; #endif } @@ -1541,7 +1587,7 @@ static int lua_fairygui_GController_getSelectedPageId(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GController_getSelectedPageId'.",&tolua_err); - return 0; + return 0; #endif } @@ -1572,7 +1618,7 @@ static int lua_fairygui_GController_setParent(lua_State* tolua_S) return 0; } cobj->setParent(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GController:setParent",argc, 1); return 0; @@ -1580,7 +1626,7 @@ static int lua_fairygui_GController_setParent(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GController_setParent'.",&tolua_err); - return 0; + return 0; #endif } @@ -1604,7 +1650,7 @@ static int lua_fairygui_GController_runActions(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 0) { cobj->runActions(); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GController:runActions",argc, 0); return 0; @@ -1612,7 +1658,7 @@ static int lua_fairygui_GController_runActions(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GController_runActions'.",&tolua_err); - return 0; + return 0; #endif } @@ -1643,7 +1689,7 @@ static int lua_fairygui_GController_setOppositePageId(lua_State* tolua_S) return 0; } cobj->setOppositePageId(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GController:setOppositePageId",argc, 1); return 0; @@ -1651,7 +1697,7 @@ static int lua_fairygui_GController_setOppositePageId(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GController_setOppositePageId'.",&tolua_err); - return 0; + return 0; #endif } @@ -1691,7 +1737,7 @@ static int lua_fairygui_GController_hasPage(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GController_hasPage'.",&tolua_err); - return 0; + return 0; #endif } @@ -1731,7 +1777,7 @@ static int lua_fairygui_GController_getPageNameById(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GController_getPageNameById'.",&tolua_err); - return 0; + return 0; #endif } @@ -1764,7 +1810,7 @@ static int lua_fairygui_GController_getPreviousPageId(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GController_getPreviousPageId'.",&tolua_err); - return 0; + return 0; #endif } @@ -1797,7 +1843,7 @@ static int lua_fairygui_GController_getPageCount(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GController_getPageCount'.",&tolua_err); - return 0; + return 0; #endif } @@ -1830,7 +1876,7 @@ static int lua_fairygui_GController_getSelectedIndex(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GController_getSelectedIndex'.",&tolua_err); - return 0; + return 0; #endif } @@ -1863,7 +1909,7 @@ static int lua_fairygui_GController_getPreviousPage(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GController_getPreviousPage'.",&tolua_err); - return 0; + return 0; #endif } @@ -1894,7 +1940,7 @@ static int lua_fairygui_GController_setSelectedPageId(lua_State* tolua_S) return 0; } cobj->setSelectedPageId(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GController:setSelectedPageId",argc, 1); return 0; @@ -1902,7 +1948,7 @@ static int lua_fairygui_GController_setSelectedPageId(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GController_setSelectedPageId'.",&tolua_err); - return 0; + return 0; #endif } @@ -1935,7 +1981,7 @@ static int lua_fairygui_GController_getSelectedPage(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GController_getSelectedPage'.",&tolua_err); - return 0; + return 0; #endif } @@ -1968,7 +2014,7 @@ static int lua_fairygui_GController_getParent(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GController_getParent'.",&tolua_err); - return 0; + return 0; #endif } @@ -2005,410 +2051,406 @@ static int lua_register_fairygui_GController(lua_State* tolua_S) static int lua_fairygui_GObject_get_id(lua_State* L) { - fairygui::GObject* cobj = nullptr; + fairygui::GObject* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GObject*)tolua_tousertype(L,1,0); + cobj = (fairygui::GObject*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GObject_get_id'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GObject_get_id'", nullptr); + return 0; + } #endif - tolua_pushstring(L, cobj->id.c_str()); - return 1; + tolua_pushstring(L, cobj->id.c_str()); + return 1; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_GObject_get_id'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_GObject_get_id'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GObject_get_name(lua_State* L) { - fairygui::GObject* cobj = nullptr; + fairygui::GObject* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GObject*)tolua_tousertype(L,1,0); + cobj = (fairygui::GObject*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GObject_get_name'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GObject_get_name'", nullptr); + return 0; + } #endif - tolua_pushstring(L, cobj->name.c_str()); - return 1; + tolua_pushstring(L, cobj->name.c_str()); + return 1; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_GObject_get_name'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_GObject_get_name'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GObject_set_name(lua_State* L) { - fairygui::GObject* cobj = nullptr; - + fairygui::GObject* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GObject*)tolua_tousertype(L,1,0); + cobj = (fairygui::GObject*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GObject_set_name'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GObject_set_name'", nullptr); + return 0; + } #endif - - cobj->name = tolua_tostring(L, 2, ""); - return 0; - + cobj->name = tolua_tostring(L, 2, ""); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_GObject_set_name'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_GObject_set_name'.",&tolua_err); + return 0; #endif } - static int lua_fairygui_GObject_get_sourceSize(lua_State* L) { - fairygui::GObject* cobj = nullptr; + fairygui::GObject* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GObject*)tolua_tousertype(L,1,0); + cobj = (fairygui::GObject*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GObject_get_sourceSize'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GObject_get_sourceSize'", nullptr); + return 0; + } #endif - size_to_luaval(L, cobj->sourceSize); - return 1; + size_to_luaval(L, cobj->sourceSize); + return 1; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_GObject_get_sourceSize'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_GObject_get_sourceSize'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GObject_get_initSize(lua_State* L) { - fairygui::GObject* cobj = nullptr; + fairygui::GObject* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GObject*)tolua_tousertype(L,1,0); + cobj = (fairygui::GObject*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GObject_get_initSize'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GObject_get_initSize'", nullptr); + return 0; + } #endif - size_to_luaval(L, cobj->initSize); - return 1; + size_to_luaval(L, cobj->initSize); + return 1; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_GObject_get_initSize'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_GObject_get_initSize'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GObject_get_minSize(lua_State* L) { - fairygui::GObject* cobj = nullptr; + fairygui::GObject* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GObject*)tolua_tousertype(L,1,0); + cobj = (fairygui::GObject*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GObject_get_minSize'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GObject_get_minSize'", nullptr); + return 0; + } #endif - size_to_luaval(L, cobj->minSize); - return 1; + size_to_luaval(L, cobj->minSize); + return 1; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_GObject_get_minSize'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_GObject_get_minSize'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GObject_get_maxSize(lua_State* L) { - fairygui::GObject* cobj = nullptr; + fairygui::GObject* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GObject*)tolua_tousertype(L,1,0); + cobj = (fairygui::GObject*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GObject_get_maxSize'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GObject_get_maxSize'", nullptr); + return 0; + } #endif - size_to_luaval(L, cobj->maxSize); - return 1; + size_to_luaval(L, cobj->maxSize); + return 1; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_GObject_get_maxSize'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_GObject_get_maxSize'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GObject_getXMin(lua_State* tolua_S) { - int argc = 0; - fairygui::GObject* cobj = nullptr; + int argc = 0; + fairygui::GObject* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GObject*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GObject*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObject_getXMin'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObject_getXMin'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - lua_pushnumber(tolua_S, cobj->getXMin()); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:getXMin", argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + lua_pushnumber(tolua_S, cobj->getXMin()); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:getXMin", argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getXMin'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getXMin'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GObject_setXMin(lua_State* tolua_S) { - int argc = 0; - fairygui::GObject* cobj = nullptr; + int argc = 0; + fairygui::GObject* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GObject*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GObject*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObject_setXMin'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObject_setXMin'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - cobj->setXMin(float(lua_tonumber(tolua_S, 2))); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setXMin", argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + cobj->setXMin(float(lua_tonumber(tolua_S, 2))); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setXMin", argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setXMin'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setXMin'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GObject_getYMin(lua_State* tolua_S) { - int argc = 0; - fairygui::GObject* cobj = nullptr; + int argc = 0; + fairygui::GObject* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GObject*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GObject*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObject_getYMin'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObject_getYMin'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - lua_pushnumber(tolua_S, cobj->getYMin()); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:getYMin", argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + lua_pushnumber(tolua_S, cobj->getYMin()); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:getYMin", argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getYMin'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getYMin'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GObject_setYMin(lua_State* tolua_S) { - int argc = 0; - fairygui::GObject* cobj = nullptr; + int argc = 0; + fairygui::GObject* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GObject*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GObject*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObject_setYMin'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObject_setYMin'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - cobj->setYMin(float(lua_tonumber(tolua_S, 2))); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setYMin", argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + cobj->setYMin(float(lua_tonumber(tolua_S, 2))); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setYMin", argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setYMin'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setYMin'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GObject_isPivotAsAnchor(lua_State* tolua_S) { - int argc = 0; - fairygui::GObject* cobj = nullptr; + int argc = 0; + fairygui::GObject* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GObject*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GObject*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObject_isPivotAsAnchor'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObject_isPivotAsAnchor'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - lua_pushboolean(tolua_S, cobj->isPivotAsAnchor()); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:isPivotAsAnchor", argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + lua_pushboolean(tolua_S, cobj->isPivotAsAnchor()); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:isPivotAsAnchor", argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_isPivotAsAnchor'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_isPivotAsAnchor'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GObject_getProp(lua_State* tolua_S) { - int argc = 0; - fairygui::GObject* cobj = nullptr; + int argc = 0; + fairygui::GObject* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GObject*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GObject*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObject_getProp'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObject_getProp'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - cocos2d::Value value = cobj->getProp((fairygui::ObjectPropID)lua_tointeger(tolua_S, 2)); - ccvalue_to_luaval(tolua_S, value); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:getProp", argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + cocos2d::Value value = cobj->getProp((fairygui::ObjectPropID)lua_tointeger(tolua_S, 2)); + ccvalue_to_luaval(tolua_S, value); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:getProp", argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getProp'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getProp'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GObject_setProp(lua_State* tolua_S) { - int argc = 0; - fairygui::GObject* cobj = nullptr; + int argc = 0; + fairygui::GObject* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GObject*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GObject*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObject_setProp'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObject_setProp'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - cocos2d::Value value; - luaval_to_ccvalue(tolua_S, 3, &value, "fairygui.GObject:setProp"); - cobj->setProp((fairygui::ObjectPropID)lua_tointeger(tolua_S, 2), value); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setProp", argc, 2); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 2) { + cocos2d::Value value; + luaval_to_ccvalue(tolua_S, 3, &value, "fairygui.GObject:setProp"); + cobj->setProp((fairygui::ObjectPropID)lua_tointeger(tolua_S, 2), value); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setProp", argc, 2); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setProp'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setProp'.",&tolua_err); + return 0; #endif } @@ -2433,7 +2475,7 @@ static int lua_fairygui_GObject_startDrag(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 0) { cobj->startDrag(); - return 0; + return 0; } if (argc == 1) { int arg0; @@ -2443,7 +2485,7 @@ static int lua_fairygui_GObject_startDrag(lua_State* tolua_S) return 0; } cobj->startDrag(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:startDrag",argc, 0); return 0; @@ -2451,7 +2493,7 @@ static int lua_fairygui_GObject_startDrag(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_startDrag'.",&tolua_err); - return 0; + return 0; #endif } @@ -2484,7 +2526,7 @@ static int lua_fairygui_GObject_getPackageItem(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getPackageItem'.",&tolua_err); - return 0; + return 0; #endif } @@ -2515,7 +2557,7 @@ static int lua_fairygui_GObject_setGroup(lua_State* tolua_S) return 0; } cobj->setGroup(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setGroup",argc, 1); return 0; @@ -2523,7 +2565,7 @@ static int lua_fairygui_GObject_setGroup(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setGroup'.",&tolua_err); - return 0; + return 0; #endif } @@ -2556,7 +2598,7 @@ static int lua_fairygui_GObject_isDraggable(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_isDraggable'.",&tolua_err); - return 0; + return 0; #endif } @@ -2589,7 +2631,7 @@ static int lua_fairygui_GObject_relations(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_relations'.",&tolua_err); - return 0; + return 0; #endif } @@ -2622,7 +2664,7 @@ static int lua_fairygui_GObject_isTouchable(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_isTouchable'.",&tolua_err); - return 0; + return 0; #endif } @@ -2655,7 +2697,7 @@ static int lua_fairygui_GObject_setScale(lua_State* tolua_S) return 0; } cobj->setScale(arg0, arg1); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setScale",argc, 2); return 0; @@ -2663,7 +2705,7 @@ static int lua_fairygui_GObject_setScale(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setScale'.",&tolua_err); - return 0; + return 0; #endif } @@ -2696,7 +2738,7 @@ static int lua_fairygui_GObject_getWidth(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getWidth'.",&tolua_err); - return 0; + return 0; #endif } @@ -2729,7 +2771,7 @@ static int lua_fairygui_GObject_getY(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getY'.",&tolua_err); - return 0; + return 0; #endif } @@ -2762,7 +2804,7 @@ static int lua_fairygui_GObject_displayObject(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_displayObject'.",&tolua_err); - return 0; + return 0; #endif } @@ -2770,7 +2812,7 @@ static int lua_fairygui_GObject_setData(lua_State* tolua_S) { int argc = 0; fairygui::GObject* cobj = nullptr; - bool ok = true; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; @@ -2786,14 +2828,14 @@ static int lua_fairygui_GObject_setData(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Ref *arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Ref", &arg0, "fairygui.GObject:setData"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GObject_setData'", nullptr); - return 0; - } - cobj->setData((void *)arg0); - return 0; + cocos2d::Ref *arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Ref", &arg0, "fairygui.GObject:setData"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GObject_setData'", nullptr); + return 0; + } + cobj->setData((void *)arg0); + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setData",argc, 1); return 0; @@ -2801,112 +2843,112 @@ static int lua_fairygui_GObject_setData(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setData'.",&tolua_err); - return 0; + return 0; #endif } static int lua_fairygui_GObject_getData(lua_State* tolua_S) { - int argc = 0; - fairygui::GObject* cobj = nullptr; + int argc = 0; + fairygui::GObject* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GObject*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GObject*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObject_getData'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObject_getData'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cocos2d::Ref *ret = (cocos2d::Ref *)cobj->getData(); - object_to_luaval(tolua_S, "cc.Ref", ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:getData",argc,0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cocos2d::Ref *ret = (cocos2d::Ref *)cobj->getData(); + object_to_luaval(tolua_S, "cc.Ref", ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:getData",argc,0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getData'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getData'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GObject_setCustomData(lua_State* tolua_S) { - int argc = 0; - fairygui::GObject* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GObject* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GObject*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GObject*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObject_setCustomData'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObject_setCustomData'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - cocos2d::Value arg0; - ok &= luaval_to_ccvalue(tolua_S, 2, &arg0, "fairygui.GObject:setCustomData"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GObject_setCustomData'", nullptr); - return 0; - } - cobj->setCustomData(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setCustomData",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + cocos2d::Value arg0; + ok &= luaval_to_ccvalue(tolua_S, 2, &arg0, "fairygui.GObject:setCustomData"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GObject_setCustomData'", nullptr); + return 0; + } + cobj->setCustomData(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setCustomData",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setCustomData'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setCustomData'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GObject_getCustomData(lua_State* tolua_S) { - int argc = 0; - fairygui::GObject* cobj = nullptr; + int argc = 0; + fairygui::GObject* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GObject*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GObject*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObject_getCustomData'", nullptr); - return 0; - } -#endif + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObject_getCustomData'", nullptr); + return 0; + } +#endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - const cocos2d::Value &ret = cobj->getCustomData(); - ccvalue_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:getCustomData",argc,0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + const cocos2d::Value &ret = cobj->getCustomData(); + ccvalue_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:getCustomData",argc,0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getCustomData'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getCustomData'.",&tolua_err); + return 0; #endif } @@ -2939,7 +2981,7 @@ static int lua_fairygui_GObject_getRotation(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getRotation'.",&tolua_err); - return 0; + return 0; #endif } @@ -2963,7 +3005,7 @@ static int lua_fairygui_GObject_stopDrag(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 0) { cobj->stopDrag(); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:stopDrag",argc, 0); return 0; @@ -2971,7 +3013,7 @@ static int lua_fairygui_GObject_stopDrag(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_stopDrag'.",&tolua_err); - return 0; + return 0; #endif } @@ -3004,7 +3046,7 @@ static int lua_fairygui_GObject_getSortingOrder(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getSortingOrder'.",&tolua_err); - return 0; + return 0; #endif } @@ -3037,7 +3079,7 @@ static int lua_fairygui_GObject_isGrayed(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_isGrayed'.",&tolua_err); - return 0; + return 0; #endif } @@ -3068,7 +3110,7 @@ static int lua_fairygui_GObject_setWidth(lua_State* tolua_S) return 0; } cobj->setWidth(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setWidth",argc, 1); return 0; @@ -3076,7 +3118,7 @@ static int lua_fairygui_GObject_setWidth(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setWidth'.",&tolua_err); - return 0; + return 0; #endif } @@ -3109,7 +3151,7 @@ static int lua_fairygui_GObject_getScale(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getScale'.",&tolua_err); - return 0; + return 0; #endif } @@ -3142,7 +3184,7 @@ static int lua_fairygui_GObject_getResourceURL(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getResourceURL'.",&tolua_err); - return 0; + return 0; #endif } @@ -3175,7 +3217,7 @@ int lua_fairygui_GObject_isPixelSnapping(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_isPixelSnapping'.",&tolua_err); - return 0; + return 0; #endif } @@ -3206,7 +3248,7 @@ static int lua_fairygui_GObject_setTooltips(lua_State* tolua_S) return 0; } cobj->setTooltips(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setTooltips",argc, 1); return 0; @@ -3214,7 +3256,7 @@ static int lua_fairygui_GObject_setTooltips(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setTooltips'.",&tolua_err); - return 0; + return 0; #endif } @@ -3223,7 +3265,7 @@ static int lua_fairygui_GObject_localToGlobal(lua_State* tolua_S) int argc = 0; fairygui::GObject* cobj = nullptr; bool ok = true; - + #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; @@ -3235,33 +3277,33 @@ static int lua_fairygui_GObject_localToGlobal(lua_State* tolua_S) return 0; } #endif - + argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - cocos2d::Rect arg0; - ok = luaval_to_rect(tolua_S, 2, &arg0, "fairygui.GObject:localToGlobal"); - if (ok) { - cocos2d::Rect ret = cobj->localToGlobal(arg0); - rect_to_luaval(tolua_S, ret); - return 1; - } - cocos2d::Vec2 arg00; - ok = luaval_to_vec2(tolua_S, 2, &arg00, "fairygui.GObject:localToGlobal"); - if (ok) { - cocos2d::Vec2 ret = cobj->localToGlobal(arg00); - vec2_to_luaval(tolua_S, ret); - return 1; - } - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GObject_localToGlobal'", nullptr); - return 0; - } + if (argc == 1) { + cocos2d::Rect arg0; + ok = luaval_to_rect(tolua_S, 2, &arg0, "fairygui.GObject:localToGlobal"); + if (ok) { + cocos2d::Rect ret = cobj->localToGlobal(arg0); + rect_to_luaval(tolua_S, ret); + return 1; + } + cocos2d::Vec2 arg00; + ok = luaval_to_vec2(tolua_S, 2, &arg00, "fairygui.GObject:localToGlobal"); + if (ok) { + cocos2d::Vec2 ret = cobj->localToGlobal(arg00); + vec2_to_luaval(tolua_S, ret); + return 1; + } + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GObject_localToGlobal'", nullptr); + return 0; + } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:localToGlobal",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_localToGlobal'.",&tolua_err); - return 0; + return 0; #endif } @@ -3294,7 +3336,7 @@ static int lua_fairygui_GObject_getScaleY(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getScaleY'.",&tolua_err); - return 0; + return 0; #endif } @@ -3327,7 +3369,7 @@ static int lua_fairygui_GObject_getScaleX(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getScaleX'.",&tolua_err); - return 0; + return 0; #endif } @@ -3360,7 +3402,7 @@ static int lua_fairygui_GObject_onStage(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_onStage'.",&tolua_err); - return 0; + return 0; #endif } @@ -3393,7 +3435,7 @@ static int lua_fairygui_GObject_getHeight(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getHeight'.",&tolua_err); - return 0; + return 0; #endif } @@ -3433,7 +3475,7 @@ static int lua_fairygui_GObject_getGear(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getGear'.",&tolua_err); - return 0; + return 0; #endif } @@ -3442,7 +3484,7 @@ static int lua_fairygui_GObject_globalToLocal(lua_State* tolua_S) int argc = 0; fairygui::GObject* cobj = nullptr; bool ok = true; - + #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; @@ -3454,33 +3496,33 @@ static int lua_fairygui_GObject_globalToLocal(lua_State* tolua_S) return 0; } #endif - + argc = lua_gettop(tolua_S) - 1; - if (argc == 1) { - cocos2d::Rect arg0; - ok = luaval_to_rect(tolua_S, 2, &arg0, "fairygui.GObject:globalToLocal"); - if (ok) { - cocos2d::Rect ret = cobj->globalToLocal(arg0); - rect_to_luaval(tolua_S, ret); - return 1; - } - cocos2d::Vec2 arg00; - ok = luaval_to_vec2(tolua_S, 2, &arg00, "fairygui.GObject:globalToLocal"); - if (ok) { - cocos2d::Vec2 ret = cobj->globalToLocal(arg00); - vec2_to_luaval(tolua_S, ret); - return 1; - } - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GObject_globalToLocal'", nullptr); - return 0; - } + if (argc == 1) { + cocos2d::Rect arg0; + ok = luaval_to_rect(tolua_S, 2, &arg0, "fairygui.GObject:globalToLocal"); + if (ok) { + cocos2d::Rect ret = cobj->globalToLocal(arg0); + rect_to_luaval(tolua_S, ret); + return 1; + } + cocos2d::Vec2 arg00; + ok = luaval_to_vec2(tolua_S, 2, &arg00, "fairygui.GObject:globalToLocal"); + if (ok) { + cocos2d::Vec2 ret = cobj->globalToLocal(arg00); + vec2_to_luaval(tolua_S, ret); + return 1; + } + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GObject_globalToLocal'", nullptr); + return 0; + } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:globalToLocal",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_globalToLocal'.",&tolua_err); - return 0; + return 0; #endif } @@ -3513,7 +3555,7 @@ static int lua_fairygui_GObject_getGroup(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getGroup'.",&tolua_err); - return 0; + return 0; #endif } @@ -3537,7 +3579,7 @@ static int lua_fairygui_GObject_removeFromParent(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 0) { cobj->removeFromParent(); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:removeFromParent",argc, 0); return 0; @@ -3545,7 +3587,7 @@ static int lua_fairygui_GObject_removeFromParent(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_removeFromParent'.",&tolua_err); - return 0; + return 0; #endif } @@ -3569,7 +3611,7 @@ static int lua_fairygui_GObject_constructFromResource(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 0) { cobj->constructFromResource(); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:constructFromResource",argc, 0); return 0; @@ -3577,7 +3619,7 @@ static int lua_fairygui_GObject_constructFromResource(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_constructFromResource'.",&tolua_err); - return 0; + return 0; #endif } @@ -3608,7 +3650,7 @@ static int lua_fairygui_GObject_setSortingOrder(lua_State* tolua_S) return 0; } cobj->setSortingOrder(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setSortingOrder",argc, 1); return 0; @@ -3616,7 +3658,7 @@ static int lua_fairygui_GObject_setSortingOrder(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setSortingOrder'.",&tolua_err); - return 0; + return 0; #endif } @@ -3647,7 +3689,7 @@ static int lua_fairygui_GObject_setAlpha(lua_State* tolua_S) return 0; } cobj->setAlpha(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setAlpha",argc, 1); return 0; @@ -3655,7 +3697,7 @@ static int lua_fairygui_GObject_setAlpha(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setAlpha'.",&tolua_err); - return 0; + return 0; #endif } @@ -3688,7 +3730,7 @@ static int lua_fairygui_GObject_getSize(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getSize'.",&tolua_err); - return 0; + return 0; #endif } @@ -3721,7 +3763,7 @@ static int lua_fairygui_GObject_getSkewY(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getSkewY'.",&tolua_err); - return 0; + return 0; #endif } @@ -3752,7 +3794,7 @@ static int lua_fairygui_GObject_setRotation(lua_State* tolua_S) return 0; } cobj->setRotation(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setRotation",argc, 1); return 0; @@ -3760,7 +3802,7 @@ static int lua_fairygui_GObject_setRotation(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setRotation'.",&tolua_err); - return 0; + return 0; #endif } @@ -3793,7 +3835,7 @@ static int lua_fairygui_GObject_addDisplayLock(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_addDisplayLock'.",&tolua_err); - return 0; + return 0; #endif } @@ -3824,7 +3866,7 @@ static int lua_fairygui_GObject_setPixelSnapping(lua_State* tolua_S) return 0; } cobj->setPixelSnapping(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setPixelSnapping",argc, 1); return 0; @@ -3832,7 +3874,7 @@ static int lua_fairygui_GObject_setPixelSnapping(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setPixelSnapping'.",&tolua_err); - return 0; + return 0; #endif } @@ -3865,7 +3907,7 @@ static int lua_fairygui_GObject_removeRelation(lua_State* tolua_S) return 0; } cobj->removeRelation(arg0, arg1); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:removeRelation",argc, 2); return 0; @@ -3873,7 +3915,7 @@ static int lua_fairygui_GObject_removeRelation(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_removeRelation'.",&tolua_err); - return 0; + return 0; #endif } @@ -3904,7 +3946,7 @@ static int lua_fairygui_GObject_setDraggable(lua_State* tolua_S) return 0; } cobj->setDraggable(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setDraggable",argc, 1); return 0; @@ -3912,7 +3954,7 @@ static int lua_fairygui_GObject_setDraggable(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setDraggable'.",&tolua_err); - return 0; + return 0; #endif } @@ -3943,7 +3985,7 @@ static int lua_fairygui_GObject_setIcon(lua_State* tolua_S) return 0; } cobj->setIcon(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setIcon",argc, 1); return 0; @@ -3951,7 +3993,7 @@ static int lua_fairygui_GObject_setIcon(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setIcon'.",&tolua_err); - return 0; + return 0; #endif } @@ -3982,7 +4024,7 @@ static int lua_fairygui_GObject_setScaleY(lua_State* tolua_S) return 0; } cobj->setScaleY(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setScaleY",argc, 1); return 0; @@ -3990,7 +4032,7 @@ static int lua_fairygui_GObject_setScaleY(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setScaleY'.",&tolua_err); - return 0; + return 0; #endif } @@ -4021,7 +4063,7 @@ static int lua_fairygui_GObject_setScaleX(lua_State* tolua_S) return 0; } cobj->setScaleX(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setScaleX",argc, 1); return 0; @@ -4029,7 +4071,7 @@ static int lua_fairygui_GObject_setScaleX(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setScaleX'.",&tolua_err); - return 0; + return 0; #endif } @@ -4062,7 +4104,7 @@ static int lua_fairygui_GObject_getSkewX(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getSkewX'.",&tolua_err); - return 0; + return 0; #endif } @@ -4093,7 +4135,7 @@ static int lua_fairygui_GObject_releaseDisplayLock(lua_State* tolua_S) return 0; } cobj->releaseDisplayLock(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:releaseDisplayLock",argc, 1); return 0; @@ -4101,7 +4143,7 @@ static int lua_fairygui_GObject_releaseDisplayLock(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_releaseDisplayLock'.",&tolua_err); - return 0; + return 0; #endif } @@ -4132,7 +4174,7 @@ static int lua_fairygui_GObject_setDragBounds(lua_State* tolua_S) return 0; } cobj->setDragBounds(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setDragBounds",argc, 1); return 0; @@ -4140,7 +4182,7 @@ static int lua_fairygui_GObject_setDragBounds(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setDragBounds'.",&tolua_err); - return 0; + return 0; #endif } @@ -4164,7 +4206,7 @@ static int lua_fairygui_GObject_makeFullScreen(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 0) { cobj->makeFullScreen(); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:makeFullScreen",argc, 0); return 0; @@ -4172,7 +4214,7 @@ static int lua_fairygui_GObject_makeFullScreen(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_makeFullScreen'.",&tolua_err); - return 0; + return 0; #endif } @@ -4214,7 +4256,7 @@ static int lua_fairygui_GObject_transformRect(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_transformRect'.",&tolua_err); - return 0; + return 0; #endif } @@ -4245,7 +4287,7 @@ static int lua_fairygui_GObject_setTouchable(lua_State* tolua_S) return 0; } cobj->setTouchable(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setTouchable",argc, 1); return 0; @@ -4253,7 +4295,7 @@ static int lua_fairygui_GObject_setTouchable(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setTouchable'.",&tolua_err); - return 0; + return 0; #endif } @@ -4286,7 +4328,7 @@ static int lua_fairygui_GObject_getAlpha(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getAlpha'.",&tolua_err); - return 0; + return 0; #endif } @@ -4317,7 +4359,7 @@ static int lua_fairygui_GObject_setGrayed(lua_State* tolua_S) return 0; } cobj->setGrayed(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setGrayed",argc, 1); return 0; @@ -4325,7 +4367,7 @@ static int lua_fairygui_GObject_setGrayed(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setGrayed'.",&tolua_err); - return 0; + return 0; #endif } @@ -4358,7 +4400,7 @@ static int lua_fairygui_GObject_getText(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getText'.",&tolua_err); - return 0; + return 0; #endif } @@ -4391,7 +4433,7 @@ static int lua_fairygui_GObject_setPosition(lua_State* tolua_S) return 0; } cobj->setPosition(arg0, arg1); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setPosition",argc, 2); return 0; @@ -4399,7 +4441,7 @@ static int lua_fairygui_GObject_setPosition(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setPosition'.",&tolua_err); - return 0; + return 0; #endif } @@ -4430,7 +4472,7 @@ static int lua_fairygui_GObject_setX(lua_State* tolua_S) return 0; } cobj->setX(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setX",argc, 1); return 0; @@ -4438,7 +4480,7 @@ static int lua_fairygui_GObject_setX(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setX'.",&tolua_err); - return 0; + return 0; #endif } @@ -4469,7 +4511,7 @@ static int lua_fairygui_GObject_setY(lua_State* tolua_S) return 0; } cobj->setY(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setY",argc, 1); return 0; @@ -4477,7 +4519,7 @@ static int lua_fairygui_GObject_setY(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setY'.",&tolua_err); - return 0; + return 0; #endif } @@ -4510,7 +4552,7 @@ static int lua_fairygui_GObject_getPosition(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getPosition'.",&tolua_err); - return 0; + return 0; #endif } @@ -4543,7 +4585,7 @@ static int lua_fairygui_GObject_getParent(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getParent'.",&tolua_err); - return 0; + return 0; #endif } @@ -4574,7 +4616,7 @@ static int lua_fairygui_GObject_setHeight(lua_State* tolua_S) return 0; } cobj->setHeight(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setHeight",argc, 1); return 0; @@ -4582,7 +4624,7 @@ static int lua_fairygui_GObject_setHeight(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setHeight'.",&tolua_err); - return 0; + return 0; #endif } @@ -4615,7 +4657,7 @@ static int lua_fairygui_GObject_getX(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getX'.",&tolua_err); - return 0; + return 0; #endif } @@ -4648,40 +4690,40 @@ static int lua_fairygui_GObject_getRoot(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getRoot'.",&tolua_err); - return 0; + return 0; #endif } static int lua_fairygui_GObject_treeNode(lua_State* tolua_S) { - int argc = 0; - fairygui::GObject* cobj = nullptr; + int argc = 0; + fairygui::GObject* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GObject*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GObject*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObject_treeNode'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObject_treeNode'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GTreeNode* ret = cobj->treeNode(); - object_to_luaval(tolua_S, "fairygui.GTreeNode",(fairygui::GTreeNode*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:treeNode",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::GTreeNode* ret = cobj->treeNode(); + object_to_luaval(tolua_S, "fairygui.GTreeNode",(fairygui::GTreeNode*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:treeNode",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_treeNode'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_treeNode'.",&tolua_err); + return 0; #endif } @@ -4706,7 +4748,7 @@ static int lua_fairygui_GObject_center(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 0) { cobj->center(); - return 0; + return 0; } if (argc == 1) { bool arg0; @@ -4716,7 +4758,7 @@ static int lua_fairygui_GObject_center(lua_State* tolua_S) return 0; } cobj->center(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:center",argc, 0); return 0; @@ -4724,7 +4766,7 @@ static int lua_fairygui_GObject_center(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_center'.",&tolua_err); - return 0; + return 0; #endif } @@ -4757,7 +4799,7 @@ static int lua_fairygui_GObject_getIcon(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getIcon'.",&tolua_err); - return 0; + return 0; #endif } @@ -4788,7 +4830,7 @@ static int lua_fairygui_GObject_setVisible(lua_State* tolua_S) return 0; } cobj->setVisible(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setVisible",argc, 1); return 0; @@ -4796,7 +4838,7 @@ static int lua_fairygui_GObject_setVisible(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setVisible'.",&tolua_err); - return 0; + return 0; #endif } @@ -4827,7 +4869,7 @@ static int lua_fairygui_GObject_setText(lua_State* tolua_S) return 0; } cobj->setText(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setText",argc, 1); return 0; @@ -4835,7 +4877,7 @@ static int lua_fairygui_GObject_setText(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setText'.",&tolua_err); - return 0; + return 0; #endif } @@ -4868,7 +4910,7 @@ static int lua_fairygui_GObject_isVisible(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_isVisible'.",&tolua_err); - return 0; + return 0; #endif } @@ -4910,7 +4952,7 @@ static int lua_fairygui_GObject_hitTest(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_hitTest'.",&tolua_err); - return 0; + return 0; #endif } @@ -4943,7 +4985,7 @@ static int lua_fairygui_GObject_getDragBounds(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getDragBounds'.",&tolua_err); - return 0; + return 0; #endif } @@ -4976,7 +5018,7 @@ static int lua_fairygui_GObject_addRelation(lua_State* tolua_S) return 0; } cobj->addRelation(arg0, arg1); - return 0; + return 0; } if (argc == 3) { fairygui::GObject* arg0; @@ -4990,7 +5032,7 @@ static int lua_fairygui_GObject_addRelation(lua_State* tolua_S) return 0; } cobj->addRelation(arg0, arg1, arg2); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:addRelation",argc, 2); return 0; @@ -4998,7 +5040,7 @@ static int lua_fairygui_GObject_addRelation(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_addRelation'.",&tolua_err); - return 0; + return 0; #endif } @@ -5031,7 +5073,7 @@ static int lua_fairygui_GObject_setPivot(lua_State* tolua_S) return 0; } cobj->setPivot(arg0, arg1); - return 0; + return 0; } if (argc == 3) { double arg0; @@ -5045,7 +5087,7 @@ static int lua_fairygui_GObject_setPivot(lua_State* tolua_S) return 0; } cobj->setPivot(arg0, arg1, arg2); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setPivot",argc, 2); return 0; @@ -5053,7 +5095,7 @@ static int lua_fairygui_GObject_setPivot(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setPivot'.",&tolua_err); - return 0; + return 0; #endif } @@ -5095,7 +5137,7 @@ static int lua_fairygui_GObject_checkGearController(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_checkGearController'.",&tolua_err); - return 0; + return 0; #endif } @@ -5128,7 +5170,7 @@ static int lua_fairygui_GObject_getPivot(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getPivot'.",&tolua_err); - return 0; + return 0; #endif } @@ -5159,7 +5201,7 @@ static int lua_fairygui_GObject_setSkewX(lua_State* tolua_S) return 0; } cobj->setSkewX(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setSkewX",argc, 1); return 0; @@ -5167,7 +5209,7 @@ static int lua_fairygui_GObject_setSkewX(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setSkewX'.",&tolua_err); - return 0; + return 0; #endif } @@ -5198,7 +5240,7 @@ static int lua_fairygui_GObject_setSkewY(lua_State* tolua_S) return 0; } cobj->setSkewY(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setSkewY",argc, 1); return 0; @@ -5206,7 +5248,7 @@ static int lua_fairygui_GObject_setSkewY(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setSkewY'.",&tolua_err); - return 0; + return 0; #endif } @@ -5239,7 +5281,7 @@ static int lua_fairygui_GObject_setSize(lua_State* tolua_S) return 0; } cobj->setSize(arg0, arg1); - return 0; + return 0; } if (argc == 3) { double arg0; @@ -5253,7 +5295,7 @@ static int lua_fairygui_GObject_setSize(lua_State* tolua_S) return 0; } cobj->setSize(arg0, arg1, arg2); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:setSize",argc, 2); return 0; @@ -5261,7 +5303,7 @@ static int lua_fairygui_GObject_setSize(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_setSize'.",&tolua_err); - return 0; + return 0; #endif } @@ -5294,6 +5336,106 @@ static int lua_fairygui_GObject_getTooltips(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getTooltips'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_GObject_addClickListener(lua_State* tolua_S) +{ + int argc = 0; + fairygui::GObject* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::GObject*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObject_addClickListener'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + LUA_FUNCTION handler = (toluafix_ref_function(tolua_S,2,0)); + if (0 == handler) { + tolua_error(tolua_S, "invalid arguments in function 'lua_fairygui_GObject_addClickListener'", nullptr); + return 0; + } + cobj->addClickListener([=](fairygui::EventContext* context) { + lua_State *coroutine = LuaEngine::getInstance()->getLuaStack()->getLuaState(); + object_to_luaval(coroutine, "fairygui.EventContext", context); + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 1); + }); + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)cobj, handler, (ScriptHandlerMgr::HandlerType)HT_GOBJECT_CLICKED); + return 0; + } + if (2 == argc) { + LUA_FUNCTION handler = (toluafix_ref_function(tolua_S,2,0)); + int tag; + ok &= luaval_to_int32(tolua_S,3,&tag,"lua_fairygui_GObject_addClickListener"); + if (0 == handler || !ok) { + tolua_error(tolua_S, "invalid arguments in function 'lua_fairygui_GObject_addClickListener'", nullptr); + return 0; + } + cobj->addClickListener([=](fairygui::EventContext* context) { + lua_State *coroutine = LuaEngine::getInstance()->getLuaStack()->getLuaState(); + object_to_luaval(coroutine, "fairygui.EventContext", context); + lua_pushinteger(coroutine, tag); + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 2); + }, fairygui::EventTag(tag)); + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)cobj, handler, (ScriptHandlerMgr::HandlerType)HT_GOBJECT_CLICKED); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting 1~2 \n", "fairygui.GObject:addClickListener",argc); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_addClickListener'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_GObject_removeClickListener(lua_State* tolua_S) +{ + int argc = 0; + fairygui::GObject* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GObject",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::GObject*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObject_removeClickListener'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + int tag; + ok &= luaval_to_int32(tolua_S, 2, (int *)&tag, "lua_fairygui_GObject_removeClickListener"); + if (!ok) { + tolua_error(tolua_S, "invalid arguments in function 'lua_fairygui_GObject_removeClickListener'", nullptr); + return 0; + } + cobj->removeClickListener(fairygui::EventTag(tag)); + ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)cobj, (ScriptHandlerMgr::HandlerType)HT_GOBJECT_CLICKED); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObject:removeClickListener",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_removeClickListener'.",&tolua_err); return 0; #endif } @@ -5318,7 +5460,7 @@ static int lua_fairygui_GObject_create(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_create'.",&tolua_err); - return 0; + return 0; #endif } @@ -5342,7 +5484,7 @@ static int lua_fairygui_GObject_getDraggingObject(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObject_getDraggingObject'.",&tolua_err); - return 0; + return 0; #endif } @@ -5352,21 +5494,21 @@ static int lua_register_fairygui_GObject(lua_State* tolua_S) tolua_cclass(tolua_S,"GObject","fairygui.GObject","fairygui.UIEventDispatcher",nullptr); tolua_beginmodule(tolua_S,"GObject"); - // variable - tolua_variable(tolua_S,"id",lua_fairygui_GObject_get_id, nullptr); - tolua_variable(tolua_S,"name",lua_fairygui_GObject_get_name, lua_fairygui_GObject_set_name); - tolua_variable(tolua_S,"sourceSize",lua_fairygui_GObject_get_sourceSize, nullptr); - tolua_variable(tolua_S,"initSize",lua_fairygui_GObject_get_initSize, nullptr); - tolua_variable(tolua_S,"minSize",lua_fairygui_GObject_get_minSize, nullptr); - tolua_variable(tolua_S,"maxSize",lua_fairygui_GObject_get_maxSize, nullptr); - // function - tolua_function(tolua_S,"getXMin",lua_fairygui_GObject_getXMin); - tolua_function(tolua_S,"setXMin",lua_fairygui_GObject_setXMin); - tolua_function(tolua_S,"getYMin",lua_fairygui_GObject_getYMin); - tolua_function(tolua_S,"setYMin",lua_fairygui_GObject_setYMin); - tolua_function(tolua_S,"isPivotAsAnchor",lua_fairygui_GObject_isPivotAsAnchor); - tolua_function(tolua_S,"getProp",lua_fairygui_GObject_getProp); - tolua_function(tolua_S,"setProp",lua_fairygui_GObject_setProp); + // variable + tolua_variable(tolua_S,"id",lua_fairygui_GObject_get_id, nullptr); + tolua_variable(tolua_S,"name",lua_fairygui_GObject_get_name, lua_fairygui_GObject_set_name); + tolua_variable(tolua_S,"sourceSize",lua_fairygui_GObject_get_sourceSize, nullptr); + tolua_variable(tolua_S,"initSize",lua_fairygui_GObject_get_initSize, nullptr); + tolua_variable(tolua_S,"minSize",lua_fairygui_GObject_get_minSize, nullptr); + tolua_variable(tolua_S,"maxSize",lua_fairygui_GObject_get_maxSize, nullptr); + // function + tolua_function(tolua_S,"getXMin",lua_fairygui_GObject_getXMin); + tolua_function(tolua_S,"setXMin",lua_fairygui_GObject_setXMin); + tolua_function(tolua_S,"getYMin",lua_fairygui_GObject_getYMin); + tolua_function(tolua_S,"setYMin",lua_fairygui_GObject_setYMin); + tolua_function(tolua_S,"isPivotAsAnchor",lua_fairygui_GObject_isPivotAsAnchor); + tolua_function(tolua_S,"getProp",lua_fairygui_GObject_getProp); + tolua_function(tolua_S,"setProp",lua_fairygui_GObject_setProp); tolua_function(tolua_S,"startDrag",lua_fairygui_GObject_startDrag); tolua_function(tolua_S,"getPackageItem",lua_fairygui_GObject_getPackageItem); tolua_function(tolua_S,"setGroup",lua_fairygui_GObject_setGroup); @@ -5378,9 +5520,9 @@ static int lua_register_fairygui_GObject(lua_State* tolua_S) tolua_function(tolua_S,"getY",lua_fairygui_GObject_getY); tolua_function(tolua_S,"displayObject",lua_fairygui_GObject_displayObject); tolua_function(tolua_S,"setData",lua_fairygui_GObject_setData); - tolua_function(tolua_S,"getData",lua_fairygui_GObject_getData); - tolua_function(tolua_S,"setCustomData",lua_fairygui_GObject_setCustomData); - tolua_function(tolua_S,"getCustomData",lua_fairygui_GObject_getCustomData); + tolua_function(tolua_S,"getData",lua_fairygui_GObject_getData); + tolua_function(tolua_S,"setCustomData",lua_fairygui_GObject_setCustomData); + tolua_function(tolua_S,"getCustomData",lua_fairygui_GObject_getCustomData); tolua_function(tolua_S,"getRotation",lua_fairygui_GObject_getRotation); tolua_function(tolua_S,"stopDrag",lua_fairygui_GObject_stopDrag); tolua_function(tolua_S,"getSortingOrder",lua_fairygui_GObject_getSortingOrder); @@ -5429,7 +5571,7 @@ static int lua_register_fairygui_GObject(lua_State* tolua_S) tolua_function(tolua_S,"setHeight",lua_fairygui_GObject_setHeight); tolua_function(tolua_S,"getX",lua_fairygui_GObject_getX); tolua_function(tolua_S,"getRoot",lua_fairygui_GObject_getRoot); - tolua_function(tolua_S,"treeNode",lua_fairygui_GObject_treeNode); + tolua_function(tolua_S,"treeNode",lua_fairygui_GObject_treeNode); tolua_function(tolua_S,"center",lua_fairygui_GObject_center); tolua_function(tolua_S,"getIcon",lua_fairygui_GObject_getIcon); tolua_function(tolua_S,"setVisible",lua_fairygui_GObject_setVisible); @@ -5445,6 +5587,8 @@ static int lua_register_fairygui_GObject(lua_State* tolua_S) tolua_function(tolua_S,"setSkewY",lua_fairygui_GObject_setSkewY); tolua_function(tolua_S,"setSize",lua_fairygui_GObject_setSize); tolua_function(tolua_S,"getTooltips",lua_fairygui_GObject_getTooltips); + tolua_function(tolua_S,"addClickListener", lua_fairygui_GObject_addClickListener); + tolua_function(tolua_S,"removeClickListener", lua_fairygui_GObject_removeClickListener); tolua_function(tolua_S,"create", lua_fairygui_GObject_create); tolua_function(tolua_S,"getDraggingObject", lua_fairygui_GObject_getDraggingObject); tolua_endmodule(tolua_S); @@ -5483,7 +5627,7 @@ static int lua_fairygui_UIPackage_getName(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIPackage_getName'.",&tolua_err); - return 0; + return 0; #endif } @@ -5516,7 +5660,7 @@ static int lua_fairygui_UIPackage_getId(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIPackage_getId'.",&tolua_err); - return 0; + return 0; #endif } @@ -5556,7 +5700,7 @@ static int lua_fairygui_UIPackage_getItemByName(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIPackage_getItemByName'.",&tolua_err); - return 0; + return 0; #endif } @@ -5596,7 +5740,7 @@ static int lua_fairygui_UIPackage_getItem(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIPackage_getItem'.",&tolua_err); - return 0; + return 0; #endif } @@ -5627,7 +5771,7 @@ static int lua_fairygui_UIPackage_createObjectFromURL(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIPackage_createObjectFromURL'.",&tolua_err); - return 0; + return 0; #endif } @@ -5650,14 +5794,14 @@ static int lua_fairygui_UIPackage_removePackage(lua_State* tolua_S) return 0; } fairygui::UIPackage::removePackage(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.UIPackage:removePackage",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIPackage_removePackage'.",&tolua_err); - return 0; + return 0; #endif } @@ -5690,7 +5834,7 @@ static int lua_fairygui_UIPackage_getItemURL(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIPackage_getItemURL'.",&tolua_err); - return 0; + return 0; #endif } @@ -5721,7 +5865,7 @@ static int lua_fairygui_UIPackage_normalizeURL(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIPackage_normalizeURL'.",&tolua_err); - return 0; + return 0; #endif } @@ -5737,14 +5881,14 @@ static int lua_fairygui_UIPackage_removeAllPackages(lua_State* tolua_S) argc = lua_gettop(tolua_S) - 1; if (argc == 0) { fairygui::UIPackage::removeAllPackages(); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.UIPackage:removeAllPackages",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIPackage_removeAllPackages'.",&tolua_err); - return 0; + return 0; #endif } @@ -5777,7 +5921,7 @@ static int lua_fairygui_UIPackage_createObject(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIPackage_createObject'.",&tolua_err); - return 0; + return 0; #endif } @@ -5808,7 +5952,7 @@ static int lua_fairygui_UIPackage_getByName(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIPackage_getByName'.",&tolua_err); - return 0; + return 0; #endif } @@ -5839,7 +5983,7 @@ static int lua_fairygui_UIPackage_addPackage(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIPackage_addPackage'.",&tolua_err); - return 0; + return 0; #endif } @@ -5870,7 +6014,7 @@ static int lua_fairygui_UIPackage_getById(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIPackage_getById'.",&tolua_err); - return 0; + return 0; #endif } @@ -5901,7 +6045,7 @@ static int lua_fairygui_UIPackage_getItemByURL(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIPackage_getItemByURL'.",&tolua_err); - return 0; + return 0; #endif } @@ -5925,7 +6069,7 @@ static int lua_fairygui_UIPackage_getEmptyTexture(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIPackage_getEmptyTexture'.",&tolua_err); - return 0; + return 0; #endif } @@ -5984,7 +6128,7 @@ static int lua_fairygui_GImage_setColor(lua_State* tolua_S) return 0; } cobj->setColor(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GImage:setColor",argc, 1); return 0; @@ -5992,7 +6136,7 @@ static int lua_fairygui_GImage_setColor(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GImage_setColor'.",&tolua_err); - return 0; + return 0; #endif } @@ -6025,7 +6169,7 @@ static int lua_fairygui_GImage_getColor(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GImage_getColor'.",&tolua_err); - return 0; + return 0; #endif } @@ -6058,7 +6202,7 @@ static int lua_fairygui_GImage_getFlip(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GImage_getFlip'.",&tolua_err); - return 0; + return 0; #endif } @@ -6089,7 +6233,7 @@ static int lua_fairygui_GImage_setFlip(lua_State* tolua_S) return 0; } cobj->setFlip(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GImage:setFlip",argc, 1); return 0; @@ -6097,243 +6241,201 @@ static int lua_fairygui_GImage_setFlip(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GImage_setFlip'.",&tolua_err); - return 0; -#endif -} - -static int lua_fairygui_GImage_create(lua_State* tolua_S) -{ - int argc = 0; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.GImage",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - if (argc == 0) { - fairygui::GImage* ret = fairygui::GImage::create(); - object_to_luaval(tolua_S, "fairygui.GImage",(fairygui::GImage*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GImage:create",argc, 0); return 0; -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GImage_create'.",&tolua_err); - return 0; #endif } -static int lua_register_fairygui_GImage(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.GImage"); - tolua_cclass(tolua_S,"GImage","fairygui.GImage","fairygui.GObject",nullptr); - - tolua_beginmodule(tolua_S,"GImage"); - tolua_function(tolua_S,"setColor",lua_fairygui_GImage_setColor); - tolua_function(tolua_S,"getColor",lua_fairygui_GImage_getColor); - tolua_function(tolua_S,"getFlip",lua_fairygui_GImage_getFlip); - tolua_function(tolua_S,"setFlip",lua_fairygui_GImage_setFlip); - tolua_function(tolua_S,"create", lua_fairygui_GImage_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::GImage).name(); - g_luaType[typeName] = "fairygui.GImage"; - g_typeCast["GImage"] = "fairygui.GImage"; - return 1; -} - -static int lua_fairygui_GMovieClip_getFrame(lua_State* tolua_S) +static int lua_fairygui_GImage_getFillMethod(lua_State* tolua_S) { int argc = 0; - fairygui::GMovieClip* cobj = nullptr; + fairygui::GImage* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GMovieClip",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GImage",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GMovieClip*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GImage*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GMovieClip_getFrame'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GImage_getFillMethod'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - int ret = cobj->getFrame(); + int ret = (int)cobj->getFillMethod(); tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GMovieClip:getFrame",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GImage:getFillMethod",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GMovieClip_getFrame'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GImage_getFillMethod'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GMovieClip_setColor(lua_State* tolua_S) +static int lua_fairygui_GImage_setFillMethod(lua_State* tolua_S) { int argc = 0; - fairygui::GMovieClip* cobj = nullptr; + fairygui::GImage* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GMovieClip",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GImage",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GMovieClip*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GImage*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GMovieClip_setColor'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GImage_setFillMethod'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Color3B arg0; - ok &= luaval_to_color3b(tolua_S, 2, &arg0, "fairygui.GMovieClip:setColor"); + fairygui::FillMethod arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GImage:setFillMethod"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GMovieClip_setColor'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GImage_setFillMethod'", nullptr); return 0; } - cobj->setColor(arg0); - return 0; + cobj->setFillMethod(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GMovieClip:setColor",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GImage:setFillMethod",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GMovieClip_setColor'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GImage_setFillMethod'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GMovieClip_getColor(lua_State* tolua_S) +static int lua_fairygui_GImage_getFillOrigin(lua_State* tolua_S) { int argc = 0; - fairygui::GMovieClip* cobj = nullptr; + fairygui::GImage* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GMovieClip",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GImage",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GMovieClip*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GImage*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GMovieClip_getColor'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GImage_getFillOrigin'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - const cocos2d::Color3B& ret = cobj->getColor(); - color3b_to_luaval(tolua_S, ret); + int ret = (int)cobj->getFillOrigin(); + tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GMovieClip:getColor",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GImage:getFillOrigin",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GMovieClip_getColor'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GImage_getFillOrigin'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GMovieClip_getFlip(lua_State* tolua_S) +static int lua_fairygui_GImage_setFillOrigin(lua_State* tolua_S) { int argc = 0; - fairygui::GMovieClip* cobj = nullptr; + fairygui::GImage* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GMovieClip",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GImage",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GMovieClip*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GImage*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GMovieClip_getFlip'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GImage_setFillOrigin'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - int ret = (int)cobj->getFlip(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + if (argc == 1) { + fairygui::FillOrigin arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GImage:setFillOrigin"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GImage_setFillOrigin'", nullptr); + return 0; + } + cobj->setFillOrigin(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GMovieClip:getFlip",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GImage:setFillOrigin",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GMovieClip_getFlip'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GImage_setFillOrigin'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GMovieClip_setFlip(lua_State* tolua_S) +static int lua_fairygui_GImage_isFillClockwise(lua_State* tolua_S) { int argc = 0; - fairygui::GMovieClip* cobj = nullptr; - bool ok = true; + fairygui::GImage* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GMovieClip",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GImage",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GMovieClip*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GImage*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GMovieClip_setFlip'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GImage_isFillClockwise'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::FlipType arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GMovieClip:setFlip"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GMovieClip_setFlip'", nullptr); - return 0; - } - cobj->setFlip(arg0); - return 0; + if (argc == 0) { + bool ret = cobj->isFillClockwise(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GMovieClip:setFlip",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GImage:isFillClockwise",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GMovieClip_setFlip'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GImage_isFillClockwise'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GMovieClip_setPlaying(lua_State* tolua_S) +static int lua_fairygui_GImage_setFillClockwise(lua_State* tolua_S) { int argc = 0; - fairygui::GMovieClip* cobj = nullptr; + fairygui::GImage* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GMovieClip",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GImage",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GMovieClip*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GImage*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GMovieClip_setPlaying'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GImage_setFillClockwise'", nullptr); return 0; } #endif @@ -6341,130 +6443,147 @@ static int lua_fairygui_GMovieClip_setPlaying(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GMovieClip:setPlaying"); + ok &= luaval_to_boolean(tolua_S, 2, &arg0, "fairygui.GImage:setFillClockwise"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GMovieClip_setPlaying'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GImage_setFillClockwise'", nullptr); return 0; } - cobj->setPlaying(arg0); - return 0; + cobj->setFillClockwise(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GMovieClip:setPlaying",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GImage:setFillClockwise",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GMovieClip_setPlaying'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GImage_setFillClockwise'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GMovieClip_setPlaySettings(lua_State* tolua_S) +static int lua_fairygui_GImage_getFillAmount(lua_State* tolua_S) { int argc = 0; - fairygui::GMovieClip* cobj = nullptr; - bool ok = true; + fairygui::GImage* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GMovieClip",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GImage",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GMovieClip*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GImage*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GMovieClip_setPlaySettings'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GImage_getFillAmount'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - cobj->setPlaySettings(); - return 0; - } - if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GMovieClip:setPlaySettings"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GMovieClip_setPlaySettings'", nullptr); - return 0; - } - cobj->setPlaySettings(arg0); - return 0; - } - if (argc == 2) { - int arg0; - int arg1; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GMovieClip:setPlaySettings"); - ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GMovieClip:setPlaySettings"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GMovieClip_setPlaySettings'", nullptr); - return 0; - } - cobj->setPlaySettings(arg0, arg1); - return 0; + float ret = cobj->getFillAmount(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; } - if (argc == 3) { - int arg0; - int arg1; - int arg2; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GMovieClip:setPlaySettings"); - ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GMovieClip:setPlaySettings"); - ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "fairygui.GMovieClip:setPlaySettings"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GMovieClip_setPlaySettings'", nullptr); - return 0; - } - cobj->setPlaySettings(arg0, arg1, arg2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GImage:getFillAmount",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GImage_getFillAmount'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_GImage_setFillAmount(lua_State* tolua_S) +{ + int argc = 0; + fairygui::GImage* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GImage",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::GImage*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GImage_setFillAmount'", nullptr); return 0; } - if (argc == 4) { - int arg0; - int arg1; - int arg2; - int arg3; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GMovieClip:setPlaySettings"); - ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GMovieClip:setPlaySettings"); - ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "fairygui.GMovieClip:setPlaySettings"); - ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3, "fairygui.GMovieClip:setPlaySettings"); +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + float arg0; + ok &= luaval_to_float(tolua_S, 2, &arg0, "fairygui.GImage:setFillAmount"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GMovieClip_setPlaySettings'", nullptr); - return 0; - } - cobj->setPlaySettings(arg0, arg1, arg2, arg3); - return 0; - } - if (argc == 5) { - int arg0; - int arg1; - int arg2; - int arg3; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GMovieClip:setPlaySettings"); - ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GMovieClip:setPlaySettings"); - ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "fairygui.GMovieClip:setPlaySettings"); - ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3, "fairygui.GMovieClip:setPlaySettings"); - LUA_FUNCTION handler = (toluafix_ref_function(tolua_S, 6, 0)); - if(!ok || 0 == handler) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GMovieClip_setPlaySettings'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GImage_setFillAmount'", nullptr); return 0; } - cobj->setPlaySettings(arg0, arg1, arg2, arg3, [=]() { - LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 0); - }); - ScriptHandlerMgr::getInstance()->addCustomHandler((void*)cobj, handler); + cobj->setFillAmount(arg0); return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GMovieClip:setPlaySettings",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GImage:setFillAmount",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GMovieClip_setPlaySettings'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GImage_setFillAmount'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GMovieClip_isPlaying(lua_State* tolua_S) +static int lua_fairygui_GImage_create(lua_State* tolua_S) +{ + int argc = 0; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertable(tolua_S,1,"fairygui.GImage",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + if (argc == 0) { + fairygui::GImage* ret = fairygui::GImage::create(); + object_to_luaval(tolua_S, "fairygui.GImage",(fairygui::GImage*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GImage:create",argc, 0); + return 0; +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GImage_create'.",&tolua_err); + return 0; +#endif +} + +static int lua_register_fairygui_GImage(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"fairygui.GImage"); + tolua_cclass(tolua_S,"GImage","fairygui.GImage","fairygui.GObject",nullptr); + + tolua_beginmodule(tolua_S,"GImage"); + tolua_function(tolua_S,"setColor",lua_fairygui_GImage_setColor); + tolua_function(tolua_S,"getColor",lua_fairygui_GImage_getColor); + tolua_function(tolua_S,"getFlip",lua_fairygui_GImage_getFlip); + tolua_function(tolua_S,"setFlip",lua_fairygui_GImage_setFlip); + tolua_function(tolua_S,"getFillMethod",lua_fairygui_GImage_getFillMethod); + tolua_function(tolua_S,"setFillMethod",lua_fairygui_GImage_setFillMethod); + tolua_function(tolua_S,"getFillOrigin",lua_fairygui_GImage_getFillOrigin); + tolua_function(tolua_S,"setFillOrigin",lua_fairygui_GImage_setFillOrigin); + tolua_function(tolua_S,"isFillClockwise",lua_fairygui_GImage_isFillClockwise); + tolua_function(tolua_S,"setFillClockwise",lua_fairygui_GImage_setFillClockwise); + tolua_function(tolua_S,"getFillAmount",lua_fairygui_GImage_getFillAmount); + tolua_function(tolua_S,"setFillAmount",lua_fairygui_GImage_setFillAmount); + tolua_function(tolua_S,"create", lua_fairygui_GImage_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::GImage).name(); + g_luaType[typeName] = "fairygui.GImage"; + g_typeCast["GImage"] = "fairygui.GImage"; + return 1; +} + +static int lua_fairygui_GMovieClip_getFrame(lua_State* tolua_S) { int argc = 0; fairygui::GMovieClip* cobj = nullptr; @@ -6476,28 +6595,28 @@ static int lua_fairygui_GMovieClip_isPlaying(lua_State* tolua_S) cobj = (fairygui::GMovieClip*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GMovieClip_isPlaying'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GMovieClip_getFrame'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - bool ret = cobj->isPlaying(); - tolua_pushboolean(tolua_S,(bool)ret); + int ret = cobj->getFrame(); + tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GMovieClip:isPlaying",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GMovieClip:getFrame",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GMovieClip_isPlaying'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GMovieClip_getFrame'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GMovieClip_setFrame(lua_State* tolua_S) +static int lua_fairygui_GMovieClip_setColor(lua_State* tolua_S) { int argc = 0; fairygui::GMovieClip* cobj = nullptr; @@ -6510,332 +6629,437 @@ static int lua_fairygui_GMovieClip_setFrame(lua_State* tolua_S) cobj = (fairygui::GMovieClip*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GMovieClip_setFrame'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GMovieClip_setColor'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GMovieClip:setFrame"); - if(!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GMovieClip_setFrame'", nullptr); + cocos2d::Color3B arg0; + ok &= luaval_to_color3b(tolua_S, 2, &arg0, "fairygui.GMovieClip:setColor"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GMovieClip_setColor'", nullptr); return 0; } - cobj->setFrame(arg0); + cobj->setColor(arg0); return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GMovieClip:setFrame",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GMovieClip:setColor",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GMovieClip_setFrame'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GMovieClip_setColor'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GMovieClip_reverse(lua_State* tolua_S) +static int lua_fairygui_GMovieClip_getColor(lua_State* tolua_S) { - int argc = 0; - fairygui::GMovieClip* cobj = nullptr; + int argc = 0; + fairygui::GMovieClip* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GMovieClip",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GMovieClip",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GMovieClip*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GMovieClip*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GMovieClip_reverse'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GMovieClip_getColor'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->reverse(); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GMovieClip:reverse",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + const cocos2d::Color3B& ret = cobj->getColor(); + color3b_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GMovieClip:getColor",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GMovieClip_reverse'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GMovieClip_getColor'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GMovieClip_create(lua_State* tolua_S) +static int lua_fairygui_GMovieClip_getFlip(lua_State* tolua_S) { int argc = 0; + fairygui::GMovieClip* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.GMovieClip",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GMovieClip",0,&tolua_err)) goto tolua_lerror; #endif - - argc = lua_gettop(tolua_S) - 1; - if (argc == 0){ - fairygui::GMovieClip* ret = fairygui::GMovieClip::create(); - object_to_luaval(tolua_S, "fairygui.GMovieClip",(fairygui::GMovieClip*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GMovieClip:create",argc, 0); - return 0; -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GMovieClip_create'.",&tolua_err); - return 0; -#endif -} - -static int lua_register_fairygui_GMovieClip(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.GMovieClip"); - tolua_cclass(tolua_S,"GMovieClip","fairygui.GMovieClip","fairygui.GObject",nullptr); - - tolua_beginmodule(tolua_S,"GMovieClip"); - tolua_function(tolua_S,"getFrame",lua_fairygui_GMovieClip_getFrame); - tolua_function(tolua_S,"setColor",lua_fairygui_GMovieClip_setColor); - tolua_function(tolua_S,"getColor",lua_fairygui_GMovieClip_getColor); - tolua_function(tolua_S,"getFlip",lua_fairygui_GMovieClip_getFlip); - tolua_function(tolua_S,"setFlip",lua_fairygui_GMovieClip_setFlip); - tolua_function(tolua_S,"setPlaying",lua_fairygui_GMovieClip_setPlaying); - tolua_function(tolua_S,"setPlaySettings",lua_fairygui_GMovieClip_setPlaySettings); - tolua_function(tolua_S,"isPlaying",lua_fairygui_GMovieClip_isPlaying); - tolua_function(tolua_S,"setFrame",lua_fairygui_GMovieClip_setFrame); - tolua_function(tolua_S,"reverse", lua_fairygui_GMovieClip_reverse); - tolua_function(tolua_S,"create", lua_fairygui_GMovieClip_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::GMovieClip).name(); - g_luaType[typeName] = "fairygui.GMovieClip"; - g_typeCast["GMovieClip"] = "fairygui.GMovieClip"; - return 1; -} - -static int lua_fairygui_GTextField_setAutoSize(lua_State* tolua_S) -{ - int argc = 0; - fairygui::GTextField* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTextField",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GMovieClip*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_setAutoSize'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GMovieClip_getFlip'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::AutoSizeType arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GTextField:setAutoSize"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTextField_setAutoSize'", nullptr); - return 0; - } - cobj->setAutoSize(arg0); - return 0; + if (argc == 0) { + int ret = (int)cobj->getFlip(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:setAutoSize",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GMovieClip:getFlip",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_setAutoSize'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GMovieClip_getFlip'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTextField_getFontSize(lua_State* tolua_S) +static int lua_fairygui_GMovieClip_setFlip(lua_State* tolua_S) { int argc = 0; - fairygui::GTextField* cobj = nullptr; + fairygui::GMovieClip* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTextField",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GMovieClip",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GMovieClip*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_getFontSize'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GMovieClip_setFlip'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - float ret = cobj->getFontSize(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + if (argc == 1) { + fairygui::FlipType arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GMovieClip:setFlip"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GMovieClip_setFlip'", nullptr); + return 0; + } + cobj->setFlip(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:getFontSize",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GMovieClip:setFlip",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_getFontSize'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GMovieClip_setFlip'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTextField_setColor(lua_State* tolua_S) +static int lua_fairygui_GMovieClip_setPlaying(lua_State* tolua_S) { int argc = 0; - fairygui::GTextField* cobj = nullptr; + fairygui::GMovieClip* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTextField",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GMovieClip",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GMovieClip*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_setColor'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GMovieClip_setPlaying'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Color3B arg0; - ok &= luaval_to_color3b(tolua_S, 2, &arg0, "fairygui.GTextField:setColor"); + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GMovieClip:setPlaying"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTextField_setColor'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GMovieClip_setPlaying'", nullptr); return 0; } - cobj->setColor(arg0); - return 0; + cobj->setPlaying(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:setColor",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GMovieClip:setPlaying",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_setColor'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GMovieClip_setPlaying'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTextField_setSingleLine(lua_State* tolua_S) +static int lua_fairygui_GMovieClip_setPlaySettings(lua_State* tolua_S) { int argc = 0; - fairygui::GTextField* cobj = nullptr; + fairygui::GMovieClip* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTextField",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GMovieClip",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GMovieClip*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_setSingleLine'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GMovieClip_setPlaySettings'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cobj->setPlaySettings(); + return 0; + } if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GTextField:setSingleLine"); + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GMovieClip:setPlaySettings"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTextField_setSingleLine'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GMovieClip_setPlaySettings'", nullptr); return 0; } - cobj->setSingleLine(arg0); - return 0; + cobj->setPlaySettings(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:setSingleLine",argc, 1); + if (argc == 2) { + int arg0; + int arg1; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GMovieClip:setPlaySettings"); + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GMovieClip:setPlaySettings"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GMovieClip_setPlaySettings'", nullptr); + return 0; + } + cobj->setPlaySettings(arg0, arg1); + return 0; + } + if (argc == 3) { + int arg0; + int arg1; + int arg2; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GMovieClip:setPlaySettings"); + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GMovieClip:setPlaySettings"); + ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "fairygui.GMovieClip:setPlaySettings"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GMovieClip_setPlaySettings'", nullptr); + return 0; + } + cobj->setPlaySettings(arg0, arg1, arg2); + return 0; + } + if (argc == 4) { + int arg0; + int arg1; + int arg2; + int arg3; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GMovieClip:setPlaySettings"); + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GMovieClip:setPlaySettings"); + ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "fairygui.GMovieClip:setPlaySettings"); + ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3, "fairygui.GMovieClip:setPlaySettings"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GMovieClip_setPlaySettings'", nullptr); + return 0; + } + cobj->setPlaySettings(arg0, arg1, arg2, arg3); + return 0; + } + if (argc == 5) { + int arg0; + int arg1; + int arg2; + int arg3; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GMovieClip:setPlaySettings"); + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GMovieClip:setPlaySettings"); + ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "fairygui.GMovieClip:setPlaySettings"); + ok &= luaval_to_int32(tolua_S, 5,(int *)&arg3, "fairygui.GMovieClip:setPlaySettings"); + LUA_FUNCTION handler = (toluafix_ref_function(tolua_S, 6, 0)); + if(!ok || 0 == handler) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GMovieClip_setPlaySettings'", nullptr); + return 0; + } + cobj->setPlaySettings(arg0, arg1, arg2, arg3, [=]() { + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 0); + }); + ScriptHandlerMgr::getInstance()->addCustomHandler((void*)cobj, handler); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GMovieClip:setPlaySettings",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_setSingleLine'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GMovieClip_setPlaySettings'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTextField_isUBBEnabled(lua_State* tolua_S) +static int lua_fairygui_GMovieClip_isPlaying(lua_State* tolua_S) { int argc = 0; - fairygui::GTextField* cobj = nullptr; + fairygui::GMovieClip* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTextField",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GMovieClip",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GMovieClip*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_isUBBEnabled'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GMovieClip_isPlaying'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - bool ret = cobj->isUBBEnabled(); + bool ret = cobj->isPlaying(); tolua_pushboolean(tolua_S,(bool)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:isUBBEnabled",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GMovieClip:isPlaying",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_isUBBEnabled'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GMovieClip_isPlaying'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTextField_getColor(lua_State* tolua_S) +static int lua_fairygui_GMovieClip_setFrame(lua_State* tolua_S) { int argc = 0; - fairygui::GTextField* cobj = nullptr; + fairygui::GMovieClip* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTextField",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GMovieClip",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GMovieClip*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_getColor'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GMovieClip_setFrame'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - const cocos2d::Color3B& ret = cobj->getColor(); - color3b_to_luaval(tolua_S, ret); - return 1; + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GMovieClip:setFrame"); + if(!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GMovieClip_setFrame'", nullptr); + return 0; + } + cobj->setFrame(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:getColor",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GMovieClip:setFrame",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_getColor'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GMovieClip_setFrame'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTextField_setUBBEnabled(lua_State* tolua_S) +static int lua_fairygui_GMovieClip_reverse(lua_State* tolua_S) { int argc = 0; - fairygui::GTextField* cobj = nullptr; + fairygui::GMovieClip* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GMovieClip",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::GMovieClip*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GMovieClip_reverse'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cobj->reverse(); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GMovieClip:reverse",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GMovieClip_reverse'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_GMovieClip_create(lua_State* tolua_S) +{ + int argc = 0; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertable(tolua_S,1,"fairygui.GMovieClip",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + if (argc == 0){ + fairygui::GMovieClip* ret = fairygui::GMovieClip::create(); + object_to_luaval(tolua_S, "fairygui.GMovieClip",(fairygui::GMovieClip*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GMovieClip:create",argc, 0); + return 0; +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GMovieClip_create'.",&tolua_err); + return 0; +#endif +} + +static int lua_register_fairygui_GMovieClip(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"fairygui.GMovieClip"); + tolua_cclass(tolua_S,"GMovieClip","fairygui.GMovieClip","fairygui.GObject",nullptr); + + tolua_beginmodule(tolua_S,"GMovieClip"); + tolua_function(tolua_S,"getFrame",lua_fairygui_GMovieClip_getFrame); + tolua_function(tolua_S,"setColor",lua_fairygui_GMovieClip_setColor); + tolua_function(tolua_S,"getColor",lua_fairygui_GMovieClip_getColor); + tolua_function(tolua_S,"getFlip",lua_fairygui_GMovieClip_getFlip); + tolua_function(tolua_S,"setFlip",lua_fairygui_GMovieClip_setFlip); + tolua_function(tolua_S,"setPlaying",lua_fairygui_GMovieClip_setPlaying); + tolua_function(tolua_S,"setPlaySettings",lua_fairygui_GMovieClip_setPlaySettings); + tolua_function(tolua_S,"isPlaying",lua_fairygui_GMovieClip_isPlaying); + tolua_function(tolua_S,"setFrame",lua_fairygui_GMovieClip_setFrame); + tolua_function(tolua_S,"reverse", lua_fairygui_GMovieClip_reverse); + tolua_function(tolua_S,"create", lua_fairygui_GMovieClip_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::GMovieClip).name(); + g_luaType[typeName] = "fairygui.GMovieClip"; + g_typeCast["GMovieClip"] = "fairygui.GMovieClip"; + return 1; +} + +static int lua_fairygui_GTextField_setAutoSize(lua_State* tolua_S) +{ + int argc = 0; + fairygui::GTextField* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 @@ -6845,33 +7069,33 @@ static int lua_fairygui_GTextField_setUBBEnabled(lua_State* tolua_S) cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_setUBBEnabled'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_setAutoSize'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GTextField:setUBBEnabled"); + fairygui::AutoSizeType arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GTextField:setAutoSize"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTextField_setUBBEnabled'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTextField_setAutoSize'", nullptr); return 0; } - cobj->setUBBEnabled(arg0); - return 0; + cobj->setAutoSize(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:setUBBEnabled",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:setAutoSize",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_setUBBEnabled'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_setAutoSize'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTextField_getAutoSize(lua_State* tolua_S) +static int lua_fairygui_GTextField_getFontSize(lua_State* tolua_S) { int argc = 0; fairygui::GTextField* cobj = nullptr; @@ -6883,28 +7107,28 @@ static int lua_fairygui_GTextField_getAutoSize(lua_State* tolua_S) cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_getAutoSize'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_getFontSize'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - int ret = (int)cobj->getAutoSize(); - lua_pushinteger(tolua_S,ret); + float ret = cobj->getFontSize(); + tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:getAutoSize",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:getFontSize",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_getAutoSize'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_getFontSize'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTextField_setFontSize(lua_State* tolua_S) +static int lua_fairygui_GTextField_setColor(lua_State* tolua_S) { int argc = 0; fairygui::GTextField* cobj = nullptr; @@ -6917,36 +7141,37 @@ static int lua_fairygui_GTextField_setFontSize(lua_State* tolua_S) cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_setFontSize'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_setColor'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GTextField:setFontSize"); + cocos2d::Color3B arg0; + ok &= luaval_to_color3b(tolua_S, 2, &arg0, "fairygui.GTextField:setColor"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTextField_setFontSize'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTextField_setColor'", nullptr); return 0; } - cobj->setFontSize(arg0); - return 0; + cobj->setColor(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:setFontSize",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:setColor",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_setFontSize'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_setColor'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTextField_applyTextFormat(lua_State* tolua_S) +static int lua_fairygui_GTextField_setSingleLine(lua_State* tolua_S) { int argc = 0; fairygui::GTextField* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; @@ -6955,27 +7180,33 @@ static int lua_fairygui_GTextField_applyTextFormat(lua_State* tolua_S) cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_applyTextFormat'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_setSingleLine'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->applyTextFormat(); - return 0; + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GTextField:setSingleLine"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTextField_setSingleLine'", nullptr); + return 0; + } + cobj->setSingleLine(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:applyTextFormat",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:setSingleLine",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_applyTextFormat'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_setSingleLine'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTextField_getTextFormat(lua_State* tolua_S) +static int lua_fairygui_GTextField_isUBBEnabled(lua_State* tolua_S) { int argc = 0; fairygui::GTextField* cobj = nullptr; @@ -6987,28 +7218,28 @@ static int lua_fairygui_GTextField_getTextFormat(lua_State* tolua_S) cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_getTextFormat'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_isUBBEnabled'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - fairygui::TextFormat* ret = cobj->getTextFormat(); - object_to_luaval(tolua_S, "fairygui.TextFormat",(fairygui::TextFormat*)ret); + bool ret = cobj->isUBBEnabled(); + tolua_pushboolean(tolua_S,(bool)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:getTextFormat",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:isUBBEnabled",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_getTextFormat'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_isUBBEnabled'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTextField_isSingleLine(lua_State* tolua_S) +static int lua_fairygui_GTextField_getColor(lua_State* tolua_S) { int argc = 0; fairygui::GTextField* cobj = nullptr; @@ -7020,31 +7251,32 @@ static int lua_fairygui_GTextField_isSingleLine(lua_State* tolua_S) cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_isSingleLine'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_getColor'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - bool ret = cobj->isSingleLine(); - tolua_pushboolean(tolua_S,(bool)ret); + const cocos2d::Color3B& ret = cobj->getColor(); + color3b_to_luaval(tolua_S, ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:isSingleLine",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:getColor",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_isSingleLine'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_getColor'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTextField_getTextSize(lua_State* tolua_S) +static int lua_fairygui_GTextField_setUBBEnabled(lua_State* tolua_S) { int argc = 0; fairygui::GTextField* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; @@ -7053,378 +7285,586 @@ static int lua_fairygui_GTextField_getTextSize(lua_State* tolua_S) cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_getTextSize'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_setUBBEnabled'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - const cocos2d::Size& ret = cobj->getTextSize(); - size_to_luaval(tolua_S, ret); - return 1; + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GTextField:setUBBEnabled"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTextField_setUBBEnabled'", nullptr); + return 0; + } + cobj->setUBBEnabled(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:getTextSize",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:setUBBEnabled",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_getTextSize'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_setUBBEnabled'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTextField_getOutlineColor(lua_State* tolua_S) +static int lua_fairygui_GTextField_getAutoSize(lua_State* tolua_S) { - int argc = 0; - fairygui::GTextField* cobj = nullptr; + int argc = 0; + fairygui::GTextField* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTextField",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTextField",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_getOutlineColor'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_getAutoSize'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cocos2d::Color3B ret = cobj->getOutlineColor(); - color3b_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:getOutlineColor",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + int ret = (int)cobj->getAutoSize(); + lua_pushinteger(tolua_S,ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:getAutoSize",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_getOutlineColor'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_getAutoSize'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTextField_setOutlineColor(lua_State* tolua_S) +static int lua_fairygui_GTextField_setFontSize(lua_State* tolua_S) { - int argc = 0; - fairygui::GTextField* cobj = nullptr; + int argc = 0; + fairygui::GTextField* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTextField",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTextField",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_setOutlineColor'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_setFontSize'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - cocos2d::Color3B arg0; - if (luaval_to_color3b(tolua_S, 2, &arg0, "fairygui.GTextField:setOutlineColor")) { - cobj->setOutlineColor(arg0); - return 0; - } - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTextField_setOutlineColor'", nullptr); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:setOutlineColor",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GTextField:setFontSize"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTextField_setFontSize'", nullptr); + return 0; + } + cobj->setFontSize(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:setFontSize",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_setOutlineColor'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_setFontSize'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTextField_getTemplateVars(lua_State* tolua_S) +static int lua_fairygui_GTextField_applyTextFormat(lua_State* tolua_S) { - int argc = 0; - fairygui::GTextField* cobj = nullptr; + int argc = 0; + fairygui::GTextField* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTextField",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTextField",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_getTemplateVars'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_applyTextFormat'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cocos2d::ValueMap *ret = cobj->getTemplateVars(); - ccvaluemap_to_luaval(tolua_S, *ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:getTemplateVars",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cobj->applyTextFormat(); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:applyTextFormat",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_getTemplateVars'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_applyTextFormat'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTextField_setTemplateVars(lua_State* tolua_S) +static int lua_fairygui_GTextField_getTextFormat(lua_State* tolua_S) { - int argc = 0; - fairygui::GTextField* cobj = nullptr; + int argc = 0; + fairygui::GTextField* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTextField",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTextField",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_setTemplateVars'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_getTextFormat'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - cocos2d::ValueMap arg0; - if (luaval_to_ccvaluemap(tolua_S, 2, &arg0, "fairygui.GTextField:setTemplateVars")) { - cobj->setTemplateVars(&arg0); - return 0; - } - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTextField_setTemplateVars'", nullptr); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:setTemplateVars",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::TextFormat* ret = cobj->getTextFormat(); + object_to_luaval(tolua_S, "fairygui.TextFormat",(fairygui::TextFormat*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:getTextFormat",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_setTemplateVars'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_getTextFormat'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTextField_setVar(lua_State* tolua_S) +static int lua_fairygui_GTextField_isSingleLine(lua_State* tolua_S) { - int argc = 0; - bool ok = true; - fairygui::GTextField* cobj = nullptr; + int argc = 0; + fairygui::GTextField* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTextField",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTextField",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_setVar'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_isSingleLine'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - std::string arg0; - cocos2d::Value arg1; - ok &= luaval_to_std_string(tolua_S, 2, &arg0, "fairygui.GTextField:setVar"); - ok &= luaval_to_ccvalue(tolua_S, 3, &arg1, "fairygui.GTextField:setVar"); - if (ok) { - cobj->setVar(arg0, arg1); - return 0; - } - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTextField_setVar'", nullptr); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:setVar",argc, 2); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + bool ret = cobj->isSingleLine(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:isSingleLine",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_setVar'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_isSingleLine'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTextField_flushVars(lua_State* tolua_S) +static int lua_fairygui_GTextField_getTextSize(lua_State* tolua_S) { - int argc = 0; - fairygui::GTextField* cobj = nullptr; + int argc = 0; + fairygui::GTextField* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTextField",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTextField",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_flushVars'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_getTextSize'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->flushVars(); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:flushVars",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + const cocos2d::Size& ret = cobj->getTextSize(); + size_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:getTextSize",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_flushVars'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_getTextSize'.",&tolua_err); + return 0; #endif } -static int lua_register_fairygui_GTextField(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.GTextField"); - tolua_cclass(tolua_S,"GTextField","fairygui.GTextField","fairygui.GObject",nullptr); - - tolua_beginmodule(tolua_S,"GTextField"); - tolua_function(tolua_S,"setAutoSize",lua_fairygui_GTextField_setAutoSize); - tolua_function(tolua_S,"getFontSize",lua_fairygui_GTextField_getFontSize); - tolua_function(tolua_S,"setColor",lua_fairygui_GTextField_setColor); - tolua_function(tolua_S,"setSingleLine",lua_fairygui_GTextField_setSingleLine); - tolua_function(tolua_S,"isUBBEnabled",lua_fairygui_GTextField_isUBBEnabled); - tolua_function(tolua_S,"getColor",lua_fairygui_GTextField_getColor); - tolua_function(tolua_S,"setUBBEnabled",lua_fairygui_GTextField_setUBBEnabled); - tolua_function(tolua_S,"getAutoSize",lua_fairygui_GTextField_getAutoSize); - tolua_function(tolua_S,"setFontSize",lua_fairygui_GTextField_setFontSize); - tolua_function(tolua_S,"applyTextFormat",lua_fairygui_GTextField_applyTextFormat); - tolua_function(tolua_S,"getTextFormat",lua_fairygui_GTextField_getTextFormat); - tolua_function(tolua_S,"isSingleLine",lua_fairygui_GTextField_isSingleLine); - tolua_function(tolua_S,"getTextSize",lua_fairygui_GTextField_getTextSize); - tolua_function(tolua_S,"getOutlineColor",lua_fairygui_GTextField_getOutlineColor); - tolua_function(tolua_S,"setOutlineColor",lua_fairygui_GTextField_setOutlineColor); - tolua_function(tolua_S,"getTemplateVars",lua_fairygui_GTextField_getTemplateVars); - tolua_function(tolua_S,"setTemplateVars",lua_fairygui_GTextField_setTemplateVars); - tolua_function(tolua_S,"setVar",lua_fairygui_GTextField_setVar); - tolua_function(tolua_S,"flushVars",lua_fairygui_GTextField_flushVars); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::GTextField).name(); - g_luaType[typeName] = "fairygui.GTextField"; - g_typeCast["GTextField"] = "fairygui.GTextField"; - return 1; -} - -static int lua_fairygui_GRichTextField_getControl(lua_State* tolua_S) +static int lua_fairygui_GTextField_getOutlineColor(lua_State* tolua_S) { - int argc = 0; - fairygui::GRichTextField* cobj = nullptr; + int argc = 0; + fairygui::GTextField* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRichTextField",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTextField",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRichTextField*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRichTextField_getControl'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_getOutlineColor'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - std::string name = tolua_tocppstring(tolua_S, 2, ""); - fairygui::HtmlObject *ret = cobj->getControl(name); - object_to_luaval(tolua_S, "fairygui.HtmlObject", ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRichTextField:getControl", argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cocos2d::Color3B ret = cobj->getOutlineColor(); + color3b_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:getOutlineColor",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRichTextField_getControl'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_getOutlineColor'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRichTextField_getControls(lua_State* tolua_S) +static int lua_fairygui_GTextField_setOutlineColor(lua_State* tolua_S) { - int argc = 0; - fairygui::GRichTextField* cobj = nullptr; + int argc = 0; + fairygui::GTextField* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRichTextField",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTextField",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRichTextField*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRichTextField_getControls'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_setOutlineColor'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - const std::vector& ret = cobj->getControls(); - lua_newtable(tolua_S); - int index = 1; - for (fairygui::HtmlObject *obj : ret) { - lua_pushnumber(tolua_S, index); - object_to_luaval(tolua_S, "fairygui.HtmlObject", obj); - lua_rawset(tolua_S, -3); - ++index; - } - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRichTextField:getControls", argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + cocos2d::Color3B arg0; + if (luaval_to_color3b(tolua_S, 2, &arg0, "fairygui.GTextField:setOutlineColor")) { + cobj->setOutlineColor(arg0); + return 0; + } + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTextField_setOutlineColor'", nullptr); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:setOutlineColor",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRichTextField_getControls'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_setOutlineColor'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRichTextField_create(lua_State* tolua_S) +static int lua_fairygui_GTextField_getTemplateVars(lua_State* tolua_S) { int argc = 0; + fairygui::GTextField* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.GRichTextField",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTextField",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_getTemplateVars'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S) - 1; - if (argc == 0){ - fairygui::GRichTextField* ret = fairygui::GRichTextField::create(); - object_to_luaval(tolua_S, "fairygui.GRichTextField",(fairygui::GRichTextField*)ret); + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cocos2d::ValueMap *ret = cobj->getTemplateVars(); + ccvaluemap_to_luaval(tolua_S, *ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GRichTextField:create",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:getTemplateVars",argc, 0); return 0; + #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRichTextField_create'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_getTemplateVars'.",&tolua_err); + return 0; #endif } -static int lua_register_fairygui_GRichTextField(lua_State* tolua_S) +static int lua_fairygui_GTextField_setTemplateVars(lua_State* tolua_S) { - tolua_usertype(tolua_S,"fairygui.GRichTextField"); + int argc = 0; + fairygui::GTextField* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTextField",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_setTemplateVars'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + cocos2d::ValueMap arg0; + if (luaval_to_ccvaluemap(tolua_S, 2, &arg0, "fairygui.GTextField:setTemplateVars")) { + cobj->setTemplateVars(&arg0); + return 0; + } + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTextField_setTemplateVars'", nullptr); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:setTemplateVars",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_setTemplateVars'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_GTextField_setVar(lua_State* tolua_S) +{ + int argc = 0; + bool ok = true; + fairygui::GTextField* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTextField",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_setVar'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) { + std::string arg0; + cocos2d::Value arg1; + ok &= luaval_to_std_string(tolua_S, 2, &arg0, "fairygui.GTextField:setVar"); + ok &= luaval_to_ccvalue(tolua_S, 3, &arg1, "fairygui.GTextField:setVar"); + if (ok) { + cobj->setVar(arg0, arg1); + return 0; + } + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTextField_setVar'", nullptr); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:setVar",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_setVar'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_GTextField_flushVars(lua_State* tolua_S) +{ + int argc = 0; + fairygui::GTextField* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTextField",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::GTextField*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTextField_flushVars'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cobj->flushVars(); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextField:flushVars",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextField_flushVars'.",&tolua_err); + return 0; +#endif +} + +static int lua_register_fairygui_GTextField(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"fairygui.GTextField"); + tolua_cclass(tolua_S,"GTextField","fairygui.GTextField","fairygui.GObject",nullptr); + + tolua_beginmodule(tolua_S,"GTextField"); + tolua_function(tolua_S,"setAutoSize",lua_fairygui_GTextField_setAutoSize); + tolua_function(tolua_S,"getFontSize",lua_fairygui_GTextField_getFontSize); + tolua_function(tolua_S,"setColor",lua_fairygui_GTextField_setColor); + tolua_function(tolua_S,"setSingleLine",lua_fairygui_GTextField_setSingleLine); + tolua_function(tolua_S,"isUBBEnabled",lua_fairygui_GTextField_isUBBEnabled); + tolua_function(tolua_S,"getColor",lua_fairygui_GTextField_getColor); + tolua_function(tolua_S,"setUBBEnabled",lua_fairygui_GTextField_setUBBEnabled); + tolua_function(tolua_S,"getAutoSize",lua_fairygui_GTextField_getAutoSize); + tolua_function(tolua_S,"setFontSize",lua_fairygui_GTextField_setFontSize); + tolua_function(tolua_S,"applyTextFormat",lua_fairygui_GTextField_applyTextFormat); + tolua_function(tolua_S,"getTextFormat",lua_fairygui_GTextField_getTextFormat); + tolua_function(tolua_S,"isSingleLine",lua_fairygui_GTextField_isSingleLine); + tolua_function(tolua_S,"getTextSize",lua_fairygui_GTextField_getTextSize); + tolua_function(tolua_S,"getOutlineColor",lua_fairygui_GTextField_getOutlineColor); + tolua_function(tolua_S,"setOutlineColor",lua_fairygui_GTextField_setOutlineColor); + tolua_function(tolua_S,"getTemplateVars",lua_fairygui_GTextField_getTemplateVars); + tolua_function(tolua_S,"setTemplateVars",lua_fairygui_GTextField_setTemplateVars); + tolua_function(tolua_S,"setVar",lua_fairygui_GTextField_setVar); + tolua_function(tolua_S,"flushVars",lua_fairygui_GTextField_flushVars); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::GTextField).name(); + g_luaType[typeName] = "fairygui.GTextField"; + g_typeCast["GTextField"] = "fairygui.GTextField"; + return 1; +} + +static int lua_fairygui_GRichTextField_getControl(lua_State* tolua_S) +{ + int argc = 0; + fairygui::GRichTextField* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRichTextField",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::GRichTextField*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRichTextField_getControl'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + std::string name = tolua_tocppstring(tolua_S, 2, ""); + fairygui::HtmlObject *ret = cobj->getControl(name); + object_to_luaval(tolua_S, "fairygui.HtmlObject", ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRichTextField:getControl", argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRichTextField_getControl'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_GRichTextField_getControls(lua_State* tolua_S) +{ + int argc = 0; + fairygui::GRichTextField* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRichTextField",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::GRichTextField*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRichTextField_getControls'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + const std::vector& ret = cobj->getControls(); + lua_newtable(tolua_S); + int index = 1; + for (fairygui::HtmlObject *obj : ret) { + lua_pushnumber(tolua_S, index); + object_to_luaval(tolua_S, "fairygui.HtmlObject", obj); + lua_rawset(tolua_S, -3); + ++index; + } + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRichTextField:getControls", argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRichTextField_getControls'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_GRichTextField_create(lua_State* tolua_S) +{ + int argc = 0; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertable(tolua_S,1,"fairygui.GRichTextField",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + if (argc == 0){ + fairygui::GRichTextField* ret = fairygui::GRichTextField::create(); + object_to_luaval(tolua_S, "fairygui.GRichTextField",(fairygui::GRichTextField*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GRichTextField:create",argc, 0); + return 0; +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRichTextField_create'.",&tolua_err); + return 0; +#endif +} + +static int lua_register_fairygui_GRichTextField(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"fairygui.GRichTextField"); tolua_cclass(tolua_S,"GRichTextField","fairygui.GRichTextField","fairygui.GTextField",nullptr); tolua_beginmodule(tolua_S,"GRichTextField"); - tolua_function(tolua_S,"getControl", lua_fairygui_GRichTextField_getControl); - tolua_function(tolua_S,"getControls", lua_fairygui_GRichTextField_getControls); + tolua_function(tolua_S,"getControl", lua_fairygui_GRichTextField_getControl); + tolua_function(tolua_S,"getControls", lua_fairygui_GRichTextField_getControls); tolua_function(tolua_S,"create", lua_fairygui_GRichTextField_create); tolua_endmodule(tolua_S); std::string typeName = typeid(fairygui::GRichTextField).name(); @@ -7460,7 +7900,7 @@ static int lua_fairygui_GTextInput_setKeyboardType(lua_State* tolua_S) return 0; } cobj->setKeyboardType(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextInput:setKeyboardType",argc, 1); return 0; @@ -7468,7 +7908,7 @@ static int lua_fairygui_GTextInput_setKeyboardType(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextInput_setKeyboardType'.",&tolua_err); - return 0; + return 0; #endif } @@ -7499,7 +7939,7 @@ static int lua_fairygui_GTextInput_setPrompt(lua_State* tolua_S) return 0; } cobj->setPrompt(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextInput:setPrompt",argc, 1); return 0; @@ -7507,7 +7947,7 @@ static int lua_fairygui_GTextInput_setPrompt(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextInput_setPrompt'.",&tolua_err); - return 0; + return 0; #endif } @@ -7538,7 +7978,7 @@ static int lua_fairygui_GTextInput_setMaxLength(lua_State* tolua_S) return 0; } cobj->setMaxLength(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextInput:setMaxLength",argc, 1); return 0; @@ -7546,7 +7986,7 @@ static int lua_fairygui_GTextInput_setMaxLength(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextInput_setMaxLength'.",&tolua_err); - return 0; + return 0; #endif } @@ -7577,7 +8017,7 @@ static int lua_fairygui_GTextInput_setRestrict(lua_State* tolua_S) return 0; } cobj->setRestrict(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextInput:setRestrict",argc, 1); return 0; @@ -7585,7 +8025,7 @@ static int lua_fairygui_GTextInput_setRestrict(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextInput_setRestrict'.",&tolua_err); - return 0; + return 0; #endif } @@ -7616,7 +8056,7 @@ static int lua_fairygui_GTextInput_setPassword(lua_State* tolua_S) return 0; } cobj->setPassword(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GTextInput:setPassword",argc, 1); return 0; @@ -7624,7 +8064,7 @@ static int lua_fairygui_GTextInput_setPassword(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextInput_setPassword'.",&tolua_err); - return 0; + return 0; #endif } @@ -7648,7 +8088,7 @@ static int lua_fairygui_GTextInput_create(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTextInput_create'.",&tolua_err); - return 0; + return 0; #endif } @@ -7670,55 +8110,47 @@ static int lua_register_fairygui_GTextInput(lua_State* tolua_S) g_typeCast["GTextInput"] = "fairygui.GTextInput"; return 1; } - -static int lua_fairygui_GGraph_drawEllipse(lua_State* tolua_S) +static int lua_fairygui_GGraph_setPolygonPoints(lua_State* tolua_S) { int argc = 0; fairygui::GGraph* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GGraph",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S, 1, "fairygui.GGraph", 0, &tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GGraph*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GGraph*)tolua_tousertype(tolua_S, 1, 0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGraph_drawEllipse'", nullptr); + tolua_error(tolua_S, "invalid 'cobj' in function 'lua_fairygui_GGraph_setPolygonPoints'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 5) { - double arg0; - double arg1; + argc = lua_gettop(tolua_S) - 1; + if (argc == 1) { + cocos2d::Vec2* arg1 = nullptr; int arg2; - cocos2d::Color4F arg3; - cocos2d::Color4F arg4; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GGraph:drawEllipse"); - ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.GGraph:drawEllipse"); - ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "fairygui.GGraph:drawEllipse"); - ok &=luaval_to_color4f(tolua_S, 5, &arg3, "fairygui.GGraph:drawEllipse"); - ok &=luaval_to_color4f(tolua_S, 6, &arg4, "fairygui.GGraph:drawEllipse"); + bool ok = luaval_to_array_of_vec2(tolua_S, 2, &arg1, &arg2, "fairygui.GGraph:setPolygonPoints"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GGraph_drawEllipse'", nullptr); + tolua_error(tolua_S, "invalid arguments in function 'lua_fairygui_GGraph_setPolygonPoints'", nullptr); + CC_SAFE_DELETE_ARRAY(arg1); return 0; } - cobj->drawEllipse(arg0, arg1, arg2, arg3, arg4); - return 0; + cobj->setPolygonPoints(arg1, arg2); + CC_SAFE_DELETE_ARRAY(arg1); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGraph:drawEllipse",argc, 5); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGraph:setPolygonPoints", argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGraph_drawEllipse'.",&tolua_err); - return 0; + tolua_error(tolua_S, "#ferror in function 'lua_fairygui_GGraph_setPolygonPoints'.", &tolua_err); + return 0; #endif } - -static int lua_fairygui_GGraph_isEmpty(lua_State* tolua_S) +static int lua_fairygui_GGraph_getColor(lua_State* tolua_S) { int argc = 0; fairygui::GGraph* cobj = nullptr; @@ -7730,28 +8162,28 @@ static int lua_fairygui_GGraph_isEmpty(lua_State* tolua_S) cobj = (fairygui::GGraph*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGraph_isEmpty'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGraph_getColor'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - bool ret = cobj->isEmpty(); - tolua_pushboolean(tolua_S,(bool)ret); + const cocos2d::Color3B& ret = cobj->getColor(); + color3b_to_luaval(tolua_S, ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGraph:isEmpty",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGraph:getColor",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGraph_isEmpty'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGraph_getColor'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GGraph_drawRect(lua_State* tolua_S) +static int lua_fairygui_GGraph_setColor(lua_State* tolua_S) { int argc = 0; fairygui::GGraph* cobj = nullptr; @@ -7764,13 +8196,236 @@ static int lua_fairygui_GGraph_drawRect(lua_State* tolua_S) cobj = (fairygui::GGraph*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGraph_drawRect'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGraph_setColor'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 5) { + if (argc == 1) { + cocos2d::Color3B arg0; + ok &= luaval_to_color3b(tolua_S, 2, &arg0, "fairygui.GGraph:setColor"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GGraph_setColor'", nullptr); + return 0; + } + cobj->setColor(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGraph:setColor",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGraph_setColor'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_GGraph_drawPolygon(lua_State* tolua_S) +{ + int argc = 0; + fairygui::GGraph* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GGraph",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::GGraph*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGraph_drawPolygon'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 4) { + int arg0; + cocos2d::Color4F arg1; + cocos2d::Color4F arg2; + cocos2d::Vec2* arg3 = nullptr; + int arg4; + ok &= luaval_to_int32(tolua_S, 2, &arg0, "fairygui.GGraph:drawPolygon"); + ok &= luaval_to_color4f(tolua_S, 3, &arg1, "fairygui.GGraph:drawPolygon"); + ok &= luaval_to_color4f(tolua_S, 4, &arg2, "fairygui.GGraph:drawPolygon"); + ok &= luaval_to_array_of_vec2(tolua_S, 5, &arg3, &arg4, "fairygui.GGraph:drawPolygon"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GGraph_drawPolygon'", nullptr); + CC_SAFE_DELETE_ARRAY(arg3); + return 0; + } + cobj->drawPolygon(arg0, arg1, arg2, arg3, arg4); + CC_SAFE_DELETE_ARRAY(arg3); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGraph:drawPolygon", argc, 4); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGraph_drawPolygon'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_GGraph_drawRegularPolygon(lua_State* tolua_S) +{ + int argc = 0; + fairygui::GGraph* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GGraph",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::GGraph*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGraph_drawRegularPolygon'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc >= 4) { + int arg0; + cocos2d::Color4F arg1; + cocos2d::Color4F arg2; + int arg3; + float arg4 = 0; + float* arg5 = nullptr; + int arg6 = 0; + ok &= luaval_to_int32(tolua_S, 2, &arg0, "fairygui.GGraph:drawRegularPolygon"); + ok &= luaval_to_color4f(tolua_S, 3, &arg1, "fairygui.GGraph:drawRegularPolygon"); + ok &= luaval_to_color4f(tolua_S, 4, &arg2, "fairygui.GGraph:drawRegularPolygon"); + ok &= luaval_to_int32(tolua_S, 5, &arg3, "fairygui.GGraph:drawRegularPolygon"); + if (argc >= 5) { + ok &= luaval_to_float(tolua_S, 6, &arg4, "fairygui.GGraph:drawRegularPolygon"); + } + if (argc == 6) { + ok &= luaval_to_array_of_float(tolua_S, 7, &arg5, &arg6, "fairygui.GGraph:drawRegularPolygon"); + } + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GGraph_drawRegularPolygon'", nullptr); + CC_SAFE_DELETE_ARRAY(arg5); + return 0; + } + cobj->drawRegularPolygon(arg0, arg1, arg2, arg3, arg4, arg5, arg6); + CC_SAFE_DELETE_ARRAY(arg5); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting 4~6 \n", "fairygui.GGraph:drawRegularPolygon", argc); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGraph_drawRegularPolygon'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_GGraph_drawEllipse(lua_State* tolua_S) +{ + int argc = 0; + fairygui::GGraph* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GGraph",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::GGraph*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGraph_drawEllipse'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 5) { + double arg0; + double arg1; + int arg2; + cocos2d::Color4F arg3; + cocos2d::Color4F arg4; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GGraph:drawEllipse"); + ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.GGraph:drawEllipse"); + ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "fairygui.GGraph:drawEllipse"); + ok &=luaval_to_color4f(tolua_S, 5, &arg3, "fairygui.GGraph:drawEllipse"); + ok &=luaval_to_color4f(tolua_S, 6, &arg4, "fairygui.GGraph:drawEllipse"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GGraph_drawEllipse'", nullptr); + return 0; + } + cobj->drawEllipse(arg0, arg1, arg2, arg3, arg4); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGraph:drawEllipse",argc, 5); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGraph_drawEllipse'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_GGraph_isEmpty(lua_State* tolua_S) +{ + int argc = 0; + fairygui::GGraph* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GGraph",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::GGraph*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGraph_isEmpty'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + bool ret = cobj->isEmpty(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGraph:isEmpty",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGraph_isEmpty'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_GGraph_drawRect(lua_State* tolua_S) +{ + int argc = 0; + fairygui::GGraph* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GGraph",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::GGraph*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGraph_drawRect'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 5) { double arg0; double arg1; int arg2; @@ -7786,7 +8441,7 @@ static int lua_fairygui_GGraph_drawRect(lua_State* tolua_S) return 0; } cobj->drawRect(arg0, arg1, arg2, arg3, arg4); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGraph:drawRect",argc, 5); return 0; @@ -7794,7 +8449,7 @@ static int lua_fairygui_GGraph_drawRect(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGraph_drawRect'.",&tolua_err); - return 0; + return 0; #endif } @@ -7818,7 +8473,7 @@ static int lua_fairygui_GGraph_create(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGraph_create'.",&tolua_err); - return 0; + return 0; #endif } @@ -7828,6 +8483,11 @@ static int lua_register_fairygui_GGraph(lua_State* tolua_S) tolua_cclass(tolua_S,"GGraph","fairygui.GGraph","fairygui.GObject",nullptr); tolua_beginmodule(tolua_S,"GGraph"); + tolua_function(tolua_S,"setPolygonPoints",lua_fairygui_GGraph_setPolygonPoints); + tolua_function(tolua_S,"getColor",lua_fairygui_GGraph_getColor); + tolua_function(tolua_S,"setColor",lua_fairygui_GGraph_setColor); + tolua_function(tolua_S,"drawPolygon",lua_fairygui_GGraph_drawPolygon); + tolua_function(tolua_S,"drawRegularPolygon",lua_fairygui_GGraph_drawRegularPolygon); tolua_function(tolua_S,"drawEllipse",lua_fairygui_GGraph_drawEllipse); tolua_function(tolua_S,"isEmpty",lua_fairygui_GGraph_isEmpty); tolua_function(tolua_S,"drawRect",lua_fairygui_GGraph_drawRect); @@ -7868,7 +8528,7 @@ static int lua_fairygui_GLoader_getURL(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_getURL'.",&tolua_err); - return 0; + return 0; #endif } @@ -7901,7 +8561,7 @@ static int lua_fairygui_GLoader_isPlaying(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_isPlaying'.",&tolua_err); - return 0; + return 0; #endif } @@ -7932,7 +8592,7 @@ static int lua_fairygui_GLoader_setColor(lua_State* tolua_S) return 0; } cobj->setColor(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:setColor",argc, 1); return 0; @@ -7940,7 +8600,7 @@ static int lua_fairygui_GLoader_setColor(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_setColor'.",&tolua_err); - return 0; + return 0; #endif } @@ -7971,7 +8631,7 @@ static int lua_fairygui_GLoader_setAlign(lua_State* tolua_S) return 0; } cobj->setAlign(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:setAlign",argc, 1); return 0; @@ -7979,7 +8639,7 @@ static int lua_fairygui_GLoader_setAlign(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_setAlign'.",&tolua_err); - return 0; + return 0; #endif } @@ -8010,7 +8670,7 @@ static int lua_fairygui_GLoader_setPlaying(lua_State* tolua_S) return 0; } cobj->setPlaying(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:setPlaying",argc, 1); return 0; @@ -8018,7 +8678,7 @@ static int lua_fairygui_GLoader_setPlaying(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_setPlaying'.",&tolua_err); - return 0; + return 0; #endif } @@ -8051,7 +8711,7 @@ static int lua_fairygui_GLoader_getColor(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_getColor'.",&tolua_err); - return 0; + return 0; #endif } @@ -8082,7 +8742,7 @@ static int lua_fairygui_GLoader_setURL(lua_State* tolua_S) return 0; } cobj->setURL(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:setURL",argc, 1); return 0; @@ -8090,7 +8750,7 @@ static int lua_fairygui_GLoader_setURL(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_setURL'.",&tolua_err); - return 0; + return 0; #endif } @@ -8121,7 +8781,7 @@ static int lua_fairygui_GLoader_setFrame(lua_State* tolua_S) return 0; } cobj->setFrame(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:setFrame",argc, 1); return 0; @@ -8129,7 +8789,7 @@ static int lua_fairygui_GLoader_setFrame(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_setFrame'.",&tolua_err); - return 0; + return 0; #endif } @@ -8162,7 +8822,7 @@ static int lua_fairygui_GLoader_getFill(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_getFill'.",&tolua_err); - return 0; + return 0; #endif } @@ -8193,7 +8853,7 @@ static int lua_fairygui_GLoader_setAutoSize(lua_State* tolua_S) return 0; } cobj->setAutoSize(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:setAutoSize",argc, 1); return 0; @@ -8201,7 +8861,7 @@ static int lua_fairygui_GLoader_setAutoSize(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_setAutoSize'.",&tolua_err); - return 0; + return 0; #endif } @@ -8234,7 +8894,7 @@ static int lua_fairygui_GLoader_getAutoSize(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_getAutoSize'.",&tolua_err); - return 0; + return 0; #endif } @@ -8267,7 +8927,7 @@ static int lua_fairygui_GLoader_getContentSize(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_getContentSize'.",&tolua_err); - return 0; + return 0; #endif } @@ -8298,7 +8958,7 @@ static int lua_fairygui_GLoader_setVerticalAlign(lua_State* tolua_S) return 0; } cobj->setVerticalAlign(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:setVerticalAlign",argc, 1); return 0; @@ -8306,7 +8966,7 @@ static int lua_fairygui_GLoader_setVerticalAlign(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_setVerticalAlign'.",&tolua_err); - return 0; + return 0; #endif } @@ -8339,7 +8999,7 @@ static int lua_fairygui_GLoader_getAlign(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_getAlign'.",&tolua_err); - return 0; + return 0; #endif } @@ -8370,7 +9030,7 @@ static int lua_fairygui_GLoader_setFill(lua_State* tolua_S) return 0; } cobj->setFill(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:setFill",argc, 1); return 0; @@ -8378,7 +9038,7 @@ static int lua_fairygui_GLoader_setFill(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_setFill'.",&tolua_err); - return 0; + return 0; #endif } @@ -8411,7 +9071,7 @@ static int lua_fairygui_GLoader_getVerticalAlign(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_getVerticalAlign'.",&tolua_err); - return 0; + return 0; #endif } @@ -8444,395 +9104,395 @@ static int lua_fairygui_GLoader_getFrame(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_getFrame'.",&tolua_err); - return 0; + return 0; #endif } static int lua_fairygui_GLoader_isShrinkOnly(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader* cobj = nullptr; + int argc = 0; + fairygui::GLoader* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader_isShrinkOnly'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader_isShrinkOnly'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - tolua_pushboolean(tolua_S, cobj->isShrinkOnly()); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:isShrinkOnly",argc, 0); - return 0; - + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + tolua_pushboolean(tolua_S, cobj->isShrinkOnly()); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:isShrinkOnly",argc, 0); + return 0; + #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_isShrinkOnly'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_isShrinkOnly'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader_setShrinkOnly(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GLoader* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader_setShrinkOnly'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader_setShrinkOnly'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GLoader:setShrinkOnly"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader_setShrinkOnly'", nullptr); - return 0; - } - cobj->setShrinkOnly(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:setShrinkOnly",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GLoader:setShrinkOnly"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader_setShrinkOnly'", nullptr); + return 0; + } + cobj->setShrinkOnly(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:setShrinkOnly",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_setShrinkOnly'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_setShrinkOnly'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader_getFillMethod(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader* cobj = nullptr; + int argc = 0; + fairygui::GLoader* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader_getFillMethod'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader_getFillMethod'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - lua_pushinteger(tolua_S, (lua_Integer)cobj->getFillMethod()); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:getFillMethod",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + lua_pushinteger(tolua_S, (lua_Integer)cobj->getFillMethod()); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:getFillMethod",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_getFillMethod'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_getFillMethod'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader_setFillMethod(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GLoader* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader_setFillMethod'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader_setFillMethod'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,&arg0, "fairygui.GLoader:setFillMethod"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader_setFillMethod'", nullptr); - return 0; - } - cobj->setFillMethod((fairygui::FillMethod)arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:setFillMethod",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,&arg0, "fairygui.GLoader:setFillMethod"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader_setFillMethod'", nullptr); + return 0; + } + cobj->setFillMethod((fairygui::FillMethod)arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:setFillMethod",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_setFillMethod'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_setFillMethod'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader_getFillOrigin(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader* cobj = nullptr; + int argc = 0; + fairygui::GLoader* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader_getFillOrigin'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader_getFillOrigin'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - lua_pushinteger(tolua_S, (lua_Integer)cobj->getFillOrigin()); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:getFillOrigin",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + lua_pushinteger(tolua_S, (lua_Integer)cobj->getFillOrigin()); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:getFillOrigin",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_getFillOrigin'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_getFillOrigin'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader_setFillOrigin(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GLoader* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader_setFillOrigin'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader_setFillOrigin'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,&arg0, "fairygui.GLoader:setFillMethod"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader_setFillOrigin'", nullptr); - return 0; - } - cobj->setFillOrigin((fairygui::FillOrigin)arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:setFillOrigin",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,&arg0, "fairygui.GLoader:setFillMethod"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader_setFillOrigin'", nullptr); + return 0; + } + cobj->setFillOrigin((fairygui::FillOrigin)arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:setFillOrigin",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_setFillOrigin'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_setFillOrigin'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader_isFillClockwise(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader* cobj = nullptr; + int argc = 0; + fairygui::GLoader* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader_isFillClockwise'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader_isFillClockwise'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - lua_pushboolean(tolua_S, cobj->isFillClockwise()); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:isFillClockwise",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + lua_pushboolean(tolua_S, cobj->isFillClockwise()); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:isFillClockwise",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_isFillClockwise'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_isFillClockwise'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader_setFillClockwise(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GLoader* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader_setFillClockwise'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader_setFillClockwise'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GLoader:setFillClockwise"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader_setFillClockwise'", nullptr); - return 0; - } - cobj->setFillClockwise(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:setFillClockwise",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GLoader:setFillClockwise"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader_setFillClockwise'", nullptr); + return 0; + } + cobj->setFillClockwise(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:setFillClockwise",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_setFillClockwise'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_setFillClockwise'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader_getFillAmount(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader* cobj = nullptr; + int argc = 0; + fairygui::GLoader* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader_getFillAmount'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader_getFillAmount'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - lua_pushnumber(tolua_S, cobj->getFillAmount()); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:getFillAmount",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + lua_pushnumber(tolua_S, cobj->getFillAmount()); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:getFillAmount",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_getFillAmount'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_getFillAmount'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader_setFillAmount(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GLoader* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader_setFillAmount'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader_setFillAmount'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - float arg0; - ok &= luaval_to_float(tolua_S, 2,&arg0, "fairygui.GLoader:setFillAmount"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader_setFillAmount'", nullptr); - return 0; - } - cobj->setFillAmount(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:setFillAmount",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + float arg0; + ok &= luaval_to_float(tolua_S, 2,&arg0, "fairygui.GLoader:setFillAmount"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader_setFillAmount'", nullptr); + return 0; + } + cobj->setFillAmount(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:setFillAmount",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_setFillAmount'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_setFillAmount'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader_getComponent(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader* cobj = nullptr; + int argc = 0; + fairygui::GLoader* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader_getComponent'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader_getComponent'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GComponent* ret = cobj->getComponent(); - object_to_luaval(tolua_S, "fairygui.GComponent",(fairygui::GComponent*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:getComponent",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::GComponent* ret = cobj->getComponent(); + object_to_luaval(tolua_S, "fairygui.GComponent",(fairygui::GComponent*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader:getComponent",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_getComponent'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_getComponent'.",&tolua_err); + return 0; #endif } @@ -8856,7 +9516,7 @@ static int lua_fairygui_GLoader_create(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader_create'.",&tolua_err); - return 0; + return 0; #endif } @@ -8883,17 +9543,17 @@ static int lua_register_fairygui_GLoader(lua_State* tolua_S) tolua_function(tolua_S,"setFill",lua_fairygui_GLoader_setFill); tolua_function(tolua_S,"getVerticalAlign",lua_fairygui_GLoader_getVerticalAlign); tolua_function(tolua_S,"getFrame",lua_fairygui_GLoader_getFrame); - tolua_function(tolua_S,"isShrinkOnly",lua_fairygui_GLoader_isShrinkOnly); - tolua_function(tolua_S,"setShrinkOnly",lua_fairygui_GLoader_setShrinkOnly); - tolua_function(tolua_S,"getFillMethod",lua_fairygui_GLoader_getFillMethod); - tolua_function(tolua_S,"setFillMethod",lua_fairygui_GLoader_setFillMethod); - tolua_function(tolua_S,"getFillOrigin",lua_fairygui_GLoader_getFillOrigin); - tolua_function(tolua_S,"setFillOrigin",lua_fairygui_GLoader_setFillOrigin); - tolua_function(tolua_S,"isFillClockwise",lua_fairygui_GLoader_isFillClockwise); - tolua_function(tolua_S,"setFillClockwise",lua_fairygui_GLoader_setFillClockwise); - tolua_function(tolua_S,"getFillAmount",lua_fairygui_GLoader_getFillAmount); - tolua_function(tolua_S,"setFillAmount",lua_fairygui_GLoader_setFillAmount); - tolua_function(tolua_S,"getComponent",lua_fairygui_GLoader_getComponent); + tolua_function(tolua_S,"isShrinkOnly",lua_fairygui_GLoader_isShrinkOnly); + tolua_function(tolua_S,"setShrinkOnly",lua_fairygui_GLoader_setShrinkOnly); + tolua_function(tolua_S,"getFillMethod",lua_fairygui_GLoader_getFillMethod); + tolua_function(tolua_S,"setFillMethod",lua_fairygui_GLoader_setFillMethod); + tolua_function(tolua_S,"getFillOrigin",lua_fairygui_GLoader_getFillOrigin); + tolua_function(tolua_S,"setFillOrigin",lua_fairygui_GLoader_setFillOrigin); + tolua_function(tolua_S,"isFillClockwise",lua_fairygui_GLoader_isFillClockwise); + tolua_function(tolua_S,"setFillClockwise",lua_fairygui_GLoader_setFillClockwise); + tolua_function(tolua_S,"getFillAmount",lua_fairygui_GLoader_getFillAmount); + tolua_function(tolua_S,"setFillAmount",lua_fairygui_GLoader_setFillAmount); + tolua_function(tolua_S,"getComponent",lua_fairygui_GLoader_getComponent); tolua_function(tolua_S,"create", lua_fairygui_GLoader_create); tolua_endmodule(tolua_S); std::string typeName = typeid(fairygui::GLoader).name(); @@ -8904,1001 +9564,1001 @@ static int lua_register_fairygui_GLoader(lua_State* tolua_S) static int lua_fairygui_GLoader3D_getURL(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_getURL'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_getURL'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - const std::string& ret = cobj->getURL(); - lua_pushlstring(tolua_S,ret.c_str(),ret.length()); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:getURL",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + const std::string& ret = cobj->getURL(); + lua_pushlstring(tolua_S,ret.c_str(),ret.length()); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:getURL",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_getURL'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_getURL'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_setURL(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setURL'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setURL'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GLoader3D:setURL"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setURL'", nullptr); - return 0; - } - cobj->setURL(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setURL",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GLoader3D:setURL"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setURL'", nullptr); + return 0; + } + cobj->setURL(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setURL",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setURL'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setURL'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_getAlign(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_getAlign'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_getAlign'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - int ret = (int)cobj->getAlign(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:getAlign",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + int ret = (int)cobj->getAlign(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:getAlign",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_getAlign'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_getAlign'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_setAlign(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setAlign'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setAlign'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - cocos2d::TextHAlignment arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GLoader3D:setAlign"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setAlign'", nullptr); - return 0; - } - cobj->setAlign(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setAlign",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + cocos2d::TextHAlignment arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GLoader3D:setAlign"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setAlign'", nullptr); + return 0; + } + cobj->setAlign(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setAlign",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setAlign'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setAlign'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_getVerticalAlign(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_getVerticalAlign'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_getVerticalAlign'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - int ret = (int)cobj->getVerticalAlign(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:getVerticalAlign",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + int ret = (int)cobj->getVerticalAlign(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:getVerticalAlign",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_getVerticalAlign'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_getVerticalAlign'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_setVerticalAlign(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setVerticalAlign'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setVerticalAlign'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - cocos2d::TextVAlignment arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GLoader3D:setVerticalAlign"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setVerticalAlign'", nullptr); - return 0; - } - cobj->setVerticalAlign(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setVerticalAlign",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + cocos2d::TextVAlignment arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GLoader3D:setVerticalAlign"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setVerticalAlign'", nullptr); + return 0; + } + cobj->setVerticalAlign(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setVerticalAlign",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setVerticalAlign'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setVerticalAlign'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_getAutoSize(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_getAutoSize'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_getAutoSize'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - bool ret = cobj->getAutoSize(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:getAutoSize",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + bool ret = cobj->getAutoSize(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:getAutoSize",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_getAutoSize'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_getAutoSize'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_setAutoSize(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setAutoSize'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setAutoSize'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GLoader3D:setAutoSize"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setAutoSize'", nullptr); - return 0; - } - cobj->setAutoSize(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setAutoSize",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GLoader3D:setAutoSize"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setAutoSize'", nullptr); + return 0; + } + cobj->setAutoSize(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setAutoSize",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setAutoSize'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setAutoSize'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_getFill(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_getFill'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_getFill'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - int ret = (int)cobj->getFill(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:getFill",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + int ret = (int)cobj->getFill(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:getFill",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_getFill'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_getFill'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_setFill(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setFill'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setFill'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::LoaderFillType arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GLoader3D:setFill"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setFill'", nullptr); - return 0; - } - cobj->setFill(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setFill",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + fairygui::LoaderFillType arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GLoader3D:setFill"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setFill'", nullptr); + return 0; + } + cobj->setFill(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setFill",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setFill'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setFill'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_isShrinkOnly(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_isShrinkOnly'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_isShrinkOnly'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - tolua_pushboolean(tolua_S, cobj->isShrinkOnly()); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:isShrinkOnly",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + tolua_pushboolean(tolua_S, cobj->isShrinkOnly()); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:isShrinkOnly",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_isShrinkOnly'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_isShrinkOnly'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_setShrinkOnly(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setShrinkOnly'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setShrinkOnly'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GLoader3D:setShrinkOnly"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setShrinkOnly'", nullptr); - return 0; - } - cobj->setShrinkOnly(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setShrinkOnly",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GLoader3D:setShrinkOnly"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setShrinkOnly'", nullptr); + return 0; + } + cobj->setShrinkOnly(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setShrinkOnly",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setShrinkOnly'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setShrinkOnly'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_getContent(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_getContent'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_getContent'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - const cocos2d::Node *ret = cobj->getContent(); - object_to_luaval(tolua_S, "cc.Node",(cocos2d::Node*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:getContent",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + const cocos2d::Node *ret = cobj->getContent(); + object_to_luaval(tolua_S, "cc.Node",(cocos2d::Node*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:getContent",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_getContent'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_getContent'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_setContent(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setContent'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setContent'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "fairygui.GLoader3D:setContent"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setContent'", nullptr); - return 0; - } - cobj->setContent(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setContent",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + cocos2d::Node* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "fairygui.GLoader3D:setContent"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setContent'", nullptr); + return 0; + } + cobj->setContent(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setContent",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setContent'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setContent'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_setColor(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setColor'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setColor'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - cocos2d::Color3B arg0; - ok &= luaval_to_color3b(tolua_S, 2, &arg0, "fairygui.GLoader3D:setColor"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setColor'", nullptr); - return 0; - } - cobj->setColor(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setColor",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + cocos2d::Color3B arg0; + ok &= luaval_to_color3b(tolua_S, 2, &arg0, "fairygui.GLoader3D:setColor"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setColor'", nullptr); + return 0; + } + cobj->setColor(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setColor",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setColor'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setColor'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_getColor(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_getColor'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_getColor'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - const cocos2d::Color3B& ret = cobj->getColor(); - color3b_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:getColor",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + const cocos2d::Color3B& ret = cobj->getColor(); + color3b_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:getColor",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_getColor'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_getColor'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_isPlaying(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_isPlaying'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_isPlaying'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - bool ret = cobj->isPlaying(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:isPlaying",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + bool ret = cobj->isPlaying(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:isPlaying",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_isPlaying'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_isPlaying'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_setPlaying(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setPlaying'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setPlaying'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GLoader3D:setPlaying"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setPlaying'", nullptr); - return 0; - } - cobj->setPlaying(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setPlaying",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GLoader3D:setPlaying"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setPlaying'", nullptr); + return 0; + } + cobj->setPlaying(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setPlaying",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setPlaying'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setPlaying'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_getFrame(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_getFrame'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_getFrame'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - int ret = cobj->getFrame(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:getFrame",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + int ret = cobj->getFrame(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:getFrame",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_getFrame'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_getFrame'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_setFrame(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setFrame'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setFrame'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GLoader3D:setFrame"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setFrame'", nullptr); - return 0; - } - cobj->setFrame(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setFrame",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GLoader3D:setFrame"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setFrame'", nullptr); + return 0; + } + cobj->setFrame(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setFrame",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setFrame'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setFrame'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_getAnimationName(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_getAnimationName'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_getAnimationName'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - const std::string& ret = cobj->getAnimationName(); - lua_pushlstring(tolua_S,ret.c_str(),ret.length()); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:getAnimationName",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + const std::string& ret = cobj->getAnimationName(); + lua_pushlstring(tolua_S,ret.c_str(),ret.length()); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:getAnimationName",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_getAnimationName'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_getAnimationName'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_setAnimationName(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setAnimationName'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setAnimationName'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GLoader3D:setAnimationName"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setAnimationName'", nullptr); - return 0; - } - cobj->setAnimationName(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setAnimationName",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GLoader3D:setAnimationName"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setAnimationName'", nullptr); + return 0; + } + cobj->setAnimationName(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setAnimationName",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setAnimationName'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setAnimationName'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_getSkinName(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_getSkinName'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_getSkinName'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - const std::string& ret = cobj->getSkinName(); - lua_pushlstring(tolua_S,ret.c_str(),ret.length()); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:getSkinName",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + const std::string& ret = cobj->getSkinName(); + lua_pushlstring(tolua_S,ret.c_str(),ret.length()); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:getSkinName",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_getSkinName'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_getSkinName'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_setSkinName(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setSkinName'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setSkinName'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GLoader3D:setSkinName"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setSkinName'", nullptr); - return 0; - } - cobj->setSkinName(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setSkinName",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GLoader3D:setSkinName"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setSkinName'", nullptr); + return 0; + } + cobj->setSkinName(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setSkinName",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setSkinName'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setSkinName'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_getLoop(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_getLoop'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_getLoop'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - bool ret = cobj->getLoop(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:getLoop",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + bool ret = cobj->getLoop(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:getLoop",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_getLoop'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_getLoop'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_setLoop(lua_State* tolua_S) { - int argc = 0; - fairygui::GLoader3D* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GLoader3D* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLoader3D*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setLoop'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLoader3D_setLoop'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GLoader3D:setLoop"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setLoop'", nullptr); - return 0; - } - cobj->setLoop(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setLoop",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GLoader3D:setLoop"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLoader3D_setLoop'", nullptr); + return 0; + } + cobj->setLoop(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLoader3D:setLoop",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setLoop'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_setLoop'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GLoader3D_create(lua_State* tolua_S) { - int argc = 0; + int argc = 0; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertable(tolua_S,1,"fairygui.GLoader3D",0,&tolua_err)) goto tolua_lerror; #endif - argc = lua_gettop(tolua_S) - 1; - if (argc == 0){ - fairygui::GLoader3D* ret = fairygui::GLoader3D::create(); - object_to_luaval(tolua_S, "fairygui.GLoader3D",(fairygui::GLoader3D*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GLoader3D:create",argc, 0); - return 0; + argc = lua_gettop(tolua_S) - 1; + if (argc == 0){ + fairygui::GLoader3D* ret = fairygui::GLoader3D::create(); + object_to_luaval(tolua_S, "fairygui.GLoader3D",(fairygui::GLoader3D*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GLoader3D:create",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_create'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLoader3D_create'.",&tolua_err); + return 0; #endif } static int lua_register_fairygui_GLoader3D(lua_State* tolua_S) { - tolua_usertype(tolua_S,"fairygui.GLoader3D"); - tolua_cclass(tolua_S,"GLoader3D","fairygui.GLoader3D","fairygui.GObject",nullptr); - - tolua_beginmodule(tolua_S,"GLoader3D"); - tolua_function(tolua_S,"getURL",lua_fairygui_GLoader3D_getURL); - tolua_function(tolua_S,"setURL",lua_fairygui_GLoader3D_setURL); - tolua_function(tolua_S,"getAlign",lua_fairygui_GLoader3D_getAlign); - tolua_function(tolua_S,"setAlign",lua_fairygui_GLoader3D_setAlign); - tolua_function(tolua_S,"getVerticalAlign",lua_fairygui_GLoader3D_getVerticalAlign); - tolua_function(tolua_S,"setVerticalAlign",lua_fairygui_GLoader3D_setVerticalAlign); - tolua_function(tolua_S,"getAutoSize",lua_fairygui_GLoader3D_getAutoSize); - tolua_function(tolua_S,"setAutoSize",lua_fairygui_GLoader3D_setAutoSize); - tolua_function(tolua_S,"getFill",lua_fairygui_GLoader3D_getFill); - tolua_function(tolua_S,"setFill",lua_fairygui_GLoader3D_setFill); - tolua_function(tolua_S,"isShrinkOnly",lua_fairygui_GLoader3D_isShrinkOnly); - tolua_function(tolua_S,"setShrinkOnly",lua_fairygui_GLoader3D_setShrinkOnly); - tolua_function(tolua_S,"getContent",lua_fairygui_GLoader3D_getContent); - tolua_function(tolua_S,"setContent",lua_fairygui_GLoader3D_setContent); - tolua_function(tolua_S,"getColor",lua_fairygui_GLoader3D_getColor); - tolua_function(tolua_S,"setColor",lua_fairygui_GLoader3D_setColor); - tolua_function(tolua_S,"isPlaying",lua_fairygui_GLoader3D_isPlaying); - tolua_function(tolua_S,"setPlaying",lua_fairygui_GLoader3D_setPlaying); - tolua_function(tolua_S,"getFrame",lua_fairygui_GLoader3D_getFrame); - tolua_function(tolua_S,"setFrame",lua_fairygui_GLoader3D_setFrame); - tolua_function(tolua_S,"getAnimationName",lua_fairygui_GLoader3D_getAnimationName); - tolua_function(tolua_S,"setAnimationName",lua_fairygui_GLoader3D_setAnimationName); - tolua_function(tolua_S,"getSkinName",lua_fairygui_GLoader3D_getSkinName); - tolua_function(tolua_S,"setSkinName",lua_fairygui_GLoader3D_setSkinName); - tolua_function(tolua_S,"getLoop",lua_fairygui_GLoader3D_getLoop); - tolua_function(tolua_S,"setLoop",lua_fairygui_GLoader3D_setLoop); - tolua_function(tolua_S,"create", lua_fairygui_GLoader3D_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::GLoader3D).name(); - g_luaType[typeName] = "fairygui.GLoader3D"; - g_typeCast["GLoader3D"] = "fairygui.GLoader3D"; - return 1; + tolua_usertype(tolua_S,"fairygui.GLoader3D"); + tolua_cclass(tolua_S,"GLoader3D","fairygui.GLoader3D","fairygui.GObject",nullptr); + + tolua_beginmodule(tolua_S,"GLoader3D"); + tolua_function(tolua_S,"getURL",lua_fairygui_GLoader3D_getURL); + tolua_function(tolua_S,"setURL",lua_fairygui_GLoader3D_setURL); + tolua_function(tolua_S,"getAlign",lua_fairygui_GLoader3D_getAlign); + tolua_function(tolua_S,"setAlign",lua_fairygui_GLoader3D_setAlign); + tolua_function(tolua_S,"getVerticalAlign",lua_fairygui_GLoader3D_getVerticalAlign); + tolua_function(tolua_S,"setVerticalAlign",lua_fairygui_GLoader3D_setVerticalAlign); + tolua_function(tolua_S,"getAutoSize",lua_fairygui_GLoader3D_getAutoSize); + tolua_function(tolua_S,"setAutoSize",lua_fairygui_GLoader3D_setAutoSize); + tolua_function(tolua_S,"getFill",lua_fairygui_GLoader3D_getFill); + tolua_function(tolua_S,"setFill",lua_fairygui_GLoader3D_setFill); + tolua_function(tolua_S,"isShrinkOnly",lua_fairygui_GLoader3D_isShrinkOnly); + tolua_function(tolua_S,"setShrinkOnly",lua_fairygui_GLoader3D_setShrinkOnly); + tolua_function(tolua_S,"getContent",lua_fairygui_GLoader3D_getContent); + tolua_function(tolua_S,"setContent",lua_fairygui_GLoader3D_setContent); + tolua_function(tolua_S,"getColor",lua_fairygui_GLoader3D_getColor); + tolua_function(tolua_S,"setColor",lua_fairygui_GLoader3D_setColor); + tolua_function(tolua_S,"isPlaying",lua_fairygui_GLoader3D_isPlaying); + tolua_function(tolua_S,"setPlaying",lua_fairygui_GLoader3D_setPlaying); + tolua_function(tolua_S,"getFrame",lua_fairygui_GLoader3D_getFrame); + tolua_function(tolua_S,"setFrame",lua_fairygui_GLoader3D_setFrame); + tolua_function(tolua_S,"getAnimationName",lua_fairygui_GLoader3D_getAnimationName); + tolua_function(tolua_S,"setAnimationName",lua_fairygui_GLoader3D_setAnimationName); + tolua_function(tolua_S,"getSkinName",lua_fairygui_GLoader3D_getSkinName); + tolua_function(tolua_S,"setSkinName",lua_fairygui_GLoader3D_setSkinName); + tolua_function(tolua_S,"getLoop",lua_fairygui_GLoader3D_getLoop); + tolua_function(tolua_S,"setLoop",lua_fairygui_GLoader3D_setLoop); + tolua_function(tolua_S,"create", lua_fairygui_GLoader3D_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::GLoader3D).name(); + g_luaType[typeName] = "fairygui.GLoader3D"; + g_typeCast["GLoader3D"] = "fairygui.GLoader3D"; + return 1; } static int lua_fairygui_GGroup_getColumnGap(lua_State* tolua_S) @@ -9930,7 +10590,7 @@ static int lua_fairygui_GGroup_getColumnGap(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_getColumnGap'.",&tolua_err); - return 0; + return 0; #endif } @@ -9963,7 +10623,7 @@ static int lua_fairygui_GGroup_resizeChildren(lua_State* tolua_S) return 0; } cobj->resizeChildren(arg0, arg1); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGroup:resizeChildren",argc, 2); return 0; @@ -9971,7 +10631,7 @@ static int lua_fairygui_GGroup_resizeChildren(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_resizeChildren'.",&tolua_err); - return 0; + return 0; #endif } @@ -10002,7 +10662,7 @@ static int lua_fairygui_GGroup_setLayout(lua_State* tolua_S) return 0; } cobj->setLayout(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGroup:setLayout",argc, 1); return 0; @@ -10010,7 +10670,7 @@ static int lua_fairygui_GGroup_setLayout(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_setLayout'.",&tolua_err); - return 0; + return 0; #endif } @@ -10041,7 +10701,7 @@ static int lua_fairygui_GGroup_setColumnGap(lua_State* tolua_S) return 0; } cobj->setColumnGap(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGroup:setColumnGap",argc, 1); return 0; @@ -10049,7 +10709,7 @@ static int lua_fairygui_GGroup_setColumnGap(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_setColumnGap'.",&tolua_err); - return 0; + return 0; #endif } @@ -10074,7 +10734,7 @@ static int lua_fairygui_GGroup_setBoundsChangedFlag(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 0) { cobj->setBoundsChangedFlag(); - return 0; + return 0; } if (argc == 1) { bool arg0; @@ -10084,7 +10744,7 @@ static int lua_fairygui_GGroup_setBoundsChangedFlag(lua_State* tolua_S) return 0; } cobj->setBoundsChangedFlag(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGroup:setBoundsChangedFlag",argc, 0); return 0; @@ -10092,7 +10752,7 @@ static int lua_fairygui_GGroup_setBoundsChangedFlag(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_setBoundsChangedFlag'.",&tolua_err); - return 0; + return 0; #endif } @@ -10125,7 +10785,7 @@ static int lua_fairygui_GGroup_moveChildren(lua_State* tolua_S) return 0; } cobj->moveChildren(arg0, arg1); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGroup:moveChildren",argc, 2); return 0; @@ -10133,7 +10793,7 @@ static int lua_fairygui_GGroup_moveChildren(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_moveChildren'.",&tolua_err); - return 0; + return 0; #endif } @@ -10166,7 +10826,7 @@ static int lua_fairygui_GGroup_getLineGap(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_getLineGap'.",&tolua_err); - return 0; + return 0; #endif } @@ -10197,7 +10857,7 @@ static int lua_fairygui_GGroup_setLineGap(lua_State* tolua_S) return 0; } cobj->setLineGap(arg0); - return 0; + return 0; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGroup:setLineGap",argc, 1); return 0; @@ -10205,7 +10865,7 @@ static int lua_fairygui_GGroup_setLineGap(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_setLineGap'.",&tolua_err); - return 0; + return 0; #endif } @@ -10238,291 +10898,291 @@ static int lua_fairygui_GGroup_getLayout(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_getLayout'.",&tolua_err); - return 0; + return 0; #endif } static int lua_fairygui_GGroup_isExcludeInvisibles(lua_State* tolua_S) { - int argc = 0; - fairygui::GGroup* cobj = nullptr; + int argc = 0; + fairygui::GGroup* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GGroup",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GGroup",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GGroup*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GGroup*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGroup_isExcludeInvisibles'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGroup_isExcludeInvisibles'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - lua_pushboolean(tolua_S,(int)cobj->isExcludeInvisibles()); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGroup:isExcludeInvisibles",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + lua_pushboolean(tolua_S,(int)cobj->isExcludeInvisibles()); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGroup:isExcludeInvisibles",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_isExcludeInvisibles'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_isExcludeInvisibles'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GGroup_setExcludeInvisibles(lua_State* tolua_S) { - int argc = 0; - fairygui::GGroup* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GGroup* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GGroup",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GGroup",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GGroup*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GGroup*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGroup_setExcludeInvisibles'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGroup_setExcludeInvisibles'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2, &arg0, "fairygui.GGroup:setExcludeInvisibles"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GGroup_setExcludeInvisibles'", nullptr); - return 0; - } - cobj->setExcludeInvisibles(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGroup:setExcludeInvisibles",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2, &arg0, "fairygui.GGroup:setExcludeInvisibles"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GGroup_setExcludeInvisibles'", nullptr); + return 0; + } + cobj->setExcludeInvisibles(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGroup:setExcludeInvisibles",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_setExcludeInvisibles'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_setExcludeInvisibles'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GGroup_isAutoSizeDisabled(lua_State* tolua_S) { - int argc = 0; - fairygui::GGroup* cobj = nullptr; + int argc = 0; + fairygui::GGroup* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GGroup",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GGroup",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GGroup*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GGroup*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGroup_isAutoSizeDisabled'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGroup_isAutoSizeDisabled'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - lua_pushboolean(tolua_S,(int)cobj->isAutoSizeDisabled()); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGroup:isAutoSizeDisabled",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + lua_pushboolean(tolua_S,(int)cobj->isAutoSizeDisabled()); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGroup:isAutoSizeDisabled",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_isAutoSizeDisabled'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_isAutoSizeDisabled'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GGroup_setAutoSizeDisabled(lua_State* tolua_S) { - int argc = 0; - fairygui::GGroup* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GGroup* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GGroup",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GGroup",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GGroup*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GGroup*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGroup_setAutoSizeDisabled'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGroup_setAutoSizeDisabled'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2, &arg0, "fairygui.GGroup:setAutoSizeDisabled"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GGroup_setAutoSizeDisabled'", nullptr); - return 0; - } - cobj->setAutoSizeDisabled(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGroup:setAutoSizeDisabled",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2, &arg0, "fairygui.GGroup:setAutoSizeDisabled"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GGroup_setAutoSizeDisabled'", nullptr); + return 0; + } + cobj->setAutoSizeDisabled(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGroup:setAutoSizeDisabled",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_setAutoSizeDisabled'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_setAutoSizeDisabled'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GGroup_getMainGridIndex(lua_State* tolua_S) { - int argc = 0; - fairygui::GGroup* cobj = nullptr; + int argc = 0; + fairygui::GGroup* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GGroup",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GGroup",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GGroup*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GGroup*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGroup_getMainGridIndex'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGroup_getMainGridIndex'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - lua_pushinteger(tolua_S, cobj->getMainGridIndex()); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGroup:getMainGridIndex",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + lua_pushinteger(tolua_S, cobj->getMainGridIndex()); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGroup:getMainGridIndex",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_getMainGridIndex'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_getMainGridIndex'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GGroup_setMainGridIndex(lua_State* tolua_S) { - int argc = 0; - fairygui::GGroup* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GGroup* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GGroup",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GGroup",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GGroup*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GGroup*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGroup_setMainGridIndex'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGroup_setMainGridIndex'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2, &arg0, "fairygui.GGroup:setMainGridIndex"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GGroup_setMainGridIndex'", nullptr); - return 0; - } - cobj->setMainGridIndex(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGroup:setMainGridIndex",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2, &arg0, "fairygui.GGroup:setMainGridIndex"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GGroup_setMainGridIndex'", nullptr); + return 0; + } + cobj->setMainGridIndex(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGroup:setMainGridIndex",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_setMainGridIndex'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_setMainGridIndex'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GGroup_getMainGridMinSize(lua_State* tolua_S) { - int argc = 0; - fairygui::GGroup* cobj = nullptr; + int argc = 0; + fairygui::GGroup* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GGroup",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GGroup",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GGroup*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GGroup*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGroup_getMainGridMinSize'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGroup_getMainGridMinSize'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - lua_pushinteger(tolua_S, cobj->getMainGridMinSize()); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGroup:getMainGridMinSize",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + lua_pushinteger(tolua_S, cobj->getMainGridMinSize()); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGroup:getMainGridMinSize",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_getMainGridMinSize'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_getMainGridMinSize'.",&tolua_err); + return 0; #endif } static int lua_fairygui_GGroup_setMainGridMinSize(lua_State* tolua_S) { - int argc = 0; - fairygui::GGroup* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GGroup* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GGroup",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GGroup",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GGroup*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GGroup*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGroup_setMainGridMinSize'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GGroup_setMainGridMinSize'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2, &arg0, "fairygui.GGroup:setMainGridMinSize"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GGroup_setMainGridMinSize'", nullptr); - return 0; - } - cobj->setMainGridMinSize(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGroup:setMainGridMinSize",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2, &arg0, "fairygui.GGroup:setMainGridMinSize"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GGroup_setMainGridMinSize'", nullptr); + return 0; + } + cobj->setMainGridMinSize(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GGroup:setMainGridMinSize",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_setMainGridMinSize'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_setMainGridMinSize'.",&tolua_err); + return 0; #endif } @@ -10546,7 +11206,7 @@ static int lua_fairygui_GGroup_create(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GGroup_create'.",&tolua_err); - return 0; + return 0; #endif } @@ -10555,701 +11215,2719 @@ static int lua_register_fairygui_GGroup(lua_State* tolua_S) tolua_usertype(tolua_S,"fairygui.GGroup"); tolua_cclass(tolua_S,"GGroup","fairygui.GGroup","fairygui.GObject",nullptr); - tolua_beginmodule(tolua_S,"GGroup"); - tolua_function(tolua_S,"getColumnGap",lua_fairygui_GGroup_getColumnGap); - tolua_function(tolua_S,"resizeChildren",lua_fairygui_GGroup_resizeChildren); - tolua_function(tolua_S,"setLayout",lua_fairygui_GGroup_setLayout); - tolua_function(tolua_S,"setColumnGap",lua_fairygui_GGroup_setColumnGap); - tolua_function(tolua_S,"setBoundsChangedFlag",lua_fairygui_GGroup_setBoundsChangedFlag); - tolua_function(tolua_S,"moveChildren",lua_fairygui_GGroup_moveChildren); - tolua_function(tolua_S,"getLineGap",lua_fairygui_GGroup_getLineGap); - tolua_function(tolua_S,"setLineGap",lua_fairygui_GGroup_setLineGap); - tolua_function(tolua_S,"getLayout",lua_fairygui_GGroup_getLayout); - tolua_function(tolua_S,"isExcludeInvisibles",lua_fairygui_GGroup_isExcludeInvisibles); - tolua_function(tolua_S,"setExcludeInvisibles",lua_fairygui_GGroup_setExcludeInvisibles); - tolua_function(tolua_S,"isAutoSizeDisabled",lua_fairygui_GGroup_isAutoSizeDisabled); - tolua_function(tolua_S,"setAutoSizeDisabled",lua_fairygui_GGroup_setAutoSizeDisabled); - tolua_function(tolua_S,"getMainGridIndex",lua_fairygui_GGroup_getMainGridIndex); - tolua_function(tolua_S,"setMainGridIndex",lua_fairygui_GGroup_setMainGridIndex); - tolua_function(tolua_S,"getMainGridMinSize",lua_fairygui_GGroup_getMainGridMinSize); - tolua_function(tolua_S,"setMainGridMinSize",lua_fairygui_GGroup_setMainGridMinSize); - tolua_function(tolua_S,"create", lua_fairygui_GGroup_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::GGroup).name(); - g_luaType[typeName] = "fairygui.GGroup"; - g_typeCast["GGroup"] = "fairygui.GGroup"; - return 1; + tolua_beginmodule(tolua_S,"GGroup"); + tolua_function(tolua_S,"getColumnGap",lua_fairygui_GGroup_getColumnGap); + tolua_function(tolua_S,"resizeChildren",lua_fairygui_GGroup_resizeChildren); + tolua_function(tolua_S,"setLayout",lua_fairygui_GGroup_setLayout); + tolua_function(tolua_S,"setColumnGap",lua_fairygui_GGroup_setColumnGap); + tolua_function(tolua_S,"setBoundsChangedFlag",lua_fairygui_GGroup_setBoundsChangedFlag); + tolua_function(tolua_S,"moveChildren",lua_fairygui_GGroup_moveChildren); + tolua_function(tolua_S,"getLineGap",lua_fairygui_GGroup_getLineGap); + tolua_function(tolua_S,"setLineGap",lua_fairygui_GGroup_setLineGap); + tolua_function(tolua_S,"getLayout",lua_fairygui_GGroup_getLayout); + tolua_function(tolua_S,"isExcludeInvisibles",lua_fairygui_GGroup_isExcludeInvisibles); + tolua_function(tolua_S,"setExcludeInvisibles",lua_fairygui_GGroup_setExcludeInvisibles); + tolua_function(tolua_S,"isAutoSizeDisabled",lua_fairygui_GGroup_isAutoSizeDisabled); + tolua_function(tolua_S,"setAutoSizeDisabled",lua_fairygui_GGroup_setAutoSizeDisabled); + tolua_function(tolua_S,"getMainGridIndex",lua_fairygui_GGroup_getMainGridIndex); + tolua_function(tolua_S,"setMainGridIndex",lua_fairygui_GGroup_setMainGridIndex); + tolua_function(tolua_S,"getMainGridMinSize",lua_fairygui_GGroup_getMainGridMinSize); + tolua_function(tolua_S,"setMainGridMinSize",lua_fairygui_GGroup_setMainGridMinSize); + tolua_function(tolua_S,"create", lua_fairygui_GGroup_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::GGroup).name(); + g_luaType[typeName] = "fairygui.GGroup"; + g_typeCast["GGroup"] = "fairygui.GGroup"; + return 1; +} + +static int lua_fairygui_Transition_setValue(lua_State* tolua_S) +{ + int argc = 0; + fairygui::Transition* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_setValue'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) { + std::string arg0; + cocos2d::ValueVector arg1; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.Transition:setValue"); + ok &= luaval_to_ccvaluevector(tolua_S, 3, &arg1, "fairygui.Transition:setValue"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_setValue'", nullptr); + return 0; + } + cobj->setValue(arg0, arg1); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:setValue",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_setValue'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_Transition_changePlayTimes(lua_State* tolua_S) +{ + int argc = 0; + fairygui::Transition* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_changePlayTimes'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.Transition:changePlayTimes"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_changePlayTimes'", nullptr); + return 0; + } + cobj->changePlayTimes(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:changePlayTimes",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_changePlayTimes'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_Transition_onOwnerRemovedFromStage(lua_State* tolua_S) +{ + int argc = 0; + fairygui::Transition* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_onOwnerRemovedFromStage'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cobj->onOwnerRemovedFromStage(); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:onOwnerRemovedFromStage",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_onOwnerRemovedFromStage'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_Transition_setTarget(lua_State* tolua_S) +{ + int argc = 0; + fairygui::Transition* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_setTarget'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) { + std::string arg0; + fairygui::GObject* arg1; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.Transition:setTarget"); + ok &= luaval_to_object(tolua_S, 3, "fairygui.GObject",&arg1, "fairygui.Transition:setTarget"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_setTarget'", nullptr); + return 0; + } + cobj->setTarget(arg0, arg1); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:setTarget",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_setTarget'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_Transition_clearHooks(lua_State* tolua_S) +{ + int argc = 0; + fairygui::Transition* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_clearHooks'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cobj->clearHooks();// not remove removeObjectAllHandlers + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:clearHooks",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_clearHooks'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_Transition_stop(lua_State* tolua_S) +{ + int argc = 0; + fairygui::Transition* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_stop'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cobj->stop();// not remove removeObjectAllHandlers + return 0; + } + if (argc == 2) { + bool arg0; + bool arg1; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.Transition:stop"); + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.Transition:stop"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_stop'", nullptr); + return 0; + } + cobj->stop(arg0, arg1);// not remove removeObjectAllHandlers + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:stop",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_stop'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_Transition_getOwner(lua_State* tolua_S) +{ + int argc = 0; + fairygui::Transition* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_getOwner'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::GComponent* ret = cobj->getOwner(); + object_to_luaval(tolua_S, "fairygui.GComponent",(fairygui::GComponent*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:getOwner",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_getOwner'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_Transition_setHook(lua_State* tolua_S) +{ + int argc = 0; + fairygui::Transition* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_setHook'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.Transition:setHook"); + LUA_FUNCTION handler = (toluafix_ref_function(tolua_S, 3, 0)); + if(!ok || 0 == handler) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_setHook'", nullptr); + return 0; + } + cobj->setHook(arg0, [=]() { + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 0); + }); + ScriptHandlerMgr::getInstance()->addCustomHandler((void*)cobj, handler); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:setHook",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_setHook'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_Transition_setDuration(lua_State* tolua_S) +{ + int argc = 0; + fairygui::Transition* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_setDuration'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 2) { + std::string arg0; + double arg1; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.Transition:setDuration"); + ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.Transition:setDuration"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_setDuration'", nullptr); + return 0; + } + cobj->setDuration(arg0, arg1); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:setDuration",argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_setDuration'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_Transition_isPlaying(lua_State* tolua_S) +{ + int argc = 0; + fairygui::Transition* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_isPlaying'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + bool ret = cobj->isPlaying(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:isPlaying",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_isPlaying'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_Transition_setAutoPlay(lua_State* tolua_S) +{ + int argc = 0; + fairygui::Transition* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_setAutoPlay'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 3) { + bool arg0; + int arg1; + double arg2; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.Transition:setAutoPlay"); + ok &= luaval_to_int32(tolua_S, 3,&arg1, "fairygui.Transition:setAutoPlay"); + ok &= luaval_to_number(tolua_S, 4,&arg2, "fairygui.Transition:setAutoPlay"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_setAutoPlay'", nullptr); + return 0; + } + cobj->setAutoPlay(arg0, arg1, arg2); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:setAutoPlay",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_setAutoPlay'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_Transition_updateFromRelations(lua_State* tolua_S) +{ + int argc = 0; + fairygui::Transition* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_updateFromRelations'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 3) { + std::string arg0; + double arg1; + double arg2; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.Transition:updateFromRelations"); + ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.Transition:updateFromRelations"); + ok &= luaval_to_number(tolua_S, 4,&arg2, "fairygui.Transition:updateFromRelations"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_updateFromRelations'", nullptr); + return 0; + } + cobj->updateFromRelations(arg0, arg1, arg2); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:updateFromRelations",argc, 3); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_updateFromRelations'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_Transition_playReverse(lua_State* tolua_S) +{ + int argc = 0; + fairygui::Transition* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj){ + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_playReverse'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cobj->playReverse(); + return 0; + } + if (argc == 1) { + LUA_FUNCTION handler = (toluafix_ref_function(tolua_S, 2, 0)); + if (0 == handler) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_playReverse'", nullptr); + return 0; + } + cobj->playReverse([=]() { + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 0); + }); + ScriptHandlerMgr::getInstance()->addCustomHandler((void*)cobj, handler); + return 0; + } + if (argc == 2) { + int arg0; + double arg1; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.Transition:playReverse"); + ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.Transition:playReverse"); + cobj->playReverse(arg0, arg1); + return 0; + } + if (argc == 3) { + int arg0; + double arg1; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.Transition:playReverse"); + ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.Transition:playReverse"); + LUA_FUNCTION handler = (toluafix_ref_function(tolua_S, 4, 0)); + if (!ok || 0 == handler) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_playReverse'", nullptr); + return 0; + } + cobj->playReverse(arg0, arg1, [=]() { + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 0); + }); + ScriptHandlerMgr::getInstance()->addCustomHandler((void*)cobj, handler); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:playReverse",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_playReverse'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_Transition_play(lua_State* tolua_S) +{ + int argc = 0; + fairygui::Transition* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj){ + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_play'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cobj->play(); + return 0; + } + if (argc == 1) { + LUA_FUNCTION handler = (toluafix_ref_function(tolua_S, 2, 0)); + if (0 == handler) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_play'", nullptr); + return 0; + } + cobj->play([=]() { + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 0); + }); + ScriptHandlerMgr::getInstance()->addCustomHandler((void*)cobj, handler); + return 0; + } + if (argc == 2) { + int arg0; + double arg1; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.Transition:play"); + ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.Transition:play"); + cobj->play(arg0, arg1); + return 0; + } + if (argc == 3) { + int arg0; + double arg1; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.Transition:play"); + ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.Transition:play"); + LUA_FUNCTION handler = (toluafix_ref_function(tolua_S, 4, 0)); + if (!ok || 0 == handler) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_play'", nullptr); + return 0; + } + cobj->play(arg0, arg1, [=]() { + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 0); + }); + ScriptHandlerMgr::getInstance()->addCustomHandler((void*)cobj, handler); + return 0; + } + if (argc == 4) { + int arg0; + double arg1; + double arg2; + double arg3; + ok &= luaval_to_int32(tolua_S, 2,&arg0, "fairygui.Transition:play"); + ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.Transition:play"); + ok &= luaval_to_number(tolua_S, 4,&arg2, "fairygui.Transition:play"); + ok &= luaval_to_number(tolua_S, 5,&arg3, "fairygui.Transition:play"); + cobj->play(arg0, arg1, arg2, arg3); + return 0; + } + if (argc == 5) { + int arg0; + double arg1; + double arg2; + double arg3; + ok &= luaval_to_int32(tolua_S, 2,&arg0, "fairygui.Transition:play"); + ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.Transition:play"); + ok &= luaval_to_number(tolua_S, 4,&arg2, "fairygui.Transition:play"); + ok &= luaval_to_number(tolua_S, 5,&arg3, "fairygui.Transition:play"); + LUA_FUNCTION handler = (toluafix_ref_function(tolua_S, 6, 0)); + if (!ok || 0 == handler) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_play'", nullptr); + return 0; + } + cobj->play(arg0, arg1, arg2, arg3, [=]() { + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 0); + }); + ScriptHandlerMgr::getInstance()->addCustomHandler((void*)cobj, handler); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:play",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_play'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_Transition_setTimeScale(lua_State* tolua_S) +{ + int argc = 0; + fairygui::Transition* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_setTimeScale'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.Transition:setTimeScale"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_setTimeScale'", nullptr); + return 0; + } + cobj->setTimeScale(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:setTimeScale",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_setTimeScale'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_Transition_getTimeScale(lua_State* tolua_S) +{ + int argc = 0; + fairygui::Transition* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_getTimeScale'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + lua_pushnumber(tolua_S, lua_Number(cobj->getTimeScale())); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:getTimeScale",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_getTimeScale'.",&tolua_err); + return 0; +#endif +} + +static int lua_register_fairygui_Transition(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"fairygui.Transition"); + tolua_cclass(tolua_S,"Transition","fairygui.Transition","cc.Ref",nullptr); + + tolua_beginmodule(tolua_S,"Transition"); + tolua_function(tolua_S,"setValue",lua_fairygui_Transition_setValue); + tolua_function(tolua_S,"changePlayTimes",lua_fairygui_Transition_changePlayTimes); + tolua_function(tolua_S,"onOwnerRemovedFromStage",lua_fairygui_Transition_onOwnerRemovedFromStage); + tolua_function(tolua_S,"setTarget",lua_fairygui_Transition_setTarget); + tolua_function(tolua_S,"clearHooks",lua_fairygui_Transition_clearHooks); + tolua_function(tolua_S,"stop",lua_fairygui_Transition_stop); + tolua_function(tolua_S,"getOwner",lua_fairygui_Transition_getOwner); + tolua_function(tolua_S,"setHook",lua_fairygui_Transition_setHook); + tolua_function(tolua_S,"setDuration",lua_fairygui_Transition_setDuration); + tolua_function(tolua_S,"isPlaying",lua_fairygui_Transition_isPlaying); + tolua_function(tolua_S,"setAutoPlay",lua_fairygui_Transition_setAutoPlay); + tolua_function(tolua_S,"updateFromRelations",lua_fairygui_Transition_updateFromRelations); + tolua_function(tolua_S,"playReverse",lua_fairygui_Transition_playReverse); + tolua_function(tolua_S,"play",lua_fairygui_Transition_play); + tolua_function(tolua_S,"setTimeScale",lua_fairygui_Transition_setTimeScale); + tolua_function(tolua_S,"getTimeScale",lua_fairygui_Transition_getTimeScale); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::Transition).name(); + g_luaType[typeName] = "fairygui.Transition"; + g_typeCast["Transition"] = "fairygui.Transition"; + return 1; +} + +static int lua_fairygui_ScrollPane_setBouncebackEffect(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setBouncebackEffect'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.ScrollPane:setBouncebackEffect"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setBouncebackEffect'", nullptr); + return 0; + } + cobj->setBouncebackEffect(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setBouncebackEffect",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setBouncebackEffect'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_getHzScrollBar(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getHzScrollBar'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::GScrollBar* ret = cobj->getHzScrollBar(); + object_to_luaval(tolua_S, "fairygui.GScrollBar",(fairygui::GScrollBar*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getHzScrollBar",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getHzScrollBar'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_scrollToView(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_scrollToView'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + cocos2d::Rect arg0; + ok = luaval_to_rect(tolua_S, 2, &arg0, "fairygui.ScrollPane:scrollToView"); + if (ok) { + cobj->scrollToView(arg0); + return 0; + } + + fairygui::GObject* arg00; + ok = luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg00, "fairygui.ScrollPane:scrollToView"); + if (ok) { + cobj->scrollToView(arg00); + return 0; + } + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollToView'", nullptr); + return 0; + } + if (argc == 2) { + cocos2d::Rect arg0; + ok = luaval_to_rect(tolua_S, 2, &arg0, "fairygui.ScrollPane:scrollToView"); + bool arg1; + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.ScrollPane:scrollToView"); + if (ok) { + cobj->scrollToView(arg0, arg1); + return 0; + } + + fairygui::GObject* arg00; + ok = luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg00, "fairygui.ScrollPane:scrollToView"); + bool arg11; + ok &= luaval_to_boolean(tolua_S, 3,&arg11, "fairygui.ScrollPane:scrollToView"); + if (ok) { + cobj->scrollToView(arg00, arg11); + return 0; + } + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollToView'", nullptr); + return 0; + } + if (argc == 3) { + cocos2d::Rect arg0; + ok = luaval_to_rect(tolua_S, 2, &arg0, "fairygui.ScrollPane:scrollToView"); + bool arg1; + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.ScrollPane:scrollToView"); + bool arg2; + ok &= luaval_to_boolean(tolua_S, 4,&arg2, "fairygui.ScrollPane:scrollToView"); + if (ok) { + cobj->scrollToView(arg0, arg1, arg2); + return 0; + } + + fairygui::GObject* arg00; + ok = luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg00, "fairygui.ScrollPane:scrollToView"); + bool arg11; + ok &= luaval_to_boolean(tolua_S, 3,&arg11, "fairygui.ScrollPane:scrollToView"); + bool arg22; + ok &= luaval_to_boolean(tolua_S, 4,&arg22, "fairygui.ScrollPane:scrollToView"); + if (ok) { + cobj->scrollToView(arg00, arg11, arg22); + return 0; + } + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollToView'", nullptr); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:scrollToView",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_scrollToView'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_getDecelerationRate(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getDecelerationRate'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + double ret = cobj->getDecelerationRate(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getDecelerationRate",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getDecelerationRate'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_getPercX(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getPercX'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + double ret = cobj->getPercX(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getPercX",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getPercX'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_getPosY(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getPosY'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + double ret = cobj->getPosY(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getPosY",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getPosY'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_getFooter(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getFooter'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::GComponent* ret = cobj->getFooter(); + object_to_luaval(tolua_S, "fairygui.GComponent",(fairygui::GComponent*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getFooter",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getFooter'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_setPosX(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setPosX'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:setPosX"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPosX'", nullptr); + return 0; + } + cobj->setPosX(arg0); + return 0; + } + if (argc == 2) { + double arg0; + bool arg1; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:setPosX"); + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.ScrollPane:setPosX"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPosX'", nullptr); + return 0; + } + cobj->setPosX(arg0, arg1); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setPosX",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setPosX'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_getPosX(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getPosX'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + double ret = cobj->getPosX(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getPosX",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getPosX'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_setPageY(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setPageY'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.ScrollPane:setPageY"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPageY'", nullptr); + return 0; + } + cobj->setPageY(arg0); + return 0; + } + if (argc == 2) { + int arg0; + bool arg1; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.ScrollPane:setPageY"); + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.ScrollPane:setPageY"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPageY'", nullptr); + return 0; + } + cobj->setPageY(arg0, arg1); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setPageY",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setPageY'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_scrollTop(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_scrollTop'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cobj->scrollTop(); + return 0; + } + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.ScrollPane:scrollTop"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollTop'", nullptr); + return 0; + } + cobj->scrollTop(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:scrollTop",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_scrollTop'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_isSnapToItem(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_isSnapToItem'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + bool ret = cobj->isSnapToItem(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:isSnapToItem",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_isSnapToItem'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_isTouchEffect(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_isTouchEffect'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + bool ret = cobj->isTouchEffect(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:isTouchEffect",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_isTouchEffect'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_setScrollStep(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setScrollStep'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:setScrollStep"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setScrollStep'", nullptr); + return 0; + } + cobj->setScrollStep(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setScrollStep",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setScrollStep'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_scrollBottom(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_scrollBottom'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cobj->scrollBottom(); + return 0; + } + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.ScrollPane:scrollBottom"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollBottom'", nullptr); + return 0; + } + cobj->scrollBottom(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:scrollBottom",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_scrollBottom'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_isChildInView(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_isChildInView'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + fairygui::GObject* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.ScrollPane:isChildInView"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_isChildInView'", nullptr); + return 0; + } + bool ret = cobj->isChildInView(arg0); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:isChildInView",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_isChildInView'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_isPageMode(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_isPageMode'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + bool ret = cobj->isPageMode(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:isPageMode",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_isPageMode'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_setDecelerationRate(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setDecelerationRate'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:setDecelerationRate"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setDecelerationRate'", nullptr); + return 0; + } + cobj->setDecelerationRate(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setDecelerationRate",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setDecelerationRate'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_getScrollingPosY(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getScrollingPosY'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + double ret = cobj->getScrollingPosY(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getScrollingPosY",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getScrollingPosY'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_getScrollingPosX(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getScrollingPosX'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + double ret = cobj->getScrollingPosX(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getScrollingPosX",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getScrollingPosX'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_getContentSize(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getContentSize'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + const cocos2d::Size& ret = cobj->getContentSize(); + size_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getContentSize",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getContentSize'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_isRightMost(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_isRightMost'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + bool ret = cobj->isRightMost(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:isRightMost",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_isRightMost'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_setPageController(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setPageController'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + fairygui::GController* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GController",&arg0, "fairygui.ScrollPane:setPageController"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPageController'", nullptr); + return 0; + } + cobj->setPageController(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setPageController",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setPageController'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_lockHeader(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_lockHeader'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.ScrollPane:lockHeader"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_lockHeader'", nullptr); + return 0; + } + cobj->lockHeader(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:lockHeader",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_lockHeader'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_lockFooter(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_lockFooter'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.ScrollPane:lockFooter"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_lockFooter'", nullptr); + return 0; + } + cobj->lockFooter(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:lockFooter",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_lockFooter'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_scrollDown(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_scrollDown'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cobj->scrollDown(); + return 0; + } + if (argc == 1) { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:scrollDown"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollDown'", nullptr); + return 0; + } + cobj->scrollDown(arg0); + return 0; + } + if (argc == 2) { + double arg0; + bool arg1; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:scrollDown"); + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.ScrollPane:scrollDown"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollDown'", nullptr); + return 0; + } + cobj->scrollDown(arg0, arg1); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:scrollDown",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_scrollDown'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_setSnapToItem(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setSnapToItem'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.ScrollPane:setSnapToItem"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setSnapToItem'", nullptr); + return 0; + } + cobj->setSnapToItem(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setSnapToItem",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setSnapToItem'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_getScrollStep(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getScrollStep'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + double ret = cobj->getScrollStep(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getScrollStep",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getScrollStep'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_getPageX(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getPageX'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + int ret = cobj->getPageX(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getPageX",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getPageX'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_scrollLeft(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_scrollLeft'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cobj->scrollLeft(); + return 0; + } + if (argc == 1) { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:scrollLeft"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollLeft'", nullptr); + return 0; + } + cobj->scrollLeft(arg0); + return 0; + } + if (argc == 2) { + double arg0; + bool arg1; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:scrollLeft"); + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.ScrollPane:scrollLeft"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollLeft'", nullptr); + return 0; + } + cobj->scrollLeft(arg0, arg1); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:scrollLeft",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_scrollLeft'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_getViewSize(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getViewSize'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + const cocos2d::Size& ret = cobj->getViewSize(); + size_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getViewSize",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getViewSize'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_setInertiaDisabled(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setInertiaDisabled'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.ScrollPane:setInertiaDisabled"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setInertiaDisabled'", nullptr); + return 0; + } + cobj->setInertiaDisabled(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setInertiaDisabled",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setInertiaDisabled'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_getPageController(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getPageController'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::GController* ret = cobj->getPageController(); + object_to_luaval(tolua_S, "fairygui.GController",(fairygui::GController*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getPageController",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getPageController'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_setPageX(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setPageX'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.ScrollPane:setPageX"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPageX'", nullptr); + return 0; + } + cobj->setPageX(arg0); + return 0; + } + if (argc == 2) { + int arg0; + bool arg1; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.ScrollPane:setPageX"); + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.ScrollPane:setPageX"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPageX'", nullptr); + return 0; + } + cobj->setPageX(arg0, arg1); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setPageX",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setPageX'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_scrollUp(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_scrollUp'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cobj->scrollUp(); + return 0; + } + if (argc == 1) { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:scrollUp"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollUp'", nullptr); + return 0; + } + cobj->scrollUp(arg0); + return 0; + } + if (argc == 2) { + double arg0; + bool arg1; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:scrollUp"); + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.ScrollPane:scrollUp"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollUp'", nullptr); + return 0; + } + cobj->scrollUp(arg0, arg1); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:scrollUp",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_scrollUp'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_ScrollPane_isMouseWheelEnabled(lua_State* tolua_S) +{ + int argc = 0; + fairygui::ScrollPane* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_isMouseWheelEnabled'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + bool ret = cobj->isMouseWheelEnabled(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:isMouseWheelEnabled",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_isMouseWheelEnabled'.",&tolua_err); + return 0; +#endif } -static int lua_fairygui_Transition_setValue(lua_State* tolua_S) +static int lua_fairygui_ScrollPane_setPageMode(lua_State* tolua_S) { int argc = 0; - fairygui::Transition* cobj = nullptr; + fairygui::ScrollPane* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_setValue'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setPageMode'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - std::string arg0; - cocos2d::ValueVector arg1; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.Transition:setValue"); - ok &= luaval_to_ccvaluevector(tolua_S, 3, &arg1, "fairygui.Transition:setValue"); + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.ScrollPane:setPageMode"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_setValue'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPageMode'", nullptr); return 0; } - cobj->setValue(arg0, arg1); - return 0; + cobj->setPageMode(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:setValue",argc, 2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setPageMode",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_setValue'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setPageMode'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Transition_changePlayTimes(lua_State* tolua_S) +static int lua_fairygui_ScrollPane_setTouchEffect(lua_State* tolua_S) { int argc = 0; - fairygui::Transition* cobj = nullptr; + fairygui::ScrollPane* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_changePlayTimes'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setTouchEffect'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.Transition:changePlayTimes"); + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.ScrollPane:setTouchEffect"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_changePlayTimes'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setTouchEffect'", nullptr); return 0; } - cobj->changePlayTimes(arg0); - return 0; + cobj->setTouchEffect(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:changePlayTimes",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setTouchEffect",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_changePlayTimes'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setTouchEffect'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Transition_onOwnerRemovedFromStage(lua_State* tolua_S) +static int lua_fairygui_ScrollPane_setMouseWheelEnabled(lua_State* tolua_S) { int argc = 0; - fairygui::Transition* cobj = nullptr; + fairygui::ScrollPane* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_onOwnerRemovedFromStage'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setMouseWheelEnabled'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->onOwnerRemovedFromStage(); - return 0; + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.ScrollPane:setMouseWheelEnabled"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setMouseWheelEnabled'", nullptr); + return 0; + } + cobj->setMouseWheelEnabled(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:onOwnerRemovedFromStage",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setMouseWheelEnabled",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_onOwnerRemovedFromStage'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setMouseWheelEnabled'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Transition_setTarget(lua_State* tolua_S) +static int lua_fairygui_ScrollPane_isInertiaDisabled(lua_State* tolua_S) { int argc = 0; - fairygui::Transition* cobj = nullptr; - bool ok = true; + fairygui::ScrollPane* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_setTarget'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_isInertiaDisabled'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - std::string arg0; - fairygui::GObject* arg1; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.Transition:setTarget"); - ok &= luaval_to_object(tolua_S, 3, "fairygui.GObject",&arg1, "fairygui.Transition:setTarget"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_setTarget'", nullptr); - return 0; - } - cobj->setTarget(arg0, arg1); - return 0; + if (argc == 0) { + bool ret = cobj->isInertiaDisabled(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:setTarget",argc, 2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:isInertiaDisabled",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_setTarget'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_isInertiaDisabled'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Transition_clearHooks(lua_State* tolua_S) +static int lua_fairygui_ScrollPane_setPercX(lua_State* tolua_S) { int argc = 0; - fairygui::Transition* cobj = nullptr; + fairygui::ScrollPane* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_clearHooks'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setPercX'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->clearHooks();// not remove removeObjectAllHandlers - return 0; + if (argc == 1) { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:setPercX"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPercX'", nullptr); + return 0; + } + cobj->setPercX(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:clearHooks",argc, 0); + if (argc == 2) { + double arg0; + bool arg1; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:setPercX"); + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.ScrollPane:setPercX"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPercX'", nullptr); + return 0; + } + cobj->setPercX(arg0, arg1); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setPercX",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_clearHooks'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setPercX'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Transition_stop(lua_State* tolua_S) +static int lua_fairygui_ScrollPane_setPercY(lua_State* tolua_S) { int argc = 0; - fairygui::Transition* cobj = nullptr; + fairygui::ScrollPane* cobj = nullptr; bool ok = true; - + #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) - { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_stop'", nullptr); + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setPercY'", nullptr); return 0; } #endif - + argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->stop();// not remove removeObjectAllHandlers - return 0; - } - if (argc == 2) { - bool arg0; - bool arg1; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.Transition:stop"); - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.Transition:stop"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_stop'", nullptr); - return 0; - } - cobj->stop(arg0, arg1);// not remove removeObjectAllHandlers - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:stop",argc, 0); + if (argc == 1) { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:setPercY"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPercY'", nullptr); + return 0; + } + cobj->setPercY(arg0); + return 0; + } + if (argc == 2) { + double arg0; + bool arg1; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:setPercY"); + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.ScrollPane:setPercY"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPercY'", nullptr); + return 0; + } + cobj->setPercY(arg0, arg1); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setPercY",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_stop'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setPercY'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Transition_getOwner(lua_State* tolua_S) +static int lua_fairygui_ScrollPane_cancelDragging(lua_State* tolua_S) { int argc = 0; - fairygui::Transition* cobj = nullptr; + fairygui::ScrollPane* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_getOwner'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_cancelDragging'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - fairygui::GComponent* ret = cobj->getOwner(); - object_to_luaval(tolua_S, "fairygui.GComponent",(fairygui::GComponent*)ret); - return 1; + cobj->cancelDragging(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:getOwner",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:cancelDragging",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_getOwner'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_cancelDragging'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Transition_setHook(lua_State* tolua_S) +static int lua_fairygui_ScrollPane_getPercY(lua_State* tolua_S) { int argc = 0; - fairygui::Transition* cobj = nullptr; - bool ok = true; + fairygui::ScrollPane* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_setHook'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getPercY'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.Transition:setHook"); - LUA_FUNCTION handler = (toluafix_ref_function(tolua_S, 3, 0)); - if(!ok || 0 == handler) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_setHook'", nullptr); - return 0; - } - cobj->setHook(arg0, [=]() { - LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 0); - }); - ScriptHandlerMgr::getInstance()->addCustomHandler((void*)cobj, handler); - return 0; + if (argc == 0) { + double ret = cobj->getPercY(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:setHook",argc, 2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getPercY",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_setHook'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getPercY'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Transition_setDuration(lua_State* tolua_S) +static int lua_fairygui_ScrollPane_scrollRight(lua_State* tolua_S) { int argc = 0; - fairygui::Transition* cobj = nullptr; + fairygui::ScrollPane* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_setDuration'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_scrollRight'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cobj->scrollRight(); + return 0; + } + if (argc == 1) { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:scrollRight"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollRight'", nullptr); + return 0; + } + cobj->scrollRight(arg0); + return 0; + } if (argc == 2) { - std::string arg0; - double arg1; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.Transition:setDuration"); - ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.Transition:setDuration"); + double arg0; + bool arg1; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:scrollRight"); + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.ScrollPane:scrollRight"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_setDuration'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollRight'", nullptr); return 0; } - cobj->setDuration(arg0, arg1); - return 0; + cobj->scrollRight(arg0, arg1); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:setDuration",argc, 2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:scrollRight",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_setDuration'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_scrollRight'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Transition_isPlaying(lua_State* tolua_S) +static int lua_fairygui_ScrollPane_getHeader(lua_State* tolua_S) { int argc = 0; - fairygui::Transition* cobj = nullptr; + fairygui::ScrollPane* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_isPlaying'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getHeader'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - bool ret = cobj->isPlaying(); - tolua_pushboolean(tolua_S,(bool)ret); + fairygui::GComponent* ret = cobj->getHeader(); + object_to_luaval(tolua_S, "fairygui.GComponent",(fairygui::GComponent*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:isPlaying",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getHeader",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_isPlaying'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getHeader'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Transition_setAutoPlay(lua_State* tolua_S) +static int lua_fairygui_ScrollPane_getVtScrollBar(lua_State* tolua_S) { int argc = 0; - fairygui::Transition* cobj = nullptr; - bool ok = true; + fairygui::ScrollPane* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_setAutoPlay'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getVtScrollBar'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 3) { - bool arg0; - int arg1; - double arg2; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.Transition:setAutoPlay"); - ok &= luaval_to_int32(tolua_S, 3,&arg1, "fairygui.Transition:setAutoPlay"); - ok &= luaval_to_number(tolua_S, 4,&arg2, "fairygui.Transition:setAutoPlay"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_setAutoPlay'", nullptr); - return 0; - } - cobj->setAutoPlay(arg0, arg1, arg2); - return 0; + if (argc == 0) { + fairygui::GScrollBar* ret = cobj->getVtScrollBar(); + object_to_luaval(tolua_S, "fairygui.GScrollBar",(fairygui::GScrollBar*)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:setAutoPlay",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getVtScrollBar",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_setAutoPlay'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getVtScrollBar'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Transition_updateFromRelations(lua_State* tolua_S) +static int lua_fairygui_ScrollPane_getOwner(lua_State* tolua_S) { int argc = 0; - fairygui::Transition* cobj = nullptr; - bool ok = true; + fairygui::ScrollPane* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_updateFromRelations'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getOwner'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 3) { - std::string arg0; - double arg1; - double arg2; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.Transition:updateFromRelations"); - ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.Transition:updateFromRelations"); - ok &= luaval_to_number(tolua_S, 4,&arg2, "fairygui.Transition:updateFromRelations"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_updateFromRelations'", nullptr); - return 0; - } - cobj->updateFromRelations(arg0, arg1, arg2); - return 0; + if (argc == 0) { + fairygui::GComponent* ret = cobj->getOwner(); + object_to_luaval(tolua_S, "fairygui.GComponent",(fairygui::GComponent*)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:updateFromRelations",argc, 3); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getOwner",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_updateFromRelations'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getOwner'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Transition_playReverse(lua_State* tolua_S) +static int lua_fairygui_ScrollPane_isBottomMost(lua_State* tolua_S) { int argc = 0; - fairygui::Transition* cobj = nullptr; - bool ok = true; - + fairygui::ScrollPane* cobj = nullptr; + #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj){ - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_playReverse'", nullptr); + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_isBottomMost'", nullptr); return 0; } #endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->playReverse(); - return 0; - } - if (argc == 1) { - LUA_FUNCTION handler = (toluafix_ref_function(tolua_S, 2, 0)); - if (0 == handler) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_playReverse'", nullptr); - return 0; - } - cobj->playReverse([=]() { - LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 0); - }); - ScriptHandlerMgr::getInstance()->addCustomHandler((void*)cobj, handler); - return 0; - } - if (argc == 2) { - int arg0; - double arg1; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.Transition:playReverse"); - ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.Transition:playReverse"); - cobj->playReverse(arg0, arg1); - return 0; - } - if (argc == 3) { - int arg0; - double arg1; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.Transition:playReverse"); - ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.Transition:playReverse"); - LUA_FUNCTION handler = (toluafix_ref_function(tolua_S, 4, 0)); - if (!ok || 0 == handler) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_playReverse'", nullptr); - return 0; - } - cobj->playReverse(arg0, arg1, [=]() { - LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 0); - }); - ScriptHandlerMgr::getInstance()->addCustomHandler((void*)cobj, handler); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:playReverse",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_playReverse'.",&tolua_err); - return 0; -#endif -} -static int lua_fairygui_Transition_play(lua_State* tolua_S) -{ - int argc = 0; - fairygui::Transition* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Transition",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::Transition*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj){ - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Transition_play'", nullptr); - return 0; - } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->play(); - return 0; - } - if (argc == 1) { - LUA_FUNCTION handler = (toluafix_ref_function(tolua_S, 2, 0)); - if (0 == handler) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_play'", nullptr); - return 0; - } - cobj->play([=]() { - LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 0); - }); - ScriptHandlerMgr::getInstance()->addCustomHandler((void*)cobj, handler); - return 0; - } - if (argc == 2) { - int arg0; - double arg1; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.Transition:play"); - ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.Transition:play"); - cobj->play(arg0, arg1); - return 0; - } - if (argc == 3) { - int arg0; - double arg1; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.Transition:play"); - ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.Transition:play"); - LUA_FUNCTION handler = (toluafix_ref_function(tolua_S, 4, 0)); - if (!ok || 0 == handler) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_play'", nullptr); - return 0; - } - cobj->play(arg0, arg1, [=]() { - LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 0); - }); - ScriptHandlerMgr::getInstance()->addCustomHandler((void*)cobj, handler); - return 0; - } - if (argc == 4) { - int arg0; - double arg1; - double arg2; - double arg3; - ok &= luaval_to_int32(tolua_S, 2,&arg0, "fairygui.Transition:play"); - ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.Transition:play"); - ok &= luaval_to_number(tolua_S, 4,&arg2, "fairygui.Transition:play"); - ok &= luaval_to_number(tolua_S, 5,&arg3, "fairygui.Transition:play"); - cobj->play(arg0, arg1, arg2, arg3); - return 0; - } - if (argc == 5) { - int arg0; - double arg1; - double arg2; - double arg3; - ok &= luaval_to_int32(tolua_S, 2,&arg0, "fairygui.Transition:play"); - ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.Transition:play"); - ok &= luaval_to_number(tolua_S, 4,&arg2, "fairygui.Transition:play"); - ok &= luaval_to_number(tolua_S, 5,&arg3, "fairygui.Transition:play"); - LUA_FUNCTION handler = (toluafix_ref_function(tolua_S, 6, 0)); - if (!ok || 0 == handler) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Transition_play'", nullptr); - return 0; - } - cobj->play(arg0, arg1, arg2, arg3, [=]() { - LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 0); - }); - ScriptHandlerMgr::getInstance()->addCustomHandler((void*)cobj, handler); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Transition:play",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + bool ret = cobj->isBottomMost(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:isBottomMost",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Transition_play'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_isBottomMost'.",&tolua_err); + return 0; #endif } -static int lua_register_fairygui_Transition(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.Transition"); - tolua_cclass(tolua_S,"Transition","fairygui.Transition","cc.Ref",nullptr); - - tolua_beginmodule(tolua_S,"Transition"); - tolua_function(tolua_S,"setValue",lua_fairygui_Transition_setValue); - tolua_function(tolua_S,"changePlayTimes",lua_fairygui_Transition_changePlayTimes); - tolua_function(tolua_S,"onOwnerRemovedFromStage",lua_fairygui_Transition_onOwnerRemovedFromStage); - tolua_function(tolua_S,"setTarget",lua_fairygui_Transition_setTarget); - tolua_function(tolua_S,"clearHooks",lua_fairygui_Transition_clearHooks); - tolua_function(tolua_S,"stop",lua_fairygui_Transition_stop); - tolua_function(tolua_S,"getOwner",lua_fairygui_Transition_getOwner); - tolua_function(tolua_S,"setHook",lua_fairygui_Transition_setHook); - tolua_function(tolua_S,"setDuration",lua_fairygui_Transition_setDuration); - tolua_function(tolua_S,"isPlaying",lua_fairygui_Transition_isPlaying); - tolua_function(tolua_S,"setAutoPlay",lua_fairygui_Transition_setAutoPlay); - tolua_function(tolua_S,"updateFromRelations",lua_fairygui_Transition_updateFromRelations); - tolua_function(tolua_S,"playReverse",lua_fairygui_Transition_playReverse); - tolua_function(tolua_S,"play",lua_fairygui_Transition_play); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::Transition).name(); - g_luaType[typeName] = "fairygui.Transition"; - g_typeCast["Transition"] = "fairygui.Transition"; - return 1; -} - -static int lua_fairygui_ScrollPane_setBouncebackEffect(lua_State* tolua_S) +static int lua_fairygui_ScrollPane_getPageY(lua_State* tolua_S) { int argc = 0; fairygui::ScrollPane* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; @@ -11258,33 +13936,28 @@ static int lua_fairygui_ScrollPane_setBouncebackEffect(lua_State* tolua_S) cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setBouncebackEffect'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getPageY'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.ScrollPane:setBouncebackEffect"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setBouncebackEffect'", nullptr); - return 0; - } - cobj->setBouncebackEffect(arg0); - return 0; + if (argc == 0) { + int ret = cobj->getPageY(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setBouncebackEffect",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getPageY",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setBouncebackEffect'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getPageY'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_getHzScrollBar(lua_State* tolua_S) +static int lua_fairygui_ScrollPane_isBouncebackEffect(lua_State* tolua_S) { int argc = 0; fairygui::ScrollPane* cobj = nullptr; @@ -11296,33 +13969,33 @@ static int lua_fairygui_ScrollPane_getHzScrollBar(lua_State* tolua_S) cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getHzScrollBar'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_isBouncebackEffect'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - fairygui::GScrollBar* ret = cobj->getHzScrollBar(); - object_to_luaval(tolua_S, "fairygui.GScrollBar",(fairygui::GScrollBar*)ret); + bool ret = cobj->isBouncebackEffect(); + tolua_pushboolean(tolua_S,(bool)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getHzScrollBar",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:isBouncebackEffect",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getHzScrollBar'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_isBouncebackEffect'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_scrollToView(lua_State* tolua_S) +static int lua_fairygui_ScrollPane_setPosY(lua_State* tolua_S) { int argc = 0; fairygui::ScrollPane* cobj = nullptr; bool ok = true; - + #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; @@ -11330,2076 +14003,1994 @@ static int lua_fairygui_ScrollPane_scrollToView(lua_State* tolua_S) cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_scrollToView'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setPosY'", nullptr); return 0; } #endif - + argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - cocos2d::Rect arg0; - ok = luaval_to_rect(tolua_S, 2, &arg0, "fairygui.ScrollPane:scrollToView"); - if (ok) { - cobj->scrollToView(arg0); - return 0; - } - - fairygui::GObject* arg00; - ok = luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg00, "fairygui.ScrollPane:scrollToView"); - if (ok) { - cobj->scrollToView(arg00); - return 0; - } - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollToView'", nullptr); - return 0; - } - if (argc == 2) { - cocos2d::Rect arg0; - ok = luaval_to_rect(tolua_S, 2, &arg0, "fairygui.ScrollPane:scrollToView"); - bool arg1; - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.ScrollPane:scrollToView"); - if (ok) { - cobj->scrollToView(arg0, arg1); - return 0; - } - - fairygui::GObject* arg00; - ok = luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg00, "fairygui.ScrollPane:scrollToView"); - bool arg11; - ok &= luaval_to_boolean(tolua_S, 3,&arg11, "fairygui.ScrollPane:scrollToView"); - if (ok) { - cobj->scrollToView(arg00, arg11); - return 0; - } - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollToView'", nullptr); - return 0; - } - if (argc == 3) { - cocos2d::Rect arg0; - ok = luaval_to_rect(tolua_S, 2, &arg0, "fairygui.ScrollPane:scrollToView"); - bool arg1; - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.ScrollPane:scrollToView"); - bool arg2; - ok &= luaval_to_boolean(tolua_S, 4,&arg2, "fairygui.ScrollPane:scrollToView"); - if (ok) { - cobj->scrollToView(arg0, arg1, arg2); - return 0; - } - - fairygui::GObject* arg00; - ok = luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg00, "fairygui.ScrollPane:scrollToView"); - bool arg11; - ok &= luaval_to_boolean(tolua_S, 3,&arg11, "fairygui.ScrollPane:scrollToView"); - bool arg22; - ok &= luaval_to_boolean(tolua_S, 4,&arg22, "fairygui.ScrollPane:scrollToView"); - if (ok) { - cobj->scrollToView(arg00, arg11, arg22); - return 0; - } - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollToView'", nullptr); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:scrollToView",argc, 1); + if (argc == 1) { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:setPosY"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPosY'", nullptr); + return 0; + } + cobj->setPosY(arg0); + return 0; + } + if (argc == 2) { + double arg0; + bool arg1; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:setPosY"); + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.ScrollPane:setPosY"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPosY'", nullptr); + return 0; + } + cobj->setPosY(arg0, arg1); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setPosY",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_scrollToView'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setPosY'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_getDecelerationRate(lua_State* tolua_S) +static int lua_fairygui_ScrollPane_getDraggingPane(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertable(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + + argc = lua_gettop(tolua_S) - 1; + if (argc == 0){ + fairygui::ScrollPane* ret = fairygui::ScrollPane::getDraggingPane(); + object_to_luaval(tolua_S, "fairygui.ScrollPane",(fairygui::ScrollPane*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.ScrollPane:getDraggingPane",argc, 0); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getDraggingPane'.",&tolua_err); + return 0; +#endif +} + +static int lua_register_fairygui_ScrollPane(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"fairygui.ScrollPane"); + tolua_cclass(tolua_S,"ScrollPane","fairygui.ScrollPane","cc.Ref",nullptr); + + tolua_beginmodule(tolua_S,"ScrollPane"); + tolua_function(tolua_S,"setBouncebackEffect",lua_fairygui_ScrollPane_setBouncebackEffect); + tolua_function(tolua_S,"getHzScrollBar",lua_fairygui_ScrollPane_getHzScrollBar); + tolua_function(tolua_S,"scrollToView",lua_fairygui_ScrollPane_scrollToView); + tolua_function(tolua_S,"getDecelerationRate",lua_fairygui_ScrollPane_getDecelerationRate); + tolua_function(tolua_S,"getPercX",lua_fairygui_ScrollPane_getPercX); + tolua_function(tolua_S,"getPosY",lua_fairygui_ScrollPane_getPosY); + tolua_function(tolua_S,"getFooter",lua_fairygui_ScrollPane_getFooter); + tolua_function(tolua_S,"setPosX",lua_fairygui_ScrollPane_setPosX); + tolua_function(tolua_S,"getPosX",lua_fairygui_ScrollPane_getPosX); + tolua_function(tolua_S,"setPageY",lua_fairygui_ScrollPane_setPageY); + tolua_function(tolua_S,"scrollTop",lua_fairygui_ScrollPane_scrollTop); + tolua_function(tolua_S,"isSnapToItem",lua_fairygui_ScrollPane_isSnapToItem); + tolua_function(tolua_S,"isTouchEffect",lua_fairygui_ScrollPane_isTouchEffect); + tolua_function(tolua_S,"setScrollStep",lua_fairygui_ScrollPane_setScrollStep); + tolua_function(tolua_S,"scrollBottom",lua_fairygui_ScrollPane_scrollBottom); + tolua_function(tolua_S,"isChildInView",lua_fairygui_ScrollPane_isChildInView); + tolua_function(tolua_S,"isPageMode",lua_fairygui_ScrollPane_isPageMode); + tolua_function(tolua_S,"setDecelerationRate",lua_fairygui_ScrollPane_setDecelerationRate); + tolua_function(tolua_S,"getScrollingPosY",lua_fairygui_ScrollPane_getScrollingPosY); + tolua_function(tolua_S,"getScrollingPosX",lua_fairygui_ScrollPane_getScrollingPosX); + tolua_function(tolua_S,"getContentSize",lua_fairygui_ScrollPane_getContentSize); + tolua_function(tolua_S,"isRightMost",lua_fairygui_ScrollPane_isRightMost); + tolua_function(tolua_S,"setPageController",lua_fairygui_ScrollPane_setPageController); + tolua_function(tolua_S,"lockHeader",lua_fairygui_ScrollPane_lockHeader); + tolua_function(tolua_S,"lockFooter",lua_fairygui_ScrollPane_lockFooter); + tolua_function(tolua_S,"scrollDown",lua_fairygui_ScrollPane_scrollDown); + tolua_function(tolua_S,"setSnapToItem",lua_fairygui_ScrollPane_setSnapToItem); + tolua_function(tolua_S,"getScrollStep",lua_fairygui_ScrollPane_getScrollStep); + tolua_function(tolua_S,"getPageX",lua_fairygui_ScrollPane_getPageX); + tolua_function(tolua_S,"scrollLeft",lua_fairygui_ScrollPane_scrollLeft); + tolua_function(tolua_S,"getViewSize",lua_fairygui_ScrollPane_getViewSize); + tolua_function(tolua_S,"setInertiaDisabled",lua_fairygui_ScrollPane_setInertiaDisabled); + tolua_function(tolua_S,"getPageController",lua_fairygui_ScrollPane_getPageController); + tolua_function(tolua_S,"setPageX",lua_fairygui_ScrollPane_setPageX); + tolua_function(tolua_S,"scrollUp",lua_fairygui_ScrollPane_scrollUp); + tolua_function(tolua_S,"isMouseWheelEnabled",lua_fairygui_ScrollPane_isMouseWheelEnabled); + tolua_function(tolua_S,"setPageMode",lua_fairygui_ScrollPane_setPageMode); + tolua_function(tolua_S,"setTouchEffect",lua_fairygui_ScrollPane_setTouchEffect); + tolua_function(tolua_S,"setMouseWheelEnabled",lua_fairygui_ScrollPane_setMouseWheelEnabled); + tolua_function(tolua_S,"isInertiaDisabled",lua_fairygui_ScrollPane_isInertiaDisabled); + tolua_function(tolua_S,"setPercX",lua_fairygui_ScrollPane_setPercX); + tolua_function(tolua_S,"setPercY",lua_fairygui_ScrollPane_setPercY); + tolua_function(tolua_S,"cancelDragging",lua_fairygui_ScrollPane_cancelDragging); + tolua_function(tolua_S,"getPercY",lua_fairygui_ScrollPane_getPercY); + tolua_function(tolua_S,"scrollRight",lua_fairygui_ScrollPane_scrollRight); + tolua_function(tolua_S,"getHeader",lua_fairygui_ScrollPane_getHeader); + tolua_function(tolua_S,"getVtScrollBar",lua_fairygui_ScrollPane_getVtScrollBar); + tolua_function(tolua_S,"getOwner",lua_fairygui_ScrollPane_getOwner); + tolua_function(tolua_S,"isBottomMost",lua_fairygui_ScrollPane_isBottomMost); + tolua_function(tolua_S,"getPageY",lua_fairygui_ScrollPane_getPageY); + tolua_function(tolua_S,"isBouncebackEffect",lua_fairygui_ScrollPane_isBouncebackEffect); + tolua_function(tolua_S,"setPosY",lua_fairygui_ScrollPane_setPosY); + tolua_function(tolua_S,"getDraggingPane", lua_fairygui_ScrollPane_getDraggingPane); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::ScrollPane).name(); + g_luaType[typeName] = "fairygui.ScrollPane"; + g_typeCast["ScrollPane"] = "fairygui.ScrollPane"; + return 1; +} + +static int lua_fairygui_GComponent_addChild(lua_State* tolua_S) +{ + int argc = 0; + fairygui::GComponent* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getDecelerationRate'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_addChild'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - double ret = cobj->getDecelerationRate(); - tolua_pushnumber(tolua_S,(lua_Number)ret); + if (argc == 1) { + fairygui::GObject* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GComponent:addChild"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_addChild'", nullptr); + return 0; + } + fairygui::GObject* ret = cobj->addChild(arg0); + object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getDecelerationRate",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:addChild",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getDecelerationRate'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_addChild'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_getPercX(lua_State* tolua_S) +static int lua_fairygui_GComponent_getHitArea(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getPercX'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getHitArea'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - double ret = cobj->getPercX(); - tolua_pushnumber(tolua_S,(lua_Number)ret); + fairygui::IHitTest* ret = cobj->getHitArea(); + object_to_luaval(tolua_S, "fairygui.IHitTest",(fairygui::IHitTest*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getPercX",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getHitArea",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getPercX'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getHitArea'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_getPosY(lua_State* tolua_S) +static int lua_fairygui_GComponent_applyAllControllers(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getPosY'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_applyAllControllers'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - double ret = cobj->getPosY(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + cobj->applyAllControllers(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getPosY",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:applyAllControllers",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getPosY'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_applyAllControllers'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_getFooter(lua_State* tolua_S) +static int lua_fairygui_GComponent_getOpaque(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getFooter'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getOpaque'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - fairygui::GComponent* ret = cobj->getFooter(); - object_to_luaval(tolua_S, "fairygui.GComponent",(fairygui::GComponent*)ret); + bool ret = cobj->getOpaque(); + tolua_pushboolean(tolua_S,(bool)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getFooter",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getOpaque",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getFooter'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getOpaque'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_setPosX(lua_State* tolua_S) +static int lua_fairygui_GComponent_setChildrenRenderOrder(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setPosX'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_setChildrenRenderOrder'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:setPosX"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPosX'", nullptr); - return 0; - } - cobj->setPosX(arg0); - return 0; - } - if (argc == 2) { - double arg0; - bool arg1; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:setPosX"); - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.ScrollPane:setPosX"); + fairygui::ChildrenRenderOrder arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GComponent:setChildrenRenderOrder"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPosX'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_setChildrenRenderOrder'", nullptr); return 0; } - cobj->setPosX(arg0, arg1); - return 0; + cobj->setChildrenRenderOrder(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setPosX",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:setChildrenRenderOrder",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setPosX'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_setChildrenRenderOrder'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_getPosX(lua_State* tolua_S) +static int lua_fairygui_GComponent_setOpaque(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getPosX'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_setOpaque'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - double ret = cobj->getPosX(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GComponent:setOpaque"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_setOpaque'", nullptr); + return 0; + } + cobj->setOpaque(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getPosX",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:setOpaque",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getPosX'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_setOpaque'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_setPageY(lua_State* tolua_S) +static int lua_fairygui_GComponent_getViewWidth(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; - bool ok = true; + fairygui::GComponent* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setPageY'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getViewWidth'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.ScrollPane:setPageY"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPageY'", nullptr); - return 0; - } - cobj->setPageY(arg0); - return 0; - } - if (argc == 2) { - int arg0; - bool arg1; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.ScrollPane:setPageY"); - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.ScrollPane:setPageY"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPageY'", nullptr); - return 0; - } - cobj->setPageY(arg0, arg1); - return 0; + if (argc == 0) { + double ret = cobj->getViewWidth(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setPageY",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getViewWidth",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setPageY'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getViewWidth'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_scrollTop(lua_State* tolua_S) +static int lua_fairygui_GComponent_getTransitions(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; - bool ok = true; + fairygui::GComponent* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_scrollTop'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getTransitions'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - cobj->scrollTop(); - return 0; - } - if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.ScrollPane:scrollTop"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollTop'", nullptr); - return 0; - } - cobj->scrollTop(arg0); - return 0; + const cocos2d::Vector& ret = cobj->getTransitions(); + ccvector_to_luaval(tolua_S, ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:scrollTop",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getTransitions",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_scrollTop'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getTransitions'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_isSnapToItem(lua_State* tolua_S) +static int lua_fairygui_GComponent_getViewHeight(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_isSnapToItem'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getViewHeight'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - bool ret = cobj->isSnapToItem(); - tolua_pushboolean(tolua_S,(bool)ret); + double ret = cobj->getViewHeight(); + tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:isSnapToItem",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getViewHeight",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_isSnapToItem'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getViewHeight'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_isTouchEffect(lua_State* tolua_S) +static int lua_fairygui_GComponent_ensureBoundsCorrect(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_isTouchEffect'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_ensureBoundsCorrect'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - bool ret = cobj->isTouchEffect(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; + cobj->ensureBoundsCorrect(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:isTouchEffect",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:ensureBoundsCorrect",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_isTouchEffect'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_ensureBoundsCorrect'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_setScrollStep(lua_State* tolua_S) +static int lua_fairygui_GComponent_isAncestorOf(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setScrollStep'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_isAncestorOf'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:setScrollStep"); + const fairygui::GObject* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GComponent:isAncestorOf"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setScrollStep'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_isAncestorOf'", nullptr); return 0; } - cobj->setScrollStep(arg0); - return 0; + bool ret = cobj->isAncestorOf(arg0); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setScrollStep",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:isAncestorOf",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setScrollStep'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_isAncestorOf'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_scrollBottom(lua_State* tolua_S) +static int lua_fairygui_GComponent_getChildren(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; - bool ok = true; + fairygui::GComponent* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_scrollBottom'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getChildren'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - cobj->scrollBottom(); - return 0; - } - if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.ScrollPane:scrollBottom"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollBottom'", nullptr); - return 0; - } - cobj->scrollBottom(arg0); - return 0; + const cocos2d::Vector& ret = cobj->getChildren(); + ccvector_to_luaval(tolua_S, ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:scrollBottom",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getChildren",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_scrollBottom'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getChildren'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_isChildInView(lua_State* tolua_S) +static int lua_fairygui_GComponent_getMask(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; - bool ok = true; + fairygui::GComponent* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_isChildInView'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getMask'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::GObject* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.ScrollPane:isChildInView"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_isChildInView'", nullptr); - return 0; - } - bool ret = cobj->isChildInView(arg0); - tolua_pushboolean(tolua_S,(bool)ret); + if (argc == 0) { + cocos2d::Node* ret = cobj->getMask(); + object_to_luaval(tolua_S, "cc.Node",(cocos2d::Node*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:isChildInView",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getMask",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_isChildInView'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getMask'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_isPageMode(lua_State* tolua_S) +static int lua_fairygui_GComponent_adjustRadioGroupDepth(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_isPageMode'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_adjustRadioGroupDepth'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - bool ret = cobj->isPageMode(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; + if (argc == 2) { + fairygui::GObject* arg0; + fairygui::GController* arg1; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GComponent:adjustRadioGroupDepth"); + ok &= luaval_to_object(tolua_S, 3, "fairygui.GController",&arg1, "fairygui.GComponent:adjustRadioGroupDepth"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_adjustRadioGroupDepth'", nullptr); + return 0; + } + cobj->adjustRadioGroupDepth(arg0, arg1); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:isPageMode",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:adjustRadioGroupDepth",argc, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_isPageMode'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_adjustRadioGroupDepth'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_setDecelerationRate(lua_State* tolua_S) +static int lua_fairygui_GComponent_getController(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setDecelerationRate'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getController'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:setDecelerationRate"); + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GComponent:getController"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setDecelerationRate'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_getController'", nullptr); return 0; } - cobj->setDecelerationRate(arg0); - return 0; + fairygui::GController* ret = cobj->getController(arg0); + object_to_luaval(tolua_S, "fairygui.GController",(fairygui::GController*)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setDecelerationRate",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getController",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setDecelerationRate'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getController'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_getScrollingPosY(lua_State* tolua_S) +static int lua_fairygui_GComponent_setApexIndex(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getScrollingPosY'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_setApexIndex'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - double ret = cobj->getScrollingPosY(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GComponent:setApexIndex"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_setApexIndex'", nullptr); + return 0; + } + cobj->setApexIndex(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getScrollingPosY",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:setApexIndex",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getScrollingPosY'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_setApexIndex'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_getScrollingPosX(lua_State* tolua_S) +static int lua_fairygui_GComponent_getTransition(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getScrollingPosX'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getTransition'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - double ret = cobj->getScrollingPosX(); - tolua_pushnumber(tolua_S,(lua_Number)ret); + if (argc == 1) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GComponent:getTransition"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_getTransition'", nullptr); + return 0; + } + fairygui::Transition* ret = cobj->getTransition(arg0); + object_to_luaval(tolua_S, "fairygui.Transition",(fairygui::Transition*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getScrollingPosX",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getTransition",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getScrollingPosX'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getTransition'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_getContentSize(lua_State* tolua_S) +static int lua_fairygui_GComponent_getFirstChildInView(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getContentSize'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getFirstChildInView'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - const cocos2d::Size& ret = cobj->getContentSize(); - size_to_luaval(tolua_S, ret); + int ret = cobj->getFirstChildInView(); + tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getContentSize",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getFirstChildInView",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getContentSize'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getFirstChildInView'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_isRightMost(lua_State* tolua_S) +static int lua_fairygui_GComponent_isChildInView(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_isRightMost'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_isChildInView'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - bool ret = cobj->isRightMost(); + if (argc == 1) { + fairygui::GObject* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GComponent:isChildInView"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_isChildInView'", nullptr); + return 0; + } + bool ret = cobj->isChildInView(arg0); tolua_pushboolean(tolua_S,(bool)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:isRightMost",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:isChildInView",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_isRightMost'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_isChildInView'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_setPageController(lua_State* tolua_S) +static int lua_fairygui_GComponent_setBoundsChangedFlag(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; - bool ok = true; + fairygui::GComponent* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setPageController'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_setBoundsChangedFlag'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::GController* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GController",&arg0, "fairygui.ScrollPane:setPageController"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPageController'", nullptr); - return 0; - } - cobj->setPageController(arg0); - return 0; + if (argc == 0) { + cobj->setBoundsChangedFlag(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setPageController",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:setBoundsChangedFlag",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setPageController'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_setBoundsChangedFlag'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_lockHeader(lua_State* tolua_S) +static int lua_fairygui_GComponent_addChildAt(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_lockHeader'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_addChildAt'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.ScrollPane:lockHeader"); + if (argc == 2) { + fairygui::GObject* arg0; + int arg1; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GComponent:addChildAt"); + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GComponent:addChildAt"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_lockHeader'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_addChildAt'", nullptr); return 0; } - cobj->lockHeader(arg0); - return 0; + fairygui::GObject* ret = cobj->addChildAt(arg0, arg1); + object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:lockHeader",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:addChildAt",argc, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_lockHeader'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_addChildAt'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_lockFooter(lua_State* tolua_S) +static int lua_fairygui_GComponent_removeChildren(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_lockFooter'", nullptr); + if (!cobj){ + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_removeChildren'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { + if (argc == 0) { + cobj->removeChildren(); + return 0; + } + if (argc == 2) { int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.ScrollPane:lockFooter"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_lockFooter'", nullptr); - return 0; - } - cobj->lockFooter(arg0); - return 0; + int arg1; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GComponent:removeChildren"); + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GComponent:removeChildren"); + cobj->removeChildren(arg0, arg1); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:lockFooter",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:removeChildren",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_lockFooter'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_removeChildren'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_scrollDown(lua_State* tolua_S) +static int lua_fairygui_GComponent_removeChildAt(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_scrollDown'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_removeChildAt'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->scrollDown(); - return 0; - } if (argc == 1) { - double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:scrollDown"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollDown'", nullptr); - return 0; - } - cobj->scrollDown(arg0); - return 0; - } - if (argc == 2) { - double arg0; - bool arg1; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:scrollDown"); - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.ScrollPane:scrollDown"); + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GComponent:removeChildAt"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollDown'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_removeChildAt'", nullptr); return 0; } - cobj->scrollDown(arg0, arg1); - return 0; + cobj->removeChildAt(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:scrollDown",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:removeChildAt",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_scrollDown'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_removeChildAt'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_setSnapToItem(lua_State* tolua_S) +static int lua_fairygui_GComponent_getChild(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setSnapToItem'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getChild'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.ScrollPane:setSnapToItem"); + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GComponent:getChild"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setSnapToItem'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_getChild'", nullptr); return 0; } - cobj->setSnapToItem(arg0); - return 0; + fairygui::GObject* ret = cobj->getChild(arg0); + object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setSnapToItem",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getChild",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setSnapToItem'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getChild'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_getScrollStep(lua_State* tolua_S) +static int lua_fairygui_GComponent_addController(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getScrollStep'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_addController'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - double ret = cobj->getScrollStep(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + if (argc == 1) { + fairygui::GController* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GController",&arg0, "fairygui.GComponent:addController"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_addController'", nullptr); + return 0; + } + cobj->addController(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getScrollStep",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:addController",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getScrollStep'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_addController'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_getPageX(lua_State* tolua_S) +static int lua_fairygui_GComponent_childSortingOrderChanged(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getPageX'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_childSortingOrderChanged'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - int ret = cobj->getPageX(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + if (argc == 3) { + fairygui::GObject* arg0; + int arg1; + int arg2; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GComponent:childSortingOrderChanged"); + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GComponent:childSortingOrderChanged"); + ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "fairygui.GComponent:childSortingOrderChanged"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_childSortingOrderChanged'", nullptr); + return 0; + } + cobj->childSortingOrderChanged(arg0, arg1, arg2); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getPageX",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:childSortingOrderChanged",argc, 3); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getPageX'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_childSortingOrderChanged'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_scrollLeft(lua_State* tolua_S) +static int lua_fairygui_GComponent_applyController(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_scrollLeft'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_applyController'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->scrollLeft(); - return 0; - } if (argc == 1) { - double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:scrollLeft"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollLeft'", nullptr); - return 0; - } - cobj->scrollLeft(arg0); - return 0; - } - if (argc == 2) { - double arg0; - bool arg1; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:scrollLeft"); - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.ScrollPane:scrollLeft"); + fairygui::GController* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GController",&arg0, "fairygui.GComponent:applyController"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollLeft'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_applyController'", nullptr); return 0; } - cobj->scrollLeft(arg0, arg1); - return 0; + cobj->applyController(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:scrollLeft",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:applyController",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_scrollLeft'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_applyController'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_getViewSize(lua_State* tolua_S) +static int lua_fairygui_GComponent_getControllers(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getViewSize'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getControllers'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - const cocos2d::Size& ret = cobj->getViewSize(); - size_to_luaval(tolua_S, ret); + const cocos2d::Vector& ret = cobj->getControllers(); + ccvector_to_luaval(tolua_S, ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getViewSize",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getControllers",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getViewSize'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getControllers'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_setInertiaDisabled(lua_State* tolua_S) +static int lua_fairygui_GComponent_setMask(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setInertiaDisabled'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_setMask'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.ScrollPane:setInertiaDisabled"); + cocos2d::Node* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "fairygui.GComponent:setMask"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setInertiaDisabled'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_setMask'", nullptr); return 0; } - cobj->setInertiaDisabled(arg0); - return 0; + cobj->setMask(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setInertiaDisabled",argc, 1); + if (argc == 2) { + cocos2d::Node* arg0; + bool arg1; + ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "fairygui.GComponent:setMask"); + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.GComponent:setMask"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_setMask'", nullptr); + return 0; + } + cobj->setMask(arg0, arg1); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:setMask",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setInertiaDisabled'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_setMask'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_getPageController(lua_State* tolua_S) +static int lua_fairygui_GComponent_setChildIndex(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getPageController'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_setChildIndex'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GController* ret = cobj->getPageController(); - object_to_luaval(tolua_S, "fairygui.GController",(fairygui::GController*)ret); - return 1; + if (argc == 2) { + fairygui::GObject* arg0; + int arg1; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GComponent:setChildIndex"); + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GComponent:setChildIndex"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_setChildIndex'", nullptr); + return 0; + } + cobj->setChildIndex(arg0, arg1); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getPageController",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:setChildIndex",argc, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getPageController'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_setChildIndex'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_setPageX(lua_State* tolua_S) +static int lua_fairygui_GComponent_setViewWidth(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setPageX'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_setViewWidth'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.ScrollPane:setPageX"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPageX'", nullptr); - return 0; - } - cobj->setPageX(arg0); - return 0; - } - if (argc == 2) { - int arg0; - bool arg1; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.ScrollPane:setPageX"); - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.ScrollPane:setPageX"); + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GComponent:setViewWidth"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPageX'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_setViewWidth'", nullptr); return 0; } - cobj->setPageX(arg0, arg1); - return 0; + cobj->setViewWidth(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setPageX",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:setViewWidth",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setPageX'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_setViewWidth'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_scrollUp(lua_State* tolua_S) +static int lua_fairygui_GComponent_getChildById(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_scrollUp'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getChildById'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->scrollUp(); - return 0; - } if (argc == 1) { - double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:scrollUp"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollUp'", nullptr); - return 0; - } - cobj->scrollUp(arg0); - return 0; - } - if (argc == 2) { - double arg0; - bool arg1; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:scrollUp"); - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.ScrollPane:scrollUp"); + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GComponent:getChildById"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollUp'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_getChildById'", nullptr); return 0; } - cobj->scrollUp(arg0, arg1); - return 0; + fairygui::GObject* ret = cobj->getChildById(arg0); + object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:scrollUp",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getChildById",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_scrollUp'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getChildById'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_isMouseWheelEnabled(lua_State* tolua_S) +static int lua_fairygui_GComponent_getChildByPath(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_isMouseWheelEnabled'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getChildByPath'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - bool ret = cobj->isMouseWheelEnabled(); - tolua_pushboolean(tolua_S,(bool)ret); + if (argc == 1) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GComponent:getChildByPath"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_getChildByPath'", nullptr); + return 0; + } + fairygui::GObject* ret = cobj->getChildByPath(arg0); + object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:isMouseWheelEnabled",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getChildByPath",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_isMouseWheelEnabled'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getChildByPath'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_setPageMode(lua_State* tolua_S) +static int lua_fairygui_GComponent_getChildIndex(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setPageMode'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getChildIndex'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.ScrollPane:setPageMode"); + const fairygui::GObject* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GComponent:getChildIndex"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPageMode'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_getChildIndex'", nullptr); return 0; } - cobj->setPageMode(arg0); - return 0; + int ret = cobj->getChildIndex(arg0); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setPageMode",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getChildIndex",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setPageMode'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getChildIndex'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_setTouchEffect(lua_State* tolua_S) +static int lua_fairygui_GComponent_getMargin(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; - bool ok = true; + fairygui::GComponent* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setTouchEffect'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getMargin'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.ScrollPane:setTouchEffect"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setTouchEffect'", nullptr); - return 0; - } - cobj->setTouchEffect(arg0); - return 0; + if (argc == 0) { + const fairygui::Margin& ret = cobj->getMargin(); + margin_to_luaval(tolua_S, ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setTouchEffect",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getMargin",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setTouchEffect'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getMargin'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_setMouseWheelEnabled(lua_State* tolua_S) +static int lua_fairygui_GComponent_getControllerAt(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setMouseWheelEnabled'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getControllerAt'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.ScrollPane:setMouseWheelEnabled"); + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GComponent:getControllerAt"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setMouseWheelEnabled'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_getControllerAt'", nullptr); return 0; } - cobj->setMouseWheelEnabled(arg0); - return 0; + fairygui::GController* ret = cobj->getControllerAt(arg0); + object_to_luaval(tolua_S, "fairygui.GController",(fairygui::GController*)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setMouseWheelEnabled",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getControllerAt",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setMouseWheelEnabled'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getControllerAt'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_isInertiaDisabled(lua_State* tolua_S) +static int lua_fairygui_GComponent_getChildAt(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_isInertiaDisabled'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getChildAt'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - bool ret = cobj->isInertiaDisabled(); - tolua_pushboolean(tolua_S,(bool)ret); + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GComponent:getChildAt"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_getChildAt'", nullptr); + return 0; + } + fairygui::GObject* ret = cobj->getChildAt(arg0); + object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:isInertiaDisabled",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getChildAt",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_isInertiaDisabled'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getChildAt'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_setPercX(lua_State* tolua_S) +static int lua_fairygui_GComponent_getApexIndex(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; - bool ok = true; + fairygui::GComponent* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setPercX'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getApexIndex'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:setPercX"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPercX'", nullptr); - return 0; - } - cobj->setPercX(arg0); - return 0; - } - if (argc == 2) { - double arg0; - bool arg1; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:setPercX"); - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.ScrollPane:setPercX"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPercX'", nullptr); - return 0; - } - cobj->setPercX(arg0, arg1); - return 0; + if (argc == 0) { + int ret = cobj->getApexIndex(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setPercX",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getApexIndex",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setPercX'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getApexIndex'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_setPercY(lua_State* tolua_S) +static int lua_fairygui_GComponent_setMargin(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setPercY'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_setMargin'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:setPercY"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPercY'", nullptr); - return 0; - } - cobj->setPercY(arg0); - return 0; - } - if (argc == 2) { - double arg0; - bool arg1; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:setPercY"); - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.ScrollPane:setPercY"); + fairygui::Margin arg0; + ok &= luaval_to_margin(tolua_S, 2, &arg0, "fairygui.GComponent:setMargin"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPercY'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_setMargin'", nullptr); return 0; } - cobj->setPercY(arg0, arg1); - return 0; + cobj->setMargin(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setPercY",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:setMargin",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setPercY'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_setMargin'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_cancelDragging(lua_State* tolua_S) +static int lua_fairygui_GComponent_getScrollPane(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_cancelDragging'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getScrollPane'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - cobj->cancelDragging(); - return 0; + fairygui::ScrollPane* ret = cobj->getScrollPane(); + object_to_luaval(tolua_S, "fairygui.ScrollPane",(fairygui::ScrollPane*)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:cancelDragging",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getScrollPane",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_cancelDragging'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getScrollPane'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_getPercY(lua_State* tolua_S) +static int lua_fairygui_GComponent_getTransitionAt(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getPercY'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getTransitionAt'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - double ret = cobj->getPercY(); - tolua_pushnumber(tolua_S,(lua_Number)ret); + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GComponent:getTransitionAt"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_getTransitionAt'", nullptr); + return 0; + } + fairygui::Transition* ret = cobj->getTransitionAt(arg0); + object_to_luaval(tolua_S, "fairygui.Transition",(fairygui::Transition*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getPercY",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getTransitionAt",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getPercY'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getTransitionAt'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_scrollRight(lua_State* tolua_S) +static int lua_fairygui_GComponent_getChildInGroup(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_scrollRight'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getChildInGroup'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->scrollRight(); - return 0; - } - if (argc == 1) { - double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:scrollRight"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollRight'", nullptr); - return 0; - } - cobj->scrollRight(arg0); - return 0; - } if (argc == 2) { - double arg0; - bool arg1; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:scrollRight"); - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.ScrollPane:scrollRight"); + const fairygui::GGroup* arg0; + std::string arg1; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GGroup",&arg0, "fairygui.GComponent:getChildInGroup"); + ok &= luaval_to_std_string(tolua_S, 3,&arg1, "fairygui.GComponent:getChildInGroup"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_scrollRight'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_getChildInGroup'", nullptr); return 0; } - cobj->scrollRight(arg0, arg1); - return 0; + fairygui::GObject* ret = cobj->getChildInGroup(arg0, arg1); + object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:scrollRight",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getChildInGroup",argc, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_scrollRight'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getChildInGroup'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_getHeader(lua_State* tolua_S) +static int lua_fairygui_GComponent_removeController(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getHeader'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_removeController'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GComponent* ret = cobj->getHeader(); - object_to_luaval(tolua_S, "fairygui.GComponent",(fairygui::GComponent*)ret); - return 1; + if (argc == 1) { + fairygui::GController* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GController",&arg0, "fairygui.GComponent:removeController"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_removeController'", nullptr); + return 0; + } + cobj->removeController(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getHeader",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:removeController",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getHeader'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_removeController'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_getVtScrollBar(lua_State* tolua_S) +static int lua_fairygui_GComponent_getSnappingPosition(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getVtScrollBar'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getSnappingPosition'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GScrollBar* ret = cobj->getVtScrollBar(); - object_to_luaval(tolua_S, "fairygui.GScrollBar",(fairygui::GScrollBar*)ret); + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + cocos2d::Vec2 arg0; + ok &= luaval_to_vec2(tolua_S, 2, &arg0, "fairygui.GComponent:getSnappingPosition"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_getSnappingPosition'", nullptr); + return 0; + } + cocos2d::Vec2 ret = cobj->getSnappingPosition(arg0); + vec2_to_luaval(tolua_S, ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getVtScrollBar",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getSnappingPosition",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getVtScrollBar'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getSnappingPosition'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_getOwner(lua_State* tolua_S) +static int lua_fairygui_GComponent_setChildIndexBefore(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getOwner'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_setChildIndexBefore'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GComponent* ret = cobj->getOwner(); - object_to_luaval(tolua_S, "fairygui.GComponent",(fairygui::GComponent*)ret); + if (argc == 2) { + fairygui::GObject* arg0; + int arg1; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GComponent:setChildIndexBefore"); + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GComponent:setChildIndexBefore"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_setChildIndexBefore'", nullptr); + return 0; + } + int ret = cobj->setChildIndexBefore(arg0, arg1); + tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getOwner",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:setChildIndexBefore",argc, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getOwner'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_setChildIndexBefore'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_isBottomMost(lua_State* tolua_S) +static int lua_fairygui_GComponent_setHitArea(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_isBottomMost'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_setHitArea'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - bool ret = cobj->isBottomMost(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; + if (argc == 1) { + fairygui::IHitTest* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.IHitTest",&arg0, "fairygui.GComponent:setHitArea"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_setHitArea'", nullptr); + return 0; + } + cobj->setHitArea(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:isBottomMost",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:setHitArea",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_isBottomMost'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_setHitArea'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_getPageY(lua_State* tolua_S) +static int lua_fairygui_GComponent_swapChildrenAt(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_getPageY'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_swapChildrenAt'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - int ret = cobj->getPageY(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + if (argc == 2) { + int arg0; + int arg1; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GComponent:swapChildrenAt"); + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GComponent:swapChildrenAt"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_swapChildrenAt'", nullptr); + return 0; + } + cobj->swapChildrenAt(arg0, arg1); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:getPageY",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:swapChildrenAt",argc, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getPageY'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_swapChildrenAt'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_isBouncebackEffect(lua_State* tolua_S) +static int lua_fairygui_GComponent_numChildren(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_isBouncebackEffect'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_numChildren'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - bool ret = cobj->isBouncebackEffect(); - tolua_pushboolean(tolua_S,(bool)ret); + int ret = cobj->numChildren(); + tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:isBouncebackEffect",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:numChildren",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_isBouncebackEffect'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_numChildren'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_ScrollPane_setPosY(lua_State* tolua_S) +static int lua_fairygui_GComponent_removeChild(lua_State* tolua_S) { int argc = 0; - fairygui::ScrollPane* cobj = nullptr; + fairygui::GComponent* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::ScrollPane*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_ScrollPane_setPosY'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_removeChild'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:setPosY"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPosY'", nullptr); - return 0; - } - cobj->setPosY(arg0); - return 0; - } - if (argc == 2) { - double arg0; - bool arg1; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.ScrollPane:setPosY"); - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.ScrollPane:setPosY"); + fairygui::GObject* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GComponent:removeChild"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_ScrollPane_setPosY'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_removeChild'", nullptr); return 0; } - cobj->setPosY(arg0, arg1); - return 0; + cobj->removeChild(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.ScrollPane:setPosY",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:removeChild",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_setPosY'.",&tolua_err); - return 0; -#endif -} - -static int lua_fairygui_ScrollPane_getDraggingPane(lua_State* tolua_S) -{ - int argc = 0; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.ScrollPane",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - if (argc == 0){ - fairygui::ScrollPane* ret = fairygui::ScrollPane::getDraggingPane(); - object_to_luaval(tolua_S, "fairygui.ScrollPane",(fairygui::ScrollPane*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.ScrollPane:getDraggingPane",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_ScrollPane_getDraggingPane'.",&tolua_err); - return 0; -#endif -} - -static int lua_register_fairygui_ScrollPane(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.ScrollPane"); - tolua_cclass(tolua_S,"ScrollPane","fairygui.ScrollPane","cc.Ref",nullptr); - - tolua_beginmodule(tolua_S,"ScrollPane"); - tolua_function(tolua_S,"setBouncebackEffect",lua_fairygui_ScrollPane_setBouncebackEffect); - tolua_function(tolua_S,"getHzScrollBar",lua_fairygui_ScrollPane_getHzScrollBar); - tolua_function(tolua_S,"scrollToView",lua_fairygui_ScrollPane_scrollToView); - tolua_function(tolua_S,"getDecelerationRate",lua_fairygui_ScrollPane_getDecelerationRate); - tolua_function(tolua_S,"getPercX",lua_fairygui_ScrollPane_getPercX); - tolua_function(tolua_S,"getPosY",lua_fairygui_ScrollPane_getPosY); - tolua_function(tolua_S,"getFooter",lua_fairygui_ScrollPane_getFooter); - tolua_function(tolua_S,"setPosX",lua_fairygui_ScrollPane_setPosX); - tolua_function(tolua_S,"getPosX",lua_fairygui_ScrollPane_getPosX); - tolua_function(tolua_S,"setPageY",lua_fairygui_ScrollPane_setPageY); - tolua_function(tolua_S,"scrollTop",lua_fairygui_ScrollPane_scrollTop); - tolua_function(tolua_S,"isSnapToItem",lua_fairygui_ScrollPane_isSnapToItem); - tolua_function(tolua_S,"isTouchEffect",lua_fairygui_ScrollPane_isTouchEffect); - tolua_function(tolua_S,"setScrollStep",lua_fairygui_ScrollPane_setScrollStep); - tolua_function(tolua_S,"scrollBottom",lua_fairygui_ScrollPane_scrollBottom); - tolua_function(tolua_S,"isChildInView",lua_fairygui_ScrollPane_isChildInView); - tolua_function(tolua_S,"isPageMode",lua_fairygui_ScrollPane_isPageMode); - tolua_function(tolua_S,"setDecelerationRate",lua_fairygui_ScrollPane_setDecelerationRate); - tolua_function(tolua_S,"getScrollingPosY",lua_fairygui_ScrollPane_getScrollingPosY); - tolua_function(tolua_S,"getScrollingPosX",lua_fairygui_ScrollPane_getScrollingPosX); - tolua_function(tolua_S,"getContentSize",lua_fairygui_ScrollPane_getContentSize); - tolua_function(tolua_S,"isRightMost",lua_fairygui_ScrollPane_isRightMost); - tolua_function(tolua_S,"setPageController",lua_fairygui_ScrollPane_setPageController); - tolua_function(tolua_S,"lockHeader",lua_fairygui_ScrollPane_lockHeader); - tolua_function(tolua_S,"lockFooter",lua_fairygui_ScrollPane_lockFooter); - tolua_function(tolua_S,"scrollDown",lua_fairygui_ScrollPane_scrollDown); - tolua_function(tolua_S,"setSnapToItem",lua_fairygui_ScrollPane_setSnapToItem); - tolua_function(tolua_S,"getScrollStep",lua_fairygui_ScrollPane_getScrollStep); - tolua_function(tolua_S,"getPageX",lua_fairygui_ScrollPane_getPageX); - tolua_function(tolua_S,"scrollLeft",lua_fairygui_ScrollPane_scrollLeft); - tolua_function(tolua_S,"getViewSize",lua_fairygui_ScrollPane_getViewSize); - tolua_function(tolua_S,"setInertiaDisabled",lua_fairygui_ScrollPane_setInertiaDisabled); - tolua_function(tolua_S,"getPageController",lua_fairygui_ScrollPane_getPageController); - tolua_function(tolua_S,"setPageX",lua_fairygui_ScrollPane_setPageX); - tolua_function(tolua_S,"scrollUp",lua_fairygui_ScrollPane_scrollUp); - tolua_function(tolua_S,"isMouseWheelEnabled",lua_fairygui_ScrollPane_isMouseWheelEnabled); - tolua_function(tolua_S,"setPageMode",lua_fairygui_ScrollPane_setPageMode); - tolua_function(tolua_S,"setTouchEffect",lua_fairygui_ScrollPane_setTouchEffect); - tolua_function(tolua_S,"setMouseWheelEnabled",lua_fairygui_ScrollPane_setMouseWheelEnabled); - tolua_function(tolua_S,"isInertiaDisabled",lua_fairygui_ScrollPane_isInertiaDisabled); - tolua_function(tolua_S,"setPercX",lua_fairygui_ScrollPane_setPercX); - tolua_function(tolua_S,"setPercY",lua_fairygui_ScrollPane_setPercY); - tolua_function(tolua_S,"cancelDragging",lua_fairygui_ScrollPane_cancelDragging); - tolua_function(tolua_S,"getPercY",lua_fairygui_ScrollPane_getPercY); - tolua_function(tolua_S,"scrollRight",lua_fairygui_ScrollPane_scrollRight); - tolua_function(tolua_S,"getHeader",lua_fairygui_ScrollPane_getHeader); - tolua_function(tolua_S,"getVtScrollBar",lua_fairygui_ScrollPane_getVtScrollBar); - tolua_function(tolua_S,"getOwner",lua_fairygui_ScrollPane_getOwner); - tolua_function(tolua_S,"isBottomMost",lua_fairygui_ScrollPane_isBottomMost); - tolua_function(tolua_S,"getPageY",lua_fairygui_ScrollPane_getPageY); - tolua_function(tolua_S,"isBouncebackEffect",lua_fairygui_ScrollPane_isBouncebackEffect); - tolua_function(tolua_S,"setPosY",lua_fairygui_ScrollPane_setPosY); - tolua_function(tolua_S,"getDraggingPane", lua_fairygui_ScrollPane_getDraggingPane); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::ScrollPane).name(); - g_luaType[typeName] = "fairygui.ScrollPane"; - g_typeCast["ScrollPane"] = "fairygui.ScrollPane"; - return 1; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_removeChild'.",&tolua_err); + return 0; +#endif } -static int lua_fairygui_GComponent_addChild(lua_State* tolua_S) +static int lua_fairygui_GComponent_swapChildren(lua_State* tolua_S) { int argc = 0; fairygui::GComponent* cobj = nullptr; @@ -13412,37 +16003,39 @@ static int lua_fairygui_GComponent_addChild(lua_State* tolua_S) cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_addChild'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_swapChildren'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { + if (argc == 2) { fairygui::GObject* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GComponent:addChild"); + fairygui::GObject* arg1; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GComponent:swapChildren"); + ok &= luaval_to_object(tolua_S, 3, "fairygui.GObject",&arg1, "fairygui.GComponent:swapChildren"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_addChild'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_swapChildren'", nullptr); return 0; } - fairygui::GObject* ret = cobj->addChild(arg0); - object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); - return 1; + cobj->swapChildren(arg0, arg1); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:addChild",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:swapChildren",argc, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_addChild'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_swapChildren'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_getHitArea(lua_State* tolua_S) +static int lua_fairygui_GComponent_childStateChanged(lua_State* tolua_S) { int argc = 0; fairygui::GComponent* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; @@ -13451,28 +16044,33 @@ static int lua_fairygui_GComponent_getHitArea(lua_State* tolua_S) cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getHitArea'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_childStateChanged'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::IHitTest* ret = cobj->getHitArea(); - object_to_luaval(tolua_S, "fairygui.IHitTest",(fairygui::IHitTest*)ret); - return 1; + if (argc == 1) { + fairygui::GObject* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GComponent:childStateChanged"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_childStateChanged'", nullptr); + return 0; + } + cobj->childStateChanged(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getHitArea",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:childStateChanged",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getHitArea'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_childStateChanged'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_applyAllControllers(lua_State* tolua_S) +static int lua_fairygui_GComponent_getChildrenRenderOrder(lua_State* tolua_S) { int argc = 0; fairygui::GComponent* cobj = nullptr; @@ -13484,30 +16082,32 @@ static int lua_fairygui_GComponent_applyAllControllers(lua_State* tolua_S) cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_applyAllControllers'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getChildrenRenderOrder'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - cobj->applyAllControllers(); - return 0; + int ret = (int)cobj->getChildrenRenderOrder(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:applyAllControllers",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getChildrenRenderOrder",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_applyAllControllers'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getChildrenRenderOrder'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_getOpaque(lua_State* tolua_S) +static int lua_fairygui_GComponent_setViewHeight(lua_State* tolua_S) { int argc = 0; fairygui::GComponent* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; @@ -13516,80 +16116,171 @@ static int lua_fairygui_GComponent_getOpaque(lua_State* tolua_S) cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getOpaque'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_setViewHeight'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - bool ret = cobj->getOpaque(); - tolua_pushboolean(tolua_S,(bool)ret); + if (argc == 1) { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GComponent:setViewHeight"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_setViewHeight'", nullptr); + return 0; + } + cobj->setViewHeight(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:setViewHeight",argc, 1); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_setViewHeight'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_GComponent_create(lua_State* tolua_S) +{ + int argc = 0; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertable(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; +#endif + + argc = lua_gettop(tolua_S) - 1; + if (argc == 0){ + fairygui::GComponent* ret = fairygui::GComponent::create(); + object_to_luaval(tolua_S, "fairygui.GComponent",(fairygui::GComponent*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getOpaque",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GComponent:create",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getOpaque'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_create'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_setChildrenRenderOrder(lua_State* tolua_S) +static int lua_register_fairygui_GComponent(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"fairygui.GComponent"); + tolua_cclass(tolua_S,"GComponent","fairygui.GComponent","fairygui.GObject",nullptr); + + tolua_beginmodule(tolua_S,"GComponent"); + tolua_function(tolua_S,"addChild",lua_fairygui_GComponent_addChild); + tolua_function(tolua_S,"getHitArea",lua_fairygui_GComponent_getHitArea); + tolua_function(tolua_S,"applyAllControllers",lua_fairygui_GComponent_applyAllControllers); + tolua_function(tolua_S,"getOpaque",lua_fairygui_GComponent_getOpaque); + tolua_function(tolua_S,"setChildrenRenderOrder",lua_fairygui_GComponent_setChildrenRenderOrder); + tolua_function(tolua_S,"setOpaque",lua_fairygui_GComponent_setOpaque); + tolua_function(tolua_S,"getViewWidth",lua_fairygui_GComponent_getViewWidth); + tolua_function(tolua_S,"getTransitions",lua_fairygui_GComponent_getTransitions); + tolua_function(tolua_S,"getViewHeight",lua_fairygui_GComponent_getViewHeight); + tolua_function(tolua_S,"ensureBoundsCorrect",lua_fairygui_GComponent_ensureBoundsCorrect); + tolua_function(tolua_S,"isAncestorOf",lua_fairygui_GComponent_isAncestorOf); + tolua_function(tolua_S,"getChildren",lua_fairygui_GComponent_getChildren); + tolua_function(tolua_S,"getMask",lua_fairygui_GComponent_getMask); + tolua_function(tolua_S,"adjustRadioGroupDepth",lua_fairygui_GComponent_adjustRadioGroupDepth); + tolua_function(tolua_S,"getController",lua_fairygui_GComponent_getController); + tolua_function(tolua_S,"setApexIndex",lua_fairygui_GComponent_setApexIndex); + tolua_function(tolua_S,"getTransition",lua_fairygui_GComponent_getTransition); + tolua_function(tolua_S,"getFirstChildInView",lua_fairygui_GComponent_getFirstChildInView); + tolua_function(tolua_S,"isChildInView",lua_fairygui_GComponent_isChildInView); + tolua_function(tolua_S,"setBoundsChangedFlag",lua_fairygui_GComponent_setBoundsChangedFlag); + tolua_function(tolua_S,"addChildAt",lua_fairygui_GComponent_addChildAt); + tolua_function(tolua_S,"removeChildren",lua_fairygui_GComponent_removeChildren); + tolua_function(tolua_S,"removeChildAt",lua_fairygui_GComponent_removeChildAt); + tolua_function(tolua_S,"getChild",lua_fairygui_GComponent_getChild); + tolua_function(tolua_S,"addController",lua_fairygui_GComponent_addController); + tolua_function(tolua_S,"childSortingOrderChanged",lua_fairygui_GComponent_childSortingOrderChanged); + tolua_function(tolua_S,"applyController",lua_fairygui_GComponent_applyController); + tolua_function(tolua_S,"getControllers",lua_fairygui_GComponent_getControllers); + tolua_function(tolua_S,"setMask",lua_fairygui_GComponent_setMask); + tolua_function(tolua_S,"setChildIndex",lua_fairygui_GComponent_setChildIndex); + tolua_function(tolua_S,"setViewWidth",lua_fairygui_GComponent_setViewWidth); + tolua_function(tolua_S,"getChildById",lua_fairygui_GComponent_getChildById); + tolua_function(tolua_S,"getChildByPath",lua_fairygui_GComponent_getChildByPath); + tolua_function(tolua_S,"getChildIndex",lua_fairygui_GComponent_getChildIndex); + tolua_function(tolua_S,"getMargin",lua_fairygui_GComponent_getMargin); + tolua_function(tolua_S,"getControllerAt",lua_fairygui_GComponent_getControllerAt); + tolua_function(tolua_S,"getChildAt",lua_fairygui_GComponent_getChildAt); + tolua_function(tolua_S,"getApexIndex",lua_fairygui_GComponent_getApexIndex); + tolua_function(tolua_S,"setMargin",lua_fairygui_GComponent_setMargin); + tolua_function(tolua_S,"getScrollPane",lua_fairygui_GComponent_getScrollPane); + tolua_function(tolua_S,"getTransitionAt",lua_fairygui_GComponent_getTransitionAt); + tolua_function(tolua_S,"getChildInGroup",lua_fairygui_GComponent_getChildInGroup); + tolua_function(tolua_S,"removeController",lua_fairygui_GComponent_removeController); + tolua_function(tolua_S,"getSnappingPosition",lua_fairygui_GComponent_getSnappingPosition); + tolua_function(tolua_S,"setChildIndexBefore",lua_fairygui_GComponent_setChildIndexBefore); + tolua_function(tolua_S,"setHitArea",lua_fairygui_GComponent_setHitArea); + tolua_function(tolua_S,"swapChildrenAt",lua_fairygui_GComponent_swapChildrenAt); + tolua_function(tolua_S,"numChildren",lua_fairygui_GComponent_numChildren); + tolua_function(tolua_S,"removeChild",lua_fairygui_GComponent_removeChild); + tolua_function(tolua_S,"swapChildren",lua_fairygui_GComponent_swapChildren); + tolua_function(tolua_S,"childStateChanged",lua_fairygui_GComponent_childStateChanged); + tolua_function(tolua_S,"getChildrenRenderOrder",lua_fairygui_GComponent_getChildrenRenderOrder); + tolua_function(tolua_S,"setViewHeight",lua_fairygui_GComponent_setViewHeight); + tolua_function(tolua_S,"create", lua_fairygui_GComponent_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::GComponent).name(); + g_luaType[typeName] = "fairygui.GComponent"; + g_typeCast["GComponent"] = "fairygui.GComponent"; + return 1; +} + +static int lua_fairygui_GButton_getRelatedController(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; - bool ok = true; + fairygui::GButton* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_setChildrenRenderOrder'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_getRelatedController'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::ChildrenRenderOrder arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GComponent:setChildrenRenderOrder"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_setChildrenRenderOrder'", nullptr); - return 0; - } - cobj->setChildrenRenderOrder(arg0); - return 0; + if (argc == 0) { + fairygui::GController* ret = cobj->getRelatedController(); + object_to_luaval(tolua_S, "fairygui.GController",(fairygui::GController*)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:setChildrenRenderOrder",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:getRelatedController",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_setChildrenRenderOrder'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_getRelatedController'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_setOpaque(lua_State* tolua_S) +static int lua_fairygui_GButton_setChangeStateOnClick(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GButton* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_setOpaque'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_setChangeStateOnClick'", nullptr); return 0; } #endif @@ -13597,395 +16288,392 @@ static int lua_fairygui_GComponent_setOpaque(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GComponent:setOpaque"); + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GButton:setChangeStateOnClick"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_setOpaque'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GButton_setChangeStateOnClick'", nullptr); return 0; } - cobj->setOpaque(arg0); - return 0; + cobj->setChangeStateOnClick(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:setOpaque",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:setChangeStateOnClick",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_setOpaque'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_setChangeStateOnClick'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_getViewWidth(lua_State* tolua_S) +static int lua_fairygui_GButton_setSelectedTitle(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GButton* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getViewWidth'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_setSelectedTitle'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GButton:setSelectedTitle"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GButton_setSelectedTitle'", nullptr); + return 0; + } + cobj->setSelectedTitle(arg0); return 0; } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - double ret = cobj->getViewWidth(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getViewWidth",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:setSelectedTitle",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getViewWidth'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_setSelectedTitle'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_getTransitions(lua_State* tolua_S) +static int lua_fairygui_GButton_setSelected(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GButton* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getTransitions'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_setSelected'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - const cocos2d::Vector& ret = cobj->getTransitions(); - ccvector_to_luaval(tolua_S, ret); - return 1; + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GButton:setSelected"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GButton_setSelected'", nullptr); + return 0; + } + cobj->setSelected(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getTransitions",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:setSelected",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getTransitions'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_setSelected'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_getViewHeight(lua_State* tolua_S) +static int lua_fairygui_GButton_setRelatedController(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GButton* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getViewHeight'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_setRelatedController'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - double ret = cobj->getViewHeight(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + if (argc == 1) { + fairygui::GController* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GController",&arg0, "fairygui.GButton:setRelatedController"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GButton_setRelatedController'", nullptr); + return 0; + } + cobj->setRelatedController(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getViewHeight",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:setRelatedController",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getViewHeight'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_setRelatedController'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_ensureBoundsCorrect(lua_State* tolua_S) +static int lua_fairygui_GButton_setTitle(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GButton* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_ensureBoundsCorrect'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_setTitle'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->ensureBoundsCorrect(); - return 0; + if (argc == 1) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GButton:setTitle"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GButton_setTitle'", nullptr); + return 0; + } + cobj->setTitle(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:ensureBoundsCorrect",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:setTitle",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_ensureBoundsCorrect'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_setTitle'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_isAncestorOf(lua_State* tolua_S) +static int lua_fairygui_GButton_getTitleFontSize(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; - bool ok = true; + fairygui::GButton* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_isAncestorOf'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_getTitleFontSize'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - const fairygui::GObject* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GComponent:isAncestorOf"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_isAncestorOf'", nullptr); - return 0; - } - bool ret = cobj->isAncestorOf(arg0); - tolua_pushboolean(tolua_S,(bool)ret); + if (argc == 0) { + int ret = cobj->getTitleFontSize(); + tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:isAncestorOf",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:getTitleFontSize",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_isAncestorOf'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_getTitleFontSize'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_getChildren(lua_State* tolua_S) +static int lua_fairygui_GButton_getSelectedIcon(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GButton* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getChildren'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_getSelectedIcon'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - const cocos2d::Vector& ret = cobj->getChildren(); - ccvector_to_luaval(tolua_S, ret); + const std::string& ret = cobj->getSelectedIcon(); + lua_pushlstring(tolua_S,ret.c_str(),ret.length()); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getChildren",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:getSelectedIcon",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getChildren'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_getSelectedIcon'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_getMask(lua_State* tolua_S) +static int lua_fairygui_GButton_isSelected(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GButton* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getMask'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_isSelected'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - cocos2d::Node* ret = cobj->getMask(); - object_to_luaval(tolua_S, "cc.Node",(cocos2d::Node*)ret); + bool ret = cobj->isSelected(); + tolua_pushboolean(tolua_S,(bool)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getMask",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:isSelected",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getMask'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_isSelected'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_adjustRadioGroupDepth(lua_State* tolua_S) +static int lua_fairygui_GButton_getTitleColor(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; - bool ok = true; + fairygui::GButton* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_adjustRadioGroupDepth'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_getTitleColor'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - fairygui::GObject* arg0; - fairygui::GController* arg1; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GComponent:adjustRadioGroupDepth"); - ok &= luaval_to_object(tolua_S, 3, "fairygui.GController",&arg1, "fairygui.GComponent:adjustRadioGroupDepth"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_adjustRadioGroupDepth'", nullptr); - return 0; - } - cobj->adjustRadioGroupDepth(arg0, arg1); - return 0; + if (argc == 0) { + const cocos2d::Color3B& ret = cobj->getTitleColor(); + color3b_to_luaval(tolua_S, ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:adjustRadioGroupDepth",argc, 2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:getTitleColor",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_adjustRadioGroupDepth'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_getTitleColor'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_getController(lua_State* tolua_S) +static int lua_fairygui_GButton_getSelectedTitle(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; - bool ok = true; + fairygui::GButton* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getController'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_getSelectedTitle'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GComponent:getController"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_getController'", nullptr); - return 0; - } - fairygui::GController* ret = cobj->getController(arg0); - object_to_luaval(tolua_S, "fairygui.GController",(fairygui::GController*)ret); + if (argc == 0) { + const std::string& ret = cobj->getSelectedTitle(); + lua_pushlstring(tolua_S,ret.c_str(),ret.length()); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getController",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:getSelectedTitle",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getController'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_getSelectedTitle'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_setApexIndex(lua_State* tolua_S) +static int lua_fairygui_GButton_getTitle(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; - bool ok = true; + fairygui::GButton* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_setApexIndex'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_getTitle'", nullptr); return 0; } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GComponent:setApexIndex"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_setApexIndex'", nullptr); - return 0; - } - cobj->setApexIndex(arg0); - return 0; +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + const std::string& ret = cobj->getTitle(); + lua_pushlstring(tolua_S,ret.c_str(),ret.length()); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:setApexIndex",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:getTitle",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_setApexIndex'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_getTitle'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_getTransition(lua_State* tolua_S) +static int lua_fairygui_GButton_setSelectedIcon(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GButton* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getTransition'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_setSelectedIcon'", nullptr); return 0; } #endif @@ -13993,744 +16681,720 @@ static int lua_fairygui_GComponent_getTransition(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GComponent:getTransition"); + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GButton:setSelectedIcon"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_getTransition'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GButton_setSelectedIcon'", nullptr); return 0; } - fairygui::Transition* ret = cobj->getTransition(arg0); - object_to_luaval(tolua_S, "fairygui.Transition",(fairygui::Transition*)ret); - return 1; + cobj->setSelectedIcon(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getTransition",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:setSelectedIcon",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getTransition'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_setSelectedIcon'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_getFirstChildInView(lua_State* tolua_S) +static int lua_fairygui_GButton_isChangeStateOnClick(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GButton* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getFirstChildInView'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_isChangeStateOnClick'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - int ret = cobj->getFirstChildInView(); - tolua_pushnumber(tolua_S,(lua_Number)ret); + bool ret = cobj->isChangeStateOnClick(); + tolua_pushboolean(tolua_S,(bool)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getFirstChildInView",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:isChangeStateOnClick",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getFirstChildInView'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_isChangeStateOnClick'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_isChildInView(lua_State* tolua_S) +static int lua_fairygui_GButton_setTitleFontSize(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GButton* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_isChildInView'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_setTitleFontSize'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - fairygui::GObject* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GComponent:isChildInView"); + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GButton:setTitleFontSize"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_isChildInView'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GButton_setTitleFontSize'", nullptr); return 0; } - bool ret = cobj->isChildInView(arg0); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; + cobj->setTitleFontSize(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:isChildInView",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:setTitleFontSize",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_isChildInView'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_setTitleFontSize'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_setBoundsChangedFlag(lua_State* tolua_S) +static int lua_fairygui_GButton_setTitleColor(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GButton* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_setBoundsChangedFlag'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_setTitleColor'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->setBoundsChangedFlag(); - return 0; + if (argc == 1) { + cocos2d::Color3B arg0; + ok &= luaval_to_color3b(tolua_S, 2, &arg0, "fairygui.GButton:setTitleColor"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GButton_setTitleColor'", nullptr); + return 0; + } + cobj->setTitleColor(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:setBoundsChangedFlag",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:setTitleColor",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_setBoundsChangedFlag'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_setTitleColor'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_addChildAt(lua_State* tolua_S) +static int lua_fairygui_GButton_create(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_addChildAt'", nullptr); - return 0; - } + if (!tolua_isusertable(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - fairygui::GObject* arg0; - int arg1; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GComponent:addChildAt"); - ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GComponent:addChildAt"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_addChildAt'", nullptr); - return 0; - } - fairygui::GObject* ret = cobj->addChildAt(arg0, arg1); - object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); + argc = lua_gettop(tolua_S) - 1; + if (argc == 0){ + fairygui::GButton* ret = fairygui::GButton::create(); + object_to_luaval(tolua_S, "fairygui.GButton",(fairygui::GButton*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:addChildAt",argc, 2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GButton:create",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_addChildAt'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_create'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_removeChildren(lua_State* tolua_S) +static int lua_register_fairygui_GButton(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"fairygui.GButton"); + tolua_cclass(tolua_S,"GButton","fairygui.GButton","fairygui.GComponent",nullptr); + + tolua_beginmodule(tolua_S,"GButton"); + tolua_function(tolua_S,"getRelatedController",lua_fairygui_GButton_getRelatedController); + tolua_function(tolua_S,"setChangeStateOnClick",lua_fairygui_GButton_setChangeStateOnClick); + tolua_function(tolua_S,"setSelectedTitle",lua_fairygui_GButton_setSelectedTitle); + tolua_function(tolua_S,"setSelected",lua_fairygui_GButton_setSelected); + tolua_function(tolua_S,"setRelatedController",lua_fairygui_GButton_setRelatedController); + tolua_function(tolua_S,"setTitle",lua_fairygui_GButton_setTitle); + tolua_function(tolua_S,"getTitleFontSize",lua_fairygui_GButton_getTitleFontSize); + tolua_function(tolua_S,"getSelectedIcon",lua_fairygui_GButton_getSelectedIcon); + tolua_function(tolua_S,"isSelected",lua_fairygui_GButton_isSelected); + tolua_function(tolua_S,"getTitleColor",lua_fairygui_GButton_getTitleColor); + tolua_function(tolua_S,"getSelectedTitle",lua_fairygui_GButton_getSelectedTitle); + tolua_function(tolua_S,"getTitle",lua_fairygui_GButton_getTitle); + tolua_function(tolua_S,"setSelectedIcon",lua_fairygui_GButton_setSelectedIcon); + tolua_function(tolua_S,"isChangeStateOnClick",lua_fairygui_GButton_isChangeStateOnClick); + tolua_function(tolua_S,"setTitleFontSize",lua_fairygui_GButton_setTitleFontSize); + tolua_function(tolua_S,"setTitleColor",lua_fairygui_GButton_setTitleColor); + tolua_function(tolua_S,"create", lua_fairygui_GButton_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::GButton).name(); + g_luaType[typeName] = "fairygui.GButton"; + g_typeCast["GButton"] = "fairygui.GButton"; + return 1; +} + +static int lua_fairygui_GObjectPool_getObject(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GObjectPool* cobj = nullptr; bool ok = true; - + #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GObjectPool",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GObjectPool*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj){ - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_removeChildren'", nullptr); + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObjectPool_getObject'", nullptr); return 0; } #endif - + argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->removeChildren(); - return 0; - } - if (argc == 2) { - int arg0; - int arg1; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GComponent:removeChildren"); - ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GComponent:removeChildren"); - cobj->removeChildren(arg0, arg1); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:removeChildren",argc, 0); + if (argc == 1) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GObjectPool:getObject"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GObjectPool_getObject'", nullptr); + return 0; + } + fairygui::GObject* ret = cobj->getObject(arg0); + object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObjectPool:getObject",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_removeChildren'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObjectPool_getObject'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_removeChildAt(lua_State* tolua_S) +static int lua_fairygui_GObjectPool_returnObject(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GObjectPool* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GObjectPool",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GObjectPool*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_removeChildAt'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObjectPool_returnObject'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GComponent:removeChildAt"); + fairygui::GObject* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GObjectPool:returnObject"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_removeChildAt'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GObjectPool_returnObject'", nullptr); return 0; } - cobj->removeChildAt(arg0); - return 0; + cobj->returnObject(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:removeChildAt",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObjectPool:returnObject",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_removeChildAt'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObjectPool_returnObject'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_getChild(lua_State* tolua_S) +static int lua_register_fairygui_GObjectPool(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"fairygui.GObjectPool"); + tolua_cclass(tolua_S,"GObjectPool","fairygui.GObjectPool","",nullptr); + + tolua_beginmodule(tolua_S,"GObjectPool"); + tolua_function(tolua_S,"getObject",lua_fairygui_GObjectPool_getObject); + tolua_function(tolua_S,"returnObject",lua_fairygui_GObjectPool_returnObject); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::GObjectPool).name(); + g_luaType[typeName] = "fairygui.GObjectPool"; + g_typeCast["GObjectPool"] = "fairygui.GObjectPool"; + return 1; +} + +static int lua_fairygui_GList_selectAll(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; - bool ok = true; + fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getChild'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_selectAll'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GComponent:getChild"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_getChild'", nullptr); - return 0; - } - fairygui::GObject* ret = cobj->getChild(arg0); - object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); - return 1; + if (argc == 0) { + cobj->selectAll(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getChild",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:selectAll",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getChild'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_selectAll'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_addController(lua_State* tolua_S) +static int lua_fairygui_GList_getColumnGap(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; - bool ok = true; + fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_addController'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getColumnGap'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::GController* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GController",&arg0, "fairygui.GComponent:addController"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_addController'", nullptr); - return 0; - } - cobj->addController(arg0); - return 0; + if (argc == 0) { + int ret = cobj->getColumnGap(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:addController",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getColumnGap",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_addController'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getColumnGap'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_childSortingOrderChanged(lua_State* tolua_S) +static int lua_fairygui_GList_getLineCount(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; - bool ok = true; + fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_childSortingOrderChanged'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getLineCount'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 3) { - fairygui::GObject* arg0; - int arg1; - int arg2; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GComponent:childSortingOrderChanged"); - ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GComponent:childSortingOrderChanged"); - ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "fairygui.GComponent:childSortingOrderChanged"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_childSortingOrderChanged'", nullptr); - return 0; - } - cobj->childSortingOrderChanged(arg0, arg1, arg2); - return 0; + if (argc == 0) { + int ret = cobj->getLineCount(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:childSortingOrderChanged",argc, 3); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getLineCount",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_childSortingOrderChanged'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getLineCount'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_applyController(lua_State* tolua_S) +static int lua_fairygui_GList_setVirtualAndLoop(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; - bool ok = true; + fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_applyController'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setVirtualAndLoop'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::GController* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GController",&arg0, "fairygui.GComponent:applyController"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_applyController'", nullptr); - return 0; - } - cobj->applyController(arg0); - return 0; + if (argc == 0) { + cobj->setVirtualAndLoop(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:applyController",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setVirtualAndLoop",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_applyController'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setVirtualAndLoop'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_getControllers(lua_State* tolua_S) +static int lua_fairygui_GList_setLayout(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GList* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getControllers'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setLayout'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - const cocos2d::Vector& ret = cobj->getControllers(); - ccvector_to_luaval(tolua_S, ret); - return 1; + if (argc == 1) { + fairygui::ListLayoutType arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:setLayout"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setLayout'", nullptr); + return 0; + } + cobj->setLayout(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getControllers",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setLayout",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getControllers'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setLayout'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_setMask(lua_State* tolua_S) +static int lua_fairygui_GList_refreshVirtualList(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; - bool ok = true; + fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_setMask'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_refreshVirtualList'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - cocos2d::Node* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "fairygui.GComponent:setMask"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_setMask'", nullptr); - return 0; - } - cobj->setMask(arg0); - return 0; - } - if (argc == 2) { - cocos2d::Node* arg0; - bool arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Node",&arg0, "fairygui.GComponent:setMask"); - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.GComponent:setMask"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_setMask'", nullptr); - return 0; - } - cobj->setMask(arg0, arg1); - return 0; + if (argc == 0) { + cobj->refreshVirtualList(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:setMask",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:refreshVirtualList",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_setMask'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_refreshVirtualList'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_setChildIndex(lua_State* tolua_S) +static int lua_fairygui_GList_removeSelection(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GList* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_setChildIndex'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_removeSelection'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - fairygui::GObject* arg0; - int arg1; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GComponent:setChildIndex"); - ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GComponent:setChildIndex"); + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:removeSelection"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_setChildIndex'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_removeSelection'", nullptr); return 0; } - cobj->setChildIndex(arg0, arg1); - return 0; + cobj->removeSelection(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:setChildIndex",argc, 2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:removeSelection",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_setChildIndex'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_removeSelection'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_setViewWidth(lua_State* tolua_S) +static int lua_fairygui_GList_setColumnGap(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GList* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_setViewWidth'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setColumnGap'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GComponent:setViewWidth"); + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:setColumnGap"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_setViewWidth'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setColumnGap'", nullptr); return 0; } - cobj->setViewWidth(arg0); - return 0; + cobj->setColumnGap(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:setViewWidth",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setColumnGap",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_setViewWidth'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setColumnGap'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_getChildById(lua_State* tolua_S) +static int lua_fairygui_GList_getColumnCount(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; - bool ok = true; + fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getChildById'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getColumnCount'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GComponent:getChildById"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_getChildById'", nullptr); - return 0; - } - fairygui::GObject* ret = cobj->getChildById(arg0); - object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); + if (argc == 0) { + int ret = cobj->getColumnCount(); + tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getChildById",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getColumnCount",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getChildById'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getColumnCount'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_getChildByPath(lua_State* tolua_S) +static int lua_fairygui_GList_setVirtual(lua_State* tolua_S) { - int argc = 0; - fairygui::GComponent* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getChildByPath'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setVirtual'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GComponent:getChildByPath"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_getChildByPath'", nullptr); - return 0; - } - fairygui::GObject* ret = cobj->getChildByPath(arg0); - object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getChildByPath",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cobj->setVirtual(); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setVirtual",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getChildByPath'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setVirtual'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_getChildIndex(lua_State* tolua_S) +static int lua_fairygui_GList_setNumItems(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GList* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getChildIndex'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setNumItems'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - const fairygui::GObject* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GComponent:getChildIndex"); + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:setNumItems"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_getChildIndex'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setNumItems'", nullptr); return 0; } - int ret = cobj->getChildIndex(arg0); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + cobj->setNumItems(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getChildIndex",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setNumItems",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getChildIndex'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setNumItems'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_getMargin(lua_State* tolua_S) +static int lua_fairygui_GList_setVerticalAlign(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GList* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getMargin'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setVerticalAlign'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - const fairygui::Margin& ret = cobj->getMargin(); - margin_to_luaval(tolua_S, ret); - return 1; + if (argc == 1) { + cocos2d::TextVAlignment arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:setVerticalAlign"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setVerticalAlign'", nullptr); + return 0; + } + cobj->setVerticalAlign(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getMargin",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setVerticalAlign",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getMargin'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setVerticalAlign'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_getControllerAt(lua_State* tolua_S) +static int lua_fairygui_GList_resizeToFit(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GList* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getControllerAt'", nullptr); + if (!cobj){ + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_resizeToFit'", nullptr); return 0; } #endif @@ -14738,184 +17402,193 @@ static int lua_fairygui_GComponent_getControllerAt(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GComponent:getControllerAt"); + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:resizeToFit"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_getControllerAt'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_resizeToFit'", nullptr); return 0; } - fairygui::GController* ret = cobj->getControllerAt(arg0); - object_to_luaval(tolua_S, "fairygui.GController",(fairygui::GController*)ret); - return 1; + cobj->resizeToFit(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getControllerAt",argc, 1); + if (argc == 2) { + int arg0; + int arg1; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:resizeToFit"); + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GList:resizeToFit"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_resizeToFit'", nullptr); + return 0; + } + cobj->resizeToFit(arg0, arg1); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:resizeToFit",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getControllerAt'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_resizeToFit'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_getChildAt(lua_State* tolua_S) +static int lua_fairygui_GList_setSelectionController(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GList* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getChildAt'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setSelectionController'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GComponent:getChildAt"); + fairygui::GController* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GController",&arg0, "fairygui.GList:setSelectionController"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_getChildAt'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setSelectionController'", nullptr); return 0; } - fairygui::GObject* ret = cobj->getChildAt(arg0); - object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); - return 1; + cobj->setSelectionController(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getChildAt",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setSelectionController",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getChildAt'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setSelectionController'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_getApexIndex(lua_State* tolua_S) +static int lua_fairygui_GList_returnToPool(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GList* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getApexIndex'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_returnToPool'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - int ret = cobj->getApexIndex(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + if (argc == 1) { + fairygui::GObject* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GList:returnToPool"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_returnToPool'", nullptr); + return 0; + } + cobj->returnToPool(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getApexIndex",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:returnToPool",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getApexIndex'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_returnToPool'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_setMargin(lua_State* tolua_S) +static int lua_fairygui_GList_clearSelection(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; - bool ok = true; + fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_setMargin'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_clearSelection'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::Margin arg0; - ok &= luaval_to_margin(tolua_S, 2, &arg0, "fairygui.GComponent:setMargin"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_setMargin'", nullptr); - return 0; - } - cobj->setMargin(arg0); - return 0; + if (argc == 0) { + cobj->clearSelection(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:setMargin",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:clearSelection",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_setMargin'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_clearSelection'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_getScrollPane(lua_State* tolua_S) +static int lua_fairygui_GList_getNumItems(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getScrollPane'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getNumItems'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - fairygui::ScrollPane* ret = cobj->getScrollPane(); - object_to_luaval(tolua_S, "fairygui.ScrollPane",(fairygui::ScrollPane*)ret); + int ret = cobj->getNumItems(); + tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getScrollPane",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getNumItems",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getScrollPane'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getNumItems'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_getTransitionAt(lua_State* tolua_S) +static int lua_fairygui_GList_setColumnCount(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GList* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getTransitionAt'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setColumnCount'", nullptr); return 0; } #endif @@ -14923,1096 +17596,1067 @@ static int lua_fairygui_GComponent_getTransitionAt(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GComponent:getTransitionAt"); + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:setColumnCount"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_getTransitionAt'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setColumnCount'", nullptr); return 0; } - fairygui::Transition* ret = cobj->getTransitionAt(arg0); - object_to_luaval(tolua_S, "fairygui.Transition",(fairygui::Transition*)ret); - return 1; + cobj->setColumnCount(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getTransitionAt",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setColumnCount",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getTransitionAt'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setColumnCount'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_getChildInGroup(lua_State* tolua_S) +static int lua_fairygui_GList_removeChildToPoolAt(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GList* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getChildInGroup'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_removeChildToPoolAt'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - const fairygui::GGroup* arg0; - std::string arg1; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GGroup",&arg0, "fairygui.GComponent:getChildInGroup"); - ok &= luaval_to_std_string(tolua_S, 3,&arg1, "fairygui.GComponent:getChildInGroup"); + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:removeChildToPoolAt"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_getChildInGroup'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_removeChildToPoolAt'", nullptr); return 0; } - fairygui::GObject* ret = cobj->getChildInGroup(arg0, arg1); - object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); - return 1; + cobj->removeChildToPoolAt(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getChildInGroup",argc, 2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:removeChildToPoolAt",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getChildInGroup'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_removeChildToPoolAt'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_removeController(lua_State* tolua_S) +static int lua_fairygui_GList_addItemFromPool(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GList* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_removeController'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_addItemFromPool'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::GObject* ret = cobj->addItemFromPool(); + object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); + return 1; + } if (argc == 1) { - fairygui::GController* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GController",&arg0, "fairygui.GComponent:removeController"); + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GList:addItemFromPool"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_removeController'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_addItemFromPool'", nullptr); return 0; } - cobj->removeController(arg0); - return 0; + fairygui::GObject* ret = cobj->addItemFromPool(arg0); + object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:removeController",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:addItemFromPool",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_removeController'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_addItemFromPool'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_getSnappingPosition(lua_State* tolua_S) +static int lua_fairygui_GList_selectReverse(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; - bool ok = true; + fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getSnappingPosition'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_selectReverse'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - cocos2d::Vec2 arg0; - ok &= luaval_to_vec2(tolua_S, 2, &arg0, "fairygui.GComponent:getSnappingPosition"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_getSnappingPosition'", nullptr); - return 0; - } - cocos2d::Vec2 ret = cobj->getSnappingPosition(arg0); - vec2_to_luaval(tolua_S, ret); - return 1; + if (argc == 0) { + cobj->selectReverse(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getSnappingPosition",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:selectReverse",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getSnappingPosition'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_selectReverse'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_setChildIndexBefore(lua_State* tolua_S) +static int lua_fairygui_GList_setLineCount(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GList* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_setChildIndexBefore'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setLineCount'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - fairygui::GObject* arg0; - int arg1; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GComponent:setChildIndexBefore"); - ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GComponent:setChildIndexBefore"); + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:setLineCount"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_setChildIndexBefore'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setLineCount'", nullptr); return 0; } - int ret = cobj->setChildIndexBefore(arg0, arg1); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + cobj->setLineCount(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:setChildIndexBefore",argc, 2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setLineCount",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_setChildIndexBefore'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setLineCount'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_setHitArea(lua_State* tolua_S) +static int lua_fairygui_GList_setAutoResizeItem(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GList* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_setHitArea'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setAutoResizeItem'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - fairygui::IHitTest* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.IHitTest",&arg0, "fairygui.GComponent:setHitArea"); + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GList:setAutoResizeItem"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_setHitArea'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setAutoResizeItem'", nullptr); return 0; } - cobj->setHitArea(arg0); - return 0; + cobj->setAutoResizeItem(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:setHitArea",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setAutoResizeItem",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_setHitArea'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setAutoResizeItem'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_swapChildrenAt(lua_State* tolua_S) +static int lua_fairygui_GList_getVerticalAlign(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; - bool ok = true; + fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_swapChildrenAt'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getVerticalAlign'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - int arg0; - int arg1; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GComponent:swapChildrenAt"); - ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GComponent:swapChildrenAt"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_swapChildrenAt'", nullptr); - return 0; - } - cobj->swapChildrenAt(arg0, arg1); - return 0; + if (argc == 0) { + int ret = (int)cobj->getVerticalAlign(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:swapChildrenAt",argc, 2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getVerticalAlign",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_swapChildrenAt'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getVerticalAlign'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_numChildren(lua_State* tolua_S) +static int lua_fairygui_GList_removeChildrenToPool(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GList* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_numChildren'", nullptr); + if (!cobj){ + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_removeChildrenToPool'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - int ret = cobj->numChildren(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + cobj->removeChildrenToPool(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:numChildren",argc, 0); + if (argc == 2) { + int arg0; + int arg1; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:removeChildrenToPool"); + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GList:removeChildrenToPool"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_removeChildrenToPool'", nullptr); + return 0; + } + cobj->removeChildrenToPool(arg0, arg1); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:removeChildrenToPool",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_numChildren'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_removeChildrenToPool'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_removeChild(lua_State* tolua_S) +static int lua_fairygui_GList_setAlign(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GList* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_removeChild'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setAlign'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - fairygui::GObject* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GComponent:removeChild"); + cocos2d::TextHAlignment arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:setAlign"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_removeChild'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setAlign'", nullptr); return 0; } - cobj->removeChild(arg0); - return 0; + cobj->setAlign(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:removeChild",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setAlign",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_removeChild'.",&tolua_err); - return 0; +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setAlign'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_swapChildren(lua_State* tolua_S) +static int lua_fairygui_GList_isVirtual(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; - bool ok = true; + fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_swapChildren'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_isVirtual'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - fairygui::GObject* arg0; - fairygui::GObject* arg1; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GComponent:swapChildren"); - ok &= luaval_to_object(tolua_S, 3, "fairygui.GObject",&arg1, "fairygui.GComponent:swapChildren"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_swapChildren'", nullptr); - return 0; - } - cobj->swapChildren(arg0, arg1); - return 0; + if (argc == 0) { + bool ret = cobj->isVirtual(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:swapChildren",argc, 2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:isVirtual",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_swapChildren'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_isVirtual'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_childStateChanged(lua_State* tolua_S) +static int lua_fairygui_GList_getSelectedIndex(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; - bool ok = true; + fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_childStateChanged'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getSelectedIndex'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::GObject* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GComponent:childStateChanged"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_childStateChanged'", nullptr); - return 0; - } - cobj->childStateChanged(arg0); - return 0; + if (argc == 0) { + int ret = cobj->getSelectedIndex(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:childStateChanged",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getSelectedIndex",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_childStateChanged'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getSelectedIndex'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_getChildrenRenderOrder(lua_State* tolua_S) +static int lua_fairygui_GList_getSelection(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_getChildrenRenderOrder'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getSelection'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - int ret = (int)cobj->getChildrenRenderOrder(); - tolua_pushnumber(tolua_S,(lua_Number)ret); + std::vector arg0; + cobj->getSelection(arg0); + ccvector_int_to_luaval(tolua_S, arg0); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:getChildrenRenderOrder",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getSelection",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_getChildrenRenderOrder'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getSelection'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_setViewHeight(lua_State* tolua_S) +static int lua_fairygui_GList_itemIndexToChildIndex(lua_State* tolua_S) { int argc = 0; - fairygui::GComponent* cobj = nullptr; + fairygui::GList* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComponent*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComponent_setViewHeight'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_itemIndexToChildIndex'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GComponent:setViewHeight"); + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:itemIndexToChildIndex"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComponent_setViewHeight'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_itemIndexToChildIndex'", nullptr); return 0; } - cobj->setViewHeight(arg0); - return 0; + int ret = cobj->itemIndexToChildIndex(arg0); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComponent:setViewHeight",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:itemIndexToChildIndex",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_setViewHeight'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_itemIndexToChildIndex'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComponent_create(lua_State* tolua_S) +static int lua_fairygui_GList_getItemPool(lua_State* tolua_S) { int argc = 0; + fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.GComponent",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getItemPool'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S) - 1; - if (argc == 0){ - fairygui::GComponent* ret = fairygui::GComponent::create(); - object_to_luaval(tolua_S, "fairygui.GComponent",(fairygui::GComponent*)ret); + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::GObjectPool* ret = cobj->getItemPool(); + object_to_luaval(tolua_S, "fairygui.GObjectPool",(fairygui::GObjectPool*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GComponent:create",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getItemPool",argc, 0); return 0; - + #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComponent_create'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getItemPool'.",&tolua_err); + return 0; #endif } -static int lua_register_fairygui_GComponent(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.GComponent"); - tolua_cclass(tolua_S,"GComponent","fairygui.GComponent","fairygui.GObject",nullptr); - - tolua_beginmodule(tolua_S,"GComponent"); - tolua_function(tolua_S,"addChild",lua_fairygui_GComponent_addChild); - tolua_function(tolua_S,"getHitArea",lua_fairygui_GComponent_getHitArea); - tolua_function(tolua_S,"applyAllControllers",lua_fairygui_GComponent_applyAllControllers); - tolua_function(tolua_S,"getOpaque",lua_fairygui_GComponent_getOpaque); - tolua_function(tolua_S,"setChildrenRenderOrder",lua_fairygui_GComponent_setChildrenRenderOrder); - tolua_function(tolua_S,"setOpaque",lua_fairygui_GComponent_setOpaque); - tolua_function(tolua_S,"getViewWidth",lua_fairygui_GComponent_getViewWidth); - tolua_function(tolua_S,"getTransitions",lua_fairygui_GComponent_getTransitions); - tolua_function(tolua_S,"getViewHeight",lua_fairygui_GComponent_getViewHeight); - tolua_function(tolua_S,"ensureBoundsCorrect",lua_fairygui_GComponent_ensureBoundsCorrect); - tolua_function(tolua_S,"isAncestorOf",lua_fairygui_GComponent_isAncestorOf); - tolua_function(tolua_S,"getChildren",lua_fairygui_GComponent_getChildren); - tolua_function(tolua_S,"getMask",lua_fairygui_GComponent_getMask); - tolua_function(tolua_S,"adjustRadioGroupDepth",lua_fairygui_GComponent_adjustRadioGroupDepth); - tolua_function(tolua_S,"getController",lua_fairygui_GComponent_getController); - tolua_function(tolua_S,"setApexIndex",lua_fairygui_GComponent_setApexIndex); - tolua_function(tolua_S,"getTransition",lua_fairygui_GComponent_getTransition); - tolua_function(tolua_S,"getFirstChildInView",lua_fairygui_GComponent_getFirstChildInView); - tolua_function(tolua_S,"isChildInView",lua_fairygui_GComponent_isChildInView); - tolua_function(tolua_S,"setBoundsChangedFlag",lua_fairygui_GComponent_setBoundsChangedFlag); - tolua_function(tolua_S,"addChildAt",lua_fairygui_GComponent_addChildAt); - tolua_function(tolua_S,"removeChildren",lua_fairygui_GComponent_removeChildren); - tolua_function(tolua_S,"removeChildAt",lua_fairygui_GComponent_removeChildAt); - tolua_function(tolua_S,"getChild",lua_fairygui_GComponent_getChild); - tolua_function(tolua_S,"addController",lua_fairygui_GComponent_addController); - tolua_function(tolua_S,"childSortingOrderChanged",lua_fairygui_GComponent_childSortingOrderChanged); - tolua_function(tolua_S,"applyController",lua_fairygui_GComponent_applyController); - tolua_function(tolua_S,"getControllers",lua_fairygui_GComponent_getControllers); - tolua_function(tolua_S,"setMask",lua_fairygui_GComponent_setMask); - tolua_function(tolua_S,"setChildIndex",lua_fairygui_GComponent_setChildIndex); - tolua_function(tolua_S,"setViewWidth",lua_fairygui_GComponent_setViewWidth); - tolua_function(tolua_S,"getChildById",lua_fairygui_GComponent_getChildById); - tolua_function(tolua_S,"getChildByPath",lua_fairygui_GComponent_getChildByPath); - tolua_function(tolua_S,"getChildIndex",lua_fairygui_GComponent_getChildIndex); - tolua_function(tolua_S,"getMargin",lua_fairygui_GComponent_getMargin); - tolua_function(tolua_S,"getControllerAt",lua_fairygui_GComponent_getControllerAt); - tolua_function(tolua_S,"getChildAt",lua_fairygui_GComponent_getChildAt); - tolua_function(tolua_S,"getApexIndex",lua_fairygui_GComponent_getApexIndex); - tolua_function(tolua_S,"setMargin",lua_fairygui_GComponent_setMargin); - tolua_function(tolua_S,"getScrollPane",lua_fairygui_GComponent_getScrollPane); - tolua_function(tolua_S,"getTransitionAt",lua_fairygui_GComponent_getTransitionAt); - tolua_function(tolua_S,"getChildInGroup",lua_fairygui_GComponent_getChildInGroup); - tolua_function(tolua_S,"removeController",lua_fairygui_GComponent_removeController); - tolua_function(tolua_S,"getSnappingPosition",lua_fairygui_GComponent_getSnappingPosition); - tolua_function(tolua_S,"setChildIndexBefore",lua_fairygui_GComponent_setChildIndexBefore); - tolua_function(tolua_S,"setHitArea",lua_fairygui_GComponent_setHitArea); - tolua_function(tolua_S,"swapChildrenAt",lua_fairygui_GComponent_swapChildrenAt); - tolua_function(tolua_S,"numChildren",lua_fairygui_GComponent_numChildren); - tolua_function(tolua_S,"removeChild",lua_fairygui_GComponent_removeChild); - tolua_function(tolua_S,"swapChildren",lua_fairygui_GComponent_swapChildren); - tolua_function(tolua_S,"childStateChanged",lua_fairygui_GComponent_childStateChanged); - tolua_function(tolua_S,"getChildrenRenderOrder",lua_fairygui_GComponent_getChildrenRenderOrder); - tolua_function(tolua_S,"setViewHeight",lua_fairygui_GComponent_setViewHeight); - tolua_function(tolua_S,"create", lua_fairygui_GComponent_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::GComponent).name(); - g_luaType[typeName] = "fairygui.GComponent"; - g_typeCast["GComponent"] = "fairygui.GComponent"; - return 1; -} - -static int lua_fairygui_GButton_getRelatedController(lua_State* tolua_S) +static int lua_fairygui_GList_getSelectionController(lua_State* tolua_S) { int argc = 0; - fairygui::GButton* cobj = nullptr; + fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_getRelatedController'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getSelectionController'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - fairygui::GController* ret = cobj->getRelatedController(); + fairygui::GController* ret = cobj->getSelectionController(); object_to_luaval(tolua_S, "fairygui.GController",(fairygui::GController*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:getRelatedController",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getSelectionController",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_getRelatedController'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getSelectionController'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GButton_setChangeStateOnClick(lua_State* tolua_S) +static int lua_fairygui_GList_getLineGap(lua_State* tolua_S) { int argc = 0; - fairygui::GButton* cobj = nullptr; - bool ok = true; + fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_setChangeStateOnClick'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getLineGap'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GButton:setChangeStateOnClick"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GButton_setChangeStateOnClick'", nullptr); - return 0; - } - cobj->setChangeStateOnClick(arg0); - return 0; + if (argc == 0) { + int ret = cobj->getLineGap(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:setChangeStateOnClick",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getLineGap",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_setChangeStateOnClick'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getLineGap'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GButton_setSelectedTitle(lua_State* tolua_S) +static int lua_fairygui_GList_scrollToView(lua_State* tolua_S) { int argc = 0; - fairygui::GButton* cobj = nullptr; + fairygui::GList* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_setSelectedTitle'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_scrollToView'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GButton:setSelectedTitle"); + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:scrollToView"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GButton_setSelectedTitle'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_scrollToView'", nullptr); return 0; } - cobj->setSelectedTitle(arg0); - return 0; + cobj->scrollToView(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:setSelectedTitle",argc, 1); + if (argc == 2) { + int arg0; + bool arg1; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:scrollToView"); + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.GList:scrollToView"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_scrollToView'", nullptr); + return 0; + } + cobj->scrollToView(arg0, arg1); + return 0; + } + if (argc == 3) { + int arg0; + bool arg1; + bool arg2; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:scrollToView"); + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.GList:scrollToView"); + ok &= luaval_to_boolean(tolua_S, 4,&arg2, "fairygui.GList:scrollToView"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_scrollToView'", nullptr); + return 0; + } + cobj->scrollToView(arg0, arg1, arg2); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:scrollToView",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_setSelectedTitle'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_scrollToView'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GButton_setSelected(lua_State* tolua_S) +static int lua_fairygui_GList_handleArrowKey(lua_State* tolua_S) { int argc = 0; - fairygui::GButton* cobj = nullptr; + fairygui::GList* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_setSelected'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_handleArrowKey'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GButton:setSelected"); + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:handleArrowKey"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GButton_setSelected'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_handleArrowKey'", nullptr); return 0; } - cobj->setSelected(arg0); - return 0; + cobj->handleArrowKey(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:setSelected",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:handleArrowKey",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_setSelected'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_handleArrowKey'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GButton_setRelatedController(lua_State* tolua_S) +static int lua_fairygui_GList_getAlign(lua_State* tolua_S) { int argc = 0; - fairygui::GButton* cobj = nullptr; - bool ok = true; + fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_setRelatedController'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getAlign'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::GController* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GController",&arg0, "fairygui.GButton:setRelatedController"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GButton_setRelatedController'", nullptr); - return 0; - } - cobj->setRelatedController(arg0); - return 0; + if (argc == 0) { + int ret = (int)cobj->getAlign(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:setRelatedController",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getAlign",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_setRelatedController'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getAlign'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GButton_setTitle(lua_State* tolua_S) +static int lua_fairygui_GList_getFromPool(lua_State* tolua_S) { int argc = 0; - fairygui::GButton* cobj = nullptr; + fairygui::GList* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_setTitle'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getFromPool'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::GObject* ret = cobj->getFromPool(); + object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); + return 1; + } if (argc == 1) { std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GButton:setTitle"); + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GList:getFromPool"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GButton_setTitle'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_getFromPool'", nullptr); return 0; } - cobj->setTitle(arg0); - return 0; + fairygui::GObject* ret = cobj->getFromPool(arg0); + object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:setTitle",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getFromPool",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_setTitle'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getFromPool'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GButton_getTitleFontSize(lua_State* tolua_S) +static int lua_fairygui_GList_getDefaultItem(lua_State* tolua_S) { int argc = 0; - fairygui::GButton* cobj = nullptr; + fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_getTitleFontSize'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getDefaultItem'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - int ret = cobj->getTitleFontSize(); - tolua_pushnumber(tolua_S,(lua_Number)ret); + const std::string& ret = cobj->getDefaultItem(); + lua_pushlstring(tolua_S,ret.c_str(),ret.length()); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:getTitleFontSize",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getDefaultItem",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_getTitleFontSize'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getDefaultItem'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GButton_getSelectedIcon(lua_State* tolua_S) +static int lua_fairygui_GList_getSelectionMode(lua_State* tolua_S) { int argc = 0; - fairygui::GButton* cobj = nullptr; + fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_getSelectedIcon'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getSelectionMode'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - const std::string& ret = cobj->getSelectedIcon(); - lua_pushlstring(tolua_S,ret.c_str(),ret.length()); + int ret = (int)cobj->getSelectionMode(); + tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:getSelectedIcon",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getSelectionMode",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_getSelectedIcon'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getSelectionMode'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GButton_isSelected(lua_State* tolua_S) +static int lua_fairygui_GList_setDefaultItem(lua_State* tolua_S) { int argc = 0; - fairygui::GButton* cobj = nullptr; + fairygui::GList* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_isSelected'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setDefaultItem'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - bool ret = cobj->isSelected(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; + if (argc == 1) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GList:setDefaultItem"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setDefaultItem'", nullptr); + return 0; + } + cobj->setDefaultItem(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:isSelected",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setDefaultItem",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_isSelected'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setDefaultItem'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GButton_getTitleColor(lua_State* tolua_S) +static int lua_fairygui_GList_setSelectedIndex(lua_State* tolua_S) { int argc = 0; - fairygui::GButton* cobj = nullptr; + fairygui::GList* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_getTitleColor'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setSelectedIndex'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - const cocos2d::Color3B& ret = cobj->getTitleColor(); - color3b_to_luaval(tolua_S, ret); - return 1; + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:setSelectedIndex"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setSelectedIndex'", nullptr); + return 0; + } + cobj->setSelectedIndex(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:getTitleColor",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setSelectedIndex",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_getTitleColor'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setSelectedIndex'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GButton_getSelectedTitle(lua_State* tolua_S) +static int lua_fairygui_GList_setSelectionMode(lua_State* tolua_S) { int argc = 0; - fairygui::GButton* cobj = nullptr; + fairygui::GList* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_getSelectedTitle'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setSelectionMode'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - const std::string& ret = cobj->getSelectedTitle(); - lua_pushlstring(tolua_S,ret.c_str(),ret.length()); - return 1; + if (argc == 1) { + fairygui::ListSelectionMode arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:setSelectionMode"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setSelectionMode'", nullptr); + return 0; + } + cobj->setSelectionMode(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:getSelectedTitle",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setSelectionMode",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_getSelectedTitle'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setSelectionMode'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GButton_getTitle(lua_State* tolua_S) +static int lua_fairygui_GList_addSelection(lua_State* tolua_S) { int argc = 0; - fairygui::GButton* cobj = nullptr; + fairygui::GList* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_getTitle'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_addSelection'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - const std::string& ret = cobj->getTitle(); - lua_pushlstring(tolua_S,ret.c_str(),ret.length()); - return 1; + if (argc == 2) { + int arg0; + bool arg1; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:addSelection"); + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.GList:addSelection"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_addSelection'", nullptr); + return 0; + } + cobj->addSelection(arg0, arg1); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:getTitle",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:addSelection",argc, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_getTitle'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_addSelection'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GButton_setSelectedIcon(lua_State* tolua_S) +static int lua_fairygui_GList_childIndexToItemIndex(lua_State* tolua_S) { int argc = 0; - fairygui::GButton* cobj = nullptr; + fairygui::GList* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_setSelectedIcon'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_childIndexToItemIndex'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GButton:setSelectedIcon"); + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:childIndexToItemIndex"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GButton_setSelectedIcon'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_childIndexToItemIndex'", nullptr); return 0; } - cobj->setSelectedIcon(arg0); - return 0; + int ret = cobj->childIndexToItemIndex(arg0); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:setSelectedIcon",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:childIndexToItemIndex",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_setSelectedIcon'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_childIndexToItemIndex'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GButton_isChangeStateOnClick(lua_State* tolua_S) +static int lua_fairygui_GList_getAutoResizeItem(lua_State* tolua_S) { int argc = 0; - fairygui::GButton* cobj = nullptr; + fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_isChangeStateOnClick'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getAutoResizeItem'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - bool ret = cobj->isChangeStateOnClick(); + bool ret = cobj->getAutoResizeItem(); tolua_pushboolean(tolua_S,(bool)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:isChangeStateOnClick",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getAutoResizeItem",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_isChangeStateOnClick'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getAutoResizeItem'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GButton_setTitleFontSize(lua_State* tolua_S) +static int lua_fairygui_GList_setLineGap(lua_State* tolua_S) { int argc = 0; - fairygui::GButton* cobj = nullptr; + fairygui::GList* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_setTitleFontSize'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setLineGap'", nullptr); return 0; } #endif @@ -16020,11128 +18664,11259 @@ static int lua_fairygui_GButton_setTitleFontSize(lua_State* tolua_S) argc = lua_gettop(tolua_S)-1; if (argc == 1) { int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GButton:setTitleFontSize"); + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:setLineGap"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GButton_setTitleFontSize'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setLineGap'", nullptr); return 0; } - cobj->setTitleFontSize(arg0); - return 0; + cobj->setLineGap(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:setTitleFontSize",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setLineGap",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_setTitleFontSize'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setLineGap'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GButton_setTitleColor(lua_State* tolua_S) +static int lua_fairygui_GList_removeChildToPool(lua_State* tolua_S) { int argc = 0; - fairygui::GButton* cobj = nullptr; + fairygui::GList* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GButton*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GButton_setTitleColor'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_removeChildToPool'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::Color3B arg0; - ok &= luaval_to_color3b(tolua_S, 2, &arg0, "fairygui.GButton:setTitleColor"); + fairygui::GObject* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GList:removeChildToPool"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GButton_setTitleColor'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_removeChildToPool'", nullptr); return 0; } - cobj->setTitleColor(arg0); - return 0; + cobj->removeChildToPool(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GButton:setTitleColor",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:removeChildToPool",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_setTitleColor'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_removeChildToPool'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GButton_create(lua_State* tolua_S) +static int lua_fairygui_GList_getLayout(lua_State* tolua_S) { int argc = 0; + fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.GButton",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getLayout'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S) - 1; - if (argc == 0){ - fairygui::GButton* ret = fairygui::GButton::create(); - object_to_luaval(tolua_S, "fairygui.GButton",(fairygui::GButton*)ret); + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + int ret = (int)cobj->getLayout(); + tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GButton:create",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getLayout",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GButton_create'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getLayout'.",&tolua_err); + return 0; #endif } -static int lua_register_fairygui_GButton(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.GButton"); - tolua_cclass(tolua_S,"GButton","fairygui.GButton","fairygui.GComponent",nullptr); - - tolua_beginmodule(tolua_S,"GButton"); - tolua_function(tolua_S,"getRelatedController",lua_fairygui_GButton_getRelatedController); - tolua_function(tolua_S,"setChangeStateOnClick",lua_fairygui_GButton_setChangeStateOnClick); - tolua_function(tolua_S,"setSelectedTitle",lua_fairygui_GButton_setSelectedTitle); - tolua_function(tolua_S,"setSelected",lua_fairygui_GButton_setSelected); - tolua_function(tolua_S,"setRelatedController",lua_fairygui_GButton_setRelatedController); - tolua_function(tolua_S,"setTitle",lua_fairygui_GButton_setTitle); - tolua_function(tolua_S,"getTitleFontSize",lua_fairygui_GButton_getTitleFontSize); - tolua_function(tolua_S,"getSelectedIcon",lua_fairygui_GButton_getSelectedIcon); - tolua_function(tolua_S,"isSelected",lua_fairygui_GButton_isSelected); - tolua_function(tolua_S,"getTitleColor",lua_fairygui_GButton_getTitleColor); - tolua_function(tolua_S,"getSelectedTitle",lua_fairygui_GButton_getSelectedTitle); - tolua_function(tolua_S,"getTitle",lua_fairygui_GButton_getTitle); - tolua_function(tolua_S,"setSelectedIcon",lua_fairygui_GButton_setSelectedIcon); - tolua_function(tolua_S,"isChangeStateOnClick",lua_fairygui_GButton_isChangeStateOnClick); - tolua_function(tolua_S,"setTitleFontSize",lua_fairygui_GButton_setTitleFontSize); - tolua_function(tolua_S,"setTitleColor",lua_fairygui_GButton_setTitleColor); - tolua_function(tolua_S,"create", lua_fairygui_GButton_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::GButton).name(); - g_luaType[typeName] = "fairygui.GButton"; - g_typeCast["GButton"] = "fairygui.GButton"; - return 1; -} - -static int lua_fairygui_GObjectPool_getObject(lua_State* tolua_S) +static int lua_fairygui_GList_create(lua_State* tolua_S) { int argc = 0; - fairygui::GObjectPool* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GObjectPool",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::GObjectPool*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObjectPool_getObject'", nullptr); - return 0; - } + if (!tolua_isusertable(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GObjectPool:getObject"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GObjectPool_getObject'", nullptr); - return 0; - } - fairygui::GObject* ret = cobj->getObject(arg0); - object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); + argc = lua_gettop(tolua_S) - 1; + if (argc == 0){ + fairygui::GList* ret = fairygui::GList::create(); + object_to_luaval(tolua_S, "fairygui.GList",(fairygui::GList*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObjectPool:getObject",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GList:create",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObjectPool_getObject'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_create'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GObjectPool_returnObject(lua_State* tolua_S) +static int lua_fairygui_GList_get_itemRenderer(lua_State* L) { - int argc = 0; - fairygui::GObjectPool* cobj = nullptr; - bool ok = true; + fairygui::GList* cobj = nullptr; + int refid = -1; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GObjectPool",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(L,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GObjectPool*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GObjectPool_returnObject'", nullptr); + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GList_get_itemRenderer'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::GObject* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GObjectPool:returnObject"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GObjectPool_returnObject'", nullptr); - return 0; - } - cobj->returnObject(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GObjectPool:returnObject",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GObjectPool_returnObject'.",&tolua_err); - return 0; -#endif -} - -static int lua_register_fairygui_GObjectPool(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.GObjectPool"); - tolua_cclass(tolua_S,"GObjectPool","fairygui.GObjectPool","",nullptr); - - tolua_beginmodule(tolua_S,"GObjectPool"); - tolua_function(tolua_S,"getObject",lua_fairygui_GObjectPool_getObject); - tolua_function(tolua_S,"returnObject",lua_fairygui_GObjectPool_returnObject); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::GObjectPool).name(); - g_luaType[typeName] = "fairygui.GObjectPool"; - g_typeCast["GObjectPool"] = "fairygui.GObjectPool"; + refid = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)cobj, (ScriptHandlerMgr::HandlerType)HT_GLIST_RENDERER); + if (refid >= 0) { + toluafix_get_function_by_refid(L, refid); + } else { + lua_pushnil(L); + } return 1; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(L,"#ferror in function 'lua_fairygui_GList_get_itemRenderer'.",&tolua_err); + return 0; +#endif } -static int lua_fairygui_GList_selectAll(lua_State* tolua_S) +static int lua_fairygui_GList_set_itemRenderer(lua_State* L) { - int argc = 0; fairygui::GList* cobj = nullptr; + LUA_FUNCTION refid = -1; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(L,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_selectAll'", nullptr); + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GList_set_itemRenderer'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->selectAll(); - return 0; + if lua_isnil(L, 2) { + cobj->itemRenderer = nullptr; + ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)cobj, (ScriptHandlerMgr::HandlerType)HT_GLIST_RENDERER); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:selectAll",argc, 0); +#if COCOS2D_DEBUG >= 1 + if (!toluafix_isfunction(L, 2, "LUA_FUNCTION", 0, &tolua_err)) + goto tolua_lerror; +#endif + + refid = (toluafix_ref_function(L, 2, 0)); + cobj->itemRenderer = [=](int index, fairygui::GObject *gobject) { + lua_State *coroutine = LuaEngine::getInstance()->getLuaStack()->getLuaState(); + lua_pushinteger(coroutine, index); + object_to_luaval(coroutine, "fairygui.GObject", gobject); + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(refid, 2); + }; + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)cobj, refid, (ScriptHandlerMgr::HandlerType)HT_GLIST_RENDERER); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_selectAll'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_GList_set_itemRenderer'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_getColumnGap(lua_State* tolua_S) +static int lua_fairygui_GList_get_itemProvider(lua_State* L) { - int argc = 0; fairygui::GList* cobj = nullptr; + LUA_FUNCTION refid = -1; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(L,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getColumnGap'", nullptr); + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GList_get_itemProvider'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - int ret = cobj->getColumnGap(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + refid = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)cobj, (ScriptHandlerMgr::HandlerType)HT_GLIST_PROVIDER); + if (refid >= 0) { + toluafix_get_function_by_refid(L, refid); + } else { + lua_pushnil(L); } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getColumnGap",argc, 0); - return 0; + return 1; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getColumnGap'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_GList_get_itemProvider'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_getLineCount(lua_State* tolua_S) +static int lua_fairygui_GList_set_itemProvider(lua_State* L) { - int argc = 0; fairygui::GList* cobj = nullptr; + LUA_FUNCTION refid = -1; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(L,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getLineCount'", nullptr); + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GList_set_itemProvider'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - int ret = cobj->getLineCount(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + if lua_isnil(L, 2) { + cobj->itemProvider = nullptr; + ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)cobj, (ScriptHandlerMgr::HandlerType)HT_GLIST_PROVIDER); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getLineCount",argc, 0); +#if COCOS2D_DEBUG >= 1 + if (!toluafix_isfunction(L, 2, "LUA_FUNCTION", 0, &tolua_err)) + goto tolua_lerror; +#endif + + refid = (toluafix_ref_function(L, 2, 0)); + cobj->itemProvider = [=](int index) -> std::string { + LuaEngine::getInstance()->getLuaStack()->pushFunctionByHandler(refid); + lua_pushinteger(L, index); + int error = lua_pcall(L, 1, 1, 0); // 1 pararm, 1 return + if (error) { + CCLOG("[LUA ERROR] %s", lua_tostring(L, -1)); + lua_pop(L, 1); // remove error message from stack + return ""; + } + std::string rtn = lua_tostring(L, -1); + lua_pop(L, 1); + return rtn; + }; + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)cobj, refid, (ScriptHandlerMgr::HandlerType)HT_GLIST_PROVIDER); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getLineCount'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_GList_set_itemProvider'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_setVirtualAndLoop(lua_State* tolua_S) +static int lua_fairygui_GList_get_scrollItemToViewOnClick(lua_State* L) { - int argc = 0; fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(L,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setVirtualAndLoop'", nullptr); + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GList_get_scrollItemToViewOnClick'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->setVirtualAndLoop(); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setVirtualAndLoop",argc, 0); - return 0; + lua_pushboolean(L, cobj->scrollItemToViewOnClick); + return 1; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setVirtualAndLoop'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_GList_get_scrollItemToViewOnClick'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_setLayout(lua_State* tolua_S) +static int lua_fairygui_GList_set_scrollItemToViewOnClick(lua_State* L) { - int argc = 0; fairygui::GList* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(L,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setLayout'", nullptr); + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GList_set_scrollItemToViewOnClick'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::ListLayoutType arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:setLayout"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setLayout'", nullptr); - return 0; - } - cobj->setLayout(arg0); - return 0; + if lua_isboolean(L, 2) { + cobj->scrollItemToViewOnClick = lua_toboolean(L, 2); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setLayout",argc, 1); - return 0; + luaL_error(L, "fairygui.GList:scrollItemToViewOnClick value type MUST be Boolean!"); #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setLayout'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_GList_set_scrollItemToViewOnClick'.",&tolua_err); #endif + return 0; } -static int lua_fairygui_GList_refreshVirtualList(lua_State* tolua_S) +static int lua_fairygui_GList_get_foldInvisibleItems(lua_State* L) { - int argc = 0; fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(L,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_refreshVirtualList'", nullptr); + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GList_get_foldInvisibleItems'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->refreshVirtualList(); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:refreshVirtualList",argc, 0); - return 0; + lua_pushboolean(L, cobj->foldInvisibleItems); + return 1; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_refreshVirtualList'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_GList_get_foldInvisibleItems'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_removeSelection(lua_State* tolua_S) +static int lua_fairygui_GList_set_foldInvisibleItems(lua_State* L) { - int argc = 0; fairygui::GList* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(L,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GList*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_removeSelection'", nullptr); + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GList_set_foldInvisibleItems'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:removeSelection"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_removeSelection'", nullptr); - return 0; - } - cobj->removeSelection(arg0); - return 0; + if lua_isboolean(L, 2) { + cobj->foldInvisibleItems = lua_toboolean(L, 2); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:removeSelection",argc, 1); - return 0; + luaL_error(L, "fairygui.GList:foldInvisibleItems value type MUST be Boolean!"); #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_removeSelection'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_GList_set_foldInvisibleItems'.",&tolua_err); #endif + return 0; } -static int lua_fairygui_GList_setColumnGap(lua_State* tolua_S) +static int lua_register_fairygui_GList(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"fairygui.GList"); + tolua_cclass(tolua_S,"GList","fairygui.GList","fairygui.GComponent",nullptr); + + tolua_beginmodule(tolua_S,"GList"); + // variable + tolua_variable(tolua_S, "itemRenderer", lua_fairygui_GList_get_itemRenderer, lua_fairygui_GList_set_itemRenderer); + tolua_variable(tolua_S, "itemProvider", lua_fairygui_GList_get_itemProvider, lua_fairygui_GList_set_itemProvider); + tolua_variable(tolua_S, "scrollItemToViewOnClick", lua_fairygui_GList_get_scrollItemToViewOnClick, lua_fairygui_GList_set_scrollItemToViewOnClick); + tolua_variable(tolua_S, "foldInvisibleItems", lua_fairygui_GList_get_foldInvisibleItems, lua_fairygui_GList_set_foldInvisibleItems); + // function + tolua_function(tolua_S,"selectAll",lua_fairygui_GList_selectAll); + tolua_function(tolua_S,"getColumnGap",lua_fairygui_GList_getColumnGap); + tolua_function(tolua_S,"getLineCount",lua_fairygui_GList_getLineCount); + tolua_function(tolua_S,"setVirtualAndLoop",lua_fairygui_GList_setVirtualAndLoop); + tolua_function(tolua_S,"setLayout",lua_fairygui_GList_setLayout); + tolua_function(tolua_S,"refreshVirtualList",lua_fairygui_GList_refreshVirtualList); + tolua_function(tolua_S,"removeSelection",lua_fairygui_GList_removeSelection); + tolua_function(tolua_S,"setColumnGap",lua_fairygui_GList_setColumnGap); + tolua_function(tolua_S,"getColumnCount",lua_fairygui_GList_getColumnCount); + tolua_function(tolua_S,"setVirtual",lua_fairygui_GList_setVirtual); + tolua_function(tolua_S,"setNumItems",lua_fairygui_GList_setNumItems); + tolua_function(tolua_S,"setVerticalAlign",lua_fairygui_GList_setVerticalAlign); + tolua_function(tolua_S,"resizeToFit",lua_fairygui_GList_resizeToFit); + tolua_function(tolua_S,"setSelectionController",lua_fairygui_GList_setSelectionController); + tolua_function(tolua_S,"returnToPool",lua_fairygui_GList_returnToPool); + tolua_function(tolua_S,"clearSelection",lua_fairygui_GList_clearSelection); + tolua_function(tolua_S,"getNumItems",lua_fairygui_GList_getNumItems); + tolua_function(tolua_S,"setColumnCount",lua_fairygui_GList_setColumnCount); + tolua_function(tolua_S,"removeChildToPoolAt",lua_fairygui_GList_removeChildToPoolAt); + tolua_function(tolua_S,"addItemFromPool",lua_fairygui_GList_addItemFromPool); + tolua_function(tolua_S,"selectReverse",lua_fairygui_GList_selectReverse); + tolua_function(tolua_S,"setLineCount",lua_fairygui_GList_setLineCount); + tolua_function(tolua_S,"setAutoResizeItem",lua_fairygui_GList_setAutoResizeItem); + tolua_function(tolua_S,"getVerticalAlign",lua_fairygui_GList_getVerticalAlign); + tolua_function(tolua_S,"removeChildrenToPool",lua_fairygui_GList_removeChildrenToPool); + tolua_function(tolua_S,"setAlign",lua_fairygui_GList_setAlign); + tolua_function(tolua_S,"isVirtual",lua_fairygui_GList_isVirtual); + tolua_function(tolua_S,"getSelectedIndex",lua_fairygui_GList_getSelectedIndex); + tolua_function(tolua_S,"getSelection",lua_fairygui_GList_getSelection); + tolua_function(tolua_S,"itemIndexToChildIndex",lua_fairygui_GList_itemIndexToChildIndex); + tolua_function(tolua_S,"getItemPool",lua_fairygui_GList_getItemPool); + tolua_function(tolua_S,"getSelectionController",lua_fairygui_GList_getSelectionController); + tolua_function(tolua_S,"getLineGap",lua_fairygui_GList_getLineGap); + tolua_function(tolua_S,"scrollToView",lua_fairygui_GList_scrollToView); + tolua_function(tolua_S,"handleArrowKey",lua_fairygui_GList_handleArrowKey); + tolua_function(tolua_S,"getAlign",lua_fairygui_GList_getAlign); + tolua_function(tolua_S,"getFromPool",lua_fairygui_GList_getFromPool); + tolua_function(tolua_S,"getDefaultItem",lua_fairygui_GList_getDefaultItem); + tolua_function(tolua_S,"getSelectionMode",lua_fairygui_GList_getSelectionMode); + tolua_function(tolua_S,"setDefaultItem",lua_fairygui_GList_setDefaultItem); + tolua_function(tolua_S,"setSelectedIndex",lua_fairygui_GList_setSelectedIndex); + tolua_function(tolua_S,"setSelectionMode",lua_fairygui_GList_setSelectionMode); + tolua_function(tolua_S,"addSelection",lua_fairygui_GList_addSelection); + tolua_function(tolua_S,"childIndexToItemIndex",lua_fairygui_GList_childIndexToItemIndex); + tolua_function(tolua_S,"getAutoResizeItem",lua_fairygui_GList_getAutoResizeItem); + tolua_function(tolua_S,"setLineGap",lua_fairygui_GList_setLineGap); + tolua_function(tolua_S,"removeChildToPool",lua_fairygui_GList_removeChildToPool); + tolua_function(tolua_S,"getLayout",lua_fairygui_GList_getLayout); + tolua_function(tolua_S,"create", lua_fairygui_GList_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::GList).name(); + g_luaType[typeName] = "fairygui.GList"; + g_typeCast["GList"] = "fairygui.GList"; + return 1; +} + +static int lua_fairygui_GComboBox_setValue(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; + fairygui::GComboBox* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setColumnGap'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_setValue'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:setColumnGap"); + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GComboBox:setValue"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setColumnGap'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComboBox_setValue'", nullptr); return 0; } - cobj->setColumnGap(arg0); - return 0; + cobj->setValue(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setColumnGap",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:setValue",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setColumnGap'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_setValue'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_getColumnCount(lua_State* tolua_S) +static int lua_fairygui_GComboBox_setSelectedIndex(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; + fairygui::GComboBox* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getColumnCount'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_setSelectedIndex'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - int ret = cobj->getColumnCount(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GComboBox:setSelectedIndex"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComboBox_setSelectedIndex'", nullptr); + return 0; + } + cobj->setSelectedIndex(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getColumnCount",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:setSelectedIndex",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getColumnCount'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_setSelectedIndex'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_setVirtual(lua_State* tolua_S) +static int lua_fairygui_GComboBox_getItems(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; + fairygui::GComboBox* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setVirtual'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_getItems'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - cobj->setVirtual(); - return 0; + std::vector& ret = cobj->getItems(); + ccvector_std_string_to_luaval(tolua_S, ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setVirtual",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:getItems",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setVirtual'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_getItems'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_setNumItems(lua_State* tolua_S) +static int lua_fairygui_GComboBox_getSelectedIndex(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; - bool ok = true; + fairygui::GComboBox* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setNumItems'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_getSelectedIndex'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:setNumItems"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setNumItems'", nullptr); - return 0; - } - cobj->setNumItems(arg0); - return 0; + if (argc == 0) { + int ret = cobj->getSelectedIndex(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setNumItems",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:getSelectedIndex",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setNumItems'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_getSelectedIndex'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_setVerticalAlign(lua_State* tolua_S) +static int lua_fairygui_GComboBox_setTitle(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; + fairygui::GComboBox* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setVerticalAlign'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_setTitle'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::TextVAlignment arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:setVerticalAlign"); + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GComboBox:setTitle"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setVerticalAlign'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComboBox_setTitle'", nullptr); return 0; } - cobj->setVerticalAlign(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setVerticalAlign",argc, 1); - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setVerticalAlign'.",&tolua_err); - return 0; -#endif -} - -static int lua_fairygui_GList_resizeToFit(lua_State* tolua_S) -{ - int argc = 0; - fairygui::GList* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj){ - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_resizeToFit'", nullptr); + cobj->setTitle(arg0); return 0; } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:resizeToFit"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_resizeToFit'", nullptr); - return 0; - } - cobj->resizeToFit(arg0); - return 0; - } - if (argc == 2) { - int arg0; - int arg1; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:resizeToFit"); - ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GList:resizeToFit"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_resizeToFit'", nullptr); - return 0; - } - cobj->resizeToFit(arg0, arg1); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:resizeToFit",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:setTitle",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_resizeToFit'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_setTitle'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_setSelectionController(lua_State* tolua_S) +static int lua_fairygui_GComboBox_refresh(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; - bool ok = true; + fairygui::GComboBox* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setSelectionController'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_refresh'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::GController* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GController",&arg0, "fairygui.GList:setSelectionController"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setSelectionController'", nullptr); - return 0; - } - cobj->setSelectionController(arg0); - return 0; + if (argc == 0) { + cobj->refresh(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setSelectionController",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:refresh",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setSelectionController'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_refresh'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_returnToPool(lua_State* tolua_S) +static int lua_fairygui_GComboBox_getValue(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; - bool ok = true; + fairygui::GComboBox* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_returnToPool'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_getValue'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::GObject* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GList:returnToPool"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_returnToPool'", nullptr); - return 0; - } - cobj->returnToPool(arg0); - return 0; + if (argc == 0) { + const std::string& ret = cobj->getValue(); + lua_pushlstring(tolua_S,ret.c_str(),ret.length()); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:returnToPool",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:getValue",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_returnToPool'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_getValue'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_clearSelection(lua_State* tolua_S) +static int lua_fairygui_GComboBox_getIcons(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; + fairygui::GComboBox* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_clearSelection'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_getIcons'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - cobj->clearSelection(); - return 0; + std::vector& ret = cobj->getIcons(); + ccvector_std_string_to_luaval(tolua_S, ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:clearSelection",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:getIcons",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_clearSelection'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_getIcons'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_getNumItems(lua_State* tolua_S) +static int lua_fairygui_GComboBox_getTitle(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; + fairygui::GComboBox* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getNumItems'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_getTitle'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - int ret = cobj->getNumItems(); - tolua_pushnumber(tolua_S,(lua_Number)ret); + const std::string& ret = cobj->getTitle(); + lua_pushlstring(tolua_S,ret.c_str(),ret.length()); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getNumItems",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:getTitle",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getNumItems'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_getTitle'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_setColumnCount(lua_State* tolua_S) +static int lua_fairygui_GComboBox_getSelectionController(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; - bool ok = true; + fairygui::GComboBox* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setColumnCount'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_getSelectionController'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:setColumnCount"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setColumnCount'", nullptr); - return 0; - } - cobj->setColumnCount(arg0); - return 0; + if (argc == 0) { + fairygui::GController* ret = cobj->getSelectionController(); + object_to_luaval(tolua_S, "fairygui.GController",(fairygui::GController*)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setColumnCount",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:getSelectionController",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setColumnCount'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_getSelectionController'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_removeChildToPoolAt(lua_State* tolua_S) +static int lua_fairygui_GComboBox_getValues(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; - bool ok = true; + fairygui::GComboBox* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_removeChildToPoolAt'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_getValues'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:removeChildToPoolAt"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_removeChildToPoolAt'", nullptr); - return 0; - } - cobj->removeChildToPoolAt(arg0); - return 0; + if (argc == 0) { + std::vector& ret = cobj->getValues(); + ccvector_std_string_to_luaval(tolua_S, ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:removeChildToPoolAt",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:getValues",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_removeChildToPoolAt'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_getValues'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_addItemFromPool(lua_State* tolua_S) +static int lua_fairygui_GComboBox_setSelectionController(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; + fairygui::GComboBox* cobj = nullptr; bool ok = true; - + #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_addItemFromPool'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_setSelectionController'", nullptr); return 0; } #endif - + argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GObject* ret = cobj->addItemFromPool(); - object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); - return 1; - } - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GList:addItemFromPool"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_addItemFromPool'", nullptr); - return 0; - } - fairygui::GObject* ret = cobj->addItemFromPool(arg0); - object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:addItemFromPool",argc, 0); + if (argc == 1) { + fairygui::GController* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GController",&arg0, "fairygui.GComboBox:setSelectionController"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComboBox_setSelectionController'", nullptr); + return 0; + } + cobj->setSelectionController(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:setSelectionController",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_addItemFromPool'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_setSelectionController'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_selectReverse(lua_State* tolua_S) +static int lua_fairygui_GComboBox_setItems(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; + fairygui::GComboBox* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_selectReverse'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_setItems'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->selectReverse(); - return 0; + if (argc == 1) { + std::vector strs; + if (luaval_to_std_vector_string(tolua_S, 2, &strs, "fairygui.GComboBox:setItems")) { + std::vector& ret = cobj->getItems(); + ret.clear(); + ret.assign(strs.begin(), strs.end()); + } + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:selectReverse",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:setItems",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_selectReverse'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_setItems'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_setLineCount(lua_State* tolua_S) +static int lua_fairygui_GComboBox_setIcons(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; - bool ok = true; + fairygui::GComboBox* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setLineCount'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_setIcons'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:setLineCount"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setLineCount'", nullptr); - return 0; + std::vector strs; + if (luaval_to_std_vector_string(tolua_S, 2, &strs, "fairygui.GComboBox:setIcons")) { + std::vector& ret = cobj->getIcons(); + ret.clear(); + ret.assign(strs.begin(), strs.end()); } - cobj->setLineCount(arg0); - return 0; + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setLineCount",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:setIcons",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setLineCount'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_setIcons'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_setAutoResizeItem(lua_State* tolua_S) +static int lua_fairygui_GComboBox_setValues(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; - bool ok = true; + fairygui::GComboBox* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setAutoResizeItem'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_setValues'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GList:setAutoResizeItem"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setAutoResizeItem'", nullptr); - return 0; + std::vector strs; + if (luaval_to_std_vector_string(tolua_S, 2, &strs, "fairygui.GComboBox:setValues")) { + std::vector& ret = cobj->getValues(); + ret.clear(); + ret.assign(strs.begin(), strs.end()); } - cobj->setAutoResizeItem(arg0); - return 0; + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setAutoResizeItem",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:setValues",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setAutoResizeItem'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_setValues'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_getVerticalAlign(lua_State* tolua_S) +static int lua_fairygui_GComboBox_create(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getVerticalAlign'", nullptr); - return 0; - } + if (!tolua_isusertable(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - int ret = (int)cobj->getVerticalAlign(); - tolua_pushnumber(tolua_S,(lua_Number)ret); + argc = lua_gettop(tolua_S) - 1; + if (argc == 0){ + fairygui::GComboBox* ret = fairygui::GComboBox::create(); + object_to_luaval(tolua_S, "fairygui.GComboBox",(fairygui::GComboBox*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getVerticalAlign",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GComboBox:create",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getVerticalAlign'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_create'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_removeChildrenToPool(lua_State* tolua_S) +static int lua_register_fairygui_GComboBox(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"fairygui.GComboBox"); + tolua_cclass(tolua_S,"GComboBox","fairygui.GComboBox","fairygui.GComponent",nullptr); + + tolua_beginmodule(tolua_S,"GComboBox"); + tolua_function(tolua_S,"setValue",lua_fairygui_GComboBox_setValue); + tolua_function(tolua_S,"setSelectedIndex",lua_fairygui_GComboBox_setSelectedIndex); + tolua_function(tolua_S,"getItems",lua_fairygui_GComboBox_getItems); + tolua_function(tolua_S,"getSelectedIndex",lua_fairygui_GComboBox_getSelectedIndex); + tolua_function(tolua_S,"setTitle",lua_fairygui_GComboBox_setTitle); + tolua_function(tolua_S,"refresh",lua_fairygui_GComboBox_refresh); + tolua_function(tolua_S,"getValue",lua_fairygui_GComboBox_getValue); + tolua_function(tolua_S,"getIcons",lua_fairygui_GComboBox_getIcons); + tolua_function(tolua_S,"getTitle",lua_fairygui_GComboBox_getTitle); + tolua_function(tolua_S,"getSelectionController",lua_fairygui_GComboBox_getSelectionController); + tolua_function(tolua_S,"getValues",lua_fairygui_GComboBox_getValues); + tolua_function(tolua_S,"setSelectionController",lua_fairygui_GComboBox_setSelectionController); + tolua_function(tolua_S,"setItems",lua_fairygui_GComboBox_setItems); + tolua_function(tolua_S,"setIcons",lua_fairygui_GComboBox_setIcons); + tolua_function(tolua_S,"setValues",lua_fairygui_GComboBox_setValues); + tolua_function(tolua_S,"create", lua_fairygui_GComboBox_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::GComboBox).name(); + g_luaType[typeName] = "fairygui.GComboBox"; + g_typeCast["GComboBox"] = "fairygui.GComboBox"; + return 1; +} + +static int lua_fairygui_GProgressBar_setValue(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; + fairygui::GProgressBar* cobj = nullptr; bool ok = true; - + #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GProgressBar",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GProgressBar*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj){ - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_removeChildrenToPool'", nullptr); + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GProgressBar_setValue'", nullptr); return 0; } #endif - + argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->removeChildrenToPool(); - return 0; - } - if (argc == 2) { - int arg0; - int arg1; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:removeChildrenToPool"); - ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GList:removeChildrenToPool"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_removeChildrenToPool'", nullptr); - return 0; - } - cobj->removeChildrenToPool(arg0, arg1); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:removeChildrenToPool",argc, 0); + if (argc == 1) { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GProgressBar:setValue"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GProgressBar_setValue'", nullptr); + return 0; + } + cobj->setValue(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GProgressBar:setValue",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_removeChildrenToPool'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GProgressBar_setValue'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_setAlign(lua_State* tolua_S) +static int lua_fairygui_GProgressBar_setMax(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; + fairygui::GProgressBar* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GProgressBar",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GProgressBar*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setAlign'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GProgressBar_setMax'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - cocos2d::TextHAlignment arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:setAlign"); + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GProgressBar:setMax"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setAlign'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GProgressBar_setMax'", nullptr); return 0; } - cobj->setAlign(arg0); - return 0; + cobj->setMax(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setAlign",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GProgressBar:setMax",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setAlign'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GProgressBar_setMax'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_isVirtual(lua_State* tolua_S) +static int lua_fairygui_GProgressBar_getValue(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; + fairygui::GProgressBar* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GProgressBar",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GProgressBar*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_isVirtual'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GProgressBar_getValue'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - bool ret = cobj->isVirtual(); - tolua_pushboolean(tolua_S,(bool)ret); + double ret = cobj->getValue(); + tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:isVirtual",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GProgressBar:getValue",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_isVirtual'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GProgressBar_getValue'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_getSelectedIndex(lua_State* tolua_S) +static int lua_fairygui_GProgressBar_getTitleType(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; + fairygui::GProgressBar* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GProgressBar",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GProgressBar*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getSelectedIndex'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GProgressBar_getTitleType'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - int ret = cobj->getSelectedIndex(); + int ret = (int)cobj->getTitleType(); tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getSelectedIndex",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GProgressBar:getTitleType",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getSelectedIndex'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GProgressBar_getTitleType'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_getSelection(lua_State* tolua_S) +static int lua_fairygui_GProgressBar_tweenValue(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; + fairygui::GProgressBar* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GProgressBar",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GProgressBar*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getSelection'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GProgressBar_tweenValue'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - std::vector arg0; - cobj->getSelection(arg0); - ccvector_int_to_luaval(tolua_S, arg0); - return 1; + if (argc == 2) { + double arg0; + double arg1; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GProgressBar:tweenValue"); + ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.GProgressBar:tweenValue"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GProgressBar_tweenValue'", nullptr); + return 0; + } + cobj->tweenValue(arg0, arg1); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getSelection",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GProgressBar:tweenValue",argc, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getSelection'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GProgressBar_tweenValue'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_itemIndexToChildIndex(lua_State* tolua_S) +static int lua_fairygui_GProgressBar_getMax(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; - bool ok = true; + fairygui::GProgressBar* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GProgressBar",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GProgressBar*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_itemIndexToChildIndex'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GProgressBar_getMax'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:itemIndexToChildIndex"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_itemIndexToChildIndex'", nullptr); - return 0; - } - int ret = cobj->itemIndexToChildIndex(arg0); + if (argc == 0) { + double ret = cobj->getMax(); tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:itemIndexToChildIndex",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GProgressBar:getMax",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_itemIndexToChildIndex'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GProgressBar_getMax'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_getItemPool(lua_State* tolua_S) +static int lua_fairygui_GProgressBar_setTitleType(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; + fairygui::GProgressBar* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GProgressBar",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GProgressBar*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getItemPool'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GProgressBar_setTitleType'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GObjectPool* ret = cobj->getItemPool(); - object_to_luaval(tolua_S, "fairygui.GObjectPool",(fairygui::GObjectPool*)ret); - return 1; + if (argc == 1) { + fairygui::ProgressTitleType arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GProgressBar:setTitleType"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GProgressBar_setTitleType'", nullptr); + return 0; + } + cobj->setTitleType(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getItemPool",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GProgressBar:setTitleType",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getItemPool'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GProgressBar_setTitleType'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_getSelectionController(lua_State* tolua_S) +static int lua_fairygui_GProgressBar_setMin(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; + fairygui::GProgressBar* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GProgressBar",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GProgressBar*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getSelectionController'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GProgressBar_setMin'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GController* ret = cobj->getSelectionController(); - object_to_luaval(tolua_S, "fairygui.GController",(fairygui::GController*)ret); - return 1; + if (argc == 1) { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GProgressBar:setMin"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GProgressBar_setMin'", nullptr); + return 0; + } + cobj->setMin(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getSelectionController",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GProgressBar:setMin",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getSelectionController'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GProgressBar_setMin'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_getLineGap(lua_State* tolua_S) +static int lua_fairygui_GProgressBar_getMin(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; + fairygui::GProgressBar* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GProgressBar",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GProgressBar*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getLineGap'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GProgressBar_getMin'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - int ret = cobj->getLineGap(); + double ret = cobj->getMin(); tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getLineGap",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GProgressBar:getMin",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getLineGap'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GProgressBar_getMin'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_scrollToView(lua_State* tolua_S) +static int lua_fairygui_GProgressBar_create(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; - bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_scrollToView'", nullptr); - return 0; - } + if (!tolua_isusertable(tolua_S,1,"fairygui.GProgressBar",0,&tolua_err)) goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:scrollToView"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_scrollToView'", nullptr); - return 0; - } - cobj->scrollToView(arg0); - return 0; - } - if (argc == 2) { - int arg0; - bool arg1; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:scrollToView"); - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.GList:scrollToView"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_scrollToView'", nullptr); - return 0; - } - cobj->scrollToView(arg0, arg1); - return 0; - } - if (argc == 3) { - int arg0; - bool arg1; - bool arg2; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:scrollToView"); - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.GList:scrollToView"); - ok &= luaval_to_boolean(tolua_S, 4,&arg2, "fairygui.GList:scrollToView"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_scrollToView'", nullptr); - return 0; - } - cobj->scrollToView(arg0, arg1, arg2); - return 0; + argc = lua_gettop(tolua_S) - 1; + if (argc == 0){ + fairygui::GProgressBar* ret = fairygui::GProgressBar::create(); + object_to_luaval(tolua_S, "fairygui.GProgressBar",(fairygui::GProgressBar*)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:scrollToView",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GProgressBar:create",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_scrollToView'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GProgressBar_create'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_handleArrowKey(lua_State* tolua_S) +int lua_register_fairygui_GProgressBar(lua_State* tolua_S) { - int argc = 0; - fairygui::GList* cobj = nullptr; - bool ok = true; + tolua_usertype(tolua_S,"fairygui.GProgressBar"); + tolua_cclass(tolua_S,"GProgressBar","fairygui.GProgressBar","fairygui.GComponent",nullptr); + + tolua_beginmodule(tolua_S,"GProgressBar"); + tolua_function(tolua_S,"setTitleType",lua_fairygui_GProgressBar_setTitleType); + tolua_function(tolua_S,"getTitleType",lua_fairygui_GProgressBar_getTitleType); + tolua_function(tolua_S,"setMin",lua_fairygui_GProgressBar_setMin); + tolua_function(tolua_S,"getMin",lua_fairygui_GProgressBar_getMin); + tolua_function(tolua_S,"getMax",lua_fairygui_GProgressBar_getMax); + tolua_function(tolua_S,"setMax",lua_fairygui_GProgressBar_setMax); + tolua_function(tolua_S,"setValue",lua_fairygui_GProgressBar_setValue); + tolua_function(tolua_S,"getValue",lua_fairygui_GProgressBar_getValue); + tolua_function(tolua_S,"tweenValue",lua_fairygui_GProgressBar_tweenValue); + tolua_function(tolua_S,"create", lua_fairygui_GProgressBar_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::GProgressBar).name(); + g_luaType[typeName] = "fairygui.GProgressBar"; + g_typeCast["GProgressBar"] = "fairygui.GProgressBar"; + return 1; +} + +static int lua_fairygui_GSlider_get_changeOnClick(lua_State* L) +{ + fairygui::GSlider* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(L,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GSlider*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_handleArrowKey'", nullptr); + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GSlider_get_changeOnClick'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:handleArrowKey"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_handleArrowKey'", nullptr); - return 0; - } - cobj->handleArrowKey(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:handleArrowKey",argc, 1); - return 0; + lua_pushboolean(L, cobj->changeOnClick); + return 1; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_handleArrowKey'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_GSlider_get_changeOnClick'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_getAlign(lua_State* tolua_S) +static int lua_fairygui_GSlider_set_changeOnClick(lua_State* L) { - int argc = 0; - fairygui::GList* cobj = nullptr; + fairygui::GSlider* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(L,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GSlider*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getAlign'", nullptr); + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GSlider_set_changeOnClick'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - int ret = (int)cobj->getAlign(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getAlign",argc, 0); + cobj->changeOnClick = lua_toboolean(L, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getAlign'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_GSlider_set_changeOnClick'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_getFromPool(lua_State* tolua_S) +static int lua_fairygui_GSlider_get_canDrag(lua_State* L) { - int argc = 0; - fairygui::GList* cobj = nullptr; - bool ok = true; - + fairygui::GSlider* cobj = nullptr; + #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(L,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GSlider*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getFromPool'", nullptr); + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GSlider_get_canDrag'", nullptr); return 0; } #endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GObject* ret = cobj->getFromPool(); - object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); - return 1; - } - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GList:getFromPool"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_getFromPool'", nullptr); - return 0; - } - fairygui::GObject* ret = cobj->getFromPool(arg0); - object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getFromPool",argc, 0); - return 0; + + lua_pushboolean(L, cobj->canDrag); + return 1; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getFromPool'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_GSlider_get_canDrag'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_getDefaultItem(lua_State* tolua_S) +static int lua_fairygui_GSlider_set_canDrag(lua_State* L) { - int argc = 0; - fairygui::GList* cobj = nullptr; + fairygui::GSlider* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(L,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GSlider*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getDefaultItem'", nullptr); + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GSlider_set_canDrag'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - const std::string& ret = cobj->getDefaultItem(); - lua_pushlstring(tolua_S,ret.c_str(),ret.length()); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getDefaultItem",argc, 0); + cobj->canDrag = lua_toboolean(L, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getDefaultItem'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_GSlider_set_canDrag'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_getSelectionMode(lua_State* tolua_S) +static int lua_fairygui_GSlider_setValue(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; + fairygui::GSlider* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GSlider*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getSelectionMode'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GSlider_setValue'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - int ret = (int)cobj->getSelectionMode(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + if (argc == 1) { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GSlider:setValue"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GSlider_setValue'", nullptr); + return 0; + } + cobj->setValue(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getSelectionMode",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GSlider:setValue",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getSelectionMode'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GSlider_setValue'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_setDefaultItem(lua_State* tolua_S) +static int lua_fairygui_GSlider_setMax(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; + fairygui::GSlider* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GSlider*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setDefaultItem'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GSlider_setMax'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GList:setDefaultItem"); + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GSlider:setMax"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setDefaultItem'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GSlider_setMax'", nullptr); return 0; } - cobj->setDefaultItem(arg0); - return 0; + cobj->setMax(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setDefaultItem",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GSlider:setMax",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setDefaultItem'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GSlider_setMax'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_setSelectedIndex(lua_State* tolua_S) +static int lua_fairygui_GSlider_getValue(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; - bool ok = true; + fairygui::GSlider* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GSlider*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setSelectedIndex'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GSlider_getValue'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:setSelectedIndex"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setSelectedIndex'", nullptr); - return 0; - } - cobj->setSelectedIndex(arg0); - return 0; + if (argc == 0) { + double ret = cobj->getValue(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setSelectedIndex",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GSlider:getValue",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setSelectedIndex'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GSlider_getValue'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_setSelectionMode(lua_State* tolua_S) +static int lua_fairygui_GSlider_getTitleType(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; - bool ok = true; + fairygui::GSlider* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GSlider*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setSelectionMode'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GSlider_getTitleType'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::ListSelectionMode arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:setSelectionMode"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setSelectionMode'", nullptr); - return 0; - } - cobj->setSelectionMode(arg0); - return 0; + if (argc == 0) { + int ret = (int)cobj->getTitleType(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setSelectionMode",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GSlider:getTitleType",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setSelectionMode'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GSlider_getTitleType'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_addSelection(lua_State* tolua_S) +static int lua_fairygui_GSlider_getMax(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; - bool ok = true; + fairygui::GSlider* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GSlider*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_addSelection'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GSlider_getMax'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - int arg0; - bool arg1; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:addSelection"); - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.GList:addSelection"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_addSelection'", nullptr); - return 0; - } - cobj->addSelection(arg0, arg1); - return 0; + if (argc == 0) { + double ret = cobj->getMax(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:addSelection",argc, 2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GSlider:getMax",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_addSelection'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GSlider_getMax'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_childIndexToItemIndex(lua_State* tolua_S) +static int lua_fairygui_GSlider_setTitleType(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; + fairygui::GSlider* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GSlider*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_childIndexToItemIndex'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GSlider_setTitleType'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:childIndexToItemIndex"); + fairygui::ProgressTitleType arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GSlider:setTitleType"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_childIndexToItemIndex'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GSlider_setTitleType'", nullptr); return 0; } - int ret = cobj->childIndexToItemIndex(arg0); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + cobj->setTitleType(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:childIndexToItemIndex",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GSlider:setTitleType",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_childIndexToItemIndex'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GSlider_setTitleType'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_getAutoResizeItem(lua_State* tolua_S) +static int lua_fairygui_GSlider_getMin(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; + fairygui::GSlider* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GSlider*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getAutoResizeItem'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GSlider_getMin'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - bool ret = cobj->getAutoResizeItem(); - tolua_pushboolean(tolua_S,(bool)ret); + double ret = cobj->getMin(); + tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getAutoResizeItem",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GSlider:getMin",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getAutoResizeItem'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GSlider_getMin'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_setLineGap(lua_State* tolua_S) +static int lua_fairygui_GSlider_setMin(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; + fairygui::GSlider* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GSlider*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_setLineGap'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GSlider_setMin'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GList:setLineGap"); + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GSlider:setMin"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_setLineGap'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GSlider_setMin'", nullptr); return 0; } - cobj->setLineGap(arg0); - return 0; + cobj->setMin(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:setLineGap",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GSlider:setMin",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_setLineGap'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GSlider_setMin'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_removeChildToPool(lua_State* tolua_S) +static int lua_fairygui_GSlider_getWholeNumbers(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; - bool ok = true; + fairygui::GSlider* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GSlider*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_removeChildToPool'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GSlider_getWholeNumbers'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::GObject* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GList:removeChildToPool"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GList_removeChildToPool'", nullptr); - return 0; - } - cobj->removeChildToPool(arg0); - return 0; + if (argc == 0) { + bool ret = cobj->getWholeNumbers(); + tolua_pushboolean(tolua_S,(int)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:removeChildToPool",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GSlider:getWholeNumbers",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_removeChildToPool'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GSlider_getWholeNumbers'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_getLayout(lua_State* tolua_S) +static int lua_fairygui_GSlider_setWholeNumbers(lua_State* tolua_S) { int argc = 0; - fairygui::GList* cobj = nullptr; + fairygui::GSlider* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GSlider*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GList_getLayout'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GSlider_setWholeNumbers'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - int ret = (int)cobj->getLayout(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2, &arg0, "fairygui.GSlider:setWholeNumbers"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GSlider_setWholeNumbers'", nullptr); + return 0; + } + cobj->setWholeNumbers(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GList:getLayout",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GSlider:setWholeNumbers",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_getLayout'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GSlider_setWholeNumbers'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_create(lua_State* tolua_S) +static int lua_fairygui_GSlider_create(lua_State* tolua_S) { int argc = 0; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertable(tolua_S,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; #endif argc = lua_gettop(tolua_S) - 1; if (argc == 0){ - fairygui::GList* ret = fairygui::GList::create(); - object_to_luaval(tolua_S, "fairygui.GList",(fairygui::GList*)ret); + fairygui::GSlider* ret = fairygui::GSlider::create(); + object_to_luaval(tolua_S, "fairygui.GSlider",(fairygui::GSlider*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GList:create",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GSlider:create",argc, 0); return 0; - + #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GList_create'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GSlider_create'.",&tolua_err); + return 0; #endif } -typedef enum { - GLIST_ITEM_RENDERER, - GLIST_ITEM_PROVIDER, - GTREE_NODE_RENDERER, // GTree is expend from list - GTREE_NODE_WILLEXPAND -} GList_HandlerType; - -static int lua_fairygui_GList_get_itemRenderer(lua_State* L) +static int lua_register_fairygui_GSlider(lua_State* tolua_S) { - fairygui::GList* cobj = nullptr; - int refid = -1; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::GList*)tolua_tousertype(L,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GList_get_itemRenderer'", nullptr); - return 0; - } -#endif - - // GLIST_ITEM_RENDERER is a HandlerType - refid = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)cobj, (ScriptHandlerMgr::HandlerType)GLIST_ITEM_RENDERER); - if (refid >= 0) { - toluafix_get_function_by_refid(L, refid); - } else { - lua_pushnil(L); - } - return 1; + tolua_usertype(tolua_S,"fairygui.GSlider"); + tolua_cclass(tolua_S,"GSlider","fairygui.GSlider","fairygui.GComponent",nullptr); -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_GList_get_itemRenderer'.",&tolua_err); - return 0; -#endif + tolua_beginmodule(tolua_S,"GSlider"); + // variable + tolua_variable(tolua_S, "changeOnClick", lua_fairygui_GSlider_get_changeOnClick, lua_fairygui_GSlider_set_changeOnClick); + tolua_variable(tolua_S, "canDrag", lua_fairygui_GSlider_get_canDrag, lua_fairygui_GSlider_set_canDrag); + // function + tolua_function(tolua_S,"getTitleType",lua_fairygui_GSlider_getTitleType); + tolua_function(tolua_S,"setTitleType",lua_fairygui_GSlider_setTitleType); + tolua_function(tolua_S,"getMin",lua_fairygui_GSlider_getMin); + tolua_function(tolua_S,"setMin",lua_fairygui_GSlider_setMin); + tolua_function(tolua_S,"getMax",lua_fairygui_GSlider_getMax); + tolua_function(tolua_S,"setMax",lua_fairygui_GSlider_setMax); + tolua_function(tolua_S,"getValue",lua_fairygui_GSlider_getValue); + tolua_function(tolua_S,"setValue",lua_fairygui_GSlider_setValue); + tolua_function(tolua_S,"getWholeNumbers",lua_fairygui_GSlider_getWholeNumbers); + tolua_function(tolua_S,"setWholeNumbers",lua_fairygui_GSlider_setWholeNumbers); + tolua_function(tolua_S,"create", lua_fairygui_GSlider_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::GSlider).name(); + g_luaType[typeName] = "fairygui.GSlider"; + g_typeCast["GSlider"] = "fairygui.GSlider"; + return 1; } -static int lua_fairygui_GList_set_itemRenderer(lua_State* L) +static int lua_fairygui_GScrollBar_setScrollPane(lua_State* tolua_S) { - fairygui::GList* cobj = nullptr; - LUA_FUNCTION refid = -1; + int argc = 0; + fairygui::GScrollBar* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GScrollBar",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(L,1,0); + cobj = (fairygui::GScrollBar*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GList_set_itemRenderer'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GScrollBar_setScrollPane'", nullptr); + return 0; + } #endif - if lua_isnil(L, 2) { - cobj->itemRenderer = nullptr; - ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)cobj, (ScriptHandlerMgr::HandlerType)GLIST_ITEM_RENDERER); - return 0; - } -#if COCOS2D_DEBUG >= 1 - if (!toluafix_isfunction(L, 2, "LUA_FUNCTION", 0, &tolua_err)) - goto tolua_lerror; -#endif - - refid = (toluafix_ref_function(L, 2, 0)); - cobj->itemRenderer = [=](int index, fairygui::GObject *gobject) { - lua_pushinteger(L, index); - object_to_luaval(L, "fairygui.GObject", gobject); - LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(refid, 2); - }; - // GLIST_ITEM_RENDERER is a HandlerType - ScriptHandlerMgr::getInstance()->addObjectHandler((void*)cobj, refid, (ScriptHandlerMgr::HandlerType)GLIST_ITEM_RENDERER); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 2) { + fairygui::ScrollPane* arg0; + bool arg1; + ok &= luaval_to_object(tolua_S, 2, "fairygui.ScrollPane",&arg0, "fairygui.GScrollBar:setScrollPane"); + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.GScrollBar:setScrollPane"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GScrollBar_setScrollPane'", nullptr); + return 0; + } + cobj->setScrollPane(arg0, arg1); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GScrollBar:setScrollPane",argc, 2); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_GList_set_itemRenderer'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GScrollBar_setScrollPane'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_get_itemProvider(lua_State* L) +static int lua_fairygui_GScrollBar_setDisplayPerc(lua_State* tolua_S) { - fairygui::GList* cobj = nullptr; - LUA_FUNCTION refid = -1; + int argc = 0; + fairygui::GScrollBar* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GScrollBar",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(L,1,0); + cobj = (fairygui::GScrollBar*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GList_get_itemProvider'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GScrollBar_setDisplayPerc'", nullptr); + return 0; + } #endif - // GLIST_ITEM_PROVIDER is a HandlerType - refid = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)cobj, (ScriptHandlerMgr::HandlerType)GLIST_ITEM_PROVIDER); - if (refid >= 0) { - toluafix_get_function_by_refid(L, refid); - } else { - lua_pushnil(L); - } - return 1; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GScrollBar:setDisplayPerc"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GScrollBar_setDisplayPerc'", nullptr); + return 0; + } + cobj->setDisplayPerc(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GScrollBar:setDisplayPerc",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_GList_get_itemProvider'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GScrollBar_setDisplayPerc'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_set_itemProvider(lua_State* L) +static int lua_fairygui_GScrollBar_getMinSize(lua_State* tolua_S) { - fairygui::GList* cobj = nullptr; - LUA_FUNCTION refid = -1; + int argc = 0; + fairygui::GScrollBar* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GScrollBar",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(L,1,0); + cobj = (fairygui::GScrollBar*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GList_set_itemProvider'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GScrollBar_getMinSize'", nullptr); + return 0; + } #endif - if lua_isnil(L, 2) { - cobj->itemProvider = nullptr; - ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)cobj, (ScriptHandlerMgr::HandlerType)GLIST_ITEM_PROVIDER); - return 0; - } -#if COCOS2D_DEBUG >= 1 - if (!toluafix_isfunction(L, 2, "LUA_FUNCTION", 0, &tolua_err)) - goto tolua_lerror; -#endif - - refid = (toluafix_ref_function(L, 2, 0)); - cobj->itemProvider = [=](int index) -> std::string { - LuaEngine::getInstance()->getLuaStack()->pushFunctionByHandler(refid); - lua_pushinteger(L, index); - int error = lua_pcall(L, 1, 1, 0); // 1 pararm, 1 return - if (error) { - CCLOG("[LUA ERROR] %s", lua_tostring(L, -1)); - lua_pop(L, 1); // remove error message from stack - return ""; - } - std::string rtn = lua_tostring(L, -1); - lua_pop(L, 1); - return rtn; - }; - // GLIST_ITEM_PROVIDER is a HandlerType - ScriptHandlerMgr::getInstance()->addObjectHandler((void*)cobj, refid, (ScriptHandlerMgr::HandlerType)GLIST_ITEM_PROVIDER); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + double ret = cobj->getMinSize(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GScrollBar:getMinSize",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_GList_set_itemProvider'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GScrollBar_getMinSize'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_get_scrollItemToViewOnClick(lua_State* L) +static int lua_fairygui_GScrollBar_setScrollPerc(lua_State* tolua_S) { - fairygui::GList* cobj = nullptr; + int argc = 0; + fairygui::GScrollBar* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GScrollBar",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(L,1,0); + cobj = (fairygui::GScrollBar*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GList_get_scrollItemToViewOnClick'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GScrollBar_setScrollPerc'", nullptr); + return 0; + } #endif - lua_pushboolean(L, cobj->scrollItemToViewOnClick); - return 1; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GScrollBar:setScrollPerc"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GScrollBar_setScrollPerc'", nullptr); + return 0; + } + cobj->setScrollPerc(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GScrollBar:setScrollPerc",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_GList_get_scrollItemToViewOnClick'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GScrollBar_setScrollPerc'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_set_scrollItemToViewOnClick(lua_State* L) +static int lua_fairygui_GScrollBar_create(lua_State* tolua_S) { - fairygui::GList* cobj = nullptr; + int argc = 0; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::GList*)tolua_tousertype(L,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GList_set_scrollItemToViewOnClick'", nullptr); - return 0; - } + tolua_Error tolua_err; + if (!tolua_isusertable(tolua_S,1,"fairygui.GScrollBar",0,&tolua_err)) goto tolua_lerror; #endif - if lua_isboolean(L, 2) { - cobj->scrollItemToViewOnClick = lua_toboolean(L, 2); - return 0; - } - luaL_error(L, "fairygui.GList:scrollItemToViewOnClick value type MUST be Boolean!"); + argc = lua_gettop(tolua_S) - 1; + if (argc == 0){ + fairygui::GScrollBar* ret = fairygui::GScrollBar::create(); + object_to_luaval(tolua_S, "fairygui.GScrollBar",(fairygui::GScrollBar*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GScrollBar:create",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_GList_set_scrollItemToViewOnClick'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GScrollBar_create'.",&tolua_err); + return 0; #endif - return 0; } -static int lua_fairygui_GList_get_foldInvisibleItems(lua_State* L) +static int lua_register_fairygui_GScrollBar(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"fairygui.GScrollBar"); + tolua_cclass(tolua_S,"GScrollBar","fairygui.GScrollBar","fairygui.GComponent",nullptr); + + tolua_beginmodule(tolua_S,"GScrollBar"); + tolua_function(tolua_S,"setScrollPane",lua_fairygui_GScrollBar_setScrollPane); + tolua_function(tolua_S,"setDisplayPerc",lua_fairygui_GScrollBar_setDisplayPerc); + tolua_function(tolua_S,"getMinSize",lua_fairygui_GScrollBar_getMinSize); + tolua_function(tolua_S,"setScrollPerc",lua_fairygui_GScrollBar_setScrollPerc); + tolua_function(tolua_S,"create", lua_fairygui_GScrollBar_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::GScrollBar).name(); + g_luaType[typeName] = "fairygui.GScrollBar"; + g_typeCast["GScrollBar"] = "fairygui.GScrollBar"; + return 1; +} + +static int lua_fairygui_Window_getCloseButton(lua_State* tolua_S) { - fairygui::GList* cobj = nullptr; + int argc = 0; + fairygui::Window* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(L,1,0); + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GList_get_foldInvisibleItems'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_getCloseButton'", nullptr); + return 0; + } #endif - lua_pushboolean(L, cobj->foldInvisibleItems); - return 1; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::GObject* ret = cobj->getCloseButton(); + object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:getCloseButton",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_GList_get_foldInvisibleItems'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_getCloseButton'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GList_set_foldInvisibleItems(lua_State* L) +static int lua_fairygui_Window_getContentPane(lua_State* tolua_S) { - fairygui::GList* cobj = nullptr; + int argc = 0; + fairygui::Window* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.GList",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GList*)tolua_tousertype(L,1,0); + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GList_set_foldInvisibleItems'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_getContentPane'", nullptr); + return 0; + } #endif - if lua_isboolean(L, 2) { - cobj->foldInvisibleItems = lua_toboolean(L, 2); - return 0; - } - luaL_error(L, "fairygui.GList:foldInvisibleItems value type MUST be Boolean!"); + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::GComponent* ret = cobj->getContentPane(); + object_to_luaval(tolua_S, "fairygui.GComponent",(fairygui::GComponent*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:getContentPane",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_GList_set_foldInvisibleItems'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_getContentPane'.",&tolua_err); + return 0; #endif - return 0; -} - -static int lua_register_fairygui_GList(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.GList"); - tolua_cclass(tolua_S,"GList","fairygui.GList","fairygui.GComponent",nullptr); - - tolua_beginmodule(tolua_S,"GList"); - // variable - tolua_variable(tolua_S, "itemRenderer", lua_fairygui_GList_get_itemRenderer, lua_fairygui_GList_set_itemRenderer); - tolua_variable(tolua_S, "itemProvider", lua_fairygui_GList_get_itemProvider, lua_fairygui_GList_set_itemProvider); - tolua_variable(tolua_S, "scrollItemToViewOnClick", lua_fairygui_GList_get_scrollItemToViewOnClick, lua_fairygui_GList_set_scrollItemToViewOnClick); - tolua_variable(tolua_S, "foldInvisibleItems", lua_fairygui_GList_get_foldInvisibleItems, lua_fairygui_GList_set_foldInvisibleItems); - // function - tolua_function(tolua_S,"selectAll",lua_fairygui_GList_selectAll); - tolua_function(tolua_S,"getColumnGap",lua_fairygui_GList_getColumnGap); - tolua_function(tolua_S,"getLineCount",lua_fairygui_GList_getLineCount); - tolua_function(tolua_S,"setVirtualAndLoop",lua_fairygui_GList_setVirtualAndLoop); - tolua_function(tolua_S,"setLayout",lua_fairygui_GList_setLayout); - tolua_function(tolua_S,"refreshVirtualList",lua_fairygui_GList_refreshVirtualList); - tolua_function(tolua_S,"removeSelection",lua_fairygui_GList_removeSelection); - tolua_function(tolua_S,"setColumnGap",lua_fairygui_GList_setColumnGap); - tolua_function(tolua_S,"getColumnCount",lua_fairygui_GList_getColumnCount); - tolua_function(tolua_S,"setVirtual",lua_fairygui_GList_setVirtual); - tolua_function(tolua_S,"setNumItems",lua_fairygui_GList_setNumItems); - tolua_function(tolua_S,"setVerticalAlign",lua_fairygui_GList_setVerticalAlign); - tolua_function(tolua_S,"resizeToFit",lua_fairygui_GList_resizeToFit); - tolua_function(tolua_S,"setSelectionController",lua_fairygui_GList_setSelectionController); - tolua_function(tolua_S,"returnToPool",lua_fairygui_GList_returnToPool); - tolua_function(tolua_S,"clearSelection",lua_fairygui_GList_clearSelection); - tolua_function(tolua_S,"getNumItems",lua_fairygui_GList_getNumItems); - tolua_function(tolua_S,"setColumnCount",lua_fairygui_GList_setColumnCount); - tolua_function(tolua_S,"removeChildToPoolAt",lua_fairygui_GList_removeChildToPoolAt); - tolua_function(tolua_S,"addItemFromPool",lua_fairygui_GList_addItemFromPool); - tolua_function(tolua_S,"selectReverse",lua_fairygui_GList_selectReverse); - tolua_function(tolua_S,"setLineCount",lua_fairygui_GList_setLineCount); - tolua_function(tolua_S,"setAutoResizeItem",lua_fairygui_GList_setAutoResizeItem); - tolua_function(tolua_S,"getVerticalAlign",lua_fairygui_GList_getVerticalAlign); - tolua_function(tolua_S,"removeChildrenToPool",lua_fairygui_GList_removeChildrenToPool); - tolua_function(tolua_S,"setAlign",lua_fairygui_GList_setAlign); - tolua_function(tolua_S,"isVirtual",lua_fairygui_GList_isVirtual); - tolua_function(tolua_S,"getSelectedIndex",lua_fairygui_GList_getSelectedIndex); - tolua_function(tolua_S,"getSelection",lua_fairygui_GList_getSelection); - tolua_function(tolua_S,"itemIndexToChildIndex",lua_fairygui_GList_itemIndexToChildIndex); - tolua_function(tolua_S,"getItemPool",lua_fairygui_GList_getItemPool); - tolua_function(tolua_S,"getSelectionController",lua_fairygui_GList_getSelectionController); - tolua_function(tolua_S,"getLineGap",lua_fairygui_GList_getLineGap); - tolua_function(tolua_S,"scrollToView",lua_fairygui_GList_scrollToView); - tolua_function(tolua_S,"handleArrowKey",lua_fairygui_GList_handleArrowKey); - tolua_function(tolua_S,"getAlign",lua_fairygui_GList_getAlign); - tolua_function(tolua_S,"getFromPool",lua_fairygui_GList_getFromPool); - tolua_function(tolua_S,"getDefaultItem",lua_fairygui_GList_getDefaultItem); - tolua_function(tolua_S,"getSelectionMode",lua_fairygui_GList_getSelectionMode); - tolua_function(tolua_S,"setDefaultItem",lua_fairygui_GList_setDefaultItem); - tolua_function(tolua_S,"setSelectedIndex",lua_fairygui_GList_setSelectedIndex); - tolua_function(tolua_S,"setSelectionMode",lua_fairygui_GList_setSelectionMode); - tolua_function(tolua_S,"addSelection",lua_fairygui_GList_addSelection); - tolua_function(tolua_S,"childIndexToItemIndex",lua_fairygui_GList_childIndexToItemIndex); - tolua_function(tolua_S,"getAutoResizeItem",lua_fairygui_GList_getAutoResizeItem); - tolua_function(tolua_S,"setLineGap",lua_fairygui_GList_setLineGap); - tolua_function(tolua_S,"removeChildToPool",lua_fairygui_GList_removeChildToPool); - tolua_function(tolua_S,"getLayout",lua_fairygui_GList_getLayout); - tolua_function(tolua_S,"create", lua_fairygui_GList_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::GList).name(); - g_luaType[typeName] = "fairygui.GList"; - g_typeCast["GList"] = "fairygui.GList"; - return 1; } -static int lua_fairygui_GComboBox_setValue(lua_State* tolua_S) +static int lua_fairygui_Window_show(lua_State* tolua_S) { int argc = 0; - fairygui::GComboBox* cobj = nullptr; - bool ok = true; + fairygui::Window* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_setValue'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_show'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GComboBox:setValue"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComboBox_setValue'", nullptr); - return 0; - } - cobj->setValue(arg0); - return 0; + if (argc == 0) { + cobj->show(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:setValue",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:show",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_setValue'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_show'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComboBox_setSelectedIndex(lua_State* tolua_S) +static int lua_fairygui_Window_isTop(lua_State* tolua_S) { int argc = 0; - fairygui::GComboBox* cobj = nullptr; - bool ok = true; + fairygui::Window* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_setSelectedIndex'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_isTop'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GComboBox:setSelectedIndex"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComboBox_setSelectedIndex'", nullptr); - return 0; - } - cobj->setSelectedIndex(arg0); - return 0; + if (argc == 0) { + bool ret = cobj->isTop(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:setSelectedIndex",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:isTop",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_setSelectedIndex'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_isTop'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComboBox_getItems(lua_State* tolua_S) +static int lua_fairygui_Window_hideImmediately(lua_State* tolua_S) { int argc = 0; - fairygui::GComboBox* cobj = nullptr; + fairygui::Window* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_getItems'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_hideImmediately'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - std::vector& ret = cobj->getItems(); - ccvector_std_string_to_luaval(tolua_S, ret); - return 1; + cobj->hideImmediately(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:getItems",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:hideImmediately",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_getItems'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_hideImmediately'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComboBox_getSelectedIndex(lua_State* tolua_S) +static int lua_fairygui_Window_toggleStatus(lua_State* tolua_S) { int argc = 0; - fairygui::GComboBox* cobj = nullptr; + fairygui::Window* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_getSelectedIndex'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_toggleStatus'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - int ret = cobj->getSelectedIndex(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + cobj->toggleStatus(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:getSelectedIndex",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:toggleStatus",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_getSelectedIndex'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_toggleStatus'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComboBox_setTitle(lua_State* tolua_S) +static int lua_fairygui_Window_hide(lua_State* tolua_S) { int argc = 0; - fairygui::GComboBox* cobj = nullptr; - bool ok = true; + fairygui::Window* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_setTitle'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_hide'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GComboBox:setTitle"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComboBox_setTitle'", nullptr); - return 0; - } - cobj->setTitle(arg0); - return 0; + if (argc == 0) { + cobj->hide(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:setTitle",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:hide",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_setTitle'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_hide'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComboBox_refresh(lua_State* tolua_S) +static int lua_fairygui_Window_getFrame(lua_State* tolua_S) { int argc = 0; - fairygui::GComboBox* cobj = nullptr; + fairygui::Window* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_refresh'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_getFrame'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - cobj->refresh(); - return 0; + fairygui::GComponent* ret = cobj->getFrame(); + object_to_luaval(tolua_S, "fairygui.GComponent",(fairygui::GComponent*)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:refresh",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:getFrame",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_refresh'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_getFrame'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComboBox_getValue(lua_State* tolua_S) +static int lua_fairygui_Window_isShowing(lua_State* tolua_S) { int argc = 0; - fairygui::GComboBox* cobj = nullptr; + fairygui::Window* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_getValue'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_isShowing'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - const std::string& ret = cobj->getValue(); - lua_pushlstring(tolua_S,ret.c_str(),ret.length()); + bool ret = cobj->isShowing(); + tolua_pushboolean(tolua_S,(bool)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:getValue",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:isShowing",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_getValue'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_isShowing'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComboBox_getIcons(lua_State* tolua_S) +static int lua_fairygui_Window_closeModalWait(lua_State* tolua_S) { int argc = 0; - fairygui::GComboBox* cobj = nullptr; + fairygui::Window* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_getIcons'", nullptr); + if (!cobj){ + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_closeModalWait'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - std::vector& ret = cobj->getIcons(); - ccvector_std_string_to_luaval(tolua_S, ret); + bool ret = cobj->closeModalWait(); + tolua_pushboolean(tolua_S,(bool)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:getIcons",argc, 0); + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.Window:closeModalWait"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Window_closeModalWait'", nullptr); + return 0; + } + bool ret = cobj->closeModalWait(arg0); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:closeModalWait",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_getIcons'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_closeModalWait'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComboBox_getTitle(lua_State* tolua_S) +static int lua_fairygui_Window_initWindow(lua_State* tolua_S) { int argc = 0; - fairygui::GComboBox* cobj = nullptr; + fairygui::Window* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_getTitle'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_initWindow'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - const std::string& ret = cobj->getTitle(); - lua_pushlstring(tolua_S,ret.c_str(),ret.length()); - return 1; + cobj->initWindow(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:getTitle",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:initWindow",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_getTitle'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_initWindow'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComboBox_getSelectionController(lua_State* tolua_S) +static int lua_fairygui_Window_setContentArea(lua_State* tolua_S) { int argc = 0; - fairygui::GComboBox* cobj = nullptr; + fairygui::Window* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_getSelectionController'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_setContentArea'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GController* ret = cobj->getSelectionController(); - object_to_luaval(tolua_S, "fairygui.GController",(fairygui::GController*)ret); - return 1; + if (argc == 1) { + fairygui::GObject* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.Window:setContentArea"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Window_setContentArea'", nullptr); + return 0; + } + cobj->setContentArea(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:getSelectionController",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:setContentArea",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_getSelectionController'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_setContentArea'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComboBox_getValues(lua_State* tolua_S) +static int lua_fairygui_Window_setDragArea(lua_State* tolua_S) { int argc = 0; - fairygui::GComboBox* cobj = nullptr; + fairygui::Window* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_getValues'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_setDragArea'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - std::vector& ret = cobj->getValues(); - ccvector_std_string_to_luaval(tolua_S, ret); - return 1; + if (argc == 1) { + fairygui::GObject* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.Window:setDragArea"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Window_setDragArea'", nullptr); + return 0; + } + cobj->setDragArea(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:getValues",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:setDragArea",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_getValues'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_setDragArea'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComboBox_setSelectionController(lua_State* tolua_S) +static int lua_fairygui_Window_setContentPane(lua_State* tolua_S) { int argc = 0; - fairygui::GComboBox* cobj = nullptr; + fairygui::Window* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_setSelectionController'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_setContentPane'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - fairygui::GController* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GController",&arg0, "fairygui.GComboBox:setSelectionController"); + fairygui::GComponent* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GComponent",&arg0, "fairygui.Window:setContentPane"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GComboBox_setSelectionController'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Window_setContentPane'", nullptr); return 0; } - cobj->setSelectionController(arg0); - return 0; + cobj->setContentPane(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:setSelectionController",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:setContentPane",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_setSelectionController'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_setContentPane'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComboBox_setItems(lua_State* tolua_S) +static int lua_fairygui_Window_isModal(lua_State* tolua_S) { - int argc = 0; - fairygui::GComboBox* cobj = nullptr; + int argc = 0; + fairygui::Window* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_setItems'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_isModal'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - std::vector strs; - if (luaval_to_std_vector_string(tolua_S, 2, &strs, "fairygui.GComboBox:setItems")) { - std::vector& ret = cobj->getItems(); - ret.clear(); - ret.assign(strs.begin(), strs.end()); - } - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:setItems",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + bool ret = cobj->isModal(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:isModal",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_setItems'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_isModal'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComboBox_setIcons(lua_State* tolua_S) +static int lua_fairygui_Window_isBringToFrontOnClick(lua_State* tolua_S) { - int argc = 0; - fairygui::GComboBox* cobj = nullptr; + int argc = 0; + fairygui::Window* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_setIcons'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_isBringToFrontOnClick'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - std::vector strs; - if (luaval_to_std_vector_string(tolua_S, 2, &strs, "fairygui.GComboBox:setIcons")) { - std::vector& ret = cobj->getIcons(); - ret.clear(); - ret.assign(strs.begin(), strs.end()); - } - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:setIcons",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + bool ret = cobj->isBringToFrontOnClick(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:isBringToFrontOnClick",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_setIcons'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_isBringToFrontOnClick'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComboBox_setValues(lua_State* tolua_S) +static int lua_fairygui_Window_getContentArea(lua_State* tolua_S) { - int argc = 0; - fairygui::GComboBox* cobj = nullptr; + int argc = 0; + fairygui::Window* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GComboBox*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GComboBox_setValues'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_getContentArea'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - std::vector strs; - if (luaval_to_std_vector_string(tolua_S, 2, &strs, "fairygui.GComboBox:setValues")) { - std::vector& ret = cobj->getValues(); - ret.clear(); - ret.assign(strs.begin(), strs.end()); - } - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GComboBox:setValues",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::GObject* ret = cobj->getContentArea(); + object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:getContentArea",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_setValues'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_getContentArea'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GComboBox_create(lua_State* tolua_S) +static int lua_fairygui_Window_setBringToFrontOnClick(lua_State* tolua_S) { int argc = 0; + fairygui::Window* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.GComboBox",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_setBringToFrontOnClick'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S) - 1; - if (argc == 0){ - fairygui::GComboBox* ret = fairygui::GComboBox::create(); - object_to_luaval(tolua_S, "fairygui.GComboBox",(fairygui::GComboBox*)ret); - return 1; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.Window:setBringToFrontOnClick"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Window_setBringToFrontOnClick'", nullptr); + return 0; + } + cobj->setBringToFrontOnClick(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GComboBox:create",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:setBringToFrontOnClick",argc, 1); return 0; - + #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GComboBox_create'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_setBringToFrontOnClick'.",&tolua_err); + return 0; #endif } -static int lua_register_fairygui_GComboBox(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.GComboBox"); - tolua_cclass(tolua_S,"GComboBox","fairygui.GComboBox","fairygui.GComponent",nullptr); - - tolua_beginmodule(tolua_S,"GComboBox"); - tolua_function(tolua_S,"setValue",lua_fairygui_GComboBox_setValue); - tolua_function(tolua_S,"setSelectedIndex",lua_fairygui_GComboBox_setSelectedIndex); - tolua_function(tolua_S,"getItems",lua_fairygui_GComboBox_getItems); - tolua_function(tolua_S,"getSelectedIndex",lua_fairygui_GComboBox_getSelectedIndex); - tolua_function(tolua_S,"setTitle",lua_fairygui_GComboBox_setTitle); - tolua_function(tolua_S,"refresh",lua_fairygui_GComboBox_refresh); - tolua_function(tolua_S,"getValue",lua_fairygui_GComboBox_getValue); - tolua_function(tolua_S,"getIcons",lua_fairygui_GComboBox_getIcons); - tolua_function(tolua_S,"getTitle",lua_fairygui_GComboBox_getTitle); - tolua_function(tolua_S,"getSelectionController",lua_fairygui_GComboBox_getSelectionController); - tolua_function(tolua_S,"getValues",lua_fairygui_GComboBox_getValues); - tolua_function(tolua_S,"setSelectionController",lua_fairygui_GComboBox_setSelectionController); - tolua_function(tolua_S,"setItems",lua_fairygui_GComboBox_setItems); - tolua_function(tolua_S,"setIcons",lua_fairygui_GComboBox_setIcons); - tolua_function(tolua_S,"setValues",lua_fairygui_GComboBox_setValues); - tolua_function(tolua_S,"create", lua_fairygui_GComboBox_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::GComboBox).name(); - g_luaType[typeName] = "fairygui.GComboBox"; - g_typeCast["GComboBox"] = "fairygui.GComboBox"; - return 1; -} - -static int lua_fairygui_GProgressBar_setValue(lua_State* tolua_S) +static int lua_fairygui_Window_setModal(lua_State* tolua_S) { int argc = 0; - fairygui::GProgressBar* cobj = nullptr; + fairygui::Window* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GProgressBar",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GProgressBar*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GProgressBar_setValue'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_setModal'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GProgressBar:setValue"); + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.Window:setModal"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GProgressBar_setValue'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Window_setModal'", nullptr); return 0; } - cobj->setValue(arg0); - return 0; + cobj->setModal(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GProgressBar:setValue",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:setModal",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GProgressBar_setValue'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_setModal'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GProgressBar_setMax(lua_State* tolua_S) +static int lua_fairygui_Window_getModalWaitingPane(lua_State* tolua_S) { int argc = 0; - fairygui::GProgressBar* cobj = nullptr; - bool ok = true; + fairygui::Window* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GProgressBar",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GProgressBar*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GProgressBar_setMax'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_getModalWaitingPane'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GProgressBar:setMax"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GProgressBar_setMax'", nullptr); - return 0; - } - cobj->setMax(arg0); - return 0; + if (argc == 0) { + fairygui::GObject* ret = cobj->getModalWaitingPane(); + object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GProgressBar:setMax",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:getModalWaitingPane",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GProgressBar_setMax'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_getModalWaitingPane'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GProgressBar_getValue(lua_State* tolua_S) +static int lua_fairygui_Window_getDragArea(lua_State* tolua_S) { int argc = 0; - fairygui::GProgressBar* cobj = nullptr; + fairygui::Window* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GProgressBar",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GProgressBar*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GProgressBar_getValue'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_getDragArea'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - double ret = cobj->getValue(); - tolua_pushnumber(tolua_S,(lua_Number)ret); + fairygui::GObject* ret = cobj->getDragArea(); + object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GProgressBar:getValue",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:getDragArea",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GProgressBar_getValue'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_getDragArea'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GProgressBar_getTitleType(lua_State* tolua_S) +static int lua_fairygui_Window_bringToFront(lua_State* tolua_S) { int argc = 0; - fairygui::GProgressBar* cobj = nullptr; + fairygui::Window* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GProgressBar",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GProgressBar*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GProgressBar_getTitleType'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_bringToFront'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - int ret = (int)cobj->getTitleType(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + cobj->bringToFront(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GProgressBar:getTitleType",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:bringToFront",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GProgressBar_getTitleType'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_bringToFront'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GProgressBar_tweenValue(lua_State* tolua_S) +static int lua_fairygui_Window_showModalWait(lua_State* tolua_S) { int argc = 0; - fairygui::GProgressBar* cobj = nullptr; + fairygui::Window* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GProgressBar",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GProgressBar*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GProgressBar_tweenValue'", nullptr); + if (!cobj){ + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_showModalWait'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - double arg0; - double arg1; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GProgressBar:tweenValue"); - ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.GProgressBar:tweenValue"); + if (argc == 0) { + cobj->showModalWait(); + return 0; + } + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.Window:showModalWait"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GProgressBar_tweenValue'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Window_showModalWait'", nullptr); return 0; } - cobj->tweenValue(arg0, arg1); - return 0; + cobj->showModalWait(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GProgressBar:tweenValue",argc, 2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:showModalWait",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GProgressBar_tweenValue'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_showModalWait'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GProgressBar_getMax(lua_State* tolua_S) +static int lua_fairygui_Window_setCloseButton(lua_State* tolua_S) { int argc = 0; - fairygui::GProgressBar* cobj = nullptr; + fairygui::Window* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GProgressBar",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GProgressBar*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GProgressBar_getMax'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_setCloseButton'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - double ret = cobj->getMax(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + if (argc == 1) { + fairygui::GObject* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.Window:setCloseButton"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Window_setCloseButton'", nullptr); + return 0; + } + cobj->setCloseButton(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GProgressBar:getMax",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:setCloseButton",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GProgressBar_getMax'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_setCloseButton'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GProgressBar_setTitleType(lua_State* tolua_S) +static int lua_fairygui_Window_addUISource(lua_State* tolua_S) { int argc = 0; - fairygui::GProgressBar* cobj = nullptr; + fairygui::Window* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GProgressBar",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GProgressBar*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GProgressBar_setTitleType'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_addUISource'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - fairygui::ProgressTitleType arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GProgressBar:setTitleType"); + fairygui::IUISource* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.IUISource",&arg0, "fairygui.Window:addUISource"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GProgressBar_setTitleType'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Window_addUISource'", nullptr); return 0; } - cobj->setTitleType(arg0); - return 0; + cobj->addUISource(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GProgressBar:setTitleType",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:addUISource",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GProgressBar_setTitleType'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_addUISource'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GProgressBar_setMin(lua_State* tolua_S) +static int lua_fairygui_Window_create(lua_State* tolua_S) { - int argc = 0; - fairygui::GProgressBar* cobj = nullptr; - bool ok = true; + int argc = 0; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GProgressBar",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::GProgressBar*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GProgressBar_setMin'", nullptr); - return 0; - } + tolua_Error tolua_err; + if (!tolua_isusertable(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GProgressBar:setMin"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GProgressBar_setMin'", nullptr); - return 0; - } - cobj->setMin(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GProgressBar:setMin",argc, 1); - return 0; + argc = lua_gettop(tolua_S) - 1; + if (argc == 0){ + fairygui::Window* ret = fairygui::Window::create(); + object_to_luaval(tolua_S, "fairygui.Window",(fairygui::Window*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.Window:create",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GProgressBar_setMin'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_create'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GProgressBar_getMin(lua_State* tolua_S) +static int lua_register_fairygui_Window(lua_State* tolua_S) { - int argc = 0; - fairygui::GProgressBar* cobj = nullptr; + tolua_usertype(tolua_S,"fairygui.Window"); + tolua_cclass(tolua_S,"Window","fairygui.Window","fairygui.GComponent",nullptr); + + tolua_beginmodule(tolua_S,"Window"); + tolua_function(tolua_S,"getCloseButton",lua_fairygui_Window_getCloseButton); + tolua_function(tolua_S,"getContentPane",lua_fairygui_Window_getContentPane); + tolua_function(tolua_S,"show",lua_fairygui_Window_show); + tolua_function(tolua_S,"isTop",lua_fairygui_Window_isTop); + tolua_function(tolua_S,"hideImmediately",lua_fairygui_Window_hideImmediately); + tolua_function(tolua_S,"toggleStatus",lua_fairygui_Window_toggleStatus); + tolua_function(tolua_S,"hide",lua_fairygui_Window_hide); + tolua_function(tolua_S,"getFrame",lua_fairygui_Window_getFrame); + tolua_function(tolua_S,"isShowing",lua_fairygui_Window_isShowing); + tolua_function(tolua_S,"closeModalWait",lua_fairygui_Window_closeModalWait); + tolua_function(tolua_S,"initWindow",lua_fairygui_Window_initWindow); + tolua_function(tolua_S,"setContentArea",lua_fairygui_Window_setContentArea); + tolua_function(tolua_S,"setDragArea",lua_fairygui_Window_setDragArea); + tolua_function(tolua_S,"setContentPane",lua_fairygui_Window_setContentPane); + tolua_function(tolua_S,"isModal",lua_fairygui_Window_isModal); + tolua_function(tolua_S,"isBringToFrontOnClick",lua_fairygui_Window_isBringToFrontOnClick); + tolua_function(tolua_S,"getContentArea",lua_fairygui_Window_getContentArea); + tolua_function(tolua_S,"setBringToFrontOnClick",lua_fairygui_Window_setBringToFrontOnClick); + tolua_function(tolua_S,"setModal",lua_fairygui_Window_setModal); + tolua_function(tolua_S,"getModalWaitingPane",lua_fairygui_Window_getModalWaitingPane); + tolua_function(tolua_S,"getDragArea",lua_fairygui_Window_getDragArea); + tolua_function(tolua_S,"bringToFront",lua_fairygui_Window_bringToFront); + tolua_function(tolua_S,"showModalWait",lua_fairygui_Window_showModalWait); + tolua_function(tolua_S,"setCloseButton",lua_fairygui_Window_setCloseButton); + tolua_function(tolua_S,"addUISource",lua_fairygui_Window_addUISource); + tolua_function(tolua_S,"create", lua_fairygui_Window_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::Window).name(); + g_luaType[typeName] = "fairygui.Window"; + g_typeCast["Window"] = "fairygui.Window"; + return 1; +} + +static int lua_fairygui_GRoot_closeAllWindows(lua_State* tolua_S) +{ + int argc = 0; + fairygui::GRoot* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GProgressBar",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GProgressBar*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GProgressBar_getMin'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_closeAllWindows'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - double ret = cobj->getMin(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GProgressBar:getMin",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cobj->closeAllWindows(); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:closeAllWindows",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GProgressBar_getMin'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_closeAllWindows'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GProgressBar_create(lua_State* tolua_S) +static int lua_fairygui_GRoot_hideTooltips(lua_State* tolua_S) { int argc = 0; + fairygui::GRoot* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.GProgressBar",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_hideTooltips'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S) - 1; - if (argc == 0){ - fairygui::GProgressBar* ret = fairygui::GProgressBar::create(); - object_to_luaval(tolua_S, "fairygui.GProgressBar",(fairygui::GProgressBar*)ret); - return 1; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cobj->hideTooltips(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GProgressBar:create",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:hideTooltips",argc, 0); return 0; - + #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GProgressBar_create'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_hideTooltips'.",&tolua_err); + return 0; #endif } -int lua_register_fairygui_GProgressBar(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.GProgressBar"); - tolua_cclass(tolua_S,"GProgressBar","fairygui.GProgressBar","fairygui.GComponent",nullptr); - - tolua_beginmodule(tolua_S,"GProgressBar"); - tolua_function(tolua_S,"setTitleType",lua_fairygui_GProgressBar_setTitleType); - tolua_function(tolua_S,"getTitleType",lua_fairygui_GProgressBar_getTitleType); - tolua_function(tolua_S,"setMin",lua_fairygui_GProgressBar_setMin); - tolua_function(tolua_S,"getMin",lua_fairygui_GProgressBar_getMin); - tolua_function(tolua_S,"getMax",lua_fairygui_GProgressBar_getMax); - tolua_function(tolua_S,"setMax",lua_fairygui_GProgressBar_setMax); - tolua_function(tolua_S,"setValue",lua_fairygui_GProgressBar_setValue); - tolua_function(tolua_S,"getValue",lua_fairygui_GProgressBar_getValue); - tolua_function(tolua_S,"tweenValue",lua_fairygui_GProgressBar_tweenValue); - tolua_function(tolua_S,"create", lua_fairygui_GProgressBar_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::GProgressBar).name(); - g_luaType[typeName] = "fairygui.GProgressBar"; - g_typeCast["GProgressBar"] = "fairygui.GProgressBar"; - return 1; -} - -static int lua_fairygui_GSlider_get_changeOnClick(lua_State* L) +static int lua_fairygui_GRoot_hasAnyPopup(lua_State* tolua_S) { - fairygui::GSlider* cobj = nullptr; + int argc = 0; + fairygui::GRoot* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GSlider*)tolua_tousertype(L,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GSlider_get_changeOnClick'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_hasAnyPopup'", nullptr); + return 0; + } #endif - lua_pushboolean(L, cobj->changeOnClick); - return 1; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + bool ret = cobj->hasAnyPopup(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:hasAnyPopup",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_GSlider_get_changeOnClick'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_hasAnyPopup'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GSlider_set_changeOnClick(lua_State* L) +static int lua_fairygui_GRoot_getTopWindow(lua_State* tolua_S) { - fairygui::GSlider* cobj = nullptr; + int argc = 0; + fairygui::GRoot* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GSlider*)tolua_tousertype(L,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GSlider_set_changeOnClick'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_getTopWindow'", nullptr); + return 0; + } #endif - cobj->changeOnClick = lua_toboolean(L, 2); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::Window* ret = cobj->getTopWindow(); + object_to_luaval(tolua_S, "fairygui.Window",(fairygui::Window*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:getTopWindow",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_GSlider_set_changeOnClick'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_getTopWindow'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GSlider_get_canDrag(lua_State* L) +static int lua_fairygui_GRoot_hidePopup(lua_State* tolua_S) { - fairygui::GSlider* cobj = nullptr; + int argc = 0; + fairygui::GRoot* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GSlider*)tolua_tousertype(L,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GSlider_get_canDrag'", nullptr); - return 0; - } + if (!cobj){ + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_hidePopup'", nullptr); + return 0; + } #endif - lua_pushboolean(L, cobj->canDrag); - return 1; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cobj->hidePopup(); + return 0; + } + if (argc == 1) { + fairygui::GObject* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GRoot:hidePopup"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_hidePopup'", nullptr); + return 0; + } + cobj->hidePopup(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:hidePopup",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_GSlider_get_canDrag'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_hidePopup'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GSlider_set_canDrag(lua_State* L) +static int lua_fairygui_GRoot_closeAllExceptModals(lua_State* tolua_S) { - fairygui::GSlider* cobj = nullptr; + int argc = 0; + fairygui::GRoot* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GSlider*)tolua_tousertype(L,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GSlider_set_canDrag'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_closeAllExceptModals'", nullptr); + return 0; + } #endif - cobj->canDrag = lua_toboolean(L, 2); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cobj->closeAllExceptModals(); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:closeAllExceptModals",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_GSlider_set_canDrag'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_closeAllExceptModals'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GSlider_setValue(lua_State* tolua_S) +static int lua_fairygui_GRoot_showPopup(lua_State* tolua_S) { int argc = 0; - fairygui::GSlider* cobj = nullptr; + fairygui::GRoot* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GSlider*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GSlider_setValue'", nullptr); + if (!cobj){ + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_showPopup'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GSlider:setValue"); + fairygui::GObject* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GRoot:showPopup"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GSlider_setValue'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_showPopup'", nullptr); return 0; } - cobj->setValue(arg0); - return 0; + cobj->showPopup(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GSlider:setValue",argc, 1); + if (argc == 3) { + fairygui::GObject* arg0; + fairygui::GObject* arg1; + fairygui::PopupDirection arg2; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GRoot:showPopup"); + ok &= luaval_to_object(tolua_S, 3, "fairygui.GObject",&arg1, "fairygui.GRoot:showPopup"); + ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "fairygui.GRoot:showPopup"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_showPopup'", nullptr); + return 0; + } + cobj->showPopup(arg0, arg1, arg2); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:showPopup",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GSlider_setValue'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_showPopup'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GSlider_setMax(lua_State* tolua_S) +static int lua_fairygui_GRoot_showTooltipsWin(lua_State* tolua_S) { int argc = 0; - fairygui::GSlider* cobj = nullptr; + fairygui::GRoot* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GSlider*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GSlider_setMax'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_showTooltipsWin'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GSlider:setMax"); + fairygui::GObject* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GRoot:showTooltipsWin"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GSlider_setMax'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_showTooltipsWin'", nullptr); return 0; } - cobj->setMax(arg0); - return 0; + cobj->showTooltipsWin(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GSlider:setMax",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:showTooltipsWin",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GSlider_setMax'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_showTooltipsWin'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GSlider_getValue(lua_State* tolua_S) +static int lua_fairygui_GRoot_closeModalWait(lua_State* tolua_S) { int argc = 0; - fairygui::GSlider* cobj = nullptr; + fairygui::GRoot* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GSlider*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GSlider_getValue'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_closeModalWait'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - double ret = cobj->getValue(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + cobj->closeModalWait(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GSlider:getValue",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:closeModalWait",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GSlider_getValue'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_closeModalWait'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GSlider_getTitleType(lua_State* tolua_S) +static int lua_fairygui_GRoot_getInputProcessor(lua_State* tolua_S) { int argc = 0; - fairygui::GSlider* cobj = nullptr; + fairygui::GRoot* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GSlider*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GSlider_getTitleType'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_getInputProcessor'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - int ret = (int)cobj->getTitleType(); - tolua_pushnumber(tolua_S,(lua_Number)ret); + fairygui::InputProcessor* ret = cobj->getInputProcessor(); + object_to_luaval(tolua_S, "fairygui.InputProcessor",(fairygui::InputProcessor*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GSlider:getTitleType",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:getInputProcessor",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GSlider_getTitleType'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_getInputProcessor'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GSlider_getMax(lua_State* tolua_S) +static int lua_fairygui_GRoot_getSoundVolumeScale(lua_State* tolua_S) { int argc = 0; - fairygui::GSlider* cobj = nullptr; + fairygui::GRoot* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GSlider*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GSlider_getMax'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_getSoundVolumeScale'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - double ret = cobj->getMax(); + double ret = cobj->getSoundVolumeScale(); tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GSlider:getMax",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:getSoundVolumeScale",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GSlider_getMax'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_getSoundVolumeScale'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GSlider_setTitleType(lua_State* tolua_S) +static int lua_fairygui_GRoot_togglePopup(lua_State* tolua_S) { int argc = 0; - fairygui::GSlider* cobj = nullptr; + fairygui::GRoot* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GSlider*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GSlider_setTitleType'", nullptr); + if (!cobj){ + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_togglePopup'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - fairygui::ProgressTitleType arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GSlider:setTitleType"); + fairygui::GObject* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GRoot:togglePopup"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GSlider_setTitleType'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_togglePopup'", nullptr); return 0; } - cobj->setTitleType(arg0); - return 0; + cobj->togglePopup(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GSlider:setTitleType",argc, 1); + if (argc == 3) { + fairygui::GObject* arg0; + fairygui::GObject* arg1; + fairygui::PopupDirection arg2; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GRoot:togglePopup"); + ok &= luaval_to_object(tolua_S, 3, "fairygui.GObject",&arg1, "fairygui.GRoot:togglePopup"); + ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "fairygui.GRoot:togglePopup"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_togglePopup'", nullptr); + return 0; + } + cobj->togglePopup(arg0, arg1, arg2); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:togglePopup",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GSlider_setTitleType'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_togglePopup'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GSlider_getMin(lua_State* tolua_S) +static int lua_fairygui_GRoot_isSoundEnabled(lua_State* tolua_S) { - int argc = 0; - fairygui::GSlider* cobj = nullptr; + int argc = 0; + fairygui::GRoot* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GSlider*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GSlider_getMin'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_isSoundEnabled'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - double ret = cobj->getMin(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GSlider:getMin",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + bool ret = cobj->isSoundEnabled(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:isSoundEnabled",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GSlider_getMin'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_isSoundEnabled'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GSlider_setMin(lua_State* tolua_S) +static int lua_fairygui_GRoot_setSoundVolumeScale(lua_State* tolua_S) { - int argc = 0; - fairygui::GSlider* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GRoot* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GSlider*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GSlider_setMin'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_setSoundVolumeScale'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GSlider:setMin"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GSlider_setMin'", nullptr); - return 0; - } - cobj->setMin(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GSlider:setMin",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GRoot:setSoundVolumeScale"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_setSoundVolumeScale'", nullptr); + return 0; + } + cobj->setSoundVolumeScale(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:setSoundVolumeScale",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GSlider_setMin'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_setSoundVolumeScale'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GSlider_getWholeNumbers(lua_State* tolua_S) +static int lua_fairygui_GRoot_getTouchTarget(lua_State* tolua_S) { - int argc = 0; - fairygui::GSlider* cobj = nullptr; + int argc = 0; + fairygui::GRoot* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GSlider*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GSlider_getWholeNumbers'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_getTouchTarget'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - bool ret = cobj->getWholeNumbers(); - tolua_pushboolean(tolua_S,(int)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GSlider:getWholeNumbers",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::GObject* ret = cobj->getTouchTarget(); + object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:getTouchTarget",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GSlider_getWholeNumbers'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_getTouchTarget'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GSlider_setWholeNumbers(lua_State* tolua_S) +static int lua_fairygui_GRoot_hideWindowImmediately(lua_State* tolua_S) { - int argc = 0; - fairygui::GSlider* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GRoot* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GSlider*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GSlider_setWholeNumbers'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_hideWindowImmediately'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2, &arg0, "fairygui.GSlider:setWholeNumbers"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GSlider_setWholeNumbers'", nullptr); - return 0; - } - cobj->setWholeNumbers(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GSlider:setWholeNumbers",argc, 1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + fairygui::Window* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.Window",&arg0, "fairygui.GRoot:hideWindowImmediately"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_hideWindowImmediately'", nullptr); + return 0; + } + cobj->hideWindowImmediately(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:hideWindowImmediately",argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GSlider_setWholeNumbers'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_hideWindowImmediately'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GSlider_create(lua_State* tolua_S) +static int lua_fairygui_GRoot_getModalLayer(lua_State* tolua_S) { int argc = 0; + fairygui::GRoot* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.GSlider",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_getModalLayer'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S) - 1; - if (argc == 0){ - fairygui::GSlider* ret = fairygui::GSlider::create(); - object_to_luaval(tolua_S, "fairygui.GSlider",(fairygui::GSlider*)ret); + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::GGraph* ret = cobj->getModalLayer(); + object_to_luaval(tolua_S, "fairygui.GGraph",(fairygui::GGraph*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GSlider:create",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:getModalLayer",argc, 0); return 0; - + #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GSlider_create'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_getModalLayer'.",&tolua_err); + return 0; #endif } -static int lua_register_fairygui_GSlider(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.GSlider"); - tolua_cclass(tolua_S,"GSlider","fairygui.GSlider","fairygui.GComponent",nullptr); - - tolua_beginmodule(tolua_S,"GSlider"); - // variable - tolua_variable(tolua_S, "changeOnClick", lua_fairygui_GSlider_get_changeOnClick, lua_fairygui_GSlider_set_changeOnClick); - tolua_variable(tolua_S, "canDrag", lua_fairygui_GSlider_get_canDrag, lua_fairygui_GSlider_set_canDrag); - // function - tolua_function(tolua_S,"getTitleType",lua_fairygui_GSlider_getTitleType); - tolua_function(tolua_S,"setTitleType",lua_fairygui_GSlider_setTitleType); - tolua_function(tolua_S,"getMin",lua_fairygui_GSlider_getMin); - tolua_function(tolua_S,"setMin",lua_fairygui_GSlider_setMin); - tolua_function(tolua_S,"getMax",lua_fairygui_GSlider_getMax); - tolua_function(tolua_S,"setMax",lua_fairygui_GSlider_setMax); - tolua_function(tolua_S,"getValue",lua_fairygui_GSlider_getValue); - tolua_function(tolua_S,"setValue",lua_fairygui_GSlider_setValue); - tolua_function(tolua_S,"getWholeNumbers",lua_fairygui_GSlider_getWholeNumbers); - tolua_function(tolua_S,"setWholeNumbers",lua_fairygui_GSlider_setWholeNumbers); - tolua_function(tolua_S,"create", lua_fairygui_GSlider_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::GSlider).name(); - g_luaType[typeName] = "fairygui.GSlider"; - g_typeCast["GSlider"] = "fairygui.GSlider"; - return 1; -} - -static int lua_fairygui_GScrollBar_setScrollPane(lua_State* tolua_S) +static int lua_fairygui_GRoot_playSound(lua_State* tolua_S) { int argc = 0; - fairygui::GScrollBar* cobj = nullptr; + fairygui::GRoot* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GScrollBar",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GScrollBar*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GScrollBar_setScrollPane'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_playSound'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GRoot:playSound"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_playSound'", nullptr); + return 0; + } + cobj->playSound(arg0); + return 0; + } if (argc == 2) { - fairygui::ScrollPane* arg0; - bool arg1; - ok &= luaval_to_object(tolua_S, 2, "fairygui.ScrollPane",&arg0, "fairygui.GScrollBar:setScrollPane"); - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.GScrollBar:setScrollPane"); + std::string arg0; + double arg1; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GRoot:playSound"); + ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.GRoot:playSound"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GScrollBar_setScrollPane'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_playSound'", nullptr); return 0; } - cobj->setScrollPane(arg0, arg1); - return 0; + cobj->playSound(arg0, arg1); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GScrollBar:setScrollPane",argc, 2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:playSound",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GScrollBar_setScrollPane'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_playSound'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GScrollBar_setDisplayPerc(lua_State* tolua_S) +static int lua_fairygui_GRoot_getModalWaitingPane(lua_State* tolua_S) { int argc = 0; - fairygui::GScrollBar* cobj = nullptr; - bool ok = true; + fairygui::GRoot* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GScrollBar",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GScrollBar*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GScrollBar_setDisplayPerc'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_getModalWaitingPane'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GScrollBar:setDisplayPerc"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GScrollBar_setDisplayPerc'", nullptr); - return 0; - } - cobj->setDisplayPerc(arg0); - return 0; + if (argc == 0) { + fairygui::GObject* ret = cobj->getModalWaitingPane(); + object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GScrollBar:setDisplayPerc",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:getModalWaitingPane",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GScrollBar_setDisplayPerc'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_getModalWaitingPane'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GScrollBar_getMinSize(lua_State* tolua_S) +static int lua_fairygui_GRoot_setSoundEnabled(lua_State* tolua_S) { int argc = 0; - fairygui::GScrollBar* cobj = nullptr; + fairygui::GRoot* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GScrollBar",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GScrollBar*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GScrollBar_getMinSize'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_setSoundEnabled'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - double ret = cobj->getMinSize(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GRoot:setSoundEnabled"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_setSoundEnabled'", nullptr); + return 0; + } + cobj->setSoundEnabled(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GScrollBar:getMinSize",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:setSoundEnabled",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GScrollBar_getMinSize'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_setSoundEnabled'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GScrollBar_setScrollPerc(lua_State* tolua_S) +static int lua_fairygui_GRoot_bringToFront(lua_State* tolua_S) { int argc = 0; - fairygui::GScrollBar* cobj = nullptr; + fairygui::GRoot* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GScrollBar",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GScrollBar*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GScrollBar_setScrollPerc'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_bringToFront'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GScrollBar:setScrollPerc"); + fairygui::Window* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.Window",&arg0, "fairygui.GRoot:bringToFront"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GScrollBar_setScrollPerc'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_bringToFront'", nullptr); return 0; } - cobj->setScrollPerc(arg0); - return 0; + cobj->bringToFront(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GScrollBar:setScrollPerc",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:bringToFront",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GScrollBar_setScrollPerc'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_bringToFront'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GScrollBar_create(lua_State* tolua_S) +static int lua_fairygui_GRoot_hasModalWindow(lua_State* tolua_S) { int argc = 0; + fairygui::GRoot* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.GScrollBar",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_hasModalWindow'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S) - 1; - if (argc == 0){ - fairygui::GScrollBar* ret = fairygui::GScrollBar::create(); - object_to_luaval(tolua_S, "fairygui.GScrollBar",(fairygui::GScrollBar*)ret); + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + bool ret = cobj->hasModalWindow(); + tolua_pushboolean(tolua_S,(bool)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GScrollBar:create",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:hasModalWindow",argc, 0); return 0; - + #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GScrollBar_create'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_hasModalWindow'.",&tolua_err); + return 0; #endif } -static int lua_register_fairygui_GScrollBar(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.GScrollBar"); - tolua_cclass(tolua_S,"GScrollBar","fairygui.GScrollBar","fairygui.GComponent",nullptr); - - tolua_beginmodule(tolua_S,"GScrollBar"); - tolua_function(tolua_S,"setScrollPane",lua_fairygui_GScrollBar_setScrollPane); - tolua_function(tolua_S,"setDisplayPerc",lua_fairygui_GScrollBar_setDisplayPerc); - tolua_function(tolua_S,"getMinSize",lua_fairygui_GScrollBar_getMinSize); - tolua_function(tolua_S,"setScrollPerc",lua_fairygui_GScrollBar_setScrollPerc); - tolua_function(tolua_S,"create", lua_fairygui_GScrollBar_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::GScrollBar).name(); - g_luaType[typeName] = "fairygui.GScrollBar"; - g_typeCast["GScrollBar"] = "fairygui.GScrollBar"; - return 1; -} - -static int lua_fairygui_Window_getCloseButton(lua_State* tolua_S) +static int lua_fairygui_GRoot_showModalWait(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; + fairygui::GRoot* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_getCloseButton'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_showModalWait'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - fairygui::GObject* ret = cobj->getCloseButton(); - object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); - return 1; + cobj->showModalWait(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:getCloseButton",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:showModalWait",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_getCloseButton'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_showModalWait'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_getContentPane(lua_State* tolua_S) +static int lua_fairygui_GRoot_isModalWaiting(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; + fairygui::GRoot* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_getContentPane'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_isModalWaiting'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - fairygui::GComponent* ret = cobj->getContentPane(); - object_to_luaval(tolua_S, "fairygui.GComponent",(fairygui::GComponent*)ret); + bool ret = cobj->isModalWaiting(); + tolua_pushboolean(tolua_S,(bool)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:getContentPane",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:isModalWaiting",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_getContentPane'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_isModalWaiting'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_show(lua_State* tolua_S) +static int lua_fairygui_GRoot_getTouchPosition(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; + fairygui::GRoot* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_show'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_getTouchPosition'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->show(); - return 0; + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GRoot:getTouchPosition"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_getTouchPosition'", nullptr); + return 0; + } + cocos2d::Vec2 ret = cobj->getTouchPosition(arg0); + vec2_to_luaval(tolua_S, ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:show",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:getTouchPosition",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_show'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_getTouchPosition'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_isTop(lua_State* tolua_S) +static int lua_fairygui_GRoot_getPoupPosition(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; + fairygui::GRoot* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_isTop'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_getPoupPosition'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - bool ret = cobj->isTop(); - tolua_pushboolean(tolua_S,(bool)ret); + if (argc == 3) { + fairygui::GObject* arg0; + fairygui::GObject* arg1; + fairygui::PopupDirection arg2; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GRoot:getPoupPosition"); + ok &= luaval_to_object(tolua_S, 3, "fairygui.GObject",&arg1, "fairygui.GRoot:getPoupPosition"); + ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "fairygui.GRoot:getPoupPosition"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_getPoupPosition'", nullptr); + return 0; + } + cocos2d::Vec2 ret = cobj->getPoupPosition(arg0, arg1, arg2); + vec2_to_luaval(tolua_S, ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:isTop",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:getPoupPosition",argc, 3); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_isTop'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_getPoupPosition'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_hideImmediately(lua_State* tolua_S) +static int lua_fairygui_GRoot_showWindow(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; + fairygui::GRoot* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_hideImmediately'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_showWindow'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->hideImmediately(); - return 0; + if (argc == 1) { + fairygui::Window* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.Window",&arg0, "fairygui.GRoot:showWindow"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_showWindow'", nullptr); + return 0; + } + cobj->showWindow(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:hideImmediately",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:showWindow",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_hideImmediately'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_showWindow'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_toggleStatus(lua_State* tolua_S) +static int lua_fairygui_GRoot_showTooltips(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; + fairygui::GRoot* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_toggleStatus'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_showTooltips'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->toggleStatus(); - return 0; + if (argc == 1) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GRoot:showTooltips"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_showTooltips'", nullptr); + return 0; + } + cobj->showTooltips(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:toggleStatus",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:showTooltips",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_toggleStatus'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_showTooltips'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_hide(lua_State* tolua_S) +static int lua_fairygui_GRoot_hideWindow(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; + fairygui::GRoot* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_hide'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_hideWindow'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->hide(); - return 0; + if (argc == 1) { + fairygui::Window* arg0; + ok &= luaval_to_object(tolua_S, 2, "fairygui.Window",&arg0, "fairygui.GRoot:hideWindow"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_hideWindow'", nullptr); + return 0; + } + cobj->hideWindow(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:hide",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:hideWindow",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_hide'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_hideWindow'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_getFrame(lua_State* tolua_S) +static int lua_fairygui_GRoot_create(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_getFrame'", nullptr); - return 0; - } + if (!tolua_isusertable(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GComponent* ret = cobj->getFrame(); - object_to_luaval(tolua_S, "fairygui.GComponent",(fairygui::GComponent*)ret); + argc = lua_gettop(tolua_S) - 1; + if (argc == 1) { + cocos2d::Scene* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Scene",&arg0, "fairygui.GRoot:create"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_create'", nullptr); + return 0; + } + fairygui::GRoot* ret = fairygui::GRoot::create(arg0); + object_to_luaval(tolua_S, "fairygui.GRoot",(fairygui::GRoot*)ret); + return 1; + } + if (argc == 2) { + cocos2d::Scene* arg0; + int arg1; + ok &= luaval_to_object(tolua_S, 2, "cc.Scene",&arg0, "fairygui.GRoot:create"); + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GRoot:create"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_create'", nullptr); + return 0; + } + fairygui::GRoot* ret = fairygui::GRoot::create(arg0, arg1); + object_to_luaval(tolua_S, "fairygui.GRoot",(fairygui::GRoot*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:getFrame",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GRoot:create",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_getFrame'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_create'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_isShowing(lua_State* tolua_S) +static int lua_fairygui_GRoot_getInstance(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_isShowing'", nullptr); - return 0; - } + if (!tolua_isusertable(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; + argc = lua_gettop(tolua_S) - 1; if (argc == 0) { - bool ret = cobj->isShowing(); - tolua_pushboolean(tolua_S,(bool)ret); + fairygui::GRoot* ret = fairygui::GRoot::getInstance(); + object_to_luaval(tolua_S, "fairygui.GRoot",(fairygui::GRoot*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:isShowing",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GRoot:getInstance",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_isShowing'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_getInstance'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_closeModalWait(lua_State* tolua_S) +static int lua_register_fairygui_GRoot(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"fairygui.GRoot"); + tolua_cclass(tolua_S,"GRoot","fairygui.GRoot","fairygui.GComponent",nullptr); + + tolua_beginmodule(tolua_S,"GRoot"); + tolua_function(tolua_S,"closeAllWindows",lua_fairygui_GRoot_closeAllWindows); + tolua_function(tolua_S,"hideTooltips",lua_fairygui_GRoot_hideTooltips); + tolua_function(tolua_S,"hasAnyPopup",lua_fairygui_GRoot_hasAnyPopup); + tolua_function(tolua_S,"getTopWindow",lua_fairygui_GRoot_getTopWindow); + tolua_function(tolua_S,"hidePopup",lua_fairygui_GRoot_hidePopup); + tolua_function(tolua_S,"closeAllExceptModals",lua_fairygui_GRoot_closeAllExceptModals); + tolua_function(tolua_S,"showPopup",lua_fairygui_GRoot_showPopup); + tolua_function(tolua_S,"showTooltipsWin",lua_fairygui_GRoot_showTooltipsWin); + tolua_function(tolua_S,"closeModalWait",lua_fairygui_GRoot_closeModalWait); + tolua_function(tolua_S,"getInputProcessor",lua_fairygui_GRoot_getInputProcessor); + tolua_function(tolua_S,"getSoundVolumeScale",lua_fairygui_GRoot_getSoundVolumeScale); + tolua_function(tolua_S,"togglePopup",lua_fairygui_GRoot_togglePopup); + tolua_function(tolua_S,"isSoundEnabled",lua_fairygui_GRoot_isSoundEnabled); + tolua_function(tolua_S,"setSoundVolumeScale",lua_fairygui_GRoot_setSoundVolumeScale); + tolua_function(tolua_S,"getTouchTarget",lua_fairygui_GRoot_getTouchTarget); + tolua_function(tolua_S,"hideWindowImmediately",lua_fairygui_GRoot_hideWindowImmediately); + tolua_function(tolua_S,"getModalLayer",lua_fairygui_GRoot_getModalLayer); + tolua_function(tolua_S,"playSound",lua_fairygui_GRoot_playSound); + tolua_function(tolua_S,"getModalWaitingPane",lua_fairygui_GRoot_getModalWaitingPane); + tolua_function(tolua_S,"setSoundEnabled",lua_fairygui_GRoot_setSoundEnabled); + tolua_function(tolua_S,"bringToFront",lua_fairygui_GRoot_bringToFront); + tolua_function(tolua_S,"hasModalWindow",lua_fairygui_GRoot_hasModalWindow); + tolua_function(tolua_S,"showModalWait",lua_fairygui_GRoot_showModalWait); + tolua_function(tolua_S,"isModalWaiting",lua_fairygui_GRoot_isModalWaiting); + tolua_function(tolua_S,"getTouchPosition",lua_fairygui_GRoot_getTouchPosition); + tolua_function(tolua_S,"getPoupPosition",lua_fairygui_GRoot_getPoupPosition); + tolua_function(tolua_S,"showWindow",lua_fairygui_GRoot_showWindow); + tolua_function(tolua_S,"showTooltips",lua_fairygui_GRoot_showTooltips); + tolua_function(tolua_S,"hideWindow",lua_fairygui_GRoot_hideWindow); + tolua_function(tolua_S,"create", lua_fairygui_GRoot_create); + tolua_function(tolua_S,"getInstance", lua_fairygui_GRoot_getInstance); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::GRoot).name(); + g_luaType[typeName] = "fairygui.GRoot"; + g_typeCast["GRoot"] = "fairygui.GRoot"; + return 1; +} + +static int lua_fairygui_PopupMenu_setItemGrayed(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; + fairygui::PopupMenu* cobj = nullptr; bool ok = true; - + #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj){ - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_closeModalWait'", nullptr); + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_setItemGrayed'", nullptr); return 0; } #endif - + argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - bool ret = cobj->closeModalWait(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.Window:closeModalWait"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Window_closeModalWait'", nullptr); - return 0; - } - bool ret = cobj->closeModalWait(arg0); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:closeModalWait",argc, 0); + if (argc == 2) { + std::string arg0; + bool arg1; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.PopupMenu:setItemGrayed"); + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.PopupMenu:setItemGrayed"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_PopupMenu_setItemGrayed'", nullptr); + return 0; + } + cobj->setItemGrayed(arg0, arg1); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:setItemGrayed",argc, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_closeModalWait'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_setItemGrayed'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_initWindow(lua_State* tolua_S) +static int lua_fairygui_PopupMenu_getItemName(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; + fairygui::PopupMenu* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_initWindow'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_getItemName'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->initWindow(); - return 0; + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.PopupMenu:getItemName"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_PopupMenu_getItemName'", nullptr); + return 0; + } + const std::string& ret = cobj->getItemName(arg0); + lua_pushlstring(tolua_S,ret.c_str(),ret.length()); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:initWindow",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:getItemName",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_initWindow'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_getItemName'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_setContentArea(lua_State* tolua_S) +static int lua_fairygui_PopupMenu_clearItems(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; - bool ok = true; + fairygui::PopupMenu* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_setContentArea'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_clearItems'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::GObject* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.Window:setContentArea"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Window_setContentArea'", nullptr); - return 0; - } - cobj->setContentArea(arg0); - return 0; + if (argc == 0) { + cobj->clearItems(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:setContentArea",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:clearItems",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_setContentArea'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_clearItems'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_setDragArea(lua_State* tolua_S) +static int lua_fairygui_PopupMenu_getList(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; - bool ok = true; + fairygui::PopupMenu* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_setDragArea'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_getList'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::GObject* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.Window:setDragArea"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Window_setDragArea'", nullptr); - return 0; - } - cobj->setDragArea(arg0); - return 0; + if (argc == 0) { + fairygui::GList* ret = cobj->getList(); + object_to_luaval(tolua_S, "fairygui.GList",(fairygui::GList*)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:setDragArea",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:getList",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_setDragArea'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_getList'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_setContentPane(lua_State* tolua_S) +static int lua_fairygui_PopupMenu_removeItem(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; + fairygui::PopupMenu* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_setContentPane'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_removeItem'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - fairygui::GComponent* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GComponent",&arg0, "fairygui.Window:setContentPane"); + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.PopupMenu:removeItem"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Window_setContentPane'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_PopupMenu_removeItem'", nullptr); return 0; } - cobj->setContentPane(arg0); - return 0; + bool ret = cobj->removeItem(arg0); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:setContentPane",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:removeItem",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_setContentPane'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_removeItem'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_isModal(lua_State* tolua_S) +static int lua_fairygui_PopupMenu_addItem(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; + fairygui::PopupMenu* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_isModal'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_addItem'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - bool ret = cobj->isModal(); - tolua_pushboolean(tolua_S,(bool)ret); + if (argc == 2) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.PopupMenu:addItem"); + LUA_FUNCTION handler = (toluafix_ref_function(tolua_S, 3, 0)); + if(!ok || 0 == handler) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_PopupMenu_addItem'", nullptr); + return 0; + } + fairygui::GButton* ret = cobj->addItem(arg0, [=](fairygui::EventContext* context) { + lua_State *coroutine = LuaEngine::getInstance()->getLuaStack()->getLuaState(); + object_to_luaval(coroutine, "fairygui.EventContext", context); + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 1); + }); + ScriptHandlerMgr::getInstance()->addCustomHandler((void*)cobj, handler); + object_to_luaval(tolua_S, "fairygui.GButton",(fairygui::GButton*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:isModal",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:addItem",argc, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_isModal'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_addItem'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_isBringToFrontOnClick(lua_State* tolua_S) +static int lua_fairygui_PopupMenu_addSeperator(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; + fairygui::PopupMenu* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_isBringToFrontOnClick'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_addSeperator'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - bool ret = cobj->isBringToFrontOnClick(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; + cobj->addSeperator(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:isBringToFrontOnClick",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:addSeperator",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_isBringToFrontOnClick'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_addSeperator'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_getContentArea(lua_State* tolua_S) +static int lua_fairygui_PopupMenu_addItemAt(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; + fairygui::PopupMenu* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_getContentArea'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_addItemAt'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GObject* ret = cobj->getContentArea(); - object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); + if (argc == 3) { + std::string arg0; + int arg1; + std::function arg2; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.PopupMenu:addItemAt"); + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.PopupMenu:addItemAt"); + LUA_FUNCTION handler = (toluafix_ref_function(tolua_S, 4, 0)); + if(!ok || 0 == handler) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_PopupMenu_addItemAt'", nullptr); + return 0; + } + fairygui::GButton* ret = cobj->addItemAt(arg0, arg1, [=](fairygui::EventContext* context) { + lua_State *coroutine = LuaEngine::getInstance()->getLuaStack()->getLuaState(); + object_to_luaval(coroutine, "fairygui.EventContext", context); + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 1); + }); + ScriptHandlerMgr::getInstance()->addCustomHandler((void*)cobj, handler); + object_to_luaval(tolua_S, "fairygui.GButton",(fairygui::GButton*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:getContentArea",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:addItemAt",argc, 3); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_getContentArea'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_addItemAt'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_setBringToFrontOnClick(lua_State* tolua_S) +static int lua_fairygui_PopupMenu_setItemText(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; + fairygui::PopupMenu* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_setBringToFrontOnClick'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_setItemText'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.Window:setBringToFrontOnClick"); + if (argc == 2) { + std::string arg0; + std::string arg1; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.PopupMenu:setItemText"); + ok &= luaval_to_std_string(tolua_S, 3,&arg1, "fairygui.PopupMenu:setItemText"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Window_setBringToFrontOnClick'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_PopupMenu_setItemText'", nullptr); return 0; } - cobj->setBringToFrontOnClick(arg0); - return 0; + cobj->setItemText(arg0, arg1); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:setBringToFrontOnClick",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:setItemText",argc, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_setBringToFrontOnClick'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_setItemText'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_setModal(lua_State* tolua_S) +static int lua_fairygui_PopupMenu_setItemChecked(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; + fairygui::PopupMenu* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_setModal'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_setItemChecked'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.Window:setModal"); + if (argc == 2) { + std::string arg0; + bool arg1; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.PopupMenu:setItemChecked"); + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.PopupMenu:setItemChecked"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Window_setModal'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_PopupMenu_setItemChecked'", nullptr); return 0; } - cobj->setModal(arg0); - return 0; + cobj->setItemChecked(arg0, arg1); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:setModal",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:setItemChecked",argc, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_setModal'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_setItemChecked'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_getModalWaitingPane(lua_State* tolua_S) +static int lua_fairygui_PopupMenu_show(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; + fairygui::PopupMenu* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_getModalWaitingPane'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_show'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - fairygui::GObject* ret = cobj->getModalWaitingPane(); - object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); - return 1; + cobj->show(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:getModalWaitingPane",argc, 0); + if (argc == 2) { + fairygui::GObject* arg0; + fairygui::PopupDirection arg1; + ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.PopupMenu:show"); + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.PopupMenu:show"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_PopupMenu_show'", nullptr); + return 0; + } + cobj->show(arg0, arg1); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:show",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_getModalWaitingPane'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_show'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_getDragArea(lua_State* tolua_S) +static int lua_fairygui_PopupMenu_getContentPane(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; + fairygui::PopupMenu* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_getDragArea'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_getContentPane'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - fairygui::GObject* ret = cobj->getDragArea(); - object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); + fairygui::GComponent* ret = cobj->getContentPane(); + object_to_luaval(tolua_S, "fairygui.GComponent",(fairygui::GComponent*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:getDragArea",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:getContentPane",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_getDragArea'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_getContentPane'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_bringToFront(lua_State* tolua_S) +static int lua_fairygui_PopupMenu_getItemCount(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; + fairygui::PopupMenu* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_bringToFront'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_getItemCount'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - cobj->bringToFront(); - return 0; + int ret = cobj->getItemCount(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:bringToFront",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:getItemCount",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_bringToFront'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_getItemCount'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_showModalWait(lua_State* tolua_S) +static int lua_fairygui_PopupMenu_setItemCheckable(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; + fairygui::PopupMenu* cobj = nullptr; bool ok = true; - + #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj){ - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_showModalWait'", nullptr); + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_setItemCheckable'", nullptr); return 0; } #endif - + argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->showModalWait(); - return 0; - } - if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.Window:showModalWait"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Window_showModalWait'", nullptr); - return 0; - } - cobj->showModalWait(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:showModalWait",argc, 0); + if (argc == 2) { + std::string arg0; + bool arg1; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.PopupMenu:setItemCheckable"); + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.PopupMenu:setItemCheckable"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_PopupMenu_setItemCheckable'", nullptr); + return 0; + } + cobj->setItemCheckable(arg0, arg1); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:setItemCheckable",argc, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_showModalWait'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_setItemCheckable'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_setCloseButton(lua_State* tolua_S) +static int lua_fairygui_PopupMenu_isItemChecked(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; + fairygui::PopupMenu* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_setCloseButton'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_isItemChecked'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - fairygui::GObject* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.Window:setCloseButton"); + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.PopupMenu:isItemChecked"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Window_setCloseButton'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_PopupMenu_isItemChecked'", nullptr); return 0; } - cobj->setCloseButton(arg0); - return 0; + bool ret = cobj->isItemChecked(arg0); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:setCloseButton",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:isItemChecked",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_setCloseButton'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_isItemChecked'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_addUISource(lua_State* tolua_S) +static int lua_fairygui_PopupMenu_setItemVisible(lua_State* tolua_S) { int argc = 0; - fairygui::Window* cobj = nullptr; + fairygui::PopupMenu* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::Window*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_Window_addUISource'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_setItemVisible'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::IUISource* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.IUISource",&arg0, "fairygui.Window:addUISource"); + if (argc == 2) { + std::string arg0; + bool arg1; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.PopupMenu:setItemVisible"); + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.PopupMenu:setItemVisible"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_Window_addUISource'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_PopupMenu_setItemVisible'", nullptr); return 0; } - cobj->addUISource(arg0); - return 0; + cobj->setItemVisible(arg0, arg1); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.Window:addUISource",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:setItemVisible",argc, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_addUISource'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_setItemVisible'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_Window_create(lua_State* tolua_S) +static int lua_fairygui_PopupMenu_create(lua_State* tolua_S) { int argc = 0; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.Window",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertable(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; #endif - argc = lua_gettop(tolua_S) - 1; + argc = lua_gettop(tolua_S)-1; if (argc == 0){ - fairygui::Window* ret = fairygui::Window::create(); - object_to_luaval(tolua_S, "fairygui.Window",(fairygui::Window*)ret); + fairygui::PopupMenu* ret = fairygui::PopupMenu::create(); + object_to_luaval(tolua_S, "fairygui.PopupMenu",(fairygui::PopupMenu*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.Window:create",argc, 0); + if (argc == 1) { + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.PopupMenu:create"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_PopupMenu_create'", nullptr); + return 0; + } + fairygui::PopupMenu* ret = fairygui::PopupMenu::create(arg0); + object_to_luaval(tolua_S, "fairygui.PopupMenu",(fairygui::PopupMenu*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d", "fairygui.PopupMenu:create",argc, 1); return 0; - + #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_Window_create'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_create'.",&tolua_err); + return 0; #endif } -static int lua_register_fairygui_Window(lua_State* tolua_S) +static int lua_register_fairygui_PopupMenu(lua_State* tolua_S) { - tolua_usertype(tolua_S,"fairygui.Window"); - tolua_cclass(tolua_S,"Window","fairygui.Window","fairygui.GComponent",nullptr); + tolua_usertype(tolua_S,"fairygui.PopupMenu"); + tolua_cclass(tolua_S,"PopupMenu","fairygui.PopupMenu","cc.Ref",nullptr); - tolua_beginmodule(tolua_S,"Window"); - tolua_function(tolua_S,"getCloseButton",lua_fairygui_Window_getCloseButton); - tolua_function(tolua_S,"getContentPane",lua_fairygui_Window_getContentPane); - tolua_function(tolua_S,"show",lua_fairygui_Window_show); - tolua_function(tolua_S,"isTop",lua_fairygui_Window_isTop); - tolua_function(tolua_S,"hideImmediately",lua_fairygui_Window_hideImmediately); - tolua_function(tolua_S,"toggleStatus",lua_fairygui_Window_toggleStatus); - tolua_function(tolua_S,"hide",lua_fairygui_Window_hide); - tolua_function(tolua_S,"getFrame",lua_fairygui_Window_getFrame); - tolua_function(tolua_S,"isShowing",lua_fairygui_Window_isShowing); - tolua_function(tolua_S,"closeModalWait",lua_fairygui_Window_closeModalWait); - tolua_function(tolua_S,"initWindow",lua_fairygui_Window_initWindow); - tolua_function(tolua_S,"setContentArea",lua_fairygui_Window_setContentArea); - tolua_function(tolua_S,"setDragArea",lua_fairygui_Window_setDragArea); - tolua_function(tolua_S,"setContentPane",lua_fairygui_Window_setContentPane); - tolua_function(tolua_S,"isModal",lua_fairygui_Window_isModal); - tolua_function(tolua_S,"isBringToFrontOnClick",lua_fairygui_Window_isBringToFrontOnClick); - tolua_function(tolua_S,"getContentArea",lua_fairygui_Window_getContentArea); - tolua_function(tolua_S,"setBringToFrontOnClick",lua_fairygui_Window_setBringToFrontOnClick); - tolua_function(tolua_S,"setModal",lua_fairygui_Window_setModal); - tolua_function(tolua_S,"getModalWaitingPane",lua_fairygui_Window_getModalWaitingPane); - tolua_function(tolua_S,"getDragArea",lua_fairygui_Window_getDragArea); - tolua_function(tolua_S,"bringToFront",lua_fairygui_Window_bringToFront); - tolua_function(tolua_S,"showModalWait",lua_fairygui_Window_showModalWait); - tolua_function(tolua_S,"setCloseButton",lua_fairygui_Window_setCloseButton); - tolua_function(tolua_S,"addUISource",lua_fairygui_Window_addUISource); - tolua_function(tolua_S,"create", lua_fairygui_Window_create); + tolua_beginmodule(tolua_S,"PopupMenu"); + tolua_function(tolua_S,"setItemGrayed",lua_fairygui_PopupMenu_setItemGrayed); + tolua_function(tolua_S,"getItemName",lua_fairygui_PopupMenu_getItemName); + tolua_function(tolua_S,"clearItems",lua_fairygui_PopupMenu_clearItems); + tolua_function(tolua_S,"getList",lua_fairygui_PopupMenu_getList); + tolua_function(tolua_S,"removeItem",lua_fairygui_PopupMenu_removeItem); + tolua_function(tolua_S,"addItem",lua_fairygui_PopupMenu_addItem); + tolua_function(tolua_S,"addSeperator",lua_fairygui_PopupMenu_addSeperator); + tolua_function(tolua_S,"addItemAt",lua_fairygui_PopupMenu_addItemAt); + tolua_function(tolua_S,"setItemText",lua_fairygui_PopupMenu_setItemText); + tolua_function(tolua_S,"setItemChecked",lua_fairygui_PopupMenu_setItemChecked); + tolua_function(tolua_S,"show",lua_fairygui_PopupMenu_show); + tolua_function(tolua_S,"getContentPane",lua_fairygui_PopupMenu_getContentPane); + tolua_function(tolua_S,"getItemCount",lua_fairygui_PopupMenu_getItemCount); + tolua_function(tolua_S,"setItemCheckable",lua_fairygui_PopupMenu_setItemCheckable); + tolua_function(tolua_S,"isItemChecked",lua_fairygui_PopupMenu_isItemChecked); + tolua_function(tolua_S,"setItemVisible",lua_fairygui_PopupMenu_setItemVisible); + tolua_function(tolua_S,"create", lua_fairygui_PopupMenu_create); tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::Window).name(); - g_luaType[typeName] = "fairygui.Window"; - g_typeCast["Window"] = "fairygui.Window"; + std::string typeName = typeid(fairygui::PopupMenu).name(); + g_luaType[typeName] = "fairygui.PopupMenu"; + g_typeCast["PopupMenu"] = "fairygui.PopupMenu"; return 1; } -static int lua_fairygui_GRoot_closeAllWindows(lua_State* tolua_S) +static int lua_fairygui_UIObjectFactory_newObject(lua_State* tolua_S) { int argc = 0; - fairygui::GRoot* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_closeAllWindows'", nullptr); - return 0; - } + if (!tolua_isusertable(tolua_S,1,"fairygui.UIObjectFactory",0,&tolua_err)) goto tolua_lerror; #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->closeAllWindows(); - return 0; + if (argc == 1){ + fairygui::ObjectType arg0; + ok = luaval_to_int32(tolua_S, 2, (int *)&arg0, "fairygui.UIObjectFactory:newObject"); + if (ok) { + fairygui::GObject* ret = fairygui::UIObjectFactory::newObject(arg0); + object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); + return 1; + } + + fairygui::PackageItem* arg00; + ok = luaval_to_object(tolua_S, 2, "fairygui.PackageItem",&arg00, "fairygui.UIObjectFactory:newObject"); + if (ok) { + fairygui::GObject* ret = fairygui::UIObjectFactory::newObject(arg00); + object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); + return 1; + } + + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_UIObjectFactory_newObject'", nullptr); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:closeAllWindows",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d", "fairygui.UIObjectFactory:newObject",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_closeAllWindows'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIObjectFactory_newObject'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_hideTooltips(lua_State* tolua_S) +static int lua_fairygui_UIObjectFactory_setPackageItemExtension(lua_State* tolua_S) { int argc = 0; - fairygui::GRoot* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_hideTooltips'", nullptr); - return 0; + if (!tolua_isusertable(tolua_S,1,"fairygui.UIObjectFactory",0,&tolua_err) || + !tolua_isstring(tolua_S, 2, 0, &tolua_err) || + !toluafix_isfunction(tolua_S, 3, "LUA_FUNCTION", 0, &tolua_err)) + { + goto tolua_lerror; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->hideTooltips(); - return 0; + if (argc == 2) { + std::string url; + int handler; + luaval_to_std_string(tolua_S, 2, &url, "fairygui.UIObjectFactory:setPackageItemExtension"); + handler = toluafix_ref_function(tolua_S, 3, 0); + // typeid is a ref of static object + ScriptHandlerMgr::getInstance()->addCustomHandler((void *)&typeid(fairygui::UIObjectFactory), handler); + fairygui::UIObjectFactory::setPackageItemExtension(url, [=]() -> fairygui::GComponent * { + LuaEngine::getInstance()->getLuaStack()->pushFunctionByHandler(handler); + int error = lua_pcall(tolua_S, 0, 1, 0); // 1 pararm, 1 return + if (error) { + CCLOG("[LUA ERROR] %s", lua_tostring(tolua_S, -1)); + lua_pop(tolua_S, 1); // remove error message from stack + return nullptr; + } + fairygui::GComponent *com = static_cast(tolua_tousertype(tolua_S, -1, 0)); + lua_pop(tolua_S, 1); + return com; + }); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:hideTooltips",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d", "fairygui.UIObjectFactory:setPackageItemExtension",argc,2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_hideTooltips'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIObjectFactory_setPackageItemExtension'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_hasAnyPopup(lua_State* tolua_S) +static int lua_fairygui_UIObjectFactory_setLoaderExtension(lua_State* tolua_S) { int argc = 0; - fairygui::GRoot* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_hasAnyPopup'", nullptr); - return 0; + if (!tolua_isusertable(tolua_S,1,"fairygui.UIObjectFactory",0,&tolua_err) || + !toluafix_isfunction(tolua_S, 2, "LUA_FUNCTION", 0, &tolua_err)) + { + goto tolua_lerror; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - bool ret = cobj->hasAnyPopup(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; + if (argc == 1) { + int handler = toluafix_ref_function(tolua_S, 2, 0); + // typeid is a ref of static object + ScriptHandlerMgr::getInstance()->addCustomHandler((void *)&typeid(fairygui::UIObjectFactory), handler); + fairygui::UIObjectFactory::setLoaderExtension([=]() -> fairygui::GLoader * { + LuaEngine::getInstance()->getLuaStack()->pushFunctionByHandler(handler); + int error = lua_pcall(tolua_S, 0, 1, 0); // 1 pararm, 1 return + if (error) { + CCLOG("[LUA ERROR] %s", lua_tostring(tolua_S, -1)); + lua_pop(tolua_S, 1); // remove error message from stack + return nullptr; + } + fairygui::GLoader *loader = static_cast(tolua_tousertype(tolua_S, -1, 0)); + lua_pop(tolua_S, 1); + return loader; + }); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:hasAnyPopup",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d", "fairygui.UIObjectFactory:setLoaderExtension",argc,1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_hasAnyPopup'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIObjectFactory_setLoaderExtension'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_getTopWindow(lua_State* tolua_S) +static int lua_register_fairygui_UIObjectFactory(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"fairygui.UIObjectFactory"); + tolua_cclass(tolua_S,"UIObjectFactory","fairygui.UIObjectFactory","",nullptr); + + tolua_beginmodule(tolua_S,"UIObjectFactory"); + tolua_function(tolua_S,"newObject", lua_fairygui_UIObjectFactory_newObject); + tolua_function(tolua_S,"setPackageItemExtension", lua_fairygui_UIObjectFactory_setPackageItemExtension); + tolua_function(tolua_S,"setLoaderExtension", lua_fairygui_UIObjectFactory_setLoaderExtension); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::UIObjectFactory).name(); + g_luaType[typeName] = "fairygui.UIObjectFactory"; + g_typeCast["UIObjectFactory"] = "fairygui.UIObjectFactory"; + return 1; +} + +static int lua_fairygui_DragDropManager_cancel(lua_State* tolua_S) { int argc = 0; - fairygui::GRoot* cobj = nullptr; + fairygui::DragDropManager* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.DragDropManager",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::DragDropManager*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_getTopWindow'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_DragDropManager_cancel'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - fairygui::Window* ret = cobj->getTopWindow(); - object_to_luaval(tolua_S, "fairygui.Window",(fairygui::Window*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:getTopWindow",argc, 0); - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_getTopWindow'.",&tolua_err); - return 0; -#endif -} - -static int lua_fairygui_GRoot_hidePopup(lua_State* tolua_S) -{ - int argc = 0; - fairygui::GRoot* cobj = nullptr; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj){ - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_hidePopup'", nullptr); + cobj->cancel(); return 0; } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->hidePopup(); - return 0; - } - if (argc == 1) { - fairygui::GObject* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GRoot:hidePopup"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_hidePopup'", nullptr); - return 0; - } - cobj->hidePopup(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:hidePopup",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.DragDropManager:cancel",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_hidePopup'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_DragDropManager_cancel'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_closeAllExceptModals(lua_State* tolua_S) +static int lua_fairygui_DragDropManager_isDragging(lua_State* tolua_S) { int argc = 0; - fairygui::GRoot* cobj = nullptr; + fairygui::DragDropManager* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.DragDropManager",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::DragDropManager*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_closeAllExceptModals'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_DragDropManager_isDragging'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - cobj->closeAllExceptModals(); - return 0; + bool ret = cobj->isDragging(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:closeAllExceptModals",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.DragDropManager:isDragging",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_closeAllExceptModals'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_DragDropManager_isDragging'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_showPopup(lua_State* tolua_S) +static int lua_fairygui_DragDropManager_getAgent(lua_State* tolua_S) { int argc = 0; - fairygui::GRoot* cobj = nullptr; - bool ok = true; - + fairygui::DragDropManager* cobj = nullptr; + #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.DragDropManager",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::DragDropManager*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj){ - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_showPopup'", nullptr); + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_DragDropManager_getAgent'", nullptr); return 0; } #endif - + argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::GObject* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GRoot:showPopup"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_showPopup'", nullptr); - return 0; - } - cobj->showPopup(arg0); - return 0; - } - if (argc == 3) { - fairygui::GObject* arg0; - fairygui::GObject* arg1; - fairygui::PopupDirection arg2; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GRoot:showPopup"); - ok &= luaval_to_object(tolua_S, 3, "fairygui.GObject",&arg1, "fairygui.GRoot:showPopup"); - ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "fairygui.GRoot:showPopup"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_showPopup'", nullptr); - return 0; - } - cobj->showPopup(arg0, arg1, arg2); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:showPopup",argc, 1); + if (argc == 0) { + fairygui::GLoader* ret = cobj->getAgent(); + object_to_luaval(tolua_S, "fairygui.GLoader",(fairygui::GLoader*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.DragDropManager:getAgent",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_showPopup'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_DragDropManager_getAgent'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_showTooltipsWin(lua_State* tolua_S) +static int lua_fairygui_DragDropManager_startDrag(lua_State* tolua_S) { int argc = 0; - fairygui::GRoot* cobj = nullptr; + fairygui::DragDropManager* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.DragDropManager",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::DragDropManager*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_showTooltipsWin'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_DragDropManager_startDrag'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - fairygui::GObject* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GRoot:showTooltipsWin"); + std::string arg0; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.DragDropManager:startDrag"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_showTooltipsWin'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_DragDropManager_startDrag'", nullptr); return 0; } - cobj->showTooltipsWin(arg0); - return 0; + cobj->startDrag(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:showTooltipsWin",argc, 1); + if (argc == 2) { + std::string arg0; + cocos2d::Value arg1; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.DragDropManager:startDrag"); + ok &= luaval_to_ccvalue(tolua_S, 3, &arg1, "fairygui.DragDropManager:startDrag"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_DragDropManager_startDrag'", nullptr); + return 0; + } + cobj->startDrag(arg0, arg1); + return 0; + } + if (argc == 3) { + std::string arg0; + cocos2d::Value arg1; + int arg2; + ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.DragDropManager:startDrag"); + ok &= luaval_to_ccvalue(tolua_S, 3, &arg1, "fairygui.DragDropManager:startDrag"); + ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "fairygui.DragDropManager:startDrag"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_DragDropManager_startDrag'", nullptr); + return 0; + } + cobj->startDrag(arg0, arg1, arg2); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.DragDropManager:startDrag",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_showTooltipsWin'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_DragDropManager_startDrag'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_closeModalWait(lua_State* tolua_S) +static int lua_fairygui_DragDropManager_getInstance(lua_State* tolua_S) { int argc = 0; - fairygui::GRoot* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_closeModalWait'", nullptr); - return 0; - } + if (!tolua_isusertable(tolua_S,1,"fairygui.DragDropManager",0,&tolua_err)) goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; + argc = lua_gettop(tolua_S) - 1; if (argc == 0) { - cobj->closeModalWait(); - return 0; + fairygui::DragDropManager* ret = fairygui::DragDropManager::getInstance(); + object_to_luaval(tolua_S, "fairygui.DragDropManager",(fairygui::DragDropManager*)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:closeModalWait",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.DragDropManager:getInstance",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_closeModalWait'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_DragDropManager_getInstance'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_getInputProcessor(lua_State* tolua_S) +static int lua_fairygui_DragDropManager_destroyInstance(lua_State* tolua_S) { int argc = 0; - fairygui::GRoot* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_getInputProcessor'", nullptr); - return 0; - } + if (!tolua_isusertable(tolua_S,1,"fairygui.DragDropManager",0,&tolua_err)) goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; + argc = lua_gettop(tolua_S) - 1; if (argc == 0) { - fairygui::InputProcessor* ret = cobj->getInputProcessor(); - object_to_luaval(tolua_S, "fairygui.InputProcessor",(fairygui::InputProcessor*)ret); - return 1; + fairygui::DragDropManager::destroyInstance(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:getInputProcessor",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.DragDropManager:destroyInstance",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_getInputProcessor'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_DragDropManager_destroyInstance'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_getSoundVolumeScale(lua_State* tolua_S) +static int lua_register_fairygui_DragDropManager(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"fairygui.DragDropManager"); + tolua_cclass(tolua_S,"DragDropManager","fairygui.DragDropManager","",nullptr); + + tolua_beginmodule(tolua_S,"DragDropManager"); + tolua_function(tolua_S,"cancel",lua_fairygui_DragDropManager_cancel); + tolua_function(tolua_S,"isDragging",lua_fairygui_DragDropManager_isDragging); + tolua_function(tolua_S,"getAgent",lua_fairygui_DragDropManager_getAgent); + tolua_function(tolua_S,"startDrag",lua_fairygui_DragDropManager_startDrag); + tolua_function(tolua_S,"getInstance", lua_fairygui_DragDropManager_getInstance); + tolua_function(tolua_S,"destroyInstance", lua_fairygui_DragDropManager_destroyInstance); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::DragDropManager).name(); + g_luaType[typeName] = "fairygui.DragDropManager"; + g_typeCast["DragDropManager"] = "fairygui.DragDropManager"; + return 1; +} + +static int lua_fairygui_UIConfig_registerFont(lua_State* tolua_S) { int argc = 0; - fairygui::GRoot* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertable(tolua_S,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_getSoundVolumeScale'", nullptr); + + argc = lua_gettop(tolua_S) - 1; + if (argc == 2) { + std::string arg0; + std::string arg1; + ok &= luaval_to_std_string(tolua_S, 2, &arg0, "fairygui.UIConfig:registerFont"); + ok &= luaval_to_std_string(tolua_S, 3, &arg1, "fairygui.UIConfig:registerFont"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_UIConfig_registerFont'", nullptr); + return 0; + } + fairygui::UIConfig::registerFont(arg0, arg1); return 0; } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.UIConfig:registerFont", argc, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIConfig_registerFont'.",&tolua_err); + return 0; #endif +} - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - double ret = cobj->getSoundVolumeScale(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:getSoundVolumeScale",argc, 0); +static int lua_fairygui_UIConfig_set_defaultFont(lua_State* L) +{ +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isstring(L, 2, 0, &tolua_err)) + goto tolua_lerror; +#endif + + fairygui::UIConfig::defaultFont = lua_tostring(L, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_getSoundVolumeScale'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_defaultFont'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_togglePopup(lua_State* tolua_S) +static int lua_fairygui_UIConfig_set_buttonSound(lua_State* L) { - int argc = 0; - fairygui::GRoot* cobj = nullptr; - bool ok = true; - #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj){ - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_togglePopup'", nullptr); - return 0; - } + if (!tolua_isstring(L, 2, 0, &tolua_err)) + goto tolua_lerror; #endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::GObject* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GRoot:togglePopup"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_togglePopup'", nullptr); - return 0; - } - cobj->togglePopup(arg0); - return 0; - } - if (argc == 3) { - fairygui::GObject* arg0; - fairygui::GObject* arg1; - fairygui::PopupDirection arg2; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GRoot:togglePopup"); - ok &= luaval_to_object(tolua_S, 3, "fairygui.GObject",&arg1, "fairygui.GRoot:togglePopup"); - ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "fairygui.GRoot:togglePopup"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_togglePopup'", nullptr); - return 0; - } - cobj->togglePopup(arg0, arg1, arg2); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:togglePopup",argc, 1); + + fairygui::UIConfig::buttonSound = lua_tostring(L, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_buttonSound'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_UIConfig_set_buttonSoundVolumeScale(lua_State* L) +{ +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isnumber(L, 2, 0, &tolua_err)) + goto tolua_lerror; +#endif + + fairygui::UIConfig::buttonSoundVolumeScale = lua_tonumber(L, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_togglePopup'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_buttonSoundVolumeScale'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_isSoundEnabled(lua_State* tolua_S) +static int lua_fairygui_UIConfig_set_defaultScrollStep(lua_State* L) { - int argc = 0; - fairygui::GRoot* cobj = nullptr; - #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_isSoundEnabled'", nullptr); - return 0; - } + if (!tolua_isnumber(L, 2, 0, &tolua_err)) + goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - bool ret = cobj->isSoundEnabled(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:isSoundEnabled",argc, 0); + fairygui::UIConfig::defaultScrollStep = lua_tointeger(L, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_isSoundEnabled'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_defaultScrollStep'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_setSoundVolumeScale(lua_State* tolua_S) +static int lua_fairygui_UIConfig_set_defaultScrollDecelerationRate(lua_State* L) { - int argc = 0; - fairygui::GRoot* cobj = nullptr; - bool ok = true; - #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_setSoundVolumeScale'", nullptr); - return 0; - } + if (!tolua_isnumber(L, 2, 0, &tolua_err)) + goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - double arg0; - ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GRoot:setSoundVolumeScale"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_setSoundVolumeScale'", nullptr); - return 0; - } - cobj->setSoundVolumeScale(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:setSoundVolumeScale",argc, 1); + fairygui::UIConfig::defaultScrollDecelerationRate = lua_tonumber(L, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_setSoundVolumeScale'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_defaultScrollDecelerationRate'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_getTouchTarget(lua_State* tolua_S) +static int lua_fairygui_UIConfig_set_defaultScrollTouchEffect(lua_State* L) { - int argc = 0; - fairygui::GRoot* cobj = nullptr; - #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_getTouchTarget'", nullptr); - return 0; - } + if (!tolua_isboolean(L, 2, 0, &tolua_err)) + goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GObject* ret = cobj->getTouchTarget(); - object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:getTouchTarget",argc, 0); + fairygui::UIConfig::defaultScrollTouchEffect = lua_toboolean(L, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_getTouchTarget'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_defaultScrollTouchEffect'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_hideWindowImmediately(lua_State* tolua_S) +static int lua_fairygui_UIConfig_set_defaultScrollBounceEffect(lua_State* L) { - int argc = 0; - fairygui::GRoot* cobj = nullptr; - bool ok = true; - #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_hideWindowImmediately'", nullptr); - return 0; - } + if (!tolua_isboolean(L, 2, 0, &tolua_err)) + goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::Window* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.Window",&arg0, "fairygui.GRoot:hideWindowImmediately"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_hideWindowImmediately'", nullptr); - return 0; - } - cobj->hideWindowImmediately(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:hideWindowImmediately",argc, 1); + fairygui::UIConfig::defaultScrollBounceEffect = lua_toboolean(L, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_hideWindowImmediately'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_defaultScrollBounceEffect'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_getModalLayer(lua_State* tolua_S) +static int lua_fairygui_UIConfig_set_defaultScrollBarDisplay(lua_State* L) { - int argc = 0; - fairygui::GRoot* cobj = nullptr; - #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_getModalLayer'", nullptr); - return 0; - } + if (!tolua_isnumber(L, 2, 0, &tolua_err)) + goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GGraph* ret = cobj->getModalLayer(); - object_to_luaval(tolua_S, "fairygui.GGraph",(fairygui::GGraph*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:getModalLayer",argc, 0); + fairygui::UIConfig::defaultScrollBarDisplay = (fairygui::ScrollBarDisplayType)lua_tointeger(L, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_getModalLayer'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_defaultScrollBarDisplay'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_playSound(lua_State* tolua_S) +static int lua_fairygui_UIConfig_set_verticalScrollBar(lua_State* L) { - int argc = 0; - fairygui::GRoot* cobj = nullptr; - bool ok = true; - #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_playSound'", nullptr); - return 0; - } + if (!tolua_isstring(L, 2, 0, &tolua_err)) + goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GRoot:playSound"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_playSound'", nullptr); - return 0; - } - cobj->playSound(arg0); - return 0; - } - if (argc == 2) { - std::string arg0; - double arg1; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GRoot:playSound"); - ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.GRoot:playSound"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_playSound'", nullptr); - return 0; - } - cobj->playSound(arg0, arg1); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:playSound",argc, 1); + fairygui::UIConfig::verticalScrollBar = lua_tostring(L, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_playSound'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_verticalScrollBar'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_getModalWaitingPane(lua_State* tolua_S) +static int lua_fairygui_UIConfig_set_horizontalScrollBar(lua_State* L) { - int argc = 0; - fairygui::GRoot* cobj = nullptr; - #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_getModalWaitingPane'", nullptr); - return 0; - } + if (!tolua_isstring(L, 2, 0, &tolua_err)) + goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GObject* ret = cobj->getModalWaitingPane(); - object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:getModalWaitingPane",argc, 0); + fairygui::UIConfig::horizontalScrollBar = lua_tostring(L, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_getModalWaitingPane'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_horizontalScrollBar'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_setSoundEnabled(lua_State* tolua_S) +static int lua_fairygui_UIConfig_set_touchDragSensitivity(lua_State* L) { - int argc = 0; - fairygui::GRoot* cobj = nullptr; - bool ok = true; - #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_setSoundEnabled'", nullptr); - return 0; - } + if (!tolua_isnumber(L, 2, 0, &tolua_err)) + goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.GRoot:setSoundEnabled"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_setSoundEnabled'", nullptr); - return 0; - } - cobj->setSoundEnabled(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:setSoundEnabled",argc, 1); + fairygui::UIConfig::touchDragSensitivity = lua_tointeger(L, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_setSoundEnabled'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_touchDragSensitivity'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_bringToFront(lua_State* tolua_S) +static int lua_fairygui_UIConfig_set_clickDragSensitivity(lua_State* L) { - int argc = 0; - fairygui::GRoot* cobj = nullptr; - bool ok = true; - #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_bringToFront'", nullptr); - return 0; - } + if (!tolua_isnumber(L, 2, 0, &tolua_err)) + goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::Window* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.Window",&arg0, "fairygui.GRoot:bringToFront"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_bringToFront'", nullptr); - return 0; - } - cobj->bringToFront(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:bringToFront",argc, 1); + fairygui::UIConfig::clickDragSensitivity = lua_tointeger(L, 2); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_clickDragSensitivity'.",&tolua_err); + return 0; +#endif +} + +static int lua_fairygui_UIConfig_set_touchScrollSensitivity(lua_State* L) +{ +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; +#endif + +#if COCOS2D_DEBUG >= 1 + if (!tolua_isnumber(L, 2, 0, &tolua_err)) + goto tolua_lerror; +#endif + + fairygui::UIConfig::touchScrollSensitivity = lua_tointeger(L, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_bringToFront'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_touchScrollSensitivity'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_hasModalWindow(lua_State* tolua_S) +static int lua_fairygui_UIConfig_set_defaultComboBoxVisibleItemCount(lua_State* L) { - int argc = 0; - fairygui::GRoot* cobj = nullptr; - #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_hasModalWindow'", nullptr); - return 0; - } + if (!tolua_isnumber(L, 2, 0, &tolua_err)) + goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - bool ret = cobj->hasModalWindow(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:hasModalWindow",argc, 0); + fairygui::UIConfig::defaultComboBoxVisibleItemCount = lua_tointeger(L, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_hasModalWindow'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_defaultComboBoxVisibleItemCount'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_showModalWait(lua_State* tolua_S) +static int lua_fairygui_UIConfig_set_globalModalWaiting(lua_State* L) { - int argc = 0; - fairygui::GRoot* cobj = nullptr; - #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_showModalWait'", nullptr); - return 0; - } + if (!tolua_isstring(L, 2, 0, &tolua_err)) + goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->showModalWait(); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:showModalWait",argc, 0); + fairygui::UIConfig::globalModalWaiting = lua_tostring(L, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_showModalWait'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_globalModalWaiting'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_isModalWaiting(lua_State* tolua_S) +static int lua_fairygui_UIConfig_set_modalLayerColor(lua_State* L) { - int argc = 0; - fairygui::GRoot* cobj = nullptr; - #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_isModalWaiting'", nullptr); - return 0; - } + if (!tolua_istable(L, 2, 0, &tolua_err)) + goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - bool ret = cobj->isModalWaiting(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; + { + Color4F colorf; + luaval_to_color4f(L, 2, &colorf); + fairygui::UIConfig::modalLayerColor = colorf; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:isModalWaiting",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_isModalWaiting'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_modalLayerColor'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_getTouchPosition(lua_State* tolua_S) +static int lua_fairygui_UIConfig_set_tooltipsWin(lua_State* L) { - int argc = 0; - fairygui::GRoot* cobj = nullptr; - bool ok = true; - #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_getTouchPosition'", nullptr); - return 0; - } + if (!tolua_isstring(L, 2, 0, &tolua_err)) + goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.GRoot:getTouchPosition"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_getTouchPosition'", nullptr); - return 0; - } - cocos2d::Vec2 ret = cobj->getTouchPosition(arg0); - vec2_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:getTouchPosition",argc, 1); + fairygui::UIConfig::tooltipsWin = lua_tostring(L, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_getTouchPosition'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_tooltipsWin'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_getPoupPosition(lua_State* tolua_S) +static int lua_fairygui_UIConfig_set_bringWindowToFrontOnClick(lua_State* L) { - int argc = 0; - fairygui::GRoot* cobj = nullptr; - bool ok = true; - #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_getPoupPosition'", nullptr); - return 0; - } + if (!tolua_isboolean(L, 2, 0, &tolua_err)) + goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 3) { - fairygui::GObject* arg0; - fairygui::GObject* arg1; - fairygui::PopupDirection arg2; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.GRoot:getPoupPosition"); - ok &= luaval_to_object(tolua_S, 3, "fairygui.GObject",&arg1, "fairygui.GRoot:getPoupPosition"); - ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "fairygui.GRoot:getPoupPosition"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_getPoupPosition'", nullptr); - return 0; - } - cocos2d::Vec2 ret = cobj->getPoupPosition(arg0, arg1, arg2); - vec2_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:getPoupPosition",argc, 3); + fairygui::UIConfig::bringWindowToFrontOnClick = lua_toboolean(L, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_getPoupPosition'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_bringWindowToFrontOnClick'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_showWindow(lua_State* tolua_S) +static int lua_fairygui_UIConfig_set_windowModalWaiting(lua_State* L) { - int argc = 0; - fairygui::GRoot* cobj = nullptr; - bool ok = true; - #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_showWindow'", nullptr); - return 0; - } + if (!tolua_isstring(L, 2, 0, &tolua_err)) + goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::Window* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.Window",&arg0, "fairygui.GRoot:showWindow"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_showWindow'", nullptr); - return 0; - } - cobj->showWindow(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:showWindow",argc, 1); + fairygui::UIConfig::windowModalWaiting = lua_tostring(L, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_showWindow'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_windowModalWaiting'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_showTooltips(lua_State* tolua_S) +static int lua_fairygui_UIConfig_set_popupMenu(lua_State* L) { - int argc = 0; - fairygui::GRoot* cobj = nullptr; - bool ok = true; - #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_showTooltips'", nullptr); - return 0; - } + if (!tolua_isstring(L, 2, 0, &tolua_err)) + goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.GRoot:showTooltips"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_showTooltips'", nullptr); - return 0; - } - cobj->showTooltips(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:showTooltips",argc, 1); + fairygui::UIConfig::popupMenu = lua_tostring(L, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_showTooltips'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_popupMenu'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_hideWindow(lua_State* tolua_S) +static int lua_fairygui_UIConfig_set_popupMenu_seperator(lua_State* L) { - int argc = 0; - fairygui::GRoot* cobj = nullptr; - bool ok = true; - #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GRoot*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GRoot_hideWindow'", nullptr); - return 0; - } + if (!tolua_isstring(L, 2, 0, &tolua_err)) + goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::Window* arg0; - ok &= luaval_to_object(tolua_S, 2, "fairygui.Window",&arg0, "fairygui.GRoot:hideWindow"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_hideWindow'", nullptr); - return 0; - } - cobj->hideWindow(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GRoot:hideWindow",argc, 1); + fairygui::UIConfig::popupMenu_seperator = lua_tostring(L, 2); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_hideWindow'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_popupMenu_seperator'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_create(lua_State* tolua_S) +static int lua_fairygui_UIConfig_set_onMusicCallback(lua_State* L) { - int argc = 0; - bool ok = true; + LUA_FUNCTION refid = -1; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; #endif - argc = lua_gettop(tolua_S) - 1; - if (argc == 1) { - cocos2d::Scene* arg0; - ok &= luaval_to_object(tolua_S, 2, "cc.Scene",&arg0, "fairygui.GRoot:create"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_create'", nullptr); - return 0; - } - fairygui::GRoot* ret = fairygui::GRoot::create(arg0); - object_to_luaval(tolua_S, "fairygui.GRoot",(fairygui::GRoot*)ret); - return 1; + if lua_isnil(L, 2) { + fairygui::UIConfig::onMusicCallback = nullptr; + // cheat, use fairygui::UIConfig::registerFont address for ref object *_* + ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)fairygui::UIConfig::registerFont, (ScriptHandlerMgr::HandlerType)HT_UICONFIG_MUSIC); + return 0; } - if (argc == 2) { - cocos2d::Scene* arg0; - int arg1; - ok &= luaval_to_object(tolua_S, 2, "cc.Scene",&arg0, "fairygui.GRoot:create"); - ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GRoot:create"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GRoot_create'", nullptr); - return 0; +#if COCOS2D_DEBUG >= 1 + if (!toluafix_isfunction(L, 2, "LUA_FUNCTION", 0, &tolua_err)) + goto tolua_lerror; +#endif + + refid = (toluafix_ref_function(L, 2, 0)); + fairygui::UIConfig::onMusicCallback = [=](const std::string &path) { + LuaEngine::getInstance()->getLuaStack()->pushFunctionByHandler(refid); + lua_pushlstring(L, path.c_str(), path.length()); + int error = lua_pcall(L, 1, 0, 0); // 1 pararm, 0 return + if (error) { + CCLOG("[LUA ERROR] %s", lua_tostring(L, -1)); + lua_pop(L, 1); // remove error message from stack } - fairygui::GRoot* ret = fairygui::GRoot::create(arg0, arg1); - object_to_luaval(tolua_S, "fairygui.GRoot",(fairygui::GRoot*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GRoot:create",argc, 1); + }; + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)fairygui::UIConfig::registerFont, refid, (ScriptHandlerMgr::HandlerType)HT_UICONFIG_MUSIC); return 0; - + #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_create'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_onMusicCallback'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GRoot_getInstance(lua_State* tolua_S) +static int lua_register_fairygui_UIConfig(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"fairygui.UIConfig"); + tolua_cclass(tolua_S,"UIConfig","fairygui.UIConfig","",nullptr); + + tolua_beginmodule(tolua_S,"UIConfig"); + // variable + tolua_variable(tolua_S, "defaultFont", nullptr, lua_fairygui_UIConfig_set_defaultFont); + tolua_variable(tolua_S, "buttonSound", nullptr, lua_fairygui_UIConfig_set_buttonSound); + tolua_variable(tolua_S, "buttonSoundVolumeScale", nullptr, lua_fairygui_UIConfig_set_buttonSoundVolumeScale); + tolua_variable(tolua_S, "defaultScrollStep", nullptr, lua_fairygui_UIConfig_set_defaultScrollStep); + tolua_variable(tolua_S, "defaultScrollDecelerationRate", nullptr, lua_fairygui_UIConfig_set_defaultScrollDecelerationRate); + tolua_variable(tolua_S, "defaultScrollTouchEffect", nullptr, lua_fairygui_UIConfig_set_defaultScrollTouchEffect); + tolua_variable(tolua_S, "defaultScrollBounceEffect", nullptr, lua_fairygui_UIConfig_set_defaultScrollBounceEffect); + tolua_variable(tolua_S, "defaultScrollBarDisplay", nullptr, lua_fairygui_UIConfig_set_defaultScrollBarDisplay); + tolua_variable(tolua_S, "verticalScrollBar", nullptr, lua_fairygui_UIConfig_set_verticalScrollBar); + tolua_variable(tolua_S, "horizontalScrollBar", nullptr, lua_fairygui_UIConfig_set_horizontalScrollBar); + tolua_variable(tolua_S, "touchDragSensitivity", nullptr, lua_fairygui_UIConfig_set_touchDragSensitivity); + tolua_variable(tolua_S, "clickDragSensitivity", nullptr, lua_fairygui_UIConfig_set_clickDragSensitivity); + tolua_variable(tolua_S, "touchScrollSensitivity", nullptr, lua_fairygui_UIConfig_set_touchScrollSensitivity); + tolua_variable(tolua_S, "defaultComboBoxVisibleItemCount", nullptr, lua_fairygui_UIConfig_set_defaultComboBoxVisibleItemCount); + tolua_variable(tolua_S, "globalModalWaiting", nullptr, lua_fairygui_UIConfig_set_globalModalWaiting); + tolua_variable(tolua_S, "modalLayerColor", nullptr, lua_fairygui_UIConfig_set_modalLayerColor); + tolua_variable(tolua_S, "tooltipsWin", nullptr, lua_fairygui_UIConfig_set_tooltipsWin); + tolua_variable(tolua_S, "bringWindowToFrontOnClick", nullptr, lua_fairygui_UIConfig_set_bringWindowToFrontOnClick); + tolua_variable(tolua_S, "windowModalWaiting", nullptr, lua_fairygui_UIConfig_set_windowModalWaiting); + tolua_variable(tolua_S, "popupMenu", nullptr, lua_fairygui_UIConfig_set_popupMenu); + tolua_variable(tolua_S, "popupMenu_seperator", nullptr, lua_fairygui_UIConfig_set_popupMenu_seperator); + tolua_variable(tolua_S, "onMusicCallback", nullptr, lua_fairygui_UIConfig_set_onMusicCallback); + // function + tolua_function(tolua_S,"registerFont", lua_fairygui_UIConfig_registerFont); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::UIConfig).name(); + g_luaType[typeName] = "fairygui.UIConfig"; + g_typeCast["UIConfig"] = "fairygui.UIConfig"; + return 1; +} + +static int lua_fairygui_GLabel_getTitle(lua_State* tolua_S) { int argc = 0; + fairygui::GLabel* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.GRoot",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLabel",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::GLabel*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLabel_getTitle'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S) - 1; + argc = lua_gettop(tolua_S)-1; if (argc == 0) { - fairygui::GRoot* ret = fairygui::GRoot::getInstance(); - object_to_luaval(tolua_S, "fairygui.GRoot",(fairygui::GRoot*)ret); + const std::string& rtn = cobj->getTitle(); + lua_pushlstring(tolua_S, rtn.c_str(), rtn.length()); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GRoot:getInstance",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLabel:getTitle",argc,0); return 0; - + #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GRoot_getInstance'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLabel_getTitle'.",&tolua_err); + return 0; #endif } -static int lua_register_fairygui_GRoot(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.GRoot"); - tolua_cclass(tolua_S,"GRoot","fairygui.GRoot","fairygui.GComponent",nullptr); - - tolua_beginmodule(tolua_S,"GRoot"); - tolua_function(tolua_S,"closeAllWindows",lua_fairygui_GRoot_closeAllWindows); - tolua_function(tolua_S,"hideTooltips",lua_fairygui_GRoot_hideTooltips); - tolua_function(tolua_S,"hasAnyPopup",lua_fairygui_GRoot_hasAnyPopup); - tolua_function(tolua_S,"getTopWindow",lua_fairygui_GRoot_getTopWindow); - tolua_function(tolua_S,"hidePopup",lua_fairygui_GRoot_hidePopup); - tolua_function(tolua_S,"closeAllExceptModals",lua_fairygui_GRoot_closeAllExceptModals); - tolua_function(tolua_S,"showPopup",lua_fairygui_GRoot_showPopup); - tolua_function(tolua_S,"showTooltipsWin",lua_fairygui_GRoot_showTooltipsWin); - tolua_function(tolua_S,"closeModalWait",lua_fairygui_GRoot_closeModalWait); - tolua_function(tolua_S,"getInputProcessor",lua_fairygui_GRoot_getInputProcessor); - tolua_function(tolua_S,"getSoundVolumeScale",lua_fairygui_GRoot_getSoundVolumeScale); - tolua_function(tolua_S,"togglePopup",lua_fairygui_GRoot_togglePopup); - tolua_function(tolua_S,"isSoundEnabled",lua_fairygui_GRoot_isSoundEnabled); - tolua_function(tolua_S,"setSoundVolumeScale",lua_fairygui_GRoot_setSoundVolumeScale); - tolua_function(tolua_S,"getTouchTarget",lua_fairygui_GRoot_getTouchTarget); - tolua_function(tolua_S,"hideWindowImmediately",lua_fairygui_GRoot_hideWindowImmediately); - tolua_function(tolua_S,"getModalLayer",lua_fairygui_GRoot_getModalLayer); - tolua_function(tolua_S,"playSound",lua_fairygui_GRoot_playSound); - tolua_function(tolua_S,"getModalWaitingPane",lua_fairygui_GRoot_getModalWaitingPane); - tolua_function(tolua_S,"setSoundEnabled",lua_fairygui_GRoot_setSoundEnabled); - tolua_function(tolua_S,"bringToFront",lua_fairygui_GRoot_bringToFront); - tolua_function(tolua_S,"hasModalWindow",lua_fairygui_GRoot_hasModalWindow); - tolua_function(tolua_S,"showModalWait",lua_fairygui_GRoot_showModalWait); - tolua_function(tolua_S,"isModalWaiting",lua_fairygui_GRoot_isModalWaiting); - tolua_function(tolua_S,"getTouchPosition",lua_fairygui_GRoot_getTouchPosition); - tolua_function(tolua_S,"getPoupPosition",lua_fairygui_GRoot_getPoupPosition); - tolua_function(tolua_S,"showWindow",lua_fairygui_GRoot_showWindow); - tolua_function(tolua_S,"showTooltips",lua_fairygui_GRoot_showTooltips); - tolua_function(tolua_S,"hideWindow",lua_fairygui_GRoot_hideWindow); - tolua_function(tolua_S,"create", lua_fairygui_GRoot_create); - tolua_function(tolua_S,"getInstance", lua_fairygui_GRoot_getInstance); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::GRoot).name(); - g_luaType[typeName] = "fairygui.GRoot"; - g_typeCast["GRoot"] = "fairygui.GRoot"; - return 1; -} - -static int lua_fairygui_PopupMenu_setItemGrayed(lua_State* tolua_S) +static int lua_fairygui_GLabel_setTitle(lua_State* tolua_S) { - int argc = 0; - fairygui::PopupMenu* cobj = nullptr; bool ok = true; + int argc = 0; + fairygui::GLabel* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLabel",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLabel*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_setItemGrayed'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLabel_setTitle'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 2) { + if (argc == 1) { std::string arg0; - bool arg1; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.PopupMenu:setItemGrayed"); - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.PopupMenu:setItemGrayed"); + ok &= luaval_to_std_string(tolua_S,2,&arg0, "fairygui.GLabel:setTitle"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_PopupMenu_setItemGrayed'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLabel_setTitle'", nullptr); return 0; } - cobj->setItemGrayed(arg0, arg1); - return 0; + cobj->setTitle(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:setItemGrayed",argc, 2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLabel:setTitle",argc,1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_setItemGrayed'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLabel_setTitle'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_PopupMenu_getItemName(lua_State* tolua_S) +static int lua_fairygui_GLabel_getTitleColor(lua_State* tolua_S) { int argc = 0; - fairygui::PopupMenu* cobj = nullptr; - bool ok = true; + fairygui::GLabel* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLabel",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLabel*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_getItemName'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLabel_getTitleColor'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int arg0; - ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fairygui.PopupMenu:getItemName"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_PopupMenu_getItemName'", nullptr); - return 0; - } - const std::string& ret = cobj->getItemName(arg0); - lua_pushlstring(tolua_S,ret.c_str(),ret.length()); + if (argc == 0) { + const cocos2d::Color3B ret = cobj->getTitleColor(); + color3b_to_luaval(tolua_S, ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:getItemName",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLabel:getTitleColor",argc,0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_getItemName'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLabel_getTitleColor'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_PopupMenu_clearItems(lua_State* tolua_S) +static int lua_fairygui_GLabel_setTitleColor(lua_State* tolua_S) { + bool ok = true; int argc = 0; - fairygui::PopupMenu* cobj = nullptr; + fairygui::GLabel* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLabel",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLabel*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_clearItems'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLabel_setTitleColor'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->clearItems(); - return 0; + if (argc == 1) { + cocos2d::Color3B arg0; + ok &=luaval_to_color3b(tolua_S, 2, &arg0, "fairygui.GLabel:setTitleColor"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLabel_setTitleColor'", nullptr); + return 0; + } + cobj->setTitleColor(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:clearItems",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLabel:setTitleColor",argc,1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_clearItems'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLabel_setTitleColor'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_PopupMenu_getList(lua_State* tolua_S) +static int lua_fairygui_GLabel_getTitleFontSize(lua_State* tolua_S) { int argc = 0; - fairygui::PopupMenu* cobj = nullptr; + fairygui::GLabel* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLabel",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLabel*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_getList'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLabel_getTitleFontSize'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - fairygui::GList* ret = cobj->getList(); - object_to_luaval(tolua_S, "fairygui.GList",(fairygui::GList*)ret); + lua_pushinteger(tolua_S, cobj->getTitleFontSize()); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:getList",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLabel:getTitleFontSize",argc,0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_getList'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLabel_getTitleFontSize'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_PopupMenu_removeItem(lua_State* tolua_S) +static int lua_fairygui_GLabel_setTitleFontSize(lua_State* tolua_S) { - int argc = 0; - fairygui::PopupMenu* cobj = nullptr; bool ok = true; + int argc = 0; + fairygui::GLabel* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLabel",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLabel*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_removeItem'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLabel_setTitleFontSize'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.PopupMenu:removeItem"); + int arg0; + ok &=luaval_to_int32(tolua_S, 2, &arg0, "fairygui.GLabel:setTitleFontSize"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_PopupMenu_removeItem'", nullptr); + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLabel_setTitleFontSize'", nullptr); return 0; } - bool ret = cobj->removeItem(arg0); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; + cobj->setTitleFontSize(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:removeItem",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLabel:setTitleFontSize",argc,1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_removeItem'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLabel_setTitleFontSize'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_PopupMenu_addItem(lua_State* tolua_S) +static int lua_fairygui_GLabel_getTextField(lua_State* tolua_S) { int argc = 0; - fairygui::PopupMenu* cobj = nullptr; - bool ok = true; + fairygui::GLabel* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.GLabel",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GLabel*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_addItem'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLabel_getTextField'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.PopupMenu:addItem"); - LUA_FUNCTION handler = (toluafix_ref_function(tolua_S, 3, 0)); - if(!ok || 0 == handler) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_PopupMenu_addItem'", nullptr); - return 0; - } - fairygui::GButton* ret = cobj->addItem(arg0, [=](fairygui::EventContext* context) { - object_to_luaval(tolua_S, "fairygui.EventContext", context); - LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 1); - }); - ScriptHandlerMgr::getInstance()->addCustomHandler((void*)cobj, handler); - object_to_luaval(tolua_S, "fairygui.GButton",(fairygui::GButton*)ret); + if (argc == 0) { + fairygui::GTextField *ret = cobj->getTextField(); + object_to_luaval(tolua_S, "fairygui.GTextField",(fairygui::GTextField*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:addItem",argc, 2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLabel:getTextField",argc,0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_addItem'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLabel_getTextField'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_PopupMenu_addSeperator(lua_State* tolua_S) +static int lua_fairygui_GLabel_create(lua_State* tolua_S) { int argc = 0; - fairygui::PopupMenu* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_addSeperator'", nullptr); - return 0; - } + if (!tolua_isusertable(tolua_S,1,"fairygui.GLabel",0,&tolua_err)) goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; + argc = lua_gettop(tolua_S) - 1; if (argc == 0) { - cobj->addSeperator(); - return 0; + fairygui::GLabel *ret = fairygui::GLabel::create(); + object_to_luaval(tolua_S, "fairygui.GLabel",(fairygui::GLabel*)ret); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:addSeperator",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GLabel:create",argc, 0); return 0; - #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_addSeperator'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLabel_create'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_PopupMenu_addItemAt(lua_State* tolua_S) +static int lua_register_fairygui_GLabel(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"fairygui.GLabel"); + tolua_cclass(tolua_S,"GLabel","fairygui.GLabel","fairygui.GComponent",nullptr); + + tolua_beginmodule(tolua_S,"GLabel"); + tolua_function(tolua_S,"getTitle",lua_fairygui_GLabel_getTitle); + tolua_function(tolua_S,"setTitle",lua_fairygui_GLabel_setTitle); + tolua_function(tolua_S,"getTitleColor",lua_fairygui_GLabel_getTitleColor); + tolua_function(tolua_S,"setTitleColor",lua_fairygui_GLabel_setTitleColor); + tolua_function(tolua_S,"getTitleFontSize",lua_fairygui_GLabel_getTitleFontSize); + tolua_function(tolua_S,"setTitleFontSize",lua_fairygui_GLabel_setTitleFontSize); + tolua_function(tolua_S,"getTextField",lua_fairygui_GLabel_getTextField); + tolua_function(tolua_S,"create", lua_fairygui_GLabel_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::GLabel).name(); + g_luaType[typeName] = "fairygui.GLabel"; + g_typeCast["GLabel"] = "fairygui.GLabel"; + return 1; +} + +static int lua_fairygui_FUIInput_getTextFormat(lua_State* tolua_S) { int argc = 0; - fairygui::PopupMenu* cobj = nullptr; - bool ok = true; + fairygui::FUIInput* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.FUIInput",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::FUIInput*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_addItemAt'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_FUIInput_getTextFormat'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 3) { - std::string arg0; - int arg1; - std::function arg2; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.PopupMenu:addItemAt"); - ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.PopupMenu:addItemAt"); - LUA_FUNCTION handler = (toluafix_ref_function(tolua_S, 4, 0)); - if(!ok || 0 == handler) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_PopupMenu_addItemAt'", nullptr); - return 0; - } - fairygui::GButton* ret = cobj->addItemAt(arg0, arg1, [=](fairygui::EventContext* context) { - object_to_luaval(tolua_S, "fairygui.EventContext", context); - LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 1); - }); - ScriptHandlerMgr::getInstance()->addCustomHandler((void*)cobj, handler); - object_to_luaval(tolua_S, "fairygui.GButton",(fairygui::GButton*)ret); + if (argc == 0) { + fairygui::TextFormat* ret = cobj->getTextFormat(); + object_to_luaval(tolua_S, "fairygui.TextFormat",(fairygui::TextFormat*)ret); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:addItemAt",argc, 3); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUIInput:getTextFormat",argc,0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_addItemAt'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_FUIInput_getTextFormat'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_PopupMenu_setItemText(lua_State* tolua_S) +static int lua_fairygui_FUIInput_applyTextFormat(lua_State* tolua_S) { int argc = 0; - fairygui::PopupMenu* cobj = nullptr; - bool ok = true; + fairygui::FUIInput* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.FUIInput",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::FUIInput*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_setItemText'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_FUIInput_applyTextFormat'", nullptr); return 0; } -#endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - std::string arg0; - std::string arg1; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.PopupMenu:setItemText"); - ok &= luaval_to_std_string(tolua_S, 3,&arg1, "fairygui.PopupMenu:setItemText"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_PopupMenu_setItemText'", nullptr); - return 0; - } - cobj->setItemText(arg0, arg1); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:setItemText",argc, 2); +#endif + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cobj->applyTextFormat(); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUIInput:applyTextFormat",argc,0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_setItemText'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_FUIInput_applyTextFormat'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_PopupMenu_setItemChecked(lua_State* tolua_S) +static int lua_fairygui_FUIInput_isSingleLine(lua_State* tolua_S) { int argc = 0; - fairygui::PopupMenu* cobj = nullptr; - bool ok = true; + fairygui::FUIInput* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.FUIInput",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::FUIInput*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_setItemChecked'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_FUIInput_isSingleLine'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - std::string arg0; - bool arg1; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.PopupMenu:setItemChecked"); - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.PopupMenu:setItemChecked"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_PopupMenu_setItemChecked'", nullptr); - return 0; - } - cobj->setItemChecked(arg0, arg1); - return 0; + if (argc == 0) { + lua_pushboolean(tolua_S, cobj->isSingleLine()); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:setItemChecked",argc, 2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUIInput:isSingleLine",argc,0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_setItemChecked'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_FUIInput_isSingleLine'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_PopupMenu_show(lua_State* tolua_S) +static int lua_fairygui_FUIInput_setSingleLine(lua_State* tolua_S) { int argc = 0; - fairygui::PopupMenu* cobj = nullptr; + fairygui::FUIInput* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.FUIInput",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::FUIInput*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_show'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_FUIInput_setSingleLine'", nullptr); return 0; } #endif - + argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->show(); - return 0; - } - if (argc == 2) { - fairygui::GObject* arg0; - fairygui::PopupDirection arg1; - ok &= luaval_to_object(tolua_S, 2, "fairygui.GObject",&arg0, "fairygui.PopupMenu:show"); - ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.PopupMenu:show"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_PopupMenu_show'", nullptr); - return 0; - } - cobj->show(arg0, arg1); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:show",argc, 0); + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.FUIInput:setSingleLine"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_FUIInput_setSingleLine'", nullptr); + return 0; + } + cobj->setSingleLine(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUIInput:setSingleLine",argc,1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_show'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_FUIInput_setSingleLine'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_PopupMenu_getContentPane(lua_State* tolua_S) +static int lua_fairygui_FUIInput_isPassword(lua_State* tolua_S) { int argc = 0; - fairygui::PopupMenu* cobj = nullptr; + fairygui::FUIInput* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.FUIInput",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::FUIInput*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_getContentPane'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_FUIInput_isPassword'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; if (argc == 0) { - fairygui::GComponent* ret = cobj->getContentPane(); - object_to_luaval(tolua_S, "fairygui.GComponent",(fairygui::GComponent*)ret); + lua_pushboolean(tolua_S, cobj->isPassword()); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:getContentPane",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUIInput:isPassword",argc,0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_getContentPane'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_FUIInput_isPassword'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_PopupMenu_getItemCount(lua_State* tolua_S) +static int lua_fairygui_FUIInput_setPassword(lua_State* tolua_S) { int argc = 0; - fairygui::PopupMenu* cobj = nullptr; + fairygui::FUIInput* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fairygui.FUIInput",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::FUIInput*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_getItemCount'", nullptr); + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_FUIInput_setPassword'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - int ret = cobj->getItemCount(); - tolua_pushnumber(tolua_S,(lua_Number)ret); - return 1; + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2, &arg0, "fairygui.FUIInput:setPassword"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_FUIInput_setPassword'", nullptr); + return 0; + } + cobj->setPassword(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:getItemCount",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUIInput:setPassword",argc,1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_getItemCount'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_FUIInput_setPassword'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_PopupMenu_setItemCheckable(lua_State* tolua_S) +// FUIInput is return by GTextInput:displayObject() +static int lua_register_fairygui_FUIInput(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"fairygui.FUIInput"); + tolua_cclass(tolua_S,"FUIInput","fairygui.FUIInput","ccui.EditBox",nullptr); + + tolua_beginmodule(tolua_S,"FUIInput"); + tolua_function(tolua_S,"getTextFormat",lua_fairygui_FUIInput_getTextFormat); + tolua_function(tolua_S,"applyTextFormat",lua_fairygui_FUIInput_applyTextFormat); + tolua_function(tolua_S,"isSingleLine",lua_fairygui_FUIInput_isSingleLine); + tolua_function(tolua_S,"setSingleLine",lua_fairygui_FUIInput_setSingleLine); + tolua_function(tolua_S,"isPassword",lua_fairygui_FUIInput_isPassword); + tolua_function(tolua_S,"setPassword",lua_fairygui_FUIInput_setPassword); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::FUIInput).name(); + g_luaType[typeName] = "fairygui.FUIInput"; + g_typeCast["FUIInput"] = "fairygui.FUIInput"; + return 1; +} + +static int lua_fairygui_FUISprite_clearContent(lua_State* tolua_S) { int argc = 0; - fairygui::PopupMenu* cobj = nullptr; - bool ok = true; + fairygui::FUISprite* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S, 1, "fairygui.FUISprite", 0, &tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::FUISprite*)tolua_tousertype(tolua_S, 1, 0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_setItemCheckable'", nullptr); + tolua_error(tolua_S, "invalid 'cobj' in function 'lua_fairygui_FUISprite_clearContent'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - std::string arg0; - bool arg1; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.PopupMenu:setItemCheckable"); - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.PopupMenu:setItemCheckable"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_PopupMenu_setItemCheckable'", nullptr); - return 0; - } - cobj->setItemCheckable(arg0, arg1); - return 0; + argc = lua_gettop(tolua_S) - 1; + if (argc == 0) { + cobj->clearContent(); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:setItemCheckable",argc, 2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUISprite:clearContent", argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_setItemCheckable'.",&tolua_err); - return 0; + tolua_error(tolua_S, "#ferror in function 'lua_fairygui_FUISprite_clearContent'.", &tolua_err); + return 0; #endif } -static int lua_fairygui_PopupMenu_isItemChecked(lua_State* tolua_S) +static int lua_fairygui_FUISprite_setScale9Grid(lua_State* tolua_S) { int argc = 0; - fairygui::PopupMenu* cobj = nullptr; + fairygui::FUISprite* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S, 1, "fairygui.FUISprite", 0, &tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::FUISprite*)tolua_tousertype(tolua_S, 1, 0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_isItemChecked'", nullptr); + tolua_error(tolua_S, "invalid 'cobj' in function 'lua_fairygui_FUISprite_setScale9Grid'", nullptr); return 0; } #endif - - argc = lua_gettop(tolua_S)-1; + argc = lua_gettop(tolua_S) - 1; if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.PopupMenu:isItemChecked"); + cocos2d::Rect arg0; + ok = luaval_to_rect(tolua_S, 2, &arg0, "fairygui.FUISprite:setScale9Grid"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_PopupMenu_isItemChecked'", nullptr); + tolua_error(tolua_S, "invalid arguments in function 'lua_fairygui_FUISprite_setScale9Grid'", nullptr); return 0; } - bool ret = cobj->isItemChecked(arg0); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; + cobj->setScale9Grid(&arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:isItemChecked",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUISprite:setScale9Grid", argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_isItemChecked'.",&tolua_err); - return 0; + tolua_error(tolua_S, "#ferror in function 'lua_fairygui_FUISprite_setScale9Grid'.", &tolua_err); + return 0; #endif } -static int lua_fairygui_PopupMenu_setItemVisible(lua_State* tolua_S) +static int lua_fairygui_FUISprite_setGrayed(lua_State* tolua_S) { int argc = 0; - fairygui::PopupMenu* cobj = nullptr; + fairygui::FUISprite* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S, 1, "fairygui.FUISprite", 0, &tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PopupMenu*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::FUISprite*)tolua_tousertype(tolua_S, 1, 0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PopupMenu_setItemVisible'", nullptr); + tolua_error(tolua_S, "invalid 'cobj' in function 'lua_fairygui_FUISprite_setGrayed'", nullptr); return 0; } #endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - std::string arg0; - bool arg1; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.PopupMenu:setItemVisible"); - ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.PopupMenu:setItemVisible"); + argc = lua_gettop(tolua_S) - 1; + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2, &arg0, "fairygui.FUISprite:setGrayed"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_PopupMenu_setItemVisible'", nullptr); + tolua_error(tolua_S, "invalid arguments in function 'lua_fairygui_FUISprite_setGrayed'", nullptr); return 0; } - cobj->setItemVisible(arg0, arg1); - return 0; + cobj->setGrayed(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PopupMenu:setItemVisible",argc, 2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUISprite:setGrayed", argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_setItemVisible'.",&tolua_err); - return 0; + tolua_error(tolua_S, "#ferror in function 'lua_fairygui_FUISprite_setGrayed'.", &tolua_err); + return 0; #endif } -static int lua_fairygui_PopupMenu_create(lua_State* tolua_S) +static int lua_fairygui_FUISprite_getFillMethod(lua_State* tolua_S) { int argc = 0; + fairygui::FUISprite* cobj = nullptr; bool ok = true; - + #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.PopupMenu",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S, 1, "fairygui.FUISprite", 0, &tolua_err)) goto tolua_lerror; #endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 0){ - fairygui::PopupMenu* ret = fairygui::PopupMenu::create(); - object_to_luaval(tolua_S, "fairygui.PopupMenu",(fairygui::PopupMenu*)ret); - return 1; - } - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.PopupMenu:create"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_PopupMenu_create'", nullptr); - return 0; - } - fairygui::PopupMenu* ret = fairygui::PopupMenu::create(arg0); - object_to_luaval(tolua_S, "fairygui.PopupMenu",(fairygui::PopupMenu*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d", "fairygui.PopupMenu:create",argc, 1); + cobj = (fairygui::FUISprite*)tolua_tousertype(tolua_S, 1, 0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S, "invalid 'cobj' in function 'lua_fairygui_FUISprite_getFillMethod'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S) - 1; + if (argc == 0) { + lua_pushinteger(tolua_S, (lua_Integer)cobj->getFillMethod()); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUISprite:getFillMethod", argc, 0); return 0; - + #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PopupMenu_create'.",&tolua_err); - return 0; + tolua_error(tolua_S, "#ferror in function 'lua_fairygui_FUISprite_getFillMethod'.", &tolua_err); + return 0; #endif } -static int lua_register_fairygui_PopupMenu(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.PopupMenu"); - tolua_cclass(tolua_S,"PopupMenu","fairygui.PopupMenu","cc.Ref",nullptr); - - tolua_beginmodule(tolua_S,"PopupMenu"); - tolua_function(tolua_S,"setItemGrayed",lua_fairygui_PopupMenu_setItemGrayed); - tolua_function(tolua_S,"getItemName",lua_fairygui_PopupMenu_getItemName); - tolua_function(tolua_S,"clearItems",lua_fairygui_PopupMenu_clearItems); - tolua_function(tolua_S,"getList",lua_fairygui_PopupMenu_getList); - tolua_function(tolua_S,"removeItem",lua_fairygui_PopupMenu_removeItem); - tolua_function(tolua_S,"addItem",lua_fairygui_PopupMenu_addItem); - tolua_function(tolua_S,"addSeperator",lua_fairygui_PopupMenu_addSeperator); - tolua_function(tolua_S,"addItemAt",lua_fairygui_PopupMenu_addItemAt); - tolua_function(tolua_S,"setItemText",lua_fairygui_PopupMenu_setItemText); - tolua_function(tolua_S,"setItemChecked",lua_fairygui_PopupMenu_setItemChecked); - tolua_function(tolua_S,"show",lua_fairygui_PopupMenu_show); - tolua_function(tolua_S,"getContentPane",lua_fairygui_PopupMenu_getContentPane); - tolua_function(tolua_S,"getItemCount",lua_fairygui_PopupMenu_getItemCount); - tolua_function(tolua_S,"setItemCheckable",lua_fairygui_PopupMenu_setItemCheckable); - tolua_function(tolua_S,"isItemChecked",lua_fairygui_PopupMenu_isItemChecked); - tolua_function(tolua_S,"setItemVisible",lua_fairygui_PopupMenu_setItemVisible); - tolua_function(tolua_S,"create", lua_fairygui_PopupMenu_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::PopupMenu).name(); - g_luaType[typeName] = "fairygui.PopupMenu"; - g_typeCast["PopupMenu"] = "fairygui.PopupMenu"; - return 1; -} - -static int lua_fairygui_UIObjectFactory_newObject(lua_State* tolua_S) +static int lua_fairygui_FUISprite_setFillMethod(lua_State* tolua_S) { int argc = 0; + fairygui::FUISprite* cobj = nullptr; bool ok = true; - + #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.UIObjectFactory",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S, 1, "fairygui.FUISprite", 0, &tolua_err)) goto tolua_lerror; #endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 1){ - fairygui::ObjectType arg0; - ok = luaval_to_int32(tolua_S, 2, (int *)&arg0, "fairygui.UIObjectFactory:newObject"); - if (ok) { - fairygui::GObject* ret = fairygui::UIObjectFactory::newObject(arg0); - object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); - return 1; - } - - fairygui::PackageItem* arg00; - ok = luaval_to_object(tolua_S, 2, "fairygui.PackageItem",&arg00, "fairygui.UIObjectFactory:newObject"); - if (ok) { - fairygui::GObject* ret = fairygui::UIObjectFactory::newObject(arg00); - object_to_luaval(tolua_S, "fairygui.GObject",(fairygui::GObject*)ret); - return 1; - } - - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_UIObjectFactory_newObject'", nullptr); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d", "fairygui.UIObjectFactory:newObject",argc, 1); + cobj = (fairygui::FUISprite*)tolua_tousertype(tolua_S, 1, 0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S, "invalid 'cobj' in function 'lua_fairygui_FUISprite_setFillMethod'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S) - 1; + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2, &arg0, "fairygui.GLoader:setFillMethod"); + if (!ok) { + tolua_error(tolua_S, "invalid arguments in function 'lua_fairygui_FUISprite_setFillMethod'", nullptr); + return 0; + } + cobj->setFillMethod((fairygui::FillMethod)arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUISprite:setFillMethod", argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIObjectFactory_newObject'.",&tolua_err); - return 0; + tolua_error(tolua_S, "#ferror in function 'lua_fairygui_FUISprite_setFillMethod'.", &tolua_err); + return 0; #endif } -static int lua_fairygui_UIObjectFactory_setPackageItemExtension(lua_State* tolua_S) +static int lua_fairygui_FUISprite_getFillOrigin(lua_State* tolua_S) { - int argc = 0; - + int argc = 0; + fairygui::FUISprite* cobj = nullptr; + bool ok = true; + #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.UIObjectFactory",0,&tolua_err) || - !tolua_isstring(tolua_S, 2, 0, &tolua_err) || - !toluafix_isfunction(tolua_S, 3, "LUA_FUNCTION", 0, &tolua_err)) - { - goto tolua_lerror; - } + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S, 1, "fairygui.FUISprite", 0, &tolua_err)) goto tolua_lerror; #endif - - argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - std::string url; - int handler; - luaval_to_std_string(tolua_S, 2, &url, "fairygui.UIObjectFactory:setPackageItemExtension"); - handler = toluafix_ref_function(tolua_S, 3, 0); - // typeid is a ref of static object - ScriptHandlerMgr::getInstance()->addCustomHandler((void *)&typeid(fairygui::UIObjectFactory), handler); - fairygui::UIObjectFactory::setPackageItemExtension(url, [=]() -> fairygui::GComponent * { - LuaEngine::getInstance()->getLuaStack()->pushFunctionByHandler(handler); - int error = lua_pcall(tolua_S, 0, 1, 0); // 1 pararm, 1 return - if (error) { - CCLOG("[LUA ERROR] %s", lua_tostring(tolua_S, -1)); - lua_pop(tolua_S, 1); // remove error message from stack - return nullptr; - } - fairygui::GComponent *com = static_cast(tolua_tousertype(tolua_S, -1, 0)); - lua_pop(tolua_S, 1); - return com; - }); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d", "fairygui.UIObjectFactory:setPackageItemExtension",argc,2); - return 0; + cobj = (fairygui::FUISprite*)tolua_tousertype(tolua_S, 1, 0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S, "invalid 'cobj' in function 'lua_fairygui_FUISprite_getFillOrigin'", nullptr); + return 0; + } +#endif + argc = lua_gettop(tolua_S) - 1; + if (argc == 0) { + lua_pushinteger(tolua_S, (lua_Integer)cobj->getFillOrigin()); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUISprite:getFillOrigin", argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIObjectFactory_setPackageItemExtension'.",&tolua_err); - return 0; + tolua_error(tolua_S, "#ferror in function 'lua_fairygui_FUISprite_getFillOrigin'.", &tolua_err); + return 0; #endif } -static int lua_fairygui_UIObjectFactory_setLoaderExtension(lua_State* tolua_S) +static int lua_fairygui_FUISprite_setFillOrigin(lua_State* tolua_S) { - int argc = 0; - + int argc = 0; + fairygui::FUISprite* cobj = nullptr; + bool ok = true; + #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.UIObjectFactory",0,&tolua_err) || - !toluafix_isfunction(tolua_S, 2, "LUA_FUNCTION", 0, &tolua_err)) - { - goto tolua_lerror; - } + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S, 1, "fairygui.FUISprite", 0, &tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::FUISprite*)tolua_tousertype(tolua_S, 1, 0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S, "invalid 'cobj' in function 'lua_fairygui_FUISprite_setFillOrigin'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int handler = toluafix_ref_function(tolua_S, 2, 0); - // typeid is a ref of static object - ScriptHandlerMgr::getInstance()->addCustomHandler((void *)&typeid(fairygui::UIObjectFactory), handler); - fairygui::UIObjectFactory::setLoaderExtension([=]() -> fairygui::GLoader * { - LuaEngine::getInstance()->getLuaStack()->pushFunctionByHandler(handler); - int error = lua_pcall(tolua_S, 0, 1, 0); // 1 pararm, 1 return - if (error) { - CCLOG("[LUA ERROR] %s", lua_tostring(tolua_S, -1)); - lua_pop(tolua_S, 1); // remove error message from stack - return nullptr; - } - fairygui::GLoader *loader = static_cast(tolua_tousertype(tolua_S, -1, 0)); - lua_pop(tolua_S, 1); - return loader; - }); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d", "fairygui.UIObjectFactory:setLoaderExtension",argc,1); - return 0; + argc = lua_gettop(tolua_S) - 1; + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2, &arg0, "fairygui.FUISprite:setFillMethod"); + if (!ok) { + tolua_error(tolua_S, "invalid arguments in function 'lua_fairygui_FUISprite_setFillOrigin'", nullptr); + return 0; + } + cobj->setFillOrigin((fairygui::FillOrigin)arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUISprite:setFillOrigin", argc, 1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIObjectFactory_setLoaderExtension'.",&tolua_err); - return 0; + tolua_error(tolua_S, "#ferror in function 'lua_fairygui_FUISprite_setFillOrigin'.", &tolua_err); + return 0; #endif } -static int lua_register_fairygui_UIObjectFactory(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.UIObjectFactory"); - tolua_cclass(tolua_S,"UIObjectFactory","fairygui.UIObjectFactory","",nullptr); - - tolua_beginmodule(tolua_S,"UIObjectFactory"); - tolua_function(tolua_S,"newObject", lua_fairygui_UIObjectFactory_newObject); - tolua_function(tolua_S,"setPackageItemExtension", lua_fairygui_UIObjectFactory_setPackageItemExtension); - tolua_function(tolua_S,"setLoaderExtension", lua_fairygui_UIObjectFactory_setLoaderExtension); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::UIObjectFactory).name(); - g_luaType[typeName] = "fairygui.UIObjectFactory"; - g_typeCast["UIObjectFactory"] = "fairygui.UIObjectFactory"; - return 1; -} - -static int lua_fairygui_DragDropManager_cancel(lua_State* tolua_S) +static int lua_fairygui_FUISprite_isFillClockwise(lua_State* tolua_S) { int argc = 0; - fairygui::DragDropManager* cobj = nullptr; + fairygui::FUISprite* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.DragDropManager",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S, 1, "fairygui.FUISprite", 0, &tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::DragDropManager*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::FUISprite*)tolua_tousertype(tolua_S, 1, 0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_DragDropManager_cancel'", nullptr); + tolua_error(tolua_S, "invalid 'cobj' in function 'lua_fairygui_FUISprite_isFillClockwise'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; + argc = lua_gettop(tolua_S) - 1; if (argc == 0) { - cobj->cancel(); - return 0; + lua_pushboolean(tolua_S, cobj->isFillClockwise()); + return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.DragDropManager:cancel",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUISprite:isFillClockwise", argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_DragDropManager_cancel'.",&tolua_err); - return 0; + tolua_error(tolua_S, "#ferror in function 'lua_fairygui_FUISprite_isFillClockwise'.", &tolua_err); + return 0; #endif } -static int lua_fairygui_DragDropManager_isDragging(lua_State* tolua_S) +static int lua_fairygui_FUISprite_setFillClockwise(lua_State* tolua_S) { int argc = 0; - fairygui::DragDropManager* cobj = nullptr; + fairygui::FUISprite* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.DragDropManager",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S, 1, "fairygui.FUISprite", 0, &tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::DragDropManager*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::FUISprite*)tolua_tousertype(tolua_S, 1, 0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_DragDropManager_isDragging'", nullptr); + tolua_error(tolua_S, "invalid 'cobj' in function 'lua_fairygui_FUISprite_setFillClockwise'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - bool ret = cobj->isDragging(); - tolua_pushboolean(tolua_S,(bool)ret); - return 1; + argc = lua_gettop(tolua_S) - 1; + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2, &arg0, "fairygui.FUISprite:setFillClockwise"); + if (!ok) { + tolua_error(tolua_S, "invalid arguments in function 'lua_fairygui_FUISprite_setFillClockwise'", nullptr); + return 0; + } + cobj->setFillClockwise(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.DragDropManager:isDragging",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUISprite:setFillClockwise", argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_DragDropManager_isDragging'.",&tolua_err); - return 0; + tolua_error(tolua_S, "#ferror in function 'lua_fairygui_FUISprite_setFillClockwise'.", &tolua_err); + return 0; #endif } -static int lua_fairygui_DragDropManager_getAgent(lua_State* tolua_S) +static int lua_fairygui_FUISprite_getFillAmount(lua_State* tolua_S) { int argc = 0; - fairygui::DragDropManager* cobj = nullptr; + fairygui::FUISprite* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.DragDropManager",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S, 1, "fairygui.FUISprite", 0, &tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::DragDropManager*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::FUISprite*)tolua_tousertype(tolua_S, 1, 0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_DragDropManager_getAgent'", nullptr); + tolua_error(tolua_S, "invalid 'cobj' in function 'lua_fairygui_FUISprite_getFillAmount'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; + argc = lua_gettop(tolua_S) - 1; if (argc == 0) { - fairygui::GLoader* ret = cobj->getAgent(); - object_to_luaval(tolua_S, "fairygui.GLoader",(fairygui::GLoader*)ret); + lua_pushnumber(tolua_S, cobj->getFillAmount()); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.DragDropManager:getAgent",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUISprite:getFillAmount", argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_DragDropManager_getAgent'.",&tolua_err); - return 0; + tolua_error(tolua_S, "#ferror in function 'lua_fairygui_FUISprite_getFillAmount'.", &tolua_err); + return 0; #endif } -static int lua_fairygui_DragDropManager_startDrag(lua_State* tolua_S) +static int lua_fairygui_FUISprite_setFillAmount(lua_State* tolua_S) { int argc = 0; - fairygui::DragDropManager* cobj = nullptr; + fairygui::FUISprite* cobj = nullptr; bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.DragDropManager",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S, 1, "fairygui.FUISprite", 0, &tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::DragDropManager*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::FUISprite*)tolua_tousertype(tolua_S, 1, 0); #if COCOS2D_DEBUG >= 1 if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_DragDropManager_startDrag'", nullptr); + tolua_error(tolua_S, "invalid 'cobj' in function 'lua_fairygui_FUISprite_setFillAmount'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; + argc = lua_gettop(tolua_S) - 1; if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.DragDropManager:startDrag"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_DragDropManager_startDrag'", nullptr); - return 0; - } - cobj->startDrag(arg0); - return 0; - } - if (argc == 2) { - std::string arg0; - cocos2d::Value arg1; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.DragDropManager:startDrag"); - ok &= luaval_to_ccvalue(tolua_S, 3, &arg1, "fairygui.DragDropManager:startDrag"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_DragDropManager_startDrag'", nullptr); - return 0; - } - cobj->startDrag(arg0, arg1); - return 0; - } - if (argc == 3) { - std::string arg0; - cocos2d::Value arg1; - int arg2; - ok &= luaval_to_std_string(tolua_S, 2,&arg0, "fairygui.DragDropManager:startDrag"); - ok &= luaval_to_ccvalue(tolua_S, 3, &arg1, "fairygui.DragDropManager:startDrag"); - ok &= luaval_to_int32(tolua_S, 4,(int *)&arg2, "fairygui.DragDropManager:startDrag"); + float arg0; + ok &= luaval_to_float(tolua_S, 2, &arg0, "fairygui.FUISprite:setFillAmount"); if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_DragDropManager_startDrag'", nullptr); + tolua_error(tolua_S, "invalid arguments in function 'lua_fairygui_FUISprite_setFillAmount'", nullptr); return 0; } - cobj->startDrag(arg0, arg1, arg2); - return 0; + cobj->setFillAmount(arg0); + return 0; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.DragDropManager:startDrag",argc, 1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUISprite:setFillAmount", argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_DragDropManager_startDrag'.",&tolua_err); - return 0; + tolua_error(tolua_S, "#ferror in function 'lua_fairygui_FUISprite_setFillAmount'.", &tolua_err); + return 0; #endif } -static int lua_fairygui_DragDropManager_getInstance(lua_State* tolua_S) +static int lua_fairygui_FUISprite_isScaleByTile(lua_State* tolua_S) { int argc = 0; + fairygui::FUISprite* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.DragDropManager",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S, 1, "fairygui.FUISprite", 0, &tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::FUISprite*)tolua_tousertype(tolua_S, 1, 0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S, "invalid 'cobj' in function 'lua_fairygui_FUISprite_isScaleByTile'", nullptr); + return 0; + } #endif argc = lua_gettop(tolua_S) - 1; if (argc == 0) { - fairygui::DragDropManager* ret = fairygui::DragDropManager::getInstance(); - object_to_luaval(tolua_S, "fairygui.DragDropManager",(fairygui::DragDropManager*)ret); + lua_pushboolean(tolua_S, cobj->isScaleByTile()); return 1; } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.DragDropManager:getInstance",argc, 0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUISprite:isScaleByTile", argc, 0); return 0; - + #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_DragDropManager_getInstance'.",&tolua_err); - return 0; + tolua_error(tolua_S, "#ferror in function 'lua_fairygui_FUISprite_isScaleByTile'.", &tolua_err); + return 0; #endif } -static int lua_fairygui_DragDropManager_destroyInstance(lua_State* tolua_S) +static int lua_fairygui_FUISprite_setScaleByTile(lua_State* tolua_S) { - int argc = 0; + int argc = 0; + fairygui::FUISprite* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.DragDropManager",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S, 1, "fairygui.FUISprite", 0, &tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::FUISprite*)tolua_tousertype(tolua_S, 1, 0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S, "invalid 'cobj' in function 'lua_fairygui_FUISprite_setScaleByTile'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S) - 1; - if (argc == 0) { - fairygui::DragDropManager::destroyInstance(); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.DragDropManager:destroyInstance",argc, 0); - return 0; - + argc = lua_gettop(tolua_S) - 1; + if (argc == 1) { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2, &arg0, "fairygui.FUISprite:setScaleByTile"); + if (!ok) { + tolua_error(tolua_S, "invalid arguments in function 'lua_fairygui_FUISprite_setScaleByTile'", nullptr); + return 0; + } + cobj->setScaleByTile(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUISprite:setScaleByTile", argc, 1); + return 0; + #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_DragDropManager_destroyInstance'.",&tolua_err); - return 0; + tolua_error(tolua_S, "#ferror in function 'lua_fairygui_FUISprite_setScaleByTile'.", &tolua_err); + return 0; #endif } -static int lua_register_fairygui_DragDropManager(lua_State* tolua_S) +// FUISprite is return by displayObject():getChildren() +static int lua_register_fairygui_FUISprite(lua_State* tolua_S) { - tolua_usertype(tolua_S,"fairygui.DragDropManager"); - tolua_cclass(tolua_S,"DragDropManager","fairygui.DragDropManager","",nullptr); + tolua_usertype(tolua_S, "fairygui.FUISprite"); + tolua_cclass(tolua_S, "FUISprite", "fairygui.FUISprite", "cc.Sprite", nullptr); - tolua_beginmodule(tolua_S,"DragDropManager"); - tolua_function(tolua_S,"cancel",lua_fairygui_DragDropManager_cancel); - tolua_function(tolua_S,"isDragging",lua_fairygui_DragDropManager_isDragging); - tolua_function(tolua_S,"getAgent",lua_fairygui_DragDropManager_getAgent); - tolua_function(tolua_S,"startDrag",lua_fairygui_DragDropManager_startDrag); - tolua_function(tolua_S,"getInstance", lua_fairygui_DragDropManager_getInstance); - tolua_function(tolua_S,"destroyInstance", lua_fairygui_DragDropManager_destroyInstance); + tolua_beginmodule(tolua_S, "FUISprite"); + tolua_function(tolua_S, "clearConten", lua_fairygui_FUISprite_clearContent); + tolua_function(tolua_S, "setScale9Grid", lua_fairygui_FUISprite_setScale9Grid); + tolua_function(tolua_S, "setGrayed", lua_fairygui_FUISprite_setGrayed); + tolua_function(tolua_S, "getFillMethod", lua_fairygui_FUISprite_getFillMethod); + tolua_function(tolua_S, "setFillMethod", lua_fairygui_FUISprite_setFillMethod); + tolua_function(tolua_S, "getFillOrigin", lua_fairygui_FUISprite_getFillOrigin); + tolua_function(tolua_S, "setFillOrigin", lua_fairygui_FUISprite_setFillOrigin); + tolua_function(tolua_S, "isFillClockwise", lua_fairygui_FUISprite_isFillClockwise); + tolua_function(tolua_S, "setFillClockwise", lua_fairygui_FUISprite_setFillClockwise); + tolua_function(tolua_S, "isScaleByTile", lua_fairygui_FUISprite_isScaleByTile); + tolua_function(tolua_S, "setScaleByTile", lua_fairygui_FUISprite_setScaleByTile); tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::DragDropManager).name(); - g_luaType[typeName] = "fairygui.DragDropManager"; - g_typeCast["DragDropManager"] = "fairygui.DragDropManager"; + std::string typeName = typeid(fairygui::FUISprite).name(); + g_luaType[typeName] = "fairygui.FUISprite"; + g_typeCast["FUISprite"] = "fairygui.FUISprite"; return 1; } -typedef enum { - UICONFIG_MUSIC -} UIConfig_HandlerType; - -static int lua_fairygui_UIConfig_registerFont(lua_State* tolua_S) +static int lua_fairygui_GBasicTextField_setUnderlineColor(lua_State* tolua_S) { - int argc = 0; - bool ok = true; - -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; -#endif - - argc = lua_gettop(tolua_S) - 1; - if (argc == 2) { - std::string arg0; - std::string arg1; - ok &= luaval_to_std_string(tolua_S, 2, &arg0, "fairygui.UIConfig:registerFont"); - ok &= luaval_to_std_string(tolua_S, 3, &arg1, "fairygui.UIConfig:registerFont"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_UIConfig_registerFont'", nullptr); - return 0; - } - fairygui::UIConfig::registerFont(arg0, arg1); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.UIConfig:registerFont", argc, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_UIConfig_registerFont'.",&tolua_err); - return 0; -#endif -} + int argc = 0; + fairygui::GBasicTextField* cobj = nullptr; + bool ok = true; -static int lua_fairygui_UIConfig_set_defaultFont(lua_State* L) -{ #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GBasicTextField",0,&tolua_err)) goto tolua_lerror; #endif - + cobj = (fairygui::GBasicTextField*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!tolua_isstring(L, 2, 0, &tolua_err)) - goto tolua_lerror; + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GBasicTextField_setUnderlineColor'", nullptr); + return 0; + } #endif - fairygui::UIConfig::defaultFont = lua_tostring(L, 2); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + cocos2d::Color3B arg0; + ok &= luaval_to_color3b(tolua_S, 2, &arg0, "fairygui.GBasicTextField:setUnderlineColor"); + if (!ok) { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GBasicTextField_setUnderlineColor'", nullptr); + return 0; + } + cobj->setUnderlineColor(arg0); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GBasicTextField:setUnderlineColor",argc,1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_defaultFont'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GBasicTextField_setUnderlineColor'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_UIConfig_set_buttonSound(lua_State* L) +// GBasicTextField is extend from GTextField, and UIObjectFactory create this +static int lua_register_fairygui_GBasicTextField(lua_State* tolua_S) { -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; -#endif - -#if COCOS2D_DEBUG >= 1 - if (!tolua_isstring(L, 2, 0, &tolua_err)) - goto tolua_lerror; -#endif - - fairygui::UIConfig::buttonSound = lua_tostring(L, 2); - return 0; + tolua_usertype(tolua_S,"fairygui.GBasicTextField"); + tolua_cclass(tolua_S,"GBasicTextField","fairygui.GBasicTextField","fairygui.GTextField",nullptr); -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_buttonSound'.",&tolua_err); - return 0; -#endif + tolua_beginmodule(tolua_S,"GBasicTextField"); + tolua_function(tolua_S,"setUnderlineColor",lua_fairygui_GBasicTextField_setUnderlineColor); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::GBasicTextField).name(); + g_luaType[typeName] = "fairygui.GBasicTextField"; + g_typeCast["GBasicTextField"] = "fairygui.GBasicTextField"; + return 1; } -static int lua_fairygui_UIConfig_set_buttonSoundVolumeScale(lua_State* L) +static int lua_fairygui_InputProcessor_getRecentInput(lua_State* tolua_S) { + int argc = 0; + fairygui::InputProcessor* cobj = nullptr; + #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.InputProcessor",0,&tolua_err)) goto tolua_lerror; #endif - + cobj = (fairygui::InputProcessor*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!tolua_isnumber(L, 2, 0, &tolua_err)) - goto tolua_lerror; + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_InputProcessor_getRecentInput'", nullptr); + return 0; + } #endif - fairygui::UIConfig::buttonSoundVolumeScale = lua_tonumber(L, 2); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::InputEvent *ret = cobj->getRecentInput(); + object_to_luaval(tolua_S, "fairygui.InputEvent", ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.InputProcessor:getRecentInput",argc,0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_buttonSoundVolumeScale'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_InputProcessor_getRecentInput'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_UIConfig_set_defaultScrollStep(lua_State* L) +static int lua_fairygui_InputProcessor_mouseMove(lua_State* tolua_S) { + int argc = 0; + fairygui::InputProcessor* cobj = nullptr; + bool ok = true; + #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.InputProcessor",0,&tolua_err)) goto tolua_lerror; #endif - + cobj = (fairygui::InputProcessor*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!tolua_isnumber(L, 2, 0, &tolua_err)) - goto tolua_lerror; + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_InputProcessor_mouseMove'", nullptr); + return 0; + } #endif - fairygui::UIConfig::defaultScrollStep = lua_tointeger(L, 2); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 2) { + float arg0, arg1; + ok &= luaval_to_float(tolua_S, 2, &arg0, "fairygui.InputProcessor:mouseMove"); + ok &= luaval_to_float(tolua_S, 3, &arg1, "fairygui.InputProcessor:mouseMove"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_InputProcessor_mouseMove'", nullptr); + return 0; + } + cobj->mouseMove(arg0, arg1); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.InputProcessor:mouseMove", argc, 2); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_defaultScrollStep'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_InputProcessor_mouseMove'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_UIConfig_set_defaultScrollDecelerationRate(lua_State* L) +// InputProcessor is return by GRoot::getInputProcessor() +static int lua_register_fairygui_InputProcessor(lua_State* tolua_S) { -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; -#endif + tolua_usertype(tolua_S,"fairygui.InputProcessor"); + tolua_cclass(tolua_S,"InputProcessor","fairygui.InputProcessor","",nullptr); -#if COCOS2D_DEBUG >= 1 - if (!tolua_isnumber(L, 2, 0, &tolua_err)) - goto tolua_lerror; -#endif - - fairygui::UIConfig::defaultScrollDecelerationRate = lua_tonumber(L, 2); - return 0; + tolua_beginmodule(tolua_S,"InputProcessor"); + tolua_function(tolua_S,"getRecentInput",lua_fairygui_InputProcessor_getRecentInput); + tolua_function(tolua_S,"mouseMove",lua_fairygui_InputProcessor_mouseMove); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::InputProcessor).name(); + g_luaType[typeName] = "fairygui.InputProcessor"; + g_typeCast["InputProcessor"] = "fairygui.InputProcessor"; + return 1; +} -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_defaultScrollDecelerationRate'.",&tolua_err); - return 0; -#endif +static int lua_fairygui_HtmlObject_get_buttonResource(lua_State* L) +{ + lua_pushlstring(L, fairygui::HtmlObject::buttonResource.c_str(), fairygui::HtmlObject::buttonResource.size()); + return 1; } -static int lua_fairygui_UIConfig_set_defaultScrollTouchEffect(lua_State* L) +static int lua_fairygui_HtmlObject_set_buttonResource(lua_State* L) { #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; #endif + if lua_isnil(L, 2) { + fairygui::HtmlObject::buttonResource = ""; + return 0; + } #if COCOS2D_DEBUG >= 1 - if (!tolua_isboolean(L, 2, 0, &tolua_err)) - goto tolua_lerror; + if (!tolua_isstring(L, 2, 0, &tolua_err)) + goto tolua_lerror; #endif - fairygui::UIConfig::defaultScrollTouchEffect = lua_toboolean(L, 2); - return 0; + fairygui::HtmlObject::buttonResource = tolua_tostring(L, 2, ""); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_defaultScrollTouchEffect'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_HtmlObject_set_buttonResource'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_UIConfig_set_defaultScrollBounceEffect(lua_State* L) +static int lua_fairygui_HtmlObject_get_inputResource(lua_State* L) +{ + lua_pushlstring(L, fairygui::HtmlObject::inputResource.c_str(), fairygui::HtmlObject::inputResource.size()); + return 1; +} + +static int lua_fairygui_HtmlObject_set_inputResource(lua_State* L) { #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; #endif + if lua_isnil(L, 2) { + fairygui::HtmlObject::inputResource = ""; + return 0; + } #if COCOS2D_DEBUG >= 1 - if (!tolua_isboolean(L, 2, 0, &tolua_err)) - goto tolua_lerror; + if (!tolua_isstring(L, 2, 0, &tolua_err)) + goto tolua_lerror; #endif - fairygui::UIConfig::defaultScrollBounceEffect = lua_toboolean(L, 2); - return 0; + fairygui::HtmlObject::inputResource = tolua_tostring(L, 2, ""); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_defaultScrollBounceEffect'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_HtmlObject_set_inputResource'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_UIConfig_set_defaultScrollBarDisplay(lua_State* L) +static int lua_fairygui_HtmlObject_get_selectResource(lua_State* L) +{ + lua_pushlstring(L, fairygui::HtmlObject::selectResource.c_str(), fairygui::HtmlObject::selectResource.size()); + return 1; +} + +static int lua_fairygui_HtmlObject_set_selectResource(lua_State* L) { #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; #endif + if lua_isnil(L, 2) { + fairygui::HtmlObject::selectResource = ""; + return 0; + } #if COCOS2D_DEBUG >= 1 - if (!tolua_isnumber(L, 2, 0, &tolua_err)) - goto tolua_lerror; + if (!tolua_isstring(L, 2, 0, &tolua_err)) + goto tolua_lerror; #endif - fairygui::UIConfig::defaultScrollBarDisplay = (fairygui::ScrollBarDisplayType)lua_tointeger(L, 2); - return 0; + fairygui::HtmlObject::selectResource = tolua_tostring(L, 2, ""); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_defaultScrollBarDisplay'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_HtmlObject_set_selectResource'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_UIConfig_set_verticalScrollBar(lua_State* L) +static int lua_fairygui_HtmlObject_get_usePool(lua_State* L) +{ + tolua_pushboolean(L, fairygui::HtmlObject::usePool); + return 1; +} + +static int lua_fairygui_HtmlObject_set_usePool(lua_State* L) { #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; #endif #if COCOS2D_DEBUG >= 1 - if (!tolua_isstring(L, 2, 0, &tolua_err)) - goto tolua_lerror; + if (!tolua_isboolean(L, 2, 0, &tolua_err)) + goto tolua_lerror; #endif - fairygui::UIConfig::verticalScrollBar = lua_tostring(L, 2); - return 0; + fairygui::HtmlObject::usePool = tolua_toboolean(L, 2, true); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_verticalScrollBar'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_HtmlObject_set_usePool'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_UIConfig_set_horizontalScrollBar(lua_State* L) +static int lua_fairygui_HtmlObject_getUI(lua_State* tolua_S) { + int argc = 0; + fairygui::HtmlObject* cobj = nullptr; + #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.HtmlObject",0,&tolua_err)) goto tolua_lerror; #endif - + cobj = (fairygui::HtmlObject*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!tolua_isstring(L, 2, 0, &tolua_err)) - goto tolua_lerror; + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_HtmlObject_getUI'", nullptr); + return 0; + } #endif - fairygui::UIConfig::horizontalScrollBar = lua_tostring(L, 2); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::GObject *ret = cobj->getUI(); + object_to_luaval(tolua_S, "fairygui.GObject", ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.HtmlObject:getUI",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_horizontalScrollBar'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_HtmlObject_getUI'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_UIConfig_set_touchDragSensitivity(lua_State* L) +static int lua_fairygui_HtmlObject_getElementAttrs(lua_State* tolua_S) { + int argc = 0; + fairygui::HtmlObject* cobj = nullptr; + #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.HtmlObject",0,&tolua_err)) goto tolua_lerror; #endif - + cobj = (fairygui::HtmlObject*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!tolua_isnumber(L, 2, 0, &tolua_err)) - goto tolua_lerror; + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_HtmlObject_getElementAttrs'", nullptr); + return 0; + } #endif - fairygui::UIConfig::touchDragSensitivity = lua_tointeger(L, 2); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cocos2d::ValueMap &ret = cobj->getElement()->attrs; + ccvaluemap_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.HtmlObject:getElementAttrs",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_touchDragSensitivity'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_HtmlObject_getElementAttrs'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_UIConfig_set_clickDragSensitivity(lua_State* L) +// fairygui.HtmlObject:clearStaticPools() +static int lua_fairygui_HtmlObject_clearStaticPools(lua_State* tolua_S) { -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; -#endif + int argc = 0; #if COCOS2D_DEBUG >= 1 - if (!tolua_isnumber(L, 2, 0, &tolua_err)) - goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertable(tolua_S,1,"fairygui.HtmlObject",0,&tolua_err)) goto tolua_lerror; #endif - fairygui::UIConfig::clickDragSensitivity = lua_tointeger(L, 2); - return 0; - + argc = lua_gettop(tolua_S) - 1; + if (argc == 0) { + fairygui::HtmlObject::objectPool.clear(); + fairygui::HtmlObject::loaderPool.clear(); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.HtmlObject:clearStaticPools",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_clickDragSensitivity'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_HtmlObject_clearStaticPools'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_UIConfig_set_touchScrollSensitivity(lua_State* L) +// HtmlObject only need static public members +static int lua_register_fairygui_HtmlObject(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"fairygui.HtmlObject"); + tolua_cclass(tolua_S,"HtmlObject","fairygui.HtmlObject","",nullptr); + + tolua_beginmodule(tolua_S,"HtmlObject"); + // variable + tolua_variable(tolua_S, "buttonResource", lua_fairygui_HtmlObject_get_buttonResource, lua_fairygui_HtmlObject_set_buttonResource); + tolua_variable(tolua_S, "inputResource", lua_fairygui_HtmlObject_get_inputResource, lua_fairygui_HtmlObject_set_inputResource); + tolua_variable(tolua_S, "selectResource", lua_fairygui_HtmlObject_get_selectResource, lua_fairygui_HtmlObject_set_selectResource); + tolua_variable(tolua_S, "usePool", lua_fairygui_HtmlObject_get_usePool, lua_fairygui_HtmlObject_set_usePool); + // function + tolua_function(tolua_S, "getUI", lua_fairygui_HtmlObject_getUI); + tolua_function(tolua_S, "getElementAttrs", lua_fairygui_HtmlObject_getElementAttrs); + tolua_function(tolua_S, "clearStaticPools", lua_fairygui_HtmlObject_clearStaticPools); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::HtmlObject).name(); + g_luaType[typeName] = "fairygui.HtmlObject"; + g_typeCast["HtmlObject"] = "fairygui.HtmlObject"; + return 1; +} + +static int lua_fairygui_PackageItem_get_owner(lua_State* L) { + fairygui::PackageItem* cobj = nullptr; + #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.PackageItem",0,&tolua_err)) goto tolua_lerror; #endif - + cobj = (fairygui::PackageItem*)tolua_tousertype(L, 1, 0); #if COCOS2D_DEBUG >= 1 - if (!tolua_isnumber(L, 2, 0, &tolua_err)) - goto tolua_lerror; + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_PackageItem_get_owner'", nullptr); + return 0; + } #endif - fairygui::UIConfig::touchScrollSensitivity = lua_tointeger(L, 2); - return 0; + object_to_luaval(L, "fairygui.PackageItem", cobj->owner); + return 1; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_touchScrollSensitivity'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_PackageItem_get_owner'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_UIConfig_set_defaultComboBoxVisibleItemCount(lua_State* L) +static int lua_fairygui_PackageItem_get_type(lua_State* L) { + fairygui::PackageItem* cobj = nullptr; + #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.PackageItem",0,&tolua_err)) goto tolua_lerror; #endif - + cobj = (fairygui::PackageItem*)tolua_tousertype(L, 1, 0); #if COCOS2D_DEBUG >= 1 - if (!tolua_isnumber(L, 2, 0, &tolua_err)) - goto tolua_lerror; + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_PackageItem_get_type'", nullptr); + return 0; + } #endif - fairygui::UIConfig::defaultComboBoxVisibleItemCount = lua_tointeger(L, 2); - return 0; + lua_pushinteger(L, (lua_Integer)cobj->type); + return 1; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_defaultComboBoxVisibleItemCount'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_PackageItem_get_type'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_UIConfig_set_globalModalWaiting(lua_State* L) +static int lua_fairygui_PackageItem_get_objectType(lua_State* L) { + fairygui::PackageItem* cobj = nullptr; + #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.PackageItem",0,&tolua_err)) goto tolua_lerror; #endif - + cobj = (fairygui::PackageItem*)tolua_tousertype(L, 1, 0); #if COCOS2D_DEBUG >= 1 - if (!tolua_isstring(L, 2, 0, &tolua_err)) - goto tolua_lerror; + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_PackageItem_get_objectType'", nullptr); + return 0; + } #endif - fairygui::UIConfig::globalModalWaiting = lua_tostring(L, 2); - return 0; + lua_pushinteger(L, (lua_Integer)cobj->objectType); + return 1; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_globalModalWaiting'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_PackageItem_get_objectType'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_UIConfig_set_modalLayerColor(lua_State* L) +static int lua_fairygui_PackageItem_get_id(lua_State* L) { + fairygui::PackageItem* cobj = nullptr; + #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.PackageItem",0,&tolua_err)) goto tolua_lerror; #endif - + cobj = (fairygui::PackageItem*)tolua_tousertype(L, 1, 0); #if COCOS2D_DEBUG >= 1 - if (!tolua_istable(L, 2, 0, &tolua_err)) - goto tolua_lerror; + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_PackageItem_get_id'", nullptr); + return 0; + } #endif - { - Color4F colorf; - luaval_to_color4f(L, 2, &colorf); - fairygui::UIConfig::modalLayerColor = colorf; - } - return 0; + lua_pushlstring(L, cobj->id.c_str(), cobj->id.size()); + return 1; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_modalLayerColor'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_PackageItem_get_id'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_UIConfig_set_tooltipsWin(lua_State* L) +static int lua_fairygui_PackageItem_get_name(lua_State* L) { + fairygui::PackageItem* cobj = nullptr; + #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.PackageItem",0,&tolua_err)) goto tolua_lerror; #endif - + cobj = (fairygui::PackageItem*)tolua_tousertype(L, 1, 0); #if COCOS2D_DEBUG >= 1 - if (!tolua_isstring(L, 2, 0, &tolua_err)) - goto tolua_lerror; + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_PackageItem_get_name'", nullptr); + return 0; + } #endif - fairygui::UIConfig::tooltipsWin = lua_tostring(L, 2); - return 0; + lua_pushlstring(L, cobj->name.c_str(), cobj->name.size()); + return 1; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_tooltipsWin'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_PackageItem_get_name'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_UIConfig_set_bringWindowToFrontOnClick(lua_State* L) +static int lua_fairygui_PackageItem_get_width(lua_State* L) { + fairygui::PackageItem* cobj = nullptr; + #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.PackageItem",0,&tolua_err)) goto tolua_lerror; #endif - + cobj = (fairygui::PackageItem*)tolua_tousertype(L, 1, 0); #if COCOS2D_DEBUG >= 1 - if (!tolua_isboolean(L, 2, 0, &tolua_err)) - goto tolua_lerror; + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_PackageItem_get_width'", nullptr); + return 0; + } #endif - fairygui::UIConfig::bringWindowToFrontOnClick = lua_toboolean(L, 2); - return 0; + lua_pushinteger(L, (lua_Integer)cobj->width); + return 1; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_bringWindowToFrontOnClick'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_PackageItem_get_width'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_UIConfig_set_windowModalWaiting(lua_State* L) +static int lua_fairygui_PackageItem_get_height(lua_State* L) { + fairygui::PackageItem* cobj = nullptr; + #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.PackageItem",0,&tolua_err)) goto tolua_lerror; #endif - + cobj = (fairygui::PackageItem*)tolua_tousertype(L, 1, 0); #if COCOS2D_DEBUG >= 1 - if (!tolua_isstring(L, 2, 0, &tolua_err)) - goto tolua_lerror; + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_PackageItem_get_height'", nullptr); + return 0; + } #endif - fairygui::UIConfig::windowModalWaiting = lua_tostring(L, 2); - return 0; + lua_pushinteger(L, (lua_Integer)cobj->height); + return 1; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_windowModalWaiting'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_PackageItem_get_height'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_UIConfig_set_popupMenu(lua_State* L) +static int lua_fairygui_PackageItem_get_file(lua_State* L) { + fairygui::PackageItem* cobj = nullptr; + #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.PackageItem",0,&tolua_err)) goto tolua_lerror; #endif - + cobj = (fairygui::PackageItem*)tolua_tousertype(L, 1, 0); #if COCOS2D_DEBUG >= 1 - if (!tolua_isstring(L, 2, 0, &tolua_err)) - goto tolua_lerror; + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_PackageItem_get_file'", nullptr); + return 0; + } #endif - fairygui::UIConfig::popupMenu = lua_tostring(L, 2); - return 0; + lua_pushlstring(L, cobj->file.c_str(), cobj->file.size()); + return 1; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_popupMenu'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_PackageItem_get_file'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_UIConfig_set_popupMenu_seperator(lua_State* L) +static int lua_fairygui_PackageItem_get_spriteFrame(lua_State* L) { + fairygui::PackageItem* cobj = nullptr; + #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.PackageItem",0,&tolua_err)) goto tolua_lerror; #endif - + cobj = (fairygui::PackageItem*)tolua_tousertype(L, 1, 0); #if COCOS2D_DEBUG >= 1 - if (!tolua_isstring(L, 2, 0, &tolua_err)) - goto tolua_lerror; + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_PackageItem_get_spriteFrame'", nullptr); + return 0; + } #endif - fairygui::UIConfig::popupMenu_seperator = lua_tostring(L, 2); - return 0; + object_to_luaval(L, "cc.SpriteFrame", cobj->spriteFrame); + return 1; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_popupMenu_seperator'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_PackageItem_get_spriteFrame'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_UIConfig_set_onMusicCallback(lua_State* L) +static int lua_fairygui_PackageItem_load(lua_State* tolua_S) { - LUA_FUNCTION refid = -1; + int argc = 0; + fairygui::PackageItem* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(L,1,"fairygui.UIConfig",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.PackageItem",0,&tolua_err)) goto tolua_lerror; #endif - - if lua_isnil(L, 2) { - fairygui::UIConfig::onMusicCallback = nullptr; - // cheat, use fairygui::UIConfig::registerFont address for ref object *_* - ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)fairygui::UIConfig::registerFont, (ScriptHandlerMgr::HandlerType)UICONFIG_MUSIC); - return 0; - } + cobj = (fairygui::PackageItem*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!toluafix_isfunction(L, 2, "LUA_FUNCTION", 0, &tolua_err)) - goto tolua_lerror; + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PackageItem_load'", nullptr); + return 0; + } #endif - refid = (toluafix_ref_function(L, 2, 0)); - fairygui::UIConfig::onMusicCallback = [=](const std::string &path) { - LuaEngine::getInstance()->getLuaStack()->pushFunctionByHandler(refid); - lua_pushlstring(L, path.c_str(), path.length()); - int error = lua_pcall(L, 1, 0, 0); // 1 pararm, 0 return - if (error) { - CCLOG("[LUA ERROR] %s", lua_tostring(L, -1)); - lua_pop(L, 1); // remove error message from stack - } - }; - ScriptHandlerMgr::getInstance()->addObjectHandler((void*)fairygui::UIConfig::registerFont, refid, (ScriptHandlerMgr::HandlerType)UICONFIG_MUSIC); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cobj->load(); + return 0; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PackageItem:load", argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_UIConfig_set_onMusicCallback'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PackageItem_load'.",&tolua_err); + return 0; #endif } -static int lua_register_fairygui_UIConfig(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.UIConfig"); - tolua_cclass(tolua_S,"UIConfig","fairygui.UIConfig","",nullptr); - - tolua_beginmodule(tolua_S,"UIConfig"); - // variable - tolua_variable(tolua_S, "defaultFont", nullptr, lua_fairygui_UIConfig_set_defaultFont); - tolua_variable(tolua_S, "buttonSound", nullptr, lua_fairygui_UIConfig_set_buttonSound); - tolua_variable(tolua_S, "buttonSoundVolumeScale", nullptr, lua_fairygui_UIConfig_set_buttonSoundVolumeScale); - tolua_variable(tolua_S, "defaultScrollStep", nullptr, lua_fairygui_UIConfig_set_defaultScrollStep); - tolua_variable(tolua_S, "defaultScrollDecelerationRate", nullptr, lua_fairygui_UIConfig_set_defaultScrollDecelerationRate); - tolua_variable(tolua_S, "defaultScrollTouchEffect", nullptr, lua_fairygui_UIConfig_set_defaultScrollTouchEffect); - tolua_variable(tolua_S, "defaultScrollBounceEffect", nullptr, lua_fairygui_UIConfig_set_defaultScrollBounceEffect); - tolua_variable(tolua_S, "defaultScrollBarDisplay", nullptr, lua_fairygui_UIConfig_set_defaultScrollBarDisplay); - tolua_variable(tolua_S, "verticalScrollBar", nullptr, lua_fairygui_UIConfig_set_verticalScrollBar); - tolua_variable(tolua_S, "horizontalScrollBar", nullptr, lua_fairygui_UIConfig_set_horizontalScrollBar); - tolua_variable(tolua_S, "touchDragSensitivity", nullptr, lua_fairygui_UIConfig_set_touchDragSensitivity); - tolua_variable(tolua_S, "clickDragSensitivity", nullptr, lua_fairygui_UIConfig_set_clickDragSensitivity); - tolua_variable(tolua_S, "touchScrollSensitivity", nullptr, lua_fairygui_UIConfig_set_touchScrollSensitivity); - tolua_variable(tolua_S, "defaultComboBoxVisibleItemCount", nullptr, lua_fairygui_UIConfig_set_defaultComboBoxVisibleItemCount); - tolua_variable(tolua_S, "globalModalWaiting", nullptr, lua_fairygui_UIConfig_set_globalModalWaiting); - tolua_variable(tolua_S, "modalLayerColor", nullptr, lua_fairygui_UIConfig_set_modalLayerColor); - tolua_variable(tolua_S, "tooltipsWin", nullptr, lua_fairygui_UIConfig_set_tooltipsWin); - tolua_variable(tolua_S, "bringWindowToFrontOnClick", nullptr, lua_fairygui_UIConfig_set_bringWindowToFrontOnClick); - tolua_variable(tolua_S, "windowModalWaiting", nullptr, lua_fairygui_UIConfig_set_windowModalWaiting); - tolua_variable(tolua_S, "popupMenu", nullptr, lua_fairygui_UIConfig_set_popupMenu); - tolua_variable(tolua_S, "popupMenu_seperator", nullptr, lua_fairygui_UIConfig_set_popupMenu_seperator); - tolua_variable(tolua_S, "onMusicCallback", nullptr, lua_fairygui_UIConfig_set_onMusicCallback); - // function - tolua_function(tolua_S,"registerFont", lua_fairygui_UIConfig_registerFont); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::UIConfig).name(); - g_luaType[typeName] = "fairygui.UIConfig"; - g_typeCast["UIConfig"] = "fairygui.UIConfig"; - return 1; -} - -static int lua_fairygui_GLabel_getTitle(lua_State* tolua_S) +static int lua_fairygui_PackageItem_getBranch(lua_State* tolua_S) { - int argc = 0; - fairygui::GLabel* cobj = nullptr; + int argc = 0; + fairygui::PackageItem* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLabel",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.PackageItem",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLabel*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::PackageItem*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLabel_getTitle'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PackageItem_getBranch'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - const std::string& rtn = cobj->getTitle(); - lua_pushlstring(tolua_S, rtn.c_str(), rtn.length()); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLabel:getTitle",argc,0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::PackageItem *ret = cobj->getBranch(); + object_to_luaval(tolua_S, "fairygui.PackageItem",(fairygui::PackageItem*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PackageItem:getBranch", argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLabel_getTitle'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PackageItem_getBranch'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GLabel_setTitle(lua_State* tolua_S) +static int lua_fairygui_PackageItem_getHighResolution(lua_State* tolua_S) { - bool ok = true; - int argc = 0; - fairygui::GLabel* cobj = nullptr; + int argc = 0; + fairygui::PackageItem* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLabel",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.PackageItem",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLabel*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::PackageItem*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLabel_setTitle'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PackageItem_getHighResolution'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - std::string arg0; - ok &= luaval_to_std_string(tolua_S,2,&arg0, "fairygui.GLabel:setTitle"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLabel_setTitle'", nullptr); - return 0; - } - cobj->setTitle(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLabel:setTitle",argc,1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::PackageItem *ret = cobj->getHighResolution(); + object_to_luaval(tolua_S, "fairygui.PackageItem",(fairygui::PackageItem*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PackageItem:getHighResolution", argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLabel_setTitle'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PackageItem_getHighResolution'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GLabel_getTitleColor(lua_State* tolua_S) +static int lua_register_fairygui_PackageItem(lua_State* tolua_S) { - int argc = 0; - fairygui::GLabel* cobj = nullptr; + tolua_usertype(tolua_S,"fairygui.PackageItem"); + tolua_cclass(tolua_S,"PackageItem","fairygui.PackageItem","",nullptr); + + tolua_beginmodule(tolua_S,"PackageItem"); + // variable + tolua_variable(tolua_S, "owner", lua_fairygui_PackageItem_get_owner, nullptr); + tolua_variable(tolua_S, "type", lua_fairygui_PackageItem_get_type, nullptr); + tolua_variable(tolua_S, "objectType", lua_fairygui_PackageItem_get_objectType, nullptr); + tolua_variable(tolua_S, "id", lua_fairygui_PackageItem_get_id, nullptr); + tolua_variable(tolua_S, "name", lua_fairygui_PackageItem_get_name, nullptr); + tolua_variable(tolua_S, "width", lua_fairygui_PackageItem_get_width, nullptr); + tolua_variable(tolua_S, "height", lua_fairygui_PackageItem_get_height, nullptr); + tolua_variable(tolua_S, "file", lua_fairygui_PackageItem_get_file, nullptr); + tolua_variable(tolua_S, "spriteFrame", lua_fairygui_PackageItem_get_spriteFrame, nullptr); + // function + tolua_function(tolua_S, "load", lua_fairygui_PackageItem_load); + tolua_function(tolua_S, "getBranch", lua_fairygui_PackageItem_getBranch); + tolua_function(tolua_S, "getHighResolution", lua_fairygui_PackageItem_getHighResolution); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::PackageItem).name(); + g_luaType[typeName] = "fairygui.PackageItem"; + g_typeCast["PackageItem"] = "fairygui.PackageItem"; + return 1; +} + +static int lua_fairygui_GTree_set_treeNodeRender(lua_State* L) +{ + fairygui::GTree* cobj = nullptr; + LUA_FUNCTION refid = -1; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLabel",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLabel*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTree*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLabel_getTitleColor'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GTree_set_treeNodeRender'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - const cocos2d::Color3B ret = cobj->getTitleColor(); - color3b_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLabel:getTitleColor",argc,0); - return 0; + if lua_isnil(L, 2) { + cobj->treeNodeRender = nullptr; + ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)cobj, (ScriptHandlerMgr::HandlerType)HT_GTREE_RENDERER); + return 0; + } +#if COCOS2D_DEBUG >= 1 + if (!toluafix_isfunction(L, 2, "LUA_FUNCTION", 0, &tolua_err)) + goto tolua_lerror; +#endif + + refid = (toluafix_ref_function(L, 2, 0)); + cobj->treeNodeRender = [=](fairygui::GTreeNode* node, fairygui::GComponent* obj) { + lua_State *coroutine = LuaEngine::getInstance()->getLuaStack()->getLuaState(); + object_to_luaval(coroutine, "fairygui.GTreeNode", node); + object_to_luaval(coroutine, "fairygui.GComponent", obj); + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(refid, 2); + }; + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)cobj, refid, (ScriptHandlerMgr::HandlerType)HT_GTREE_RENDERER); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLabel_getTitleColor'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_GTree_set_treeNodeRender'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GLabel_setTitleColor(lua_State* tolua_S) +static int lua_fairygui_GTree_set_treeNodeWillExpand(lua_State* L) { - bool ok = true; - int argc = 0; - fairygui::GLabel* cobj = nullptr; + fairygui::GTree* cobj = nullptr; + LUA_FUNCTION refid = -1; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLabel",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLabel*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTree*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLabel_setTitleColor'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GTree_set_treeNodeWillExpand'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - cocos2d::Color3B arg0; - ok &=luaval_to_color3b(tolua_S, 2, &arg0, "fairygui.GLabel:setTitleColor"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLabel_setTitleColor'", nullptr); - return 0; - } - cobj->setTitleColor(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLabel:setTitleColor",argc,1); - return 0; + if lua_isnil(L, 2) { + cobj->treeNodeWillExpand = nullptr; + ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)cobj, (ScriptHandlerMgr::HandlerType)HT_GTREE_WILLEXPAND); + return 0; + } +#if COCOS2D_DEBUG >= 1 + if (!toluafix_isfunction(L, 2, "LUA_FUNCTION", 0, &tolua_err)) + goto tolua_lerror; +#endif + + refid = (toluafix_ref_function(L, 2, 0)); + cobj->treeNodeWillExpand = [=](fairygui::GTreeNode* node, bool expand) { + lua_State *coroutine = LuaEngine::getInstance()->getLuaStack()->getLuaState(); + object_to_luaval(coroutine, "fairygui.GTreeNode", node); + lua_pushboolean(coroutine, (int)expand); + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(refid, 2); + }; + ScriptHandlerMgr::getInstance()->addObjectHandler((void*)cobj, refid, (ScriptHandlerMgr::HandlerType)HT_GTREE_WILLEXPAND); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLabel_setTitleColor'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_GTree_set_treeNodeWillExpand'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GLabel_getTitleFontSize(lua_State* tolua_S) +static int lua_fairygui_GTree_getIndent(lua_State* tolua_S) { - int argc = 0; - fairygui::GLabel* cobj = nullptr; + int argc = 0; + fairygui::GTree* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLabel",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLabel*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTree*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLabel_getTitleFontSize'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTree_getIndent'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - lua_pushinteger(tolua_S, cobj->getTitleFontSize()); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLabel:getTitleFontSize",argc,0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + int rtn = cobj->getIndent(); + lua_pushinteger(tolua_S, rtn); + return 1; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTree:getIndent",argc,0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLabel_getTitleFontSize'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTree_getIndent'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GLabel_setTitleFontSize(lua_State* tolua_S) +static int lua_fairygui_GTree_setIndent(lua_State* tolua_S) { - bool ok = true; - int argc = 0; - fairygui::GLabel* cobj = nullptr; + int argc = 0; + fairygui::GTree* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLabel",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLabel*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTree*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLabel_setTitleFontSize'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTree_setIndent'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int arg0; - ok &=luaval_to_int32(tolua_S, 2, &arg0, "fairygui.GLabel:setTitleFontSize"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GLabel_setTitleFontSize'", nullptr); - return 0; - } - cobj->setTitleFontSize(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLabel:setTitleFontSize",argc,1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + cobj->setIndent((int)lua_tointeger(tolua_S, 2)); + return 0; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTree:setIndent",argc,1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLabel_setTitleFontSize'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTree_setIndent'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GLabel_getTextField(lua_State* tolua_S) +static int lua_fairygui_GTree_getClickToExpand(lua_State* tolua_S) { - int argc = 0; - fairygui::GLabel* cobj = nullptr; + int argc = 0; + fairygui::GTree* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GLabel",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GLabel*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTree*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GLabel_getTextField'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTree_getClickToExpand'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GTextField *ret = cobj->getTextField(); - object_to_luaval(tolua_S, "fairygui.GTextField",(fairygui::GTextField*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GLabel:getTextField",argc,0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + int rtn = cobj->getClickToExpand(); + lua_pushinteger(tolua_S, rtn); + return 1; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTree:getClickToExpand",argc,0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLabel_getTextField'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTree_getClickToExpand'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GLabel_create(lua_State* tolua_S) +static int lua_fairygui_GTree_setClickToExpand(lua_State* tolua_S) { - int argc = 0; + int argc = 0; + fairygui::GTree* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.GLabel",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::GTree*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTree_setClickToExpand'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S) - 1; - if (argc == 0) { - fairygui::GLabel *ret = fairygui::GLabel::create(); - object_to_luaval(tolua_S, "fairygui.GLabel",(fairygui::GLabel*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GLabel:create",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + cobj->setClickToExpand((int)lua_tointeger(tolua_S, 2)); + return 0; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTree:setClickToExpand",argc,1); + return 0; + #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GLabel_create'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTree_setClickToExpand'.",&tolua_err); + return 0; #endif } -static int lua_register_fairygui_GLabel(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.GLabel"); - tolua_cclass(tolua_S,"GLabel","fairygui.GLabel","fairygui.GComponent",nullptr); - - tolua_beginmodule(tolua_S,"GLabel"); - tolua_function(tolua_S,"getTitle",lua_fairygui_GLabel_getTitle); - tolua_function(tolua_S,"setTitle",lua_fairygui_GLabel_setTitle); - tolua_function(tolua_S,"getTitleColor",lua_fairygui_GLabel_getTitleColor); - tolua_function(tolua_S,"setTitleColor",lua_fairygui_GLabel_setTitleColor); - tolua_function(tolua_S,"getTitleFontSize",lua_fairygui_GLabel_getTitleFontSize); - tolua_function(tolua_S,"setTitleFontSize",lua_fairygui_GLabel_setTitleFontSize); - tolua_function(tolua_S,"getTextField",lua_fairygui_GLabel_getTextField); - tolua_function(tolua_S,"create", lua_fairygui_GLabel_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::GLabel).name(); - g_luaType[typeName] = "fairygui.GLabel"; - g_typeCast["GLabel"] = "fairygui.GLabel"; - return 1; -} - -static int lua_fairygui_FUIInput_getTextFormat(lua_State* tolua_S) +static int lua_fairygui_GTree_getRootNode(lua_State* tolua_S) { - int argc = 0; - fairygui::FUIInput* cobj = nullptr; + int argc = 0; + fairygui::GTree* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.FUIInput",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::FUIInput*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTree*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_FUIInput_getTextFormat'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTree_getRootNode'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::TextFormat* ret = cobj->getTextFormat(); - object_to_luaval(tolua_S, "fairygui.TextFormat",(fairygui::TextFormat*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUIInput:getTextFormat",argc,0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::GTreeNode* rtn = cobj->getRootNode(); + object_to_luaval(tolua_S,"fairygui.GTreeNode",(fairygui::GTreeNode*)rtn); + return 1; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTree:getRootNode",argc,0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_FUIInput_getTextFormat'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTree_getRootNode'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_FUIInput_applyTextFormat(lua_State* tolua_S) +static int lua_fairygui_GTree_getSelectedNode(lua_State* tolua_S) { - int argc = 0; - fairygui::FUIInput* cobj = nullptr; + int argc = 0; + fairygui::GTree* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.FUIInput",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::FUIInput*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTree*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_FUIInput_applyTextFormat'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTree_getSelectedNode'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->applyTextFormat(); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUIInput:applyTextFormat",argc,0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::GTreeNode* rtn = cobj->getSelectedNode(); + object_to_luaval(tolua_S,"fairygui.GTreeNode",(fairygui::GTreeNode*)rtn); + return 1; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTree:getSelectedNode",argc,0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_FUIInput_applyTextFormat'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTree_getSelectedNode'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_FUIInput_isSingleLine(lua_State* tolua_S) +static int lua_fairygui_GTree_getSelectedNodes(lua_State* tolua_S) { - int argc = 0; - fairygui::FUIInput* cobj = nullptr; + int argc = 0; + fairygui::GTree* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.FUIInput",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::FUIInput*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTree*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_FUIInput_isSingleLine'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTree_getSelectedNodes'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - lua_pushboolean(tolua_S, cobj->isSingleLine()); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUIInput:isSingleLine",argc,0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + std::vector rtn; + cobj->getSelectedNodes(rtn); + + lua_newtable(tolua_S); + int index = 1; + for (const fairygui::GTreeNode* value : rtn) + { + lua_pushnumber(tolua_S, (lua_Number)index); + object_to_luaval(tolua_S,"fairygui.GTreeNode",(fairygui::GTreeNode*)value); + lua_rawset(tolua_S, -3); + ++index; + } + return 1; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTree:getSelectedNodes",argc,0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_FUIInput_isSingleLine'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTree_getSelectedNodes'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_FUIInput_setSingleLine(lua_State* tolua_S) +static int lua_fairygui_GTree_selectNode(lua_State* tolua_S) { - int argc = 0; - fairygui::FUIInput* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GTree* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.FUIInput",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::FUIInput*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTree*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_FUIInput_setSingleLine'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTree_selectNode'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fairygui.FUIInput:setSingleLine"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_FUIInput_setSingleLine'", nullptr); - return 0; - } - cobj->setSingleLine(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUIInput:setSingleLine",argc,1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc > 0) { + fairygui::GTreeNode *arg0; + luaval_to_object(tolua_S,2,"fairygui::GTreeNode",&arg0,"fairygui.GTree:selectNode"); + if (argc > 1) { + bool arg1 = (bool)lua_toboolean(tolua_S,3); + cobj->selectNode(arg0, arg1); + } else { + cobj->selectNode(arg0); + } + return 0; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting 1 or 2 \n","fairygui.GTree:selectNode",argc); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_FUIInput_setSingleLine'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTree_selectNode'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_FUIInput_isPassword(lua_State* tolua_S) +static int lua_fairygui_GTree_unselectNode(lua_State* tolua_S) { - int argc = 0; - fairygui::FUIInput* cobj = nullptr; + int argc = 0; + fairygui::GTree* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.FUIInput",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::FUIInput*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTree*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_FUIInput_isPassword'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTree_unselectNode'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - lua_pushboolean(tolua_S, cobj->isPassword()); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUIInput:isPassword",argc,0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + fairygui::GTreeNode *arg0; + luaval_to_object(tolua_S,2,"fairygui::GTreeNode",&arg0,"fairygui.GTree:unselectNode"); + cobj->unselectNode(arg0); + return 0; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d\n","fairygui.GTree:unselectNode",argc,1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_FUIInput_isPassword'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTree_unselectNode'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_FUIInput_setPassword(lua_State* tolua_S) +static int lua_fairygui_GTree_expandAll(lua_State* tolua_S) { - int argc = 0; - fairygui::FUIInput* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GTree* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.FUIInput",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::FUIInput*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTree*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_FUIInput_setPassword'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTree_expandAll'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - bool arg0; - ok &= luaval_to_boolean(tolua_S, 2, &arg0, "fairygui.FUIInput:setPassword"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_FUIInput_setPassword'", nullptr); - return 0; - } - cobj->setPassword(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.FUIInput:setPassword",argc,1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + fairygui::GTreeNode *arg0; + luaval_to_object(tolua_S,2,"fairygui::GTreeNode",&arg0,"fairygui.GTree:expandAll"); + cobj->expandAll(arg0); + return 0; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d\n","fairygui.GTree:expandAll",argc,1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_FUIInput_setPassword'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTree_expandAll'.",&tolua_err); + return 0; #endif } -// FUIInput is return by GTextInput:displayObject() -static int lua_register_fairygui_FUIInput(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.FUIInput"); - tolua_cclass(tolua_S,"FUIInput","fairygui.FUIInput","ccui.EditBox",nullptr); - - tolua_beginmodule(tolua_S,"FUIInput"); - tolua_function(tolua_S,"getTextFormat",lua_fairygui_FUIInput_getTextFormat); - tolua_function(tolua_S,"applyTextFormat",lua_fairygui_FUIInput_applyTextFormat); - tolua_function(tolua_S,"isSingleLine",lua_fairygui_FUIInput_isSingleLine); - tolua_function(tolua_S,"setSingleLine",lua_fairygui_FUIInput_setSingleLine); - tolua_function(tolua_S,"isPassword",lua_fairygui_FUIInput_isPassword); - tolua_function(tolua_S,"setPassword",lua_fairygui_FUIInput_setPassword); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::FUIInput).name(); - g_luaType[typeName] = "fairygui.FUIInput"; - g_typeCast["FUIInput"] = "fairygui.FUIInput"; - return 1; -} - -static int lua_fairygui_GBasicTextField_setUnderlineColor(lua_State* tolua_S) +static int lua_fairygui_GTree_collapseAll(lua_State* tolua_S) { - int argc = 0; - fairygui::GBasicTextField* cobj = nullptr; - bool ok = true; + int argc = 0; + fairygui::GTree* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GBasicTextField",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GBasicTextField*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTree*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GBasicTextField_setUnderlineColor'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTree_collapseAll'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - cocos2d::Color3B arg0; - ok &= luaval_to_color3b(tolua_S, 2, &arg0, "fairygui.GBasicTextField:setUnderlineColor"); - if (!ok) { - tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GBasicTextField_setUnderlineColor'", nullptr); - return 0; - } - cobj->setUnderlineColor(arg0); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.GBasicTextField:setUnderlineColor",argc,1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + fairygui::GTreeNode *arg0; + luaval_to_object(tolua_S,2,"fairygui::GTreeNode",&arg0,"fairygui.GTree:collapseAll"); + cobj->collapseAll(arg0); + return 0; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d\n","fairygui.GTree:collapseAll",argc,1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GBasicTextField_setUnderlineColor'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTree_collapseAll'.",&tolua_err); + return 0; #endif } -// GBasicTextField is extend from GTextField, and UIObjectFactory create this -static int lua_register_fairygui_GBasicTextField(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.GBasicTextField"); - tolua_cclass(tolua_S,"GBasicTextField","fairygui.GBasicTextField","fairygui.GTextField",nullptr); - - tolua_beginmodule(tolua_S,"GBasicTextField"); - tolua_function(tolua_S,"setUnderlineColor",lua_fairygui_GBasicTextField_setUnderlineColor); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::GBasicTextField).name(); - g_luaType[typeName] = "fairygui.GBasicTextField"; - g_typeCast["GBasicTextField"] = "fairygui.GBasicTextField"; - return 1; -} - -static int lua_fairygui_InputProcessor_getRecentInput(lua_State* tolua_S) +static int lua_fairygui_GTree_create(lua_State* tolua_S) { - int argc = 0; - fairygui::InputProcessor* cobj = nullptr; + int argc = 0; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.InputProcessor",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::InputProcessor*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_InputProcessor_getRecentInput'", nullptr); - return 0; - } + tolua_Error tolua_err; + if (!tolua_isusertable(tolua_S,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::InputEvent *ret = cobj->getRecentInput(); - object_to_luaval(tolua_S, "fairygui.InputEvent", ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.InputProcessor:getRecentInput",argc,0); - return 0; - + argc = lua_gettop(tolua_S) - 1; + if (argc == 0) { + fairygui::GTree *ret = fairygui::GTree::create(); + object_to_luaval(tolua_S,"fairygui.GTree",(fairygui::GTree*)ret); + return 1; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d\n ","fairygui.GTree:create",argc, 0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_InputProcessor_getRecentInput'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTree_create'.",&tolua_err); + return 0; #endif } -// InputProcessor is return by GRoot::getInputProcessor() -static int lua_register_fairygui_InputProcessor(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.InputProcessor"); - tolua_cclass(tolua_S,"InputProcessor","fairygui.InputProcessor","",nullptr); - - tolua_beginmodule(tolua_S,"InputProcessor"); - tolua_function(tolua_S,"getRecentInput",lua_fairygui_InputProcessor_getRecentInput); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::InputProcessor).name(); - g_luaType[typeName] = "fairygui.InputProcessor"; - g_typeCast["InputProcessor"] = "fairygui.InputProcessor"; - return 1; -} - -static int lua_fairygui_HtmlObject_get_buttonResource(lua_State* L) +static int lua_register_fairygui_GTree(lua_State* tolua_S) { - lua_pushlstring(L, fairygui::HtmlObject::buttonResource.c_str(), fairygui::HtmlObject::buttonResource.size()); - return 1; + tolua_usertype(tolua_S,"fairygui.GTree"); + tolua_cclass(tolua_S,"GTree","fairygui.GTree","fairygui.GList",nullptr); + + tolua_beginmodule(tolua_S,"GTree"); + // variable + tolua_variable(tolua_S, "treeNodeRender", nullptr, lua_fairygui_GTree_set_treeNodeRender); + tolua_variable(tolua_S, "treeNodeWillExpand", nullptr, lua_fairygui_GTree_set_treeNodeWillExpand); + // function + tolua_function(tolua_S,"getIndent",lua_fairygui_GTree_getIndent); + tolua_function(tolua_S,"setIndent",lua_fairygui_GTree_setIndent); + tolua_function(tolua_S,"getClickToExpand",lua_fairygui_GTree_getClickToExpand); + tolua_function(tolua_S,"setClickToExpand",lua_fairygui_GTree_setClickToExpand); + tolua_function(tolua_S,"getRootNode",lua_fairygui_GTree_getRootNode); + tolua_function(tolua_S,"getSelectedNode",lua_fairygui_GTree_getSelectedNode); + tolua_function(tolua_S,"getSelectedNodes",lua_fairygui_GTree_getSelectedNodes); + tolua_function(tolua_S,"selectNode",lua_fairygui_GTree_selectNode); + tolua_function(tolua_S,"unselectNode",lua_fairygui_GTree_unselectNode); + tolua_function(tolua_S,"expandAll",lua_fairygui_GTree_expandAll); + tolua_function(tolua_S,"collapseAll",lua_fairygui_GTree_collapseAll); + tolua_function(tolua_S,"create", lua_fairygui_GTree_create); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::GTree).name(); + g_luaType[typeName] = "fairygui.GTree"; + g_typeCast["GTree"] = "fairygui.GTree"; + return 1; } -static int lua_fairygui_HtmlObject_set_buttonResource(lua_State* L) +static int lua_fairygui_GTreeNode_create(lua_State* tolua_S) { -#if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; -#endif + int argc = 0; - if lua_isnil(L, 2) { - fairygui::HtmlObject::buttonResource = ""; - return 0; - } #if COCOS2D_DEBUG >= 1 - if (!tolua_isstring(L, 2, 0, &tolua_err)) - goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertable(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - - fairygui::HtmlObject::buttonResource = tolua_tostring(L, 2, ""); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc <= 2) { + fairygui::GTreeNode *ret = nullptr; + if (argc > 0) { + bool isFolder = (bool)lua_toboolean(tolua_S, 2); + if (argc > 1) { + std::string resURL; + luaval_to_std_string(tolua_S, 3, &resURL, "fairygui.GTreeNode:create"); + ret = fairygui::GTreeNode::create(isFolder, resURL); + } else { + ret = fairygui::GTreeNode::create(isFolder); + } + } else { + ret = fairygui::GTreeNode::create(); + } + object_to_luaval(tolua_S,"fairygui.GTreeNode",(fairygui::GTreeNode*)ret); + return 1; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting 0~2\n ","fairygui.GTreeNode:create",argc); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_HtmlObject_set_buttonResource'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_create'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_HtmlObject_get_inputResource(lua_State* L) +static int lua_fairygui_GTreeNode_getParent(lua_State* tolua_S) { - lua_pushlstring(L, fairygui::HtmlObject::inputResource.c_str(), fairygui::HtmlObject::inputResource.size()); - return 1; -} + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; -static int lua_fairygui_HtmlObject_set_inputResource(lua_State* L) -{ #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - - if lua_isnil(L, 2) { - fairygui::HtmlObject::inputResource = ""; - return 0; - } + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!tolua_isstring(L, 2, 0, &tolua_err)) - goto tolua_lerror; + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_getParent'", nullptr); + return 0; + } #endif - - fairygui::HtmlObject::inputResource = tolua_tostring(L, 2, ""); - return 0; + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::GTreeNode *node = cobj->getParent(); + object_to_luaval(tolua_S, "fairygui.GTreeNode", node); + return 1; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:getParent",argc,0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_HtmlObject_set_inputResource'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_getParent'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_HtmlObject_get_selectResource(lua_State* L) +static int lua_fairygui_GTreeNode_getTree(lua_State* tolua_S) { - lua_pushlstring(L, fairygui::HtmlObject::selectResource.c_str(), fairygui::HtmlObject::selectResource.size()); - return 1; -} + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; -static int lua_fairygui_HtmlObject_set_selectResource(lua_State* L) -{ #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - - if lua_isnil(L, 2) { - fairygui::HtmlObject::selectResource = ""; - return 0; - } + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!tolua_isstring(L, 2, 0, &tolua_err)) - goto tolua_lerror; + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_getTree'", nullptr); + return 0; + } #endif - - fairygui::HtmlObject::selectResource = tolua_tostring(L, 2, ""); - return 0; + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::GTree *tree = cobj->getTree(); + object_to_luaval(tolua_S, "fairygui.GTree", tree); + return 1; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:getTree",argc,0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_HtmlObject_set_selectResource'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_getTree'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_HtmlObject_get_usePool(lua_State* L) +static int lua_fairygui_GTreeNode_getCell(lua_State* tolua_S) { - tolua_pushboolean(L, fairygui::HtmlObject::usePool); - return 1; -} + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; -static int lua_fairygui_HtmlObject_set_usePool(lua_State* L) -{ #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!tolua_isboolean(L, 2, 0, &tolua_err)) - goto tolua_lerror; + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_getCell'", nullptr); + return 0; + } #endif - - fairygui::HtmlObject::usePool = tolua_toboolean(L, 2, true); - return 0; + + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::GComponent *com = cobj->getCell(); + object_to_luaval(tolua_S, "fairygui.GComponent", com); + return 1; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:getCell",argc,0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_HtmlObject_set_usePool'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_getCell'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_HtmlObject_getUI(lua_State* tolua_S) +static int lua_fairygui_GTreeNode_getData(lua_State* tolua_S) { - int argc = 0; - fairygui::HtmlObject* cobj = nullptr; + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.HtmlObject",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::HtmlObject*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_HtmlObject_getUI'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_getData'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GObject *ret = cobj->getUI(); - object_to_luaval(tolua_S, "fairygui.GObject", ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.HtmlObject:getUI",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + const cocos2d::Value& data = cobj->getData(); + ccvalue_to_luaval(tolua_S, data); + return 1; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:getData",argc,0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_HtmlObject_getUI'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_getData'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_HtmlObject_getElementAttrs(lua_State* tolua_S) +static int lua_fairygui_GTreeNode_setData(lua_State* tolua_S) { - int argc = 0; - fairygui::HtmlObject* cobj = nullptr; + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.HtmlObject",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::HtmlObject*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_HtmlObject_getElementAttrs'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_setData'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cocos2d::ValueMap &ret = cobj->getElement()->attrs; - ccvaluemap_to_luaval(tolua_S, ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.HtmlObject:getElementAttrs",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + cocos2d::Value data; + luaval_to_ccvalue(tolua_S, 2, &data); + cobj->setData(data); + return 0; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:setData",argc,1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_HtmlObject_getElementAttrs'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_setData'.",&tolua_err); + return 0; #endif } -// fairygui.HtmlObject:clearStaticPools() -static int lua_fairygui_HtmlObject_clearStaticPools(lua_State* tolua_S) +static int lua_fairygui_GTreeNode_isExpanded(lua_State* tolua_S) { - int argc = 0; + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.HtmlObject",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_isExpanded'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S) - 1; - if (argc == 0) { - fairygui::HtmlObject::objectPool.clear(); - fairygui::HtmlObject::loaderPool.clear(); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.HtmlObject:clearStaticPools",argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + bool rtn = cobj->isExpanded(); + lua_pushboolean(tolua_S, (int)rtn); + return 1; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:isExpanded",argc,0); + return 0; + #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_HtmlObject_clearStaticPools'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_isExpanded'.",&tolua_err); + return 0; #endif } -// HtmlObject only need static public members -static int lua_register_fairygui_HtmlObject(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.HtmlObject"); - tolua_cclass(tolua_S,"HtmlObject","fairygui.HtmlObject","",nullptr); - - tolua_beginmodule(tolua_S,"HtmlObject"); - // variable - tolua_variable(tolua_S, "buttonResource", lua_fairygui_HtmlObject_get_buttonResource, lua_fairygui_HtmlObject_set_buttonResource); - tolua_variable(tolua_S, "inputResource", lua_fairygui_HtmlObject_get_inputResource, lua_fairygui_HtmlObject_set_inputResource); - tolua_variable(tolua_S, "selectResource", lua_fairygui_HtmlObject_get_selectResource, lua_fairygui_HtmlObject_set_selectResource); - tolua_variable(tolua_S, "usePool", lua_fairygui_HtmlObject_get_usePool, lua_fairygui_HtmlObject_set_usePool); - // function - tolua_function(tolua_S, "getUI", lua_fairygui_HtmlObject_getUI); - tolua_function(tolua_S, "getElementAttrs", lua_fairygui_HtmlObject_getElementAttrs); - tolua_function(tolua_S, "clearStaticPools", lua_fairygui_HtmlObject_clearStaticPools); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::HtmlObject).name(); - g_luaType[typeName] = "fairygui.HtmlObject"; - g_typeCast["HtmlObject"] = "fairygui.HtmlObject"; - return 1; -} - -static int lua_fairygui_PackageItem_get_owner(lua_State* L) +static int lua_fairygui_GTreeNode_setExpaned(lua_State* tolua_S) { - fairygui::PackageItem* cobj = nullptr; + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.PackageItem",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PackageItem*)tolua_tousertype(L, 1, 0); + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_PackageItem_get_owner'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_setExpaned'", nullptr); + return 0; + } #endif - object_to_luaval(L, "fairygui.PackageItem", cobj->owner); - return 1; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + bool expand = lua_toboolean(tolua_S, 2); + cobj->setExpaned(expand); + return 0; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:setExpaned",argc,1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_PackageItem_get_owner'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_setExpaned'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_PackageItem_get_type(lua_State* L) +static int lua_fairygui_GTreeNode_isFolder(lua_State* tolua_S) { - fairygui::PackageItem* cobj = nullptr; + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.PackageItem",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PackageItem*)tolua_tousertype(L, 1, 0); + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_PackageItem_get_type'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_isFolder'", nullptr); + return 0; + } #endif - lua_pushinteger(L, (lua_Integer)cobj->type); - return 1; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + bool rtn = cobj->isFolder(); + lua_pushboolean(tolua_S, (int)rtn); + return 1; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:isFolder",argc,0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_PackageItem_get_type'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_isFolder'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_PackageItem_get_objectType(lua_State* L) +static int lua_fairygui_GTreeNode_getText(lua_State* tolua_S) { - fairygui::PackageItem* cobj = nullptr; + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.PackageItem",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PackageItem*)tolua_tousertype(L, 1, 0); + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_PackageItem_get_objectType'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_getText'", nullptr); + return 0; + } #endif - lua_pushinteger(L, (lua_Integer)cobj->objectType); - return 1; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + const std::string& rtn = cobj->getText(); + lua_pushlstring(tolua_S, rtn.c_str(), rtn.length()); + return 1; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:getText",argc,0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_PackageItem_get_objectType'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_getText'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_PackageItem_get_id(lua_State* L) +static int lua_fairygui_GTreeNode_setText(lua_State* tolua_S) { - fairygui::PackageItem* cobj = nullptr; + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.PackageItem",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PackageItem*)tolua_tousertype(L, 1, 0); + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_PackageItem_get_id'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_setText'", nullptr); + return 0; + } #endif - lua_pushlstring(L, cobj->id.c_str(), cobj->id.size()); - return 1; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + std::string value; + luaval_to_std_string(tolua_S, 2, &value, "fairygui.GTreeNode:setText"); + cobj->setText(value); + return 0; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:setText",argc,1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_PackageItem_get_id'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_setText'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_PackageItem_get_name(lua_State* L) +static int lua_fairygui_GTreeNode_getIcon(lua_State* tolua_S) { - fairygui::PackageItem* cobj = nullptr; + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.PackageItem",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PackageItem*)tolua_tousertype(L, 1, 0); + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_PackageItem_get_name'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_getIcon'", nullptr); + return 0; + } #endif - lua_pushlstring(L, cobj->name.c_str(), cobj->name.size()); - return 1; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + const std::string& rtn = cobj->getIcon(); + lua_pushlstring(tolua_S, rtn.c_str(), rtn.length()); + return 1; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:getIcon",argc,0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_PackageItem_get_name'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_getIcon'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_PackageItem_get_width(lua_State* L) +static int lua_fairygui_GTreeNode_setIcon(lua_State* tolua_S) { - fairygui::PackageItem* cobj = nullptr; + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.PackageItem",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PackageItem*)tolua_tousertype(L, 1, 0); + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_PackageItem_get_width'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_setIcon'", nullptr); + return 0; + } #endif - lua_pushinteger(L, (lua_Integer)cobj->width); - return 1; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + std::string value; + luaval_to_std_string(tolua_S, 2, &value, "fairygui.GTreeNode:setIcon"); + cobj->setIcon(value); + return 0; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:setIcon",argc,1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_PackageItem_get_width'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_setIcon'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_PackageItem_get_height(lua_State* L) +static int lua_fairygui_GTreeNode_addChild(lua_State* tolua_S) { - fairygui::PackageItem* cobj = nullptr; + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.PackageItem",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PackageItem*)tolua_tousertype(L, 1, 0); + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_PackageItem_get_height'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_addChild'", nullptr); + return 0; + } #endif - lua_pushinteger(L, (lua_Integer)cobj->height); - return 1; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + fairygui::GTreeNode* child; + luaval_to_object(tolua_S,2,"fairygui.GTreeNode",&child,"fairygui.GTreeNode:addChild"); + child = cobj->addChild(child); + object_to_luaval(tolua_S,"fairygui.GTreeNode",(fairygui::GTreeNode*)child); + return 1; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:addChild",argc,1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_PackageItem_get_height'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_addChild'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_PackageItem_get_file(lua_State* L) +static int lua_fairygui_GTreeNode_addChildAt(lua_State* tolua_S) { - fairygui::PackageItem* cobj = nullptr; + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.PackageItem",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PackageItem*)tolua_tousertype(L, 1, 0); + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_PackageItem_get_file'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_addChildAt'", nullptr); + return 0; + } #endif - lua_pushlstring(L, cobj->file.c_str(), cobj->file.size()); - return 1; + argc = lua_gettop(tolua_S)-1; + if (argc == 2) { + fairygui::GTreeNode* child; + int index; + luaval_to_object(tolua_S,2,"fairygui.GTreeNode",&child,"fairygui.GTreeNode:addChildAt"); + index = (int)lua_tointeger(tolua_S, 3); + child = cobj->addChildAt(child, index); + object_to_luaval(tolua_S,"fairygui.GTreeNode",(fairygui::GTreeNode*)child); + return 1; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:addChildAt",argc,2); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_PackageItem_get_file'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_addChildAt'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_PackageItem_get_spriteFrame(lua_State* L) +static int lua_fairygui_GTreeNode_removeChild(lua_State* tolua_S) { - fairygui::PackageItem* cobj = nullptr; + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.PackageItem",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PackageItem*)tolua_tousertype(L, 1, 0); + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_PackageItem_get_spriteFrame'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_removeChild'", nullptr); + return 0; + } #endif - object_to_luaval(L, "cc.SpriteFrame", cobj->spriteFrame); - return 1; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + fairygui::GTreeNode* child; + luaval_to_object(tolua_S,2,"fairygui.GTreeNode",&child,"fairygui.GTreeNode:removeChild"); + cobj->removeChild(child); + return 0; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:removeChild",argc,1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_PackageItem_get_spriteFrame'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_removeChild'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_PackageItem_load(lua_State* tolua_S) +static int lua_fairygui_GTreeNode_removeChildAt(lua_State* tolua_S) { - int argc = 0; - fairygui::PackageItem* cobj = nullptr; + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.PackageItem",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PackageItem*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PackageItem_load'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_removeChildAt'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->load(); - return 0; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PackageItem:load", argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + int index = (int)lua_tointeger(tolua_S, 2); + cobj->removeChildAt(index); + return 0; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:removeChildAt",argc,1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PackageItem_load'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_removeChildAt'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_PackageItem_getBranch(lua_State* tolua_S) +static int lua_fairygui_GTreeNode_removeChildren(lua_State* tolua_S) { - int argc = 0; - fairygui::PackageItem* cobj = nullptr; + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.PackageItem",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PackageItem*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PackageItem_getBranch'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_removeChildren'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::PackageItem *ret = cobj->getBranch(); - object_to_luaval(tolua_S, "fairygui.PackageItem",(fairygui::PackageItem*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PackageItem:getBranch", argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + cobj->removeChildren(); + return 0; + } else if (argc == 2) { + int beginIndex = (int)lua_tointeger(tolua_S, 2); + int endIndex = (int)lua_tointeger(tolua_S, 3); + cobj->removeChildren(beginIndex, endIndex); + return 0; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting 0 or 2 \n","fairygui.GTreeNode:removeChildren",argc); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PackageItem_getBranch'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_removeChildren'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_PackageItem_getHighResolution(lua_State* tolua_S) +static int lua_fairygui_GTreeNode_getChildAt(lua_State* tolua_S) { - int argc = 0; - fairygui::PackageItem* cobj = nullptr; + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.PackageItem",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::PackageItem*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_PackageItem_getHighResolution'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_getChildAt'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::PackageItem *ret = cobj->getHighResolution(); - object_to_luaval(tolua_S, "fairygui.PackageItem",(fairygui::PackageItem*)ret); - return 1; - } - luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fairygui.PackageItem:getHighResolution", argc, 0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + int index = (int)lua_tointeger(tolua_S, 2); + fairygui::GTreeNode *child = cobj->getChildAt(index); + object_to_luaval(tolua_S,"fairygui.GTreeNode",(fairygui::GTreeNode*)child); + return 1; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:getChildAt",argc,1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_PackageItem_getHighResolution'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_getChildAt'.",&tolua_err); + return 0; #endif } -static int lua_register_fairygui_PackageItem(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.PackageItem"); - tolua_cclass(tolua_S,"PackageItem","fairygui.PackageItem","",nullptr); - - tolua_beginmodule(tolua_S,"PackageItem"); - // variable - tolua_variable(tolua_S, "owner", lua_fairygui_PackageItem_get_owner, nullptr); - tolua_variable(tolua_S, "type", lua_fairygui_PackageItem_get_type, nullptr); - tolua_variable(tolua_S, "objectType", lua_fairygui_PackageItem_get_objectType, nullptr); - tolua_variable(tolua_S, "id", lua_fairygui_PackageItem_get_id, nullptr); - tolua_variable(tolua_S, "name", lua_fairygui_PackageItem_get_name, nullptr); - tolua_variable(tolua_S, "width", lua_fairygui_PackageItem_get_width, nullptr); - tolua_variable(tolua_S, "height", lua_fairygui_PackageItem_get_height, nullptr); - tolua_variable(tolua_S, "file", lua_fairygui_PackageItem_get_file, nullptr); - tolua_variable(tolua_S, "spriteFrame", lua_fairygui_PackageItem_get_spriteFrame, nullptr); - // function - tolua_function(tolua_S, "load", lua_fairygui_PackageItem_load); - tolua_function(tolua_S, "getBranch", lua_fairygui_PackageItem_getBranch); - tolua_function(tolua_S, "getHighResolution", lua_fairygui_PackageItem_getHighResolution); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::PackageItem).name(); - g_luaType[typeName] = "fairygui.PackageItem"; - g_typeCast["PackageItem"] = "fairygui.PackageItem"; - return 1; -} - -static int lua_fairygui_GTree_set_treeNodeRender(lua_State* L) +static int lua_fairygui_GTreeNode_getPrevSibling(lua_State* tolua_S) { - fairygui::GTree* cobj = nullptr; - LUA_FUNCTION refid = -1; + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTree*)tolua_tousertype(L,1,0); + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GTree_set_treeNodeRender'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_getPrevSibling'", nullptr); + return 0; + } #endif - if lua_isnil(L, 2) { - cobj->treeNodeRender = nullptr; - ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)cobj, (ScriptHandlerMgr::HandlerType)GTREE_NODE_RENDERER); - return 0; - } -#if COCOS2D_DEBUG >= 1 - if (!toluafix_isfunction(L, 2, "LUA_FUNCTION", 0, &tolua_err)) - goto tolua_lerror; -#endif - - refid = (toluafix_ref_function(L, 2, 0)); - cobj->treeNodeRender = [=](fairygui::GTreeNode* node, fairygui::GComponent* obj) { - object_to_luaval(L, "fairygui.GTreeNode", node); - object_to_luaval(L, "fairygui.GComponent", obj); - LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(refid, 2); - }; - ScriptHandlerMgr::getInstance()->addObjectHandler((void*)cobj, refid, (ScriptHandlerMgr::HandlerType)GTREE_NODE_RENDERER); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::GTreeNode *node = cobj->getPrevSibling(); + object_to_luaval(tolua_S,"fairygui.GTreeNode",(fairygui::GTreeNode*)node); + return 1; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:getPrevSibling",argc,0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_GTree_set_treeNodeRender'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_getPrevSibling'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTree_set_treeNodeWillExpand(lua_State* L) +static int lua_fairygui_GTreeNode_getNextSibling(lua_State* tolua_S) { - fairygui::GTree* cobj = nullptr; - LUA_FUNCTION refid = -1; + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTree*)tolua_tousertype(L,1,0); + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_GTree_set_treeNodeWillExpand'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_getNextSibling'", nullptr); + return 0; + } #endif - if lua_isnil(L, 2) { - cobj->treeNodeWillExpand = nullptr; - ScriptHandlerMgr::getInstance()->removeObjectHandler((void*)cobj, (ScriptHandlerMgr::HandlerType)GTREE_NODE_WILLEXPAND); - return 0; - } -#if COCOS2D_DEBUG >= 1 - if (!toluafix_isfunction(L, 2, "LUA_FUNCTION", 0, &tolua_err)) - goto tolua_lerror; -#endif - - refid = (toluafix_ref_function(L, 2, 0)); - cobj->treeNodeWillExpand = [=](fairygui::GTreeNode* node, bool expand) { - object_to_luaval(L, "fairygui.GTreeNode", node); - lua_pushboolean(L, (int)expand); - LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(refid, 2); - }; - ScriptHandlerMgr::getInstance()->addObjectHandler((void*)cobj, refid, (ScriptHandlerMgr::HandlerType)GTREE_NODE_WILLEXPAND); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + fairygui::GTreeNode *node = cobj->getNextSibling(); + object_to_luaval(tolua_S,"fairygui.GTreeNode",(fairygui::GTreeNode*)node); + return 1; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:getNextSibling",argc,0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_GTree_set_treeNodeWillExpand'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_getNextSibling'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTree_getIndent(lua_State* tolua_S) +static int lua_fairygui_GTreeNode_getChildIndex(lua_State* tolua_S) { - int argc = 0; - fairygui::GTree* cobj = nullptr; + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTree*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTree_getIndent'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_getChildIndex'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - int rtn = cobj->getIndent(); - lua_pushinteger(tolua_S, rtn); - return 1; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTree:getIndent",argc,0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + fairygui::GTreeNode* child; + int index; + luaval_to_object(tolua_S,2,"fairygui.GTreeNode",&child,"fairygui.GTreeNode:getChildIndex"); + index = cobj->getChildIndex(child); + lua_pushinteger(tolua_S, (lua_Integer)index); + return 1; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:getChildIndex",argc,1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTree_getIndent'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_getChildIndex'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTree_setIndent(lua_State* tolua_S) +static int lua_fairygui_GTreeNode_setChildIndex(lua_State* tolua_S) { - int argc = 0; - fairygui::GTree* cobj = nullptr; + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTree*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTree_setIndent'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_setChildIndex'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - cobj->setIndent((int)lua_tointeger(tolua_S, 2)); - return 0; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTree:setIndent",argc,1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 2) { + fairygui::GTreeNode* child; + int index; + luaval_to_object(tolua_S,2,"fairygui.GTreeNode",&child,"fairygui.GTreeNode:setChildIndex"); + index = (int)lua_tointeger(tolua_S, 3); + cobj->setChildIndex(child, index); + return 0; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:setChildIndex",argc,2); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTree_setIndent'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_setChildIndex'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTree_getClickToExpand(lua_State* tolua_S) +static int lua_fairygui_GTreeNode_setChildIndexBefore(lua_State* tolua_S) { - int argc = 0; - fairygui::GTree* cobj = nullptr; + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTree*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTree_getClickToExpand'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_setChildIndexBefore'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - int rtn = cobj->getClickToExpand(); - lua_pushinteger(tolua_S, rtn); - return 1; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTree:getClickToExpand",argc,0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 2) { + fairygui::GTreeNode* child; + int index; + luaval_to_object(tolua_S,2,"fairygui.GTreeNode",&child,"fairygui.GTreeNode:setChildIndexBefore"); + index = (int)lua_tointeger(tolua_S, 3); + index = cobj->setChildIndexBefore(child, index); + lua_pushinteger(tolua_S, (lua_Integer)index); + return 1; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:setChildIndexBefore",argc,2); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTree_getClickToExpand'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_setChildIndexBefore'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTree_setClickToExpand(lua_State* tolua_S) +static int lua_fairygui_GTreeNode_swapChildren(lua_State* tolua_S) { - int argc = 0; - fairygui::GTree* cobj = nullptr; + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTree*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTree_setClickToExpand'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_swapChildren'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - cobj->setClickToExpand((int)lua_tointeger(tolua_S, 2)); - return 0; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTree:setClickToExpand",argc,1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 2) { + fairygui::GTreeNode* child1; + fairygui::GTreeNode* child2; + luaval_to_object(tolua_S,2,"fairygui.GTreeNode",&child1,"fairygui.GTreeNode:swapChildren"); + luaval_to_object(tolua_S,3,"fairygui.GTreeNode",&child2,"fairygui.GTreeNode:swapChildren"); + cobj->swapChildren(child1, child2); + return 0; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:swapChildren",argc,2); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTree_setClickToExpand'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_swapChildren'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTree_getRootNode(lua_State* tolua_S) +static int lua_fairygui_GTreeNode_swapChildrenAt(lua_State* tolua_S) { - int argc = 0; - fairygui::GTree* cobj = nullptr; + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTree*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTree_getRootNode'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_swapChildrenAt'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GTreeNode* rtn = cobj->getRootNode(); - object_to_luaval(tolua_S,"fairygui.GTreeNode",(fairygui::GTreeNode*)rtn); - return 1; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTree:getRootNode",argc,0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 2) { + int index1 = (int)lua_tointeger(tolua_S, 2); + int index2 = (int)lua_tointeger(tolua_S, 3); + cobj->swapChildrenAt(index1, index2); + return 0; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:swapChildrenAt",argc,2); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTree_getRootNode'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_swapChildrenAt'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTree_getSelectedNode(lua_State* tolua_S) +static int lua_fairygui_GTreeNode_numChildren(lua_State* tolua_S) { - int argc = 0; - fairygui::GTree* cobj = nullptr; + int argc = 0; + fairygui::GTreeNode* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTree*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTree_getSelectedNode'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_numChildren'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GTreeNode* rtn = cobj->getSelectedNode(); - object_to_luaval(tolua_S,"fairygui.GTreeNode",(fairygui::GTreeNode*)rtn); - return 1; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTree:getSelectedNode",argc,0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 0) { + int rtn = cobj->numChildren(); + lua_pushinteger(tolua_S, (lua_Integer)rtn); + return 1; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:numChildren",argc,0); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTree_getSelectedNode'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_numChildren'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTree_getSelectedNodes(lua_State* tolua_S) +static int lua_register_fairygui_GTreeNode(lua_State* tolua_S) { - int argc = 0; - fairygui::GTree* cobj = nullptr; + tolua_usertype(tolua_S,"fairygui.GTreeNode"); + tolua_cclass(tolua_S,"GTreeNode","fairygui.GTreeNode","cc.Ref",nullptr); + + tolua_beginmodule(tolua_S,"GTreeNode"); + tolua_function(tolua_S,"create", lua_fairygui_GTreeNode_create); + tolua_function(tolua_S,"getParent",lua_fairygui_GTreeNode_getParent); + tolua_function(tolua_S,"getTree",lua_fairygui_GTreeNode_getTree); + tolua_function(tolua_S,"getCell",lua_fairygui_GTreeNode_getCell); + tolua_function(tolua_S,"getData",lua_fairygui_GTreeNode_getData); + tolua_function(tolua_S,"setData",lua_fairygui_GTreeNode_setData); + tolua_function(tolua_S,"isExpanded",lua_fairygui_GTreeNode_isExpanded); + tolua_function(tolua_S,"setExpaned",lua_fairygui_GTreeNode_setExpaned); + tolua_function(tolua_S,"isFolder",lua_fairygui_GTreeNode_isFolder); + tolua_function(tolua_S,"getText",lua_fairygui_GTreeNode_getText); + tolua_function(tolua_S,"setText",lua_fairygui_GTreeNode_setText); + tolua_function(tolua_S,"getIcon",lua_fairygui_GTreeNode_getIcon); + tolua_function(tolua_S,"setIcon",lua_fairygui_GTreeNode_setIcon); + tolua_function(tolua_S,"addChild",lua_fairygui_GTreeNode_addChild); + tolua_function(tolua_S,"addChildAt",lua_fairygui_GTreeNode_addChildAt); + tolua_function(tolua_S,"removeChild",lua_fairygui_GTreeNode_removeChild); + tolua_function(tolua_S,"removeChildAt",lua_fairygui_GTreeNode_removeChildAt); + tolua_function(tolua_S,"removeChildren",lua_fairygui_GTreeNode_removeChildren); + tolua_function(tolua_S,"getChildAt",lua_fairygui_GTreeNode_getChildAt); + tolua_function(tolua_S,"getPrevSibling",lua_fairygui_GTreeNode_getPrevSibling); + tolua_function(tolua_S,"getNextSibling",lua_fairygui_GTreeNode_getNextSibling); + tolua_function(tolua_S,"getChildIndex",lua_fairygui_GTreeNode_getChildIndex); + tolua_function(tolua_S,"setChildIndex",lua_fairygui_GTreeNode_setChildIndex); + tolua_function(tolua_S,"setChildIndexBefore",lua_fairygui_GTreeNode_setChildIndexBefore); + tolua_function(tolua_S,"swapChildren",lua_fairygui_GTreeNode_swapChildren); + tolua_function(tolua_S,"swapChildrenAt",lua_fairygui_GTreeNode_swapChildrenAt); + tolua_function(tolua_S,"numChildren",lua_fairygui_GTreeNode_numChildren); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::GTreeNode).name(); + g_luaType[typeName] = "fairygui.GTreeNode"; + g_typeCast["GTreeNode"] = "fairygui.GTreeNode"; + return 1; +} + +static int lua_fairygui_TextFormat_set_face(lua_State* L) +{ + fairygui::TextFormat* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTree*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTree_getSelectedNodes'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_face'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - std::vector rtn; - cobj->getSelectedNodes(rtn); - - lua_newtable(tolua_S); - int index = 1; - for (const fairygui::GTreeNode* value : rtn) - { - lua_pushnumber(tolua_S, (lua_Number)index); - object_to_luaval(tolua_S,"fairygui.GTreeNode",(fairygui::GTreeNode*)value); - lua_rawset(tolua_S, -3); - ++index; - } - return 1; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTree:getSelectedNodes",argc,0); - return 0; + cobj->face = lua_tostring(L, 2); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTree_getSelectedNodes'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_face'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTree_selectNode(lua_State* tolua_S) +static int lua_fairygui_TextFormat_set_fontSize(lua_State* L) { - int argc = 0; - fairygui::GTree* cobj = nullptr; + fairygui::TextFormat* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTree*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTree_selectNode'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_fontSize'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc > 0) { - fairygui::GTreeNode *arg0; - luaval_to_object(tolua_S,2,"fairygui::GTreeNode",&arg0,"fairygui.GTree:selectNode"); - if (argc > 1) { - bool arg1 = (bool)lua_toboolean(tolua_S,3); - cobj->selectNode(arg0, arg1); - } else { - cobj->selectNode(arg0); - } - return 0; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting 1 or 2 \n","fairygui.GTree:selectNode",argc); - return 0; + cobj->fontSize = (float)lua_tonumber(L, 2); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTree_selectNode'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_fontSize'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTree_unselectNode(lua_State* tolua_S) +static int lua_fairygui_TextFormat_set_color(lua_State* L) { - int argc = 0; - fairygui::GTree* cobj = nullptr; + fairygui::TextFormat* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTree*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTree_unselectNode'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_color'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::GTreeNode *arg0; - luaval_to_object(tolua_S,2,"fairygui::GTreeNode",&arg0,"fairygui.GTree:unselectNode"); - cobj->unselectNode(arg0); - return 0; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d\n","fairygui.GTree:unselectNode",argc,1); - return 0; + luaval_to_color3b(L, 2, &cobj->color, "fairygui.TextFormat:color"); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTree_unselectNode'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_color'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTree_expandAll(lua_State* tolua_S) +static int lua_fairygui_TextFormat_set_bold(lua_State* L) { - int argc = 0; - fairygui::GTree* cobj = nullptr; + fairygui::TextFormat* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTree*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTree_expandAll'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_bold'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::GTreeNode *arg0; - luaval_to_object(tolua_S,2,"fairygui::GTreeNode",&arg0,"fairygui.GTree:expandAll"); - cobj->expandAll(arg0); - return 0; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d\n","fairygui.GTree:expandAll",argc,1); - return 0; + cobj->bold = (bool)lua_toboolean(L, 2); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTree_expandAll'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_bold'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTree_collapseAll(lua_State* tolua_S) +static int lua_fairygui_TextFormat_set_italics(lua_State* L) { - int argc = 0; - fairygui::GTree* cobj = nullptr; + fairygui::TextFormat* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTree*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTree_collapseAll'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_italics'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::GTreeNode *arg0; - luaval_to_object(tolua_S,2,"fairygui::GTreeNode",&arg0,"fairygui.GTree:collapseAll"); - cobj->collapseAll(arg0); - return 0; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d\n","fairygui.GTree:collapseAll",argc,1); - return 0; + cobj->italics = (bool)lua_toboolean(L, 2); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTree_collapseAll'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_italics'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTree_create(lua_State* tolua_S) +static int lua_fairygui_TextFormat_set_underline(lua_State* L) { - int argc = 0; + fairygui::TextFormat* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.GTree",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_underline'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S) - 1; - if (argc == 0) { - fairygui::GTree *ret = fairygui::GTree::create(); - object_to_luaval(tolua_S,"fairygui.GTree",(fairygui::GTree*)ret); - return 1; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d\n ","fairygui.GTree:create",argc, 0); - return 0; + cobj->underline = (bool)lua_toboolean(L, 2); + return 0; + #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTree_create'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_underline'.",&tolua_err); + return 0; #endif } -static int lua_register_fairygui_GTree(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.GTree"); - tolua_cclass(tolua_S,"GTree","fairygui.GTree","fairygui.GList",nullptr); - - tolua_beginmodule(tolua_S,"GTree"); - // variable - tolua_variable(tolua_S, "treeNodeRender", nullptr, lua_fairygui_GTree_set_treeNodeRender); - tolua_variable(tolua_S, "treeNodeWillExpand", nullptr, lua_fairygui_GTree_set_treeNodeWillExpand); - // function - tolua_function(tolua_S,"getIndent",lua_fairygui_GTree_getIndent); - tolua_function(tolua_S,"setIndent",lua_fairygui_GTree_setIndent); - tolua_function(tolua_S,"getClickToExpand",lua_fairygui_GTree_getClickToExpand); - tolua_function(tolua_S,"setClickToExpand",lua_fairygui_GTree_setClickToExpand); - tolua_function(tolua_S,"getRootNode",lua_fairygui_GTree_getRootNode); - tolua_function(tolua_S,"getSelectedNode",lua_fairygui_GTree_getSelectedNode); - tolua_function(tolua_S,"getSelectedNodes",lua_fairygui_GTree_getSelectedNodes); - tolua_function(tolua_S,"selectNode",lua_fairygui_GTree_selectNode); - tolua_function(tolua_S,"unselectNode",lua_fairygui_GTree_unselectNode); - tolua_function(tolua_S,"expandAll",lua_fairygui_GTree_expandAll); - tolua_function(tolua_S,"collapseAll",lua_fairygui_GTree_collapseAll); - tolua_function(tolua_S,"create", lua_fairygui_GTree_create); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::GTree).name(); - g_luaType[typeName] = "fairygui.GTree"; - g_typeCast["GTree"] = "fairygui.GTree"; - return 1; -} - -static int lua_fairygui_GTreeNode_create(lua_State* tolua_S) +static int lua_fairygui_TextFormat_set_lineSpacing(lua_State* L) { - int argc = 0; + fairygui::TextFormat* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertable(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_lineSpacing'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc <= 2) { - fairygui::GTreeNode *ret = nullptr; - if (argc > 0) { - bool isFolder = (bool)lua_toboolean(tolua_S, 2); - if (argc > 1) { - std::string resURL; - luaval_to_std_string(tolua_S, 2, &resURL, "fairygui.GTreeNode:create"); - ret = fairygui::GTreeNode::create(isFolder, resURL); - } else { - ret = fairygui::GTreeNode::create(isFolder); - } - } else { - ret = fairygui::GTreeNode::create(); - } - object_to_luaval(tolua_S,"fairygui.GTreeNode",(fairygui::GTreeNode*)ret); - return 1; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting 0~2\n ","fairygui.GTreeNode:create",argc); - return 0; + cobj->lineSpacing = (int)lua_tointeger(L, 2); + return 0; + #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_create'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_lineSpacing'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTreeNode_getParent(lua_State* tolua_S) +static int lua_fairygui_TextFormat_set_letterSpacing(lua_State* L) { - int argc = 0; - fairygui::GTreeNode* cobj = nullptr; + fairygui::TextFormat* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_getParent'", nullptr); - return 0; - } + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; +#endif + cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_letterSpacing'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GTreeNode *node = cobj->getParent(); - object_to_luaval(tolua_S, "fairygui.GTreeNode", node); - return 1; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:getParent",argc,0); - return 0; + cobj->letterSpacing = (int)lua_tointeger(L, 2); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_getParent'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_letterSpacing'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTreeNode_getTree(lua_State* tolua_S) +static int lua_fairygui_TextFormat_set_align(lua_State* L) { - int argc = 0; - fairygui::GTreeNode* cobj = nullptr; + fairygui::TextFormat* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_getTree'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_align'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GTree *tree = cobj->getTree(); - object_to_luaval(tolua_S, "fairygui.GTree", tree); - return 1; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:getTree",argc,0); - return 0; + cobj->align = (cocos2d::TextHAlignment)lua_tointeger(L, 2); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_getTree'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_align'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTreeNode_getCell(lua_State* tolua_S) +static int lua_fairygui_TextFormat_set_verticalAlign(lua_State* L) { - int argc = 0; - fairygui::GTreeNode* cobj = nullptr; + fairygui::TextFormat* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_getCell'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_verticalAlign'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GComponent *com = cobj->getCell(); - object_to_luaval(tolua_S, "fairygui.GComponent", com); - return 1; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:getCell",argc,0); - return 0; + cobj->verticalAlign = (cocos2d::TextVAlignment)lua_tointeger(L, 2); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_getCell'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_verticalAlign'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTreeNode_getData(lua_State* tolua_S) +static int lua_fairygui_TextFormat_set_outlineColor(lua_State* L) { - int argc = 0; - fairygui::GTreeNode* cobj = nullptr; + fairygui::TextFormat* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_getData'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_outlineColor'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - const cocos2d::Value& data = cobj->getData(); - ccvalue_to_luaval(tolua_S, data); - return 1; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:getData",argc,0); - return 0; + luaval_to_color3b(L, 2, &cobj->outlineColor, "fairygui.TextFormat:outlineColor"); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_getData'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_outlineColor'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTreeNode_setData(lua_State* tolua_S) +static int lua_fairygui_TextFormat_set_outlineSize(lua_State* L) { - int argc = 0; - fairygui::GTreeNode* cobj = nullptr; + fairygui::TextFormat* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_setData'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_outlineSize'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - cocos2d::Value data; - luaval_to_ccvalue(tolua_S, 2, &data); - cobj->setData(data); - return 0; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:setData",argc,1); - return 0; + cobj->outlineSize = (int)lua_tointeger(L, 2); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_setData'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_outlineSize'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTreeNode_isExpanded(lua_State* tolua_S) +static int lua_fairygui_TextFormat_set_shadowColor(lua_State* L) { - int argc = 0; - fairygui::GTreeNode* cobj = nullptr; + fairygui::TextFormat* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_isExpanded'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_shadowColor'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - bool rtn = cobj->isExpanded(); - lua_pushboolean(tolua_S, (int)rtn); - return 1; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:isExpanded",argc,0); - return 0; + luaval_to_color3b(L, 2, &cobj->shadowColor, "fairygui.TextFormat:shadowColor"); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_isExpanded'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_shadowColor'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTreeNode_setExpaned(lua_State* tolua_S) +static int lua_fairygui_TextFormat_set_shadowOffset(lua_State* L) { - int argc = 0; - fairygui::GTreeNode* cobj = nullptr; + fairygui::TextFormat* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_setExpaned'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_shadowOffset'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - bool expand = lua_toboolean(tolua_S, 2); - cobj->setExpaned(expand); - return 0; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:setExpaned",argc,1); - return 0; + luaval_to_size(L, 2, &cobj->shadowOffset); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_setExpaned'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_shadowOffset'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTreeNode_isFolder(lua_State* tolua_S) +static int lua_fairygui_TextFormat_set_shadowBlurRadius(lua_State* L) { - int argc = 0; - fairygui::GTreeNode* cobj = nullptr; + fairygui::TextFormat* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_isFolder'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_shadowBlurRadius'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - bool rtn = cobj->isFolder(); - lua_pushboolean(tolua_S, (int)rtn); - return 1; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:isFolder",argc,0); - return 0; + cobj->shadowBlurRadius = (int)lua_tointeger(L, 2); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_isFolder'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_shadowBlurRadius'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTreeNode_getText(lua_State* tolua_S) +static int lua_fairygui_TextFormat_set_glowColor(lua_State* L) { - int argc = 0; - fairygui::GTreeNode* cobj = nullptr; + fairygui::TextFormat* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_getText'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_glowColor'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - const std::string& rtn = cobj->getText(); - lua_pushlstring(tolua_S, rtn.c_str(), rtn.length()); - return 1; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:getText",argc,0); - return 0; + luaval_to_color3b(L, 2, &cobj->glowColor, "fairygui.TextFormat:glowColor"); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_getText'.",&tolua_err); - return 0; + tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_glowColor'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTreeNode_setText(lua_State* tolua_S) +static int lua_fairygui_TextFormat_setFormat(lua_State* tolua_S) { - int argc = 0; - fairygui::GTreeNode* cobj = nullptr; + int argc = 0; + fairygui::TextFormat* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::TextFormat*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_setText'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_TextFormat_setFormat'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - std::string value; - luaval_to_std_string(tolua_S, 2, &value, "fairygui.GTreeNode:setText"); - cobj->setText(value); - return 0; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:setText",argc,1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + fairygui::TextFormat *format; + luaval_to_object(tolua_S,2,"fairygui.TextFormat",&format,"fairygui.TextFormat:setFormat"); + cobj->setFormat(*format); + return 0; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.TextFormat:setFormat",argc,1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_setText'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_TextFormat_setFormat'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTreeNode_getIcon(lua_State* tolua_S) +static int lua_fairygui_TextFormat_enableEffect(lua_State* tolua_S) { - int argc = 0; - fairygui::GTreeNode* cobj = nullptr; + int argc = 0; + fairygui::TextFormat* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::TextFormat*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_getIcon'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_TextFormat_enableEffect'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - const std::string& rtn = cobj->getIcon(); - lua_pushlstring(tolua_S, rtn.c_str(), rtn.length()); - return 1; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:getIcon",argc,0); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + int effectFlag = (int)lua_tointeger(tolua_S, 2); + cobj->enableEffect(effectFlag); + return 0; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.TextFormat:enableEffect",argc,1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_getIcon'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_TextFormat_enableEffect'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTreeNode_setIcon(lua_State* tolua_S) +static int lua_fairygui_TextFormat_disableEffect(lua_State* tolua_S) { - int argc = 0; - fairygui::GTreeNode* cobj = nullptr; + int argc = 0; + fairygui::TextFormat* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::TextFormat*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_setIcon'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_TextFormat_disableEffect'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - std::string value; - luaval_to_std_string(tolua_S, 2, &value, "fairygui.GTreeNode:setIcon"); - cobj->setIcon(value); - return 0; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:setIcon",argc,1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + int effectFlag = (int)lua_tointeger(tolua_S, 2); + cobj->disableEffect(effectFlag); + return 0; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.TextFormat:disableEffect",argc,1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_setIcon'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_TextFormat_disableEffect'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTreeNode_addChild(lua_State* tolua_S) +static int lua_fairygui_TextFormat_hasEffect(lua_State* tolua_S) { - int argc = 0; - fairygui::GTreeNode* cobj = nullptr; + int argc = 0; + fairygui::TextFormat* cobj = nullptr; #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::TextFormat*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_addChild'", nullptr); - return 0; - } + if (!cobj) { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_TextFormat_hasEffect'", nullptr); + return 0; + } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::GTreeNode* child; - luaval_to_object(tolua_S,2,"fairygui.GTreeNode",&child,"fairygui.GTreeNode:addChild"); - child = cobj->addChild(child); - object_to_luaval(tolua_S,"fairygui.GTreeNode",(fairygui::GTreeNode*)child); - return 1; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:addChild",argc,1); - return 0; + argc = lua_gettop(tolua_S)-1; + if (argc == 1) { + int effectFlag = (int)lua_tointeger(tolua_S, 2); + bool rtn = cobj->hasEffect(effectFlag); + lua_pushboolean(tolua_S, (int)rtn); + return 1; + } + luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.TextFormat:hasEffect",argc,1); + return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_addChild'.",&tolua_err); - return 0; + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_TextFormat_hasEffect'.",&tolua_err); + return 0; #endif } -static int lua_fairygui_GTreeNode_addChildAt(lua_State* tolua_S) +static int lua_register_fairygui_TextFormat(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"fairygui.TextFormat"); + tolua_cclass(tolua_S,"TextFormat","fairygui.TextFormat","",nullptr); + + tolua_beginmodule(tolua_S,"TextFormat"); + // variable + tolua_variable(tolua_S, "face", nullptr, lua_fairygui_TextFormat_set_face); + tolua_variable(tolua_S, "fontSize", nullptr, lua_fairygui_TextFormat_set_fontSize); + tolua_variable(tolua_S, "color", nullptr, lua_fairygui_TextFormat_set_color); + tolua_variable(tolua_S, "bold", nullptr, lua_fairygui_TextFormat_set_bold); + tolua_variable(tolua_S, "italics", nullptr, lua_fairygui_TextFormat_set_italics); + tolua_variable(tolua_S, "underline", nullptr, lua_fairygui_TextFormat_set_underline); + tolua_variable(tolua_S, "lineSpacing", nullptr, lua_fairygui_TextFormat_set_lineSpacing); + tolua_variable(tolua_S, "letterSpacing", nullptr, lua_fairygui_TextFormat_set_letterSpacing); + tolua_variable(tolua_S, "align", nullptr, lua_fairygui_TextFormat_set_align); + tolua_variable(tolua_S, "verticalAlign", nullptr, lua_fairygui_TextFormat_set_verticalAlign); + tolua_variable(tolua_S, "outlineColor", nullptr, lua_fairygui_TextFormat_set_outlineColor); + tolua_variable(tolua_S, "outlineSize", nullptr, lua_fairygui_TextFormat_set_outlineSize); + tolua_variable(tolua_S, "shadowColor", nullptr, lua_fairygui_TextFormat_set_shadowColor); + tolua_variable(tolua_S, "shadowOffset", nullptr, lua_fairygui_TextFormat_set_shadowOffset); + tolua_variable(tolua_S, "shadowBlurRadius", nullptr, lua_fairygui_TextFormat_set_shadowBlurRadius); + tolua_variable(tolua_S, "glowColor", nullptr, lua_fairygui_TextFormat_set_glowColor); + // function + tolua_function(tolua_S,"setFormat",lua_fairygui_TextFormat_setFormat); + tolua_function(tolua_S,"enableEffect",lua_fairygui_TextFormat_enableEffect); + tolua_function(tolua_S,"disableEffect",lua_fairygui_TextFormat_disableEffect); + tolua_function(tolua_S,"hasEffect",lua_fairygui_TextFormat_hasEffect); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::TextFormat).name(); + g_luaType[typeName] = "fairygui.TextFormat"; + g_typeCast["TextFormat"] = "fairygui.TextFormat"; + return 1; +} + +int lua_fairygui_GTween_clean(lua_State* tolua_S) { int argc = 0; - fairygui::GTreeNode* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_addChildAt'", nullptr); - return 0; - } + if (!tolua_isusertable(tolua_S,1,"fairygui.GTween",0,&tolua_err)) goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - fairygui::GTreeNode* child; - int index; - luaval_to_object(tolua_S,2,"fairygui.GTreeNode",&child,"fairygui.GTreeNode:addChildAt"); - index = (int)lua_tointeger(tolua_S, 3); - child = cobj->addChildAt(child, index); - object_to_luaval(tolua_S,"fairygui.GTreeNode",(fairygui::GTreeNode*)child); + argc = lua_gettop(tolua_S) - 1; + if (argc == 0) + { + fairygui::GTween::clean(); + lua_settop(tolua_S, 1); return 1; } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:addChildAt",argc,2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GTween:clean",argc, 0); return 0; - #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_addChildAt'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTween_clean'.",&tolua_err); return 0; #endif } -static int lua_fairygui_GTreeNode_removeChild(lua_State* tolua_S) +int lua_fairygui_GTween_delayedCall(lua_State* tolua_S) { int argc = 0; - fairygui::GTreeNode* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_removeChild'", nullptr); - return 0; - } + if (!tolua_isusertable(tolua_S,1,"fairygui.GTween",0,&tolua_err)) goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::GTreeNode* child; - luaval_to_object(tolua_S,2,"fairygui.GTreeNode",&child,"fairygui.GTreeNode:removeChild"); - cobj->removeChild(child); - return 0; + argc = lua_gettop(tolua_S) - 1; + if (argc == 1) + { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GTween:delayedCall"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTween_delayedCall'", nullptr); + return 0; + } + fairygui::GTweener* ret = fairygui::GTween::delayedCall(arg0); + object_to_luaval(tolua_S, "fairygui.GTweener",(fairygui::GTweener*)ret); + return 1; } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:removeChild",argc,1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GTween:delayedCall",argc, 1); return 0; - #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_removeChild'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTween_delayedCall'.",&tolua_err); return 0; #endif } -static int lua_fairygui_GTreeNode_removeChildAt(lua_State* tolua_S) +int lua_fairygui_GTween_getTween(lua_State* tolua_S) { int argc = 0; - fairygui::GTreeNode* cobj = nullptr; - + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_removeChildAt'", nullptr); - return 0; - } + if (!tolua_isusertable(tolua_S,1,"fairygui.GTween",0,&tolua_err)) goto tolua_lerror; #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int index = (int)lua_tointeger(tolua_S, 2); - cobj->removeChildAt(index); - return 0; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:removeChildAt",argc,1); + do + { + if (argc == 2) + { + cocos2d::Ref* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0, "fairygui.GTween:getTween"); + if (!ok) { break; } + fairygui::TweenPropType arg1; + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GTween:getTween"); + if (!ok) { break; } + fairygui::GTweener* ret = fairygui::GTween::getTween(arg0, arg1); + object_to_luaval(tolua_S, "fairygui.GTweener",(fairygui::GTweener*)ret); + return 1; + } + } while (0); + ok = true; + do + { + if (argc == 1) + { + cocos2d::Ref* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0, "fairygui.GTween:getTween"); + if (!ok) { break; } + fairygui::GTweener* ret = fairygui::GTween::getTween(arg0); + object_to_luaval(tolua_S, "fairygui.GTweener",(fairygui::GTweener*)ret); + return 1; + } + } while (0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d", "fairygui.GTween:getTween",argc, 1); return 0; - #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_removeChildAt'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTween_getTween'.",&tolua_err); return 0; #endif } -static int lua_fairygui_GTreeNode_removeChildren(lua_State* tolua_S) +int lua_fairygui_GTween_isTweening(lua_State* tolua_S) { int argc = 0; - fairygui::GTreeNode* cobj = nullptr; - + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_removeChildren'", nullptr); - return 0; - } + if (!tolua_isusertable(tolua_S,1,"fairygui.GTween",0,&tolua_err)) goto tolua_lerror; #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - cobj->removeChildren(); - return 0; - } else if (argc == 2) { - int beginIndex = (int)lua_tointeger(tolua_S, 2); - int endIndex = (int)lua_tointeger(tolua_S, 3); - cobj->removeChildren(beginIndex, endIndex); - return 0; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting 0 or 2 \n","fairygui.GTreeNode:removeChildren",argc); + do + { + if (argc == 2) + { + cocos2d::Ref* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0, "fairygui.GTween:isTweening"); + if (!ok) { break; } + fairygui::TweenPropType arg1; + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GTween:isTweening"); + if (!ok) { break; } + bool ret = fairygui::GTween::isTweening(arg0, arg1); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + } while (0); + ok = true; + do + { + if (argc == 1) + { + cocos2d::Ref* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0, "fairygui.GTween:isTweening"); + if (!ok) { break; } + bool ret = fairygui::GTween::isTweening(arg0); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + } while (0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d", "fairygui.GTween:isTweening",argc, 1); return 0; - #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_removeChildren'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTween_isTweening'.",&tolua_err); return 0; #endif } -static int lua_fairygui_GTreeNode_getChildAt(lua_State* tolua_S) +int lua_fairygui_GTween_kill(lua_State* tolua_S) { int argc = 0; - fairygui::GTreeNode* cobj = nullptr; - + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_getChildAt'", nullptr); - return 0; - } + if (!tolua_isusertable(tolua_S,1,"fairygui.GTween",0,&tolua_err)) goto tolua_lerror; #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int index = (int)lua_tointeger(tolua_S, 2); - fairygui::GTreeNode *child = cobj->getChildAt(index); - object_to_luaval(tolua_S,"fairygui.GTreeNode",(fairygui::GTreeNode*)child); - return 1; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:getChildAt",argc,1); + do + { + if (argc == 2) + { + cocos2d::Ref* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0, "fairygui.GTween:kill"); + if (!ok) { break; } + bool arg1; + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fairygui.GTween:kill"); + if (!ok) { break; } + fairygui::GTween::kill(arg0, arg1); + lua_settop(tolua_S, 1); + return 1; + } + } while (0); + ok = true; + do + { + if (argc == 1) + { + cocos2d::Ref* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0, "fairygui.GTween:kill"); + if (!ok) { break; } + fairygui::GTween::kill(arg0); + lua_settop(tolua_S, 1); + return 1; + } + } while (0); + ok = true; + do + { + if (argc == 3) + { + cocos2d::Ref* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0, "fairygui.GTween:kill"); + if (!ok) { break; } + fairygui::TweenPropType arg1; + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fairygui.GTween:kill"); + if (!ok) { break; } + bool arg2; + ok &= luaval_to_boolean(tolua_S, 4,&arg2, "fairygui.GTween:kill"); + if (!ok) { break; } + fairygui::GTween::kill(arg0, arg1, arg2); + lua_settop(tolua_S, 1); + return 1; + } + } while (0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d", "fairygui.GTween:kill",argc, 3); return 0; - #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_getChildAt'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTween_kill'.",&tolua_err); return 0; #endif } -static int lua_fairygui_GTreeNode_getPrevSibling(lua_State* tolua_S) +int lua_fairygui_GTween_shake(lua_State* tolua_S) { int argc = 0; - fairygui::GTreeNode* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_getPrevSibling'", nullptr); - return 0; - } + if (!tolua_isusertable(tolua_S,1,"fairygui.GTween",0,&tolua_err)) goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GTreeNode *node = cobj->getPrevSibling(); - object_to_luaval(tolua_S,"fairygui.GTreeNode",(fairygui::GTreeNode*)node); + argc = lua_gettop(tolua_S) - 1; + if (argc == 3) + { + cocos2d::Vec2 arg0; + double arg1; + double arg2; + ok &= luaval_to_vec2(tolua_S, 2, &arg0, "fairygui.GTween:shake"); + ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.GTween:shake"); + ok &= luaval_to_number(tolua_S, 4,&arg2, "fairygui.GTween:shake"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTween_shake'", nullptr); + return 0; + } + fairygui::GTweener* ret = fairygui::GTween::shake(arg0, arg1, arg2); + object_to_luaval(tolua_S, "fairygui.GTweener",(fairygui::GTweener*)ret); return 1; } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:getPrevSibling",argc,0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GTween:shake",argc, 3); return 0; - #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_getPrevSibling'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTween_shake'.",&tolua_err); return 0; #endif } -static int lua_fairygui_GTreeNode_getNextSibling(lua_State* tolua_S) +int lua_fairygui_GTween_to(lua_State* tolua_S) { int argc = 0; - fairygui::GTreeNode* cobj = nullptr; - + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_getNextSibling'", nullptr); - return 0; - } + if (!tolua_isusertable(tolua_S,1,"fairygui.GTween",0,&tolua_err)) goto tolua_lerror; #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - fairygui::GTreeNode *node = cobj->getNextSibling(); - object_to_luaval(tolua_S,"fairygui.GTreeNode",(fairygui::GTreeNode*)node); - return 1; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:getNextSibling",argc,0); + do + { + if (argc == 3) + { + cocos2d::Vec2 arg0; + ok &= luaval_to_vec2(tolua_S, 2, &arg0, "fairygui.GTween:to"); + if (!ok) { break; } + cocos2d::Vec2 arg1; + ok &= luaval_to_vec2(tolua_S, 3, &arg1, "fairygui.GTween:to"); + if (!ok) { break; } + double arg2; + ok &= luaval_to_number(tolua_S, 4,&arg2, "fairygui.GTween:to"); + if (!ok) { break; } + fairygui::GTweener* ret = fairygui::GTween::to(arg0, arg1, arg2); + object_to_luaval(tolua_S, "fairygui.GTweener",(fairygui::GTweener*)ret); + return 1; + } + } while (0); + ok = true; + do + { + if (argc == 3) + { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GTween:to"); + if (!ok) { break; } + double arg1; + ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.GTween:to"); + if (!ok) { break; } + double arg2; + ok &= luaval_to_number(tolua_S, 4,&arg2, "fairygui.GTween:to"); + if (!ok) { break; } + fairygui::GTweener* ret = fairygui::GTween::to(arg0, arg1, arg2); + object_to_luaval(tolua_S, "fairygui.GTweener",(fairygui::GTweener*)ret); + return 1; + } + } while (0); + ok = true; + do + { + if (argc == 3) + { + cocos2d::Vec3 arg0; + ok &= luaval_to_vec3(tolua_S, 2, &arg0, "fairygui.GTween:to"); + if (!ok) { break; } + cocos2d::Vec3 arg1; + ok &= luaval_to_vec3(tolua_S, 3, &arg1, "fairygui.GTween:to"); + if (!ok) { break; } + double arg2; + ok &= luaval_to_number(tolua_S, 4,&arg2, "fairygui.GTween:to"); + if (!ok) { break; } + fairygui::GTweener* ret = fairygui::GTween::to(arg0, arg1, arg2); + object_to_luaval(tolua_S, "fairygui.GTweener",(fairygui::GTweener*)ret); + return 1; + } + } while (0); + ok = true; + do + { + if (argc == 3) + { + cocos2d::Vec4 arg0; + ok &= luaval_to_vec4(tolua_S, 2, &arg0, "fairygui.GTween:to"); + if (!ok) { break; } + cocos2d::Vec4 arg1; + ok &= luaval_to_vec4(tolua_S, 3, &arg1, "fairygui.GTween:to"); + if (!ok) { break; } + double arg2; + ok &= luaval_to_number(tolua_S, 4,&arg2, "fairygui.GTween:to"); + if (!ok) { break; } + fairygui::GTweener* ret = fairygui::GTween::to(arg0, arg1, arg2); + object_to_luaval(tolua_S, "fairygui.GTweener",(fairygui::GTweener*)ret); + return 1; + } + } while (0); + ok = true; + do + { + if (argc == 3) + { + cocos2d::Color4B arg0; + ok &=luaval_to_color4b(tolua_S, 2, &arg0, "fairygui.GTween:to"); + if (!ok) { break; } + cocos2d::Color4B arg1; + ok &=luaval_to_color4b(tolua_S, 3, &arg1, "fairygui.GTween:to"); + if (!ok) { break; } + double arg2; + ok &= luaval_to_number(tolua_S, 4,&arg2, "fairygui.GTween:to"); + if (!ok) { break; } + fairygui::GTweener* ret = fairygui::GTween::to(arg0, arg1, arg2); + object_to_luaval(tolua_S, "fairygui.GTweener",(fairygui::GTweener*)ret); + return 1; + } + } while (0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d", "fairygui.GTween:to",argc, 3); return 0; - #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_getNextSibling'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTween_to'.",&tolua_err); return 0; #endif } -static int lua_fairygui_GTreeNode_getChildIndex(lua_State* tolua_S) +int lua_fairygui_GTween_toDouble(lua_State* tolua_S) { int argc = 0; - fairygui::GTreeNode* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_getChildIndex'", nullptr); - return 0; - } + if (!tolua_isusertable(tolua_S,1,"fairygui.GTween",0,&tolua_err)) goto tolua_lerror; #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::GTreeNode* child; - int index; - luaval_to_object(tolua_S,2,"fairygui.GTreeNode",&child,"fairygui.GTreeNode:getChildIndex"); - index = cobj->getChildIndex(child); - lua_pushinteger(tolua_S, (lua_Integer)index); + argc = lua_gettop(tolua_S) - 1; + if (argc == 3) + { + double arg0; + double arg1; + double arg2; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fairygui.GTween:toDouble"); + ok &= luaval_to_number(tolua_S, 3,&arg1, "fairygui.GTween:toDouble"); + ok &= luaval_to_number(tolua_S, 4,&arg2, "fairygui.GTween:toDouble"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTween_toDouble'", nullptr); + return 0; + } + fairygui::GTweener* ret = fairygui::GTween::toDouble(arg0, arg1, arg2); + object_to_luaval(tolua_S, "fairygui.GTweener",(fairygui::GTweener*)ret); return 1; } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:getChildIndex",argc,1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", "fairygui.GTween:toDouble",argc, 3); return 0; - #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_getChildIndex'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTween_toDouble'.",&tolua_err); return 0; #endif } -static int lua_fairygui_GTreeNode_setChildIndex(lua_State* tolua_S) +int lua_register_fairygui_GTween(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"fairygui.GTween"); + tolua_cclass(tolua_S,"GTween","fairygui.GTween","",nullptr); + + tolua_beginmodule(tolua_S,"GTween"); + tolua_function(tolua_S,"clean", lua_fairygui_GTween_clean); + tolua_function(tolua_S,"delayedCall", lua_fairygui_GTween_delayedCall); + tolua_function(tolua_S,"getTween", lua_fairygui_GTween_getTween); + tolua_function(tolua_S,"isTweening", lua_fairygui_GTween_isTweening); + tolua_function(tolua_S,"kill", lua_fairygui_GTween_kill); + tolua_function(tolua_S,"shake", lua_fairygui_GTween_shake); + tolua_function(tolua_S,"to", lua_fairygui_GTween_to); + tolua_function(tolua_S,"toDouble", lua_fairygui_GTween_toDouble); + tolua_endmodule(tolua_S); + std::string typeName = typeid(fairygui::GTween).name(); + g_luaType[typeName] = "fairygui.GTween"; + g_typeCast["GTween"] = "fairygui.GTween"; + return 1; +} + +int lua_fairygui_GTweener_allCompleted(lua_State* tolua_S) { int argc = 0; - fairygui::GTreeNode* cobj = nullptr; + fairygui::GTweener* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fgui.GTweener",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); + + cobj = (fairygui::GTweener*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_setChildIndex'", nullptr); + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTweener_allCompleted'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - fairygui::GTreeNode* child; - int index; - luaval_to_object(tolua_S,2,"fairygui.GTreeNode",&child,"fairygui.GTreeNode:setChildIndex"); - index = (int)lua_tointeger(tolua_S, 3); - cobj->setChildIndex(child, index); - return 0; + if (argc == 0) + { + bool ret = cobj->allCompleted(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:setChildIndex",argc,2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GTweener:allCompleted",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_setChildIndex'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTweener_allCompleted'.",&tolua_err); return 0; #endif } -static int lua_fairygui_GTreeNode_setChildIndexBefore(lua_State* tolua_S) +int lua_fairygui_GTweener_getDelay(lua_State* tolua_S) { int argc = 0; - fairygui::GTreeNode* cobj = nullptr; + fairygui::GTweener* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fgui.GTweener",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); + + cobj = (fairygui::GTweener*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_setChildIndexBefore'", nullptr); + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTweener_getDelay'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - fairygui::GTreeNode* child; - int index; - luaval_to_object(tolua_S,2,"fairygui.GTreeNode",&child,"fairygui.GTreeNode:setChildIndexBefore"); - index = (int)lua_tointeger(tolua_S, 3); - index = cobj->setChildIndexBefore(child, index); - lua_pushinteger(tolua_S, (lua_Integer)index); + if (argc == 0) + { + double ret = cobj->getDelay(); + tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:setChildIndexBefore",argc,2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GTweener:getDelay",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_setChildIndexBefore'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTweener_getDelay'.",&tolua_err); return 0; #endif } -static int lua_fairygui_GTreeNode_swapChildren(lua_State* tolua_S) +int lua_fairygui_GTweener_getDuration(lua_State* tolua_S) { int argc = 0; - fairygui::GTreeNode* cobj = nullptr; + fairygui::GTweener* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fgui.GTweener",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); + + cobj = (fairygui::GTweener*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_swapChildren'", nullptr); + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTweener_getDuration'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - fairygui::GTreeNode* child1; - fairygui::GTreeNode* child2; - luaval_to_object(tolua_S,2,"fairygui.GTreeNode",&child1,"fairygui.GTreeNode:swapChildren"); - luaval_to_object(tolua_S,3,"fairygui.GTreeNode",&child2,"fairygui.GTreeNode:swapChildren"); - cobj->swapChildren(child1, child2); - return 0; + if (argc == 0) + { + double ret = cobj->getDuration(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:swapChildren",argc,2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GTweener:getDuration",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_swapChildren'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTweener_getDuration'.",&tolua_err); return 0; #endif } -static int lua_fairygui_GTreeNode_swapChildrenAt(lua_State* tolua_S) +int lua_fairygui_GTweener_getNormalizedTime(lua_State* tolua_S) { int argc = 0; - fairygui::GTreeNode* cobj = nullptr; + fairygui::GTweener* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fgui.GTweener",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); + + cobj = (fairygui::GTweener*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_swapChildrenAt'", nullptr); + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTweener_getNormalizedTime'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 2) { - int index1 = (int)lua_tointeger(tolua_S, 2); - int index2 = (int)lua_tointeger(tolua_S, 3); - cobj->swapChildrenAt(index1, index2); - return 0; + if (argc == 0) + { + double ret = cobj->getNormalizedTime(); + tolua_pushnumber(tolua_S,(lua_Number)ret); + return 1; } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:swapChildrenAt",argc,2); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GTweener:getNormalizedTime",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_swapChildrenAt'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTweener_getNormalizedTime'.",&tolua_err); return 0; #endif } -static int lua_fairygui_GTreeNode_numChildren(lua_State* tolua_S) +int lua_fairygui_GTweener_getRepeat(lua_State* tolua_S) { int argc = 0; - fairygui::GTreeNode* cobj = nullptr; + fairygui::GTweener* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.GTreeNode",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fgui.GTweener",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::GTreeNode*)tolua_tousertype(tolua_S,1,0); + + cobj = (fairygui::GTweener*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTreeNode_numChildren'", nullptr); + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTweener_getRepeat'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 0) { - int rtn = cobj->numChildren(); - lua_pushinteger(tolua_S, (lua_Integer)rtn); + if (argc == 0) + { + int ret = cobj->getRepeat(); + tolua_pushnumber(tolua_S,(lua_Number)ret); return 1; } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.GTreeNode:numChildren",argc,0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GTweener:getRepeat",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTreeNode_numChildren'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTweener_getRepeat'.",&tolua_err); return 0; #endif } -static int lua_register_fairygui_GTreeNode(lua_State* tolua_S) -{ - tolua_usertype(tolua_S,"fairygui.GTreeNode"); - tolua_cclass(tolua_S,"GTreeNode","fairygui.GTreeNode","cc.Ref",nullptr); - - tolua_beginmodule(tolua_S,"GTreeNode"); - tolua_function(tolua_S,"create", lua_fairygui_GTreeNode_create); - tolua_function(tolua_S,"getParent",lua_fairygui_GTreeNode_getParent); - tolua_function(tolua_S,"getTree",lua_fairygui_GTreeNode_getTree); - tolua_function(tolua_S,"getCell",lua_fairygui_GTreeNode_getCell); - tolua_function(tolua_S,"getData",lua_fairygui_GTreeNode_getData); - tolua_function(tolua_S,"setData",lua_fairygui_GTreeNode_setData); - tolua_function(tolua_S,"isExpanded",lua_fairygui_GTreeNode_isExpanded); - tolua_function(tolua_S,"setExpaned",lua_fairygui_GTreeNode_setExpaned); - tolua_function(tolua_S,"isFolder",lua_fairygui_GTreeNode_isFolder); - tolua_function(tolua_S,"getText",lua_fairygui_GTreeNode_getText); - tolua_function(tolua_S,"setText",lua_fairygui_GTreeNode_setText); - tolua_function(tolua_S,"getIcon",lua_fairygui_GTreeNode_getIcon); - tolua_function(tolua_S,"setIcon",lua_fairygui_GTreeNode_setIcon); - tolua_function(tolua_S,"addChild",lua_fairygui_GTreeNode_addChild); - tolua_function(tolua_S,"addChildAt",lua_fairygui_GTreeNode_addChildAt); - tolua_function(tolua_S,"removeChild",lua_fairygui_GTreeNode_removeChild); - tolua_function(tolua_S,"removeChildAt",lua_fairygui_GTreeNode_removeChildAt); - tolua_function(tolua_S,"removeChildren",lua_fairygui_GTreeNode_removeChildren); - tolua_function(tolua_S,"getChildAt",lua_fairygui_GTreeNode_getChildAt); - tolua_function(tolua_S,"getPrevSibling",lua_fairygui_GTreeNode_getPrevSibling); - tolua_function(tolua_S,"getNextSibling",lua_fairygui_GTreeNode_getNextSibling); - tolua_function(tolua_S,"getChildIndex",lua_fairygui_GTreeNode_getChildIndex); - tolua_function(tolua_S,"setChildIndex",lua_fairygui_GTreeNode_setChildIndex); - tolua_function(tolua_S,"setChildIndexBefore",lua_fairygui_GTreeNode_setChildIndexBefore); - tolua_function(tolua_S,"swapChildren",lua_fairygui_GTreeNode_swapChildren); - tolua_function(tolua_S,"swapChildrenAt",lua_fairygui_GTreeNode_swapChildrenAt); - tolua_function(tolua_S,"numChildren",lua_fairygui_GTreeNode_numChildren); - tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::GTreeNode).name(); - g_luaType[typeName] = "fairygui.GTreeNode"; - g_typeCast["GTreeNode"] = "fairygui.GTreeNode"; - return 1; -} - -static int lua_fairygui_TextFormat_set_face(lua_State* L) +int lua_fairygui_GTweener_getTarget(lua_State* tolua_S) { - fairygui::TextFormat* cobj = nullptr; + int argc = 0; + fairygui::GTweener* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_face'", nullptr); - return 0; - } -#endif - - cobj->face = lua_tostring(L, 2); - return 0; - -#if COCOS2D_DEBUG >= 1 -tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_face'.",&tolua_err); - return 0; + if (!tolua_isusertype(tolua_S,1,"fgui.GTweener",0,&tolua_err)) goto tolua_lerror; #endif -} -static int lua_fairygui_TextFormat_set_fontSize(lua_State* L) -{ - fairygui::TextFormat* cobj = nullptr; + cobj = (fairygui::GTweener*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; -#endif - cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); -#if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_fontSize'", nullptr); + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTweener_getTarget'", nullptr); return 0; } #endif - cobj->fontSize = (float)lua_tonumber(L, 2); + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + void* ret = cobj->getTarget(); + #pragma warning NO CONVERSION FROM NATIVE FOR void*; + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GTweener:getTarget",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_fontSize'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTweener_getTarget'.",&tolua_err); return 0; #endif } -static int lua_fairygui_TextFormat_set_color(lua_State* L) +int lua_fairygui_GTweener_getUserData(lua_State* tolua_S) { - fairygui::TextFormat* cobj = nullptr; + int argc = 0; + fairygui::GTweener* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fgui.GTweener",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); + + cobj = (fairygui::GTweener*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_color'", nullptr); + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTweener_getUserData'", nullptr); return 0; } #endif - luaval_to_color3b(L, 2, &cobj->color, "fairygui.TextFormat:color"); + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + const cocos2d::Value& ret = cobj->getUserData(); + ccvalue_to_luaval(tolua_S, ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GTweener:getUserData",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_color'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTweener_getUserData'.",&tolua_err); return 0; #endif } -static int lua_fairygui_TextFormat_set_bold(lua_State* L) +int lua_fairygui_GTweener_isCompleted(lua_State* tolua_S) { - fairygui::TextFormat* cobj = nullptr; + int argc = 0; + fairygui::GTweener* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fgui.GTweener",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); + + cobj = (fairygui::GTweener*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_bold'", nullptr); + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTweener_isCompleted'", nullptr); return 0; } #endif - cobj->bold = (bool)lua_toboolean(L, 2); + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + bool ret = cobj->isCompleted(); + tolua_pushboolean(tolua_S,(bool)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GTweener:isCompleted",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_bold'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTweener_isCompleted'.",&tolua_err); return 0; #endif } -static int lua_fairygui_TextFormat_set_italics(lua_State* L) +int lua_fairygui_GTweener_kill(lua_State* tolua_S) { - fairygui::TextFormat* cobj = nullptr; + int argc = 0; + fairygui::GTweener* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fgui.GTweener",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); + + cobj = (fairygui::GTweener*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_italics'", nullptr); + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTweener_kill'", nullptr); return 0; } #endif - cobj->italics = (bool)lua_toboolean(L, 2); + argc = lua_gettop(tolua_S)-1; + if (argc == 0) + { + cobj->kill(); + lua_settop(tolua_S, 1); + return 1; + } + if (argc == 1) + { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fgui.GTweener:kill"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTweener_kill'", nullptr); + return 0; + } + cobj->kill(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GTweener:kill",argc, 0); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_italics'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTweener_kill'.",&tolua_err); return 0; #endif } -static int lua_fairygui_TextFormat_set_underline(lua_State* L) +int lua_fairygui_GTweener_seek(lua_State* tolua_S) { - fairygui::TextFormat* cobj = nullptr; + int argc = 0; + fairygui::GTweener* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fgui.GTweener",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); + + cobj = (fairygui::GTweener*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_underline'", nullptr); + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTweener_seek'", nullptr); return 0; } #endif - cobj->underline = (bool)lua_toboolean(L, 2); + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fgui.GTweener:seek"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTweener_seek'", nullptr); + return 0; + } + cobj->seek(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GTweener:seek",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_underline'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTweener_seek'.",&tolua_err); return 0; #endif } -static int lua_fairygui_TextFormat_set_lineSpacing(lua_State* L) +int lua_fairygui_GTweener_setBreakpoint(lua_State* tolua_S) { - fairygui::TextFormat* cobj = nullptr; + int argc = 0; + fairygui::GTweener* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fgui.GTweener",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); + + cobj = (fairygui::GTweener*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_lineSpacing'", nullptr); + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTweener_setBreakpoint'", nullptr); return 0; } #endif - cobj->lineSpacing = (int)lua_tointeger(L, 2); + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fgui.GTweener:setBreakpoint"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTweener_setBreakpoint'", nullptr); + return 0; + } + fairygui::GTweener* ret = cobj->setBreakpoint(arg0); + object_to_luaval(tolua_S, "fgui.GTweener",(fairygui::GTweener*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GTweener:setBreakpoint",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_lineSpacing'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTweener_setBreakpoint'.",&tolua_err); return 0; #endif } -static int lua_fairygui_TextFormat_set_letterSpacing(lua_State* L) +int lua_fairygui_GTweener_setDelay(lua_State* tolua_S) { - fairygui::TextFormat* cobj = nullptr; + int argc = 0; + fairygui::GTweener* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fgui.GTweener",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); + + cobj = (fairygui::GTweener*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_letterSpacing'", nullptr); + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTweener_setDelay'", nullptr); return 0; } #endif - cobj->letterSpacing = (int)lua_tointeger(L, 2); + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fgui.GTweener:setDelay"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTweener_setDelay'", nullptr); + return 0; + } + fairygui::GTweener* ret = cobj->setDelay(arg0); + object_to_luaval(tolua_S, "fgui.GTweener",(fairygui::GTweener*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GTweener:setDelay",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_letterSpacing'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTweener_setDelay'.",&tolua_err); return 0; #endif } -static int lua_fairygui_TextFormat_set_align(lua_State* L) +int lua_fairygui_GTweener_setDuration(lua_State* tolua_S) { - fairygui::TextFormat* cobj = nullptr; + int argc = 0; + fairygui::GTweener* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fgui.GTweener",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); + + cobj = (fairygui::GTweener*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_align'", nullptr); + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTweener_setDuration'", nullptr); return 0; } #endif - cobj->align = (cocos2d::TextHAlignment)lua_tointeger(L, 2); + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fgui.GTweener:setDuration"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTweener_setDuration'", nullptr); + return 0; + } + fairygui::GTweener* ret = cobj->setDuration(arg0); + object_to_luaval(tolua_S, "fgui.GTweener",(fairygui::GTweener*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GTweener:setDuration",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_align'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTweener_setDuration'.",&tolua_err); return 0; #endif } -static int lua_fairygui_TextFormat_set_verticalAlign(lua_State* L) +int lua_fairygui_GTweener_setEase(lua_State* tolua_S) { - fairygui::TextFormat* cobj = nullptr; + int argc = 0; + fairygui::GTweener* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fgui.GTweener",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); + + cobj = (fairygui::GTweener*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_verticalAlign'", nullptr); + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTweener_setEase'", nullptr); return 0; } #endif - cobj->verticalAlign = (cocos2d::TextVAlignment)lua_tointeger(L, 2); + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + fairygui::EaseType arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fgui.GTweener:setEase"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTweener_setEase'", nullptr); + return 0; + } + fairygui::GTweener* ret = cobj->setEase(arg0); + object_to_luaval(tolua_S, "fgui.GTweener",(fairygui::GTweener*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GTweener:setEase",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_verticalAlign'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTweener_setEase'.",&tolua_err); return 0; #endif } -static int lua_fairygui_TextFormat_set_outlineColor(lua_State* L) +int lua_fairygui_GTweener_setEaseOvershootOrAmplitude(lua_State* tolua_S) { - fairygui::TextFormat* cobj = nullptr; + int argc = 0; + fairygui::GTweener* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fgui.GTweener",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); + + cobj = (fairygui::GTweener*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_outlineColor'", nullptr); + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTweener_setEaseOvershootOrAmplitude'", nullptr); return 0; } #endif - luaval_to_color3b(L, 2, &cobj->outlineColor, "fairygui.TextFormat:outlineColor"); + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fgui.GTweener:setEaseOvershootOrAmplitude"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTweener_setEaseOvershootOrAmplitude'", nullptr); + return 0; + } + fairygui::GTweener* ret = cobj->setEaseOvershootOrAmplitude(arg0); + object_to_luaval(tolua_S, "fgui.GTweener",(fairygui::GTweener*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GTweener:setEaseOvershootOrAmplitude",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_outlineColor'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTweener_setEaseOvershootOrAmplitude'.",&tolua_err); return 0; #endif } -static int lua_fairygui_TextFormat_set_outlineSize(lua_State* L) +int lua_fairygui_GTweener_setEasePeriod(lua_State* tolua_S) { - fairygui::TextFormat* cobj = nullptr; + int argc = 0; + fairygui::GTweener* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fgui.GTweener",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); + + cobj = (fairygui::GTweener*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_outlineSize'", nullptr); + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTweener_setEasePeriod'", nullptr); return 0; } #endif - cobj->outlineSize = (int)lua_tointeger(L, 2); + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fgui.GTweener:setEasePeriod"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTweener_setEasePeriod'", nullptr); + return 0; + } + fairygui::GTweener* ret = cobj->setEasePeriod(arg0); + object_to_luaval(tolua_S, "fgui.GTweener",(fairygui::GTweener*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GTweener:setEasePeriod",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_outlineSize'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTweener_setEasePeriod'.",&tolua_err); return 0; #endif } -static int lua_fairygui_TextFormat_set_shadowColor(lua_State* L) +int lua_fairygui_GTweener_setPath(lua_State* tolua_S) { - fairygui::TextFormat* cobj = nullptr; + int argc = 0; + fairygui::GTweener* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fgui.GTweener",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); + + cobj = (fairygui::GTweener*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_shadowColor'", nullptr); + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTweener_setPath'", nullptr); return 0; } #endif - luaval_to_color3b(L, 2, &cobj->shadowColor, "fairygui.TextFormat:shadowColor"); + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + fairygui::GPath* arg0; + ok &= luaval_to_object(tolua_S, 2, "fgui.GPath",&arg0, "fgui.GTweener:setPath"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTweener_setPath'", nullptr); + return 0; + } + fairygui::GTweener* ret = cobj->setPath(arg0); + object_to_luaval(tolua_S, "fgui.GTweener",(fairygui::GTweener*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GTweener:setPath",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_shadowColor'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTweener_setPath'.",&tolua_err); return 0; #endif } -static int lua_fairygui_TextFormat_set_shadowOffset(lua_State* L) +int lua_fairygui_GTweener_setPaused(lua_State* tolua_S) { - fairygui::TextFormat* cobj = nullptr; + int argc = 0; + fairygui::GTweener* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fgui.GTweener",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); + + cobj = (fairygui::GTweener*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_shadowOffset'", nullptr); + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTweener_setPaused'", nullptr); return 0; } #endif - luaval_to_size(L, 2, &cobj->shadowOffset); + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fgui.GTweener:setPaused"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTweener_setPaused'", nullptr); + return 0; + } + fairygui::GTweener* ret = cobj->setPaused(arg0); + object_to_luaval(tolua_S, "fgui.GTweener",(fairygui::GTweener*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GTweener:setPaused",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_shadowOffset'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTweener_setPaused'.",&tolua_err); return 0; #endif } -static int lua_fairygui_TextFormat_set_shadowBlurRadius(lua_State* L) +int lua_fairygui_GTweener_setRepeat(lua_State* tolua_S) { - fairygui::TextFormat* cobj = nullptr; + int argc = 0; + fairygui::GTweener* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fgui.GTweener",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); + + cobj = (fairygui::GTweener*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_shadowBlurRadius'", nullptr); + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTweener_setRepeat'", nullptr); return 0; } #endif - cobj->shadowBlurRadius = (int)lua_tointeger(L, 2); + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + int arg0; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fgui.GTweener:setRepeat"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTweener_setRepeat'", nullptr); + return 0; + } + fairygui::GTweener* ret = cobj->setRepeat(arg0); + object_to_luaval(tolua_S, "fgui.GTweener",(fairygui::GTweener*)ret); + return 1; + } + if (argc == 2) + { + int arg0; + bool arg1; + ok &= luaval_to_int32(tolua_S, 2,(int *)&arg0, "fgui.GTweener:setRepeat"); + ok &= luaval_to_boolean(tolua_S, 3,&arg1, "fgui.GTweener:setRepeat"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTweener_setRepeat'", nullptr); + return 0; + } + fairygui::GTweener* ret = cobj->setRepeat(arg0, arg1); + object_to_luaval(tolua_S, "fgui.GTweener",(fairygui::GTweener*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GTweener:setRepeat",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_shadowBlurRadius'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTweener_setRepeat'.",&tolua_err); return 0; #endif } -static int lua_fairygui_TextFormat_set_glowColor(lua_State* L) +int lua_fairygui_GTweener_setSnapping(lua_State* tolua_S) { - fairygui::TextFormat* cobj = nullptr; + int argc = 0; + fairygui::GTweener* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(L,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fgui.GTweener",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::TextFormat*)tolua_tousertype(L,1,0); + + cobj = (fairygui::GTweener*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(L,"invalid 'cobj' in function 'lua_fairygui_TextFormat_set_glowColor'", nullptr); + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTweener_setSnapping'", nullptr); return 0; } #endif - luaval_to_color3b(L, 2, &cobj->glowColor, "fairygui.TextFormat:glowColor"); + argc = lua_gettop(tolua_S)-1; + if (argc == 1) + { + bool arg0; + ok &= luaval_to_boolean(tolua_S, 2,&arg0, "fgui.GTweener:setSnapping"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTweener_setSnapping'", nullptr); + return 0; + } + fairygui::GTweener* ret = cobj->setSnapping(arg0); + object_to_luaval(tolua_S, "fgui.GTweener",(fairygui::GTweener*)ret); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GTweener:setSnapping",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(L,"#ferror in function 'lua_fairygui_TextFormat_set_glowColor'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTweener_setSnapping'.",&tolua_err); return 0; #endif } -static int lua_fairygui_TextFormat_setFormat(lua_State* tolua_S) +int lua_fairygui_GTweener_setTarget(lua_State* tolua_S) { int argc = 0; - fairygui::TextFormat* cobj = nullptr; + fairygui::GTweener* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fgui.GTweener",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::TextFormat*)tolua_tousertype(tolua_S,1,0); + cobj = (fairygui::GTweener*)tolua_tousertype(tolua_S,1,0); #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_TextFormat_setFormat'", nullptr); + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTweener_setTarget'", nullptr); return 0; } #endif - argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - fairygui::TextFormat *format; - luaval_to_object(tolua_S,2,"fairygui.TextFormat",&format,"fairygui.TextFormat:setFormat"); - cobj->setFormat(*format); - return 0; - } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.TextFormat:setFormat",argc,1); + argc = lua_gettop(tolua_S) - 1; + do { + if (argc == 2) { + cocos2d::Ref* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0, "fgui.GTweener:setTarget"); + if (!ok) { break; } + + fairygui::TweenPropType arg1; + ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "fgui.GTweener:setTarget"); + if (!ok) { break; } + + fairygui::GTweener* ret = cobj->setTarget(arg0, arg1); + object_to_luaval(tolua_S, "fgui.GTweener",(fairygui::GTweener*)ret); + return 1; + } + } while(0); + ok = true; + do { + if (argc == 1) { + cocos2d::Ref* arg0; + ok &= luaval_to_object(tolua_S, 2, "cc.Ref",&arg0, "fgui.GTweener:setTarget"); + if (!ok) { break; } + + fairygui::GTweener* ret = cobj->setTarget(arg0); + object_to_luaval(tolua_S, "fgui.GTweener",(fairygui::GTweener*)ret); + return 1; + } + } while(0); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GTweener:setTarget",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_TextFormat_setFormat'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTweener_setTarget'.",&tolua_err); return 0; #endif } -static int lua_fairygui_TextFormat_enableEffect(lua_State* tolua_S) +int lua_fairygui_GTweener_setTimeScale(lua_State* tolua_S) { int argc = 0; - fairygui::TextFormat* cobj = nullptr; + fairygui::GTweener* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fgui.GTweener",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::TextFormat*)tolua_tousertype(tolua_S,1,0); + + cobj = (fairygui::GTweener*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_TextFormat_enableEffect'", nullptr); + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTweener_setTimeScale'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int effectFlag = (int)lua_tointeger(tolua_S, 2); - cobj->enableEffect(effectFlag); - return 0; + if (argc == 1) + { + double arg0; + ok &= luaval_to_number(tolua_S, 2,&arg0, "fgui.GTweener:setTimeScale"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTweener_setTimeScale'", nullptr); + return 0; + } + fairygui::GTweener* ret = cobj->setTimeScale(arg0); + object_to_luaval(tolua_S, "fgui.GTweener",(fairygui::GTweener*)ret); + return 1; } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.TextFormat:enableEffect",argc,1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GTweener:setTimeScale",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_TextFormat_enableEffect'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTweener_setTimeScale'.",&tolua_err); return 0; #endif } -static int lua_fairygui_TextFormat_disableEffect(lua_State* tolua_S) +int lua_fairygui_GTweener_setUserData(lua_State* tolua_S) { int argc = 0; - fairygui::TextFormat* cobj = nullptr; + fairygui::GTweener* cobj = nullptr; + bool ok = true; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fgui.GTweener",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::TextFormat*)tolua_tousertype(tolua_S,1,0); + + cobj = (fairygui::GTweener*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_TextFormat_disableEffect'", nullptr); + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTweener_setUserData'", nullptr); return 0; } #endif argc = lua_gettop(tolua_S)-1; - if (argc == 1) { - int effectFlag = (int)lua_tointeger(tolua_S, 2); - cobj->disableEffect(effectFlag); - return 0; + if (argc == 1) + { + cocos2d::Value arg0; + ok &= luaval_to_ccvalue(tolua_S, 2, &arg0, "fgui.GTweener:setUserData"); + if(!ok) + { + tolua_error(tolua_S,"invalid arguments in function 'lua_fairygui_GTweener_setUserData'", nullptr); + return 0; + } + fairygui::GTweener* ret = cobj->setUserData(arg0); + object_to_luaval(tolua_S, "fgui.GTweener",(fairygui::GTweener*)ret); + return 1; } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.TextFormat:disableEffect",argc,1); + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GTweener:setUserData",argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_TextFormat_disableEffect'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTweener_setUserData'.",&tolua_err); return 0; #endif } -static int lua_fairygui_TextFormat_hasEffect(lua_State* tolua_S) +int lua_fairygui_GTweener_onComplete(lua_State* tolua_S) { int argc = 0; - fairygui::TextFormat* cobj = nullptr; + fairygui::GTweener* cobj = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; - if (!tolua_isusertype(tolua_S,1,"fairygui.TextFormat",0,&tolua_err)) goto tolua_lerror; + if (!tolua_isusertype(tolua_S,1,"fgui.GTweener",0,&tolua_err)) goto tolua_lerror; #endif - cobj = (fairygui::TextFormat*)tolua_tousertype(tolua_S,1,0); + + cobj = (fairygui::GTweener*)tolua_tousertype(tolua_S,1,0); + #if COCOS2D_DEBUG >= 1 - if (!cobj) { - tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_TextFormat_hasEffect'", nullptr); + if (!cobj) + { + tolua_error(tolua_S,"invalid 'cobj' in function 'lua_fairygui_GTweener_onComplete'", nullptr); return 0; } #endif - - argc = lua_gettop(tolua_S)-1; + argc = lua_gettop(tolua_S) - 1; if (argc == 1) { - int effectFlag = (int)lua_tointeger(tolua_S, 2); - bool rtn = cobj->hasEffect(effectFlag); - lua_pushboolean(tolua_S, (int)rtn); - return 1; + LUA_FUNCTION handler = (toluafix_ref_function(tolua_S,2,0)); + if (0 == handler) { + tolua_error(tolua_S, "invalid arguments in function 'lua_fairygui_GTweener_onComplete'", nullptr); + return 0; + } + cobj->onComplete([=]() { + LuaEngine::getInstance()->getLuaStack()->executeFunctionByHandler(handler, 0); + }); + ScriptHandlerMgr::getInstance()->addCustomHandler((void*)cobj, handler); + return 0; } - luaL_error(tolua_S,"%s has wrong number of arguments: %d, was expecting %d \n","fairygui.TextFormat:hasEffect",argc,1); - return 0; - #if COCOS2D_DEBUG >= 1 tolua_lerror: - tolua_error(tolua_S,"#ferror in function 'lua_fairygui_TextFormat_hasEffect'.",&tolua_err); + tolua_error(tolua_S,"#ferror in function 'lua_fairygui_GTweener_onComplete'.",&tolua_err); return 0; #endif } -static int lua_register_fairygui_TextFormat(lua_State* tolua_S) +int lua_fairygui_GTweener_constructor(lua_State* tolua_S) { - tolua_usertype(tolua_S,"fairygui.TextFormat"); - tolua_cclass(tolua_S,"TextFormat","fairygui.TextFormat","",nullptr); - - tolua_beginmodule(tolua_S,"TextFormat"); - // variable - tolua_variable(tolua_S, "face", nullptr, lua_fairygui_TextFormat_set_face); - tolua_variable(tolua_S, "fontSize", nullptr, lua_fairygui_TextFormat_set_fontSize); - tolua_variable(tolua_S, "color", nullptr, lua_fairygui_TextFormat_set_color); - tolua_variable(tolua_S, "bold", nullptr, lua_fairygui_TextFormat_set_bold); - tolua_variable(tolua_S, "italics", nullptr, lua_fairygui_TextFormat_set_italics); - tolua_variable(tolua_S, "underline", nullptr, lua_fairygui_TextFormat_set_underline); - tolua_variable(tolua_S, "lineSpacing", nullptr, lua_fairygui_TextFormat_set_lineSpacing); - tolua_variable(tolua_S, "letterSpacing", nullptr, lua_fairygui_TextFormat_set_letterSpacing); - tolua_variable(tolua_S, "align", nullptr, lua_fairygui_TextFormat_set_align); - tolua_variable(tolua_S, "verticalAlign", nullptr, lua_fairygui_TextFormat_set_verticalAlign); - tolua_variable(tolua_S, "outlineColor", nullptr, lua_fairygui_TextFormat_set_outlineColor); - tolua_variable(tolua_S, "outlineSize", nullptr, lua_fairygui_TextFormat_set_outlineSize); - tolua_variable(tolua_S, "shadowColor", nullptr, lua_fairygui_TextFormat_set_shadowColor); - tolua_variable(tolua_S, "shadowOffset", nullptr, lua_fairygui_TextFormat_set_shadowOffset); - tolua_variable(tolua_S, "shadowBlurRadius", nullptr, lua_fairygui_TextFormat_set_shadowBlurRadius); - tolua_variable(tolua_S, "glowColor", nullptr, lua_fairygui_TextFormat_set_glowColor); - // function - tolua_function(tolua_S,"setFormat",lua_fairygui_TextFormat_setFormat); - tolua_function(tolua_S,"enableEffect",lua_fairygui_TextFormat_enableEffect); - tolua_function(tolua_S,"disableEffect",lua_fairygui_TextFormat_disableEffect); - tolua_function(tolua_S,"hasEffect",lua_fairygui_TextFormat_hasEffect); + int argc = lua_gettop(tolua_S) - 1; + if (argc == 0) + { + fairygui::GTweener* cobj = new fairygui::GTweener(); + cobj->autorelease(); + int ID = (int)cobj->_ID ; + int* luaID = &cobj->_luaID ; + toluafix_pushusertype_ccobject(tolua_S, ID, luaID, (void*)cobj,"fgui.GTweener"); + return 1; + } + luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "fgui.GTweener:GTweener",argc, 0); + return 0; +} + +int lua_register_fairygui_GTweener(lua_State* tolua_S) +{ + tolua_usertype(tolua_S,"fgui.GTweener"); + tolua_cclass(tolua_S,"GTweener","fgui.GTweener","cc.Ref",nullptr); + + tolua_beginmodule(tolua_S,"GTweener"); + tolua_function(tolua_S,"new",lua_fairygui_GTweener_constructor); + tolua_function(tolua_S,"allCompleted",lua_fairygui_GTweener_allCompleted); + tolua_function(tolua_S,"getDelay",lua_fairygui_GTweener_getDelay); + tolua_function(tolua_S,"getDuration",lua_fairygui_GTweener_getDuration); + tolua_function(tolua_S,"getNormalizedTime",lua_fairygui_GTweener_getNormalizedTime); + tolua_function(tolua_S,"getRepeat",lua_fairygui_GTweener_getRepeat); + tolua_function(tolua_S,"getTarget",lua_fairygui_GTweener_getTarget); + tolua_function(tolua_S,"getUserData",lua_fairygui_GTweener_getUserData); + tolua_function(tolua_S,"isCompleted",lua_fairygui_GTweener_isCompleted); + tolua_function(tolua_S,"kill",lua_fairygui_GTweener_kill); + tolua_function(tolua_S,"seek",lua_fairygui_GTweener_seek); + tolua_function(tolua_S,"setBreakpoint",lua_fairygui_GTweener_setBreakpoint); + tolua_function(tolua_S,"setDelay",lua_fairygui_GTweener_setDelay); + tolua_function(tolua_S,"setDuration",lua_fairygui_GTweener_setDuration); + tolua_function(tolua_S,"setEase",lua_fairygui_GTweener_setEase); + tolua_function(tolua_S,"setEaseOvershootOrAmplitude",lua_fairygui_GTweener_setEaseOvershootOrAmplitude); + tolua_function(tolua_S,"setEasePeriod",lua_fairygui_GTweener_setEasePeriod); + tolua_function(tolua_S,"setPath",lua_fairygui_GTweener_setPath); + tolua_function(tolua_S,"setPaused",lua_fairygui_GTweener_setPaused); + tolua_function(tolua_S,"setRepeat",lua_fairygui_GTweener_setRepeat); + tolua_function(tolua_S,"setSnapping",lua_fairygui_GTweener_setSnapping); + tolua_function(tolua_S,"setTarget",lua_fairygui_GTweener_setTarget); + tolua_function(tolua_S,"setTimeScale",lua_fairygui_GTweener_setTimeScale); + tolua_function(tolua_S,"setUserData",lua_fairygui_GTweener_setUserData); + tolua_function(tolua_S,"onComplete",lua_fairygui_GTweener_onComplete); tolua_endmodule(tolua_S); - std::string typeName = typeid(fairygui::TextFormat).name(); - g_luaType[typeName] = "fairygui.TextFormat"; - g_typeCast["TextFormat"] = "fairygui.TextFormat"; + std::string typeName = typeid(fairygui::GTweener).name(); + g_luaType[typeName] = "fgui.GTweener"; + g_typeCast["GTweener"] = "fgui.GTweener"; return 1; } @@ -27179,21 +29954,24 @@ TOLUA_API int register_fairygui_manual(lua_State* tolua_S) lua_register_fairygui_GTextInput(tolua_S); lua_register_fairygui_Window(tolua_S); lua_register_fairygui_GLoader(tolua_S); - lua_register_fairygui_GLoader3D(tolua_S); + lua_register_fairygui_GLoader3D(tolua_S); lua_register_fairygui_GObjectPool(tolua_S); lua_register_fairygui_ScrollPane(tolua_S); lua_register_fairygui_GProgressBar(tolua_S); lua_register_fairygui_DragDropManager(tolua_S); - lua_register_fairygui_UIConfig(tolua_S); - lua_register_fairygui_GLabel(tolua_S); - lua_register_fairygui_FUIInput(tolua_S); - lua_register_fairygui_GBasicTextField(tolua_S); - lua_register_fairygui_InputProcessor(tolua_S); - lua_register_fairygui_HtmlObject(tolua_S); - lua_register_fairygui_PackageItem(tolua_S); - lua_register_fairygui_GTree(tolua_S); - lua_register_fairygui_GTreeNode(tolua_S); - lua_register_fairygui_TextFormat(tolua_S); + lua_register_fairygui_UIConfig(tolua_S); + lua_register_fairygui_GLabel(tolua_S); + lua_register_fairygui_FUIInput(tolua_S); + lua_register_fairygui_FUISprite(tolua_S); + lua_register_fairygui_GBasicTextField(tolua_S); + lua_register_fairygui_InputProcessor(tolua_S); + lua_register_fairygui_HtmlObject(tolua_S); + lua_register_fairygui_PackageItem(tolua_S); + lua_register_fairygui_GTree(tolua_S); + lua_register_fairygui_GTreeNode(tolua_S); + lua_register_fairygui_TextFormat(tolua_S); + lua_register_fairygui_GTween(tolua_S); + lua_register_fairygui_GTweener(tolua_S); tolua_endmodule(tolua_S); } diff --git a/cocos/scripting/lua-bindings/manual/network/CCHTTPRequest.cpp b/cocos/scripting/lua-bindings/manual/network/CCHTTPRequest.cpp index 933b444f..1ac40fc3 100644 --- a/cocos/scripting/lua-bindings/manual/network/CCHTTPRequest.cpp +++ b/cocos/scripting/lua-bindings/manual/network/CCHTTPRequest.cpp @@ -88,7 +88,13 @@ bool HTTPRequest::initWithUrl(const char *url, int method) curl_easy_setopt(m_curl, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(m_curl, CURLOPT_SSL_VERIFYPEER, 0L); + curl_easy_setopt(m_curl, CURLOPT_SSL_VERIFYPEER, 0); + curl_easy_setopt(m_curl, CURLOPT_SSL_VERIFYHOST, 0); + switch (method) { + case kCCHTTPRequestMethodGET: + curl_easy_setopt(m_curl, CURLOPT_CUSTOMREQUEST, "GET"); + break; case kCCHTTPRequestMethodPOST: curl_easy_setopt(m_curl, CURLOPT_POST, 1L); curl_easy_setopt(m_curl, CURLOPT_COPYPOSTFIELDS, ""); diff --git a/cocos/scripting/lua-bindings/manual/network/lua_http_manual.cpp b/cocos/scripting/lua-bindings/manual/network/lua_http_manual.cpp index 57cc7d92..3a2a0e1c 100644 --- a/cocos/scripting/lua-bindings/manual/network/lua_http_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/network/lua_http_manual.cpp @@ -733,7 +733,7 @@ TOLUA_API int register_http_manual(lua_State* tolua_S) tolua_cclass(tolua_S, "HTTPRequest", "HTTPRequest", "cc.Ref", NULL); tolua_beginmodule(tolua_S, "HTTPRequest"); tolua_function(tolua_S, "createWithUrl", tolua_HTTPRequest_createWithUrl); - tolua_function(tolua_S, "createForDownload", tolua_HTTPRequest_createForDownload); + tolua_function(tolua_S, "createForDownload", tolua_HTTPRequest_createForDownload); tolua_function(tolua_S, "setRequestUrl", tolua_HTTPRequest_setRequestUrl); tolua_function(tolua_S, "getRequestUrl", tolua_HTTPRequest_getRequestUrl); tolua_function(tolua_S, "addRequestHeader", tolua_HTTPRequest_addRequestHeader); diff --git a/cocos/scripting/lua-bindings/manual/platform/android/CCLuaJavaBridge.cpp b/cocos/scripting/lua-bindings/manual/platform/android/CCLuaJavaBridge.cpp index cd9ad64a..36d1a4ae 100644 --- a/cocos/scripting/lua-bindings/manual/platform/android/CCLuaJavaBridge.cpp +++ b/cocos/scripting/lua-bindings/manual/platform/android/CCLuaJavaBridge.cpp @@ -974,6 +974,7 @@ int LuaJavaBridge::callLuaGlobalFunction(const char *functionName, const char *a } else { + CCLOG("[LUA ERROR] %s", lua_tostring(L, -1)); ret = -ok; } } diff --git a/cocos/scripting/lua-bindings/manual/platform/android/jni/Cocos2dxLuaJavaBridge.cpp b/cocos/scripting/lua-bindings/manual/platform/android/jni/Cocos2dxLuaJavaBridge.cpp index 4050cc1f..a394b8a9 100644 --- a/cocos/scripting/lua-bindings/manual/platform/android/jni/Cocos2dxLuaJavaBridge.cpp +++ b/cocos/scripting/lua-bindings/manual/platform/android/jni/Cocos2dxLuaJavaBridge.cpp @@ -1,5 +1,6 @@ /**************************************************************************** Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. + Copyright (c) 2020-2021 cocos2d-lua.org http://www.cocos2d-x.org @@ -30,6 +31,8 @@ #include "scripting/lua-bindings/manual/platform/android/CCLuaJavaBridge.h" #include "base/ccUTF8.h" +#include "base/CCDirector.h" +#include "base/CCScheduler.h" #define LOG_TAG "Cocos2dxLuaJavaBridge_java" #define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) @@ -40,8 +43,11 @@ JNIEXPORT jint JNICALL Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge_callLuaFuncti (JNIEnv *env, jclass cls, jint functionId, jstring value) { std::string strValue = cocos2d::StringUtils::getStringUTFCharsJNI(env, value); - int ret = LuaJavaBridge::callLuaFunctionById(functionId, strValue.c_str()); - return ret; + cocos2d::Scheduler *sched = cocos2d::Director::getInstance()->getScheduler(); + sched->performFunctionInCocosThread([=](){ + LuaJavaBridge::callLuaFunctionById(functionId, strValue.c_str()); + }); + return 0; } JNIEXPORT jint JNICALL Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge_callLuaGlobalFunctionWithString @@ -49,9 +55,11 @@ JNIEXPORT jint JNICALL Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge_callLuaGlobal { std::string functionNameStr = cocos2d::StringUtils::getStringUTFCharsJNI(env, luaFunctionName); std::string valueStr = cocos2d::StringUtils::getStringUTFCharsJNI(env, value); - - int ret = LuaJavaBridge::callLuaGlobalFunction(functionNameStr.c_str(), valueStr.c_str()); - return ret; + cocos2d::Scheduler *sched = cocos2d::Director::getInstance()->getScheduler(); + sched->performFunctionInCocosThread([=](){ + LuaJavaBridge::callLuaGlobalFunction(functionNameStr.c_str(), valueStr.c_str()); + }); + return 0; } JNIEXPORT jint JNICALL Java_org_cocos2dx_lib_Cocos2dxLuaJavaBridge_retainLuaFunction diff --git a/cocos/scripting/lua-bindings/manual/spine/lua_cocos2dx_spine_manual.cpp b/cocos/scripting/lua-bindings/manual/spine/lua_cocos2dx_spine_manual.cpp index 509266c7..41607e9f 100644 --- a/cocos/scripting/lua-bindings/manual/spine/lua_cocos2dx_spine_manual.cpp +++ b/cocos/scripting/lua-bindings/manual/spine/lua_cocos2dx_spine_manual.cpp @@ -1012,9 +1012,8 @@ static int lua_cocos2dx_spine_SkeletonAnimation_updateBone(lua_State* tolua_S) #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_spine_SkeletonAnimation_updateBone'.",&tolua_err); -#endif - return 0; +#endif } static int lua_cocos2dx_spine_SkeletonAnimation_getBoundingBox(lua_State* tolua_S) @@ -1047,6 +1046,174 @@ static int lua_cocos2dx_spine_SkeletonAnimation_getBoundingBox(lua_State* tolua_ return 1; } +static int lua_cocos2dx_spine_SkeletonAnimation_setTimeScale(lua_State* tolua_S) +{ + int argc = 0; + spine::SkeletonAnimation* cobj = nullptr; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S, 1, "sp.SkeletonAnimation", 0, &tolua_err)) goto tolua_lerror; +#endif + + cobj = (spine::SkeletonAnimation*)tolua_tousertype(tolua_S, 1, 0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S, "invalid 'cobj' in function 'lua_cocos2dx_spine_SkeletonAnimation_setTimeScale'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S) - 1; + if (argc == 1) { + double arg0; + if (!luaval_to_number(tolua_S, 2, &arg0, "setTimeScale")) { + tolua_error(tolua_S, "invalid arguments in function 'setTimeScale'", nullptr); + return 0; + } + cobj->setTimeScale(arg0); + lua_settop(tolua_S, 1); + return 1; + } + luaL_error(tolua_S, "'setTimeScale' function of spine.SkeletonAnimation has wrong number of arguments: %d, was expecting 1\n", argc); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S, "#ferror in function 'setTimeScale'.", &tolua_err); + return 0; +#endif +} + +static int lua_cocos2dx_spine_SkeletonAnimation_setTrackTime(lua_State* tolua_S) +{ + int argc = 0; + spine::SkeletonAnimation* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S, 1, "sp.SkeletonAnimation", 0, &tolua_err)) goto tolua_lerror; +#endif + + cobj = (spine::SkeletonAnimation*)tolua_tousertype(tolua_S, 1, 0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S, "invalid 'cobj' in function 'lua_cocos2dx_spine_SkeletonAnimation_setTrackTime'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S) - 1; + if (argc == 2) { + int arg0; + double arg1; + ok &= luaval_to_int32(tolua_S, 2, &arg0, "setTrackTime"); + ok &= luaval_to_number(tolua_S, 3, &arg1, "setTrackTime"); + if (!ok) { + tolua_error(tolua_S, "invalid arguments in function 'sp.SkeletonAnimation:setTrackTime'", nullptr); + return 0; + } + cobj->getCurrent(arg0)->setTrackTime(arg1); + return 0; + } + luaL_error(tolua_S, "'setTrackTime' function of spine.SkeletonAnimation has wrong number of arguments: %d, was expecting 2\n", argc); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S, "#ferror in function 'setTrackTime'.", &tolua_err); + return 0; +#endif +} + +static int lua_cocos2dx_spine_SkeletonAnimation_getAnimationEnd(lua_State* tolua_S) +{ + int argc = 0; + spine::SkeletonAnimation* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S, 1, "sp.SkeletonAnimation", 0, &tolua_err)) goto tolua_lerror; +#endif + + cobj = (spine::SkeletonAnimation*)tolua_tousertype(tolua_S, 1, 0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S, "invalid 'cobj' in function 'lua_cocos2dx_spine_SkeletonAnimation_getAnimationEnd'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S) - 1; + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2, &arg0, "sp.SkeletonAnimation:getAnimationEnd"); + if (!ok) { + tolua_error(tolua_S, "invalid arguments in function 'getAnimationEnd'", nullptr); + return 0; + } + float time = cobj->getCurrent(arg0)->getAnimationEnd(); + tolua_pushnumber(tolua_S, (lua_Number)time); + return 1; + } + luaL_error(tolua_S, "'getAnimationEnd' function of spine.SkeletonAnimation has wrong number of arguments: %d, was expecting 1\n", argc); + return 0; + +#if COCOS2D_DEBUG >= 1 +tolua_lerror: + tolua_error(tolua_S, "#ferror in function 'getAnimationEnd'.", &tolua_err); + return 0; +#endif +} + +static int lua_cocos2dx_spine_SkeletonAnimation_getAnimationStart(lua_State* tolua_S) +{ + int argc = 0; + spine::SkeletonAnimation* cobj = nullptr; + bool ok = true; + +#if COCOS2D_DEBUG >= 1 + tolua_Error tolua_err; + if (!tolua_isusertype(tolua_S, 1, "sp.SkeletonAnimation", 0, &tolua_err)) goto tolua_lerror; +#endif + + cobj = (spine::SkeletonAnimation*)tolua_tousertype(tolua_S, 1, 0); + +#if COCOS2D_DEBUG >= 1 + if (!cobj) { + tolua_error(tolua_S, "invalid 'cobj' in function 'lua_cocos2dx_spine_SkeletonAnimation_getAnimationStart'", nullptr); + return 0; + } +#endif + + argc = lua_gettop(tolua_S) - 1; + if (argc == 1) { + int arg0; + ok &= luaval_to_int32(tolua_S, 2, &arg0, "sp.SkeletonAnimation:getAnimationStart"); + if (!ok) { + tolua_error(tolua_S, "invalid arguments in function 'getAnimationStart'", nullptr); + return 0; + } + float time = cobj->getCurrent(arg0)->getAnimationStart(); + tolua_pushnumber(tolua_S, (lua_Number)time); + return 1; + } + luaL_error(tolua_S, "'getAnimationStart' function of spine.SkeletonAnimation has wrong number of arguments: %d, was expecting 1\n", argc); + return 0; + +#if COCOS2D_DEBUG >= 1 + tolua_lerror: + tolua_error(tolua_S, "#ferror in function 'getAnimationStart'.", &tolua_err); + return 0; +#endif +} + + static void register_spine_manual(lua_State* L) { lua_pushstring(L, "sp.SkeletonAnimation"); @@ -1067,6 +1234,10 @@ static void register_spine_manual(lua_State* L) tolua_function(L, "findBone", lua_cocos2dx_spine_SkeletonAnimation_findBone); tolua_function(L, "updateBone", lua_cocos2dx_spine_SkeletonAnimation_updateBone); tolua_function(L, "getBoundingBox", lua_cocos2dx_spine_SkeletonAnimation_getBoundingBox); + tolua_function(L, "setTimeScale", lua_cocos2dx_spine_SkeletonAnimation_setTimeScale); + tolua_function(L, "setTrackTime", lua_cocos2dx_spine_SkeletonAnimation_setTrackTime); + tolua_function(L, "getAnimationEnd", lua_cocos2dx_spine_SkeletonAnimation_getAnimationEnd); + tolua_function(L, "getAnimationStart", lua_cocos2dx_spine_SkeletonAnimation_getAnimationStart); } lua_pop(L, 1); diff --git a/cocos/scripting/lua-bindings/manual/spine/lua_spSkeletonData.cpp b/cocos/scripting/lua-bindings/manual/spine/lua_spSkeletonData.cpp index 30e083ac..55e9a225 100644 --- a/cocos/scripting/lua-bindings/manual/spine/lua_spSkeletonData.cpp +++ b/cocos/scripting/lua-bindings/manual/spine/lua_spSkeletonData.cpp @@ -35,7 +35,14 @@ static int lua_cocos2dx_SkeletonData_create(lua_State* L) AttachmentLoader *attachmentLoader = new (__FILE__, __LINE__) Cocos2dAtlasAttachmentLoader(atlas); SkeletonJson json(attachmentLoader);// SkeletonJson not own AttachmentLoader SkeletonData *skeletonData = json.readSkeletonDataFile(skeletonDataFile); - CCASSERT(skeletonData, !json.getError().isEmpty() ? json.getError().buffer() : "Error reading skeleton data."); + if (!skeletonData) { + delete attachmentLoader; + delete atlas; + delete luaSpData; + cocos2d::log("Assert failed: %s", !json.getError().isEmpty() ? json.getError().buffer() : "Error reading skeleton data."); + luaL_error(L, "sp.SkeletonData:create fail!"); + return 0; + } luaSpData->atlas = atlas; luaSpData->data = skeletonData; diff --git a/cocos/ui/UIAbstractCheckButton.cpp b/cocos/ui/UIAbstractCheckButton.cpp index 8bd402ab..7f35f1e9 100644 --- a/cocos/ui/UIAbstractCheckButton.cpp +++ b/cocos/ui/UIAbstractCheckButton.cpp @@ -308,12 +308,12 @@ void AbstractCheckButton::onPressStateChangedToNormal() _backGroundSelectedBoxRenderer->setVisible(false); _backGroundBoxDisabledRenderer->setVisible(false); _frontCrossDisabledRenderer->setVisible(false); - + auto isETC1 = _backGroundBoxRenderer->getTexture() && _backGroundBoxRenderer->getTexture()->getAlphaTextureName(); - _backGroundBoxRenderer->updateShaders(positionTextureColor_vert, (isETC1)?etc1_frag:positionTextureColor_frag); + _backGroundBoxRenderer->setProgramState((isETC1) ? backend::ProgramType::ETC1 : backend::ProgramType::POSITION_TEXTURE_COLOR); isETC1 = _frontCrossRenderer->getTexture() && _frontCrossRenderer->getTexture()->getAlphaTextureName(); - _frontCrossRenderer->updateShaders(positionTextureColor_vert, (isETC1)?etc1_frag:positionTextureColor_frag); + _frontCrossRenderer->setProgramState((isETC1) ? backend::ProgramType::ETC1 : backend::ProgramType::POSITION_TEXTURE_COLOR); _backGroundBoxRenderer->setScale(_backgroundTextureScaleX, _backgroundTextureScaleY); @@ -330,10 +330,10 @@ void AbstractCheckButton::onPressStateChangedToNormal() void AbstractCheckButton::onPressStateChangedToPressed() { auto isETC1 = _backGroundBoxRenderer->getTexture() && _backGroundBoxRenderer->getTexture()->getAlphaTextureName(); - _backGroundBoxRenderer->updateShaders(positionTextureColor_vert, (isETC1)?etc1_frag:positionTextureColor_frag); + _backGroundBoxRenderer->setProgramState((isETC1) ? backend::ProgramType::ETC1 : backend::ProgramType::POSITION_TEXTURE_COLOR); isETC1 = _frontCrossRenderer->getTexture() && _frontCrossRenderer->getTexture()->getAlphaTextureName(); - _frontCrossRenderer->updateShaders(positionTextureColor_vert, (isETC1)?etc1_frag:positionTextureColor_frag); + _frontCrossRenderer->setProgramState((isETC1) ? backend::ProgramType::ETC1 : backend::ProgramType::POSITION_TEXTURE_COLOR); if (!_isBackgroundSelectedTextureLoaded) { @@ -357,10 +357,10 @@ void AbstractCheckButton::onPressStateChangedToDisabled() || !_isFrontCrossDisabledTextureLoaded) { auto isETC1 = _backGroundBoxRenderer->getTexture() && _backGroundBoxRenderer->getTexture()->getAlphaTextureName(); - _backGroundBoxRenderer->updateShaders(positionTextureColor_vert, (isETC1)?etc1Gray_frag:grayScale_frag); + _backGroundBoxRenderer->setProgramState((isETC1) ? backend::ProgramType::ETC1_GRAY : backend::ProgramType::GRAY_SCALE); isETC1 = _frontCrossRenderer->getTexture() && _frontCrossRenderer->getTexture()->getAlphaTextureName(); - _frontCrossRenderer->updateShaders(positionTextureColor_vert, (isETC1)?etc1Gray_frag:grayScale_frag); + _frontCrossRenderer->setProgramState((isETC1) ? backend::ProgramType::ETC1_GRAY : backend::ProgramType::GRAY_SCALE); } else { diff --git a/cocos/ui/UIButton.cpp b/cocos/ui/UIButton.cpp index 4a0477d7..ca51bd73 100644 --- a/cocos/ui/UIButton.cpp +++ b/cocos/ui/UIButton.cpp @@ -72,7 +72,8 @@ _disabledFileName(""), _normalTexType(TextureResType::LOCAL), _pressedTexType(TextureResType::LOCAL), _disabledTexType(TextureResType::LOCAL), -_fontName("") +_fontName(""), +_titleOffset(0, 0) { setTouchEnabled(true); } @@ -581,7 +582,8 @@ void Button::onPressStateChangedToDisabled() void Button::updateTitleLocation() { - _titleRenderer->setPosition(_contentSize.width * 0.5f, _contentSize.height * 0.5f); + _titleRenderer->setPosition(_contentSize.width * 0.5f + _titleOffset.x, + _contentSize.height * 0.5f + _titleOffset.y); } void Button::updateContentSize() @@ -838,6 +840,13 @@ std::string Button::getTitleFontName() const return ""; } +void Button::setTitleOffset(float x, float y) +{ + _titleOffset.x = x; + _titleOffset.y = y; + updateTitleLocation(); +} + std::string Button::getDescription() const { return "Button"; diff --git a/cocos/ui/UIButton.h b/cocos/ui/UIButton.h index 04a8a654..a0d3a11c 100644 --- a/cocos/ui/UIButton.h +++ b/cocos/ui/UIButton.h @@ -248,6 +248,9 @@ class CC_GUI_DLL Button : public Widget *@return font name in std::string */ std::string getTitleFontName() const; + + /** Set tile label display offset */ + void setTitleOffset(float x, float y); /** * Sets the title's text horizontal alignment. @@ -355,6 +358,7 @@ class CC_GUI_DLL Button : public Widget Scale9Sprite* _buttonClickedRenderer; Scale9Sprite* _buttonDisabledRenderer; Label* _titleRenderer; + Point _titleOffset; float _zoomScale; bool _prevIgnoreSize; diff --git a/cocos/ui/UIEditBox/Mac/CCUIPasswordTextField.h b/cocos/ui/UIEditBox/Mac/CCUIPasswordTextField.h index 730805d0..531ec7fb 100644 --- a/cocos/ui/UIEditBox/Mac/CCUIPasswordTextField.h +++ b/cocos/ui/UIEditBox/Mac/CCUIPasswordTextField.h @@ -27,7 +27,7 @@ #import #include "ui/UIEditBox/Mac/CCUITextInput.h" -@interface CCUIPasswordTextField : NSTextField +@interface CCUIPasswordTextField : NSSecureTextField { } diff --git a/cocos/ui/UIEditBox/Mac/CCUIPasswordTextField.m b/cocos/ui/UIEditBox/Mac/CCUIPasswordTextField.m index c75db227..59709c71 100644 --- a/cocos/ui/UIEditBox/Mac/CCUIPasswordTextField.m +++ b/cocos/ui/UIEditBox/Mac/CCUIPasswordTextField.m @@ -123,7 +123,7 @@ -(void)dealloc +(void)load { - [self setCellClass:[RSVerticallyCenteredSecureTextFieldCell class]]; + // [self setCellClass:[RSVerticallyCenteredSecureTextFieldCell class]]; } diff --git a/cocos/ui/UIEditBox/UIEditBoxImpl-common.cpp b/cocos/ui/UIEditBox/UIEditBoxImpl-common.cpp index cfd5b166..a6670c16 100755 --- a/cocos/ui/UIEditBox/UIEditBoxImpl-common.cpp +++ b/cocos/ui/UIEditBox/UIEditBoxImpl-common.cpp @@ -160,7 +160,7 @@ void EditBoxImplCommon::setFont(const char* pFontName, int fontSize) { _fontName = pFontName; _fontSize = fontSize; - this->setNativeFont(pFontName, fontSize * _label->getNodeToWorldAffineTransform().a); + this->setNativeFont(pFontName, fontSize); // Assume EditBox and it's parent will not be scaled. if (!_fontName.empty()) { _label->setSystemFontName(pFontName); @@ -182,7 +182,7 @@ void EditBoxImplCommon::setPlaceholderFont(const char* pFontName, int fontSize) { _placeholderFontName = pFontName; _placeholderFontSize = fontSize; - this->setNativePlaceholderFont(pFontName, fontSize * _labelPlaceHolder->getNodeToWorldAffineTransform().a); + this->setNativePlaceholderFont(pFontName, fontSize); // Assume EditBox and it's parent will not be scaled. if (!_placeholderFontName.empty()) { _labelPlaceHolder->setSystemFontName(pFontName); diff --git a/cocos/ui/UILayout.cpp b/cocos/ui/UILayout.cpp index f9a2856f..d04ecd80 100644 --- a/cocos/ui/UILayout.cpp +++ b/cocos/ui/UILayout.cpp @@ -204,6 +204,9 @@ void Layout::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t par { return; } + + if (FLAGS_TRANSFORM_DIRTY & parentFlags || _transformUpdated || _contentSizeDirty) + _clippingRectDirty = true; adaptRenderers(); doLayout(); @@ -224,7 +227,8 @@ void Layout::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t par } else { - Widget::visit(renderer, parentTransform, parentFlags); + //no need to adapt render again + ProtectedNode::visit(renderer, parentTransform, parentFlags); } } diff --git a/cocos/ui/UIListView.cpp b/cocos/ui/UIListView.cpp index 3c39d408..8f92d217 100644 --- a/cocos/ui/UIListView.cpp +++ b/cocos/ui/UIListView.cpp @@ -617,21 +617,18 @@ void ListView::selectedItemEvent(TouchEventType event) void ListView::interceptTouchEvent(TouchEventType event, Widget *sender, Touch* touch) { ScrollView::interceptTouchEvent(event, sender, touch); - if (!_touchEnabled) - { + if (!_touchEnabled) { return; } - if (event != TouchEventType::MOVED) - { - Widget* parent = sender; - while (parent) - { - if (parent && (parent->getParent() == _innerContainer)) - { - _curSelectedIndex = getIndex(parent); + if (event != TouchEventType::MOVED) { + Node* parent = sender; + while (parent) { + Widget* widget = dynamic_cast(parent); + if (widget && (widget->getParent() == _innerContainer)) { + _curSelectedIndex = getIndex(widget); break; } - parent = dynamic_cast(parent->getParent()); + parent = parent->getParent(); } if (sender->isHighlighted()) { selectedItemEvent(event); diff --git a/cocos/ui/UIRichText.cpp b/cocos/ui/UIRichText.cpp index ffd005de..b21cc104 100755 --- a/cocos/ui/UIRichText.cpp +++ b/cocos/ui/UIRichText.cpp @@ -1792,7 +1792,7 @@ void RichText::formatRenderers() { float newContentSizeWidth = 0.0f; float nextPosY = 0.0f; - std::vector*, float> > rowWidthPairs; + std::vector, float> > rowWidthPairs; rowWidthPairs.reserve(_elementRenders.size()); for (int i = _elementRenders.size() - 1; i >= 0; i--) { @@ -1812,11 +1812,11 @@ void RichText::formatRenderers() } nextPosY += maxY; newContentSizeWidth = std::max(newContentSizeWidth, rowWidth); - rowWidthPairs.emplace_back(&element, nextPosX); + rowWidthPairs.emplace_back(element, nextPosX); // element is local var, can not use address out of range. } this->setContentSize(Size(newContentSizeWidth, nextPosY)); for ( auto& row : rowWidthPairs ) - doHorizontalAlignment(*row.first, row.second); + doHorizontalAlignment(row.first, row.second); } else { diff --git a/cocos/ui/UIScale9Sprite.cpp b/cocos/ui/UIScale9Sprite.cpp index 53970b99..78c75e8b 100644 --- a/cocos/ui/UIScale9Sprite.cpp +++ b/cocos/ui/UIScale9Sprite.cpp @@ -308,10 +308,10 @@ void Scale9Sprite::setState(Scale9Sprite::State state) switch (state) { case State::NORMAL: - Sprite::updateShaders(positionTextureColor_vert, (isETC1)?etc1_frag:positionTextureColor_frag); + Sprite::setProgramState((isETC1) ? backend::ProgramType::ETC1 : backend::ProgramType::POSITION_TEXTURE_COLOR); break; case State::GRAY: - Sprite::updateShaders(positionTextureColor_vert, (isETC1)?etc1Gray_frag:grayScale_frag); + Sprite::setProgramState((isETC1) ? backend::ProgramType::ETC1_GRAY : backend::ProgramType::GRAY_SCALE); default: break; } diff --git a/cocos/ui/UIScrollView.cpp b/cocos/ui/UIScrollView.cpp index b9261f36..5660f7a0 100644 --- a/cocos/ui/UIScrollView.cpp +++ b/cocos/ui/UIScrollView.cpp @@ -609,14 +609,13 @@ void ScrollView::processAutoScrolling(float deltaTime) } } + moveInnerContainer(newPosition - getInnerContainerPosition(), reachedEnd); // Finish auto scroll if it ended if(reachedEnd) { _autoScrolling = false; dispatchEvent(EventType::AUTOSCROLL_ENDED); } - - moveInnerContainer(newPosition - getInnerContainerPosition(), reachedEnd); } void ScrollView::jumpToDestination(const Vec2 &des) diff --git a/cocos/ui/UISlider.cpp b/cocos/ui/UISlider.cpp index 8c6669e9..86c52ead 100644 --- a/cocos/ui/UISlider.cpp +++ b/cocos/ui/UISlider.cpp @@ -681,14 +681,14 @@ void Slider::onPressStateChangedToNormal() _slidBallDisabledRenderer->setVisible(false); auto isETC1 = _slidBallNormalRenderer->getTexture() && _slidBallNormalRenderer->getTexture()->getAlphaTextureName(); - _slidBallNormalRenderer->updateShaders(positionTextureColor_vert, (isETC1)?etc1_frag:positionTextureColor_frag); + _slidBallNormalRenderer->setProgramState((isETC1) ? backend::ProgramType::ETC1 : backend::ProgramType::POSITION_TEXTURE_COLOR); _slidBallNormalRenderer->setScale(_sliderBallNormalTextureScaleX, _sliderBallNormalTextureScaleY); } void Slider::onPressStateChangedToPressed() { auto isETC1 = _slidBallNormalRenderer->getTexture() && _slidBallNormalRenderer->getTexture()->getAlphaTextureName(); - _slidBallNormalRenderer->updateShaders(positionTextureColor_vert, (isETC1)?etc1_frag:positionTextureColor_frag); + _slidBallNormalRenderer->setProgramState((isETC1) ? backend::ProgramType::ETC1 : backend::ProgramType::POSITION_TEXTURE_COLOR); if (!_isSliderBallPressedTextureLoaded) { @@ -708,7 +708,7 @@ void Slider::onPressStateChangedToDisabled() if (!_isSliderBallDisabledTexturedLoaded) { auto isETC1 = _slidBallNormalRenderer->getTexture() && _slidBallNormalRenderer->getTexture()->getAlphaTextureName(); - _slidBallNormalRenderer->updateShaders(positionTextureColor_vert, (isETC1)?etc1Gray_frag:grayScale_frag); + _slidBallNormalRenderer->setProgramState((isETC1) ? backend::ProgramType::ETC1_GRAY : backend::ProgramType::GRAY_SCALE); _slidBallNormalRenderer->setVisible(true); } else diff --git a/cocos/ui/UIWidget.cpp b/cocos/ui/UIWidget.cpp index 8a1cdcf3..3227dbd5 100644 --- a/cocos/ui/UIWidget.cpp +++ b/cocos/ui/UIWidget.cpp @@ -250,8 +250,10 @@ Widget* Widget::getWidgetParent() void Widget::setEnabled(bool enabled) { - _enabled = enabled; - setBright(enabled); + if (_enabled != enabled) { + _enabled = enabled; + setBright(enabled); + } } void Widget::initRenderer() @@ -355,9 +357,10 @@ void Widget::setSizePercent(const Vec2 &percent) void Widget::updateSizeAndPosition() { - Size pSize = _parent->getContentSize(); - - updateSizeAndPosition(pSize); + if (_parent) { + Size pSize = _parent->getContentSize(); + updateSizeAndPosition(pSize); + } } void Widget::updateSizeAndPosition(const cocos2d::Size &parentSize) @@ -811,6 +814,9 @@ void Widget::onTouchMoved(Touch *touch, Event* /*unusedEvent*/) void Widget::onTouchEnded(Touch *touch, Event* /*unusedEvent*/) { + // if self be released in propagateTouchEvent, may crash at setHighlighted. + // use retain() to avoid such case. + this->retain(); _touchEndPosition = touch->getLocation(); /* @@ -832,6 +838,7 @@ void Widget::onTouchEnded(Touch *touch, Event* /*unusedEvent*/) { cancelUpEvent(); } + this->release(); } void Widget::onTouchCancelled(Touch* touch, Event* /*unusedEvent*/) diff --git a/external/Box2D/prebuilt/mac/libbox2d.a b/external/Box2D/prebuilt/mac/libbox2d.a index 363b9f3e..4e0f5f79 100644 Binary files a/external/Box2D/prebuilt/mac/libbox2d.a and b/external/Box2D/prebuilt/mac/libbox2d.a differ diff --git a/external/OpenAL/prebuilt/linux/64-bit/libcommon.a b/external/OpenAL/prebuilt/linux/64-bit/libcommon.a index 5aea8a62..710b05db 100644 Binary files a/external/OpenAL/prebuilt/linux/64-bit/libcommon.a and b/external/OpenAL/prebuilt/linux/64-bit/libcommon.a differ diff --git a/external/OpenAL/prebuilt/linux/64-bit/libopenal.a b/external/OpenAL/prebuilt/linux/64-bit/libopenal.a index 014cb526..0cceb23d 100644 Binary files a/external/OpenAL/prebuilt/linux/64-bit/libopenal.a and b/external/OpenAL/prebuilt/linux/64-bit/libopenal.a differ diff --git a/external/OpenAL/prebuilt/mac/libcommon.a b/external/OpenAL/prebuilt/mac/libcommon.a index cf22a751..00628cca 100644 Binary files a/external/OpenAL/prebuilt/mac/libcommon.a and b/external/OpenAL/prebuilt/mac/libcommon.a differ diff --git a/external/OpenAL/prebuilt/mac/libopenal.a b/external/OpenAL/prebuilt/mac/libopenal.a index 8da6eb66..71b14fdc 100644 Binary files a/external/OpenAL/prebuilt/mac/libopenal.a and b/external/OpenAL/prebuilt/mac/libopenal.a differ diff --git a/external/bullet/prebuilt/mac/libBulletCollision.a b/external/bullet/prebuilt/mac/libBulletCollision.a index 408276b4..3d6abb68 100644 Binary files a/external/bullet/prebuilt/mac/libBulletCollision.a and b/external/bullet/prebuilt/mac/libBulletCollision.a differ diff --git a/external/bullet/prebuilt/mac/libBulletDynamics.a b/external/bullet/prebuilt/mac/libBulletDynamics.a index 6a72a157..d1ac177f 100644 Binary files a/external/bullet/prebuilt/mac/libBulletDynamics.a and b/external/bullet/prebuilt/mac/libBulletDynamics.a differ diff --git a/external/bullet/prebuilt/mac/libBulletMultiThreaded.a b/external/bullet/prebuilt/mac/libBulletMultiThreaded.a index 57ef298b..8847bb9c 100644 Binary files a/external/bullet/prebuilt/mac/libBulletMultiThreaded.a and b/external/bullet/prebuilt/mac/libBulletMultiThreaded.a differ diff --git a/external/bullet/prebuilt/mac/libLinearMath.a b/external/bullet/prebuilt/mac/libLinearMath.a index 81b095ba..76fe8949 100644 Binary files a/external/bullet/prebuilt/mac/libLinearMath.a and b/external/bullet/prebuilt/mac/libLinearMath.a differ diff --git a/external/bullet/prebuilt/mac/libMiniCL.a b/external/bullet/prebuilt/mac/libMiniCL.a index 687ae2df..62642605 100644 Binary files a/external/bullet/prebuilt/mac/libMiniCL.a and b/external/bullet/prebuilt/mac/libMiniCL.a differ diff --git a/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a b/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a index 9fa4ea6e..b6c4b7a6 100644 Binary files a/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a and b/external/chipmunk/prebuilt/linux/64-bit/libchipmunk.a differ diff --git a/external/chipmunk/prebuilt/mac/libchipmunk.a b/external/chipmunk/prebuilt/mac/libchipmunk.a index 32231a51..cb47a284 100644 Binary files a/external/chipmunk/prebuilt/mac/libchipmunk.a and b/external/chipmunk/prebuilt/mac/libchipmunk.a differ diff --git a/external/curl/prebuilt/mac/libcurl.a b/external/curl/prebuilt/mac/libcurl.a index 0166c854..fae44cbe 100644 Binary files a/external/curl/prebuilt/mac/libcurl.a and b/external/curl/prebuilt/mac/libcurl.a differ diff --git a/external/freetype2/prebuilt/mac/libfreetype.a b/external/freetype2/prebuilt/mac/libfreetype.a index 5ea37816..55022499 100644 Binary files a/external/freetype2/prebuilt/mac/libfreetype.a and b/external/freetype2/prebuilt/mac/libfreetype.a differ diff --git a/external/glfw3/include/linux/glfw3.h b/external/glfw3/include/linux/glfw3.h index 0521d198..c8d7cfaf 100644 --- a/external/glfw3/include/linux/glfw3.h +++ b/external/glfw3/include/linux/glfw3.h @@ -52,7 +52,7 @@ extern "C" { * This is the reference documentation for OpenGL and OpenGL ES context related * functions. For more task-oriented information, see the @ref context_guide. */ -/*! @defgroup vulkan Vulkan reference +/*! @defgroup vulkan Vulkan support reference * @brief Functions and types related to Vulkan. * * This is the reference documentation for Vulkan related functions and types. @@ -96,11 +96,30 @@ extern "C" { #define _WIN32 #endif /* _WIN32 */ +/* Include because most Windows GLU headers need wchar_t and + * the macOS OpenGL header blocks the definition of ptrdiff_t by glext.h. + * Include it unconditionally to avoid surprising side-effects. + */ +#include + +/* Include because it is needed by Vulkan and related functions. + * Include it unconditionally to avoid surprising side-effects. + */ +#include + +#if defined(GLFW_INCLUDE_VULKAN) + #include +#endif /* Vulkan header */ + +/* The Vulkan header may have indirectly included windows.h (because of + * VK_USE_PLATFORM_WIN32_KHR) so we offer our replacement symbols after it. + */ + /* It is customary to use APIENTRY for OpenGL function pointer declarations on * all platforms. Additionally, the Windows OpenGL header needs APIENTRY. */ -#ifndef APIENTRY - #ifdef _WIN32 +#if !defined(APIENTRY) + #if defined(_WIN32) #define APIENTRY __stdcall #else #define APIENTRY @@ -122,17 +141,6 @@ extern "C" { #define GLFW_CALLBACK_DEFINED #endif /* CALLBACK */ -/* Include because most Windows GLU headers need wchar_t and - * the macOS OpenGL header blocks the definition of ptrdiff_t by glext.h. - * Include it unconditionally to avoid surprising side-effects. - */ -#include - -/* Include because it is needed by Vulkan and related functions. - * Include it unconditionally to avoid surprising side-effects. - */ -#include - /* Include the chosen OpenGL or OpenGL ES headers. */ #if defined(GLFW_INCLUDE_ES1) @@ -185,7 +193,38 @@ extern "C" { #endif /*__APPLE__*/ -#elif !defined(GLFW_INCLUDE_NONE) +#elif defined(GLFW_INCLUDE_GLU) + + #if defined(__APPLE__) + + #if defined(GLFW_INCLUDE_GLU) + #include + #endif + + #else /*__APPLE__*/ + + #if defined(GLFW_INCLUDE_GLU) + #include + #endif + + #endif /*__APPLE__*/ + +#elif !defined(GLFW_INCLUDE_NONE) && \ + !defined(__gl_h_) && \ + !defined(__gles1_gl_h_) && \ + !defined(__gles2_gl2_h_) && \ + !defined(__gles2_gl3_h_) && \ + !defined(__gles2_gl31_h_) && \ + !defined(__gles2_gl32_h_) && \ + !defined(__gl_glcorearb_h_) && \ + !defined(__gl2_h_) /*legacy*/ && \ + !defined(__gl3_h_) /*legacy*/ && \ + !defined(__gl31_h_) /*legacy*/ && \ + !defined(__gl32_h_) /*legacy*/ && \ + !defined(__glcorearb_h_) /*legacy*/ && \ + !defined(__GL_H__) /*non-standard*/ && \ + !defined(__gltypes_h_) /*non-standard*/ && \ + !defined(__glee_h_) /*non-standard*/ #if defined(__APPLE__) @@ -193,9 +232,6 @@ extern "C" { #define GL_GLEXT_LEGACY #endif #include - #if defined(GLFW_INCLUDE_GLU) - #include - #endif #else /*__APPLE__*/ @@ -203,18 +239,11 @@ extern "C" { #if defined(GLFW_INCLUDE_GLEXT) #include #endif - #if defined(GLFW_INCLUDE_GLU) - #include - #endif #endif /*__APPLE__*/ #endif /* OpenGL and OpenGL ES headers */ -#if defined(GLFW_INCLUDE_VULKAN) - #include -#endif /* Vulkan header */ - #if defined(GLFW_DLL) && defined(_GLFW_BUILD_DLL) /* GLFW_DLL must be defined by applications that are linking against the DLL * version of the GLFW library. _GLFW_BUILD_DLL is defined by the GLFW @@ -266,7 +295,7 @@ extern "C" { * API changes. * @ingroup init */ -#define GLFW_VERSION_REVISION 0 +#define GLFW_VERSION_REVISION 4 /*! @} */ /*! @brief One. @@ -917,62 +946,62 @@ extern "C" { #define GLFW_CLIENT_API 0x00022001 /*! @brief Context client API major version hint and attribute. * - * Context client API major version [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * Context client API major version [hint](@ref GLFW_CONTEXT_VERSION_MAJOR_hint) + * and [attribute](@ref GLFW_CONTEXT_VERSION_MAJOR_attrib). */ #define GLFW_CONTEXT_VERSION_MAJOR 0x00022002 /*! @brief Context client API minor version hint and attribute. * - * Context client API minor version [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * Context client API minor version [hint](@ref GLFW_CONTEXT_VERSION_MINOR_hint) + * and [attribute](@ref GLFW_CONTEXT_VERSION_MINOR_attrib). */ #define GLFW_CONTEXT_VERSION_MINOR 0x00022003 /*! @brief Context client API revision number hint and attribute. * - * Context client API revision number [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * Context client API revision number + * [attribute](@ref GLFW_CONTEXT_REVISION_attrib). */ #define GLFW_CONTEXT_REVISION 0x00022004 /*! @brief Context robustness hint and attribute. * - * Context client API revision number [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * Context client API revision number [hint](@ref GLFW_CONTEXT_ROBUSTNESS_hint) + * and [attribute](@ref GLFW_CONTEXT_ROBUSTNESS_attrib). */ #define GLFW_CONTEXT_ROBUSTNESS 0x00022005 /*! @brief OpenGL forward-compatibility hint and attribute. * - * OpenGL forward-compatibility [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * OpenGL forward-compatibility [hint](@ref GLFW_OPENGL_FORWARD_COMPAT_hint) + * and [attribute](@ref GLFW_OPENGL_FORWARD_COMPAT_attrib). */ #define GLFW_OPENGL_FORWARD_COMPAT 0x00022006 -/*! @brief OpenGL debug context hint and attribute. +/*! @brief Debug mode context hint and attribute. * - * OpenGL debug context [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * Debug mode context [hint](@ref GLFW_OPENGL_DEBUG_CONTEXT_hint) and + * [attribute](@ref GLFW_OPENGL_DEBUG_CONTEXT_attrib). */ #define GLFW_OPENGL_DEBUG_CONTEXT 0x00022007 /*! @brief OpenGL profile hint and attribute. * - * OpenGL profile [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * OpenGL profile [hint](@ref GLFW_OPENGL_PROFILE_hint) and + * [attribute](@ref GLFW_OPENGL_PROFILE_attrib). */ #define GLFW_OPENGL_PROFILE 0x00022008 /*! @brief Context flush-on-release hint and attribute. * - * Context flush-on-release [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * Context flush-on-release [hint](@ref GLFW_CONTEXT_RELEASE_BEHAVIOR_hint) and + * [attribute](@ref GLFW_CONTEXT_RELEASE_BEHAVIOR_attrib). */ #define GLFW_CONTEXT_RELEASE_BEHAVIOR 0x00022009 /*! @brief Context error suppression hint and attribute. * - * Context error suppression [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * Context error suppression [hint](@ref GLFW_CONTEXT_NO_ERROR_hint) and + * [attribute](@ref GLFW_CONTEXT_NO_ERROR_attrib). */ #define GLFW_CONTEXT_NO_ERROR 0x0002200A /*! @brief Context creation API hint and attribute. * - * Context creation API [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * Context creation API [hint](@ref GLFW_CONTEXT_CREATION_API_hint) and + * [attribute](@ref GLFW_CONTEXT_CREATION_API_attrib). */ #define GLFW_CONTEXT_CREATION_API 0x0002200B /*! @brief Window content area scaling window @@ -1164,13 +1193,21 @@ typedef struct GLFWwindow GLFWwindow; */ typedef struct GLFWcursor GLFWcursor; -/*! @brief The function signature for error callbacks. +/*! @brief The function pointer type for error callbacks. * - * This is the function signature for error callback functions. + * This is the function pointer type for error callbacks. An error callback + * function has the following signature: + * @code + * void callback_name(int error_code, const char* description) + * @endcode * - * @param[in] error An [error code](@ref errors). + * @param[in] error_code An [error code](@ref errors). Future releases may add + * more error codes. * @param[in] description A UTF-8 encoded string describing the error. * + * @pointer_lifetime The error description string is valid until the callback + * function returns. + * * @sa @ref error_handling * @sa @ref glfwSetErrorCallback * @@ -1180,9 +1217,13 @@ typedef struct GLFWcursor GLFWcursor; */ typedef void (* GLFWerrorfun)(int,const char*); -/*! @brief The function signature for window position callbacks. +/*! @brief The function pointer type for window position callbacks. * - * This is the function signature for window position callback functions. + * This is the function pointer type for window position callbacks. A window + * position callback function has the following signature: + * @code + * void callback_name(GLFWwindow* window, int xpos, int ypos) + * @endcode * * @param[in] window The window that was moved. * @param[in] xpos The new x-coordinate, in screen coordinates, of the @@ -1199,9 +1240,13 @@ typedef void (* GLFWerrorfun)(int,const char*); */ typedef void (* GLFWwindowposfun)(GLFWwindow*,int,int); -/*! @brief The function signature for window resize callbacks. +/*! @brief The function pointer type for window size callbacks. * - * This is the function signature for window size callback functions. + * This is the function pointer type for window size callbacks. A window size + * callback function has the following signature: + * @code + * void callback_name(GLFWwindow* window, int width, int height) + * @endcode * * @param[in] window The window that was resized. * @param[in] width The new width, in screen coordinates, of the window. @@ -1217,9 +1262,13 @@ typedef void (* GLFWwindowposfun)(GLFWwindow*,int,int); */ typedef void (* GLFWwindowsizefun)(GLFWwindow*,int,int); -/*! @brief The function signature for window close callbacks. +/*! @brief The function pointer type for window close callbacks. * - * This is the function signature for window close callback functions. + * This is the function pointer type for window close callbacks. A window + * close callback function has the following signature: + * @code + * void function_name(GLFWwindow* window) + * @endcode * * @param[in] window The window that the user attempted to close. * @@ -1233,9 +1282,13 @@ typedef void (* GLFWwindowsizefun)(GLFWwindow*,int,int); */ typedef void (* GLFWwindowclosefun)(GLFWwindow*); -/*! @brief The function signature for window content refresh callbacks. +/*! @brief The function pointer type for window content refresh callbacks. * - * This is the function signature for window refresh callback functions. + * This is the function pointer type for window content refresh callbacks. + * A window content refresh callback function has the following signature: + * @code + * void function_name(GLFWwindow* window); + * @endcode * * @param[in] window The window whose content needs to be refreshed. * @@ -1249,9 +1302,13 @@ typedef void (* GLFWwindowclosefun)(GLFWwindow*); */ typedef void (* GLFWwindowrefreshfun)(GLFWwindow*); -/*! @brief The function signature for window focus/defocus callbacks. +/*! @brief The function pointer type for window focus callbacks. * - * This is the function signature for window focus callback functions. + * This is the function pointer type for window focus callbacks. A window + * focus callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, int focused) + * @endcode * * @param[in] window The window that gained or lost input focus. * @param[in] focused `GLFW_TRUE` if the window was given input focus, or @@ -1266,10 +1323,13 @@ typedef void (* GLFWwindowrefreshfun)(GLFWwindow*); */ typedef void (* GLFWwindowfocusfun)(GLFWwindow*,int); -/*! @brief The function signature for window iconify/restore callbacks. +/*! @brief The function pointer type for window iconify callbacks. * - * This is the function signature for window iconify/restore callback - * functions. + * This is the function pointer type for window iconify callbacks. A window + * iconify callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, int iconified) + * @endcode * * @param[in] window The window that was iconified or restored. * @param[in] iconified `GLFW_TRUE` if the window was iconified, or @@ -1284,13 +1344,16 @@ typedef void (* GLFWwindowfocusfun)(GLFWwindow*,int); */ typedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int); -/*! @brief The function signature for window maximize/restore callbacks. +/*! @brief The function pointer type for window maximize callbacks. * - * This is the function signature for window maximize/restore callback - * functions. + * This is the function pointer type for window maximize callbacks. A window + * maximize callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, int maximized) + * @endcode * * @param[in] window The window that was maximized or restored. - * @param[in] iconified `GLFW_TRUE` if the window was maximized, or + * @param[in] maximized `GLFW_TRUE` if the window was maximized, or * `GLFW_FALSE` if it was restored. * * @sa @ref window_maximize @@ -1302,10 +1365,13 @@ typedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int); */ typedef void (* GLFWwindowmaximizefun)(GLFWwindow*,int); -/*! @brief The function signature for framebuffer resize callbacks. +/*! @brief The function pointer type for framebuffer size callbacks. * - * This is the function signature for framebuffer resize callback - * functions. + * This is the function pointer type for framebuffer size callbacks. + * A framebuffer size callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, int width, int height) + * @endcode * * @param[in] window The window whose framebuffer was resized. * @param[in] width The new width, in pixels, of the framebuffer. @@ -1320,10 +1386,13 @@ typedef void (* GLFWwindowmaximizefun)(GLFWwindow*,int); */ typedef void (* GLFWframebuffersizefun)(GLFWwindow*,int,int); -/*! @brief The function signature for window content scale callbacks. +/*! @brief The function pointer type for window content scale callbacks. * - * This is the function signature for window content scale callback - * functions. + * This is the function pointer type for window content scale callbacks. + * A window content scale callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, float xscale, float yscale) + * @endcode * * @param[in] window The window whose content scale changed. * @param[in] xscale The new x-axis content scale of the window. @@ -1338,14 +1407,19 @@ typedef void (* GLFWframebuffersizefun)(GLFWwindow*,int,int); */ typedef void (* GLFWwindowcontentscalefun)(GLFWwindow*,float,float); -/*! @brief The function signature for mouse button callbacks. +/*! @brief The function pointer type for mouse button callbacks. * - * This is the function signature for mouse button callback functions. + * This is the function pointer type for mouse button callback functions. + * A mouse button callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, int button, int action, int mods) + * @endcode * * @param[in] window The window that received the event. * @param[in] button The [mouse button](@ref buttons) that was pressed or * released. - * @param[in] action One of `GLFW_PRESS` or `GLFW_RELEASE`. + * @param[in] action One of `GLFW_PRESS` or `GLFW_RELEASE`. Future releases + * may add more actions. * @param[in] mods Bit field describing which [modifier keys](@ref mods) were * held down. * @@ -1359,9 +1433,13 @@ typedef void (* GLFWwindowcontentscalefun)(GLFWwindow*,float,float); */ typedef void (* GLFWmousebuttonfun)(GLFWwindow*,int,int,int); -/*! @brief The function signature for cursor position callbacks. +/*! @brief The function pointer type for cursor position callbacks. * - * This is the function signature for cursor position callback functions. + * This is the function pointer type for cursor position callbacks. A cursor + * position callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, double xpos, double ypos); + * @endcode * * @param[in] window The window that received the event. * @param[in] xpos The new cursor x-coordinate, relative to the left edge of @@ -1378,9 +1456,13 @@ typedef void (* GLFWmousebuttonfun)(GLFWwindow*,int,int,int); */ typedef void (* GLFWcursorposfun)(GLFWwindow*,double,double); -/*! @brief The function signature for cursor enter/leave callbacks. +/*! @brief The function pointer type for cursor enter/leave callbacks. * - * This is the function signature for cursor enter/leave callback functions. + * This is the function pointer type for cursor enter/leave callbacks. + * A cursor enter/leave callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, int entered) + * @endcode * * @param[in] window The window that received the event. * @param[in] entered `GLFW_TRUE` if the cursor entered the window's content @@ -1395,9 +1477,13 @@ typedef void (* GLFWcursorposfun)(GLFWwindow*,double,double); */ typedef void (* GLFWcursorenterfun)(GLFWwindow*,int); -/*! @brief The function signature for scroll callbacks. +/*! @brief The function pointer type for scroll callbacks. * - * This is the function signature for scroll callback functions. + * This is the function pointer type for scroll callbacks. A scroll callback + * function has the following signature: + * @code + * void function_name(GLFWwindow* window, double xoffset, double yoffset) + * @endcode * * @param[in] window The window that received the event. * @param[in] xoffset The scroll offset along the x-axis. @@ -1412,14 +1498,19 @@ typedef void (* GLFWcursorenterfun)(GLFWwindow*,int); */ typedef void (* GLFWscrollfun)(GLFWwindow*,double,double); -/*! @brief The function signature for keyboard key callbacks. +/*! @brief The function pointer type for keyboard key callbacks. * - * This is the function signature for keyboard key callback functions. + * This is the function pointer type for keyboard key callbacks. A keyboard + * key callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, int key, int scancode, int action, int mods) + * @endcode * * @param[in] window The window that received the event. * @param[in] key The [keyboard key](@ref keys) that was pressed or released. * @param[in] scancode The system-specific scancode of the key. - * @param[in] action `GLFW_PRESS`, `GLFW_RELEASE` or `GLFW_REPEAT`. + * @param[in] action `GLFW_PRESS`, `GLFW_RELEASE` or `GLFW_REPEAT`. Future + * releases may add more actions. * @param[in] mods Bit field describing which [modifier keys](@ref mods) were * held down. * @@ -1433,9 +1524,13 @@ typedef void (* GLFWscrollfun)(GLFWwindow*,double,double); */ typedef void (* GLFWkeyfun)(GLFWwindow*,int,int,int,int); -/*! @brief The function signature for Unicode character callbacks. +/*! @brief The function pointer type for Unicode character callbacks. * - * This is the function signature for Unicode character callback functions. + * This is the function pointer type for Unicode character callbacks. + * A Unicode character callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, unsigned int codepoint) + * @endcode * * @param[in] window The window that received the event. * @param[in] codepoint The Unicode code point of the character. @@ -1450,12 +1545,16 @@ typedef void (* GLFWkeyfun)(GLFWwindow*,int,int,int,int); */ typedef void (* GLFWcharfun)(GLFWwindow*,unsigned int); -/*! @brief The function signature for Unicode character with modifiers +/*! @brief The function pointer type for Unicode character with modifiers * callbacks. * - * This is the function signature for Unicode character with modifiers callback - * functions. It is called for each input character, regardless of what - * modifier keys are held down. + * This is the function pointer type for Unicode character with modifiers + * callbacks. It is called for each input character, regardless of what + * modifier keys are held down. A Unicode character with modifiers callback + * function has the following signature: + * @code + * void function_name(GLFWwindow* window, unsigned int codepoint, int mods) + * @endcode * * @param[in] window The window that received the event. * @param[in] codepoint The Unicode code point of the character. @@ -1473,14 +1572,21 @@ typedef void (* GLFWcharfun)(GLFWwindow*,unsigned int); */ typedef void (* GLFWcharmodsfun)(GLFWwindow*,unsigned int,int); -/*! @brief The function signature for file drop callbacks. +/*! @brief The function pointer type for path drop callbacks. * - * This is the function signature for file drop callbacks. + * This is the function pointer type for path drop callbacks. A path drop + * callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, int path_count, const char* paths[]) + * @endcode * * @param[in] window The window that received the event. - * @param[in] count The number of dropped files. + * @param[in] path_count The number of dropped paths. * @param[in] paths The UTF-8 encoded file and/or directory path names. * + * @pointer_lifetime The path array and its strings are valid until the + * callback function returns. + * * @sa @ref path_drop * @sa @ref glfwSetDropCallback * @@ -1488,15 +1594,19 @@ typedef void (* GLFWcharmodsfun)(GLFWwindow*,unsigned int,int); * * @ingroup input */ -typedef void (* GLFWdropfun)(GLFWwindow*,int,const char**); +typedef void (* GLFWdropfun)(GLFWwindow*,int,const char*[]); -/*! @brief The function signature for monitor configuration callbacks. +/*! @brief The function pointer type for monitor configuration callbacks. * - * This is the function signature for monitor configuration callback functions. + * This is the function pointer type for monitor configuration callbacks. + * A monitor callback function has the following signature: + * @code + * void function_name(GLFWmonitor* monitor, int event) + * @endcode * * @param[in] monitor The monitor that was connected or disconnected. - * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. Remaining - * values reserved for future use. + * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. Future + * releases may add more events. * * @sa @ref monitor_event * @sa @ref glfwSetMonitorCallback @@ -1507,14 +1617,17 @@ typedef void (* GLFWdropfun)(GLFWwindow*,int,const char**); */ typedef void (* GLFWmonitorfun)(GLFWmonitor*,int); -/*! @brief The function signature for joystick configuration callbacks. +/*! @brief The function pointer type for joystick configuration callbacks. * - * This is the function signature for joystick configuration callback - * functions. + * This is the function pointer type for joystick configuration callbacks. + * A joystick configuration callback function has the following signature: + * @code + * void function_name(int jid, int event) + * @endcode * * @param[in] jid The joystick that was connected or disconnected. - * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. Remaining - * values reserved for future use. + * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. Future + * releases may add more events. * * @sa @ref joystick_event * @sa @ref glfwSetJoystickCallback @@ -1665,6 +1778,10 @@ typedef struct GLFWgamepadstate * bundle, if present. This can be disabled with the @ref * GLFW_COCOA_CHDIR_RESOURCES init hint. * + * @remark @x11 This function will set the `LC_CTYPE` category of the + * application locale according to the current environment if that category is + * still "C". This is because the "C" locale breaks Unicode text input. + * * @thread_safety This function must only be called from the main thread. * * @sa @ref intro_init @@ -1688,6 +1805,8 @@ GLFWAPI int glfwInit(void); * call this function, as it is called by @ref glfwInit before it returns * failure. * + * This function has no effect if GLFW is not initialized. + * * @errors Possible errors include @ref GLFW_PLATFORM_ERROR. * * @remark This function may be called before @ref glfwInit. @@ -1849,10 +1968,17 @@ GLFWAPI int glfwGetError(const char** description); * Once set, the error callback remains set even after the library has been * terminated. * - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set. * + * @callback_signature + * @code + * void callback_name(int error_code, const char* description) + * @endcode + * For more information about the callback parameters, see the + * [callback pointer type](@ref GLFWerrorfun). + * * @errors None. * * @remark This function may be called before @ref glfwInit. @@ -1866,7 +1992,7 @@ GLFWAPI int glfwGetError(const char** description); * * @ingroup init */ -GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun); +GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun callback); /*! @brief Returns the currently connected monitors. * @@ -1946,7 +2072,7 @@ GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void); */ GLFWAPI void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos); -/*! @brief Retrives the work area of the monitor. +/*! @brief Retrieves the work area of the monitor. * * This function returns the position, in screen coordinates, of the upper-left * corner of the work area of the specified monitor along with the work area @@ -2125,11 +2251,18 @@ GLFWAPI void* glfwGetMonitorUserPointer(GLFWmonitor* monitor); * currently set callback. This is called when a monitor is connected to or * disconnected from the system. * - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWmonitor* monitor, int event) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWmonitorfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -2140,7 +2273,7 @@ GLFWAPI void* glfwGetMonitorUserPointer(GLFWmonitor* monitor); * * @ingroup monitor */ -GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun); +GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun callback); /*! @brief Returns the available video modes for the specified monitor. * @@ -2223,7 +2356,7 @@ GLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor); * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref * GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR. * - * @remark @wayland Gamma handling is a priviledged protocol, this function + * @remark @wayland Gamma handling is a privileged protocol, this function * will thus never be implemented and emits @ref GLFW_PLATFORM_ERROR. * * @thread_safety This function must only be called from the main thread. @@ -2247,7 +2380,7 @@ GLFWAPI void glfwSetGamma(GLFWmonitor* monitor, float gamma); * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref * GLFW_PLATFORM_ERROR. * - * @remark @wayland Gamma handling is a priviledged protocol, this function + * @remark @wayland Gamma handling is a privileged protocol, this function * will thus never be implemented and emits @ref GLFW_PLATFORM_ERROR while * returning `NULL`. * @@ -2291,7 +2424,7 @@ GLFWAPI const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* monitor); * * @remark @win32 The gamma ramp size must be 256. * - * @remark @wayland Gamma handling is a priviledged protocol, this function + * @remark @wayland Gamma handling is a privileged protocol, this function * will thus never be implemented and emits @ref GLFW_PLATFORM_ERROR. * * @pointer_lifetime The specified gamma ramp is copied before this function @@ -2510,7 +2643,7 @@ GLFWAPI void glfwWindowHintString(int hint, const char* value); * * @remark @macos When activating frame autosaving with * [GLFW_COCOA_FRAME_NAME](@ref GLFW_COCOA_FRAME_NAME_hint), the specified - * window size and position may be overriden by previously saved values. + * window size and position may be overridden by previously saved values. * * @remark @x11 Some window managers will not respect the placement of * initially hidden windows. @@ -3477,11 +3610,18 @@ GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* window); * area of the window. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int xpos, int ypos) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWwindowposfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @remark @wayland This callback will never be called, as there is no way for @@ -3495,7 +3635,7 @@ GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* window); * * @ingroup window */ -GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindowposfun cbfun); +GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindowposfun callback); /*! @brief Sets the size callback for the specified window. * @@ -3504,11 +3644,18 @@ GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindow * in screen coordinates, of the content area of the window. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int width, int height) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWwindowsizefun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -3520,7 +3667,7 @@ GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindow * * @ingroup window */ -GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun cbfun); +GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun callback); /*! @brief Sets the close callback for the specified window. * @@ -3534,11 +3681,18 @@ GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwind * The close callback is not triggered by @ref glfwDestroyWindow. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWwindowclosefun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @remark @macos Selecting Quit from the application menu will trigger the @@ -3553,7 +3707,7 @@ GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwind * * @ingroup window */ -GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwindowclosefun cbfun); +GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwindowclosefun callback); /*! @brief Sets the refresh callback for the specified window. * @@ -3566,11 +3720,18 @@ GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwi * very infrequently or never at all. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window); + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWwindowrefreshfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -3582,7 +3743,7 @@ GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwi * * @ingroup window */ -GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GLFWwindowrefreshfun cbfun); +GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GLFWwindowrefreshfun callback); /*! @brief Sets the focus callback for the specified window. * @@ -3595,11 +3756,18 @@ GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GL * and @ref glfwSetMouseButtonCallback. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int focused) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWwindowfocusfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -3610,7 +3778,7 @@ GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GL * * @ingroup window */ -GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwindowfocusfun cbfun); +GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwindowfocusfun callback); /*! @brief Sets the iconify callback for the specified window. * @@ -3618,11 +3786,18 @@ GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwi * is called when the window is iconified or restored. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int iconified) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWwindowiconifyfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @remark @wayland The wl_shell protocol has no concept of iconification, @@ -3636,7 +3811,7 @@ GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwi * * @ingroup window */ -GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GLFWwindowiconifyfun cbfun); +GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GLFWwindowiconifyfun callback); /*! @brief Sets the maximize callback for the specified window. * @@ -3644,11 +3819,18 @@ GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GL * is called when the window is maximized or restored. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int maximized) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWwindowmaximizefun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -3659,7 +3841,7 @@ GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GL * * @ingroup window */ -GLFWAPI GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow* window, GLFWwindowmaximizefun cbfun); +GLFWAPI GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow* window, GLFWwindowmaximizefun callback); /*! @brief Sets the framebuffer resize callback for the specified window. * @@ -3667,11 +3849,18 @@ GLFWAPI GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow* window, * which is called when the framebuffer of the specified window is resized. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int width, int height) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWframebuffersizefun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -3682,7 +3871,7 @@ GLFWAPI GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow* window, * * @ingroup window */ -GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window, GLFWframebuffersizefun cbfun); +GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window, GLFWframebuffersizefun callback); /*! @brief Sets the window content scale callback for the specified window. * @@ -3690,11 +3879,18 @@ GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window * which is called when the content scale of the specified window changes. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, float xscale, float yscale) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWwindowcontentscalefun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -3706,7 +3902,7 @@ GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window * * @ingroup window */ -GLFWAPI GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(GLFWwindow* window, GLFWwindowcontentscalefun cbfun); +GLFWAPI GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(GLFWwindow* window, GLFWwindowcontentscalefun callback); /*! @brief Processes all pending events. * @@ -4028,9 +4224,11 @@ GLFWAPI int glfwRawMouseMotionSupported(void); * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref * GLFW_PLATFORM_ERROR. * + * @remark The contents of the returned string may change when a keyboard + * layout change event is received. + * * @pointer_lifetime The returned string is allocated and freed by GLFW. You - * should not free it yourself. It is valid until the next call to @ref - * glfwGetKeyName, or until the library is terminated. + * should not free it yourself. It is valid until the library is terminated. * * @thread_safety This function must only be called from the main thread. * @@ -4353,11 +4551,18 @@ GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor); * scancode may be zero. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new key callback, or `NULL` to remove the currently + * @param[in] callback The new key callback, or `NULL` to remove the currently * set callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int key, int scancode, int action, int mods) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWkeyfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -4369,7 +4574,7 @@ GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor); * * @ingroup input */ -GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun); +GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun callback); /*! @brief Sets the Unicode character callback. * @@ -4389,11 +4594,18 @@ GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun); * on Windows. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, unsigned int codepoint) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWcharfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -4405,7 +4617,7 @@ GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun); * * @ingroup input */ -GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun); +GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun callback); /*! @brief Sets the Unicode character with modifiers callback. * @@ -4423,11 +4635,18 @@ GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun); * [key callback](@ref glfwSetKeyCallback) instead. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or an * [error](@ref error_handling) occurred. * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, unsigned int codepoint, int mods) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWcharmodsfun). + * * @deprecated Scheduled for removal in version 4.0. * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. @@ -4440,7 +4659,7 @@ GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun); * * @ingroup input */ -GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmodsfun cbfun); +GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmodsfun callback); /*! @brief Sets the mouse button callback. * @@ -4454,11 +4673,18 @@ GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmods * [window focus callback](@ref glfwSetWindowFocusCallback) has been called. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int button, int action, int mods) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWmousebuttonfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -4470,7 +4696,7 @@ GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmods * * @ingroup input */ -GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmousebuttonfun cbfun); +GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmousebuttonfun callback); /*! @brief Sets the cursor position callback. * @@ -4480,11 +4706,18 @@ GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmo * content area of the window. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, double xpos, double ypos); + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWcursorposfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -4495,20 +4728,27 @@ GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmo * * @ingroup input */ -GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursorposfun cbfun); +GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursorposfun callback); -/*! @brief Sets the cursor enter/exit callback. +/*! @brief Sets the cursor enter/leave callback. * * This function sets the cursor boundary crossing callback of the specified * window, which is called when the cursor enters or leaves the content area of * the window. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int entered) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWcursorenterfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -4519,7 +4759,7 @@ GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursor * * @ingroup input */ -GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcursorenterfun cbfun); +GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcursorenterfun callback); /*! @brief Sets the scroll callback. * @@ -4531,11 +4771,18 @@ GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcu * wheel or a touchpad scrolling area. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new scroll callback, or `NULL` to remove the currently - * set callback. + * @param[in] callback The new scroll callback, or `NULL` to remove the + * currently set callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, double xoffset, double yoffset) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWscrollfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -4546,12 +4793,12 @@ GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcu * * @ingroup input */ -GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cbfun); +GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun callback); -/*! @brief Sets the file drop callback. +/*! @brief Sets the path drop callback. * - * This function sets the file drop callback of the specified window, which is - * called when one or more dragged files are dropped on the window. + * This function sets the path drop callback of the specified window, which is + * called when one or more dragged paths are dropped on the window. * * Because the path array and its strings may have been generated specifically * for that event, they are not guaranteed to be valid after the callback has @@ -4559,11 +4806,18 @@ GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cb * make a deep copy. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new file drop callback, or `NULL` to remove the + * @param[in] callback The new file drop callback, or `NULL` to remove the * currently set callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int path_count, const char* paths[]) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWdropfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @remark @wayland File drop is currently unimplemented. @@ -4576,7 +4830,7 @@ GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cb * * @ingroup input */ -GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun cbfun); +GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun callback); /*! @brief Returns whether the specified joystick is present. * @@ -4764,7 +5018,7 @@ GLFWAPI const unsigned char* glfwGetJoystickHats(int jid, int* count); */ GLFWAPI const char* glfwGetJoystickName(int jid); -/*! @brief Returns the SDL comaptible GUID of the specified joystick. +/*! @brief Returns the SDL compatible GUID of the specified joystick. * * This function returns the SDL compatible GUID, as a UTF-8 encoded * hexadecimal string, of the specified joystick. The returned string is @@ -4895,11 +5149,18 @@ GLFWAPI int glfwJoystickIsGamepad(int jid); * called by joystick functions. The function will then return whatever it * returns if the joystick is not present. * - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(int jid, int event) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWjoystickfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -4910,7 +5171,7 @@ GLFWAPI int glfwJoystickIsGamepad(int jid); * * @ingroup input */ -GLFWAPI GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun cbfun); +GLFWAPI GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun callback); /*! @brief Adds the specified SDL_GameControllerDB gamepad mappings. * @@ -4978,7 +5239,7 @@ GLFWAPI const char* glfwGetGamepadName(int jid); /*! @brief Retrieves the state of the specified joystick remapped as a gamepad. * - * This function retrives the state of the specified joystick remapped to + * This function retrieves the state of the specified joystick remapped to * an Xbox-like gamepad. * * If the specified joystick is not present or does not have a gamepad mapping @@ -5069,23 +5330,26 @@ GLFWAPI void glfwSetClipboardString(GLFWwindow* window, const char* string); */ GLFWAPI const char* glfwGetClipboardString(GLFWwindow* window); -/*! @brief Returns the value of the GLFW timer. +/*! @brief Returns the GLFW time. + * + * This function returns the current GLFW time, in seconds. Unless the time + * has been set using @ref glfwSetTime it measures time elapsed since GLFW was + * initialized. * - * This function returns the value of the GLFW timer. Unless the timer has - * been set using @ref glfwSetTime, the timer measures time elapsed since GLFW - * was initialized. + * This function and @ref glfwSetTime are helper functions on top of @ref + * glfwGetTimerFrequency and @ref glfwGetTimerValue. * * The resolution of the timer is system dependent, but is usually on the order * of a few micro- or nanoseconds. It uses the highest-resolution monotonic * time source on each supported platform. * - * @return The current value, in seconds, or zero if an + * @return The current time, in seconds, or zero if an * [error](@ref error_handling) occurred. * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function may be called from any thread. Reading and - * writing of the internal timer offset is not atomic, so it needs to be + * writing of the internal base time is not atomic, so it needs to be * externally synchronized with calls to @ref glfwSetTime. * * @sa @ref time @@ -5096,23 +5360,26 @@ GLFWAPI const char* glfwGetClipboardString(GLFWwindow* window); */ GLFWAPI double glfwGetTime(void); -/*! @brief Sets the GLFW timer. +/*! @brief Sets the GLFW time. + * + * This function sets the current GLFW time, in seconds. The value must be + * a positive finite number less than or equal to 18446744073.0, which is + * approximately 584.5 years. * - * This function sets the value of the GLFW timer. It then continues to count - * up from that value. The value must be a positive finite number less than - * or equal to 18446744073.0, which is approximately 584.5 years. + * This function and @ref glfwGetTime are helper functions on top of @ref + * glfwGetTimerFrequency and @ref glfwGetTimerValue. * * @param[in] time The new value, in seconds. * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref * GLFW_INVALID_VALUE. * - * @remark The upper limit of the timer is calculated as + * @remark The upper limit of GLFW time is calculated as * floor((264 - 1) / 109) and is due to implementations * storing nanoseconds in 64 bits. The limit may be increased in the future. * * @thread_safety This function may be called from any thread. Reading and - * writing of the internal timer offset is not atomic, so it needs to be + * writing of the internal base time is not atomic, so it needs to be * externally synchronized with calls to @ref glfwGetTime. * * @sa @ref time @@ -5416,7 +5683,7 @@ GLFWAPI int glfwVulkanSupported(void); * * This function returns an array of names of Vulkan instance extensions required * by GLFW for creating Vulkan surfaces for GLFW windows. If successful, the - * list will always contains `VK_KHR_surface`, so if you don't require any + * list will always contain `VK_KHR_surface`, so if you don't require any * additional extensions you can pass this list directly to the * `VkInstanceCreateInfo` struct. * @@ -5441,8 +5708,9 @@ GLFWAPI int glfwVulkanSupported(void); * returned array, as it is an error to specify an extension more than once in * the `VkInstanceCreateInfo` struct. * - * @remark @macos This function currently only supports the - * `VK_MVK_macos_surface` extension from MoltenVK. + * @remark @macos This function currently supports either the + * `VK_MVK_macos_surface` extension from MoltenVK or `VK_EXT_metal_surface` + * extension. * * @pointer_lifetime The returned array is allocated and freed by GLFW. You * should not free it yourself. It is guaranteed to be valid only until the diff --git a/external/glfw3/include/linux/glfw3native.h b/external/glfw3/include/linux/glfw3native.h index 26bf7822..267e75ca 100644 --- a/external/glfw3/include/linux/glfw3native.h +++ b/external/glfw3/include/linux/glfw3native.h @@ -94,7 +94,7 @@ extern "C" { #if defined(__OBJC__) #import #else - //#include + #include typedef void* id; #endif #elif defined(GLFW_EXPOSE_NATIVE_X11) || defined(GLFW_EXPOSE_NATIVE_GLX) @@ -200,7 +200,7 @@ GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow* window); * * @ingroup native */ -//GLFWAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* monitor); +GLFWAPI CGDirectDisplayID glfwGetCocoaMonitor(GLFWmonitor* monitor); /*! @brief Returns the `NSWindow` of the specified window. * diff --git a/external/glfw3/include/mac/glfw3.h b/external/glfw3/include/mac/glfw3.h index 0521d198..c8d7cfaf 100644 --- a/external/glfw3/include/mac/glfw3.h +++ b/external/glfw3/include/mac/glfw3.h @@ -52,7 +52,7 @@ extern "C" { * This is the reference documentation for OpenGL and OpenGL ES context related * functions. For more task-oriented information, see the @ref context_guide. */ -/*! @defgroup vulkan Vulkan reference +/*! @defgroup vulkan Vulkan support reference * @brief Functions and types related to Vulkan. * * This is the reference documentation for Vulkan related functions and types. @@ -96,11 +96,30 @@ extern "C" { #define _WIN32 #endif /* _WIN32 */ +/* Include because most Windows GLU headers need wchar_t and + * the macOS OpenGL header blocks the definition of ptrdiff_t by glext.h. + * Include it unconditionally to avoid surprising side-effects. + */ +#include + +/* Include because it is needed by Vulkan and related functions. + * Include it unconditionally to avoid surprising side-effects. + */ +#include + +#if defined(GLFW_INCLUDE_VULKAN) + #include +#endif /* Vulkan header */ + +/* The Vulkan header may have indirectly included windows.h (because of + * VK_USE_PLATFORM_WIN32_KHR) so we offer our replacement symbols after it. + */ + /* It is customary to use APIENTRY for OpenGL function pointer declarations on * all platforms. Additionally, the Windows OpenGL header needs APIENTRY. */ -#ifndef APIENTRY - #ifdef _WIN32 +#if !defined(APIENTRY) + #if defined(_WIN32) #define APIENTRY __stdcall #else #define APIENTRY @@ -122,17 +141,6 @@ extern "C" { #define GLFW_CALLBACK_DEFINED #endif /* CALLBACK */ -/* Include because most Windows GLU headers need wchar_t and - * the macOS OpenGL header blocks the definition of ptrdiff_t by glext.h. - * Include it unconditionally to avoid surprising side-effects. - */ -#include - -/* Include because it is needed by Vulkan and related functions. - * Include it unconditionally to avoid surprising side-effects. - */ -#include - /* Include the chosen OpenGL or OpenGL ES headers. */ #if defined(GLFW_INCLUDE_ES1) @@ -185,7 +193,38 @@ extern "C" { #endif /*__APPLE__*/ -#elif !defined(GLFW_INCLUDE_NONE) +#elif defined(GLFW_INCLUDE_GLU) + + #if defined(__APPLE__) + + #if defined(GLFW_INCLUDE_GLU) + #include + #endif + + #else /*__APPLE__*/ + + #if defined(GLFW_INCLUDE_GLU) + #include + #endif + + #endif /*__APPLE__*/ + +#elif !defined(GLFW_INCLUDE_NONE) && \ + !defined(__gl_h_) && \ + !defined(__gles1_gl_h_) && \ + !defined(__gles2_gl2_h_) && \ + !defined(__gles2_gl3_h_) && \ + !defined(__gles2_gl31_h_) && \ + !defined(__gles2_gl32_h_) && \ + !defined(__gl_glcorearb_h_) && \ + !defined(__gl2_h_) /*legacy*/ && \ + !defined(__gl3_h_) /*legacy*/ && \ + !defined(__gl31_h_) /*legacy*/ && \ + !defined(__gl32_h_) /*legacy*/ && \ + !defined(__glcorearb_h_) /*legacy*/ && \ + !defined(__GL_H__) /*non-standard*/ && \ + !defined(__gltypes_h_) /*non-standard*/ && \ + !defined(__glee_h_) /*non-standard*/ #if defined(__APPLE__) @@ -193,9 +232,6 @@ extern "C" { #define GL_GLEXT_LEGACY #endif #include - #if defined(GLFW_INCLUDE_GLU) - #include - #endif #else /*__APPLE__*/ @@ -203,18 +239,11 @@ extern "C" { #if defined(GLFW_INCLUDE_GLEXT) #include #endif - #if defined(GLFW_INCLUDE_GLU) - #include - #endif #endif /*__APPLE__*/ #endif /* OpenGL and OpenGL ES headers */ -#if defined(GLFW_INCLUDE_VULKAN) - #include -#endif /* Vulkan header */ - #if defined(GLFW_DLL) && defined(_GLFW_BUILD_DLL) /* GLFW_DLL must be defined by applications that are linking against the DLL * version of the GLFW library. _GLFW_BUILD_DLL is defined by the GLFW @@ -266,7 +295,7 @@ extern "C" { * API changes. * @ingroup init */ -#define GLFW_VERSION_REVISION 0 +#define GLFW_VERSION_REVISION 4 /*! @} */ /*! @brief One. @@ -917,62 +946,62 @@ extern "C" { #define GLFW_CLIENT_API 0x00022001 /*! @brief Context client API major version hint and attribute. * - * Context client API major version [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * Context client API major version [hint](@ref GLFW_CONTEXT_VERSION_MAJOR_hint) + * and [attribute](@ref GLFW_CONTEXT_VERSION_MAJOR_attrib). */ #define GLFW_CONTEXT_VERSION_MAJOR 0x00022002 /*! @brief Context client API minor version hint and attribute. * - * Context client API minor version [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * Context client API minor version [hint](@ref GLFW_CONTEXT_VERSION_MINOR_hint) + * and [attribute](@ref GLFW_CONTEXT_VERSION_MINOR_attrib). */ #define GLFW_CONTEXT_VERSION_MINOR 0x00022003 /*! @brief Context client API revision number hint and attribute. * - * Context client API revision number [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * Context client API revision number + * [attribute](@ref GLFW_CONTEXT_REVISION_attrib). */ #define GLFW_CONTEXT_REVISION 0x00022004 /*! @brief Context robustness hint and attribute. * - * Context client API revision number [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * Context client API revision number [hint](@ref GLFW_CONTEXT_ROBUSTNESS_hint) + * and [attribute](@ref GLFW_CONTEXT_ROBUSTNESS_attrib). */ #define GLFW_CONTEXT_ROBUSTNESS 0x00022005 /*! @brief OpenGL forward-compatibility hint and attribute. * - * OpenGL forward-compatibility [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * OpenGL forward-compatibility [hint](@ref GLFW_OPENGL_FORWARD_COMPAT_hint) + * and [attribute](@ref GLFW_OPENGL_FORWARD_COMPAT_attrib). */ #define GLFW_OPENGL_FORWARD_COMPAT 0x00022006 -/*! @brief OpenGL debug context hint and attribute. +/*! @brief Debug mode context hint and attribute. * - * OpenGL debug context [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * Debug mode context [hint](@ref GLFW_OPENGL_DEBUG_CONTEXT_hint) and + * [attribute](@ref GLFW_OPENGL_DEBUG_CONTEXT_attrib). */ #define GLFW_OPENGL_DEBUG_CONTEXT 0x00022007 /*! @brief OpenGL profile hint and attribute. * - * OpenGL profile [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * OpenGL profile [hint](@ref GLFW_OPENGL_PROFILE_hint) and + * [attribute](@ref GLFW_OPENGL_PROFILE_attrib). */ #define GLFW_OPENGL_PROFILE 0x00022008 /*! @brief Context flush-on-release hint and attribute. * - * Context flush-on-release [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * Context flush-on-release [hint](@ref GLFW_CONTEXT_RELEASE_BEHAVIOR_hint) and + * [attribute](@ref GLFW_CONTEXT_RELEASE_BEHAVIOR_attrib). */ #define GLFW_CONTEXT_RELEASE_BEHAVIOR 0x00022009 /*! @brief Context error suppression hint and attribute. * - * Context error suppression [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * Context error suppression [hint](@ref GLFW_CONTEXT_NO_ERROR_hint) and + * [attribute](@ref GLFW_CONTEXT_NO_ERROR_attrib). */ #define GLFW_CONTEXT_NO_ERROR 0x0002200A /*! @brief Context creation API hint and attribute. * - * Context creation API [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * Context creation API [hint](@ref GLFW_CONTEXT_CREATION_API_hint) and + * [attribute](@ref GLFW_CONTEXT_CREATION_API_attrib). */ #define GLFW_CONTEXT_CREATION_API 0x0002200B /*! @brief Window content area scaling window @@ -1164,13 +1193,21 @@ typedef struct GLFWwindow GLFWwindow; */ typedef struct GLFWcursor GLFWcursor; -/*! @brief The function signature for error callbacks. +/*! @brief The function pointer type for error callbacks. * - * This is the function signature for error callback functions. + * This is the function pointer type for error callbacks. An error callback + * function has the following signature: + * @code + * void callback_name(int error_code, const char* description) + * @endcode * - * @param[in] error An [error code](@ref errors). + * @param[in] error_code An [error code](@ref errors). Future releases may add + * more error codes. * @param[in] description A UTF-8 encoded string describing the error. * + * @pointer_lifetime The error description string is valid until the callback + * function returns. + * * @sa @ref error_handling * @sa @ref glfwSetErrorCallback * @@ -1180,9 +1217,13 @@ typedef struct GLFWcursor GLFWcursor; */ typedef void (* GLFWerrorfun)(int,const char*); -/*! @brief The function signature for window position callbacks. +/*! @brief The function pointer type for window position callbacks. * - * This is the function signature for window position callback functions. + * This is the function pointer type for window position callbacks. A window + * position callback function has the following signature: + * @code + * void callback_name(GLFWwindow* window, int xpos, int ypos) + * @endcode * * @param[in] window The window that was moved. * @param[in] xpos The new x-coordinate, in screen coordinates, of the @@ -1199,9 +1240,13 @@ typedef void (* GLFWerrorfun)(int,const char*); */ typedef void (* GLFWwindowposfun)(GLFWwindow*,int,int); -/*! @brief The function signature for window resize callbacks. +/*! @brief The function pointer type for window size callbacks. * - * This is the function signature for window size callback functions. + * This is the function pointer type for window size callbacks. A window size + * callback function has the following signature: + * @code + * void callback_name(GLFWwindow* window, int width, int height) + * @endcode * * @param[in] window The window that was resized. * @param[in] width The new width, in screen coordinates, of the window. @@ -1217,9 +1262,13 @@ typedef void (* GLFWwindowposfun)(GLFWwindow*,int,int); */ typedef void (* GLFWwindowsizefun)(GLFWwindow*,int,int); -/*! @brief The function signature for window close callbacks. +/*! @brief The function pointer type for window close callbacks. * - * This is the function signature for window close callback functions. + * This is the function pointer type for window close callbacks. A window + * close callback function has the following signature: + * @code + * void function_name(GLFWwindow* window) + * @endcode * * @param[in] window The window that the user attempted to close. * @@ -1233,9 +1282,13 @@ typedef void (* GLFWwindowsizefun)(GLFWwindow*,int,int); */ typedef void (* GLFWwindowclosefun)(GLFWwindow*); -/*! @brief The function signature for window content refresh callbacks. +/*! @brief The function pointer type for window content refresh callbacks. * - * This is the function signature for window refresh callback functions. + * This is the function pointer type for window content refresh callbacks. + * A window content refresh callback function has the following signature: + * @code + * void function_name(GLFWwindow* window); + * @endcode * * @param[in] window The window whose content needs to be refreshed. * @@ -1249,9 +1302,13 @@ typedef void (* GLFWwindowclosefun)(GLFWwindow*); */ typedef void (* GLFWwindowrefreshfun)(GLFWwindow*); -/*! @brief The function signature for window focus/defocus callbacks. +/*! @brief The function pointer type for window focus callbacks. * - * This is the function signature for window focus callback functions. + * This is the function pointer type for window focus callbacks. A window + * focus callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, int focused) + * @endcode * * @param[in] window The window that gained or lost input focus. * @param[in] focused `GLFW_TRUE` if the window was given input focus, or @@ -1266,10 +1323,13 @@ typedef void (* GLFWwindowrefreshfun)(GLFWwindow*); */ typedef void (* GLFWwindowfocusfun)(GLFWwindow*,int); -/*! @brief The function signature for window iconify/restore callbacks. +/*! @brief The function pointer type for window iconify callbacks. * - * This is the function signature for window iconify/restore callback - * functions. + * This is the function pointer type for window iconify callbacks. A window + * iconify callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, int iconified) + * @endcode * * @param[in] window The window that was iconified or restored. * @param[in] iconified `GLFW_TRUE` if the window was iconified, or @@ -1284,13 +1344,16 @@ typedef void (* GLFWwindowfocusfun)(GLFWwindow*,int); */ typedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int); -/*! @brief The function signature for window maximize/restore callbacks. +/*! @brief The function pointer type for window maximize callbacks. * - * This is the function signature for window maximize/restore callback - * functions. + * This is the function pointer type for window maximize callbacks. A window + * maximize callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, int maximized) + * @endcode * * @param[in] window The window that was maximized or restored. - * @param[in] iconified `GLFW_TRUE` if the window was maximized, or + * @param[in] maximized `GLFW_TRUE` if the window was maximized, or * `GLFW_FALSE` if it was restored. * * @sa @ref window_maximize @@ -1302,10 +1365,13 @@ typedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int); */ typedef void (* GLFWwindowmaximizefun)(GLFWwindow*,int); -/*! @brief The function signature for framebuffer resize callbacks. +/*! @brief The function pointer type for framebuffer size callbacks. * - * This is the function signature for framebuffer resize callback - * functions. + * This is the function pointer type for framebuffer size callbacks. + * A framebuffer size callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, int width, int height) + * @endcode * * @param[in] window The window whose framebuffer was resized. * @param[in] width The new width, in pixels, of the framebuffer. @@ -1320,10 +1386,13 @@ typedef void (* GLFWwindowmaximizefun)(GLFWwindow*,int); */ typedef void (* GLFWframebuffersizefun)(GLFWwindow*,int,int); -/*! @brief The function signature for window content scale callbacks. +/*! @brief The function pointer type for window content scale callbacks. * - * This is the function signature for window content scale callback - * functions. + * This is the function pointer type for window content scale callbacks. + * A window content scale callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, float xscale, float yscale) + * @endcode * * @param[in] window The window whose content scale changed. * @param[in] xscale The new x-axis content scale of the window. @@ -1338,14 +1407,19 @@ typedef void (* GLFWframebuffersizefun)(GLFWwindow*,int,int); */ typedef void (* GLFWwindowcontentscalefun)(GLFWwindow*,float,float); -/*! @brief The function signature for mouse button callbacks. +/*! @brief The function pointer type for mouse button callbacks. * - * This is the function signature for mouse button callback functions. + * This is the function pointer type for mouse button callback functions. + * A mouse button callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, int button, int action, int mods) + * @endcode * * @param[in] window The window that received the event. * @param[in] button The [mouse button](@ref buttons) that was pressed or * released. - * @param[in] action One of `GLFW_PRESS` or `GLFW_RELEASE`. + * @param[in] action One of `GLFW_PRESS` or `GLFW_RELEASE`. Future releases + * may add more actions. * @param[in] mods Bit field describing which [modifier keys](@ref mods) were * held down. * @@ -1359,9 +1433,13 @@ typedef void (* GLFWwindowcontentscalefun)(GLFWwindow*,float,float); */ typedef void (* GLFWmousebuttonfun)(GLFWwindow*,int,int,int); -/*! @brief The function signature for cursor position callbacks. +/*! @brief The function pointer type for cursor position callbacks. * - * This is the function signature for cursor position callback functions. + * This is the function pointer type for cursor position callbacks. A cursor + * position callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, double xpos, double ypos); + * @endcode * * @param[in] window The window that received the event. * @param[in] xpos The new cursor x-coordinate, relative to the left edge of @@ -1378,9 +1456,13 @@ typedef void (* GLFWmousebuttonfun)(GLFWwindow*,int,int,int); */ typedef void (* GLFWcursorposfun)(GLFWwindow*,double,double); -/*! @brief The function signature for cursor enter/leave callbacks. +/*! @brief The function pointer type for cursor enter/leave callbacks. * - * This is the function signature for cursor enter/leave callback functions. + * This is the function pointer type for cursor enter/leave callbacks. + * A cursor enter/leave callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, int entered) + * @endcode * * @param[in] window The window that received the event. * @param[in] entered `GLFW_TRUE` if the cursor entered the window's content @@ -1395,9 +1477,13 @@ typedef void (* GLFWcursorposfun)(GLFWwindow*,double,double); */ typedef void (* GLFWcursorenterfun)(GLFWwindow*,int); -/*! @brief The function signature for scroll callbacks. +/*! @brief The function pointer type for scroll callbacks. * - * This is the function signature for scroll callback functions. + * This is the function pointer type for scroll callbacks. A scroll callback + * function has the following signature: + * @code + * void function_name(GLFWwindow* window, double xoffset, double yoffset) + * @endcode * * @param[in] window The window that received the event. * @param[in] xoffset The scroll offset along the x-axis. @@ -1412,14 +1498,19 @@ typedef void (* GLFWcursorenterfun)(GLFWwindow*,int); */ typedef void (* GLFWscrollfun)(GLFWwindow*,double,double); -/*! @brief The function signature for keyboard key callbacks. +/*! @brief The function pointer type for keyboard key callbacks. * - * This is the function signature for keyboard key callback functions. + * This is the function pointer type for keyboard key callbacks. A keyboard + * key callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, int key, int scancode, int action, int mods) + * @endcode * * @param[in] window The window that received the event. * @param[in] key The [keyboard key](@ref keys) that was pressed or released. * @param[in] scancode The system-specific scancode of the key. - * @param[in] action `GLFW_PRESS`, `GLFW_RELEASE` or `GLFW_REPEAT`. + * @param[in] action `GLFW_PRESS`, `GLFW_RELEASE` or `GLFW_REPEAT`. Future + * releases may add more actions. * @param[in] mods Bit field describing which [modifier keys](@ref mods) were * held down. * @@ -1433,9 +1524,13 @@ typedef void (* GLFWscrollfun)(GLFWwindow*,double,double); */ typedef void (* GLFWkeyfun)(GLFWwindow*,int,int,int,int); -/*! @brief The function signature for Unicode character callbacks. +/*! @brief The function pointer type for Unicode character callbacks. * - * This is the function signature for Unicode character callback functions. + * This is the function pointer type for Unicode character callbacks. + * A Unicode character callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, unsigned int codepoint) + * @endcode * * @param[in] window The window that received the event. * @param[in] codepoint The Unicode code point of the character. @@ -1450,12 +1545,16 @@ typedef void (* GLFWkeyfun)(GLFWwindow*,int,int,int,int); */ typedef void (* GLFWcharfun)(GLFWwindow*,unsigned int); -/*! @brief The function signature for Unicode character with modifiers +/*! @brief The function pointer type for Unicode character with modifiers * callbacks. * - * This is the function signature for Unicode character with modifiers callback - * functions. It is called for each input character, regardless of what - * modifier keys are held down. + * This is the function pointer type for Unicode character with modifiers + * callbacks. It is called for each input character, regardless of what + * modifier keys are held down. A Unicode character with modifiers callback + * function has the following signature: + * @code + * void function_name(GLFWwindow* window, unsigned int codepoint, int mods) + * @endcode * * @param[in] window The window that received the event. * @param[in] codepoint The Unicode code point of the character. @@ -1473,14 +1572,21 @@ typedef void (* GLFWcharfun)(GLFWwindow*,unsigned int); */ typedef void (* GLFWcharmodsfun)(GLFWwindow*,unsigned int,int); -/*! @brief The function signature for file drop callbacks. +/*! @brief The function pointer type for path drop callbacks. * - * This is the function signature for file drop callbacks. + * This is the function pointer type for path drop callbacks. A path drop + * callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, int path_count, const char* paths[]) + * @endcode * * @param[in] window The window that received the event. - * @param[in] count The number of dropped files. + * @param[in] path_count The number of dropped paths. * @param[in] paths The UTF-8 encoded file and/or directory path names. * + * @pointer_lifetime The path array and its strings are valid until the + * callback function returns. + * * @sa @ref path_drop * @sa @ref glfwSetDropCallback * @@ -1488,15 +1594,19 @@ typedef void (* GLFWcharmodsfun)(GLFWwindow*,unsigned int,int); * * @ingroup input */ -typedef void (* GLFWdropfun)(GLFWwindow*,int,const char**); +typedef void (* GLFWdropfun)(GLFWwindow*,int,const char*[]); -/*! @brief The function signature for monitor configuration callbacks. +/*! @brief The function pointer type for monitor configuration callbacks. * - * This is the function signature for monitor configuration callback functions. + * This is the function pointer type for monitor configuration callbacks. + * A monitor callback function has the following signature: + * @code + * void function_name(GLFWmonitor* monitor, int event) + * @endcode * * @param[in] monitor The monitor that was connected or disconnected. - * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. Remaining - * values reserved for future use. + * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. Future + * releases may add more events. * * @sa @ref monitor_event * @sa @ref glfwSetMonitorCallback @@ -1507,14 +1617,17 @@ typedef void (* GLFWdropfun)(GLFWwindow*,int,const char**); */ typedef void (* GLFWmonitorfun)(GLFWmonitor*,int); -/*! @brief The function signature for joystick configuration callbacks. +/*! @brief The function pointer type for joystick configuration callbacks. * - * This is the function signature for joystick configuration callback - * functions. + * This is the function pointer type for joystick configuration callbacks. + * A joystick configuration callback function has the following signature: + * @code + * void function_name(int jid, int event) + * @endcode * * @param[in] jid The joystick that was connected or disconnected. - * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. Remaining - * values reserved for future use. + * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. Future + * releases may add more events. * * @sa @ref joystick_event * @sa @ref glfwSetJoystickCallback @@ -1665,6 +1778,10 @@ typedef struct GLFWgamepadstate * bundle, if present. This can be disabled with the @ref * GLFW_COCOA_CHDIR_RESOURCES init hint. * + * @remark @x11 This function will set the `LC_CTYPE` category of the + * application locale according to the current environment if that category is + * still "C". This is because the "C" locale breaks Unicode text input. + * * @thread_safety This function must only be called from the main thread. * * @sa @ref intro_init @@ -1688,6 +1805,8 @@ GLFWAPI int glfwInit(void); * call this function, as it is called by @ref glfwInit before it returns * failure. * + * This function has no effect if GLFW is not initialized. + * * @errors Possible errors include @ref GLFW_PLATFORM_ERROR. * * @remark This function may be called before @ref glfwInit. @@ -1849,10 +1968,17 @@ GLFWAPI int glfwGetError(const char** description); * Once set, the error callback remains set even after the library has been * terminated. * - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set. * + * @callback_signature + * @code + * void callback_name(int error_code, const char* description) + * @endcode + * For more information about the callback parameters, see the + * [callback pointer type](@ref GLFWerrorfun). + * * @errors None. * * @remark This function may be called before @ref glfwInit. @@ -1866,7 +1992,7 @@ GLFWAPI int glfwGetError(const char** description); * * @ingroup init */ -GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun); +GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun callback); /*! @brief Returns the currently connected monitors. * @@ -1946,7 +2072,7 @@ GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void); */ GLFWAPI void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos); -/*! @brief Retrives the work area of the monitor. +/*! @brief Retrieves the work area of the monitor. * * This function returns the position, in screen coordinates, of the upper-left * corner of the work area of the specified monitor along with the work area @@ -2125,11 +2251,18 @@ GLFWAPI void* glfwGetMonitorUserPointer(GLFWmonitor* monitor); * currently set callback. This is called when a monitor is connected to or * disconnected from the system. * - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWmonitor* monitor, int event) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWmonitorfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -2140,7 +2273,7 @@ GLFWAPI void* glfwGetMonitorUserPointer(GLFWmonitor* monitor); * * @ingroup monitor */ -GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun); +GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun callback); /*! @brief Returns the available video modes for the specified monitor. * @@ -2223,7 +2356,7 @@ GLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor); * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref * GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR. * - * @remark @wayland Gamma handling is a priviledged protocol, this function + * @remark @wayland Gamma handling is a privileged protocol, this function * will thus never be implemented and emits @ref GLFW_PLATFORM_ERROR. * * @thread_safety This function must only be called from the main thread. @@ -2247,7 +2380,7 @@ GLFWAPI void glfwSetGamma(GLFWmonitor* monitor, float gamma); * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref * GLFW_PLATFORM_ERROR. * - * @remark @wayland Gamma handling is a priviledged protocol, this function + * @remark @wayland Gamma handling is a privileged protocol, this function * will thus never be implemented and emits @ref GLFW_PLATFORM_ERROR while * returning `NULL`. * @@ -2291,7 +2424,7 @@ GLFWAPI const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* monitor); * * @remark @win32 The gamma ramp size must be 256. * - * @remark @wayland Gamma handling is a priviledged protocol, this function + * @remark @wayland Gamma handling is a privileged protocol, this function * will thus never be implemented and emits @ref GLFW_PLATFORM_ERROR. * * @pointer_lifetime The specified gamma ramp is copied before this function @@ -2510,7 +2643,7 @@ GLFWAPI void glfwWindowHintString(int hint, const char* value); * * @remark @macos When activating frame autosaving with * [GLFW_COCOA_FRAME_NAME](@ref GLFW_COCOA_FRAME_NAME_hint), the specified - * window size and position may be overriden by previously saved values. + * window size and position may be overridden by previously saved values. * * @remark @x11 Some window managers will not respect the placement of * initially hidden windows. @@ -3477,11 +3610,18 @@ GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* window); * area of the window. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int xpos, int ypos) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWwindowposfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @remark @wayland This callback will never be called, as there is no way for @@ -3495,7 +3635,7 @@ GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* window); * * @ingroup window */ -GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindowposfun cbfun); +GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindowposfun callback); /*! @brief Sets the size callback for the specified window. * @@ -3504,11 +3644,18 @@ GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindow * in screen coordinates, of the content area of the window. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int width, int height) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWwindowsizefun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -3520,7 +3667,7 @@ GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindow * * @ingroup window */ -GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun cbfun); +GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun callback); /*! @brief Sets the close callback for the specified window. * @@ -3534,11 +3681,18 @@ GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwind * The close callback is not triggered by @ref glfwDestroyWindow. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWwindowclosefun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @remark @macos Selecting Quit from the application menu will trigger the @@ -3553,7 +3707,7 @@ GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwind * * @ingroup window */ -GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwindowclosefun cbfun); +GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwindowclosefun callback); /*! @brief Sets the refresh callback for the specified window. * @@ -3566,11 +3720,18 @@ GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwi * very infrequently or never at all. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window); + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWwindowrefreshfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -3582,7 +3743,7 @@ GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwi * * @ingroup window */ -GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GLFWwindowrefreshfun cbfun); +GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GLFWwindowrefreshfun callback); /*! @brief Sets the focus callback for the specified window. * @@ -3595,11 +3756,18 @@ GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GL * and @ref glfwSetMouseButtonCallback. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int focused) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWwindowfocusfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -3610,7 +3778,7 @@ GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GL * * @ingroup window */ -GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwindowfocusfun cbfun); +GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwindowfocusfun callback); /*! @brief Sets the iconify callback for the specified window. * @@ -3618,11 +3786,18 @@ GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwi * is called when the window is iconified or restored. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int iconified) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWwindowiconifyfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @remark @wayland The wl_shell protocol has no concept of iconification, @@ -3636,7 +3811,7 @@ GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwi * * @ingroup window */ -GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GLFWwindowiconifyfun cbfun); +GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GLFWwindowiconifyfun callback); /*! @brief Sets the maximize callback for the specified window. * @@ -3644,11 +3819,18 @@ GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GL * is called when the window is maximized or restored. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int maximized) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWwindowmaximizefun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -3659,7 +3841,7 @@ GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GL * * @ingroup window */ -GLFWAPI GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow* window, GLFWwindowmaximizefun cbfun); +GLFWAPI GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow* window, GLFWwindowmaximizefun callback); /*! @brief Sets the framebuffer resize callback for the specified window. * @@ -3667,11 +3849,18 @@ GLFWAPI GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow* window, * which is called when the framebuffer of the specified window is resized. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int width, int height) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWframebuffersizefun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -3682,7 +3871,7 @@ GLFWAPI GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow* window, * * @ingroup window */ -GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window, GLFWframebuffersizefun cbfun); +GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window, GLFWframebuffersizefun callback); /*! @brief Sets the window content scale callback for the specified window. * @@ -3690,11 +3879,18 @@ GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window * which is called when the content scale of the specified window changes. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, float xscale, float yscale) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWwindowcontentscalefun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -3706,7 +3902,7 @@ GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window * * @ingroup window */ -GLFWAPI GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(GLFWwindow* window, GLFWwindowcontentscalefun cbfun); +GLFWAPI GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(GLFWwindow* window, GLFWwindowcontentscalefun callback); /*! @brief Processes all pending events. * @@ -4028,9 +4224,11 @@ GLFWAPI int glfwRawMouseMotionSupported(void); * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref * GLFW_PLATFORM_ERROR. * + * @remark The contents of the returned string may change when a keyboard + * layout change event is received. + * * @pointer_lifetime The returned string is allocated and freed by GLFW. You - * should not free it yourself. It is valid until the next call to @ref - * glfwGetKeyName, or until the library is terminated. + * should not free it yourself. It is valid until the library is terminated. * * @thread_safety This function must only be called from the main thread. * @@ -4353,11 +4551,18 @@ GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor); * scancode may be zero. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new key callback, or `NULL` to remove the currently + * @param[in] callback The new key callback, or `NULL` to remove the currently * set callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int key, int scancode, int action, int mods) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWkeyfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -4369,7 +4574,7 @@ GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor); * * @ingroup input */ -GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun); +GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun callback); /*! @brief Sets the Unicode character callback. * @@ -4389,11 +4594,18 @@ GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun); * on Windows. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, unsigned int codepoint) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWcharfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -4405,7 +4617,7 @@ GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun); * * @ingroup input */ -GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun); +GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun callback); /*! @brief Sets the Unicode character with modifiers callback. * @@ -4423,11 +4635,18 @@ GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun); * [key callback](@ref glfwSetKeyCallback) instead. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or an * [error](@ref error_handling) occurred. * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, unsigned int codepoint, int mods) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWcharmodsfun). + * * @deprecated Scheduled for removal in version 4.0. * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. @@ -4440,7 +4659,7 @@ GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun); * * @ingroup input */ -GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmodsfun cbfun); +GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmodsfun callback); /*! @brief Sets the mouse button callback. * @@ -4454,11 +4673,18 @@ GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmods * [window focus callback](@ref glfwSetWindowFocusCallback) has been called. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int button, int action, int mods) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWmousebuttonfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -4470,7 +4696,7 @@ GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmods * * @ingroup input */ -GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmousebuttonfun cbfun); +GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmousebuttonfun callback); /*! @brief Sets the cursor position callback. * @@ -4480,11 +4706,18 @@ GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmo * content area of the window. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, double xpos, double ypos); + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWcursorposfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -4495,20 +4728,27 @@ GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmo * * @ingroup input */ -GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursorposfun cbfun); +GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursorposfun callback); -/*! @brief Sets the cursor enter/exit callback. +/*! @brief Sets the cursor enter/leave callback. * * This function sets the cursor boundary crossing callback of the specified * window, which is called when the cursor enters or leaves the content area of * the window. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int entered) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWcursorenterfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -4519,7 +4759,7 @@ GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursor * * @ingroup input */ -GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcursorenterfun cbfun); +GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcursorenterfun callback); /*! @brief Sets the scroll callback. * @@ -4531,11 +4771,18 @@ GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcu * wheel or a touchpad scrolling area. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new scroll callback, or `NULL` to remove the currently - * set callback. + * @param[in] callback The new scroll callback, or `NULL` to remove the + * currently set callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, double xoffset, double yoffset) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWscrollfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -4546,12 +4793,12 @@ GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcu * * @ingroup input */ -GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cbfun); +GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun callback); -/*! @brief Sets the file drop callback. +/*! @brief Sets the path drop callback. * - * This function sets the file drop callback of the specified window, which is - * called when one or more dragged files are dropped on the window. + * This function sets the path drop callback of the specified window, which is + * called when one or more dragged paths are dropped on the window. * * Because the path array and its strings may have been generated specifically * for that event, they are not guaranteed to be valid after the callback has @@ -4559,11 +4806,18 @@ GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cb * make a deep copy. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new file drop callback, or `NULL` to remove the + * @param[in] callback The new file drop callback, or `NULL` to remove the * currently set callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int path_count, const char* paths[]) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWdropfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @remark @wayland File drop is currently unimplemented. @@ -4576,7 +4830,7 @@ GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cb * * @ingroup input */ -GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun cbfun); +GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun callback); /*! @brief Returns whether the specified joystick is present. * @@ -4764,7 +5018,7 @@ GLFWAPI const unsigned char* glfwGetJoystickHats(int jid, int* count); */ GLFWAPI const char* glfwGetJoystickName(int jid); -/*! @brief Returns the SDL comaptible GUID of the specified joystick. +/*! @brief Returns the SDL compatible GUID of the specified joystick. * * This function returns the SDL compatible GUID, as a UTF-8 encoded * hexadecimal string, of the specified joystick. The returned string is @@ -4895,11 +5149,18 @@ GLFWAPI int glfwJoystickIsGamepad(int jid); * called by joystick functions. The function will then return whatever it * returns if the joystick is not present. * - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(int jid, int event) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWjoystickfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -4910,7 +5171,7 @@ GLFWAPI int glfwJoystickIsGamepad(int jid); * * @ingroup input */ -GLFWAPI GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun cbfun); +GLFWAPI GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun callback); /*! @brief Adds the specified SDL_GameControllerDB gamepad mappings. * @@ -4978,7 +5239,7 @@ GLFWAPI const char* glfwGetGamepadName(int jid); /*! @brief Retrieves the state of the specified joystick remapped as a gamepad. * - * This function retrives the state of the specified joystick remapped to + * This function retrieves the state of the specified joystick remapped to * an Xbox-like gamepad. * * If the specified joystick is not present or does not have a gamepad mapping @@ -5069,23 +5330,26 @@ GLFWAPI void glfwSetClipboardString(GLFWwindow* window, const char* string); */ GLFWAPI const char* glfwGetClipboardString(GLFWwindow* window); -/*! @brief Returns the value of the GLFW timer. +/*! @brief Returns the GLFW time. + * + * This function returns the current GLFW time, in seconds. Unless the time + * has been set using @ref glfwSetTime it measures time elapsed since GLFW was + * initialized. * - * This function returns the value of the GLFW timer. Unless the timer has - * been set using @ref glfwSetTime, the timer measures time elapsed since GLFW - * was initialized. + * This function and @ref glfwSetTime are helper functions on top of @ref + * glfwGetTimerFrequency and @ref glfwGetTimerValue. * * The resolution of the timer is system dependent, but is usually on the order * of a few micro- or nanoseconds. It uses the highest-resolution monotonic * time source on each supported platform. * - * @return The current value, in seconds, or zero if an + * @return The current time, in seconds, or zero if an * [error](@ref error_handling) occurred. * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function may be called from any thread. Reading and - * writing of the internal timer offset is not atomic, so it needs to be + * writing of the internal base time is not atomic, so it needs to be * externally synchronized with calls to @ref glfwSetTime. * * @sa @ref time @@ -5096,23 +5360,26 @@ GLFWAPI const char* glfwGetClipboardString(GLFWwindow* window); */ GLFWAPI double glfwGetTime(void); -/*! @brief Sets the GLFW timer. +/*! @brief Sets the GLFW time. + * + * This function sets the current GLFW time, in seconds. The value must be + * a positive finite number less than or equal to 18446744073.0, which is + * approximately 584.5 years. * - * This function sets the value of the GLFW timer. It then continues to count - * up from that value. The value must be a positive finite number less than - * or equal to 18446744073.0, which is approximately 584.5 years. + * This function and @ref glfwGetTime are helper functions on top of @ref + * glfwGetTimerFrequency and @ref glfwGetTimerValue. * * @param[in] time The new value, in seconds. * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref * GLFW_INVALID_VALUE. * - * @remark The upper limit of the timer is calculated as + * @remark The upper limit of GLFW time is calculated as * floor((264 - 1) / 109) and is due to implementations * storing nanoseconds in 64 bits. The limit may be increased in the future. * * @thread_safety This function may be called from any thread. Reading and - * writing of the internal timer offset is not atomic, so it needs to be + * writing of the internal base time is not atomic, so it needs to be * externally synchronized with calls to @ref glfwGetTime. * * @sa @ref time @@ -5416,7 +5683,7 @@ GLFWAPI int glfwVulkanSupported(void); * * This function returns an array of names of Vulkan instance extensions required * by GLFW for creating Vulkan surfaces for GLFW windows. If successful, the - * list will always contains `VK_KHR_surface`, so if you don't require any + * list will always contain `VK_KHR_surface`, so if you don't require any * additional extensions you can pass this list directly to the * `VkInstanceCreateInfo` struct. * @@ -5441,8 +5708,9 @@ GLFWAPI int glfwVulkanSupported(void); * returned array, as it is an error to specify an extension more than once in * the `VkInstanceCreateInfo` struct. * - * @remark @macos This function currently only supports the - * `VK_MVK_macos_surface` extension from MoltenVK. + * @remark @macos This function currently supports either the + * `VK_MVK_macos_surface` extension from MoltenVK or `VK_EXT_metal_surface` + * extension. * * @pointer_lifetime The returned array is allocated and freed by GLFW. You * should not free it yourself. It is guaranteed to be valid only until the diff --git a/external/glfw3/include/win32/glfw3.h b/external/glfw3/include/win32/glfw3.h old mode 100755 new mode 100644 index 0521d198..c8d7cfaf --- a/external/glfw3/include/win32/glfw3.h +++ b/external/glfw3/include/win32/glfw3.h @@ -52,7 +52,7 @@ extern "C" { * This is the reference documentation for OpenGL and OpenGL ES context related * functions. For more task-oriented information, see the @ref context_guide. */ -/*! @defgroup vulkan Vulkan reference +/*! @defgroup vulkan Vulkan support reference * @brief Functions and types related to Vulkan. * * This is the reference documentation for Vulkan related functions and types. @@ -96,11 +96,30 @@ extern "C" { #define _WIN32 #endif /* _WIN32 */ +/* Include because most Windows GLU headers need wchar_t and + * the macOS OpenGL header blocks the definition of ptrdiff_t by glext.h. + * Include it unconditionally to avoid surprising side-effects. + */ +#include + +/* Include because it is needed by Vulkan and related functions. + * Include it unconditionally to avoid surprising side-effects. + */ +#include + +#if defined(GLFW_INCLUDE_VULKAN) + #include +#endif /* Vulkan header */ + +/* The Vulkan header may have indirectly included windows.h (because of + * VK_USE_PLATFORM_WIN32_KHR) so we offer our replacement symbols after it. + */ + /* It is customary to use APIENTRY for OpenGL function pointer declarations on * all platforms. Additionally, the Windows OpenGL header needs APIENTRY. */ -#ifndef APIENTRY - #ifdef _WIN32 +#if !defined(APIENTRY) + #if defined(_WIN32) #define APIENTRY __stdcall #else #define APIENTRY @@ -122,17 +141,6 @@ extern "C" { #define GLFW_CALLBACK_DEFINED #endif /* CALLBACK */ -/* Include because most Windows GLU headers need wchar_t and - * the macOS OpenGL header blocks the definition of ptrdiff_t by glext.h. - * Include it unconditionally to avoid surprising side-effects. - */ -#include - -/* Include because it is needed by Vulkan and related functions. - * Include it unconditionally to avoid surprising side-effects. - */ -#include - /* Include the chosen OpenGL or OpenGL ES headers. */ #if defined(GLFW_INCLUDE_ES1) @@ -185,7 +193,38 @@ extern "C" { #endif /*__APPLE__*/ -#elif !defined(GLFW_INCLUDE_NONE) +#elif defined(GLFW_INCLUDE_GLU) + + #if defined(__APPLE__) + + #if defined(GLFW_INCLUDE_GLU) + #include + #endif + + #else /*__APPLE__*/ + + #if defined(GLFW_INCLUDE_GLU) + #include + #endif + + #endif /*__APPLE__*/ + +#elif !defined(GLFW_INCLUDE_NONE) && \ + !defined(__gl_h_) && \ + !defined(__gles1_gl_h_) && \ + !defined(__gles2_gl2_h_) && \ + !defined(__gles2_gl3_h_) && \ + !defined(__gles2_gl31_h_) && \ + !defined(__gles2_gl32_h_) && \ + !defined(__gl_glcorearb_h_) && \ + !defined(__gl2_h_) /*legacy*/ && \ + !defined(__gl3_h_) /*legacy*/ && \ + !defined(__gl31_h_) /*legacy*/ && \ + !defined(__gl32_h_) /*legacy*/ && \ + !defined(__glcorearb_h_) /*legacy*/ && \ + !defined(__GL_H__) /*non-standard*/ && \ + !defined(__gltypes_h_) /*non-standard*/ && \ + !defined(__glee_h_) /*non-standard*/ #if defined(__APPLE__) @@ -193,9 +232,6 @@ extern "C" { #define GL_GLEXT_LEGACY #endif #include - #if defined(GLFW_INCLUDE_GLU) - #include - #endif #else /*__APPLE__*/ @@ -203,18 +239,11 @@ extern "C" { #if defined(GLFW_INCLUDE_GLEXT) #include #endif - #if defined(GLFW_INCLUDE_GLU) - #include - #endif #endif /*__APPLE__*/ #endif /* OpenGL and OpenGL ES headers */ -#if defined(GLFW_INCLUDE_VULKAN) - #include -#endif /* Vulkan header */ - #if defined(GLFW_DLL) && defined(_GLFW_BUILD_DLL) /* GLFW_DLL must be defined by applications that are linking against the DLL * version of the GLFW library. _GLFW_BUILD_DLL is defined by the GLFW @@ -266,7 +295,7 @@ extern "C" { * API changes. * @ingroup init */ -#define GLFW_VERSION_REVISION 0 +#define GLFW_VERSION_REVISION 4 /*! @} */ /*! @brief One. @@ -917,62 +946,62 @@ extern "C" { #define GLFW_CLIENT_API 0x00022001 /*! @brief Context client API major version hint and attribute. * - * Context client API major version [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * Context client API major version [hint](@ref GLFW_CONTEXT_VERSION_MAJOR_hint) + * and [attribute](@ref GLFW_CONTEXT_VERSION_MAJOR_attrib). */ #define GLFW_CONTEXT_VERSION_MAJOR 0x00022002 /*! @brief Context client API minor version hint and attribute. * - * Context client API minor version [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * Context client API minor version [hint](@ref GLFW_CONTEXT_VERSION_MINOR_hint) + * and [attribute](@ref GLFW_CONTEXT_VERSION_MINOR_attrib). */ #define GLFW_CONTEXT_VERSION_MINOR 0x00022003 /*! @brief Context client API revision number hint and attribute. * - * Context client API revision number [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * Context client API revision number + * [attribute](@ref GLFW_CONTEXT_REVISION_attrib). */ #define GLFW_CONTEXT_REVISION 0x00022004 /*! @brief Context robustness hint and attribute. * - * Context client API revision number [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * Context client API revision number [hint](@ref GLFW_CONTEXT_ROBUSTNESS_hint) + * and [attribute](@ref GLFW_CONTEXT_ROBUSTNESS_attrib). */ #define GLFW_CONTEXT_ROBUSTNESS 0x00022005 /*! @brief OpenGL forward-compatibility hint and attribute. * - * OpenGL forward-compatibility [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * OpenGL forward-compatibility [hint](@ref GLFW_OPENGL_FORWARD_COMPAT_hint) + * and [attribute](@ref GLFW_OPENGL_FORWARD_COMPAT_attrib). */ #define GLFW_OPENGL_FORWARD_COMPAT 0x00022006 -/*! @brief OpenGL debug context hint and attribute. +/*! @brief Debug mode context hint and attribute. * - * OpenGL debug context [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * Debug mode context [hint](@ref GLFW_OPENGL_DEBUG_CONTEXT_hint) and + * [attribute](@ref GLFW_OPENGL_DEBUG_CONTEXT_attrib). */ #define GLFW_OPENGL_DEBUG_CONTEXT 0x00022007 /*! @brief OpenGL profile hint and attribute. * - * OpenGL profile [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * OpenGL profile [hint](@ref GLFW_OPENGL_PROFILE_hint) and + * [attribute](@ref GLFW_OPENGL_PROFILE_attrib). */ #define GLFW_OPENGL_PROFILE 0x00022008 /*! @brief Context flush-on-release hint and attribute. * - * Context flush-on-release [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * Context flush-on-release [hint](@ref GLFW_CONTEXT_RELEASE_BEHAVIOR_hint) and + * [attribute](@ref GLFW_CONTEXT_RELEASE_BEHAVIOR_attrib). */ #define GLFW_CONTEXT_RELEASE_BEHAVIOR 0x00022009 /*! @brief Context error suppression hint and attribute. * - * Context error suppression [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * Context error suppression [hint](@ref GLFW_CONTEXT_NO_ERROR_hint) and + * [attribute](@ref GLFW_CONTEXT_NO_ERROR_attrib). */ #define GLFW_CONTEXT_NO_ERROR 0x0002200A /*! @brief Context creation API hint and attribute. * - * Context creation API [hint](@ref GLFW_CLIENT_API_hint) and - * [attribute](@ref GLFW_CLIENT_API_attrib). + * Context creation API [hint](@ref GLFW_CONTEXT_CREATION_API_hint) and + * [attribute](@ref GLFW_CONTEXT_CREATION_API_attrib). */ #define GLFW_CONTEXT_CREATION_API 0x0002200B /*! @brief Window content area scaling window @@ -1164,13 +1193,21 @@ typedef struct GLFWwindow GLFWwindow; */ typedef struct GLFWcursor GLFWcursor; -/*! @brief The function signature for error callbacks. +/*! @brief The function pointer type for error callbacks. * - * This is the function signature for error callback functions. + * This is the function pointer type for error callbacks. An error callback + * function has the following signature: + * @code + * void callback_name(int error_code, const char* description) + * @endcode * - * @param[in] error An [error code](@ref errors). + * @param[in] error_code An [error code](@ref errors). Future releases may add + * more error codes. * @param[in] description A UTF-8 encoded string describing the error. * + * @pointer_lifetime The error description string is valid until the callback + * function returns. + * * @sa @ref error_handling * @sa @ref glfwSetErrorCallback * @@ -1180,9 +1217,13 @@ typedef struct GLFWcursor GLFWcursor; */ typedef void (* GLFWerrorfun)(int,const char*); -/*! @brief The function signature for window position callbacks. +/*! @brief The function pointer type for window position callbacks. * - * This is the function signature for window position callback functions. + * This is the function pointer type for window position callbacks. A window + * position callback function has the following signature: + * @code + * void callback_name(GLFWwindow* window, int xpos, int ypos) + * @endcode * * @param[in] window The window that was moved. * @param[in] xpos The new x-coordinate, in screen coordinates, of the @@ -1199,9 +1240,13 @@ typedef void (* GLFWerrorfun)(int,const char*); */ typedef void (* GLFWwindowposfun)(GLFWwindow*,int,int); -/*! @brief The function signature for window resize callbacks. +/*! @brief The function pointer type for window size callbacks. * - * This is the function signature for window size callback functions. + * This is the function pointer type for window size callbacks. A window size + * callback function has the following signature: + * @code + * void callback_name(GLFWwindow* window, int width, int height) + * @endcode * * @param[in] window The window that was resized. * @param[in] width The new width, in screen coordinates, of the window. @@ -1217,9 +1262,13 @@ typedef void (* GLFWwindowposfun)(GLFWwindow*,int,int); */ typedef void (* GLFWwindowsizefun)(GLFWwindow*,int,int); -/*! @brief The function signature for window close callbacks. +/*! @brief The function pointer type for window close callbacks. * - * This is the function signature for window close callback functions. + * This is the function pointer type for window close callbacks. A window + * close callback function has the following signature: + * @code + * void function_name(GLFWwindow* window) + * @endcode * * @param[in] window The window that the user attempted to close. * @@ -1233,9 +1282,13 @@ typedef void (* GLFWwindowsizefun)(GLFWwindow*,int,int); */ typedef void (* GLFWwindowclosefun)(GLFWwindow*); -/*! @brief The function signature for window content refresh callbacks. +/*! @brief The function pointer type for window content refresh callbacks. * - * This is the function signature for window refresh callback functions. + * This is the function pointer type for window content refresh callbacks. + * A window content refresh callback function has the following signature: + * @code + * void function_name(GLFWwindow* window); + * @endcode * * @param[in] window The window whose content needs to be refreshed. * @@ -1249,9 +1302,13 @@ typedef void (* GLFWwindowclosefun)(GLFWwindow*); */ typedef void (* GLFWwindowrefreshfun)(GLFWwindow*); -/*! @brief The function signature for window focus/defocus callbacks. +/*! @brief The function pointer type for window focus callbacks. * - * This is the function signature for window focus callback functions. + * This is the function pointer type for window focus callbacks. A window + * focus callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, int focused) + * @endcode * * @param[in] window The window that gained or lost input focus. * @param[in] focused `GLFW_TRUE` if the window was given input focus, or @@ -1266,10 +1323,13 @@ typedef void (* GLFWwindowrefreshfun)(GLFWwindow*); */ typedef void (* GLFWwindowfocusfun)(GLFWwindow*,int); -/*! @brief The function signature for window iconify/restore callbacks. +/*! @brief The function pointer type for window iconify callbacks. * - * This is the function signature for window iconify/restore callback - * functions. + * This is the function pointer type for window iconify callbacks. A window + * iconify callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, int iconified) + * @endcode * * @param[in] window The window that was iconified or restored. * @param[in] iconified `GLFW_TRUE` if the window was iconified, or @@ -1284,13 +1344,16 @@ typedef void (* GLFWwindowfocusfun)(GLFWwindow*,int); */ typedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int); -/*! @brief The function signature for window maximize/restore callbacks. +/*! @brief The function pointer type for window maximize callbacks. * - * This is the function signature for window maximize/restore callback - * functions. + * This is the function pointer type for window maximize callbacks. A window + * maximize callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, int maximized) + * @endcode * * @param[in] window The window that was maximized or restored. - * @param[in] iconified `GLFW_TRUE` if the window was maximized, or + * @param[in] maximized `GLFW_TRUE` if the window was maximized, or * `GLFW_FALSE` if it was restored. * * @sa @ref window_maximize @@ -1302,10 +1365,13 @@ typedef void (* GLFWwindowiconifyfun)(GLFWwindow*,int); */ typedef void (* GLFWwindowmaximizefun)(GLFWwindow*,int); -/*! @brief The function signature for framebuffer resize callbacks. +/*! @brief The function pointer type for framebuffer size callbacks. * - * This is the function signature for framebuffer resize callback - * functions. + * This is the function pointer type for framebuffer size callbacks. + * A framebuffer size callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, int width, int height) + * @endcode * * @param[in] window The window whose framebuffer was resized. * @param[in] width The new width, in pixels, of the framebuffer. @@ -1320,10 +1386,13 @@ typedef void (* GLFWwindowmaximizefun)(GLFWwindow*,int); */ typedef void (* GLFWframebuffersizefun)(GLFWwindow*,int,int); -/*! @brief The function signature for window content scale callbacks. +/*! @brief The function pointer type for window content scale callbacks. * - * This is the function signature for window content scale callback - * functions. + * This is the function pointer type for window content scale callbacks. + * A window content scale callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, float xscale, float yscale) + * @endcode * * @param[in] window The window whose content scale changed. * @param[in] xscale The new x-axis content scale of the window. @@ -1338,14 +1407,19 @@ typedef void (* GLFWframebuffersizefun)(GLFWwindow*,int,int); */ typedef void (* GLFWwindowcontentscalefun)(GLFWwindow*,float,float); -/*! @brief The function signature for mouse button callbacks. +/*! @brief The function pointer type for mouse button callbacks. * - * This is the function signature for mouse button callback functions. + * This is the function pointer type for mouse button callback functions. + * A mouse button callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, int button, int action, int mods) + * @endcode * * @param[in] window The window that received the event. * @param[in] button The [mouse button](@ref buttons) that was pressed or * released. - * @param[in] action One of `GLFW_PRESS` or `GLFW_RELEASE`. + * @param[in] action One of `GLFW_PRESS` or `GLFW_RELEASE`. Future releases + * may add more actions. * @param[in] mods Bit field describing which [modifier keys](@ref mods) were * held down. * @@ -1359,9 +1433,13 @@ typedef void (* GLFWwindowcontentscalefun)(GLFWwindow*,float,float); */ typedef void (* GLFWmousebuttonfun)(GLFWwindow*,int,int,int); -/*! @brief The function signature for cursor position callbacks. +/*! @brief The function pointer type for cursor position callbacks. * - * This is the function signature for cursor position callback functions. + * This is the function pointer type for cursor position callbacks. A cursor + * position callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, double xpos, double ypos); + * @endcode * * @param[in] window The window that received the event. * @param[in] xpos The new cursor x-coordinate, relative to the left edge of @@ -1378,9 +1456,13 @@ typedef void (* GLFWmousebuttonfun)(GLFWwindow*,int,int,int); */ typedef void (* GLFWcursorposfun)(GLFWwindow*,double,double); -/*! @brief The function signature for cursor enter/leave callbacks. +/*! @brief The function pointer type for cursor enter/leave callbacks. * - * This is the function signature for cursor enter/leave callback functions. + * This is the function pointer type for cursor enter/leave callbacks. + * A cursor enter/leave callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, int entered) + * @endcode * * @param[in] window The window that received the event. * @param[in] entered `GLFW_TRUE` if the cursor entered the window's content @@ -1395,9 +1477,13 @@ typedef void (* GLFWcursorposfun)(GLFWwindow*,double,double); */ typedef void (* GLFWcursorenterfun)(GLFWwindow*,int); -/*! @brief The function signature for scroll callbacks. +/*! @brief The function pointer type for scroll callbacks. * - * This is the function signature for scroll callback functions. + * This is the function pointer type for scroll callbacks. A scroll callback + * function has the following signature: + * @code + * void function_name(GLFWwindow* window, double xoffset, double yoffset) + * @endcode * * @param[in] window The window that received the event. * @param[in] xoffset The scroll offset along the x-axis. @@ -1412,14 +1498,19 @@ typedef void (* GLFWcursorenterfun)(GLFWwindow*,int); */ typedef void (* GLFWscrollfun)(GLFWwindow*,double,double); -/*! @brief The function signature for keyboard key callbacks. +/*! @brief The function pointer type for keyboard key callbacks. * - * This is the function signature for keyboard key callback functions. + * This is the function pointer type for keyboard key callbacks. A keyboard + * key callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, int key, int scancode, int action, int mods) + * @endcode * * @param[in] window The window that received the event. * @param[in] key The [keyboard key](@ref keys) that was pressed or released. * @param[in] scancode The system-specific scancode of the key. - * @param[in] action `GLFW_PRESS`, `GLFW_RELEASE` or `GLFW_REPEAT`. + * @param[in] action `GLFW_PRESS`, `GLFW_RELEASE` or `GLFW_REPEAT`. Future + * releases may add more actions. * @param[in] mods Bit field describing which [modifier keys](@ref mods) were * held down. * @@ -1433,9 +1524,13 @@ typedef void (* GLFWscrollfun)(GLFWwindow*,double,double); */ typedef void (* GLFWkeyfun)(GLFWwindow*,int,int,int,int); -/*! @brief The function signature for Unicode character callbacks. +/*! @brief The function pointer type for Unicode character callbacks. * - * This is the function signature for Unicode character callback functions. + * This is the function pointer type for Unicode character callbacks. + * A Unicode character callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, unsigned int codepoint) + * @endcode * * @param[in] window The window that received the event. * @param[in] codepoint The Unicode code point of the character. @@ -1450,12 +1545,16 @@ typedef void (* GLFWkeyfun)(GLFWwindow*,int,int,int,int); */ typedef void (* GLFWcharfun)(GLFWwindow*,unsigned int); -/*! @brief The function signature for Unicode character with modifiers +/*! @brief The function pointer type for Unicode character with modifiers * callbacks. * - * This is the function signature for Unicode character with modifiers callback - * functions. It is called for each input character, regardless of what - * modifier keys are held down. + * This is the function pointer type for Unicode character with modifiers + * callbacks. It is called for each input character, regardless of what + * modifier keys are held down. A Unicode character with modifiers callback + * function has the following signature: + * @code + * void function_name(GLFWwindow* window, unsigned int codepoint, int mods) + * @endcode * * @param[in] window The window that received the event. * @param[in] codepoint The Unicode code point of the character. @@ -1473,14 +1572,21 @@ typedef void (* GLFWcharfun)(GLFWwindow*,unsigned int); */ typedef void (* GLFWcharmodsfun)(GLFWwindow*,unsigned int,int); -/*! @brief The function signature for file drop callbacks. +/*! @brief The function pointer type for path drop callbacks. * - * This is the function signature for file drop callbacks. + * This is the function pointer type for path drop callbacks. A path drop + * callback function has the following signature: + * @code + * void function_name(GLFWwindow* window, int path_count, const char* paths[]) + * @endcode * * @param[in] window The window that received the event. - * @param[in] count The number of dropped files. + * @param[in] path_count The number of dropped paths. * @param[in] paths The UTF-8 encoded file and/or directory path names. * + * @pointer_lifetime The path array and its strings are valid until the + * callback function returns. + * * @sa @ref path_drop * @sa @ref glfwSetDropCallback * @@ -1488,15 +1594,19 @@ typedef void (* GLFWcharmodsfun)(GLFWwindow*,unsigned int,int); * * @ingroup input */ -typedef void (* GLFWdropfun)(GLFWwindow*,int,const char**); +typedef void (* GLFWdropfun)(GLFWwindow*,int,const char*[]); -/*! @brief The function signature for monitor configuration callbacks. +/*! @brief The function pointer type for monitor configuration callbacks. * - * This is the function signature for monitor configuration callback functions. + * This is the function pointer type for monitor configuration callbacks. + * A monitor callback function has the following signature: + * @code + * void function_name(GLFWmonitor* monitor, int event) + * @endcode * * @param[in] monitor The monitor that was connected or disconnected. - * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. Remaining - * values reserved for future use. + * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. Future + * releases may add more events. * * @sa @ref monitor_event * @sa @ref glfwSetMonitorCallback @@ -1507,14 +1617,17 @@ typedef void (* GLFWdropfun)(GLFWwindow*,int,const char**); */ typedef void (* GLFWmonitorfun)(GLFWmonitor*,int); -/*! @brief The function signature for joystick configuration callbacks. +/*! @brief The function pointer type for joystick configuration callbacks. * - * This is the function signature for joystick configuration callback - * functions. + * This is the function pointer type for joystick configuration callbacks. + * A joystick configuration callback function has the following signature: + * @code + * void function_name(int jid, int event) + * @endcode * * @param[in] jid The joystick that was connected or disconnected. - * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. Remaining - * values reserved for future use. + * @param[in] event One of `GLFW_CONNECTED` or `GLFW_DISCONNECTED`. Future + * releases may add more events. * * @sa @ref joystick_event * @sa @ref glfwSetJoystickCallback @@ -1665,6 +1778,10 @@ typedef struct GLFWgamepadstate * bundle, if present. This can be disabled with the @ref * GLFW_COCOA_CHDIR_RESOURCES init hint. * + * @remark @x11 This function will set the `LC_CTYPE` category of the + * application locale according to the current environment if that category is + * still "C". This is because the "C" locale breaks Unicode text input. + * * @thread_safety This function must only be called from the main thread. * * @sa @ref intro_init @@ -1688,6 +1805,8 @@ GLFWAPI int glfwInit(void); * call this function, as it is called by @ref glfwInit before it returns * failure. * + * This function has no effect if GLFW is not initialized. + * * @errors Possible errors include @ref GLFW_PLATFORM_ERROR. * * @remark This function may be called before @ref glfwInit. @@ -1849,10 +1968,17 @@ GLFWAPI int glfwGetError(const char** description); * Once set, the error callback remains set even after the library has been * terminated. * - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set. * + * @callback_signature + * @code + * void callback_name(int error_code, const char* description) + * @endcode + * For more information about the callback parameters, see the + * [callback pointer type](@ref GLFWerrorfun). + * * @errors None. * * @remark This function may be called before @ref glfwInit. @@ -1866,7 +1992,7 @@ GLFWAPI int glfwGetError(const char** description); * * @ingroup init */ -GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun); +GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun callback); /*! @brief Returns the currently connected monitors. * @@ -1946,7 +2072,7 @@ GLFWAPI GLFWmonitor* glfwGetPrimaryMonitor(void); */ GLFWAPI void glfwGetMonitorPos(GLFWmonitor* monitor, int* xpos, int* ypos); -/*! @brief Retrives the work area of the monitor. +/*! @brief Retrieves the work area of the monitor. * * This function returns the position, in screen coordinates, of the upper-left * corner of the work area of the specified monitor along with the work area @@ -2125,11 +2251,18 @@ GLFWAPI void* glfwGetMonitorUserPointer(GLFWmonitor* monitor); * currently set callback. This is called when a monitor is connected to or * disconnected from the system. * - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWmonitor* monitor, int event) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWmonitorfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -2140,7 +2273,7 @@ GLFWAPI void* glfwGetMonitorUserPointer(GLFWmonitor* monitor); * * @ingroup monitor */ -GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun cbfun); +GLFWAPI GLFWmonitorfun glfwSetMonitorCallback(GLFWmonitorfun callback); /*! @brief Returns the available video modes for the specified monitor. * @@ -2223,7 +2356,7 @@ GLFWAPI const GLFWvidmode* glfwGetVideoMode(GLFWmonitor* monitor); * @errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref * GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR. * - * @remark @wayland Gamma handling is a priviledged protocol, this function + * @remark @wayland Gamma handling is a privileged protocol, this function * will thus never be implemented and emits @ref GLFW_PLATFORM_ERROR. * * @thread_safety This function must only be called from the main thread. @@ -2247,7 +2380,7 @@ GLFWAPI void glfwSetGamma(GLFWmonitor* monitor, float gamma); * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref * GLFW_PLATFORM_ERROR. * - * @remark @wayland Gamma handling is a priviledged protocol, this function + * @remark @wayland Gamma handling is a privileged protocol, this function * will thus never be implemented and emits @ref GLFW_PLATFORM_ERROR while * returning `NULL`. * @@ -2291,7 +2424,7 @@ GLFWAPI const GLFWgammaramp* glfwGetGammaRamp(GLFWmonitor* monitor); * * @remark @win32 The gamma ramp size must be 256. * - * @remark @wayland Gamma handling is a priviledged protocol, this function + * @remark @wayland Gamma handling is a privileged protocol, this function * will thus never be implemented and emits @ref GLFW_PLATFORM_ERROR. * * @pointer_lifetime The specified gamma ramp is copied before this function @@ -2510,7 +2643,7 @@ GLFWAPI void glfwWindowHintString(int hint, const char* value); * * @remark @macos When activating frame autosaving with * [GLFW_COCOA_FRAME_NAME](@ref GLFW_COCOA_FRAME_NAME_hint), the specified - * window size and position may be overriden by previously saved values. + * window size and position may be overridden by previously saved values. * * @remark @x11 Some window managers will not respect the placement of * initially hidden windows. @@ -3477,11 +3610,18 @@ GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* window); * area of the window. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int xpos, int ypos) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWwindowposfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @remark @wayland This callback will never be called, as there is no way for @@ -3495,7 +3635,7 @@ GLFWAPI void* glfwGetWindowUserPointer(GLFWwindow* window); * * @ingroup window */ -GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindowposfun cbfun); +GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindowposfun callback); /*! @brief Sets the size callback for the specified window. * @@ -3504,11 +3644,18 @@ GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindow * in screen coordinates, of the content area of the window. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int width, int height) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWwindowsizefun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -3520,7 +3667,7 @@ GLFWAPI GLFWwindowposfun glfwSetWindowPosCallback(GLFWwindow* window, GLFWwindow * * @ingroup window */ -GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun cbfun); +GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwindowsizefun callback); /*! @brief Sets the close callback for the specified window. * @@ -3534,11 +3681,18 @@ GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwind * The close callback is not triggered by @ref glfwDestroyWindow. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWwindowclosefun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @remark @macos Selecting Quit from the application menu will trigger the @@ -3553,7 +3707,7 @@ GLFWAPI GLFWwindowsizefun glfwSetWindowSizeCallback(GLFWwindow* window, GLFWwind * * @ingroup window */ -GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwindowclosefun cbfun); +GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwindowclosefun callback); /*! @brief Sets the refresh callback for the specified window. * @@ -3566,11 +3720,18 @@ GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwi * very infrequently or never at all. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window); + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWwindowrefreshfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -3582,7 +3743,7 @@ GLFWAPI GLFWwindowclosefun glfwSetWindowCloseCallback(GLFWwindow* window, GLFWwi * * @ingroup window */ -GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GLFWwindowrefreshfun cbfun); +GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GLFWwindowrefreshfun callback); /*! @brief Sets the focus callback for the specified window. * @@ -3595,11 +3756,18 @@ GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GL * and @ref glfwSetMouseButtonCallback. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int focused) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWwindowfocusfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -3610,7 +3778,7 @@ GLFWAPI GLFWwindowrefreshfun glfwSetWindowRefreshCallback(GLFWwindow* window, GL * * @ingroup window */ -GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwindowfocusfun cbfun); +GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwindowfocusfun callback); /*! @brief Sets the iconify callback for the specified window. * @@ -3618,11 +3786,18 @@ GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwi * is called when the window is iconified or restored. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int iconified) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWwindowiconifyfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @remark @wayland The wl_shell protocol has no concept of iconification, @@ -3636,7 +3811,7 @@ GLFWAPI GLFWwindowfocusfun glfwSetWindowFocusCallback(GLFWwindow* window, GLFWwi * * @ingroup window */ -GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GLFWwindowiconifyfun cbfun); +GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GLFWwindowiconifyfun callback); /*! @brief Sets the maximize callback for the specified window. * @@ -3644,11 +3819,18 @@ GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GL * is called when the window is maximized or restored. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int maximized) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWwindowmaximizefun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -3659,7 +3841,7 @@ GLFWAPI GLFWwindowiconifyfun glfwSetWindowIconifyCallback(GLFWwindow* window, GL * * @ingroup window */ -GLFWAPI GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow* window, GLFWwindowmaximizefun cbfun); +GLFWAPI GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow* window, GLFWwindowmaximizefun callback); /*! @brief Sets the framebuffer resize callback for the specified window. * @@ -3667,11 +3849,18 @@ GLFWAPI GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow* window, * which is called when the framebuffer of the specified window is resized. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int width, int height) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWframebuffersizefun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -3682,7 +3871,7 @@ GLFWAPI GLFWwindowmaximizefun glfwSetWindowMaximizeCallback(GLFWwindow* window, * * @ingroup window */ -GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window, GLFWframebuffersizefun cbfun); +GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window, GLFWframebuffersizefun callback); /*! @brief Sets the window content scale callback for the specified window. * @@ -3690,11 +3879,18 @@ GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window * which is called when the content scale of the specified window changes. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, float xscale, float yscale) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWwindowcontentscalefun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -3706,7 +3902,7 @@ GLFWAPI GLFWframebuffersizefun glfwSetFramebufferSizeCallback(GLFWwindow* window * * @ingroup window */ -GLFWAPI GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(GLFWwindow* window, GLFWwindowcontentscalefun cbfun); +GLFWAPI GLFWwindowcontentscalefun glfwSetWindowContentScaleCallback(GLFWwindow* window, GLFWwindowcontentscalefun callback); /*! @brief Processes all pending events. * @@ -4028,9 +4224,11 @@ GLFWAPI int glfwRawMouseMotionSupported(void); * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref * GLFW_PLATFORM_ERROR. * + * @remark The contents of the returned string may change when a keyboard + * layout change event is received. + * * @pointer_lifetime The returned string is allocated and freed by GLFW. You - * should not free it yourself. It is valid until the next call to @ref - * glfwGetKeyName, or until the library is terminated. + * should not free it yourself. It is valid until the library is terminated. * * @thread_safety This function must only be called from the main thread. * @@ -4353,11 +4551,18 @@ GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor); * scancode may be zero. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new key callback, or `NULL` to remove the currently + * @param[in] callback The new key callback, or `NULL` to remove the currently * set callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int key, int scancode, int action, int mods) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWkeyfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -4369,7 +4574,7 @@ GLFWAPI void glfwSetCursor(GLFWwindow* window, GLFWcursor* cursor); * * @ingroup input */ -GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun); +GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun callback); /*! @brief Sets the Unicode character callback. * @@ -4389,11 +4594,18 @@ GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun); * on Windows. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, unsigned int codepoint) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWcharfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -4405,7 +4617,7 @@ GLFWAPI GLFWkeyfun glfwSetKeyCallback(GLFWwindow* window, GLFWkeyfun cbfun); * * @ingroup input */ -GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun); +GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun callback); /*! @brief Sets the Unicode character with modifiers callback. * @@ -4423,11 +4635,18 @@ GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun); * [key callback](@ref glfwSetKeyCallback) instead. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or an * [error](@ref error_handling) occurred. * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, unsigned int codepoint, int mods) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWcharmodsfun). + * * @deprecated Scheduled for removal in version 4.0. * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. @@ -4440,7 +4659,7 @@ GLFWAPI GLFWcharfun glfwSetCharCallback(GLFWwindow* window, GLFWcharfun cbfun); * * @ingroup input */ -GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmodsfun cbfun); +GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmodsfun callback); /*! @brief Sets the mouse button callback. * @@ -4454,11 +4673,18 @@ GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmods * [window focus callback](@ref glfwSetWindowFocusCallback) has been called. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int button, int action, int mods) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWmousebuttonfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -4470,7 +4696,7 @@ GLFWAPI GLFWcharmodsfun glfwSetCharModsCallback(GLFWwindow* window, GLFWcharmods * * @ingroup input */ -GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmousebuttonfun cbfun); +GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmousebuttonfun callback); /*! @brief Sets the cursor position callback. * @@ -4480,11 +4706,18 @@ GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmo * content area of the window. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, double xpos, double ypos); + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWcursorposfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -4495,20 +4728,27 @@ GLFWAPI GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow* window, GLFWmo * * @ingroup input */ -GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursorposfun cbfun); +GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursorposfun callback); -/*! @brief Sets the cursor enter/exit callback. +/*! @brief Sets the cursor enter/leave callback. * * This function sets the cursor boundary crossing callback of the specified * window, which is called when the cursor enters or leaves the content area of * the window. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int entered) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWcursorenterfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -4519,7 +4759,7 @@ GLFWAPI GLFWcursorposfun glfwSetCursorPosCallback(GLFWwindow* window, GLFWcursor * * @ingroup input */ -GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcursorenterfun cbfun); +GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcursorenterfun callback); /*! @brief Sets the scroll callback. * @@ -4531,11 +4771,18 @@ GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcu * wheel or a touchpad scrolling area. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new scroll callback, or `NULL` to remove the currently - * set callback. + * @param[in] callback The new scroll callback, or `NULL` to remove the + * currently set callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, double xoffset, double yoffset) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWscrollfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -4546,12 +4793,12 @@ GLFWAPI GLFWcursorenterfun glfwSetCursorEnterCallback(GLFWwindow* window, GLFWcu * * @ingroup input */ -GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cbfun); +GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun callback); -/*! @brief Sets the file drop callback. +/*! @brief Sets the path drop callback. * - * This function sets the file drop callback of the specified window, which is - * called when one or more dragged files are dropped on the window. + * This function sets the path drop callback of the specified window, which is + * called when one or more dragged paths are dropped on the window. * * Because the path array and its strings may have been generated specifically * for that event, they are not guaranteed to be valid after the callback has @@ -4559,11 +4806,18 @@ GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cb * make a deep copy. * * @param[in] window The window whose callback to set. - * @param[in] cbfun The new file drop callback, or `NULL` to remove the + * @param[in] callback The new file drop callback, or `NULL` to remove the * currently set callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(GLFWwindow* window, int path_count, const char* paths[]) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWdropfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @remark @wayland File drop is currently unimplemented. @@ -4576,7 +4830,7 @@ GLFWAPI GLFWscrollfun glfwSetScrollCallback(GLFWwindow* window, GLFWscrollfun cb * * @ingroup input */ -GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun cbfun); +GLFWAPI GLFWdropfun glfwSetDropCallback(GLFWwindow* window, GLFWdropfun callback); /*! @brief Returns whether the specified joystick is present. * @@ -4764,7 +5018,7 @@ GLFWAPI const unsigned char* glfwGetJoystickHats(int jid, int* count); */ GLFWAPI const char* glfwGetJoystickName(int jid); -/*! @brief Returns the SDL comaptible GUID of the specified joystick. +/*! @brief Returns the SDL compatible GUID of the specified joystick. * * This function returns the SDL compatible GUID, as a UTF-8 encoded * hexadecimal string, of the specified joystick. The returned string is @@ -4895,11 +5149,18 @@ GLFWAPI int glfwJoystickIsGamepad(int jid); * called by joystick functions. The function will then return whatever it * returns if the joystick is not present. * - * @param[in] cbfun The new callback, or `NULL` to remove the currently set + * @param[in] callback The new callback, or `NULL` to remove the currently set * callback. * @return The previously set callback, or `NULL` if no callback was set or the * library had not been [initialized](@ref intro_init). * + * @callback_signature + * @code + * void function_name(int jid, int event) + * @endcode + * For more information about the callback parameters, see the + * [function pointer type](@ref GLFWjoystickfun). + * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function must only be called from the main thread. @@ -4910,7 +5171,7 @@ GLFWAPI int glfwJoystickIsGamepad(int jid); * * @ingroup input */ -GLFWAPI GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun cbfun); +GLFWAPI GLFWjoystickfun glfwSetJoystickCallback(GLFWjoystickfun callback); /*! @brief Adds the specified SDL_GameControllerDB gamepad mappings. * @@ -4978,7 +5239,7 @@ GLFWAPI const char* glfwGetGamepadName(int jid); /*! @brief Retrieves the state of the specified joystick remapped as a gamepad. * - * This function retrives the state of the specified joystick remapped to + * This function retrieves the state of the specified joystick remapped to * an Xbox-like gamepad. * * If the specified joystick is not present or does not have a gamepad mapping @@ -5069,23 +5330,26 @@ GLFWAPI void glfwSetClipboardString(GLFWwindow* window, const char* string); */ GLFWAPI const char* glfwGetClipboardString(GLFWwindow* window); -/*! @brief Returns the value of the GLFW timer. +/*! @brief Returns the GLFW time. + * + * This function returns the current GLFW time, in seconds. Unless the time + * has been set using @ref glfwSetTime it measures time elapsed since GLFW was + * initialized. * - * This function returns the value of the GLFW timer. Unless the timer has - * been set using @ref glfwSetTime, the timer measures time elapsed since GLFW - * was initialized. + * This function and @ref glfwSetTime are helper functions on top of @ref + * glfwGetTimerFrequency and @ref glfwGetTimerValue. * * The resolution of the timer is system dependent, but is usually on the order * of a few micro- or nanoseconds. It uses the highest-resolution monotonic * time source on each supported platform. * - * @return The current value, in seconds, or zero if an + * @return The current time, in seconds, or zero if an * [error](@ref error_handling) occurred. * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED. * * @thread_safety This function may be called from any thread. Reading and - * writing of the internal timer offset is not atomic, so it needs to be + * writing of the internal base time is not atomic, so it needs to be * externally synchronized with calls to @ref glfwSetTime. * * @sa @ref time @@ -5096,23 +5360,26 @@ GLFWAPI const char* glfwGetClipboardString(GLFWwindow* window); */ GLFWAPI double glfwGetTime(void); -/*! @brief Sets the GLFW timer. +/*! @brief Sets the GLFW time. + * + * This function sets the current GLFW time, in seconds. The value must be + * a positive finite number less than or equal to 18446744073.0, which is + * approximately 584.5 years. * - * This function sets the value of the GLFW timer. It then continues to count - * up from that value. The value must be a positive finite number less than - * or equal to 18446744073.0, which is approximately 584.5 years. + * This function and @ref glfwGetTime are helper functions on top of @ref + * glfwGetTimerFrequency and @ref glfwGetTimerValue. * * @param[in] time The new value, in seconds. * * @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref * GLFW_INVALID_VALUE. * - * @remark The upper limit of the timer is calculated as + * @remark The upper limit of GLFW time is calculated as * floor((264 - 1) / 109) and is due to implementations * storing nanoseconds in 64 bits. The limit may be increased in the future. * * @thread_safety This function may be called from any thread. Reading and - * writing of the internal timer offset is not atomic, so it needs to be + * writing of the internal base time is not atomic, so it needs to be * externally synchronized with calls to @ref glfwGetTime. * * @sa @ref time @@ -5416,7 +5683,7 @@ GLFWAPI int glfwVulkanSupported(void); * * This function returns an array of names of Vulkan instance extensions required * by GLFW for creating Vulkan surfaces for GLFW windows. If successful, the - * list will always contains `VK_KHR_surface`, so if you don't require any + * list will always contain `VK_KHR_surface`, so if you don't require any * additional extensions you can pass this list directly to the * `VkInstanceCreateInfo` struct. * @@ -5441,8 +5708,9 @@ GLFWAPI int glfwVulkanSupported(void); * returned array, as it is an error to specify an extension more than once in * the `VkInstanceCreateInfo` struct. * - * @remark @macos This function currently only supports the - * `VK_MVK_macos_surface` extension from MoltenVK. + * @remark @macos This function currently supports either the + * `VK_MVK_macos_surface` extension from MoltenVK or `VK_EXT_metal_surface` + * extension. * * @pointer_lifetime The returned array is allocated and freed by GLFW. You * should not free it yourself. It is guaranteed to be valid only until the diff --git a/external/glfw3/prebuilt/linux/libglfw3.a b/external/glfw3/prebuilt/linux/libglfw3.a index 7de1d9fb..05532364 100644 Binary files a/external/glfw3/prebuilt/linux/libglfw3.a and b/external/glfw3/prebuilt/linux/libglfw3.a differ diff --git a/external/glfw3/prebuilt/mac/libglfw3.a b/external/glfw3/prebuilt/mac/libglfw3.a index dff02a00..dc3ab4d7 100644 Binary files a/external/glfw3/prebuilt/mac/libglfw3.a and b/external/glfw3/prebuilt/mac/libglfw3.a differ diff --git a/external/glfw3/prebuilt/win32/glfw3.lib b/external/glfw3/prebuilt/win32/glfw3.lib old mode 100755 new mode 100644 index e73beff2..81a081d1 Binary files a/external/glfw3/prebuilt/win32/glfw3.lib and b/external/glfw3/prebuilt/win32/glfw3.lib differ diff --git a/external/glsl-optimizer/prebuilt/mac/libglcpp-library.a b/external/glsl-optimizer/prebuilt/mac/libglcpp-library.a index 536cc135..c47abece 100644 Binary files a/external/glsl-optimizer/prebuilt/mac/libglcpp-library.a and b/external/glsl-optimizer/prebuilt/mac/libglcpp-library.a differ diff --git a/external/glsl-optimizer/prebuilt/mac/libglsl_optimizer.a b/external/glsl-optimizer/prebuilt/mac/libglsl_optimizer.a index c61cd518..f94bd17f 100644 Binary files a/external/glsl-optimizer/prebuilt/mac/libglsl_optimizer.a and b/external/glsl-optimizer/prebuilt/mac/libglsl_optimizer.a differ diff --git a/external/glsl-optimizer/prebuilt/mac/libmesa.a b/external/glsl-optimizer/prebuilt/mac/libmesa.a index 56f08076..4de6c363 100644 Binary files a/external/glsl-optimizer/prebuilt/mac/libmesa.a and b/external/glsl-optimizer/prebuilt/mac/libmesa.a differ diff --git a/external/jpeg/include/mac/jconfig.h b/external/jpeg/include/mac/jconfig.h old mode 100755 new mode 100644 index c561e3ce..2d05a3b0 --- a/external/jpeg/include/mac/jconfig.h +++ b/external/jpeg/include/mac/jconfig.h @@ -18,13 +18,19 @@ /* Define this if you get warnings about undefined structures. */ /* #undef INCOMPLETE_TYPES_BROKEN */ -/* Define "boolean" as unsigned char, not int, on Windows systems. */ -//#ifdef _WIN32 +/* Define "boolean" as unsigned char, not enum, on Windows systems. */ +#ifdef _WIN32 #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ typedef unsigned char boolean; #endif +#ifndef FALSE /* in case these macros already exist */ +#define FALSE 0 /* values of boolean */ +#endif +#ifndef TRUE +#define TRUE 1 +#endif #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ -//#endif +#endif #ifdef JPEG_INTERNALS diff --git a/external/jpeg/include/mac/jerror.h b/external/jpeg/include/mac/jerror.h new file mode 100644 index 00000000..a4b661f7 --- /dev/null +++ b/external/jpeg/include/mac/jerror.h @@ -0,0 +1,304 @@ +/* + * jerror.h + * + * Copyright (C) 1994-1997, Thomas G. Lane. + * Modified 1997-2012 by Guido Vollbeding. + * This file is part of the Independent JPEG Group's software. + * For conditions of distribution and use, see the accompanying README file. + * + * This file defines the error and message codes for the JPEG library. + * Edit this file to add new codes, or to translate the message strings to + * some other language. + * A set of error-reporting macros are defined too. Some applications using + * the JPEG library may wish to include this file to get the error codes + * and/or the macros. + */ + +/* + * To define the enum list of message codes, include this file without + * defining macro JMESSAGE. To create a message string table, include it + * again with a suitable JMESSAGE definition (see jerror.c for an example). + */ +#ifndef JMESSAGE +#ifndef JERROR_H +/* First time through, define the enum list */ +#define JMAKE_ENUM_LIST +#else +/* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */ +#define JMESSAGE(code,string) +#endif /* JERROR_H */ +#endif /* JMESSAGE */ + +#ifdef JMAKE_ENUM_LIST + +typedef enum { + +#define JMESSAGE(code,string) code , + +#endif /* JMAKE_ENUM_LIST */ + +JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */ + +/* For maintenance convenience, list is alphabetical by message code name */ +JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix") +JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix") +JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode") +JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS") +JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request") +JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range") +JMESSAGE(JERR_BAD_DCTSIZE, "DCT scaled block size %dx%d not supported") +JMESSAGE(JERR_BAD_DROP_SAMPLING, + "Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c") +JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition") +JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace") +JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace") +JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length") +JMESSAGE(JERR_BAD_LIB_VERSION, + "Wrong JPEG library version: library is %d, caller expects %d") +JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan") +JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d") +JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d") +JMESSAGE(JERR_BAD_PROGRESSION, + "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d") +JMESSAGE(JERR_BAD_PROG_SCRIPT, + "Invalid progressive parameters at scan script entry %d") +JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors") +JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d") +JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d") +JMESSAGE(JERR_BAD_STRUCT_SIZE, + "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u") +JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access") +JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small") +JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here") +JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet") +JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d") +JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request") +JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d") +JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x") +JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d") +JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d") +JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)") +JMESSAGE(JERR_EMS_READ, "Read from EMS failed") +JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed") +JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan") +JMESSAGE(JERR_FILE_READ, "Input file read error") +JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?") +JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet") +JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow") +JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry") +JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels") +JMESSAGE(JERR_INPUT_EMPTY, "Empty input file") +JMESSAGE(JERR_INPUT_EOF, "Premature end of input file") +JMESSAGE(JERR_MISMATCHED_QUANT_TABLE, + "Cannot transcode due to multiple use of quantization table %d") +JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data") +JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change") +JMESSAGE(JERR_NOTIMPL, "Not implemented yet") +JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time") +JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined") +JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported") +JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined") +JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image") +JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined") +JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x") +JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)") +JMESSAGE(JERR_QUANT_COMPONENTS, + "Cannot quantize more than %d color components") +JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors") +JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors") +JMESSAGE(JERR_SOF_BEFORE, "Invalid JPEG file structure: %s before SOF") +JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers") +JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker") +JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x") +JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers") +JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s") +JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file") +JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file") +JMESSAGE(JERR_TFILE_WRITE, + "Write failed on temporary file --- out of disk space?") +JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines") +JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x") +JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up") +JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation") +JMESSAGE(JERR_XMS_READ, "Read from XMS failed") +JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed") +JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT) +JMESSAGE(JMSG_VERSION, JVERSION) +JMESSAGE(JTRC_16BIT_TABLES, + "Caution: quantization tables are too coarse for baseline JPEG") +JMESSAGE(JTRC_ADOBE, + "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d") +JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u") +JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u") +JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x") +JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x") +JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d") +JMESSAGE(JTRC_DRI, "Define Restart Interval %u") +JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u") +JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u") +JMESSAGE(JTRC_EOI, "End Of Image") +JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d") +JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d") +JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE, + "Warning: thumbnail image size does not match data length %u") +JMESSAGE(JTRC_JFIF_EXTENSION, + "JFIF extension marker: type 0x%02x, length %u") +JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image") +JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u") +JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x") +JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u") +JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors") +JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors") +JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization") +JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d") +JMESSAGE(JTRC_RST, "RST%d") +JMESSAGE(JTRC_SMOOTH_NOTIMPL, + "Smoothing not supported with nonstandard sampling ratios") +JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d") +JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d") +JMESSAGE(JTRC_SOI, "Start of Image") +JMESSAGE(JTRC_SOS, "Start Of Scan: %d components") +JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d") +JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d") +JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s") +JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s") +JMESSAGE(JTRC_THUMB_JPEG, + "JFIF extension marker: JPEG-compressed thumbnail image, length %u") +JMESSAGE(JTRC_THUMB_PALETTE, + "JFIF extension marker: palette thumbnail image, length %u") +JMESSAGE(JTRC_THUMB_RGB, + "JFIF extension marker: RGB thumbnail image, length %u") +JMESSAGE(JTRC_UNKNOWN_IDS, + "Unrecognized component IDs %d %d %d, assuming YCbCr") +JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u") +JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u") +JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d") +JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code") +JMESSAGE(JWRN_BOGUS_PROGRESSION, + "Inconsistent progression sequence for component %d coefficient %d") +JMESSAGE(JWRN_EXTRANEOUS_DATA, + "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x") +JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment") +JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code") +JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d") +JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file") +JMESSAGE(JWRN_MUST_RESYNC, + "Corrupt JPEG data: found marker 0x%02x instead of RST%d") +JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG") +JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines") + +#ifdef JMAKE_ENUM_LIST + + JMSG_LASTMSGCODE +} J_MESSAGE_CODE; + +#undef JMAKE_ENUM_LIST +#endif /* JMAKE_ENUM_LIST */ + +/* Zap JMESSAGE macro so that future re-inclusions do nothing by default */ +#undef JMESSAGE + + +#ifndef JERROR_H +#define JERROR_H + +/* Macros to simplify using the error and trace message stuff */ +/* The first parameter is either type of cinfo pointer */ + +/* Fatal errors (print message and exit) */ +#define ERREXIT(cinfo,code) \ + ((cinfo)->err->msg_code = (code), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT1(cinfo,code,p1) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT2(cinfo,code,p1,p2) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT3(cinfo,code,p1,p2,p3) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (cinfo)->err->msg_parm.i[2] = (p3), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT4(cinfo,code,p1,p2,p3,p4) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (cinfo)->err->msg_parm.i[2] = (p3), \ + (cinfo)->err->msg_parm.i[3] = (p4), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXIT6(cinfo,code,p1,p2,p3,p4,p5,p6) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (cinfo)->err->msg_parm.i[2] = (p3), \ + (cinfo)->err->msg_parm.i[3] = (p4), \ + (cinfo)->err->msg_parm.i[4] = (p5), \ + (cinfo)->err->msg_parm.i[5] = (p6), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) +#define ERREXITS(cinfo,code,str) \ + ((cinfo)->err->msg_code = (code), \ + strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ + (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) + +#define MAKESTMT(stuff) do { stuff } while (0) + +/* Nonfatal errors (we can keep going, but the data is probably corrupt) */ +#define WARNMS(cinfo,code) \ + ((cinfo)->err->msg_code = (code), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) +#define WARNMS1(cinfo,code,p1) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) +#define WARNMS2(cinfo,code,p1,p2) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) + +/* Informational/debugging messages */ +#define TRACEMS(cinfo,lvl,code) \ + ((cinfo)->err->msg_code = (code), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) +#define TRACEMS1(cinfo,lvl,code,p1) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) +#define TRACEMS2(cinfo,lvl,code,p1,p2) \ + ((cinfo)->err->msg_code = (code), \ + (cinfo)->err->msg_parm.i[0] = (p1), \ + (cinfo)->err->msg_parm.i[1] = (p2), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) +#define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \ + MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ + _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \ + (cinfo)->err->msg_code = (code); \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) +#define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \ + MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ + _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ + (cinfo)->err->msg_code = (code); \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) +#define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \ + MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ + _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ + _mp[4] = (p5); \ + (cinfo)->err->msg_code = (code); \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) +#define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \ + MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ + _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ + _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \ + (cinfo)->err->msg_code = (code); \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) +#define TRACEMSS(cinfo,lvl,code,str) \ + ((cinfo)->err->msg_code = (code), \ + strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ + (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) + +#endif /* JERROR_H */ diff --git a/external/jpeg/include/mac/jmorecfg.h b/external/jpeg/include/mac/jmorecfg.h old mode 100755 new mode 100644 index 2407edbe..679d68bd --- a/external/jpeg/include/mac/jmorecfg.h +++ b/external/jpeg/include/mac/jmorecfg.h @@ -2,7 +2,7 @@ * jmorecfg.h * * Copyright (C) 1991-1997, Thomas G. Lane. - * Modified 1997-2012 by Guido Vollbeding. + * Modified 1997-2013 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -15,13 +15,22 @@ /* * Define BITS_IN_JSAMPLE as either * 8 for 8-bit sample values (the usual setting) + * 9 for 9-bit sample values + * 10 for 10-bit sample values + * 11 for 11-bit sample values * 12 for 12-bit sample values - * Only 8 and 12 are legal data precisions for lossy JPEG according to the - * JPEG standard, and the IJG code does not support anything else! - * We do not support run-time selection of data precision, sorry. + * Only 8, 9, 10, 11, and 12 bits sample data precision are supported for + * full-feature DCT processing. Further depths up to 16-bit may be added + * later for the lossless modes of operation. + * Run-time selection and conversion of data precision will be added later + * and are currently not supported, sorry. + * Exception: The transcoding part (jpegtran) supports all settings in a + * single instance, since it operates on the level of DCT coefficients and + * not sample values. The DCT coefficients are of the same type (16 bits) + * in all cases (see below). */ -#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */ +#define BITS_IN_JSAMPLE 8 /* use 8, 9, 10, 11, or 12 */ /* @@ -77,6 +86,48 @@ typedef char JSAMPLE; #endif /* BITS_IN_JSAMPLE == 8 */ +#if BITS_IN_JSAMPLE == 9 +/* JSAMPLE should be the smallest type that will hold the values 0..511. + * On nearly all machines "short" will do nicely. + */ + +typedef short JSAMPLE; +#define GETJSAMPLE(value) ((int) (value)) + +#define MAXJSAMPLE 511 +#define CENTERJSAMPLE 256 + +#endif /* BITS_IN_JSAMPLE == 9 */ + + +#if BITS_IN_JSAMPLE == 10 +/* JSAMPLE should be the smallest type that will hold the values 0..1023. + * On nearly all machines "short" will do nicely. + */ + +typedef short JSAMPLE; +#define GETJSAMPLE(value) ((int) (value)) + +#define MAXJSAMPLE 1023 +#define CENTERJSAMPLE 512 + +#endif /* BITS_IN_JSAMPLE == 10 */ + + +#if BITS_IN_JSAMPLE == 11 +/* JSAMPLE should be the smallest type that will hold the values 0..2047. + * On nearly all machines "short" will do nicely. + */ + +typedef short JSAMPLE; +#define GETJSAMPLE(value) ((int) (value)) + +#define MAXJSAMPLE 2047 +#define CENTERJSAMPLE 1024 + +#endif /* BITS_IN_JSAMPLE == 11 */ + + #if BITS_IN_JSAMPLE == 12 /* JSAMPLE should be the smallest type that will hold the values 0..4095. * On nearly all machines "short" will do nicely. @@ -252,7 +303,10 @@ typedef void noreturn_t; * Defining HAVE_BOOLEAN before including jpeglib.h should make it work. */ -#ifdef HAVE_BOOLEAN +#ifndef HAVE_BOOLEAN +#if defined FALSE || defined TRUE || defined QGLOBAL_H +/* Qt3 defines FALSE and TRUE as "const" variables in qglobal.h */ +typedef int boolean; #ifndef FALSE /* in case these macros already exist */ #define FALSE 0 /* values of boolean */ #endif @@ -262,6 +316,7 @@ typedef void noreturn_t; #else typedef enum { FALSE = 0, TRUE = 1 } boolean; #endif +#endif /* @@ -299,11 +354,12 @@ typedef enum { FALSE = 0, TRUE = 1 } boolean; #define C_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ #define DCT_SCALING_SUPPORTED /* Input rescaling via DCT? (Requires DCT_ISLOW)*/ #define ENTROPY_OPT_SUPPORTED /* Optimization of entropy coding parms? */ -/* Note: if you selected 12-bit data precision, it is dangerous to turn off - * ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only good for 8-bit - * precision, so jchuff.c normally uses entropy optimization to compute - * usable tables for higher precision. If you don't want to do optimization, - * you'll have to supply different default Huffman tables. +/* Note: if you selected more than 8-bit data precision, it is dangerous to + * turn off ENTROPY_OPT_SUPPORTED. The standard Huffman tables are only + * good for 8-bit precision, so arithmetic coding is recommended for higher + * precision. The Huffman encoder normally uses entropy optimization to + * compute usable tables for higher precision. Otherwise, you'll have to + * supply different default Huffman tables. * The exact same statements apply for progressive JPEG: the default tables * don't work for progressive mode. (This may get fixed, however.) */ @@ -314,7 +370,7 @@ typedef enum { FALSE = 0, TRUE = 1 } boolean; #define D_ARITH_CODING_SUPPORTED /* Arithmetic coding back end? */ #define D_MULTISCAN_FILES_SUPPORTED /* Multiple-scan JPEG files? */ #define D_PROGRESSIVE_SUPPORTED /* Progressive JPEG? (Requires MULTISCAN)*/ -#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? */ +#define IDCT_SCALING_SUPPORTED /* Output rescaling via IDCT? (Requires DCT_ISLOW)*/ #define SAVE_MARKERS_SUPPORTED /* jpeg_save_markers() needed? */ #define BLOCK_SMOOTHING_SUPPORTED /* Block smoothing? (Progressive only) */ #undef UPSAMPLE_SCALING_SUPPORTED /* Output rescaling at upsample stage? */ diff --git a/external/jpeg/include/mac/jpeglib.h b/external/jpeg/include/mac/jpeglib.h old mode 100755 new mode 100644 index 0a6dac44..939b50be --- a/external/jpeg/include/mac/jpeglib.h +++ b/external/jpeg/include/mac/jpeglib.h @@ -2,7 +2,7 @@ * jpeglib.h * * Copyright (C) 1991-1998, Thomas G. Lane. - * Modified 2002-2012 by Guido Vollbeding. + * Modified 2002-2015 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -39,12 +39,12 @@ extern "C" { #define JPEG_LIB_VERSION 90 /* Compatibility version 9.0 */ #define JPEG_LIB_VERSION_MAJOR 9 -#define JPEG_LIB_VERSION_MINOR 0 +#define JPEG_LIB_VERSION_MINOR 2 /* Various constants determining the sizes of things. - * All of these are specified by the JPEG standard, so don't change them - * if you want to be compatible. + * All of these are specified by the JPEG standard, + * so don't change them if you want to be compatible. */ #define DCTSIZE 8 /* The basic DCT block is 8x8 coefficients */ @@ -157,16 +157,21 @@ typedef struct { /* The downsampled dimensions are the component's actual, unpadded number * of samples at the main buffer (preprocessing/compression interface); * DCT scaling is included, so - * downsampled_width = ceil(image_width * Hi/Hmax * DCT_h_scaled_size/DCTSIZE) + * downsampled_width = + * ceil(image_width * Hi/Hmax * DCT_h_scaled_size/block_size) * and similarly for height. */ JDIMENSION downsampled_width; /* actual width in samples */ JDIMENSION downsampled_height; /* actual height in samples */ - /* This flag is used only for decompression. In cases where some of the - * components will be ignored (eg grayscale output from YCbCr image), - * we can skip most computations for the unused components. + /* For decompression, in cases where some of the components will be + * ignored (eg grayscale output from YCbCr image), we can skip most + * computations for the unused components. + * For compression, some of the components will need further quantization + * scale by factor of 2 after DCT (eg BG_YCC output from normal RGB input). + * The field is first set TRUE for decompression, FALSE for compression + * in initial_setup, and then adapted in color conversion setup. */ - boolean component_needed; /* do we need the value of this component? */ + boolean component_needed; /* These values are computed before starting a scan of the component. */ /* The decompressor output side may not use these variables. */ @@ -215,10 +220,12 @@ struct jpeg_marker_struct { typedef enum { JCS_UNKNOWN, /* error/unspecified */ JCS_GRAYSCALE, /* monochrome */ - JCS_RGB, /* red/green/blue */ - JCS_YCbCr, /* Y/Cb/Cr (also known as YUV) */ + JCS_RGB, /* red/green/blue, standard RGB (sRGB) */ + JCS_YCbCr, /* Y/Cb/Cr (also known as YUV), standard YCC */ JCS_CMYK, /* C/M/Y/K */ - JCS_YCCK /* Y/Cb/Cr/K */ + JCS_YCCK, /* Y/Cb/Cr/K */ + JCS_BG_RGB, /* big gamut red/green/blue, bg-sRGB */ + JCS_BG_YCC /* big gamut Y/Cb/Cr, bg-sYCC */ } J_COLOR_SPACE; /* Supported color transforms. */ @@ -972,7 +979,7 @@ EXTERN(void) jpeg_mem_dest JPP((j_compress_ptr cinfo, unsigned char ** outbuffer, unsigned long * outsize)); EXTERN(void) jpeg_mem_src JPP((j_decompress_ptr cinfo, - unsigned char * inbuffer, + const unsigned char * inbuffer, unsigned long insize)); /* Default parameter setup for compression */ diff --git a/external/jpeg/prebuilt/mac/libjpeg.a b/external/jpeg/prebuilt/mac/libjpeg.a old mode 100755 new mode 100644 index d8eeb3fe..65d6da0a Binary files a/external/jpeg/prebuilt/mac/libjpeg.a and b/external/jpeg/prebuilt/mac/libjpeg.a differ diff --git a/external/lua/luajit/prebuilt/linux/64-bit/libluajit.a b/external/lua/luajit/prebuilt/linux/64-bit/libluajit.a old mode 100755 new mode 100644 index ce527961..5e733189 Binary files a/external/lua/luajit/prebuilt/linux/64-bit/libluajit.a and b/external/lua/luajit/prebuilt/linux/64-bit/libluajit.a differ diff --git a/external/lua/luajit/prebuilt/mac/libluajit.a b/external/lua/luajit/prebuilt/mac/libluajit.a index 0df63e3f..f0200966 100644 Binary files a/external/lua/luajit/prebuilt/mac/libluajit.a and b/external/lua/luajit/prebuilt/mac/libluajit.a differ diff --git a/external/minimp3/minimp3.h b/external/minimp3/minimp3.h new file mode 100644 index 00000000..3220ae1a --- /dev/null +++ b/external/minimp3/minimp3.h @@ -0,0 +1,1865 @@ +#ifndef MINIMP3_H +#define MINIMP3_H +/* + https://github.com/lieff/minimp3 + To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. + This software is distributed without any warranty. + See . +*/ +#include + +#define MINIMP3_MAX_SAMPLES_PER_FRAME (1152*2) + +typedef struct +{ + int frame_bytes, frame_offset, channels, hz, layer, bitrate_kbps; +} mp3dec_frame_info_t; + +typedef struct +{ + float mdct_overlap[2][9*32], qmf_state[15*2*32]; + int reserv, free_format_bytes; + unsigned char header[4], reserv_buf[511]; +} mp3dec_t; + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +void mp3dec_init(mp3dec_t *dec); +#ifndef MINIMP3_FLOAT_OUTPUT +typedef int16_t mp3d_sample_t; +#else /* MINIMP3_FLOAT_OUTPUT */ +typedef float mp3d_sample_t; +void mp3dec_f32_to_s16(const float *in, int16_t *out, int num_samples); +#endif /* MINIMP3_FLOAT_OUTPUT */ +int mp3dec_decode_frame(mp3dec_t *dec, const uint8_t *mp3, int mp3_bytes, mp3d_sample_t *pcm, mp3dec_frame_info_t *info); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* MINIMP3_H */ +#if defined(MINIMP3_IMPLEMENTATION) && !defined(_MINIMP3_IMPLEMENTATION_GUARD) +#define _MINIMP3_IMPLEMENTATION_GUARD + +#include +#include + +#define MAX_FREE_FORMAT_FRAME_SIZE 2304 /* more than ISO spec's */ +#ifndef MAX_FRAME_SYNC_MATCHES +#define MAX_FRAME_SYNC_MATCHES 10 +#endif /* MAX_FRAME_SYNC_MATCHES */ + +#define MAX_L3_FRAME_PAYLOAD_BYTES MAX_FREE_FORMAT_FRAME_SIZE /* MUST be >= 320000/8/32000*1152 = 1440 */ + +#define MAX_BITRESERVOIR_BYTES 511 +#define SHORT_BLOCK_TYPE 2 +#define STOP_BLOCK_TYPE 3 +#define MODE_MONO 3 +#define MODE_JOINT_STEREO 1 +#define HDR_SIZE 4 +#define HDR_IS_MONO(h) (((h[3]) & 0xC0) == 0xC0) +#define HDR_IS_MS_STEREO(h) (((h[3]) & 0xE0) == 0x60) +#define HDR_IS_FREE_FORMAT(h) (((h[2]) & 0xF0) == 0) +#define HDR_IS_CRC(h) (!((h[1]) & 1)) +#define HDR_TEST_PADDING(h) ((h[2]) & 0x2) +#define HDR_TEST_MPEG1(h) ((h[1]) & 0x8) +#define HDR_TEST_NOT_MPEG25(h) ((h[1]) & 0x10) +#define HDR_TEST_I_STEREO(h) ((h[3]) & 0x10) +#define HDR_TEST_MS_STEREO(h) ((h[3]) & 0x20) +#define HDR_GET_STEREO_MODE(h) (((h[3]) >> 6) & 3) +#define HDR_GET_STEREO_MODE_EXT(h) (((h[3]) >> 4) & 3) +#define HDR_GET_LAYER(h) (((h[1]) >> 1) & 3) +#define HDR_GET_BITRATE(h) ((h[2]) >> 4) +#define HDR_GET_SAMPLE_RATE(h) (((h[2]) >> 2) & 3) +#define HDR_GET_MY_SAMPLE_RATE(h) (HDR_GET_SAMPLE_RATE(h) + (((h[1] >> 3) & 1) + ((h[1] >> 4) & 1))*3) +#define HDR_IS_FRAME_576(h) ((h[1] & 14) == 2) +#define HDR_IS_LAYER_1(h) ((h[1] & 6) == 6) + +#define BITS_DEQUANTIZER_OUT -1 +#define MAX_SCF (255 + BITS_DEQUANTIZER_OUT*4 - 210) +#define MAX_SCFI ((MAX_SCF + 3) & ~3) + +#define MINIMP3_MIN(a, b) ((a) > (b) ? (b) : (a)) +#define MINIMP3_MAX(a, b) ((a) < (b) ? (b) : (a)) + +#if !defined(MINIMP3_NO_SIMD) + +#if !defined(MINIMP3_ONLY_SIMD) && (defined(_M_X64) || defined(__x86_64__) || defined(__aarch64__) || defined(_M_ARM64)) +/* x64 always have SSE2, arm64 always have neon, no need for generic code */ +#define MINIMP3_ONLY_SIMD +#endif /* SIMD checks... */ + +#if (defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))) || ((defined(__i386__) || defined(__x86_64__)) && defined(__SSE2__)) +#if defined(_MSC_VER) +#include +#endif /* defined(_MSC_VER) */ +#include +#define HAVE_SSE 1 +#define HAVE_SIMD 1 +#define VSTORE _mm_storeu_ps +#define VLD _mm_loadu_ps +#define VSET _mm_set1_ps +#define VADD _mm_add_ps +#define VSUB _mm_sub_ps +#define VMUL _mm_mul_ps +#define VMAC(a, x, y) _mm_add_ps(a, _mm_mul_ps(x, y)) +#define VMSB(a, x, y) _mm_sub_ps(a, _mm_mul_ps(x, y)) +#define VMUL_S(x, s) _mm_mul_ps(x, _mm_set1_ps(s)) +#define VREV(x) _mm_shuffle_ps(x, x, _MM_SHUFFLE(0, 1, 2, 3)) +typedef __m128 f4; +#if defined(_MSC_VER) || defined(MINIMP3_ONLY_SIMD) +#define minimp3_cpuid __cpuid +#else /* defined(_MSC_VER) || defined(MINIMP3_ONLY_SIMD) */ +static __inline__ __attribute__((always_inline)) void minimp3_cpuid(int CPUInfo[], const int InfoType) +{ +#if defined(__PIC__) + __asm__ __volatile__( +#if defined(__x86_64__) + "push %%rbx\n" + "cpuid\n" + "xchgl %%ebx, %1\n" + "pop %%rbx\n" +#else /* defined(__x86_64__) */ + "xchgl %%ebx, %1\n" + "cpuid\n" + "xchgl %%ebx, %1\n" +#endif /* defined(__x86_64__) */ + : "=a" (CPUInfo[0]), "=r" (CPUInfo[1]), "=c" (CPUInfo[2]), "=d" (CPUInfo[3]) + : "a" (InfoType)); +#else /* defined(__PIC__) */ + __asm__ __volatile__( + "cpuid" + : "=a" (CPUInfo[0]), "=b" (CPUInfo[1]), "=c" (CPUInfo[2]), "=d" (CPUInfo[3]) + : "a" (InfoType)); +#endif /* defined(__PIC__)*/ +} +#endif /* defined(_MSC_VER) || defined(MINIMP3_ONLY_SIMD) */ +static int have_simd(void) +{ +#ifdef MINIMP3_ONLY_SIMD + return 1; +#else /* MINIMP3_ONLY_SIMD */ + static int g_have_simd; + int CPUInfo[4]; +#ifdef MINIMP3_TEST + static int g_counter; + if (g_counter++ > 100) + return 0; +#endif /* MINIMP3_TEST */ + if (g_have_simd) + goto end; + minimp3_cpuid(CPUInfo, 0); + g_have_simd = 1; + if (CPUInfo[0] > 0) + { + minimp3_cpuid(CPUInfo, 1); + g_have_simd = (CPUInfo[3] & (1 << 26)) + 1; /* SSE2 */ + } +end: + return g_have_simd - 1; +#endif /* MINIMP3_ONLY_SIMD */ +} +#elif defined(__ARM_NEON) || defined(__aarch64__) || defined(_M_ARM64) +#include +#define HAVE_SSE 0 +#define HAVE_SIMD 1 +#define VSTORE vst1q_f32 +#define VLD vld1q_f32 +#define VSET vmovq_n_f32 +#define VADD vaddq_f32 +#define VSUB vsubq_f32 +#define VMUL vmulq_f32 +#define VMAC(a, x, y) vmlaq_f32(a, x, y) +#define VMSB(a, x, y) vmlsq_f32(a, x, y) +#define VMUL_S(x, s) vmulq_f32(x, vmovq_n_f32(s)) +#define VREV(x) vcombine_f32(vget_high_f32(vrev64q_f32(x)), vget_low_f32(vrev64q_f32(x))) +typedef float32x4_t f4; +static int have_simd() +{ /* TODO: detect neon for !MINIMP3_ONLY_SIMD */ + return 1; +} +#else /* SIMD checks... */ +#define HAVE_SSE 0 +#define HAVE_SIMD 0 +#ifdef MINIMP3_ONLY_SIMD +#error MINIMP3_ONLY_SIMD used, but SSE/NEON not enabled +#endif /* MINIMP3_ONLY_SIMD */ +#endif /* SIMD checks... */ +#else /* !defined(MINIMP3_NO_SIMD) */ +#define HAVE_SIMD 0 +#endif /* !defined(MINIMP3_NO_SIMD) */ + +#if defined(__ARM_ARCH) && (__ARM_ARCH >= 6) && !defined(__aarch64__) && !defined(_M_ARM64) +#define HAVE_ARMV6 1 +static __inline__ __attribute__((always_inline)) int32_t minimp3_clip_int16_arm(int32_t a) +{ + int32_t x = 0; + __asm__ ("ssat %0, #16, %1" : "=r"(x) : "r"(a)); + return x; +} +#else +#define HAVE_ARMV6 0 +#endif + +typedef struct +{ + const uint8_t *buf; + int pos, limit; +} bs_t; + +typedef struct +{ + float scf[3*64]; + uint8_t total_bands, stereo_bands, bitalloc[64], scfcod[64]; +} L12_scale_info; + +typedef struct +{ + uint8_t tab_offset, code_tab_width, band_count; +} L12_subband_alloc_t; + +typedef struct +{ + const uint8_t *sfbtab; + uint16_t part_23_length, big_values, scalefac_compress; + uint8_t global_gain, block_type, mixed_block_flag, n_long_sfb, n_short_sfb; + uint8_t table_select[3], region_count[3], subblock_gain[3]; + uint8_t preflag, scalefac_scale, count1_table, scfsi; +} L3_gr_info_t; + +typedef struct +{ + bs_t bs; + uint8_t maindata[MAX_BITRESERVOIR_BYTES + MAX_L3_FRAME_PAYLOAD_BYTES]; + L3_gr_info_t gr_info[4]; + float grbuf[2][576], scf[40], syn[18 + 15][2*32]; + uint8_t ist_pos[2][39]; +} mp3dec_scratch_t; + +static void bs_init(bs_t *bs, const uint8_t *data, int bytes) +{ + bs->buf = data; + bs->pos = 0; + bs->limit = bytes*8; +} + +static uint32_t get_bits(bs_t *bs, int n) +{ + uint32_t next, cache = 0, s = bs->pos & 7; + int shl = n + s; + const uint8_t *p = bs->buf + (bs->pos >> 3); + if ((bs->pos += n) > bs->limit) + return 0; + next = *p++ & (255 >> s); + while ((shl -= 8) > 0) + { + cache |= next << shl; + next = *p++; + } + return cache | (next >> -shl); +} + +static int hdr_valid(const uint8_t *h) +{ + return h[0] == 0xff && + ((h[1] & 0xF0) == 0xf0 || (h[1] & 0xFE) == 0xe2) && + (HDR_GET_LAYER(h) != 0) && + (HDR_GET_BITRATE(h) != 15) && + (HDR_GET_SAMPLE_RATE(h) != 3); +} + +static int hdr_compare(const uint8_t *h1, const uint8_t *h2) +{ + return hdr_valid(h2) && + ((h1[1] ^ h2[1]) & 0xFE) == 0 && + ((h1[2] ^ h2[2]) & 0x0C) == 0 && + !(HDR_IS_FREE_FORMAT(h1) ^ HDR_IS_FREE_FORMAT(h2)); +} + +static unsigned hdr_bitrate_kbps(const uint8_t *h) +{ + static const uint8_t halfrate[2][3][15] = { + { { 0,4,8,12,16,20,24,28,32,40,48,56,64,72,80 }, { 0,4,8,12,16,20,24,28,32,40,48,56,64,72,80 }, { 0,16,24,28,32,40,48,56,64,72,80,88,96,112,128 } }, + { { 0,16,20,24,28,32,40,48,56,64,80,96,112,128,160 }, { 0,16,24,28,32,40,48,56,64,80,96,112,128,160,192 }, { 0,16,32,48,64,80,96,112,128,144,160,176,192,208,224 } }, + }; + return 2*halfrate[!!HDR_TEST_MPEG1(h)][HDR_GET_LAYER(h) - 1][HDR_GET_BITRATE(h)]; +} + +static unsigned hdr_sample_rate_hz(const uint8_t *h) +{ + static const unsigned g_hz[3] = { 44100, 48000, 32000 }; + return g_hz[HDR_GET_SAMPLE_RATE(h)] >> (int)!HDR_TEST_MPEG1(h) >> (int)!HDR_TEST_NOT_MPEG25(h); +} + +static unsigned hdr_frame_samples(const uint8_t *h) +{ + return HDR_IS_LAYER_1(h) ? 384 : (1152 >> (int)HDR_IS_FRAME_576(h)); +} + +static int hdr_frame_bytes(const uint8_t *h, int free_format_size) +{ + int frame_bytes = hdr_frame_samples(h)*hdr_bitrate_kbps(h)*125/hdr_sample_rate_hz(h); + if (HDR_IS_LAYER_1(h)) + { + frame_bytes &= ~3; /* slot align */ + } + return frame_bytes ? frame_bytes : free_format_size; +} + +static int hdr_padding(const uint8_t *h) +{ + return HDR_TEST_PADDING(h) ? (HDR_IS_LAYER_1(h) ? 4 : 1) : 0; +} + +#ifndef MINIMP3_ONLY_MP3 +static const L12_subband_alloc_t *L12_subband_alloc_table(const uint8_t *hdr, L12_scale_info *sci) +{ + const L12_subband_alloc_t *alloc; + int mode = HDR_GET_STEREO_MODE(hdr); + int nbands, stereo_bands = (mode == MODE_MONO) ? 0 : (mode == MODE_JOINT_STEREO) ? (HDR_GET_STEREO_MODE_EXT(hdr) << 2) + 4 : 32; + + if (HDR_IS_LAYER_1(hdr)) + { + static const L12_subband_alloc_t g_alloc_L1[] = { { 76, 4, 32 } }; + alloc = g_alloc_L1; + nbands = 32; + } else if (!HDR_TEST_MPEG1(hdr)) + { + static const L12_subband_alloc_t g_alloc_L2M2[] = { { 60, 4, 4 }, { 44, 3, 7 }, { 44, 2, 19 } }; + alloc = g_alloc_L2M2; + nbands = 30; + } else + { + static const L12_subband_alloc_t g_alloc_L2M1[] = { { 0, 4, 3 }, { 16, 4, 8 }, { 32, 3, 12 }, { 40, 2, 7 } }; + int sample_rate_idx = HDR_GET_SAMPLE_RATE(hdr); + unsigned kbps = hdr_bitrate_kbps(hdr) >> (int)(mode != MODE_MONO); + if (!kbps) /* free-format */ + { + kbps = 192; + } + + alloc = g_alloc_L2M1; + nbands = 27; + if (kbps < 56) + { + static const L12_subband_alloc_t g_alloc_L2M1_lowrate[] = { { 44, 4, 2 }, { 44, 3, 10 } }; + alloc = g_alloc_L2M1_lowrate; + nbands = sample_rate_idx == 2 ? 12 : 8; + } else if (kbps >= 96 && sample_rate_idx != 1) + { + nbands = 30; + } + } + + sci->total_bands = (uint8_t)nbands; + sci->stereo_bands = (uint8_t)MINIMP3_MIN(stereo_bands, nbands); + + return alloc; +} + +static void L12_read_scalefactors(bs_t *bs, uint8_t *pba, uint8_t *scfcod, int bands, float *scf) +{ + static const float g_deq_L12[18*3] = { +#define DQ(x) 9.53674316e-07f/x, 7.56931807e-07f/x, 6.00777173e-07f/x + DQ(3),DQ(7),DQ(15),DQ(31),DQ(63),DQ(127),DQ(255),DQ(511),DQ(1023),DQ(2047),DQ(4095),DQ(8191),DQ(16383),DQ(32767),DQ(65535),DQ(3),DQ(5),DQ(9) + }; + int i, m; + for (i = 0; i < bands; i++) + { + float s = 0; + int ba = *pba++; + int mask = ba ? 4 + ((19 >> scfcod[i]) & 3) : 0; + for (m = 4; m; m >>= 1) + { + if (mask & m) + { + int b = get_bits(bs, 6); + s = g_deq_L12[ba*3 - 6 + b % 3]*(1 << 21 >> b/3); + } + *scf++ = s; + } + } +} + +static void L12_read_scale_info(const uint8_t *hdr, bs_t *bs, L12_scale_info *sci) +{ + static const uint8_t g_bitalloc_code_tab[] = { + 0,17, 3, 4, 5,6,7, 8,9,10,11,12,13,14,15,16, + 0,17,18, 3,19,4,5, 6,7, 8, 9,10,11,12,13,16, + 0,17,18, 3,19,4,5,16, + 0,17,18,16, + 0,17,18,19, 4,5,6, 7,8, 9,10,11,12,13,14,15, + 0,17,18, 3,19,4,5, 6,7, 8, 9,10,11,12,13,14, + 0, 2, 3, 4, 5,6,7, 8,9,10,11,12,13,14,15,16 + }; + const L12_subband_alloc_t *subband_alloc = L12_subband_alloc_table(hdr, sci); + + int i, k = 0, ba_bits = 0; + const uint8_t *ba_code_tab = g_bitalloc_code_tab; + + for (i = 0; i < sci->total_bands; i++) + { + uint8_t ba; + if (i == k) + { + k += subband_alloc->band_count; + ba_bits = subband_alloc->code_tab_width; + ba_code_tab = g_bitalloc_code_tab + subband_alloc->tab_offset; + subband_alloc++; + } + ba = ba_code_tab[get_bits(bs, ba_bits)]; + sci->bitalloc[2*i] = ba; + if (i < sci->stereo_bands) + { + ba = ba_code_tab[get_bits(bs, ba_bits)]; + } + sci->bitalloc[2*i + 1] = sci->stereo_bands ? ba : 0; + } + + for (i = 0; i < 2*sci->total_bands; i++) + { + sci->scfcod[i] = sci->bitalloc[i] ? HDR_IS_LAYER_1(hdr) ? 2 : get_bits(bs, 2) : 6; + } + + L12_read_scalefactors(bs, sci->bitalloc, sci->scfcod, sci->total_bands*2, sci->scf); + + for (i = sci->stereo_bands; i < sci->total_bands; i++) + { + sci->bitalloc[2*i + 1] = 0; + } +} + +static int L12_dequantize_granule(float *grbuf, bs_t *bs, L12_scale_info *sci, int group_size) +{ + int i, j, k, choff = 576; + for (j = 0; j < 4; j++) + { + float *dst = grbuf + group_size*j; + for (i = 0; i < 2*sci->total_bands; i++) + { + int ba = sci->bitalloc[i]; + if (ba != 0) + { + if (ba < 17) + { + int half = (1 << (ba - 1)) - 1; + for (k = 0; k < group_size; k++) + { + dst[k] = (float)((int)get_bits(bs, ba) - half); + } + } else + { + unsigned mod = (2 << (ba - 17)) + 1; /* 3, 5, 9 */ + unsigned code = get_bits(bs, mod + 2 - (mod >> 3)); /* 5, 7, 10 */ + for (k = 0; k < group_size; k++, code /= mod) + { + dst[k] = (float)((int)(code % mod - mod/2)); + } + } + } + dst += choff; + choff = 18 - choff; + } + } + return group_size*4; +} + +static void L12_apply_scf_384(L12_scale_info *sci, const float *scf, float *dst) +{ + int i, k; + memcpy(dst + 576 + sci->stereo_bands*18, dst + sci->stereo_bands*18, (sci->total_bands - sci->stereo_bands)*18*sizeof(float)); + for (i = 0; i < sci->total_bands; i++, dst += 18, scf += 6) + { + for (k = 0; k < 12; k++) + { + dst[k + 0] *= scf[0]; + dst[k + 576] *= scf[3]; + } + } +} +#endif /* MINIMP3_ONLY_MP3 */ + +static int L3_read_side_info(bs_t *bs, L3_gr_info_t *gr, const uint8_t *hdr) +{ + static const uint8_t g_scf_long[8][23] = { + { 6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54,0 }, + { 12,12,12,12,12,12,16,20,24,28,32,40,48,56,64,76,90,2,2,2,2,2,0 }, + { 6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54,0 }, + { 6,6,6,6,6,6,8,10,12,14,16,18,22,26,32,38,46,54,62,70,76,36,0 }, + { 6,6,6,6,6,6,8,10,12,14,16,20,24,28,32,38,46,52,60,68,58,54,0 }, + { 4,4,4,4,4,4,6,6,8,8,10,12,16,20,24,28,34,42,50,54,76,158,0 }, + { 4,4,4,4,4,4,6,6,6,8,10,12,16,18,22,28,34,40,46,54,54,192,0 }, + { 4,4,4,4,4,4,6,6,8,10,12,16,20,24,30,38,46,56,68,84,102,26,0 } + }; + static const uint8_t g_scf_short[8][40] = { + { 4,4,4,4,4,4,4,4,4,6,6,6,8,8,8,10,10,10,12,12,12,14,14,14,18,18,18,24,24,24,30,30,30,40,40,40,18,18,18,0 }, + { 8,8,8,8,8,8,8,8,8,12,12,12,16,16,16,20,20,20,24,24,24,28,28,28,36,36,36,2,2,2,2,2,2,2,2,2,26,26,26,0 }, + { 4,4,4,4,4,4,4,4,4,6,6,6,6,6,6,8,8,8,10,10,10,14,14,14,18,18,18,26,26,26,32,32,32,42,42,42,18,18,18,0 }, + { 4,4,4,4,4,4,4,4,4,6,6,6,8,8,8,10,10,10,12,12,12,14,14,14,18,18,18,24,24,24,32,32,32,44,44,44,12,12,12,0 }, + { 4,4,4,4,4,4,4,4,4,6,6,6,8,8,8,10,10,10,12,12,12,14,14,14,18,18,18,24,24,24,30,30,30,40,40,40,18,18,18,0 }, + { 4,4,4,4,4,4,4,4,4,4,4,4,6,6,6,8,8,8,10,10,10,12,12,12,14,14,14,18,18,18,22,22,22,30,30,30,56,56,56,0 }, + { 4,4,4,4,4,4,4,4,4,4,4,4,6,6,6,6,6,6,10,10,10,12,12,12,14,14,14,16,16,16,20,20,20,26,26,26,66,66,66,0 }, + { 4,4,4,4,4,4,4,4,4,4,4,4,6,6,6,8,8,8,12,12,12,16,16,16,20,20,20,26,26,26,34,34,34,42,42,42,12,12,12,0 } + }; + static const uint8_t g_scf_mixed[8][40] = { + { 6,6,6,6,6,6,6,6,6,8,8,8,10,10,10,12,12,12,14,14,14,18,18,18,24,24,24,30,30,30,40,40,40,18,18,18,0 }, + { 12,12,12,4,4,4,8,8,8,12,12,12,16,16,16,20,20,20,24,24,24,28,28,28,36,36,36,2,2,2,2,2,2,2,2,2,26,26,26,0 }, + { 6,6,6,6,6,6,6,6,6,6,6,6,8,8,8,10,10,10,14,14,14,18,18,18,26,26,26,32,32,32,42,42,42,18,18,18,0 }, + { 6,6,6,6,6,6,6,6,6,8,8,8,10,10,10,12,12,12,14,14,14,18,18,18,24,24,24,32,32,32,44,44,44,12,12,12,0 }, + { 6,6,6,6,6,6,6,6,6,8,8,8,10,10,10,12,12,12,14,14,14,18,18,18,24,24,24,30,30,30,40,40,40,18,18,18,0 }, + { 4,4,4,4,4,4,6,6,4,4,4,6,6,6,8,8,8,10,10,10,12,12,12,14,14,14,18,18,18,22,22,22,30,30,30,56,56,56,0 }, + { 4,4,4,4,4,4,6,6,4,4,4,6,6,6,6,6,6,10,10,10,12,12,12,14,14,14,16,16,16,20,20,20,26,26,26,66,66,66,0 }, + { 4,4,4,4,4,4,6,6,4,4,4,6,6,6,8,8,8,12,12,12,16,16,16,20,20,20,26,26,26,34,34,34,42,42,42,12,12,12,0 } + }; + + unsigned tables, scfsi = 0; + int main_data_begin, part_23_sum = 0; + int sr_idx = HDR_GET_MY_SAMPLE_RATE(hdr); sr_idx -= (sr_idx != 0); + int gr_count = HDR_IS_MONO(hdr) ? 1 : 2; + + if (HDR_TEST_MPEG1(hdr)) + { + gr_count *= 2; + main_data_begin = get_bits(bs, 9); + scfsi = get_bits(bs, 7 + gr_count); + } else + { + main_data_begin = get_bits(bs, 8 + gr_count) >> gr_count; + } + + do + { + if (HDR_IS_MONO(hdr)) + { + scfsi <<= 4; + } + gr->part_23_length = (uint16_t)get_bits(bs, 12); + part_23_sum += gr->part_23_length; + gr->big_values = (uint16_t)get_bits(bs, 9); + if (gr->big_values > 288) + { + return -1; + } + gr->global_gain = (uint8_t)get_bits(bs, 8); + gr->scalefac_compress = (uint16_t)get_bits(bs, HDR_TEST_MPEG1(hdr) ? 4 : 9); + gr->sfbtab = g_scf_long[sr_idx]; + gr->n_long_sfb = 22; + gr->n_short_sfb = 0; + if (get_bits(bs, 1)) + { + gr->block_type = (uint8_t)get_bits(bs, 2); + if (!gr->block_type) + { + return -1; + } + gr->mixed_block_flag = (uint8_t)get_bits(bs, 1); + gr->region_count[0] = 7; + gr->region_count[1] = 255; + if (gr->block_type == SHORT_BLOCK_TYPE) + { + scfsi &= 0x0F0F; + if (!gr->mixed_block_flag) + { + gr->region_count[0] = 8; + gr->sfbtab = g_scf_short[sr_idx]; + gr->n_long_sfb = 0; + gr->n_short_sfb = 39; + } else + { + gr->sfbtab = g_scf_mixed[sr_idx]; + gr->n_long_sfb = HDR_TEST_MPEG1(hdr) ? 8 : 6; + gr->n_short_sfb = 30; + } + } + tables = get_bits(bs, 10); + tables <<= 5; + gr->subblock_gain[0] = (uint8_t)get_bits(bs, 3); + gr->subblock_gain[1] = (uint8_t)get_bits(bs, 3); + gr->subblock_gain[2] = (uint8_t)get_bits(bs, 3); + } else + { + gr->block_type = 0; + gr->mixed_block_flag = 0; + tables = get_bits(bs, 15); + gr->region_count[0] = (uint8_t)get_bits(bs, 4); + gr->region_count[1] = (uint8_t)get_bits(bs, 3); + gr->region_count[2] = 255; + } + gr->table_select[0] = (uint8_t)(tables >> 10); + gr->table_select[1] = (uint8_t)((tables >> 5) & 31); + gr->table_select[2] = (uint8_t)((tables) & 31); + gr->preflag = HDR_TEST_MPEG1(hdr) ? get_bits(bs, 1) : (gr->scalefac_compress >= 500); + gr->scalefac_scale = (uint8_t)get_bits(bs, 1); + gr->count1_table = (uint8_t)get_bits(bs, 1); + gr->scfsi = (uint8_t)((scfsi >> 12) & 15); + scfsi <<= 4; + gr++; + } while(--gr_count); + + if (part_23_sum + bs->pos > bs->limit + main_data_begin*8) + { + return -1; + } + + return main_data_begin; +} + +static void L3_read_scalefactors(uint8_t *scf, uint8_t *ist_pos, const uint8_t *scf_size, const uint8_t *scf_count, bs_t *bitbuf, int scfsi) +{ + int i, k; + for (i = 0; i < 4 && scf_count[i]; i++, scfsi *= 2) + { + int cnt = scf_count[i]; + if (scfsi & 8) + { + memcpy(scf, ist_pos, cnt); + } else + { + int bits = scf_size[i]; + if (!bits) + { + memset(scf, 0, cnt); + memset(ist_pos, 0, cnt); + } else + { + int max_scf = (scfsi < 0) ? (1 << bits) - 1 : -1; + for (k = 0; k < cnt; k++) + { + int s = get_bits(bitbuf, bits); + ist_pos[k] = (s == max_scf ? -1 : s); + scf[k] = s; + } + } + } + ist_pos += cnt; + scf += cnt; + } + scf[0] = scf[1] = scf[2] = 0; +} + +static float L3_ldexp_q2(float y, int exp_q2) +{ + static const float g_expfrac[4] = { 9.31322575e-10f,7.83145814e-10f,6.58544508e-10f,5.53767716e-10f }; + int e; + do + { + e = MINIMP3_MIN(30*4, exp_q2); + y *= g_expfrac[e & 3]*(1 << 30 >> (e >> 2)); + } while ((exp_q2 -= e) > 0); + return y; +} + +static void L3_decode_scalefactors(const uint8_t *hdr, uint8_t *ist_pos, bs_t *bs, const L3_gr_info_t *gr, float *scf, int ch) +{ + static const uint8_t g_scf_partitions[3][28] = { + { 6,5,5, 5,6,5,5,5,6,5, 7,3,11,10,0,0, 7, 7, 7,0, 6, 6,6,3, 8, 8,5,0 }, + { 8,9,6,12,6,9,9,9,6,9,12,6,15,18,0,0, 6,15,12,0, 6,12,9,6, 6,18,9,0 }, + { 9,9,6,12,9,9,9,9,9,9,12,6,18,18,0,0,12,12,12,0,12, 9,9,6,15,12,9,0 } + }; + const uint8_t *scf_partition = g_scf_partitions[!!gr->n_short_sfb + !gr->n_long_sfb]; + uint8_t scf_size[4], iscf[40]; + int i, scf_shift = gr->scalefac_scale + 1, gain_exp, scfsi = gr->scfsi; + float gain; + + if (HDR_TEST_MPEG1(hdr)) + { + static const uint8_t g_scfc_decode[16] = { 0,1,2,3, 12,5,6,7, 9,10,11,13, 14,15,18,19 }; + int part = g_scfc_decode[gr->scalefac_compress]; + scf_size[1] = scf_size[0] = (uint8_t)(part >> 2); + scf_size[3] = scf_size[2] = (uint8_t)(part & 3); + } else + { + static const uint8_t g_mod[6*4] = { 5,5,4,4,5,5,4,1,4,3,1,1,5,6,6,1,4,4,4,1,4,3,1,1 }; + int k, modprod, sfc, ist = HDR_TEST_I_STEREO(hdr) && ch; + sfc = gr->scalefac_compress >> ist; + for (k = ist*3*4; sfc >= 0; sfc -= modprod, k += 4) + { + for (modprod = 1, i = 3; i >= 0; i--) + { + scf_size[i] = (uint8_t)(sfc / modprod % g_mod[k + i]); + modprod *= g_mod[k + i]; + } + } + scf_partition += k; + scfsi = -16; + } + L3_read_scalefactors(iscf, ist_pos, scf_size, scf_partition, bs, scfsi); + + if (gr->n_short_sfb) + { + int sh = 3 - scf_shift; + for (i = 0; i < gr->n_short_sfb; i += 3) + { + iscf[gr->n_long_sfb + i + 0] += gr->subblock_gain[0] << sh; + iscf[gr->n_long_sfb + i + 1] += gr->subblock_gain[1] << sh; + iscf[gr->n_long_sfb + i + 2] += gr->subblock_gain[2] << sh; + } + } else if (gr->preflag) + { + static const uint8_t g_preamp[10] = { 1,1,1,1,2,2,3,3,3,2 }; + for (i = 0; i < 10; i++) + { + iscf[11 + i] += g_preamp[i]; + } + } + + gain_exp = gr->global_gain + BITS_DEQUANTIZER_OUT*4 - 210 - (HDR_IS_MS_STEREO(hdr) ? 2 : 0); + gain = L3_ldexp_q2(1 << (MAX_SCFI/4), MAX_SCFI - gain_exp); + for (i = 0; i < (int)(gr->n_long_sfb + gr->n_short_sfb); i++) + { + scf[i] = L3_ldexp_q2(gain, iscf[i] << scf_shift); + } +} + +static const float g_pow43[129 + 16] = { + 0,-1,-2.519842f,-4.326749f,-6.349604f,-8.549880f,-10.902724f,-13.390518f,-16.000000f,-18.720754f,-21.544347f,-24.463781f,-27.473142f,-30.567351f,-33.741992f,-36.993181f, + 0,1,2.519842f,4.326749f,6.349604f,8.549880f,10.902724f,13.390518f,16.000000f,18.720754f,21.544347f,24.463781f,27.473142f,30.567351f,33.741992f,36.993181f,40.317474f,43.711787f,47.173345f,50.699631f,54.288352f,57.937408f,61.644865f,65.408941f,69.227979f,73.100443f,77.024898f,81.000000f,85.024491f,89.097188f,93.216975f,97.382800f,101.593667f,105.848633f,110.146801f,114.487321f,118.869381f,123.292209f,127.755065f,132.257246f,136.798076f,141.376907f,145.993119f,150.646117f,155.335327f,160.060199f,164.820202f,169.614826f,174.443577f,179.305980f,184.201575f,189.129918f,194.090580f,199.083145f,204.107210f,209.162385f,214.248292f,219.364564f,224.510845f,229.686789f,234.892058f,240.126328f,245.389280f,250.680604f,256.000000f,261.347174f,266.721841f,272.123723f,277.552547f,283.008049f,288.489971f,293.998060f,299.532071f,305.091761f,310.676898f,316.287249f,321.922592f,327.582707f,333.267377f,338.976394f,344.709550f,350.466646f,356.247482f,362.051866f,367.879608f,373.730522f,379.604427f,385.501143f,391.420496f,397.362314f,403.326427f,409.312672f,415.320884f,421.350905f,427.402579f,433.475750f,439.570269f,445.685987f,451.822757f,457.980436f,464.158883f,470.357960f,476.577530f,482.817459f,489.077615f,495.357868f,501.658090f,507.978156f,514.317941f,520.677324f,527.056184f,533.454404f,539.871867f,546.308458f,552.764065f,559.238575f,565.731879f,572.243870f,578.774440f,585.323483f,591.890898f,598.476581f,605.080431f,611.702349f,618.342238f,625.000000f,631.675540f,638.368763f,645.079578f +}; + +static float L3_pow_43(int x) +{ + float frac; + int sign, mult = 256; + + if (x < 129) + { + return g_pow43[16 + x]; + } + + if (x < 1024) + { + mult = 16; + x <<= 3; + } + + sign = 2*x & 64; + frac = (float)((x & 63) - sign) / ((x & ~63) + sign); + return g_pow43[16 + ((x + sign) >> 6)]*(1.f + frac*((4.f/3) + frac*(2.f/9)))*mult; +} + +static void L3_huffman(float *dst, bs_t *bs, const L3_gr_info_t *gr_info, const float *scf, int layer3gr_limit) +{ + static const int16_t tabs[] = { 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, + 785,785,785,785,784,784,784,784,513,513,513,513,513,513,513,513,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256, + -255,1313,1298,1282,785,785,785,785,784,784,784,784,769,769,769,769,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,290,288, + -255,1313,1298,1282,769,769,769,769,529,529,529,529,529,529,529,529,528,528,528,528,528,528,528,528,512,512,512,512,512,512,512,512,290,288, + -253,-318,-351,-367,785,785,785,785,784,784,784,784,769,769,769,769,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,819,818,547,547,275,275,275,275,561,560,515,546,289,274,288,258, + -254,-287,1329,1299,1314,1312,1057,1057,1042,1042,1026,1026,784,784,784,784,529,529,529,529,529,529,529,529,769,769,769,769,768,768,768,768,563,560,306,306,291,259, + -252,-413,-477,-542,1298,-575,1041,1041,784,784,784,784,769,769,769,769,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,-383,-399,1107,1092,1106,1061,849,849,789,789,1104,1091,773,773,1076,1075,341,340,325,309,834,804,577,577,532,532,516,516,832,818,803,816,561,561,531,531,515,546,289,289,288,258, + -252,-429,-493,-559,1057,1057,1042,1042,529,529,529,529,529,529,529,529,784,784,784,784,769,769,769,769,512,512,512,512,512,512,512,512,-382,1077,-415,1106,1061,1104,849,849,789,789,1091,1076,1029,1075,834,834,597,581,340,340,339,324,804,833,532,532,832,772,818,803,817,787,816,771,290,290,290,290,288,258, + -253,-349,-414,-447,-463,1329,1299,-479,1314,1312,1057,1057,1042,1042,1026,1026,785,785,785,785,784,784,784,784,769,769,769,769,768,768,768,768,-319,851,821,-335,836,850,805,849,341,340,325,336,533,533,579,579,564,564,773,832,578,548,563,516,321,276,306,291,304,259, + -251,-572,-733,-830,-863,-879,1041,1041,784,784,784,784,769,769,769,769,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,-511,-527,-543,1396,1351,1381,1366,1395,1335,1380,-559,1334,1138,1138,1063,1063,1350,1392,1031,1031,1062,1062,1364,1363,1120,1120,1333,1348,881,881,881,881,375,374,359,373,343,358,341,325,791,791,1123,1122,-703,1105,1045,-719,865,865,790,790,774,774,1104,1029,338,293,323,308,-799,-815,833,788,772,818,803,816,322,292,307,320,561,531,515,546,289,274,288,258, + -251,-525,-605,-685,-765,-831,-846,1298,1057,1057,1312,1282,785,785,785,785,784,784,784,784,769,769,769,769,512,512,512,512,512,512,512,512,1399,1398,1383,1367,1382,1396,1351,-511,1381,1366,1139,1139,1079,1079,1124,1124,1364,1349,1363,1333,882,882,882,882,807,807,807,807,1094,1094,1136,1136,373,341,535,535,881,775,867,822,774,-591,324,338,-671,849,550,550,866,864,609,609,293,336,534,534,789,835,773,-751,834,804,308,307,833,788,832,772,562,562,547,547,305,275,560,515,290,290, + -252,-397,-477,-557,-622,-653,-719,-735,-750,1329,1299,1314,1057,1057,1042,1042,1312,1282,1024,1024,785,785,785,785,784,784,784,784,769,769,769,769,-383,1127,1141,1111,1126,1140,1095,1110,869,869,883,883,1079,1109,882,882,375,374,807,868,838,881,791,-463,867,822,368,263,852,837,836,-543,610,610,550,550,352,336,534,534,865,774,851,821,850,805,593,533,579,564,773,832,578,578,548,548,577,577,307,276,306,291,516,560,259,259, + -250,-2107,-2507,-2764,-2909,-2974,-3007,-3023,1041,1041,1040,1040,769,769,769,769,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,-767,-1052,-1213,-1277,-1358,-1405,-1469,-1535,-1550,-1582,-1614,-1647,-1662,-1694,-1726,-1759,-1774,-1807,-1822,-1854,-1886,1565,-1919,-1935,-1951,-1967,1731,1730,1580,1717,-1983,1729,1564,-1999,1548,-2015,-2031,1715,1595,-2047,1714,-2063,1610,-2079,1609,-2095,1323,1323,1457,1457,1307,1307,1712,1547,1641,1700,1699,1594,1685,1625,1442,1442,1322,1322,-780,-973,-910,1279,1278,1277,1262,1276,1261,1275,1215,1260,1229,-959,974,974,989,989,-943,735,478,478,495,463,506,414,-1039,1003,958,1017,927,942,987,957,431,476,1272,1167,1228,-1183,1256,-1199,895,895,941,941,1242,1227,1212,1135,1014,1014,490,489,503,487,910,1013,985,925,863,894,970,955,1012,847,-1343,831,755,755,984,909,428,366,754,559,-1391,752,486,457,924,997,698,698,983,893,740,740,908,877,739,739,667,667,953,938,497,287,271,271,683,606,590,712,726,574,302,302,738,736,481,286,526,725,605,711,636,724,696,651,589,681,666,710,364,467,573,695,466,466,301,465,379,379,709,604,665,679,316,316,634,633,436,436,464,269,424,394,452,332,438,363,347,408,393,448,331,422,362,407,392,421,346,406,391,376,375,359,1441,1306,-2367,1290,-2383,1337,-2399,-2415,1426,1321,-2431,1411,1336,-2447,-2463,-2479,1169,1169,1049,1049,1424,1289,1412,1352,1319,-2495,1154,1154,1064,1064,1153,1153,416,390,360,404,403,389,344,374,373,343,358,372,327,357,342,311,356,326,1395,1394,1137,1137,1047,1047,1365,1392,1287,1379,1334,1364,1349,1378,1318,1363,792,792,792,792,1152,1152,1032,1032,1121,1121,1046,1046,1120,1120,1030,1030,-2895,1106,1061,1104,849,849,789,789,1091,1076,1029,1090,1060,1075,833,833,309,324,532,532,832,772,818,803,561,561,531,560,515,546,289,274,288,258, + -250,-1179,-1579,-1836,-1996,-2124,-2253,-2333,-2413,-2477,-2542,-2574,-2607,-2622,-2655,1314,1313,1298,1312,1282,785,785,785,785,1040,1040,1025,1025,768,768,768,768,-766,-798,-830,-862,-895,-911,-927,-943,-959,-975,-991,-1007,-1023,-1039,-1055,-1070,1724,1647,-1103,-1119,1631,1767,1662,1738,1708,1723,-1135,1780,1615,1779,1599,1677,1646,1778,1583,-1151,1777,1567,1737,1692,1765,1722,1707,1630,1751,1661,1764,1614,1736,1676,1763,1750,1645,1598,1721,1691,1762,1706,1582,1761,1566,-1167,1749,1629,767,766,751,765,494,494,735,764,719,749,734,763,447,447,748,718,477,506,431,491,446,476,461,505,415,430,475,445,504,399,460,489,414,503,383,474,429,459,502,502,746,752,488,398,501,473,413,472,486,271,480,270,-1439,-1455,1357,-1471,-1487,-1503,1341,1325,-1519,1489,1463,1403,1309,-1535,1372,1448,1418,1476,1356,1462,1387,-1551,1475,1340,1447,1402,1386,-1567,1068,1068,1474,1461,455,380,468,440,395,425,410,454,364,467,466,464,453,269,409,448,268,432,1371,1473,1432,1417,1308,1460,1355,1446,1459,1431,1083,1083,1401,1416,1458,1445,1067,1067,1370,1457,1051,1051,1291,1430,1385,1444,1354,1415,1400,1443,1082,1082,1173,1113,1186,1066,1185,1050,-1967,1158,1128,1172,1097,1171,1081,-1983,1157,1112,416,266,375,400,1170,1142,1127,1065,793,793,1169,1033,1156,1096,1141,1111,1155,1080,1126,1140,898,898,808,808,897,897,792,792,1095,1152,1032,1125,1110,1139,1079,1124,882,807,838,881,853,791,-2319,867,368,263,822,852,837,866,806,865,-2399,851,352,262,534,534,821,836,594,594,549,549,593,593,533,533,848,773,579,579,564,578,548,563,276,276,577,576,306,291,516,560,305,305,275,259, + -251,-892,-2058,-2620,-2828,-2957,-3023,-3039,1041,1041,1040,1040,769,769,769,769,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,-511,-527,-543,-559,1530,-575,-591,1528,1527,1407,1526,1391,1023,1023,1023,1023,1525,1375,1268,1268,1103,1103,1087,1087,1039,1039,1523,-604,815,815,815,815,510,495,509,479,508,463,507,447,431,505,415,399,-734,-782,1262,-815,1259,1244,-831,1258,1228,-847,-863,1196,-879,1253,987,987,748,-767,493,493,462,477,414,414,686,669,478,446,461,445,474,429,487,458,412,471,1266,1264,1009,1009,799,799,-1019,-1276,-1452,-1581,-1677,-1757,-1821,-1886,-1933,-1997,1257,1257,1483,1468,1512,1422,1497,1406,1467,1496,1421,1510,1134,1134,1225,1225,1466,1451,1374,1405,1252,1252,1358,1480,1164,1164,1251,1251,1238,1238,1389,1465,-1407,1054,1101,-1423,1207,-1439,830,830,1248,1038,1237,1117,1223,1148,1236,1208,411,426,395,410,379,269,1193,1222,1132,1235,1221,1116,976,976,1192,1162,1177,1220,1131,1191,963,963,-1647,961,780,-1663,558,558,994,993,437,408,393,407,829,978,813,797,947,-1743,721,721,377,392,844,950,828,890,706,706,812,859,796,960,948,843,934,874,571,571,-1919,690,555,689,421,346,539,539,944,779,918,873,932,842,903,888,570,570,931,917,674,674,-2575,1562,-2591,1609,-2607,1654,1322,1322,1441,1441,1696,1546,1683,1593,1669,1624,1426,1426,1321,1321,1639,1680,1425,1425,1305,1305,1545,1668,1608,1623,1667,1592,1638,1666,1320,1320,1652,1607,1409,1409,1304,1304,1288,1288,1664,1637,1395,1395,1335,1335,1622,1636,1394,1394,1319,1319,1606,1621,1392,1392,1137,1137,1137,1137,345,390,360,375,404,373,1047,-2751,-2767,-2783,1062,1121,1046,-2799,1077,-2815,1106,1061,789,789,1105,1104,263,355,310,340,325,354,352,262,339,324,1091,1076,1029,1090,1060,1075,833,833,788,788,1088,1028,818,818,803,803,561,561,531,531,816,771,546,546,289,274,288,258, + -253,-317,-381,-446,-478,-509,1279,1279,-811,-1179,-1451,-1756,-1900,-2028,-2189,-2253,-2333,-2414,-2445,-2511,-2526,1313,1298,-2559,1041,1041,1040,1040,1025,1025,1024,1024,1022,1007,1021,991,1020,975,1019,959,687,687,1018,1017,671,671,655,655,1016,1015,639,639,758,758,623,623,757,607,756,591,755,575,754,559,543,543,1009,783,-575,-621,-685,-749,496,-590,750,749,734,748,974,989,1003,958,988,973,1002,942,987,957,972,1001,926,986,941,971,956,1000,910,985,925,999,894,970,-1071,-1087,-1102,1390,-1135,1436,1509,1451,1374,-1151,1405,1358,1480,1420,-1167,1507,1494,1389,1342,1465,1435,1450,1326,1505,1310,1493,1373,1479,1404,1492,1464,1419,428,443,472,397,736,526,464,464,486,457,442,471,484,482,1357,1449,1434,1478,1388,1491,1341,1490,1325,1489,1463,1403,1309,1477,1372,1448,1418,1433,1476,1356,1462,1387,-1439,1475,1340,1447,1402,1474,1324,1461,1371,1473,269,448,1432,1417,1308,1460,-1711,1459,-1727,1441,1099,1099,1446,1386,1431,1401,-1743,1289,1083,1083,1160,1160,1458,1445,1067,1067,1370,1457,1307,1430,1129,1129,1098,1098,268,432,267,416,266,400,-1887,1144,1187,1082,1173,1113,1186,1066,1050,1158,1128,1143,1172,1097,1171,1081,420,391,1157,1112,1170,1142,1127,1065,1169,1049,1156,1096,1141,1111,1155,1080,1126,1154,1064,1153,1140,1095,1048,-2159,1125,1110,1137,-2175,823,823,1139,1138,807,807,384,264,368,263,868,838,853,791,867,822,852,837,866,806,865,790,-2319,851,821,836,352,262,850,805,849,-2399,533,533,835,820,336,261,578,548,563,577,532,532,832,772,562,562,547,547,305,275,560,515,290,290,288,258 }; + static const uint8_t tab32[] = { 130,162,193,209,44,28,76,140,9,9,9,9,9,9,9,9,190,254,222,238,126,94,157,157,109,61,173,205 }; + static const uint8_t tab33[] = { 252,236,220,204,188,172,156,140,124,108,92,76,60,44,28,12 }; + static const int16_t tabindex[2*16] = { 0,32,64,98,0,132,180,218,292,364,426,538,648,746,0,1126,1460,1460,1460,1460,1460,1460,1460,1460,1842,1842,1842,1842,1842,1842,1842,1842 }; + static const uint8_t g_linbits[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,6,8,10,13,4,5,6,7,8,9,11,13 }; + +#define PEEK_BITS(n) (bs_cache >> (32 - n)) +#define FLUSH_BITS(n) { bs_cache <<= (n); bs_sh += (n); } +#define CHECK_BITS while (bs_sh >= 0) { bs_cache |= (uint32_t)*bs_next_ptr++ << bs_sh; bs_sh -= 8; } +#define BSPOS ((bs_next_ptr - bs->buf)*8 - 24 + bs_sh) + + float one = 0.0f; + int ireg = 0, big_val_cnt = gr_info->big_values; + const uint8_t *sfb = gr_info->sfbtab; + const uint8_t *bs_next_ptr = bs->buf + bs->pos/8; + uint32_t bs_cache = (((bs_next_ptr[0]*256u + bs_next_ptr[1])*256u + bs_next_ptr[2])*256u + bs_next_ptr[3]) << (bs->pos & 7); + int pairs_to_decode, np, bs_sh = (bs->pos & 7) - 8; + bs_next_ptr += 4; + + while (big_val_cnt > 0) + { + int tab_num = gr_info->table_select[ireg]; + int sfb_cnt = gr_info->region_count[ireg++]; + const int16_t *codebook = tabs + tabindex[tab_num]; + int linbits = g_linbits[tab_num]; + if (linbits) + { + do + { + np = *sfb++ / 2; + pairs_to_decode = MINIMP3_MIN(big_val_cnt, np); + one = *scf++; + do + { + int j, w = 5; + int leaf = codebook[PEEK_BITS(w)]; + while (leaf < 0) + { + FLUSH_BITS(w); + w = leaf & 7; + leaf = codebook[PEEK_BITS(w) - (leaf >> 3)]; + } + FLUSH_BITS(leaf >> 8); + + for (j = 0; j < 2; j++, dst++, leaf >>= 4) + { + int lsb = leaf & 0x0F; + if (lsb == 15) + { + lsb += PEEK_BITS(linbits); + FLUSH_BITS(linbits); + CHECK_BITS; + *dst = one*L3_pow_43(lsb)*((int32_t)bs_cache < 0 ? -1: 1); + } else + { + *dst = g_pow43[16 + lsb - 16*(bs_cache >> 31)]*one; + } + FLUSH_BITS(lsb ? 1 : 0); + } + CHECK_BITS; + } while (--pairs_to_decode); + } while ((big_val_cnt -= np) > 0 && --sfb_cnt >= 0); + } else + { + do + { + np = *sfb++ / 2; + pairs_to_decode = MINIMP3_MIN(big_val_cnt, np); + one = *scf++; + do + { + int j, w = 5; + int leaf = codebook[PEEK_BITS(w)]; + while (leaf < 0) + { + FLUSH_BITS(w); + w = leaf & 7; + leaf = codebook[PEEK_BITS(w) - (leaf >> 3)]; + } + FLUSH_BITS(leaf >> 8); + + for (j = 0; j < 2; j++, dst++, leaf >>= 4) + { + int lsb = leaf & 0x0F; + *dst = g_pow43[16 + lsb - 16*(bs_cache >> 31)]*one; + FLUSH_BITS(lsb ? 1 : 0); + } + CHECK_BITS; + } while (--pairs_to_decode); + } while ((big_val_cnt -= np) > 0 && --sfb_cnt >= 0); + } + } + + for (np = 1 - big_val_cnt;; dst += 4) + { + const uint8_t *codebook_count1 = (gr_info->count1_table) ? tab33 : tab32; + int leaf = codebook_count1[PEEK_BITS(4)]; + if (!(leaf & 8)) + { + leaf = codebook_count1[(leaf >> 3) + (bs_cache << 4 >> (32 - (leaf & 3)))]; + } + FLUSH_BITS(leaf & 7); + if (BSPOS > layer3gr_limit) + { + break; + } +#define RELOAD_SCALEFACTOR if (!--np) { np = *sfb++/2; if (!np) break; one = *scf++; } +#define DEQ_COUNT1(s) if (leaf & (128 >> s)) { dst[s] = ((int32_t)bs_cache < 0) ? -one : one; FLUSH_BITS(1) } + RELOAD_SCALEFACTOR; + DEQ_COUNT1(0); + DEQ_COUNT1(1); + RELOAD_SCALEFACTOR; + DEQ_COUNT1(2); + DEQ_COUNT1(3); + CHECK_BITS; + } + + bs->pos = layer3gr_limit; +} + +static void L3_midside_stereo(float *left, int n) +{ + int i = 0; + float *right = left + 576; +#if HAVE_SIMD + if (have_simd()) + { + for (; i < n - 3; i += 4) + { + f4 vl = VLD(left + i); + f4 vr = VLD(right + i); + VSTORE(left + i, VADD(vl, vr)); + VSTORE(right + i, VSUB(vl, vr)); + } +#ifdef __GNUC__ + /* Workaround for spurious -Waggressive-loop-optimizations warning from gcc. + * For more info see: https://github.com/lieff/minimp3/issues/88 + */ + if (__builtin_constant_p(n % 4 == 0) && n % 4 == 0) + return; +#endif + } +#endif /* HAVE_SIMD */ + for (; i < n; i++) + { + float a = left[i]; + float b = right[i]; + left[i] = a + b; + right[i] = a - b; + } +} + +static void L3_intensity_stereo_band(float *left, int n, float kl, float kr) +{ + int i; + for (i = 0; i < n; i++) + { + left[i + 576] = left[i]*kr; + left[i] = left[i]*kl; + } +} + +static void L3_stereo_top_band(const float *right, const uint8_t *sfb, int nbands, int max_band[3]) +{ + int i, k; + + max_band[0] = max_band[1] = max_band[2] = -1; + + for (i = 0; i < nbands; i++) + { + for (k = 0; k < sfb[i]; k += 2) + { + if (right[k] != 0 || right[k + 1] != 0) + { + max_band[i % 3] = i; + break; + } + } + right += sfb[i]; + } +} + +static void L3_stereo_process(float *left, const uint8_t *ist_pos, const uint8_t *sfb, const uint8_t *hdr, int max_band[3], int mpeg2_sh) +{ + static const float g_pan[7*2] = { 0,1,0.21132487f,0.78867513f,0.36602540f,0.63397460f,0.5f,0.5f,0.63397460f,0.36602540f,0.78867513f,0.21132487f,1,0 }; + unsigned i, max_pos = HDR_TEST_MPEG1(hdr) ? 7 : 64; + + for (i = 0; sfb[i]; i++) + { + unsigned ipos = ist_pos[i]; + if ((int)i > max_band[i % 3] && ipos < max_pos) + { + float kl, kr, s = HDR_TEST_MS_STEREO(hdr) ? 1.41421356f : 1; + if (HDR_TEST_MPEG1(hdr)) + { + kl = g_pan[2*ipos]; + kr = g_pan[2*ipos + 1]; + } else + { + kl = 1; + kr = L3_ldexp_q2(1, (ipos + 1) >> 1 << mpeg2_sh); + if (ipos & 1) + { + kl = kr; + kr = 1; + } + } + L3_intensity_stereo_band(left, sfb[i], kl*s, kr*s); + } else if (HDR_TEST_MS_STEREO(hdr)) + { + L3_midside_stereo(left, sfb[i]); + } + left += sfb[i]; + } +} + +static void L3_intensity_stereo(float *left, uint8_t *ist_pos, const L3_gr_info_t *gr, const uint8_t *hdr) +{ + int max_band[3], n_sfb = gr->n_long_sfb + gr->n_short_sfb; + int i, max_blocks = gr->n_short_sfb ? 3 : 1; + + L3_stereo_top_band(left + 576, gr->sfbtab, n_sfb, max_band); + if (gr->n_long_sfb) + { + max_band[0] = max_band[1] = max_band[2] = MINIMP3_MAX(MINIMP3_MAX(max_band[0], max_band[1]), max_band[2]); + } + for (i = 0; i < max_blocks; i++) + { + int default_pos = HDR_TEST_MPEG1(hdr) ? 3 : 0; + int itop = n_sfb - max_blocks + i; + int prev = itop - max_blocks; + ist_pos[itop] = max_band[i] >= prev ? default_pos : ist_pos[prev]; + } + L3_stereo_process(left, ist_pos, gr->sfbtab, hdr, max_band, gr[1].scalefac_compress & 1); +} + +static void L3_reorder(float *grbuf, float *scratch, const uint8_t *sfb) +{ + int i, len; + float *src = grbuf, *dst = scratch; + + for (;0 != (len = *sfb); sfb += 3, src += 2*len) + { + for (i = 0; i < len; i++, src++) + { + *dst++ = src[0*len]; + *dst++ = src[1*len]; + *dst++ = src[2*len]; + } + } + memcpy(grbuf, scratch, (dst - scratch)*sizeof(float)); +} + +static void L3_antialias(float *grbuf, int nbands) +{ + static const float g_aa[2][8] = { + {0.85749293f,0.88174200f,0.94962865f,0.98331459f,0.99551782f,0.99916056f,0.99989920f,0.99999316f}, + {0.51449576f,0.47173197f,0.31337745f,0.18191320f,0.09457419f,0.04096558f,0.01419856f,0.00369997f} + }; + + for (; nbands > 0; nbands--, grbuf += 18) + { + int i = 0; +#if HAVE_SIMD + if (have_simd()) for (; i < 8; i += 4) + { + f4 vu = VLD(grbuf + 18 + i); + f4 vd = VLD(grbuf + 14 - i); + f4 vc0 = VLD(g_aa[0] + i); + f4 vc1 = VLD(g_aa[1] + i); + vd = VREV(vd); + VSTORE(grbuf + 18 + i, VSUB(VMUL(vu, vc0), VMUL(vd, vc1))); + vd = VADD(VMUL(vu, vc1), VMUL(vd, vc0)); + VSTORE(grbuf + 14 - i, VREV(vd)); + } +#endif /* HAVE_SIMD */ +#ifndef MINIMP3_ONLY_SIMD + for(; i < 8; i++) + { + float u = grbuf[18 + i]; + float d = grbuf[17 - i]; + grbuf[18 + i] = u*g_aa[0][i] - d*g_aa[1][i]; + grbuf[17 - i] = u*g_aa[1][i] + d*g_aa[0][i]; + } +#endif /* MINIMP3_ONLY_SIMD */ + } +} + +static void L3_dct3_9(float *y) +{ + float s0, s1, s2, s3, s4, s5, s6, s7, s8, t0, t2, t4; + + s0 = y[0]; s2 = y[2]; s4 = y[4]; s6 = y[6]; s8 = y[8]; + t0 = s0 + s6*0.5f; + s0 -= s6; + t4 = (s4 + s2)*0.93969262f; + t2 = (s8 + s2)*0.76604444f; + s6 = (s4 - s8)*0.17364818f; + s4 += s8 - s2; + + s2 = s0 - s4*0.5f; + y[4] = s4 + s0; + s8 = t0 - t2 + s6; + s0 = t0 - t4 + t2; + s4 = t0 + t4 - s6; + + s1 = y[1]; s3 = y[3]; s5 = y[5]; s7 = y[7]; + + s3 *= 0.86602540f; + t0 = (s5 + s1)*0.98480775f; + t4 = (s5 - s7)*0.34202014f; + t2 = (s1 + s7)*0.64278761f; + s1 = (s1 - s5 - s7)*0.86602540f; + + s5 = t0 - s3 - t2; + s7 = t4 - s3 - t0; + s3 = t4 + s3 - t2; + + y[0] = s4 - s7; + y[1] = s2 + s1; + y[2] = s0 - s3; + y[3] = s8 + s5; + y[5] = s8 - s5; + y[6] = s0 + s3; + y[7] = s2 - s1; + y[8] = s4 + s7; +} + +static void L3_imdct36(float *grbuf, float *overlap, const float *window, int nbands) +{ + int i, j; + static const float g_twid9[18] = { + 0.73727734f,0.79335334f,0.84339145f,0.88701083f,0.92387953f,0.95371695f,0.97629601f,0.99144486f,0.99904822f,0.67559021f,0.60876143f,0.53729961f,0.46174861f,0.38268343f,0.30070580f,0.21643961f,0.13052619f,0.04361938f + }; + + for (j = 0; j < nbands; j++, grbuf += 18, overlap += 9) + { + float co[9], si[9]; + co[0] = -grbuf[0]; + si[0] = grbuf[17]; + for (i = 0; i < 4; i++) + { + si[8 - 2*i] = grbuf[4*i + 1] - grbuf[4*i + 2]; + co[1 + 2*i] = grbuf[4*i + 1] + grbuf[4*i + 2]; + si[7 - 2*i] = grbuf[4*i + 4] - grbuf[4*i + 3]; + co[2 + 2*i] = -(grbuf[4*i + 3] + grbuf[4*i + 4]); + } + L3_dct3_9(co); + L3_dct3_9(si); + + si[1] = -si[1]; + si[3] = -si[3]; + si[5] = -si[5]; + si[7] = -si[7]; + + i = 0; + +#if HAVE_SIMD + if (have_simd()) for (; i < 8; i += 4) + { + f4 vovl = VLD(overlap + i); + f4 vc = VLD(co + i); + f4 vs = VLD(si + i); + f4 vr0 = VLD(g_twid9 + i); + f4 vr1 = VLD(g_twid9 + 9 + i); + f4 vw0 = VLD(window + i); + f4 vw1 = VLD(window + 9 + i); + f4 vsum = VADD(VMUL(vc, vr1), VMUL(vs, vr0)); + VSTORE(overlap + i, VSUB(VMUL(vc, vr0), VMUL(vs, vr1))); + VSTORE(grbuf + i, VSUB(VMUL(vovl, vw0), VMUL(vsum, vw1))); + vsum = VADD(VMUL(vovl, vw1), VMUL(vsum, vw0)); + VSTORE(grbuf + 14 - i, VREV(vsum)); + } +#endif /* HAVE_SIMD */ + for (; i < 9; i++) + { + float ovl = overlap[i]; + float sum = co[i]*g_twid9[9 + i] + si[i]*g_twid9[0 + i]; + overlap[i] = co[i]*g_twid9[0 + i] - si[i]*g_twid9[9 + i]; + grbuf[i] = ovl*window[0 + i] - sum*window[9 + i]; + grbuf[17 - i] = ovl*window[9 + i] + sum*window[0 + i]; + } + } +} + +static void L3_idct3(float x0, float x1, float x2, float *dst) +{ + float m1 = x1*0.86602540f; + float a1 = x0 - x2*0.5f; + dst[1] = x0 + x2; + dst[0] = a1 + m1; + dst[2] = a1 - m1; +} + +static void L3_imdct12(float *x, float *dst, float *overlap) +{ + static const float g_twid3[6] = { 0.79335334f,0.92387953f,0.99144486f, 0.60876143f,0.38268343f,0.13052619f }; + float co[3], si[3]; + int i; + + L3_idct3(-x[0], x[6] + x[3], x[12] + x[9], co); + L3_idct3(x[15], x[12] - x[9], x[6] - x[3], si); + si[1] = -si[1]; + + for (i = 0; i < 3; i++) + { + float ovl = overlap[i]; + float sum = co[i]*g_twid3[3 + i] + si[i]*g_twid3[0 + i]; + overlap[i] = co[i]*g_twid3[0 + i] - si[i]*g_twid3[3 + i]; + dst[i] = ovl*g_twid3[2 - i] - sum*g_twid3[5 - i]; + dst[5 - i] = ovl*g_twid3[5 - i] + sum*g_twid3[2 - i]; + } +} + +static void L3_imdct_short(float *grbuf, float *overlap, int nbands) +{ + for (;nbands > 0; nbands--, overlap += 9, grbuf += 18) + { + float tmp[18]; + memcpy(tmp, grbuf, sizeof(tmp)); + memcpy(grbuf, overlap, 6*sizeof(float)); + L3_imdct12(tmp, grbuf + 6, overlap + 6); + L3_imdct12(tmp + 1, grbuf + 12, overlap + 6); + L3_imdct12(tmp + 2, overlap, overlap + 6); + } +} + +static void L3_change_sign(float *grbuf) +{ + int b, i; + for (b = 0, grbuf += 18; b < 32; b += 2, grbuf += 36) + for (i = 1; i < 18; i += 2) + grbuf[i] = -grbuf[i]; +} + +static void L3_imdct_gr(float *grbuf, float *overlap, unsigned block_type, unsigned n_long_bands) +{ + static const float g_mdct_window[2][18] = { + { 0.99904822f,0.99144486f,0.97629601f,0.95371695f,0.92387953f,0.88701083f,0.84339145f,0.79335334f,0.73727734f,0.04361938f,0.13052619f,0.21643961f,0.30070580f,0.38268343f,0.46174861f,0.53729961f,0.60876143f,0.67559021f }, + { 1,1,1,1,1,1,0.99144486f,0.92387953f,0.79335334f,0,0,0,0,0,0,0.13052619f,0.38268343f,0.60876143f } + }; + if (n_long_bands) + { + L3_imdct36(grbuf, overlap, g_mdct_window[0], n_long_bands); + grbuf += 18*n_long_bands; + overlap += 9*n_long_bands; + } + if (block_type == SHORT_BLOCK_TYPE) + L3_imdct_short(grbuf, overlap, 32 - n_long_bands); + else + L3_imdct36(grbuf, overlap, g_mdct_window[block_type == STOP_BLOCK_TYPE], 32 - n_long_bands); +} + +static void L3_save_reservoir(mp3dec_t *h, mp3dec_scratch_t *s) +{ + int pos = (s->bs.pos + 7)/8u; + int remains = s->bs.limit/8u - pos; + if (remains > MAX_BITRESERVOIR_BYTES) + { + pos += remains - MAX_BITRESERVOIR_BYTES; + remains = MAX_BITRESERVOIR_BYTES; + } + if (remains > 0) + { + memmove(h->reserv_buf, s->maindata + pos, remains); + } + h->reserv = remains; +} + +static int L3_restore_reservoir(mp3dec_t *h, bs_t *bs, mp3dec_scratch_t *s, int main_data_begin) +{ + int frame_bytes = (bs->limit - bs->pos)/8; + int bytes_have = MINIMP3_MIN(h->reserv, main_data_begin); + memcpy(s->maindata, h->reserv_buf + MINIMP3_MAX(0, h->reserv - main_data_begin), MINIMP3_MIN(h->reserv, main_data_begin)); + memcpy(s->maindata + bytes_have, bs->buf + bs->pos/8, frame_bytes); + bs_init(&s->bs, s->maindata, bytes_have + frame_bytes); + return h->reserv >= main_data_begin; +} + +static void L3_decode(mp3dec_t *h, mp3dec_scratch_t *s, L3_gr_info_t *gr_info, int nch) +{ + int ch; + + for (ch = 0; ch < nch; ch++) + { + int layer3gr_limit = s->bs.pos + gr_info[ch].part_23_length; + L3_decode_scalefactors(h->header, s->ist_pos[ch], &s->bs, gr_info + ch, s->scf, ch); + L3_huffman(s->grbuf[ch], &s->bs, gr_info + ch, s->scf, layer3gr_limit); + } + + if (HDR_TEST_I_STEREO(h->header)) + { + L3_intensity_stereo(s->grbuf[0], s->ist_pos[1], gr_info, h->header); + } else if (HDR_IS_MS_STEREO(h->header)) + { + L3_midside_stereo(s->grbuf[0], 576); + } + + for (ch = 0; ch < nch; ch++, gr_info++) + { + int aa_bands = 31; + int n_long_bands = (gr_info->mixed_block_flag ? 2 : 0) << (int)(HDR_GET_MY_SAMPLE_RATE(h->header) == 2); + + if (gr_info->n_short_sfb) + { + aa_bands = n_long_bands - 1; + L3_reorder(s->grbuf[ch] + n_long_bands*18, s->syn[0], gr_info->sfbtab + gr_info->n_long_sfb); + } + + L3_antialias(s->grbuf[ch], aa_bands); + L3_imdct_gr(s->grbuf[ch], h->mdct_overlap[ch], gr_info->block_type, n_long_bands); + L3_change_sign(s->grbuf[ch]); + } +} + +static void mp3d_DCT_II(float *grbuf, int n) +{ + static const float g_sec[24] = { + 10.19000816f,0.50060302f,0.50241929f,3.40760851f,0.50547093f,0.52249861f,2.05778098f,0.51544732f,0.56694406f,1.48416460f,0.53104258f,0.64682180f,1.16943991f,0.55310392f,0.78815460f,0.97256821f,0.58293498f,1.06067765f,0.83934963f,0.62250412f,1.72244716f,0.74453628f,0.67480832f,5.10114861f + }; + int i, k = 0; +#if HAVE_SIMD + if (have_simd()) for (; k < n; k += 4) + { + f4 t[4][8], *x; + float *y = grbuf + k; + + for (x = t[0], i = 0; i < 8; i++, x++) + { + f4 x0 = VLD(&y[i*18]); + f4 x1 = VLD(&y[(15 - i)*18]); + f4 x2 = VLD(&y[(16 + i)*18]); + f4 x3 = VLD(&y[(31 - i)*18]); + f4 t0 = VADD(x0, x3); + f4 t1 = VADD(x1, x2); + f4 t2 = VMUL_S(VSUB(x1, x2), g_sec[3*i + 0]); + f4 t3 = VMUL_S(VSUB(x0, x3), g_sec[3*i + 1]); + x[0] = VADD(t0, t1); + x[8] = VMUL_S(VSUB(t0, t1), g_sec[3*i + 2]); + x[16] = VADD(t3, t2); + x[24] = VMUL_S(VSUB(t3, t2), g_sec[3*i + 2]); + } + for (x = t[0], i = 0; i < 4; i++, x += 8) + { + f4 x0 = x[0], x1 = x[1], x2 = x[2], x3 = x[3], x4 = x[4], x5 = x[5], x6 = x[6], x7 = x[7], xt; + xt = VSUB(x0, x7); x0 = VADD(x0, x7); + x7 = VSUB(x1, x6); x1 = VADD(x1, x6); + x6 = VSUB(x2, x5); x2 = VADD(x2, x5); + x5 = VSUB(x3, x4); x3 = VADD(x3, x4); + x4 = VSUB(x0, x3); x0 = VADD(x0, x3); + x3 = VSUB(x1, x2); x1 = VADD(x1, x2); + x[0] = VADD(x0, x1); + x[4] = VMUL_S(VSUB(x0, x1), 0.70710677f); + x5 = VADD(x5, x6); + x6 = VMUL_S(VADD(x6, x7), 0.70710677f); + x7 = VADD(x7, xt); + x3 = VMUL_S(VADD(x3, x4), 0.70710677f); + x5 = VSUB(x5, VMUL_S(x7, 0.198912367f)); /* rotate by PI/8 */ + x7 = VADD(x7, VMUL_S(x5, 0.382683432f)); + x5 = VSUB(x5, VMUL_S(x7, 0.198912367f)); + x0 = VSUB(xt, x6); xt = VADD(xt, x6); + x[1] = VMUL_S(VADD(xt, x7), 0.50979561f); + x[2] = VMUL_S(VADD(x4, x3), 0.54119611f); + x[3] = VMUL_S(VSUB(x0, x5), 0.60134488f); + x[5] = VMUL_S(VADD(x0, x5), 0.89997619f); + x[6] = VMUL_S(VSUB(x4, x3), 1.30656302f); + x[7] = VMUL_S(VSUB(xt, x7), 2.56291556f); + } + + if (k > n - 3) + { +#if HAVE_SSE +#define VSAVE2(i, v) _mm_storel_pi((__m64 *)(void*)&y[i*18], v) +#else /* HAVE_SSE */ +#define VSAVE2(i, v) vst1_f32((float32_t *)&y[i*18], vget_low_f32(v)) +#endif /* HAVE_SSE */ + for (i = 0; i < 7; i++, y += 4*18) + { + f4 s = VADD(t[3][i], t[3][i + 1]); + VSAVE2(0, t[0][i]); + VSAVE2(1, VADD(t[2][i], s)); + VSAVE2(2, VADD(t[1][i], t[1][i + 1])); + VSAVE2(3, VADD(t[2][1 + i], s)); + } + VSAVE2(0, t[0][7]); + VSAVE2(1, VADD(t[2][7], t[3][7])); + VSAVE2(2, t[1][7]); + VSAVE2(3, t[3][7]); + } else + { +#define VSAVE4(i, v) VSTORE(&y[i*18], v) + for (i = 0; i < 7; i++, y += 4*18) + { + f4 s = VADD(t[3][i], t[3][i + 1]); + VSAVE4(0, t[0][i]); + VSAVE4(1, VADD(t[2][i], s)); + VSAVE4(2, VADD(t[1][i], t[1][i + 1])); + VSAVE4(3, VADD(t[2][1 + i], s)); + } + VSAVE4(0, t[0][7]); + VSAVE4(1, VADD(t[2][7], t[3][7])); + VSAVE4(2, t[1][7]); + VSAVE4(3, t[3][7]); + } + } else +#endif /* HAVE_SIMD */ +#ifdef MINIMP3_ONLY_SIMD + {} /* for HAVE_SIMD=1, MINIMP3_ONLY_SIMD=1 case we do not need non-intrinsic "else" branch */ +#else /* MINIMP3_ONLY_SIMD */ + for (; k < n; k++) + { + float t[4][8], *x, *y = grbuf + k; + + for (x = t[0], i = 0; i < 8; i++, x++) + { + float x0 = y[i*18]; + float x1 = y[(15 - i)*18]; + float x2 = y[(16 + i)*18]; + float x3 = y[(31 - i)*18]; + float t0 = x0 + x3; + float t1 = x1 + x2; + float t2 = (x1 - x2)*g_sec[3*i + 0]; + float t3 = (x0 - x3)*g_sec[3*i + 1]; + x[0] = t0 + t1; + x[8] = (t0 - t1)*g_sec[3*i + 2]; + x[16] = t3 + t2; + x[24] = (t3 - t2)*g_sec[3*i + 2]; + } + for (x = t[0], i = 0; i < 4; i++, x += 8) + { + float x0 = x[0], x1 = x[1], x2 = x[2], x3 = x[3], x4 = x[4], x5 = x[5], x6 = x[6], x7 = x[7], xt; + xt = x0 - x7; x0 += x7; + x7 = x1 - x6; x1 += x6; + x6 = x2 - x5; x2 += x5; + x5 = x3 - x4; x3 += x4; + x4 = x0 - x3; x0 += x3; + x3 = x1 - x2; x1 += x2; + x[0] = x0 + x1; + x[4] = (x0 - x1)*0.70710677f; + x5 = x5 + x6; + x6 = (x6 + x7)*0.70710677f; + x7 = x7 + xt; + x3 = (x3 + x4)*0.70710677f; + x5 -= x7*0.198912367f; /* rotate by PI/8 */ + x7 += x5*0.382683432f; + x5 -= x7*0.198912367f; + x0 = xt - x6; xt += x6; + x[1] = (xt + x7)*0.50979561f; + x[2] = (x4 + x3)*0.54119611f; + x[3] = (x0 - x5)*0.60134488f; + x[5] = (x0 + x5)*0.89997619f; + x[6] = (x4 - x3)*1.30656302f; + x[7] = (xt - x7)*2.56291556f; + + } + for (i = 0; i < 7; i++, y += 4*18) + { + y[0*18] = t[0][i]; + y[1*18] = t[2][i] + t[3][i] + t[3][i + 1]; + y[2*18] = t[1][i] + t[1][i + 1]; + y[3*18] = t[2][i + 1] + t[3][i] + t[3][i + 1]; + } + y[0*18] = t[0][7]; + y[1*18] = t[2][7] + t[3][7]; + y[2*18] = t[1][7]; + y[3*18] = t[3][7]; + } +#endif /* MINIMP3_ONLY_SIMD */ +} + +#ifndef MINIMP3_FLOAT_OUTPUT +static int16_t mp3d_scale_pcm(float sample) +{ +#if HAVE_ARMV6 + int32_t s32 = (int32_t)(sample + .5f); + s32 -= (s32 < 0); + int16_t s = (int16_t)minimp3_clip_int16_arm(s32); +#else + if (sample >= 32766.5) return (int16_t) 32767; + if (sample <= -32767.5) return (int16_t)-32768; + int16_t s = (int16_t)(sample + .5f); + s -= (s < 0); /* away from zero, to be compliant */ +#endif + return s; +} +#else /* MINIMP3_FLOAT_OUTPUT */ +static float mp3d_scale_pcm(float sample) +{ + return sample*(1.f/32768.f); +} +#endif /* MINIMP3_FLOAT_OUTPUT */ + +static void mp3d_synth_pair(mp3d_sample_t *pcm, int nch, const float *z) +{ + float a; + a = (z[14*64] - z[ 0]) * 29; + a += (z[ 1*64] + z[13*64]) * 213; + a += (z[12*64] - z[ 2*64]) * 459; + a += (z[ 3*64] + z[11*64]) * 2037; + a += (z[10*64] - z[ 4*64]) * 5153; + a += (z[ 5*64] + z[ 9*64]) * 6574; + a += (z[ 8*64] - z[ 6*64]) * 37489; + a += z[ 7*64] * 75038; + pcm[0] = mp3d_scale_pcm(a); + + z += 2; + a = z[14*64] * 104; + a += z[12*64] * 1567; + a += z[10*64] * 9727; + a += z[ 8*64] * 64019; + a += z[ 6*64] * -9975; + a += z[ 4*64] * -45; + a += z[ 2*64] * 146; + a += z[ 0*64] * -5; + pcm[16*nch] = mp3d_scale_pcm(a); +} + +static void mp3d_synth(float *xl, mp3d_sample_t *dstl, int nch, float *lins) +{ + int i; + float *xr = xl + 576*(nch - 1); + mp3d_sample_t *dstr = dstl + (nch - 1); + + static const float g_win[] = { + -1,26,-31,208,218,401,-519,2063,2000,4788,-5517,7134,5959,35640,-39336,74992, + -1,24,-35,202,222,347,-581,2080,1952,4425,-5879,7640,5288,33791,-41176,74856, + -1,21,-38,196,225,294,-645,2087,1893,4063,-6237,8092,4561,31947,-43006,74630, + -1,19,-41,190,227,244,-711,2085,1822,3705,-6589,8492,3776,30112,-44821,74313, + -1,17,-45,183,228,197,-779,2075,1739,3351,-6935,8840,2935,28289,-46617,73908, + -1,16,-49,176,228,153,-848,2057,1644,3004,-7271,9139,2037,26482,-48390,73415, + -2,14,-53,169,227,111,-919,2032,1535,2663,-7597,9389,1082,24694,-50137,72835, + -2,13,-58,161,224,72,-991,2001,1414,2330,-7910,9592,70,22929,-51853,72169, + -2,11,-63,154,221,36,-1064,1962,1280,2006,-8209,9750,-998,21189,-53534,71420, + -2,10,-68,147,215,2,-1137,1919,1131,1692,-8491,9863,-2122,19478,-55178,70590, + -3,9,-73,139,208,-29,-1210,1870,970,1388,-8755,9935,-3300,17799,-56778,69679, + -3,8,-79,132,200,-57,-1283,1817,794,1095,-8998,9966,-4533,16155,-58333,68692, + -4,7,-85,125,189,-83,-1356,1759,605,814,-9219,9959,-5818,14548,-59838,67629, + -4,7,-91,117,177,-106,-1428,1698,402,545,-9416,9916,-7154,12980,-61289,66494, + -5,6,-97,111,163,-127,-1498,1634,185,288,-9585,9838,-8540,11455,-62684,65290 + }; + float *zlin = lins + 15*64; + const float *w = g_win; + + zlin[4*15] = xl[18*16]; + zlin[4*15 + 1] = xr[18*16]; + zlin[4*15 + 2] = xl[0]; + zlin[4*15 + 3] = xr[0]; + + zlin[4*31] = xl[1 + 18*16]; + zlin[4*31 + 1] = xr[1 + 18*16]; + zlin[4*31 + 2] = xl[1]; + zlin[4*31 + 3] = xr[1]; + + mp3d_synth_pair(dstr, nch, lins + 4*15 + 1); + mp3d_synth_pair(dstr + 32*nch, nch, lins + 4*15 + 64 + 1); + mp3d_synth_pair(dstl, nch, lins + 4*15); + mp3d_synth_pair(dstl + 32*nch, nch, lins + 4*15 + 64); + +#if HAVE_SIMD + if (have_simd()) for (i = 14; i >= 0; i--) + { +#define VLOAD(k) f4 w0 = VSET(*w++); f4 w1 = VSET(*w++); f4 vz = VLD(&zlin[4*i - 64*k]); f4 vy = VLD(&zlin[4*i - 64*(15 - k)]); +#define V0(k) { VLOAD(k) b = VADD(VMUL(vz, w1), VMUL(vy, w0)) ; a = VSUB(VMUL(vz, w0), VMUL(vy, w1)); } +#define V1(k) { VLOAD(k) b = VADD(b, VADD(VMUL(vz, w1), VMUL(vy, w0))); a = VADD(a, VSUB(VMUL(vz, w0), VMUL(vy, w1))); } +#define V2(k) { VLOAD(k) b = VADD(b, VADD(VMUL(vz, w1), VMUL(vy, w0))); a = VADD(a, VSUB(VMUL(vy, w1), VMUL(vz, w0))); } + f4 a, b; + zlin[4*i] = xl[18*(31 - i)]; + zlin[4*i + 1] = xr[18*(31 - i)]; + zlin[4*i + 2] = xl[1 + 18*(31 - i)]; + zlin[4*i + 3] = xr[1 + 18*(31 - i)]; + zlin[4*i + 64] = xl[1 + 18*(1 + i)]; + zlin[4*i + 64 + 1] = xr[1 + 18*(1 + i)]; + zlin[4*i - 64 + 2] = xl[18*(1 + i)]; + zlin[4*i - 64 + 3] = xr[18*(1 + i)]; + + V0(0) V2(1) V1(2) V2(3) V1(4) V2(5) V1(6) V2(7) + + { +#ifndef MINIMP3_FLOAT_OUTPUT +#if HAVE_SSE + static const f4 g_max = { 32767.0f, 32767.0f, 32767.0f, 32767.0f }; + static const f4 g_min = { -32768.0f, -32768.0f, -32768.0f, -32768.0f }; + __m128i pcm8 = _mm_packs_epi32(_mm_cvtps_epi32(_mm_max_ps(_mm_min_ps(a, g_max), g_min)), + _mm_cvtps_epi32(_mm_max_ps(_mm_min_ps(b, g_max), g_min))); + dstr[(15 - i)*nch] = _mm_extract_epi16(pcm8, 1); + dstr[(17 + i)*nch] = _mm_extract_epi16(pcm8, 5); + dstl[(15 - i)*nch] = _mm_extract_epi16(pcm8, 0); + dstl[(17 + i)*nch] = _mm_extract_epi16(pcm8, 4); + dstr[(47 - i)*nch] = _mm_extract_epi16(pcm8, 3); + dstr[(49 + i)*nch] = _mm_extract_epi16(pcm8, 7); + dstl[(47 - i)*nch] = _mm_extract_epi16(pcm8, 2); + dstl[(49 + i)*nch] = _mm_extract_epi16(pcm8, 6); +#else /* HAVE_SSE */ + int16x4_t pcma, pcmb; + a = VADD(a, VSET(0.5f)); + b = VADD(b, VSET(0.5f)); + pcma = vqmovn_s32(vqaddq_s32(vcvtq_s32_f32(a), vreinterpretq_s32_u32(vcltq_f32(a, VSET(0))))); + pcmb = vqmovn_s32(vqaddq_s32(vcvtq_s32_f32(b), vreinterpretq_s32_u32(vcltq_f32(b, VSET(0))))); + vst1_lane_s16(dstr + (15 - i)*nch, pcma, 1); + vst1_lane_s16(dstr + (17 + i)*nch, pcmb, 1); + vst1_lane_s16(dstl + (15 - i)*nch, pcma, 0); + vst1_lane_s16(dstl + (17 + i)*nch, pcmb, 0); + vst1_lane_s16(dstr + (47 - i)*nch, pcma, 3); + vst1_lane_s16(dstr + (49 + i)*nch, pcmb, 3); + vst1_lane_s16(dstl + (47 - i)*nch, pcma, 2); + vst1_lane_s16(dstl + (49 + i)*nch, pcmb, 2); +#endif /* HAVE_SSE */ + +#else /* MINIMP3_FLOAT_OUTPUT */ + + static const f4 g_scale = { 1.0f/32768.0f, 1.0f/32768.0f, 1.0f/32768.0f, 1.0f/32768.0f }; + a = VMUL(a, g_scale); + b = VMUL(b, g_scale); +#if HAVE_SSE + _mm_store_ss(dstr + (15 - i)*nch, _mm_shuffle_ps(a, a, _MM_SHUFFLE(1, 1, 1, 1))); + _mm_store_ss(dstr + (17 + i)*nch, _mm_shuffle_ps(b, b, _MM_SHUFFLE(1, 1, 1, 1))); + _mm_store_ss(dstl + (15 - i)*nch, _mm_shuffle_ps(a, a, _MM_SHUFFLE(0, 0, 0, 0))); + _mm_store_ss(dstl + (17 + i)*nch, _mm_shuffle_ps(b, b, _MM_SHUFFLE(0, 0, 0, 0))); + _mm_store_ss(dstr + (47 - i)*nch, _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 3, 3, 3))); + _mm_store_ss(dstr + (49 + i)*nch, _mm_shuffle_ps(b, b, _MM_SHUFFLE(3, 3, 3, 3))); + _mm_store_ss(dstl + (47 - i)*nch, _mm_shuffle_ps(a, a, _MM_SHUFFLE(2, 2, 2, 2))); + _mm_store_ss(dstl + (49 + i)*nch, _mm_shuffle_ps(b, b, _MM_SHUFFLE(2, 2, 2, 2))); +#else /* HAVE_SSE */ + vst1q_lane_f32(dstr + (15 - i)*nch, a, 1); + vst1q_lane_f32(dstr + (17 + i)*nch, b, 1); + vst1q_lane_f32(dstl + (15 - i)*nch, a, 0); + vst1q_lane_f32(dstl + (17 + i)*nch, b, 0); + vst1q_lane_f32(dstr + (47 - i)*nch, a, 3); + vst1q_lane_f32(dstr + (49 + i)*nch, b, 3); + vst1q_lane_f32(dstl + (47 - i)*nch, a, 2); + vst1q_lane_f32(dstl + (49 + i)*nch, b, 2); +#endif /* HAVE_SSE */ +#endif /* MINIMP3_FLOAT_OUTPUT */ + } + } else +#endif /* HAVE_SIMD */ +#ifdef MINIMP3_ONLY_SIMD + {} /* for HAVE_SIMD=1, MINIMP3_ONLY_SIMD=1 case we do not need non-intrinsic "else" branch */ +#else /* MINIMP3_ONLY_SIMD */ + for (i = 14; i >= 0; i--) + { +#define LOAD(k) float w0 = *w++; float w1 = *w++; float *vz = &zlin[4*i - k*64]; float *vy = &zlin[4*i - (15 - k)*64]; +#define S0(k) { int j; LOAD(k); for (j = 0; j < 4; j++) b[j] = vz[j]*w1 + vy[j]*w0, a[j] = vz[j]*w0 - vy[j]*w1; } +#define S1(k) { int j; LOAD(k); for (j = 0; j < 4; j++) b[j] += vz[j]*w1 + vy[j]*w0, a[j] += vz[j]*w0 - vy[j]*w1; } +#define S2(k) { int j; LOAD(k); for (j = 0; j < 4; j++) b[j] += vz[j]*w1 + vy[j]*w0, a[j] += vy[j]*w1 - vz[j]*w0; } + float a[4], b[4]; + + zlin[4*i] = xl[18*(31 - i)]; + zlin[4*i + 1] = xr[18*(31 - i)]; + zlin[4*i + 2] = xl[1 + 18*(31 - i)]; + zlin[4*i + 3] = xr[1 + 18*(31 - i)]; + zlin[4*(i + 16)] = xl[1 + 18*(1 + i)]; + zlin[4*(i + 16) + 1] = xr[1 + 18*(1 + i)]; + zlin[4*(i - 16) + 2] = xl[18*(1 + i)]; + zlin[4*(i - 16) + 3] = xr[18*(1 + i)]; + + S0(0) S2(1) S1(2) S2(3) S1(4) S2(5) S1(6) S2(7) + + dstr[(15 - i)*nch] = mp3d_scale_pcm(a[1]); + dstr[(17 + i)*nch] = mp3d_scale_pcm(b[1]); + dstl[(15 - i)*nch] = mp3d_scale_pcm(a[0]); + dstl[(17 + i)*nch] = mp3d_scale_pcm(b[0]); + dstr[(47 - i)*nch] = mp3d_scale_pcm(a[3]); + dstr[(49 + i)*nch] = mp3d_scale_pcm(b[3]); + dstl[(47 - i)*nch] = mp3d_scale_pcm(a[2]); + dstl[(49 + i)*nch] = mp3d_scale_pcm(b[2]); + } +#endif /* MINIMP3_ONLY_SIMD */ +} + +static void mp3d_synth_granule(float *qmf_state, float *grbuf, int nbands, int nch, mp3d_sample_t *pcm, float *lins) +{ + int i; + for (i = 0; i < nch; i++) + { + mp3d_DCT_II(grbuf + 576*i, nbands); + } + + memcpy(lins, qmf_state, sizeof(float)*15*64); + + for (i = 0; i < nbands; i += 2) + { + mp3d_synth(grbuf + i, pcm + 32*nch*i, nch, lins + i*64); + } +#ifndef MINIMP3_NONSTANDARD_BUT_LOGICAL + if (nch == 1) + { + for (i = 0; i < 15*64; i += 2) + { + qmf_state[i] = lins[nbands*64 + i]; + } + } else +#endif /* MINIMP3_NONSTANDARD_BUT_LOGICAL */ + { + memcpy(qmf_state, lins + nbands*64, sizeof(float)*15*64); + } +} + +static int mp3d_match_frame(const uint8_t *hdr, int mp3_bytes, int frame_bytes) +{ + int i, nmatch; + for (i = 0, nmatch = 0; nmatch < MAX_FRAME_SYNC_MATCHES; nmatch++) + { + i += hdr_frame_bytes(hdr + i, frame_bytes) + hdr_padding(hdr + i); + if (i + HDR_SIZE > mp3_bytes) + return nmatch > 0; + if (!hdr_compare(hdr, hdr + i)) + return 0; + } + return 1; +} + +static int mp3d_find_frame(const uint8_t *mp3, int mp3_bytes, int *free_format_bytes, int *ptr_frame_bytes) +{ + int i, k; + for (i = 0; i < mp3_bytes - HDR_SIZE; i++, mp3++) + { + if (hdr_valid(mp3)) + { + int frame_bytes = hdr_frame_bytes(mp3, *free_format_bytes); + int frame_and_padding = frame_bytes + hdr_padding(mp3); + + for (k = HDR_SIZE; !frame_bytes && k < MAX_FREE_FORMAT_FRAME_SIZE && i + 2*k < mp3_bytes - HDR_SIZE; k++) + { + if (hdr_compare(mp3, mp3 + k)) + { + int fb = k - hdr_padding(mp3); + int nextfb = fb + hdr_padding(mp3 + k); + if (i + k + nextfb + HDR_SIZE > mp3_bytes || !hdr_compare(mp3, mp3 + k + nextfb)) + continue; + frame_and_padding = k; + frame_bytes = fb; + *free_format_bytes = fb; + } + } + if ((frame_bytes && i + frame_and_padding <= mp3_bytes && + mp3d_match_frame(mp3, mp3_bytes - i, frame_bytes)) || + (!i && frame_and_padding == mp3_bytes)) + { + *ptr_frame_bytes = frame_and_padding; + return i; + } + *free_format_bytes = 0; + } + } + *ptr_frame_bytes = 0; + return mp3_bytes; +} + +void mp3dec_init(mp3dec_t *dec) +{ + dec->header[0] = 0; +} + +int mp3dec_decode_frame(mp3dec_t *dec, const uint8_t *mp3, int mp3_bytes, mp3d_sample_t *pcm, mp3dec_frame_info_t *info) +{ + int i = 0, igr, frame_size = 0, success = 1; + const uint8_t *hdr; + bs_t bs_frame[1]; + mp3dec_scratch_t scratch; + + if (mp3_bytes > 4 && dec->header[0] == 0xff && hdr_compare(dec->header, mp3)) + { + frame_size = hdr_frame_bytes(mp3, dec->free_format_bytes) + hdr_padding(mp3); + if (frame_size != mp3_bytes && (frame_size + HDR_SIZE > mp3_bytes || !hdr_compare(mp3, mp3 + frame_size))) + { + frame_size = 0; + } + } + if (!frame_size) + { + memset(dec, 0, sizeof(mp3dec_t)); + i = mp3d_find_frame(mp3, mp3_bytes, &dec->free_format_bytes, &frame_size); + if (!frame_size || i + frame_size > mp3_bytes) + { + info->frame_bytes = i; + return 0; + } + } + + hdr = mp3 + i; + memcpy(dec->header, hdr, HDR_SIZE); + info->frame_bytes = i + frame_size; + info->frame_offset = i; + info->channels = HDR_IS_MONO(hdr) ? 1 : 2; + info->hz = hdr_sample_rate_hz(hdr); + info->layer = 4 - HDR_GET_LAYER(hdr); + info->bitrate_kbps = hdr_bitrate_kbps(hdr); + + if (!pcm) + { + return hdr_frame_samples(hdr); + } + + bs_init(bs_frame, hdr + HDR_SIZE, frame_size - HDR_SIZE); + if (HDR_IS_CRC(hdr)) + { + get_bits(bs_frame, 16); + } + + if (info->layer == 3) + { + int main_data_begin = L3_read_side_info(bs_frame, scratch.gr_info, hdr); + if (main_data_begin < 0 || bs_frame->pos > bs_frame->limit) + { + mp3dec_init(dec); + return 0; + } + success = L3_restore_reservoir(dec, bs_frame, &scratch, main_data_begin); + if (success) + { + for (igr = 0; igr < (HDR_TEST_MPEG1(hdr) ? 2 : 1); igr++, pcm += 576*info->channels) + { + memset(scratch.grbuf[0], 0, 576*2*sizeof(float)); + L3_decode(dec, &scratch, scratch.gr_info + igr*info->channels, info->channels); + mp3d_synth_granule(dec->qmf_state, scratch.grbuf[0], 18, info->channels, pcm, scratch.syn[0]); + } + } + L3_save_reservoir(dec, &scratch); + } else + { +#ifdef MINIMP3_ONLY_MP3 + return 0; +#else /* MINIMP3_ONLY_MP3 */ + L12_scale_info sci[1]; + L12_read_scale_info(hdr, bs_frame, sci); + + memset(scratch.grbuf[0], 0, 576*2*sizeof(float)); + for (i = 0, igr = 0; igr < 3; igr++) + { + if (12 == (i += L12_dequantize_granule(scratch.grbuf[0] + i, bs_frame, sci, info->layer | 1))) + { + i = 0; + L12_apply_scf_384(sci, sci->scf + igr, scratch.grbuf[0]); + mp3d_synth_granule(dec->qmf_state, scratch.grbuf[0], 12, info->channels, pcm, scratch.syn[0]); + memset(scratch.grbuf[0], 0, 576*2*sizeof(float)); + pcm += 384*info->channels; + } + if (bs_frame->pos > bs_frame->limit) + { + mp3dec_init(dec); + return 0; + } + } +#endif /* MINIMP3_ONLY_MP3 */ + } + return success*hdr_frame_samples(dec->header); +} + +#ifdef MINIMP3_FLOAT_OUTPUT +void mp3dec_f32_to_s16(const float *in, int16_t *out, int num_samples) +{ + int i = 0; +#if HAVE_SIMD + int aligned_count = num_samples & ~7; + for(; i < aligned_count; i += 8) + { + static const f4 g_scale = { 32768.0f, 32768.0f, 32768.0f, 32768.0f }; + f4 a = VMUL(VLD(&in[i ]), g_scale); + f4 b = VMUL(VLD(&in[i+4]), g_scale); +#if HAVE_SSE + static const f4 g_max = { 32767.0f, 32767.0f, 32767.0f, 32767.0f }; + static const f4 g_min = { -32768.0f, -32768.0f, -32768.0f, -32768.0f }; + __m128i pcm8 = _mm_packs_epi32(_mm_cvtps_epi32(_mm_max_ps(_mm_min_ps(a, g_max), g_min)), + _mm_cvtps_epi32(_mm_max_ps(_mm_min_ps(b, g_max), g_min))); + out[i ] = _mm_extract_epi16(pcm8, 0); + out[i+1] = _mm_extract_epi16(pcm8, 1); + out[i+2] = _mm_extract_epi16(pcm8, 2); + out[i+3] = _mm_extract_epi16(pcm8, 3); + out[i+4] = _mm_extract_epi16(pcm8, 4); + out[i+5] = _mm_extract_epi16(pcm8, 5); + out[i+6] = _mm_extract_epi16(pcm8, 6); + out[i+7] = _mm_extract_epi16(pcm8, 7); +#else /* HAVE_SSE */ + int16x4_t pcma, pcmb; + a = VADD(a, VSET(0.5f)); + b = VADD(b, VSET(0.5f)); + pcma = vqmovn_s32(vqaddq_s32(vcvtq_s32_f32(a), vreinterpretq_s32_u32(vcltq_f32(a, VSET(0))))); + pcmb = vqmovn_s32(vqaddq_s32(vcvtq_s32_f32(b), vreinterpretq_s32_u32(vcltq_f32(b, VSET(0))))); + vst1_lane_s16(out+i , pcma, 0); + vst1_lane_s16(out+i+1, pcma, 1); + vst1_lane_s16(out+i+2, pcma, 2); + vst1_lane_s16(out+i+3, pcma, 3); + vst1_lane_s16(out+i+4, pcmb, 0); + vst1_lane_s16(out+i+5, pcmb, 1); + vst1_lane_s16(out+i+6, pcmb, 2); + vst1_lane_s16(out+i+7, pcmb, 3); +#endif /* HAVE_SSE */ + } +#endif /* HAVE_SIMD */ + for(; i < num_samples; i++) + { + float sample = in[i] * 32768.0f; + if (sample >= 32766.5) + out[i] = (int16_t) 32767; + else if (sample <= -32767.5) + out[i] = (int16_t)-32768; + else + { + int16_t s = (int16_t)(sample + .5f); + s -= (s < 0); /* away from zero, to be compliant */ + out[i] = s; + } + } +} +#endif /* MINIMP3_FLOAT_OUTPUT */ +#endif /* MINIMP3_IMPLEMENTATION && !_MINIMP3_IMPLEMENTATION_GUARD */ diff --git a/external/minimp3/minimp3_ex.h b/external/minimp3/minimp3_ex.h new file mode 100644 index 00000000..e29dd15b --- /dev/null +++ b/external/minimp3/minimp3_ex.h @@ -0,0 +1,1394 @@ +#ifndef MINIMP3_EXT_H +#define MINIMP3_EXT_H +/* + https://github.com/lieff/minimp3 + To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. + This software is distributed without any warranty. + See . +*/ +#include "minimp3.h" + +/* flags for mp3dec_ex_open_* functions */ +#define MP3D_SEEK_TO_BYTE 0 /* mp3dec_ex_seek seeks to byte in stream */ +#define MP3D_SEEK_TO_SAMPLE 1 /* mp3dec_ex_seek precisely seeks to sample using index (created during duration calculation scan or when mp3dec_ex_seek called) */ +#define MP3D_DO_NOT_SCAN 2 /* do not scan whole stream for duration if vbrtag not found, mp3dec_ex_t::samples will be filled only if mp3dec_ex_t::vbr_tag_found == 1 */ +#ifdef MINIMP3_ALLOW_MONO_STEREO_TRANSITION +#define MP3D_ALLOW_MONO_STEREO_TRANSITION 4 +#define MP3D_FLAGS_MASK 7 +#else +#define MP3D_FLAGS_MASK 3 +#endif + +/* compile-time config */ +#define MINIMP3_PREDECODE_FRAMES 2 /* frames to pre-decode and skip after seek (to fill internal structures) */ +/*#define MINIMP3_SEEK_IDX_LINEAR_SEARCH*/ /* define to use linear index search instead of binary search on seek */ +#define MINIMP3_IO_SIZE (128*1024) /* io buffer size for streaming functions, must be greater than MINIMP3_BUF_SIZE */ +#define MINIMP3_BUF_SIZE (16*1024) /* buffer which can hold minimum 10 consecutive mp3 frames (~16KB) worst case */ +/*#define MINIMP3_SCAN_LIMIT (256*1024)*/ /* how many bytes will be scanned to search first valid mp3 frame, to prevent stall on large non-mp3 files */ +#define MINIMP3_ENABLE_RING 0 /* WIP enable hardware magic ring buffer if available, to make less input buffer memmove(s) in callback IO mode */ + +/* return error codes */ +#define MP3D_E_PARAM -1 +#define MP3D_E_MEMORY -2 +#define MP3D_E_IOERROR -3 +#define MP3D_E_USER -4 /* can be used to stop processing from callbacks without indicating specific error */ +#define MP3D_E_DECODE -5 /* decode error which can't be safely skipped, such as sample rate, layer and channels change */ + +typedef struct +{ + mp3d_sample_t *buffer; + size_t samples; /* channels included, byte size = samples*sizeof(mp3d_sample_t) */ + int channels, hz, layer, avg_bitrate_kbps; +} mp3dec_file_info_t; + +typedef struct +{ + const uint8_t *buffer; + size_t size; +} mp3dec_map_info_t; + +typedef struct +{ + uint64_t sample; + uint64_t offset; +} mp3dec_frame_t; + +typedef struct +{ + mp3dec_frame_t *frames; + size_t num_frames, capacity; +} mp3dec_index_t; + +typedef size_t (*MP3D_READ_CB)(void *buf, size_t size, void *user_data); +typedef int (*MP3D_SEEK_CB)(uint64_t position, void *user_data); + +typedef struct +{ + MP3D_READ_CB read; + void *read_data; + MP3D_SEEK_CB seek; + void *seek_data; +} mp3dec_io_t; + +typedef struct +{ + mp3dec_t mp3d; + mp3dec_map_info_t file; + mp3dec_io_t *io; + mp3dec_index_t index; + uint64_t offset, samples, detected_samples, cur_sample, start_offset, end_offset; + mp3dec_frame_info_t info; + mp3d_sample_t buffer[MINIMP3_MAX_SAMPLES_PER_FRAME]; + size_t input_consumed, input_filled; + int is_file, flags, vbr_tag_found, indexes_built; + int free_format_bytes; + int buffer_samples, buffer_consumed, to_skip, start_delay; + int last_error; +} mp3dec_ex_t; + +typedef int (*MP3D_ITERATE_CB)(void *user_data, const uint8_t *frame, int frame_size, int free_format_bytes, size_t buf_size, uint64_t offset, mp3dec_frame_info_t *info); +typedef int (*MP3D_PROGRESS_CB)(void *user_data, size_t file_size, uint64_t offset, mp3dec_frame_info_t *info); + +#ifdef __cplusplus +extern "C" { +#endif + +/* detect mp3/mpa format */ +int mp3dec_detect_buf(const uint8_t *buf, size_t buf_size); +int mp3dec_detect_cb(mp3dec_io_t *io, uint8_t *buf, size_t buf_size); +/* decode whole buffer block */ +int mp3dec_load_buf(mp3dec_t *dec, const uint8_t *buf, size_t buf_size, mp3dec_file_info_t *info, MP3D_PROGRESS_CB progress_cb, void *user_data); +int mp3dec_load_cb(mp3dec_t *dec, mp3dec_io_t *io, uint8_t *buf, size_t buf_size, mp3dec_file_info_t *info, MP3D_PROGRESS_CB progress_cb, void *user_data); +/* iterate through frames */ +int mp3dec_iterate_buf(const uint8_t *buf, size_t buf_size, MP3D_ITERATE_CB callback, void *user_data); +int mp3dec_iterate_cb(mp3dec_io_t *io, uint8_t *buf, size_t buf_size, MP3D_ITERATE_CB callback, void *user_data); +/* streaming decoder with seeking capability */ +int mp3dec_ex_open_buf(mp3dec_ex_t *dec, const uint8_t *buf, size_t buf_size, int flags); +int mp3dec_ex_open_cb(mp3dec_ex_t *dec, mp3dec_io_t *io, int flags); +void mp3dec_ex_close(mp3dec_ex_t *dec); +int mp3dec_ex_seek(mp3dec_ex_t *dec, uint64_t position); +size_t mp3dec_ex_read_frame(mp3dec_ex_t *dec, mp3d_sample_t **buf, mp3dec_frame_info_t *frame_info, size_t max_samples); +size_t mp3dec_ex_read(mp3dec_ex_t *dec, mp3d_sample_t *buf, size_t samples); +#ifndef MINIMP3_NO_STDIO +/* stdio versions of file detect, load, iterate and stream */ +int mp3dec_detect(const char *file_name); +int mp3dec_load(mp3dec_t *dec, const char *file_name, mp3dec_file_info_t *info, MP3D_PROGRESS_CB progress_cb, void *user_data); +int mp3dec_iterate(const char *file_name, MP3D_ITERATE_CB callback, void *user_data); +int mp3dec_ex_open(mp3dec_ex_t *dec, const char *file_name, int flags); +#ifdef _WIN32 +int mp3dec_detect_w(const wchar_t *file_name); +int mp3dec_load_w(mp3dec_t *dec, const wchar_t *file_name, mp3dec_file_info_t *info, MP3D_PROGRESS_CB progress_cb, void *user_data); +int mp3dec_iterate_w(const wchar_t *file_name, MP3D_ITERATE_CB callback, void *user_data); +int mp3dec_ex_open_w(mp3dec_ex_t *dec, const wchar_t *file_name, int flags); +#endif +#endif + +#ifdef __cplusplus +} +#endif +#endif /*MINIMP3_EXT_H*/ + +#ifdef MINIMP3_IMPLEMENTATION +#include + +static void mp3dec_skip_id3v1(const uint8_t *buf, size_t *pbuf_size) +{ + size_t buf_size = *pbuf_size; +#ifndef MINIMP3_NOSKIP_ID3V1 + if (buf_size >= 128 && !memcmp(buf + buf_size - 128, "TAG", 3)) + { + buf_size -= 128; + if (buf_size >= 227 && !memcmp(buf + buf_size - 227, "TAG+", 4)) + buf_size -= 227; + } +#endif +#ifndef MINIMP3_NOSKIP_APEV2 + if (buf_size > 32 && !memcmp(buf + buf_size - 32, "APETAGEX", 8)) + { + buf_size -= 32; + const uint8_t *tag = buf + buf_size + 8 + 4; + uint32_t tag_size = (uint32_t)(tag[3] << 24) | (tag[2] << 16) | (tag[1] << 8) | tag[0]; + if (buf_size >= tag_size) + buf_size -= tag_size; + } +#endif + *pbuf_size = buf_size; +} + +static size_t mp3dec_skip_id3v2(const uint8_t *buf, size_t buf_size) +{ +#define MINIMP3_ID3_DETECT_SIZE 10 +#ifndef MINIMP3_NOSKIP_ID3V2 + if (buf_size >= MINIMP3_ID3_DETECT_SIZE && !memcmp(buf, "ID3", 3) && !((buf[5] & 15) || (buf[6] & 0x80) || (buf[7] & 0x80) || (buf[8] & 0x80) || (buf[9] & 0x80))) + { + size_t id3v2size = (((buf[6] & 0x7f) << 21) | ((buf[7] & 0x7f) << 14) | ((buf[8] & 0x7f) << 7) | (buf[9] & 0x7f)) + 10; + if ((buf[5] & 16)) + id3v2size += 10; /* footer */ + return id3v2size; + } +#endif + return 0; +} + +static void mp3dec_skip_id3(const uint8_t **pbuf, size_t *pbuf_size) +{ + uint8_t *buf = (uint8_t *)(*pbuf); + size_t buf_size = *pbuf_size; + size_t id3v2size = mp3dec_skip_id3v2(buf, buf_size); + if (id3v2size) + { + if (id3v2size >= buf_size) + id3v2size = buf_size; + buf += id3v2size; + buf_size -= id3v2size; + } + mp3dec_skip_id3v1(buf, &buf_size); + *pbuf = (const uint8_t *)buf; + *pbuf_size = buf_size; +} + +static int mp3dec_check_vbrtag(const uint8_t *frame, int frame_size, uint32_t *frames, int *delay, int *padding) +{ + static const char g_xing_tag[4] = { 'X', 'i', 'n', 'g' }; + static const char g_info_tag[4] = { 'I', 'n', 'f', 'o' }; +#define FRAMES_FLAG 1 +#define BYTES_FLAG 2 +#define TOC_FLAG 4 +#define VBR_SCALE_FLAG 8 + /* Side info offsets after header: + / Mono Stereo + / MPEG1 17 32 + / MPEG2 & 2.5 9 17*/ + bs_t bs[1]; + L3_gr_info_t gr_info[4]; + bs_init(bs, frame + HDR_SIZE, frame_size - HDR_SIZE); + if (HDR_IS_CRC(frame)) + get_bits(bs, 16); + if (L3_read_side_info(bs, gr_info, frame) < 0) + return 0; /* side info corrupted */ + + const uint8_t *tag = frame + HDR_SIZE + bs->pos/8; + if (memcmp(g_xing_tag, tag, 4) && memcmp(g_info_tag, tag, 4)) + return 0; + int flags = tag[7]; + if (!((flags & FRAMES_FLAG))) + return -1; + tag += 8; + *frames = (uint32_t)(tag[0] << 24) | (tag[1] << 16) | (tag[2] << 8) | tag[3]; + tag += 4; + if (flags & BYTES_FLAG) + tag += 4; + if (flags & TOC_FLAG) + tag += 100; + if (flags & VBR_SCALE_FLAG) + tag += 4; + *delay = *padding = 0; + if (*tag) + { /* extension, LAME, Lavc, etc. Should be the same structure. */ + tag += 21; + if (tag - frame + 14 >= frame_size) + return 0; + *delay = ((tag[0] << 4) | (tag[1] >> 4)) + (528 + 1); + *padding = (((tag[1] & 0xF) << 8) | tag[2]) - (528 + 1); + } + return 1; +} + +int mp3dec_detect_buf(const uint8_t *buf, size_t buf_size) +{ + return mp3dec_detect_cb(0, (uint8_t *)buf, buf_size); +} + +int mp3dec_detect_cb(mp3dec_io_t *io, uint8_t *buf, size_t buf_size) +{ + if (!buf || (size_t)-1 == buf_size || (io && buf_size < MINIMP3_BUF_SIZE)) + return MP3D_E_PARAM; + size_t filled = buf_size; + if (io) + { + if (io->seek(0, io->seek_data)) + return MP3D_E_IOERROR; + filled = io->read(buf, MINIMP3_ID3_DETECT_SIZE, io->read_data); + if (filled > MINIMP3_ID3_DETECT_SIZE) + return MP3D_E_IOERROR; + } + if (filled < MINIMP3_ID3_DETECT_SIZE) + return MP3D_E_USER; /* too small, can't be mp3/mpa */ + if (mp3dec_skip_id3v2(buf, filled)) + return 0; /* id3v2 tag is enough evidence */ + if (io) + { + size_t readed = io->read(buf + MINIMP3_ID3_DETECT_SIZE, buf_size - MINIMP3_ID3_DETECT_SIZE, io->read_data); + if (readed > (buf_size - MINIMP3_ID3_DETECT_SIZE)) + return MP3D_E_IOERROR; + filled += readed; + if (filled < MINIMP3_BUF_SIZE) + mp3dec_skip_id3v1(buf, &filled); + } else + { + mp3dec_skip_id3v1(buf, &filled); + if (filled > MINIMP3_BUF_SIZE) + filled = MINIMP3_BUF_SIZE; + } + int free_format_bytes, frame_size; + mp3d_find_frame(buf, filled, &free_format_bytes, &frame_size); + if (frame_size) + return 0; /* MAX_FRAME_SYNC_MATCHES consecutive frames found */ + return MP3D_E_USER; +} + +int mp3dec_load_buf(mp3dec_t *dec, const uint8_t *buf, size_t buf_size, mp3dec_file_info_t *info, MP3D_PROGRESS_CB progress_cb, void *user_data) +{ + return mp3dec_load_cb(dec, 0, (uint8_t *)buf, buf_size, info, progress_cb, user_data); +} + +int mp3dec_load_cb(mp3dec_t *dec, mp3dec_io_t *io, uint8_t *buf, size_t buf_size, mp3dec_file_info_t *info, MP3D_PROGRESS_CB progress_cb, void *user_data) +{ + if (!dec || !buf || !info || (size_t)-1 == buf_size || (io && buf_size < MINIMP3_BUF_SIZE)) + return MP3D_E_PARAM; + uint64_t detected_samples = 0; + size_t orig_buf_size = buf_size; + int to_skip = 0; + mp3dec_frame_info_t frame_info; + memset(info, 0, sizeof(*info)); + memset(&frame_info, 0, sizeof(frame_info)); + + /* skip id3 */ + size_t filled = 0, consumed = 0; + int eof = 0, ret = 0; + if (io) + { + if (io->seek(0, io->seek_data)) + return MP3D_E_IOERROR; + filled = io->read(buf, MINIMP3_ID3_DETECT_SIZE, io->read_data); + if (filled > MINIMP3_ID3_DETECT_SIZE) + return MP3D_E_IOERROR; + if (MINIMP3_ID3_DETECT_SIZE != filled) + return 0; + size_t id3v2size = mp3dec_skip_id3v2(buf, filled); + if (id3v2size) + { + if (io->seek(id3v2size, io->seek_data)) + return MP3D_E_IOERROR; + filled = io->read(buf, buf_size, io->read_data); + if (filled > buf_size) + return MP3D_E_IOERROR; + } else + { + size_t readed = io->read(buf + MINIMP3_ID3_DETECT_SIZE, buf_size - MINIMP3_ID3_DETECT_SIZE, io->read_data); + if (readed > (buf_size - MINIMP3_ID3_DETECT_SIZE)) + return MP3D_E_IOERROR; + filled += readed; + } + if (filled < MINIMP3_BUF_SIZE) + mp3dec_skip_id3v1(buf, &filled); + } else + { + mp3dec_skip_id3((const uint8_t **)&buf, &buf_size); + if (!buf_size) + return 0; + } + /* try to make allocation size assumption by first frame or vbr tag */ + mp3dec_init(dec); + int samples; + do + { + uint32_t frames; + int i, delay, padding, free_format_bytes = 0, frame_size = 0; + const uint8_t *hdr; + if (io) + { + if (!eof && filled - consumed < MINIMP3_BUF_SIZE) + { /* keep minimum 10 consecutive mp3 frames (~16KB) worst case */ + memmove(buf, buf + consumed, filled - consumed); + filled -= consumed; + consumed = 0; + size_t readed = io->read(buf + filled, buf_size - filled, io->read_data); + if (readed > (buf_size - filled)) + return MP3D_E_IOERROR; + if (readed != (buf_size - filled)) + eof = 1; + filled += readed; + if (eof) + mp3dec_skip_id3v1(buf, &filled); + } + i = mp3d_find_frame(buf + consumed, filled - consumed, &free_format_bytes, &frame_size); + consumed += i; + hdr = buf + consumed; + } else + { + i = mp3d_find_frame(buf, buf_size, &free_format_bytes, &frame_size); + buf += i; + buf_size -= i; + hdr = buf; + } + if (i && !frame_size) + continue; + if (!frame_size) + return 0; + frame_info.channels = HDR_IS_MONO(hdr) ? 1 : 2; + frame_info.hz = hdr_sample_rate_hz(hdr); + frame_info.layer = 4 - HDR_GET_LAYER(hdr); + frame_info.bitrate_kbps = hdr_bitrate_kbps(hdr); + frame_info.frame_bytes = frame_size; + samples = hdr_frame_samples(hdr)*frame_info.channels; + if (3 != frame_info.layer) + break; + int ret = mp3dec_check_vbrtag(hdr, frame_size, &frames, &delay, &padding); + if (ret > 0) + { + padding *= frame_info.channels; + to_skip = delay*frame_info.channels; + detected_samples = samples*(uint64_t)frames; + if (detected_samples >= (uint64_t)to_skip) + detected_samples -= to_skip; + if (padding > 0 && detected_samples >= (uint64_t)padding) + detected_samples -= padding; + if (!detected_samples) + return 0; + } + if (ret) + { + if (io) + { + consumed += frame_size; + } else + { + buf += frame_size; + buf_size -= frame_size; + } + } + break; + } while(1); + size_t allocated = MINIMP3_MAX_SAMPLES_PER_FRAME*sizeof(mp3d_sample_t); + if (detected_samples) + allocated += detected_samples*sizeof(mp3d_sample_t); + else + allocated += (buf_size/frame_info.frame_bytes)*samples*sizeof(mp3d_sample_t); + info->buffer = (mp3d_sample_t*)malloc(allocated); + if (!info->buffer) + return MP3D_E_MEMORY; + /* save info */ + info->channels = frame_info.channels; + info->hz = frame_info.hz; + info->layer = frame_info.layer; + /* decode all frames */ + size_t avg_bitrate_kbps = 0, frames = 0; + do + { + if ((allocated - info->samples*sizeof(mp3d_sample_t)) < MINIMP3_MAX_SAMPLES_PER_FRAME*sizeof(mp3d_sample_t)) + { + allocated *= 2; + mp3d_sample_t *alloc_buf = (mp3d_sample_t*)realloc(info->buffer, allocated); + if (!alloc_buf) + return MP3D_E_MEMORY; + info->buffer = alloc_buf; + } + if (io) + { + if (!eof && filled - consumed < MINIMP3_BUF_SIZE) + { /* keep minimum 10 consecutive mp3 frames (~16KB) worst case */ + memmove(buf, buf + consumed, filled - consumed); + filled -= consumed; + consumed = 0; + size_t readed = io->read(buf + filled, buf_size - filled, io->read_data); + if (readed != (buf_size - filled)) + eof = 1; + filled += readed; + if (eof) + mp3dec_skip_id3v1(buf, &filled); + } + samples = mp3dec_decode_frame(dec, buf + consumed, filled - consumed, info->buffer + info->samples, &frame_info); + consumed += frame_info.frame_bytes; + } else + { + samples = mp3dec_decode_frame(dec, buf, MINIMP3_MIN(buf_size, (size_t)INT_MAX), info->buffer + info->samples, &frame_info); + buf += frame_info.frame_bytes; + buf_size -= frame_info.frame_bytes; + } + if (samples) + { + if (info->hz != frame_info.hz || info->layer != frame_info.layer) + { + ret = MP3D_E_DECODE; + break; + } + if (info->channels && info->channels != frame_info.channels) + { +#ifdef MINIMP3_ALLOW_MONO_STEREO_TRANSITION + info->channels = 0; /* mark file with mono-stereo transition */ +#else + ret = MP3D_E_DECODE; + break; +#endif + } + samples *= frame_info.channels; + if (to_skip) + { + size_t skip = MINIMP3_MIN(samples, to_skip); + to_skip -= skip; + samples -= skip; + memmove(info->buffer, info->buffer + skip, samples*sizeof(mp3d_sample_t)); + } + info->samples += samples; + avg_bitrate_kbps += frame_info.bitrate_kbps; + frames++; + if (progress_cb) + { + ret = progress_cb(user_data, orig_buf_size, orig_buf_size - buf_size, &frame_info); + if (ret) + break; + } + } + } while (frame_info.frame_bytes); + if (detected_samples && info->samples > detected_samples) + info->samples = detected_samples; /* cut padding */ + /* reallocate to normal buffer size */ + if (allocated != info->samples*sizeof(mp3d_sample_t)) + { + mp3d_sample_t *alloc_buf = (mp3d_sample_t*)realloc(info->buffer, info->samples*sizeof(mp3d_sample_t)); + if (!alloc_buf && info->samples) + return MP3D_E_MEMORY; + info->buffer = alloc_buf; + } + if (frames) + info->avg_bitrate_kbps = avg_bitrate_kbps/frames; + return ret; +} + +int mp3dec_iterate_buf(const uint8_t *buf, size_t buf_size, MP3D_ITERATE_CB callback, void *user_data) +{ + const uint8_t *orig_buf = buf; + if (!buf || (size_t)-1 == buf_size || !callback) + return MP3D_E_PARAM; + /* skip id3 */ + mp3dec_skip_id3(&buf, &buf_size); + if (!buf_size) + return 0; + mp3dec_frame_info_t frame_info; + memset(&frame_info, 0, sizeof(frame_info)); + do + { + int free_format_bytes = 0, frame_size = 0, ret; + int i = mp3d_find_frame(buf, buf_size, &free_format_bytes, &frame_size); + buf += i; + buf_size -= i; + if (i && !frame_size) + continue; + if (!frame_size) + break; + const uint8_t *hdr = buf; + frame_info.channels = HDR_IS_MONO(hdr) ? 1 : 2; + frame_info.hz = hdr_sample_rate_hz(hdr); + frame_info.layer = 4 - HDR_GET_LAYER(hdr); + frame_info.bitrate_kbps = hdr_bitrate_kbps(hdr); + frame_info.frame_bytes = frame_size; + + if (callback) + { + if ((ret = callback(user_data, hdr, frame_size, free_format_bytes, buf_size, hdr - orig_buf, &frame_info))) + return ret; + } + buf += frame_size; + buf_size -= frame_size; + } while (1); + return 0; +} + +int mp3dec_iterate_cb(mp3dec_io_t *io, uint8_t *buf, size_t buf_size, MP3D_ITERATE_CB callback, void *user_data) +{ + if (!io || !buf || (size_t)-1 == buf_size || buf_size < MINIMP3_BUF_SIZE || !callback) + return MP3D_E_PARAM; + size_t filled = io->read(buf, MINIMP3_ID3_DETECT_SIZE, io->read_data), consumed = 0; + uint64_t readed = 0; + mp3dec_frame_info_t frame_info; + int eof = 0; + memset(&frame_info, 0, sizeof(frame_info)); + if (filled > MINIMP3_ID3_DETECT_SIZE) + return MP3D_E_IOERROR; + if (MINIMP3_ID3_DETECT_SIZE != filled) + return 0; + size_t id3v2size = mp3dec_skip_id3v2(buf, filled); + if (id3v2size) + { + if (io->seek(id3v2size, io->seek_data)) + return MP3D_E_IOERROR; + filled = io->read(buf, buf_size, io->read_data); + if (filled > buf_size) + return MP3D_E_IOERROR; + readed += id3v2size; + } else + { + size_t readed = io->read(buf + MINIMP3_ID3_DETECT_SIZE, buf_size - MINIMP3_ID3_DETECT_SIZE, io->read_data); + if (readed > (buf_size - MINIMP3_ID3_DETECT_SIZE)) + return MP3D_E_IOERROR; + filled += readed; + } + if (filled < MINIMP3_BUF_SIZE) + mp3dec_skip_id3v1(buf, &filled); + do + { + int free_format_bytes = 0, frame_size = 0, ret; + int i = mp3d_find_frame(buf + consumed, filled - consumed, &free_format_bytes, &frame_size); + if (i && !frame_size) + { + consumed += i; + continue; + } + if (!frame_size) + break; + const uint8_t *hdr = buf + consumed + i; + frame_info.channels = HDR_IS_MONO(hdr) ? 1 : 2; + frame_info.hz = hdr_sample_rate_hz(hdr); + frame_info.layer = 4 - HDR_GET_LAYER(hdr); + frame_info.bitrate_kbps = hdr_bitrate_kbps(hdr); + frame_info.frame_bytes = frame_size; + + readed += i; + if (callback) + { + if ((ret = callback(user_data, hdr, frame_size, free_format_bytes, filled - consumed, readed, &frame_info))) + return ret; + } + readed += frame_size; + consumed += i + frame_size; + if (!eof && filled - consumed < MINIMP3_BUF_SIZE) + { /* keep minimum 10 consecutive mp3 frames (~16KB) worst case */ + memmove(buf, buf + consumed, filled - consumed); + filled -= consumed; + consumed = 0; + size_t readed = io->read(buf + filled, buf_size - filled, io->read_data); + if (readed > (buf_size - filled)) + return MP3D_E_IOERROR; + if (readed != (buf_size - filled)) + eof = 1; + filled += readed; + if (eof) + mp3dec_skip_id3v1(buf, &filled); + } + } while (1); + return 0; +} + +static int mp3dec_load_index(void *user_data, const uint8_t *frame, int frame_size, int free_format_bytes, size_t buf_size, uint64_t offset, mp3dec_frame_info_t *info) +{ + mp3dec_frame_t *idx_frame; + mp3dec_ex_t *dec = (mp3dec_ex_t *)user_data; + if (!dec->index.frames && !dec->start_offset) + { /* detect VBR tag and try to avoid full scan */ + uint32_t frames; + int delay, padding; + dec->info = *info; + dec->start_offset = dec->offset = offset; + dec->end_offset = offset + buf_size; + dec->free_format_bytes = free_format_bytes; /* should not change */ + if (3 == dec->info.layer) + { + int ret = mp3dec_check_vbrtag(frame, frame_size, &frames, &delay, &padding); + if (ret) + dec->start_offset = dec->offset = offset + frame_size; + if (ret > 0) + { + padding *= info->channels; + dec->start_delay = dec->to_skip = delay*info->channels; + dec->samples = hdr_frame_samples(frame)*info->channels*(uint64_t)frames; + if (dec->samples >= (uint64_t)dec->start_delay) + dec->samples -= dec->start_delay; + if (padding > 0 && dec->samples >= (uint64_t)padding) + dec->samples -= padding; + dec->detected_samples = dec->samples; + dec->vbr_tag_found = 1; + return MP3D_E_USER; + } else if (ret < 0) + return 0; + } + } + if (dec->flags & MP3D_DO_NOT_SCAN) + return MP3D_E_USER; + if (dec->index.num_frames + 1 > dec->index.capacity) + { + if (!dec->index.capacity) + dec->index.capacity = 4096; + else + dec->index.capacity *= 2; + mp3dec_frame_t *alloc_buf = (mp3dec_frame_t *)realloc((void*)dec->index.frames, sizeof(mp3dec_frame_t)*dec->index.capacity); + if (!alloc_buf) + return MP3D_E_MEMORY; + dec->index.frames = alloc_buf; + } + idx_frame = &dec->index.frames[dec->index.num_frames++]; + idx_frame->offset = offset; + idx_frame->sample = dec->samples; + if (!dec->buffer_samples && dec->index.num_frames < 256) + { /* for some cutted mp3 frames, bit-reservoir not filled and decoding can't be started from first frames */ + /* try to decode up to 255 first frames till samples starts to decode */ + dec->buffer_samples = mp3dec_decode_frame(&dec->mp3d, frame, MINIMP3_MIN(buf_size, (size_t)INT_MAX), dec->buffer, info); + dec->samples += dec->buffer_samples*info->channels; + } else + dec->samples += hdr_frame_samples(frame)*info->channels; + return 0; +} + +int mp3dec_ex_open_buf(mp3dec_ex_t *dec, const uint8_t *buf, size_t buf_size, int flags) +{ + if (!dec || !buf || (size_t)-1 == buf_size || (flags & (~MP3D_FLAGS_MASK))) + return MP3D_E_PARAM; + memset(dec, 0, sizeof(*dec)); + dec->file.buffer = buf; + dec->file.size = buf_size; + dec->flags = flags; + mp3dec_init(&dec->mp3d); + int ret = mp3dec_iterate_buf(dec->file.buffer, dec->file.size, mp3dec_load_index, dec); + if (ret && MP3D_E_USER != ret) + return ret; + mp3dec_init(&dec->mp3d); + dec->buffer_samples = 0; + dec->indexes_built = !(dec->vbr_tag_found || (flags & MP3D_DO_NOT_SCAN)); + dec->flags &= (~MP3D_DO_NOT_SCAN); + return 0; +} + +#ifndef MINIMP3_SEEK_IDX_LINEAR_SEARCH +static size_t mp3dec_idx_binary_search(mp3dec_index_t *idx, uint64_t position) +{ + size_t end = idx->num_frames, start = 0, index = 0; + while (start <= end) + { + size_t mid = (start + end) / 2; + if (idx->frames[mid].sample >= position) + { /* move left side. */ + if (idx->frames[mid].sample == position) + return mid; + end = mid - 1; + } else + { /* move to right side */ + index = mid; + start = mid + 1; + if (start == idx->num_frames) + break; + } + } + return index; +} +#endif + +int mp3dec_ex_seek(mp3dec_ex_t *dec, uint64_t position) +{ + size_t i; + if (!dec) + return MP3D_E_PARAM; + if (!(dec->flags & MP3D_SEEK_TO_SAMPLE)) + { + if (dec->io) + { + dec->offset = position; + } else + { + dec->offset = MINIMP3_MIN(position, dec->file.size); + } + dec->cur_sample = 0; + goto do_exit; + } + dec->cur_sample = position; + position += dec->start_delay; + if (0 == position) + { /* optimize seek to zero, no index needed */ +seek_zero: + dec->offset = dec->start_offset; + dec->to_skip = 0; + goto do_exit; + } + if (!dec->indexes_built) + { /* no index created yet (vbr tag used to calculate track length or MP3D_DO_NOT_SCAN open flag used) */ + dec->indexes_built = 1; + dec->samples = 0; + dec->buffer_samples = 0; + if (dec->io) + { + if (dec->io->seek(dec->start_offset, dec->io->seek_data)) + return MP3D_E_IOERROR; + int ret = mp3dec_iterate_cb(dec->io, (uint8_t *)dec->file.buffer, dec->file.size, mp3dec_load_index, dec); + if (ret && MP3D_E_USER != ret) + return ret; + } else + { + int ret = mp3dec_iterate_buf(dec->file.buffer + dec->start_offset, dec->file.size - dec->start_offset, mp3dec_load_index, dec); + if (ret && MP3D_E_USER != ret) + return ret; + } + for (i = 0; i < dec->index.num_frames; i++) + dec->index.frames[i].offset += dec->start_offset; + dec->samples = dec->detected_samples; + } + if (!dec->index.frames) + goto seek_zero; /* no frames in file - seek to zero */ +#ifdef MINIMP3_SEEK_IDX_LINEAR_SEARCH + for (i = 0; i < dec->index.num_frames; i++) + { + if (dec->index.frames[i].sample >= position) + break; + } +#else + i = mp3dec_idx_binary_search(&dec->index, position); +#endif + if (i) + { + int to_fill_bytes = 511; + int skip_frames = MINIMP3_PREDECODE_FRAMES +#ifdef MINIMP3_SEEK_IDX_LINEAR_SEARCH + + ((dec->index.frames[i].sample == position) ? 0 : 1) +#endif + ; + i -= MINIMP3_MIN(i, (size_t)skip_frames); + if (3 == dec->info.layer) + { + while (i && to_fill_bytes) + { /* make sure bit-reservoir is filled when we start decoding */ + bs_t bs[1]; + L3_gr_info_t gr_info[4]; + int frame_bytes, frame_size; + const uint8_t *hdr; + if (dec->io) + { + hdr = dec->file.buffer; + if (dec->io->seek(dec->index.frames[i - 1].offset, dec->io->seek_data)) + return MP3D_E_IOERROR; + size_t readed = dec->io->read((uint8_t *)hdr, HDR_SIZE, dec->io->read_data); + if (readed != HDR_SIZE) + return MP3D_E_IOERROR; + frame_size = hdr_frame_bytes(hdr, dec->free_format_bytes) + hdr_padding(hdr); + readed = dec->io->read((uint8_t *)hdr + HDR_SIZE, frame_size - HDR_SIZE, dec->io->read_data); + if (readed != (size_t)(frame_size - HDR_SIZE)) + return MP3D_E_IOERROR; + bs_init(bs, hdr + HDR_SIZE, frame_size - HDR_SIZE); + } else + { + hdr = dec->file.buffer + dec->index.frames[i - 1].offset; + frame_size = hdr_frame_bytes(hdr, dec->free_format_bytes) + hdr_padding(hdr); + bs_init(bs, hdr + HDR_SIZE, frame_size - HDR_SIZE); + } + if (HDR_IS_CRC(hdr)) + get_bits(bs, 16); + i--; + if (L3_read_side_info(bs, gr_info, hdr) < 0) + break; /* frame not decodable, we can start from here */ + frame_bytes = (bs->limit - bs->pos)/8; + to_fill_bytes -= MINIMP3_MIN(to_fill_bytes, frame_bytes); + } + } + } + dec->offset = dec->index.frames[i].offset; + dec->to_skip = position - dec->index.frames[i].sample; + while ((i + 1) < dec->index.num_frames && !dec->index.frames[i].sample && !dec->index.frames[i + 1].sample) + { /* skip not decodable first frames */ + const uint8_t *hdr; + if (dec->io) + { + hdr = dec->file.buffer; + if (dec->io->seek(dec->index.frames[i].offset, dec->io->seek_data)) + return MP3D_E_IOERROR; + size_t readed = dec->io->read((uint8_t *)hdr, HDR_SIZE, dec->io->read_data); + if (readed != HDR_SIZE) + return MP3D_E_IOERROR; + } else + hdr = dec->file.buffer + dec->index.frames[i].offset; + dec->to_skip += hdr_frame_samples(hdr)*dec->info.channels; + i++; + } +do_exit: + if (dec->io) + { + if (dec->io->seek(dec->offset, dec->io->seek_data)) + return MP3D_E_IOERROR; + } + dec->buffer_samples = 0; + dec->buffer_consumed = 0; + dec->input_consumed = 0; + dec->input_filled = 0; + dec->last_error = 0; + mp3dec_init(&dec->mp3d); + return 0; +} + +size_t mp3dec_ex_read_frame(mp3dec_ex_t *dec, mp3d_sample_t **buf, mp3dec_frame_info_t *frame_info, size_t max_samples) +{ + if (!dec || !buf || !frame_info) + { + if (dec) + dec->last_error = MP3D_E_PARAM; + return 0; + } + if (dec->detected_samples && dec->cur_sample >= dec->detected_samples) + return 0; /* at end of stream */ + if (dec->last_error) + return 0; /* error eof state, seek can reset it */ + *buf = NULL; + uint64_t end_offset = dec->end_offset ? dec->end_offset : dec->file.size; + int eof = 0; + while (dec->buffer_consumed == dec->buffer_samples) + { + const uint8_t *dec_buf; + if (dec->io) + { + if (!eof && (dec->input_filled - dec->input_consumed) < MINIMP3_BUF_SIZE) + { /* keep minimum 10 consecutive mp3 frames (~16KB) worst case */ + memmove((uint8_t*)dec->file.buffer, (uint8_t*)dec->file.buffer + dec->input_consumed, dec->input_filled - dec->input_consumed); + dec->input_filled -= dec->input_consumed; + dec->input_consumed = 0; + size_t readed = dec->io->read((uint8_t*)dec->file.buffer + dec->input_filled, dec->file.size - dec->input_filled, dec->io->read_data); + if (readed > (dec->file.size - dec->input_filled)) + { + dec->last_error = MP3D_E_IOERROR; + readed = 0; + } + if (readed != (dec->file.size - dec->input_filled)) + eof = 1; + dec->input_filled += readed; + if (eof) + mp3dec_skip_id3v1((uint8_t*)dec->file.buffer, &dec->input_filled); + } + dec_buf = dec->file.buffer + dec->input_consumed; + if (!(dec->input_filled - dec->input_consumed)) + return 0; + dec->buffer_samples = mp3dec_decode_frame(&dec->mp3d, dec_buf, dec->input_filled - dec->input_consumed, dec->buffer, frame_info); + dec->input_consumed += frame_info->frame_bytes; + } else + { + dec_buf = dec->file.buffer + dec->offset; + uint64_t buf_size = end_offset - dec->offset; + if (!buf_size) + return 0; + dec->buffer_samples = mp3dec_decode_frame(&dec->mp3d, dec_buf, MINIMP3_MIN(buf_size, (uint64_t)INT_MAX), dec->buffer, frame_info); + } + dec->buffer_consumed = 0; + if (dec->info.hz != frame_info->hz || dec->info.layer != frame_info->layer) + { +return_e_decode: + dec->last_error = MP3D_E_DECODE; + return 0; + } + if (dec->buffer_samples) + { + dec->buffer_samples *= frame_info->channels; + if (dec->to_skip) + { + size_t skip = MINIMP3_MIN(dec->buffer_samples, dec->to_skip); + dec->buffer_consumed += skip; + dec->to_skip -= skip; + } + if ( +#ifdef MINIMP3_ALLOW_MONO_STEREO_TRANSITION + !(dec->flags & MP3D_ALLOW_MONO_STEREO_TRANSITION) && +#endif + dec->buffer_consumed != dec->buffer_samples && dec->info.channels != frame_info->channels) + { + goto return_e_decode; + } + } else if (dec->to_skip) + { /* In mp3 decoding not always can start decode from any frame because of bit reservoir, + count skip samples for such frames */ + int frame_samples = hdr_frame_samples(dec_buf)*frame_info->channels; + dec->to_skip -= MINIMP3_MIN(frame_samples, dec->to_skip); + } + dec->offset += frame_info->frame_bytes; + } + size_t out_samples = MINIMP3_MIN((size_t)(dec->buffer_samples - dec->buffer_consumed), max_samples); + if (dec->detected_samples) + { /* count decoded samples to properly cut padding */ + if (dec->cur_sample + out_samples >= dec->detected_samples) + out_samples = dec->detected_samples - dec->cur_sample; + } + dec->cur_sample += out_samples; + *buf = dec->buffer + dec->buffer_consumed; + dec->buffer_consumed += out_samples; + return out_samples; +} + +size_t mp3dec_ex_read(mp3dec_ex_t *dec, mp3d_sample_t *buf, size_t samples) +{ + if (!dec || !buf) + { + if (dec) + dec->last_error = MP3D_E_PARAM; + return 0; + } + mp3dec_frame_info_t frame_info; + memset(&frame_info, 0, sizeof(frame_info)); + size_t samples_requested = samples; + while (samples) + { + mp3d_sample_t *buf_frame = NULL; + size_t read_samples = mp3dec_ex_read_frame(dec, &buf_frame, &frame_info, samples); + if (!read_samples) + { + break; + } + memcpy(buf, buf_frame, read_samples * sizeof(mp3d_sample_t)); + buf += read_samples; + samples -= read_samples; + } + return samples_requested - samples; +} + +int mp3dec_ex_open_cb(mp3dec_ex_t *dec, mp3dec_io_t *io, int flags) +{ + if (!dec || !io || (flags & (~MP3D_FLAGS_MASK))) + return MP3D_E_PARAM; + memset(dec, 0, sizeof(*dec)); +#ifdef MINIMP3_HAVE_RING + int ret; + if (ret = mp3dec_open_ring(&dec->file, MINIMP3_IO_SIZE)) + return ret; +#else + dec->file.size = MINIMP3_IO_SIZE; + dec->file.buffer = (const uint8_t*)malloc(dec->file.size); + if (!dec->file.buffer) + return MP3D_E_MEMORY; +#endif + dec->flags = flags; + dec->io = io; + mp3dec_init(&dec->mp3d); + if (io->seek(0, io->seek_data)) + return MP3D_E_IOERROR; + int ret = mp3dec_iterate_cb(io, (uint8_t *)dec->file.buffer, dec->file.size, mp3dec_load_index, dec); + if (ret && MP3D_E_USER != ret) + return ret; + if (dec->io->seek(dec->start_offset, dec->io->seek_data)) + return MP3D_E_IOERROR; + mp3dec_init(&dec->mp3d); + dec->buffer_samples = 0; + dec->indexes_built = !(dec->vbr_tag_found || (flags & MP3D_DO_NOT_SCAN)); + dec->flags &= (~MP3D_DO_NOT_SCAN); + return 0; +} + + +#ifndef MINIMP3_NO_STDIO + +#if defined(__linux__) || defined(__FreeBSD__) +#include +#include +#include +#include +#include +#include +#if !defined(_GNU_SOURCE) +#include +#include +#endif +#if !defined(MAP_POPULATE) && defined(__linux__) +#define MAP_POPULATE 0x08000 +#elif !defined(MAP_POPULATE) +#define MAP_POPULATE 0 +#endif + +static void mp3dec_close_file(mp3dec_map_info_t *map_info) +{ + if (map_info->buffer && MAP_FAILED != map_info->buffer) + munmap((void *)map_info->buffer, map_info->size); + map_info->buffer = 0; + map_info->size = 0; +} + +static int mp3dec_open_file(const char *file_name, mp3dec_map_info_t *map_info) +{ + if (!file_name) + return MP3D_E_PARAM; + int file; + struct stat st; + memset(map_info, 0, sizeof(*map_info)); +retry_open: + file = open(file_name, O_RDONLY); + if (file < 0 && (errno == EAGAIN || errno == EINTR)) + goto retry_open; + if (file < 0 || fstat(file, &st) < 0) + { + close(file); + return MP3D_E_IOERROR; + } + + map_info->size = st.st_size; +retry_mmap: + map_info->buffer = (const uint8_t *)mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE | MAP_POPULATE, file, 0); + if (MAP_FAILED == map_info->buffer && (errno == EAGAIN || errno == EINTR)) + goto retry_mmap; + close(file); + if (MAP_FAILED == map_info->buffer) + return MP3D_E_IOERROR; + return 0; +} + +#if MINIMP3_ENABLE_RING && defined(__linux__) && defined(_GNU_SOURCE) +#define MINIMP3_HAVE_RING +static void mp3dec_close_ring(mp3dec_map_info_t *map_info) +{ +#if defined(__linux__) && defined(_GNU_SOURCE) + if (map_info->buffer && MAP_FAILED != map_info->buffer) + munmap((void *)map_info->buffer, map_info->size*2); +#else + if (map_info->buffer) + { + shmdt(map_info->buffer); + shmdt(map_info->buffer + map_info->size); + } +#endif + map_info->buffer = 0; + map_info->size = 0; +} + +static int mp3dec_open_ring(mp3dec_map_info_t *map_info, size_t size) +{ + int memfd, page_size; +#if defined(__linux__) && defined(_GNU_SOURCE) + void *buffer; + int res; +#endif + memset(map_info, 0, sizeof(*map_info)); + +#ifdef _SC_PAGESIZE + page_size = sysconf(_SC_PAGESIZE); +#else + page_size = getpagesize(); +#endif + map_info->size = (size + page_size - 1)/page_size*page_size; + +#if defined(__linux__) && defined(_GNU_SOURCE) + memfd = memfd_create("mp3_ring", 0); + if (memfd < 0) + return MP3D_E_MEMORY; + +retry_ftruncate: + res = ftruncate(memfd, map_info->size); + if (res && (errno == EAGAIN || errno == EINTR)) + goto retry_ftruncate; + if (res) + goto error; + +retry_mmap: + map_info->buffer = (const uint8_t *)mmap(NULL, map_info->size*2, PROT_NONE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); + if (MAP_FAILED == map_info->buffer && (errno == EAGAIN || errno == EINTR)) + goto retry_mmap; + if (MAP_FAILED == map_info->buffer || !map_info->buffer) + goto error; +retry_mmap2: + buffer = mmap((void *)map_info->buffer, map_info->size, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_SHARED, memfd, 0); + if (MAP_FAILED == map_info->buffer && (errno == EAGAIN || errno == EINTR)) + goto retry_mmap2; + if (MAP_FAILED == map_info->buffer || buffer != (void *)map_info->buffer) + goto error; +retry_mmap3: + buffer = mmap((void *)map_info->buffer + map_info->size, map_info->size, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_SHARED, memfd, 0); + if (MAP_FAILED == map_info->buffer && (errno == EAGAIN || errno == EINTR)) + goto retry_mmap3; + if (MAP_FAILED == map_info->buffer || buffer != (void *)(map_info->buffer + map_info->size)) + goto error; + + close(memfd); + return 0; +error: + close(memfd); + mp3dec_close_ring(map_info); + return MP3D_E_MEMORY; +#else + memfd = shmget(IPC_PRIVATE, map_info->size, IPC_CREAT | 0700); + if (memfd < 0) + return MP3D_E_MEMORY; +retry_mmap: + map_info->buffer = (const uint8_t *)mmap(NULL, map_info->size*2, PROT_NONE, MAP_PRIVATE, -1, 0); + if (MAP_FAILED == map_info->buffer && (errno == EAGAIN || errno == EINTR)) + goto retry_mmap; + if (MAP_FAILED == map_info->buffer) + goto error; + if (map_info->buffer != shmat(memfd, map_info->buffer, 0)) + goto error; + if ((map_info->buffer + map_info->size) != shmat(memfd, map_info->buffer + map_info->size, 0)) + goto error; + if (shmctl(memfd, IPC_RMID, NULL) < 0) + return MP3D_E_MEMORY; + return 0; +error: + shmctl(memfd, IPC_RMID, NULL); + mp3dec_close_ring(map_info); + return MP3D_E_MEMORY; +#endif +} +#endif /*MINIMP3_ENABLE_RING*/ +#elif defined(_WIN32) +#include + +static void mp3dec_close_file(mp3dec_map_info_t *map_info) +{ + if (map_info->buffer) + UnmapViewOfFile(map_info->buffer); + map_info->buffer = 0; + map_info->size = 0; +} + +static int mp3dec_open_file_h(HANDLE file, mp3dec_map_info_t *map_info) +{ + memset(map_info, 0, sizeof(*map_info)); + + HANDLE mapping = NULL; + LARGE_INTEGER s; + s.LowPart = GetFileSize(file, (DWORD*)&s.HighPart); + if (s.LowPart == INVALID_FILE_SIZE && GetLastError() != NO_ERROR) + goto error; + map_info->size = s.QuadPart; + + mapping = CreateFileMapping(file, NULL, PAGE_READONLY, 0, 0, NULL); + if (!mapping) + goto error; + map_info->buffer = (const uint8_t*)MapViewOfFile(mapping, FILE_MAP_READ, 0, 0, s.QuadPart); + CloseHandle(mapping); + if (!map_info->buffer) + goto error; + + CloseHandle(file); + return 0; +error: + mp3dec_close_file(map_info); + CloseHandle(file); + return MP3D_E_IOERROR; +} + +static int mp3dec_open_file(const char *file_name, mp3dec_map_info_t *map_info) +{ + if (!file_name) + return MP3D_E_PARAM; + HANDLE file = CreateFileA(file_name, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0); + if (INVALID_HANDLE_VALUE == file) + return MP3D_E_IOERROR; + return mp3dec_open_file_h(file, map_info); +} + +static int mp3dec_open_file_w(const wchar_t *file_name, mp3dec_map_info_t *map_info) +{ + if (!file_name) + return MP3D_E_PARAM; + HANDLE file = CreateFileW(file_name, GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0); + if (INVALID_HANDLE_VALUE == file) + return MP3D_E_IOERROR; + return mp3dec_open_file_h(file, map_info); +} +#else +#include + +static void mp3dec_close_file(mp3dec_map_info_t *map_info) +{ + if (map_info->buffer) + free((void *)map_info->buffer); + map_info->buffer = 0; + map_info->size = 0; +} + +static int mp3dec_open_file(const char *file_name, mp3dec_map_info_t *map_info) +{ + if (!file_name) + return MP3D_E_PARAM; + memset(map_info, 0, sizeof(*map_info)); + FILE *file = fopen(file_name, "rb"); + if (!file) + return MP3D_E_IOERROR; + int res = MP3D_E_IOERROR; + long size = -1; + if (fseek(file, 0, SEEK_END)) + goto error; + size = ftell(file); + if (size < 0) + goto error; + map_info->size = (size_t)size; + if (fseek(file, 0, SEEK_SET)) + goto error; + map_info->buffer = (uint8_t *)malloc(map_info->size); + if (!map_info->buffer) + { + res = MP3D_E_MEMORY; + goto error; + } + if (fread((void *)map_info->buffer, 1, map_info->size, file) != map_info->size) + goto error; + fclose(file); + return 0; +error: + mp3dec_close_file(map_info); + fclose(file); + return res; +} +#endif + +static int mp3dec_detect_mapinfo(mp3dec_map_info_t *map_info) +{ + int ret = mp3dec_detect_buf(map_info->buffer, map_info->size); + mp3dec_close_file(map_info); + return ret; +} + +static int mp3dec_load_mapinfo(mp3dec_t *dec, mp3dec_map_info_t *map_info, mp3dec_file_info_t *info, MP3D_PROGRESS_CB progress_cb, void *user_data) +{ + int ret = mp3dec_load_buf(dec, map_info->buffer, map_info->size, info, progress_cb, user_data); + mp3dec_close_file(map_info); + return ret; +} + +static int mp3dec_iterate_mapinfo(mp3dec_map_info_t *map_info, MP3D_ITERATE_CB callback, void *user_data) +{ + int ret = mp3dec_iterate_buf(map_info->buffer, map_info->size, callback, user_data); + mp3dec_close_file(map_info); + return ret; +} + +static int mp3dec_ex_open_mapinfo(mp3dec_ex_t *dec, int flags) +{ + int ret = mp3dec_ex_open_buf(dec, dec->file.buffer, dec->file.size, flags); + dec->is_file = 1; + if (ret) + mp3dec_ex_close(dec); + return ret; +} + +int mp3dec_detect(const char *file_name) +{ + int ret; + mp3dec_map_info_t map_info; + if ((ret = mp3dec_open_file(file_name, &map_info))) + return ret; + return mp3dec_detect_mapinfo(&map_info); +} + +int mp3dec_load(mp3dec_t *dec, const char *file_name, mp3dec_file_info_t *info, MP3D_PROGRESS_CB progress_cb, void *user_data) +{ + int ret; + mp3dec_map_info_t map_info; + if ((ret = mp3dec_open_file(file_name, &map_info))) + return ret; + return mp3dec_load_mapinfo(dec, &map_info, info, progress_cb, user_data); +} + +int mp3dec_iterate(const char *file_name, MP3D_ITERATE_CB callback, void *user_data) +{ + int ret; + mp3dec_map_info_t map_info; + if ((ret = mp3dec_open_file(file_name, &map_info))) + return ret; + return mp3dec_iterate_mapinfo(&map_info, callback, user_data); +} + +int mp3dec_ex_open(mp3dec_ex_t *dec, const char *file_name, int flags) +{ + int ret; + if (!dec) + return MP3D_E_PARAM; + if ((ret = mp3dec_open_file(file_name, &dec->file))) + return ret; + return mp3dec_ex_open_mapinfo(dec, flags); +} + +void mp3dec_ex_close(mp3dec_ex_t *dec) +{ +#ifdef MINIMP3_HAVE_RING + if (dec->io) + mp3dec_close_ring(&dec->file); +#else + if (dec->io && dec->file.buffer) + free((void*)dec->file.buffer); +#endif + if (dec->is_file) + mp3dec_close_file(&dec->file); + if (dec->index.frames) + free(dec->index.frames); + memset(dec, 0, sizeof(*dec)); +} + +#ifdef _WIN32 +int mp3dec_detect_w(const wchar_t *file_name) +{ + int ret; + mp3dec_map_info_t map_info; + if ((ret = mp3dec_open_file_w(file_name, &map_info))) + return ret; + return mp3dec_detect_mapinfo(&map_info); +} + +int mp3dec_load_w(mp3dec_t *dec, const wchar_t *file_name, mp3dec_file_info_t *info, MP3D_PROGRESS_CB progress_cb, void *user_data) +{ + int ret; + mp3dec_map_info_t map_info; + if ((ret = mp3dec_open_file_w(file_name, &map_info))) + return ret; + return mp3dec_load_mapinfo(dec, &map_info, info, progress_cb, user_data); +} + +int mp3dec_iterate_w(const wchar_t *file_name, MP3D_ITERATE_CB callback, void *user_data) +{ + int ret; + mp3dec_map_info_t map_info; + if ((ret = mp3dec_open_file_w(file_name, &map_info))) + return ret; + return mp3dec_iterate_mapinfo(&map_info, callback, user_data); +} + +int mp3dec_ex_open_w(mp3dec_ex_t *dec, const wchar_t *file_name, int flags) +{ + int ret; + if ((ret = mp3dec_open_file_w(file_name, &dec->file))) + return ret; + return mp3dec_ex_open_mapinfo(dec, flags); +} +#endif +#else /* MINIMP3_NO_STDIO */ +void mp3dec_ex_close(mp3dec_ex_t *dec) +{ +#ifdef MINIMP3_HAVE_RING + if (dec->io) + mp3dec_close_ring(&dec->file); +#else + if (dec->io && dec->file.buffer) + free((void*)dec->file.buffer); +#endif + if (dec->index.frames) + free(dec->index.frames); + memset(dec, 0, sizeof(*dec)); +} +#endif + +#endif /*MINIMP3_IMPLEMENTATION*/ diff --git a/external/openssl/include/android/openssl/asn1.h b/external/openssl/include/android/openssl/asn1.h index 7cf61161..d0b1099a 100644 --- a/external/openssl/include/android/openssl/asn1.h +++ b/external/openssl/include/android/openssl/asn1.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -625,8 +625,8 @@ ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t); ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day, long offset_sec); int ASN1_TIME_check(const ASN1_TIME *t); -ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME - **out); +ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *t, + ASN1_GENERALIZEDTIME **out); int ASN1_TIME_set_string(ASN1_TIME *s, const char *str); int i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a); @@ -946,14 +946,17 @@ int ERR_load_ASN1_strings(void); # define ASN1_F_C2I_ASN1_INTEGER 194 # define ASN1_F_C2I_ASN1_OBJECT 196 # define ASN1_F_C2I_IBUF 226 +# define ASN1_F_C2I_UINT64_INT 101 # define ASN1_F_COLLECT_DATA 140 # define ASN1_F_D2I_ASN1_OBJECT 147 # define ASN1_F_D2I_ASN1_UINTEGER 150 # define ASN1_F_D2I_AUTOPRIVATEKEY 207 # define ASN1_F_D2I_PRIVATEKEY 154 # define ASN1_F_D2I_PUBLICKEY 155 +# define ASN1_F_DO_BUF 142 # define ASN1_F_DO_TCREATE 222 # define ASN1_F_I2D_ASN1_BIO_STREAM 211 +# define ASN1_F_I2D_ASN1_OBJECT 143 # define ASN1_F_I2D_DSA_PUBKEY 161 # define ASN1_F_I2D_EC_PUBKEY 181 # define ASN1_F_I2D_PRIVATEKEY 163 @@ -971,6 +974,8 @@ int ERR_load_ASN1_strings(void); # define ASN1_F_SMIME_READ_ASN1 212 # define ASN1_F_SMIME_TEXT 213 # define ASN1_F_STBL_MODULE_INIT 223 +# define ASN1_F_UINT32_C2I 105 +# define ASN1_F_UINT64_C2I 112 # define ASN1_F_X509_CRL_ADD0_REVOKED 169 # define ASN1_F_X509_INFO_NEW 170 # define ASN1_F_X509_NAME_ENCODE 203 @@ -1048,6 +1053,7 @@ int ERR_load_ASN1_strings(void); # define ASN1_R_MSTRING_NOT_UNIVERSAL 139 # define ASN1_R_MSTRING_WRONG_TAG 140 # define ASN1_R_NESTED_ASN1_STRING 197 +# define ASN1_R_NESTED_TOO_DEEP 201 # define ASN1_R_NON_HEX_CHARACTERS 141 # define ASN1_R_NOT_ASCII_FORMAT 190 # define ASN1_R_NOT_ENOUGH_DATA 142 diff --git a/external/openssl/include/android/openssl/asn1t.h b/external/openssl/include/android/openssl/asn1t.h index 8eedfb3f..a5248293 100644 --- a/external/openssl/include/android/openssl/asn1t.h +++ b/external/openssl/include/android/openssl/asn1t.h @@ -346,17 +346,22 @@ extern "C" { /* OPTIONAL simple type */ # define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type) +# define ASN1_OPT_EMBED(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED, 0, stname, field, type) /* IMPLICIT tagged simple type */ # define ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0) +# define ASN1_IMP_EMBED(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_EMBED) /* IMPLICIT tagged OPTIONAL simple type */ # define ASN1_IMP_OPT(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) +# define ASN1_IMP_OPT_EMBED(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED) /* Same as above but EXPLICIT */ # define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0) +# define ASN1_EXP_EMBED(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_EMBED) # define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) +# define ASN1_EXP_OPT_EMBED(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED) /* SEQUENCE OF type */ # define ASN1_SEQUENCE_OF(stname, field, type) \ diff --git a/external/openssl/include/android/openssl/bio.h b/external/openssl/include/android/openssl/bio.h index 9bc941b2..3a728625 100644 --- a/external/openssl/include/android/openssl/bio.h +++ b/external/openssl/include/android/openssl/bio.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -20,11 +20,7 @@ # include # ifndef OPENSSL_NO_SCTP -# ifndef OPENSSL_SYS_VMS -# include -# else -# include -# endif +# include # endif #ifdef __cplusplus @@ -129,11 +125,10 @@ extern "C" { # define BIO_CTRL_DGRAM_GET_MTU_OVERHEAD 49 -# define BIO_CTRL_DGRAM_SET_PEEK_MODE 50 - +/* Deliberately outside of OPENSSL_NO_SCTP - used in bss_dgram.c */ +# define BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE 50 # ifndef OPENSSL_NO_SCTP /* SCTP stuff */ -# define BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE 50 # define BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY 51 # define BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY 52 # define BIO_CTRL_DGRAM_SCTP_AUTH_CCS_RCVD 53 @@ -146,6 +141,8 @@ extern "C" { # define BIO_CTRL_DGRAM_SCTP_SAVE_SHUTDOWN 70 # endif +# define BIO_CTRL_DGRAM_SET_PEEK_MODE 71 + /* modifiers */ # define BIO_FP_READ 0x02 # define BIO_FP_WRITE 0x04 @@ -170,7 +167,7 @@ extern "C" { /* * This is used with memory BIOs: * BIO_FLAGS_MEM_RDONLY means we shouldn't free up or change the data in any way; - * BIO_FLAGS_NONCLEAR_RST means we should't clear data on reset. + * BIO_FLAGS_NONCLEAR_RST means we shouldn't clear data on reset. */ # define BIO_FLAGS_MEM_RDONLY 0x200 # define BIO_FLAGS_NONCLEAR_RST 0x400 @@ -249,7 +246,8 @@ typedef struct bio_method_st BIO_METHOD; const char *BIO_method_name(const BIO *b); int BIO_method_type(const BIO *b); -typedef void bio_info_cb(BIO *, int, const char *, int, long, long); +typedef int BIO_info_cb(BIO *, int, int); +typedef BIO_info_cb bio_info_cb; /* backward compatibility */ DEFINE_STACK_OF(BIO) @@ -550,8 +548,7 @@ int BIO_write(BIO *b, const void *data, int len); int BIO_puts(BIO *bp, const char *buf); int BIO_indent(BIO *b, int indent, int max); long BIO_ctrl(BIO *bp, int cmd, long larg, void *parg); -long BIO_callback_ctrl(BIO *b, int cmd, - void (*fp) (BIO *, int, const char *, int, long, long)); +long BIO_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp); void *BIO_ptr_ctrl(BIO *bp, int cmd, long larg); long BIO_int_ctrl(BIO *bp, int cmd, long larg, int iarg); BIO *BIO_push(BIO *b, BIO *append); @@ -733,30 +730,30 @@ __bio_h__attr__((__format__(__printf__, 3, 0))); BIO_METHOD *BIO_meth_new(int type, const char *name); void BIO_meth_free(BIO_METHOD *biom); -int (*BIO_meth_get_write(BIO_METHOD *biom)) (BIO *, const char *, int); +int (*BIO_meth_get_write(const BIO_METHOD *biom)) (BIO *, const char *, int); int BIO_meth_set_write(BIO_METHOD *biom, int (*write) (BIO *, const char *, int)); -int (*BIO_meth_get_read(BIO_METHOD *biom)) (BIO *, char *, int); +int (*BIO_meth_get_read(const BIO_METHOD *biom)) (BIO *, char *, int); int BIO_meth_set_read(BIO_METHOD *biom, int (*read) (BIO *, char *, int)); -int (*BIO_meth_get_puts(BIO_METHOD *biom)) (BIO *, const char *); +int (*BIO_meth_get_puts(const BIO_METHOD *biom)) (BIO *, const char *); int BIO_meth_set_puts(BIO_METHOD *biom, int (*puts) (BIO *, const char *)); -int (*BIO_meth_get_gets(BIO_METHOD *biom)) (BIO *, char *, int); +int (*BIO_meth_get_gets(const BIO_METHOD *biom)) (BIO *, char *, int); int BIO_meth_set_gets(BIO_METHOD *biom, int (*gets) (BIO *, char *, int)); -long (*BIO_meth_get_ctrl(BIO_METHOD *biom)) (BIO *, int, long, void *); +long (*BIO_meth_get_ctrl(const BIO_METHOD *biom)) (BIO *, int, long, void *); int BIO_meth_set_ctrl(BIO_METHOD *biom, long (*ctrl) (BIO *, int, long, void *)); -int (*BIO_meth_get_create(BIO_METHOD *bion)) (BIO *); +int (*BIO_meth_get_create(const BIO_METHOD *bion)) (BIO *); int BIO_meth_set_create(BIO_METHOD *biom, int (*create) (BIO *)); -int (*BIO_meth_get_destroy(BIO_METHOD *biom)) (BIO *); +int (*BIO_meth_get_destroy(const BIO_METHOD *biom)) (BIO *); int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy) (BIO *)); -long (*BIO_meth_get_callback_ctrl(BIO_METHOD *biom)) - (BIO *, int, bio_info_cb *); +long (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom)) + (BIO *, int, BIO_info_cb *); int BIO_meth_set_callback_ctrl(BIO_METHOD *biom, long (*callback_ctrl) (BIO *, int, - bio_info_cb *)); + BIO_info_cb *)); /* BEGIN ERROR CODES */ /* @@ -784,6 +781,7 @@ int ERR_load_BIO_strings(void); # define BIO_F_BIO_LISTEN 139 # define BIO_F_BIO_LOOKUP 135 # define BIO_F_BIO_MAKE_PAIR 121 +# define BIO_F_BIO_METH_NEW 146 # define BIO_F_BIO_NEW 108 # define BIO_F_BIO_NEW_FILE 109 # define BIO_F_BIO_NEW_MEM_BUF 126 diff --git a/external/openssl/include/android/openssl/bn.h b/external/openssl/include/android/openssl/bn.h index 17bd5213..301edd52 100644 --- a/external/openssl/include/android/openssl/bn.h +++ b/external/openssl/include/android/openssl/bn.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -119,25 +119,76 @@ void *BN_GENCB_get_arg(BN_GENCB *cb); * on the size of the number */ /* - * number of Miller-Rabin iterations for an error rate of less than 2^-80 for - * random 'b'-bit input, b >= 100 (taken from table 4.4 in the Handbook of - * Applied Cryptography [Menezes, van Oorschot, Vanstone; CRC Press 1996]; - * original paper: Damgaard, Landrock, Pomerance: Average case error - * estimates for the strong probable prime test. -- Math. Comp. 61 (1993) - * 177-194) + * BN_prime_checks_for_size() returns the number of Miller-Rabin iterations + * that will be done for checking that a random number is probably prime. The + * error rate for accepting a composite number as prime depends on the size of + * the prime |b|. The error rates used are for calculating an RSA key with 2 primes, + * and so the level is what you would expect for a key of double the size of the + * prime. + * + * This table is generated using the algorithm of FIPS PUB 186-4 + * Digital Signature Standard (DSS), section F.1, page 117. + * (https://dx.doi.org/10.6028/NIST.FIPS.186-4) + * + * The following magma script was used to generate the output: + * securitybits:=125; + * k:=1024; + * for t:=1 to 65 do + * for M:=3 to Floor(2*Sqrt(k-1)-1) do + * S:=0; + * // Sum over m + * for m:=3 to M do + * s:=0; + * // Sum over j + * for j:=2 to m do + * s+:=(RealField(32)!2)^-(j+(k-1)/j); + * end for; + * S+:=2^(m-(m-1)*t)*s; + * end for; + * A:=2^(k-2-M*t); + * B:=8*(Pi(RealField(32))^2-6)/3*2^(k-2)*S; + * pkt:=2.00743*Log(2)*k*2^-k*(A+B); + * seclevel:=Floor(-Log(2,pkt)); + * if seclevel ge securitybits then + * printf "k: %5o, security: %o bits (t: %o, M: %o)\n",k,seclevel,t,M; + * break; + * end if; + * end for; + * if seclevel ge securitybits then break; end if; + * end for; + * + * It can be run online at: + * http://magma.maths.usyd.edu.au/calc + * + * And will output: + * k: 1024, security: 129 bits (t: 6, M: 23) + * + * k is the number of bits of the prime, securitybits is the level we want to + * reach. + * + * prime length | RSA key size | # MR tests | security level + * -------------+--------------|------------+--------------- + * (b) >= 6394 | >= 12788 | 3 | 256 bit + * (b) >= 3747 | >= 7494 | 3 | 192 bit + * (b) >= 1345 | >= 2690 | 4 | 128 bit + * (b) >= 1080 | >= 2160 | 5 | 128 bit + * (b) >= 852 | >= 1704 | 5 | 112 bit + * (b) >= 476 | >= 952 | 5 | 80 bit + * (b) >= 400 | >= 800 | 6 | 80 bit + * (b) >= 347 | >= 694 | 7 | 80 bit + * (b) >= 308 | >= 616 | 8 | 80 bit + * (b) >= 55 | >= 110 | 27 | 64 bit + * (b) >= 6 | >= 12 | 34 | 64 bit */ -# define BN_prime_checks_for_size(b) ((b) >= 1300 ? 2 : \ - (b) >= 850 ? 3 : \ - (b) >= 650 ? 4 : \ - (b) >= 550 ? 5 : \ - (b) >= 450 ? 6 : \ - (b) >= 400 ? 7 : \ - (b) >= 350 ? 8 : \ - (b) >= 300 ? 9 : \ - (b) >= 250 ? 12 : \ - (b) >= 200 ? 15 : \ - (b) >= 150 ? 18 : \ - /* b >= 100 */ 27) + +# define BN_prime_checks_for_size(b) ((b) >= 3747 ? 3 : \ + (b) >= 1345 ? 4 : \ + (b) >= 476 ? 5 : \ + (b) >= 400 ? 6 : \ + (b) >= 347 ? 7 : \ + (b) >= 308 ? 8 : \ + (b) >= 55 ? 27 : \ + /* b >= 6 */ 34) # define BN_num_bytes(a) ((BN_num_bits(a)+7)/8) @@ -196,7 +247,7 @@ int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx); */ void BN_set_negative(BIGNUM *b, int n); /** BN_is_negative returns 1 if the BIGNUM is negative - * \param a pointer to the BIGNUM object + * \param b pointer to the BIGNUM object * \return 1 if a < 0 and 0 otherwise */ int BN_is_negative(const BIGNUM *b); diff --git a/external/openssl/include/android/openssl/buffer.h b/external/openssl/include/android/openssl/buffer.h index 91f0e07f..35160b4f 100644 --- a/external/openssl/include/android/openssl/buffer.h +++ b/external/openssl/include/android/openssl/buffer.h @@ -21,10 +21,7 @@ extern "C" { #endif # include - -# if !defined(NO_SYS_TYPES_H) -# include -# endif +# include /* * These names are outdated as of OpenSSL 1.1; a future release diff --git a/external/openssl/include/android/openssl/conf.h b/external/openssl/include/android/openssl/conf.h index 462e3c9d..e0539e31 100644 --- a/external/openssl/include/android/openssl/conf.h +++ b/external/openssl/include/android/openssl/conf.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -191,6 +191,7 @@ int ERR_load_CONF_strings(void); # define CONF_F_NCONF_LOAD_BIO 110 # define CONF_F_NCONF_LOAD_FP 114 # define CONF_F_NCONF_NEW 111 +# define CONF_F_SSL_MODULE_INIT 123 # define CONF_F_STR_COPY 101 /* Reason codes. */ @@ -206,8 +207,13 @@ int ERR_load_CONF_strings(void); # define CONF_R_NO_SECTION 107 # define CONF_R_NO_SUCH_FILE 114 # define CONF_R_NO_VALUE 108 +# define CONF_R_SSL_COMMAND_SECTION_EMPTY 117 +# define CONF_R_SSL_COMMAND_SECTION_NOT_FOUND 118 +# define CONF_R_SSL_SECTION_EMPTY 119 +# define CONF_R_SSL_SECTION_NOT_FOUND 120 # define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103 # define CONF_R_UNKNOWN_MODULE_NAME 113 +# define CONF_R_VARIABLE_EXPANSION_TOO_LONG 116 # define CONF_R_VARIABLE_HAS_NO_VALUE 104 # ifdef __cplusplus diff --git a/external/openssl/include/android/openssl/crypto.h b/external/openssl/include/android/openssl/crypto.h index bd0b1408..fa3f12af 100644 --- a/external/openssl/include/android/openssl/crypto.h +++ b/external/openssl/include/android/openssl/crypto.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -146,6 +146,8 @@ int CRYPTO_mem_ctrl(int mode); CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE) # define OPENSSL_secure_free(addr) \ CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE) +# define OPENSSL_secure_clear_free(addr, num) \ + CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE) # define OPENSSL_secure_actual_size(ptr) \ CRYPTO_secure_actual_size(ptr) @@ -174,7 +176,7 @@ typedef void CRYPTO_EX_new (void *parent, void *ptr, CRYPTO_EX_DATA *ad, typedef void CRYPTO_EX_free (void *parent, void *ptr, CRYPTO_EX_DATA *ad, int idx, long argl, void *argp); typedef int CRYPTO_EX_dup (CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from, - void *srcp, int idx, long argl, void *argp); + void *from_d, int idx, long argl, void *argp); __owur int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); @@ -285,6 +287,8 @@ int CRYPTO_secure_malloc_done(void); void *CRYPTO_secure_malloc(size_t num, const char *file, int line); void *CRYPTO_secure_zalloc(size_t num, const char *file, int line); void CRYPTO_secure_free(void *ptr, const char *file, int line); +void CRYPTO_secure_clear_free(void *ptr, size_t num, + const char *file, int line); int CRYPTO_secure_allocated(const void *ptr); int CRYPTO_secure_malloc_initialized(void); size_t CRYPTO_secure_actual_size(void *ptr); @@ -367,7 +371,9 @@ int CRYPTO_memcmp(const volatile void * volatile in_a, # define OPENSSL_INIT_ENGINE_CAPI 0x00002000L # define OPENSSL_INIT_ENGINE_PADLOCK 0x00004000L # define OPENSSL_INIT_ENGINE_AFALG 0x00008000L -/* OPENSSL_INIT flag 0x00010000 reserved for internal use */ +/* OPENSSL_INIT_ZLIB 0x00010000L */ +/* currently unused 0x00020000L */ +/* OPENSSL_INIT_BASE_ONLY 0x00040000L */ /* OPENSSL_INIT flag range 0xfff00000 reserved for OPENSSL_init_ssl() */ /* Max OPENSSL_INIT flag value is 0x80000000 */ diff --git a/external/openssl/include/android/openssl/ct.h b/external/openssl/include/android/openssl/ct.h index 6c632652..bf29fbab 100644 --- a/external/openssl/include/android/openssl/ct.h +++ b/external/openssl/include/android/openssl/ct.h @@ -98,6 +98,21 @@ const CTLOG_STORE *CT_POLICY_EVAL_CTX_get0_log_store(const CT_POLICY_EVAL_CTX *c void CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE(CT_POLICY_EVAL_CTX *ctx, CTLOG_STORE *log_store); +/* + * Gets the time, in milliseconds since the Unix epoch, that will be used as the + * current time when checking whether an SCT was issued in the future. + * Such SCTs will fail validation, as required by RFC6962. + */ +uint64_t CT_POLICY_EVAL_CTX_get_time(const CT_POLICY_EVAL_CTX *ctx); + +/* + * Sets the time to evaluate SCTs against, in milliseconds since the Unix epoch. + * If an SCT's timestamp is after this time, it will be interpreted as having + * been issued in the future. RFC6962 states that "TLS clients MUST reject SCTs + * whose timestamp is in the future", so an SCT will not validate in this case. + */ +void CT_POLICY_EVAL_CTX_set_time(CT_POLICY_EVAL_CTX *ctx, uint64_t time_in_ms); + /***************** * SCT functions * *****************/ @@ -467,7 +482,6 @@ int ERR_load_CT_strings(void); # define CT_F_CTLOG_NEW 117 # define CT_F_CTLOG_NEW_FROM_BASE64 118 # define CT_F_CTLOG_NEW_FROM_CONF 119 -# define CT_F_CTLOG_NEW_NULL 120 # define CT_F_CTLOG_STORE_LOAD_CTX_NEW 122 # define CT_F_CTLOG_STORE_LOAD_FILE 123 # define CT_F_CTLOG_STORE_LOAD_LOG 130 @@ -482,6 +496,7 @@ int ERR_load_CT_strings(void); # define CT_F_O2I_SCT_LIST 111 # define CT_F_O2I_SCT_SIGNATURE 112 # define CT_F_SCT_CTX_NEW 126 +# define CT_F_SCT_CTX_VERIFY 128 # define CT_F_SCT_NEW 100 # define CT_F_SCT_NEW_FROM_BASE64 127 # define CT_F_SCT_SET0_LOG_ID 101 @@ -491,7 +506,6 @@ int ERR_load_CT_strings(void); # define CT_F_SCT_SET_LOG_ENTRY_TYPE 102 # define CT_F_SCT_SET_SIGNATURE_NID 103 # define CT_F_SCT_SET_VERSION 104 -# define CT_F_SCT_CTX_VERIFY 128 /* Reason codes. */ # define CT_R_BASE64_DECODE_ERROR 108 @@ -501,6 +515,7 @@ int ERR_load_CT_strings(void); # define CT_R_LOG_CONF_MISSING_DESCRIPTION 111 # define CT_R_LOG_CONF_MISSING_KEY 112 # define CT_R_LOG_KEY_INVALID 113 +# define CT_R_SCT_FUTURE_TIMESTAMP 116 # define CT_R_SCT_INVALID 104 # define CT_R_SCT_INVALID_SIGNATURE 107 # define CT_R_SCT_LIST_INVALID 105 diff --git a/external/openssl/include/android/openssl/dh.h b/external/openssl/include/android/openssl/dh.h index ae309e7b..8cf879e1 100644 --- a/external/openssl/include/android/openssl/dh.h +++ b/external/openssl/include/android/openssl/dh.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -87,12 +87,29 @@ DECLARE_ASN1_ITEM(DHparams) */ # define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME -# define d2i_DHparams_fp(fp,x) (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ - (char *(*)())d2i_DHparams,(fp),(unsigned char **)(x)) -# define i2d_DHparams_fp(fp,x) ASN1_i2d_fp(i2d_DHparams,(fp), \ - (unsigned char *)(x)) -# define d2i_DHparams_bio(bp,x) ASN1_d2i_bio_of(DH,DH_new,d2i_DHparams,bp,x) -# define i2d_DHparams_bio(bp,x) ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x) +# define d2i_DHparams_fp(fp,x) \ + (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ + (char *(*)())d2i_DHparams, \ + (fp), \ + (unsigned char **)(x)) +# define i2d_DHparams_fp(fp,x) \ + ASN1_i2d_fp(i2d_DHparams,(fp), (unsigned char *)(x)) +# define d2i_DHparams_bio(bp,x) \ + ASN1_d2i_bio_of(DH, DH_new, d2i_DHparams, bp, x) +# define i2d_DHparams_bio(bp,x) \ + ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x) + +# define d2i_DHxparams_fp(fp,x) \ + (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ + (char *(*)())d2i_DHxparams, \ + (fp), \ + (unsigned char **)(x)) +# define i2d_DHxparams_fp(fp,x) \ + ASN1_i2d_fp(i2d_DHxparams,(fp), (unsigned char *)(x)) +# define d2i_DHxparams_bio(bp,x) \ + ASN1_d2i_bio_of(DH, DH_new, d2i_DHxparams, bp, x) +# define i2d_DHxparams_bio(bp,x) \ + ASN1_i2d_bio_of_const(DH, i2d_DHxparams, bp, x) DH *DHparams_dup(DH *); @@ -124,6 +141,7 @@ DEPRECATEDIN_0_9_8(DH *DH_generate_parameters(int prime_len, int generator, int DH_generate_parameters_ex(DH *dh, int prime_len, int generator, BN_GENCB *cb); +int DH_check_params(const DH *dh, int *ret); int DH_check(const DH *dh, int *codes); int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *codes); int DH_generate_key(DH *dh); @@ -169,7 +187,7 @@ void DH_meth_free(DH_METHOD *dhm); DH_METHOD *DH_meth_dup(const DH_METHOD *dhm); const char *DH_meth_get0_name(const DH_METHOD *dhm); int DH_meth_set1_name(DH_METHOD *dhm, const char *name); -int DH_meth_get_flags(DH_METHOD *dhm); +int DH_meth_get_flags(const DH_METHOD *dhm); int DH_meth_set_flags(DH_METHOD *dhm, int flags); void *DH_meth_get0_app_data(const DH_METHOD *dhm); int DH_meth_set0_app_data(DH_METHOD *dhm, void *app_data); diff --git a/external/openssl/include/android/openssl/dsa.h b/external/openssl/include/android/openssl/dsa.h index cb5fbc2f..3a7b1a62 100644 --- a/external/openssl/include/android/openssl/dsa.h +++ b/external/openssl/include/android/openssl/dsa.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -146,10 +146,12 @@ int DSAparams_print_fp(FILE *fp, const DSA *x); int DSA_print_fp(FILE *bp, const DSA *x, int off); # endif -# define DSS_prime_checks 50 +# define DSS_prime_checks 64 /* - * Primality test according to FIPS PUB 186[-1], Appendix 2.1: 50 rounds of - * Rabin-Miller + * Primality test according to FIPS PUB 186-4, Appendix C.3. Since we only + * have one value here we set the number of checks to 64 which is the 128 bit + * security level that is the highest level and valid for creating a 3072 bit + * DSA key. */ # define DSA_is_prime(n, callback, cb_arg) \ BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg) @@ -186,7 +188,7 @@ void DSA_meth_free(DSA_METHOD *dsam); DSA_METHOD *DSA_meth_dup(const DSA_METHOD *dsam); const char *DSA_meth_get0_name(const DSA_METHOD *dsam); int DSA_meth_set1_name(DSA_METHOD *dsam, const char *name); -int DSA_meth_get_flags(DSA_METHOD *dsam); +int DSA_meth_get_flags(const DSA_METHOD *dsam); int DSA_meth_set_flags(DSA_METHOD *dsam, int flags); void *DSA_meth_get0_app_data(const DSA_METHOD *dsam); int DSA_meth_set0_app_data(DSA_METHOD *dsam, void *app_data); @@ -260,6 +262,7 @@ int ERR_load_DSA_strings(void); # define DSA_F_DSA_SIG_NEW 102 # define DSA_F_OLD_DSA_PRIV_DECODE 122 # define DSA_F_PKEY_DSA_CTRL 120 +# define DSA_F_PKEY_DSA_CTRL_STR 104 # define DSA_F_PKEY_DSA_KEYGEN 121 /* Reason codes. */ @@ -274,6 +277,7 @@ int ERR_load_DSA_strings(void); # define DSA_R_NO_PARAMETERS_SET 107 # define DSA_R_PARAMETER_ENCODING_ERROR 105 # define DSA_R_Q_NOT_PRIME 113 +# define DSA_R_SEED_LEN_SMALL 110 # ifdef __cplusplus } diff --git a/external/openssl/include/android/openssl/e_os2.h b/external/openssl/include/android/openssl/e_os2.h index 99ea3477..9800e154 100644 --- a/external/openssl/include/android/openssl/e_os2.h +++ b/external/openssl/include/android/openssl/e_os2.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -49,7 +49,6 @@ extern "C" { # define OPENSSL_SYS_WIN32_UWIN # else # if defined(__CYGWIN__) || defined(OPENSSL_SYS_CYGWIN) -# undef OPENSSL_SYS_UNIX # define OPENSSL_SYS_WIN32_CYGWIN # else # if defined(_WIN32) || defined(OPENSSL_SYS_WIN32) @@ -212,9 +211,9 @@ extern "C" { # endif # endif -# if defined(OPENSSL_SYS_UEFI) && !defined(ssize_t) -# define ossl_ssize_t int -# define OSSL_SSIZE_MAX INT_MAX +# if defined(OPENSSL_SYS_UEFI) && !defined(ossl_ssize_t) +# define ossl_ssize_t INTN +# define OSSL_SSIZE_MAX MAX_INTN # endif # ifndef ossl_ssize_t @@ -242,7 +241,6 @@ typedef INT32 int32_t; typedef UINT32 uint32_t; typedef INT64 int64_t; typedef UINT64 uint64_t; -# define PRIu64 "%Lu" # elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ defined(__osf__) || defined(__sgi) || defined(__hpux) || \ defined(OPENSSL_SYS_VMS) || defined (__OpenBSD__) @@ -264,18 +262,6 @@ typedef unsigned __int64 uint64_t; # include # endif -/* - * We need a format operator for some client tools for uint64_t. If inttypes.h - * isn't available or did not define it, just go with hard-coded. - */ -# ifndef PRIu64 -# ifdef SIXTY_FOUR_BIT_LONG -# define PRIu64 "lu" -# else -# define PRIu64 "llu" -# endif -# endif - /* ossl_inline: portable inline definition usable in public headers */ # if !defined(inline) && !defined(__cplusplus) # if defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L diff --git a/external/openssl/include/android/openssl/ec.h b/external/openssl/include/android/openssl/ec.h index 656cb410..c4aeaed5 100644 --- a/external/openssl/include/android/openssl/ec.h +++ b/external/openssl/include/android/openssl/ec.h @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2002-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -573,11 +573,9 @@ int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p, * \param point EC_POINT object * \param form point conversion form * \param pbuf returns pointer to allocated buffer - * \param len length of the memory buffer * \param ctx BN_CTX object (optional) * \return the length of the encoded octet string or 0 if an error occurred */ - size_t EC_POINT_point2buf(const EC_GROUP *group, const EC_POINT *point, point_conversion_form_t form, unsigned char **pbuf, BN_CTX *ctx); @@ -863,7 +861,7 @@ int EC_KEY_generate_key(EC_KEY *key); int EC_KEY_check_key(const EC_KEY *key); /** Indicates if an EC_KEY can be used for signing. - * \param key the EC_KEY object + * \param eckey the EC_KEY object * \return 1 if can can sign and 0 otherwise. */ int EC_KEY_can_sign(const EC_KEY *eckey); @@ -882,11 +880,9 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, * \param key key to encode * \param form point conversion form * \param pbuf returns pointer to allocated buffer - * \param len length of the memory buffer * \param ctx BN_CTX object (optional) * \return the length of the encoded octet string or 0 if an error occurred */ - size_t EC_KEY_key2buf(const EC_KEY *key, point_conversion_form_t form, unsigned char **pbuf, BN_CTX *ctx); @@ -921,11 +917,10 @@ int EC_KEY_oct2priv(EC_KEY *key, const unsigned char *buf, size_t len); size_t EC_KEY_priv2oct(const EC_KEY *key, unsigned char *buf, size_t len); /** Encodes an EC_KEY private key to an allocated octet string - * \param key key to encode + * \param eckey key to encode * \param pbuf returns pointer to allocated buffer * \return the length of the encoded octet string or 0 if an error occurred */ - size_t EC_KEY_priv2buf(const EC_KEY *eckey, unsigned char **pbuf); /********************************************************************/ @@ -1228,7 +1223,7 @@ void EC_KEY_METHOD_set_verify(EC_KEY_METHOD *meth, const ECDSA_SIG *sig, EC_KEY *eckey)); -void EC_KEY_METHOD_get_init(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_init(const EC_KEY_METHOD *meth, int (**pinit)(EC_KEY *key), void (**pfinish)(EC_KEY *key), int (**pcopy)(EC_KEY *dest, const EC_KEY *src), @@ -1239,16 +1234,16 @@ void EC_KEY_METHOD_get_init(EC_KEY_METHOD *meth, int (**pset_public)(EC_KEY *key, const EC_POINT *pub_key)); -void EC_KEY_METHOD_get_keygen(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_keygen(const EC_KEY_METHOD *meth, int (**pkeygen)(EC_KEY *key)); -void EC_KEY_METHOD_get_compute_key(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_compute_key(const EC_KEY_METHOD *meth, int (**pck)(unsigned char **psec, size_t *pseclen, const EC_POINT *pub_key, const EC_KEY *ecdh)); -void EC_KEY_METHOD_get_sign(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_sign(const EC_KEY_METHOD *meth, int (**psign)(int type, const unsigned char *dgst, int dlen, unsigned char *sig, unsigned int *siglen, @@ -1262,7 +1257,7 @@ void EC_KEY_METHOD_get_sign(EC_KEY_METHOD *meth, const BIGNUM *in_r, EC_KEY *eckey)); -void EC_KEY_METHOD_get_verify(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_verify(const EC_KEY_METHOD *meth, int (**pverify)(int type, const unsigned char *dgst, int dgst_len, const unsigned char *sigbuf, @@ -1404,6 +1399,7 @@ int ERR_load_EC_strings(void); # define EC_F_EC_ASN1_GROUP2CURVE 153 # define EC_F_EC_ASN1_GROUP2FIELDID 154 # define EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY 208 +# define EC_F_EC_GF2M_SIMPLE_FIELD_INV 296 # define EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT 159 # define EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE 195 # define EC_F_EC_GF2M_SIMPLE_OCT2POINT 160 @@ -1413,6 +1409,7 @@ int ERR_load_EC_strings(void); # define EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES 164 # define EC_F_EC_GFP_MONT_FIELD_DECODE 133 # define EC_F_EC_GFP_MONT_FIELD_ENCODE 134 +# define EC_F_EC_GFP_MONT_FIELD_INV 297 # define EC_F_EC_GFP_MONT_FIELD_MUL 131 # define EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE 209 # define EC_F_EC_GFP_MONT_FIELD_SQR 132 @@ -1429,6 +1426,8 @@ int ERR_load_EC_strings(void); # define EC_F_EC_GFP_NIST_FIELD_MUL 200 # define EC_F_EC_GFP_NIST_FIELD_SQR 201 # define EC_F_EC_GFP_NIST_GROUP_SET_CURVE 202 +# define EC_F_EC_GFP_SIMPLE_BLIND_COORDINATES 287 +# define EC_F_EC_GFP_SIMPLE_FIELD_INV 298 # define EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT 165 # define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE 166 # define EC_F_EC_GFP_SIMPLE_MAKE_AFFINE 102 @@ -1518,6 +1517,7 @@ int ERR_load_EC_strings(void); # define EC_R_BAD_SIGNATURE 156 # define EC_R_BIGNUM_OUT_OF_RANGE 144 # define EC_R_BUFFER_TOO_SMALL 100 +# define EC_R_CANNOT_INVERT 165 # define EC_R_COORDINATES_OUT_OF_RANGE 146 # define EC_R_CURVE_DOES_NOT_SUPPORT_ECDH 160 # define EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING 159 @@ -1568,6 +1568,7 @@ int ERR_load_EC_strings(void); # define EC_R_SLOT_FULL 108 # define EC_R_UNDEFINED_GENERATOR 113 # define EC_R_UNDEFINED_ORDER 128 +# define EC_R_UNKNOWN_COFACTOR 164 # define EC_R_UNKNOWN_GROUP 129 # define EC_R_UNKNOWN_ORDER 114 # define EC_R_UNSUPPORTED_FIELD 131 diff --git a/external/openssl/include/android/openssl/engine.h b/external/openssl/include/android/openssl/engine.h index 319371e4..26cf7148 100644 --- a/external/openssl/include/android/openssl/engine.h +++ b/external/openssl/include/android/openssl/engine.h @@ -334,8 +334,6 @@ ENGINE *ENGINE_by_id(const char *id); OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_PADLOCK, NULL) # define ENGINE_load_capi() \ OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_CAPI, NULL) -# define ENGINE_load_dasync() \ - OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_DASYNC, NULL) # define ENGINE_load_afalg() \ OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_AFALG, NULL) # endif diff --git a/external/openssl/include/android/openssl/err.h b/external/openssl/include/android/openssl/err.h index f9390919..ba40f79b 100644 --- a/external/openssl/include/android/openssl/err.h +++ b/external/openssl/include/android/openssl/err.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -37,6 +37,7 @@ extern "C" { # define ERR_TXT_STRING 0x02 # define ERR_FLAG_MARK 0x01 +# define ERR_FLAG_CLEAR 0x02 # define ERR_NUM_ERRORS 16 typedef struct err_state_st { @@ -89,7 +90,7 @@ typedef struct err_state_st { # define ERR_LIB_CMS 46 # define ERR_LIB_TS 47 # define ERR_LIB_HMAC 48 -# define ERR_LIB_JPAKE 49 +/* # define ERR_LIB_JPAKE 49 */ # define ERR_LIB_CT 50 # define ERR_LIB_ASYNC 51 # define ERR_LIB_KDF 52 @@ -128,7 +129,6 @@ typedef struct err_state_st { # define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define TSerr(f,r) ERR_PUT_error(ERR_LIB_TS,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define HMACerr(f,r) ERR_PUT_error(ERR_LIB_HMAC,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define JPAKEerr(f,r) ERR_PUT_error(ERR_LIB_JPAKE,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define CTerr(f,r) ERR_PUT_error(ERR_LIB_CT,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define ASYNCerr(f,r) ERR_PUT_error(ERR_LIB_ASYNC,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define KDFerr(f,r) ERR_PUT_error(ERR_LIB_KDF,(f),(r),OPENSSL_FILE,OPENSSL_LINE) @@ -140,6 +140,7 @@ typedef struct err_state_st { # define ERR_GET_LIB(l) (int)(((l) >> 24L) & 0x0FFL) # define ERR_GET_FUNC(l) (int)(((l) >> 12L) & 0xFFFL) # define ERR_GET_REASON(l) (int)( (l) & 0xFFFL) +# define ERR_FATAL_ERROR(l) (int)( (l) & ERR_R_FATAL) /* OS functions */ # define SYS_F_FOPEN 1 @@ -159,6 +160,7 @@ typedef struct err_state_st { # define SYS_F_GETSOCKOPT 15 # define SYS_F_GETSOCKNAME 16 # define SYS_F_GETHOSTBYNAME 17 +# define SYS_F_FFLUSH 18 /* reasons */ # define ERR_R_SYS_LIB ERR_LIB_SYS/* 2 */ diff --git a/external/openssl/include/android/openssl/evp.h b/external/openssl/include/android/openssl/evp.h index b9c83b2b..36e29344 100644 --- a/external/openssl/include/android/openssl/evp.h +++ b/external/openssl/include/android/openssl/evp.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -900,6 +900,9 @@ int EVP_PKEY_security_bits(const EVP_PKEY *pkey); int EVP_PKEY_size(EVP_PKEY *pkey); int EVP_PKEY_set_type(EVP_PKEY *pkey, int type); int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len); +# ifndef OPENSSL_NO_ENGINE +int EVP_PKEY_set1_engine(EVP_PKEY *pkey, ENGINE *e); +# endif int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key); void *EVP_PKEY_get0(const EVP_PKEY *pkey); const unsigned char *EVP_PKEY_get0_hmac(const EVP_PKEY *pkey, size_t *len); @@ -1348,34 +1351,34 @@ void EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth, const char *type, const char *value)); -void EVP_PKEY_meth_get_init(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_init(const EVP_PKEY_METHOD *pmeth, int (**pinit) (EVP_PKEY_CTX *ctx)); -void EVP_PKEY_meth_get_copy(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_copy(const EVP_PKEY_METHOD *pmeth, int (**pcopy) (EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src)); -void EVP_PKEY_meth_get_cleanup(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_cleanup(const EVP_PKEY_METHOD *pmeth, void (**pcleanup) (EVP_PKEY_CTX *ctx)); -void EVP_PKEY_meth_get_paramgen(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_paramgen(const EVP_PKEY_METHOD *pmeth, int (**pparamgen_init) (EVP_PKEY_CTX *ctx), int (**pparamgen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)); -void EVP_PKEY_meth_get_keygen(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_keygen(const EVP_PKEY_METHOD *pmeth, int (**pkeygen_init) (EVP_PKEY_CTX *ctx), int (**pkeygen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)); -void EVP_PKEY_meth_get_sign(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_sign(const EVP_PKEY_METHOD *pmeth, int (**psign_init) (EVP_PKEY_CTX *ctx), int (**psign) (EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, const unsigned char *tbs, size_t tbslen)); -void EVP_PKEY_meth_get_verify(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_verify(const EVP_PKEY_METHOD *pmeth, int (**pverify_init) (EVP_PKEY_CTX *ctx), int (**pverify) (EVP_PKEY_CTX *ctx, const unsigned char *sig, @@ -1383,7 +1386,7 @@ void EVP_PKEY_meth_get_verify(EVP_PKEY_METHOD *pmeth, const unsigned char *tbs, size_t tbslen)); -void EVP_PKEY_meth_get_verify_recover(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_verify_recover(const EVP_PKEY_METHOD *pmeth, int (**pverify_recover_init) (EVP_PKEY_CTX *ctx), int (**pverify_recover) (EVP_PKEY_CTX @@ -1395,7 +1398,7 @@ void EVP_PKEY_meth_get_verify_recover(EVP_PKEY_METHOD *pmeth, char *tbs, size_t tbslen)); -void EVP_PKEY_meth_get_signctx(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_signctx(const EVP_PKEY_METHOD *pmeth, int (**psignctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx), int (**psignctx) (EVP_PKEY_CTX *ctx, @@ -1403,7 +1406,7 @@ void EVP_PKEY_meth_get_signctx(EVP_PKEY_METHOD *pmeth, size_t *siglen, EVP_MD_CTX *mctx)); -void EVP_PKEY_meth_get_verifyctx(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_verifyctx(const EVP_PKEY_METHOD *pmeth, int (**pverifyctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx), int (**pverifyctx) (EVP_PKEY_CTX *ctx, @@ -1411,7 +1414,7 @@ void EVP_PKEY_meth_get_verifyctx(EVP_PKEY_METHOD *pmeth, int siglen, EVP_MD_CTX *mctx)); -void EVP_PKEY_meth_get_encrypt(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_encrypt(const EVP_PKEY_METHOD *pmeth, int (**pencrypt_init) (EVP_PKEY_CTX *ctx), int (**pencryptfn) (EVP_PKEY_CTX *ctx, unsigned char *out, @@ -1419,7 +1422,7 @@ void EVP_PKEY_meth_get_encrypt(EVP_PKEY_METHOD *pmeth, const unsigned char *in, size_t inlen)); -void EVP_PKEY_meth_get_decrypt(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_decrypt(const EVP_PKEY_METHOD *pmeth, int (**pdecrypt_init) (EVP_PKEY_CTX *ctx), int (**pdecrypt) (EVP_PKEY_CTX *ctx, unsigned char *out, @@ -1427,13 +1430,13 @@ void EVP_PKEY_meth_get_decrypt(EVP_PKEY_METHOD *pmeth, const unsigned char *in, size_t inlen)); -void EVP_PKEY_meth_get_derive(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_derive(const EVP_PKEY_METHOD *pmeth, int (**pderive_init) (EVP_PKEY_CTX *ctx), int (**pderive) (EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen)); -void EVP_PKEY_meth_get_ctrl(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_ctrl(const EVP_PKEY_METHOD *pmeth, int (**pctrl) (EVP_PKEY_CTX *ctx, int type, int p1, void *p2), int (**pctrl_str) (EVP_PKEY_CTX *ctx, @@ -1455,11 +1458,14 @@ int ERR_load_EVP_strings(void); /* Function codes. */ # define EVP_F_AESNI_INIT_KEY 165 # define EVP_F_AES_INIT_KEY 133 +# define EVP_F_AES_OCB_CIPHER 169 # define EVP_F_AES_T4_INIT_KEY 178 +# define EVP_F_AES_WRAP_CIPHER 170 # define EVP_F_ALG_MODULE_INIT 177 # define EVP_F_CAMELLIA_INIT_KEY 159 # define EVP_F_CHACHA20_POLY1305_CTRL 182 # define EVP_F_CMLL_T4_INIT_KEY 179 +# define EVP_F_DES_EDE3_WRAP_CIPHER 171 # define EVP_F_DO_SIGVER_INIT 161 # define EVP_F_EVP_CIPHERINIT_EX 123 # define EVP_F_EVP_CIPHER_CTX_COPY 163 @@ -1479,6 +1485,7 @@ int ERR_load_EVP_strings(void); # define EVP_F_EVP_PBE_SCRYPT 181 # define EVP_F_EVP_PKCS82PKEY 111 # define EVP_F_EVP_PKEY2PKCS8 113 +# define EVP_F_EVP_PKEY_ASN1_ADD0 168 # define EVP_F_EVP_PKEY_COPY_PARAMETERS 103 # define EVP_F_EVP_PKEY_CTX_CTRL 137 # define EVP_F_EVP_PKEY_CTX_CTRL_STR 150 @@ -1499,9 +1506,12 @@ int ERR_load_EVP_strings(void); # define EVP_F_EVP_PKEY_GET0_RSA 121 # define EVP_F_EVP_PKEY_KEYGEN 146 # define EVP_F_EVP_PKEY_KEYGEN_INIT 147 +# define EVP_F_EVP_PKEY_METH_ADD0 172 +# define EVP_F_EVP_PKEY_METH_NEW 173 # define EVP_F_EVP_PKEY_NEW 106 # define EVP_F_EVP_PKEY_PARAMGEN 148 # define EVP_F_EVP_PKEY_PARAMGEN_INIT 149 +# define EVP_F_EVP_PKEY_SET1_ENGINE 187 # define EVP_F_EVP_PKEY_SIGN 140 # define EVP_F_EVP_PKEY_SIGN_INIT 141 # define EVP_F_EVP_PKEY_VERIFY 142 @@ -1546,6 +1556,7 @@ int ERR_load_EVP_strings(void); # define EVP_R_INPUT_NOT_INITIALIZED 111 # define EVP_R_INVALID_DIGEST 152 # define EVP_R_INVALID_FIPS_MODE 168 +# define EVP_R_INVALID_KEY 163 # define EVP_R_INVALID_KEY_LENGTH 130 # define EVP_R_INVALID_OPERATION 148 # define EVP_R_KEYGEN_FAILURE 120 @@ -1561,6 +1572,9 @@ int ERR_load_EVP_strings(void); # define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 150 # define EVP_R_OPERATON_NOT_INITIALIZED 151 # define EVP_R_PARTIALLY_OVERLAPPING 162 +# define EVP_R_PBKDF2_ERROR 176 +# define EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED 175 +# define EVP_R_PKEY_ASN1_METHOD_ALREADY_REGISTERED 164 # define EVP_R_PRIVATE_KEY_DECODE_ERROR 145 # define EVP_R_PRIVATE_KEY_ENCODE_ERROR 146 # define EVP_R_PUBLIC_KEY_NOT_RSA 106 @@ -1568,12 +1582,12 @@ int ERR_load_EVP_strings(void); # define EVP_R_UNKNOWN_DIGEST 161 # define EVP_R_UNKNOWN_OPTION 169 # define EVP_R_UNKNOWN_PBE_ALGORITHM 121 -# define EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS 135 # define EVP_R_UNSUPPORTED_ALGORITHM 156 # define EVP_R_UNSUPPORTED_CIPHER 107 # define EVP_R_UNSUPPORTED_KEYLENGTH 123 # define EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 124 # define EVP_R_UNSUPPORTED_KEY_SIZE 108 +# define EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS 135 # define EVP_R_UNSUPPORTED_PRF 125 # define EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM 118 # define EVP_R_UNSUPPORTED_SALT_TYPE 126 diff --git a/external/openssl/include/android/openssl/lhash.h b/external/openssl/include/android/openssl/lhash.h index e2ccb65d..8ecc5884 100644 --- a/external/openssl/include/android/openssl/lhash.h +++ b/external/openssl/include/android/openssl/lhash.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -95,7 +95,7 @@ void OPENSSL_LH_node_usage_stats_bio(const OPENSSL_LHASH *lh, BIO *out); # define _LHASH OPENSSL_LHASH # define LHASH_NODE OPENSSL_LH_NODE # define lh_error OPENSSL_LH_error -# define lh_new OPENSSL_lh_new +# define lh_new OPENSSL_LH_new # define lh_free OPENSSL_LH_free # define lh_insert OPENSSL_LH_insert # define lh_delete OPENSSL_LH_delete @@ -195,8 +195,21 @@ void OPENSSL_LH_node_usage_stats_bio(const OPENSSL_LHASH *lh, BIO *out); LHASH_OF(type) DEFINE_LHASH_OF(OPENSSL_STRING); +# ifdef _MSC_VER +/* + * push and pop this warning: + * warning C4090: 'function': different 'const' qualifiers + */ +# pragma warning (push) +# pragma warning (disable: 4090) +# endif + DEFINE_LHASH_OF(OPENSSL_CSTRING); +# ifdef _MSC_VER +# pragma warning (pop) +# endif + #ifdef __cplusplus } #endif diff --git a/external/openssl/include/android/openssl/objects.h b/external/openssl/include/android/openssl/objects.h index 09d614ff..d4462fee 100644 --- a/external/openssl/include/android/openssl/objects.h +++ b/external/openssl/include/android/openssl/objects.h @@ -992,7 +992,7 @@ const void *OBJ_bsearch_ex_(const void *key, const void *base, int num, * const void *a_; * const nid_triple const *a = a_; * - * The assignement discards a const because what you really want is: + * The assignment discards a const because what you really want is: * * const int const * const *a = a_; * @@ -1000,7 +1000,7 @@ const void *OBJ_bsearch_ex_(const void *key, const void *base, int num, * which breaks comparison functions. * * Thus we end up having to cast, sadly, or unpack the - * declarations. Or, as I finally did in this case, delcare nid_triple + * declarations. Or, as I finally did in this case, declare nid_triple * to be a struct, which it should have been in the first place. * * Ben, August 2008. diff --git a/external/openssl/include/android/openssl/ocsp.h b/external/openssl/include/android/openssl/ocsp.h index 08debc5b..ba1b9731 100644 --- a/external/openssl/include/android/openssl/ocsp.h +++ b/external/openssl/include/android/openssl/ocsp.h @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -92,7 +92,6 @@ typedef struct ocsp_resp_bytes_st OCSP_RESPBYTES; # define V_OCSP_RESPID_KEY 1 DEFINE_STACK_OF(OCSP_RESPID) -DECLARE_ASN1_FUNCTIONS(OCSP_RESPID) typedef struct ocsp_revoked_info_st OCSP_REVOKEDINFO; @@ -137,22 +136,6 @@ typedef struct ocsp_service_locator_st OCSP_SERVICELOC; # define i2d_OCSP_REQUEST_bio(bp,o) ASN1_i2d_bio_of(OCSP_REQUEST,i2d_OCSP_REQUEST,bp,o) -# define OCSP_REQUEST_sign(o,pkey,md) \ - ASN1_item_sign(ASN1_ITEM_rptr(OCSP_REQINFO),\ - &o->optionalSignature->signatureAlgorithm,NULL,\ - o->optionalSignature->signature,&o->tbsRequest,pkey,md) - -# define OCSP_BASICRESP_sign(o,pkey,md,d) \ - ASN1_item_sign(ASN1_ITEM_rptr(OCSP_RESPDATA),&o->signatureAlgorithm,NULL,\ - o->signature,&o->tbsResponseData,pkey,md) - -# define OCSP_REQUEST_verify(a,r) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_REQINFO),\ - &a->optionalSignature->signatureAlgorithm,\ - a->optionalSignature->signature,&a->tbsRequest,r) - -# define OCSP_BASICRESP_verify(a,r,d) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_RESPDATA),\ - &a->signatureAlgorithm,a->signature,&a->tbsResponseData,r) - # define ASN1_BIT_STRING_digest(data,type,md,len) \ ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING),type,data,md,len) @@ -175,8 +158,6 @@ int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it, int OCSP_REQ_CTX_nbio_d2i(OCSP_REQ_CTX *rctx, ASN1_VALUE **pval, const ASN1_ITEM *it); BIO *OCSP_REQ_CTX_get0_mem_bio(OCSP_REQ_CTX *rctx); -int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it, - ASN1_VALUE *val); int OCSP_REQ_CTX_http(OCSP_REQ_CTX *rctx, const char *op, const char *path); int OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, OCSP_REQUEST *req); int OCSP_REQ_CTX_add1_header(OCSP_REQ_CTX *rctx, @@ -210,6 +191,10 @@ int OCSP_response_status(OCSP_RESPONSE *resp); OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp); const ASN1_OCTET_STRING *OCSP_resp_get0_signature(const OCSP_BASICRESP *bs); +const X509_ALGOR *OCSP_resp_get0_tbs_sigalg(const OCSP_BASICRESP *bs); +const OCSP_RESPDATA *OCSP_resp_get0_respdata(const OCSP_BASICRESP *bs); +int OCSP_resp_get0_signer(OCSP_BASICRESP *bs, X509 **signer, + STACK_OF(X509) *extra_certs); int OCSP_resp_count(OCSP_BASICRESP *bs); OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx); diff --git a/external/openssl/include/android/openssl/opensslconf-arm32.h b/external/openssl/include/android/openssl/opensslconf-arm32.h index 527f4d5b..02b015ac 100644 --- a/external/openssl/include/android/openssl/opensslconf-arm32.h +++ b/external/openssl/include/android/openssl/opensslconf-arm32.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -96,12 +96,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/external/openssl/include/android/openssl/opensslconf-arm64.h b/external/openssl/include/android/openssl/opensslconf-arm64.h index f3d83b5c..5ec07686 100644 --- a/external/openssl/include/android/openssl/opensslconf-arm64.h +++ b/external/openssl/include/android/openssl/opensslconf-arm64.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -96,12 +96,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/external/openssl/include/android/openssl/opensslconf-x86.h b/external/openssl/include/android/openssl/opensslconf-x86.h index 9891b5d8..f5c66c55 100644 --- a/external/openssl/include/android/openssl/opensslconf-x86.h +++ b/external/openssl/include/android/openssl/opensslconf-x86.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -96,12 +96,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/external/openssl/include/android/openssl/opensslv.h b/external/openssl/include/android/openssl/opensslv.h index 2d54b69b..12483c6e 100644 --- a/external/openssl/include/android/openssl/opensslv.h +++ b/external/openssl/include/android/openssl/opensslv.h @@ -1,5 +1,5 @@ /* - * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -39,11 +39,11 @@ extern "C" { * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for * major minor fix final patch/beta) */ -# define OPENSSL_VERSION_NUMBER 0x1010003fL +# define OPENSSL_VERSION_NUMBER 0x101000cfL # ifdef OPENSSL_FIPS -# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0c-fips 10 Nov 2016" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0l-fips 10 Sep 2019" # else -# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0c 10 Nov 2016" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0l 10 Sep 2019" # endif /*- diff --git a/external/openssl/include/android/openssl/pem.h b/external/openssl/include/android/openssl/pem.h index 2375d635..f7ce3c61 100644 --- a/external/openssl/include/android/openssl/pem.h +++ b/external/openssl/include/android/openssl/pem.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -322,7 +322,8 @@ int PEM_SignUpdate(EVP_MD_CTX *ctx, unsigned char *d, unsigned int cnt); int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen, EVP_PKEY *pkey); -int PEM_def_callback(char *buf, int num, int w, void *key); +/* The default pem_password_cb that's used internally */ +int PEM_def_callback(char *buf, int num, int rwflag, void *userdata); void PEM_proc_type(char *buf, int type); void PEM_dek_info(char *buf, const char *type, int len, char *str); diff --git a/external/openssl/include/android/openssl/rsa.h b/external/openssl/include/android/openssl/rsa.h index 4d6e9cc9..9c28329f 100644 --- a/external/openssl/include/android/openssl/rsa.h +++ b/external/openssl/include/android/openssl/rsa.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -374,7 +374,7 @@ void RSA_meth_free(RSA_METHOD *meth); RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth); const char *RSA_meth_get0_name(const RSA_METHOD *meth); int RSA_meth_set1_name(RSA_METHOD *meth, const char *name); -int RSA_meth_get_flags(RSA_METHOD *meth); +int RSA_meth_get_flags(const RSA_METHOD *meth); int RSA_meth_set_flags(RSA_METHOD *meth, int flags); void *RSA_meth_get0_app_data(const RSA_METHOD *meth); int RSA_meth_set0_app_data(RSA_METHOD *meth, void *app_data); @@ -407,9 +407,9 @@ int RSA_meth_set_priv_dec(RSA_METHOD *rsa, unsigned char *to, RSA *rsa, int padding)); int (*RSA_meth_get_mod_exp(const RSA_METHOD *meth)) - (BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx); + (BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx); int RSA_meth_set_mod_exp(RSA_METHOD *rsa, - int (*mod_exp) (BIGNUM *r0, const BIGNUM *I, RSA *rsa, + int (*mod_exp) (BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx)); int (*RSA_meth_get_bn_mod_exp(const RSA_METHOD *meth)) (BIGNUM *r, const BIGNUM *a, const BIGNUM *p, @@ -468,6 +468,7 @@ int ERR_load_RSA_strings(void); # define RSA_F_PKEY_RSA_CTRL 143 # define RSA_F_PKEY_RSA_CTRL_STR 144 # define RSA_F_PKEY_RSA_SIGN 142 +# define RSA_F_PKEY_RSA_VERIFY 149 # define RSA_F_PKEY_RSA_VERIFYRECOVER 141 # define RSA_F_RSA_ALGOR_TO_MD 156 # define RSA_F_RSA_BUILTIN_KEYGEN 129 diff --git a/external/openssl/include/android/openssl/seed.h b/external/openssl/include/android/openssl/seed.h index bb97131d..de10b085 100644 --- a/external/openssl/include/android/openssl/seed.h +++ b/external/openssl/include/android/openssl/seed.h @@ -52,9 +52,7 @@ extern "C" { # endif # endif -# if !defined(NO_SYS_TYPES_H) -# include -# endif +# include # define SEED_BLOCK_SIZE 16 # define SEED_KEY_LENGTH 16 diff --git a/external/openssl/include/android/openssl/srtp.h b/external/openssl/include/android/openssl/srtp.h index 5ddfa46d..0b57c235 100644 --- a/external/openssl/include/android/openssl/srtp.h +++ b/external/openssl/include/android/openssl/srtp.h @@ -36,7 +36,7 @@ extern "C" { # ifndef OPENSSL_NO_SRTP __owur int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles); -__owur int SSL_set_tlsext_use_srtp(SSL *ctx, const char *profiles); +__owur int SSL_set_tlsext_use_srtp(SSL *ssl, const char *profiles); __owur STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl); __owur SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s); diff --git a/external/openssl/include/android/openssl/ssl.h b/external/openssl/include/android/openssl/ssl.h index 86ab9125..56e20562 100644 --- a/external/openssl/include/android/openssl/ssl.h +++ b/external/openssl/include/android/openssl/ssl.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -95,14 +95,14 @@ extern "C" { # define SSL_TXT_NULL "NULL" # define SSL_TXT_kRSA "kRSA" -# define SSL_TXT_kDHr "kDHr" -# define SSL_TXT_kDHd "kDHd" -# define SSL_TXT_kDH "kDH" +# define SSL_TXT_kDHr "kDHr"/* this cipher class has been removed */ +# define SSL_TXT_kDHd "kDHd"/* this cipher class has been removed */ +# define SSL_TXT_kDH "kDH"/* this cipher class has been removed */ # define SSL_TXT_kEDH "kEDH"/* alias for kDHE */ # define SSL_TXT_kDHE "kDHE" -# define SSL_TXT_kECDHr "kECDHr" -# define SSL_TXT_kECDHe "kECDHe" -# define SSL_TXT_kECDH "kECDH" +# define SSL_TXT_kECDHr "kECDHr"/* this cipher class has been removed */ +# define SSL_TXT_kECDHe "kECDHe"/* this cipher class has been removed */ +# define SSL_TXT_kECDH "kECDH"/* this cipher class has been removed */ # define SSL_TXT_kEECDH "kEECDH"/* alias for kECDHE */ # define SSL_TXT_kECDHE "kECDHE" # define SSL_TXT_kPSK "kPSK" @@ -114,8 +114,8 @@ extern "C" { # define SSL_TXT_aRSA "aRSA" # define SSL_TXT_aDSS "aDSS" -# define SSL_TXT_aDH "aDH" -# define SSL_TXT_aECDH "aECDH" +# define SSL_TXT_aDH "aDH"/* this cipher class has been removed */ +# define SSL_TXT_aECDH "aECDH"/* this cipher class has been removed */ # define SSL_TXT_aECDSA "aECDSA" # define SSL_TXT_aPSK "aPSK" # define SSL_TXT_aGOST94 "aGOST94" @@ -262,54 +262,33 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, const unsigned char *in, size_t inlen, int *al, void *parse_arg); +/* Typedef for verification callback */ +typedef int (*SSL_verify_cb)(int preverify_ok, X509_STORE_CTX *x509_ctx); + /* Allow initial connection to servers that don't support RI */ # define SSL_OP_LEGACY_SERVER_CONNECT 0x00000004U -/* Removed from OpenSSL 0.9.8q and 1.0.0c */ -/* Dead forever, see CVE-2010-4180. */ -# define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG 0x0U # define SSL_OP_TLSEXT_PADDING 0x00000010U -# define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER 0x0U # define SSL_OP_SAFARI_ECDHE_ECDSA_BUG 0x00000040U -/* Ancient SSLeay version, retained for compatibility */ -# define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0x0 -# define SSL_OP_TLS_D5_BUG 0x0U -/* Removed from OpenSSL 1.1.0 */ -# define SSL_OP_TLS_BLOCK_PADDING_BUG 0x0U - -/* Hasn't done anything since OpenSSL 0.9.7h, retained for compatibility */ -# define SSL_OP_MSIE_SSLV2_RSA_PADDING 0x0 -/* Refers to ancient SSLREF and SSLv2, retained for compatibility */ -# define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG 0x0 -/* Related to removed SSLv2 */ -# define SSL_OP_MICROSOFT_SESS_ID_BUG 0x0 -# define SSL_OP_NETSCAPE_CHALLENGE_BUG 0x0 /* * Disable SSL 3.0/TLS 1.0 CBC vulnerability workaround that was added in * OpenSSL 0.9.6d. Usually (depending on the application protocol) the * workaround is not needed. Unfortunately some broken SSL/TLS * implementations cannot handle it at all, which is why we include it in - * SSL_OP_ALL. + * SSL_OP_ALL. Added in 0.9.6e */ -/* added in 0.9.6e */ # define SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS 0x00000800U -/* - * SSL_OP_ALL: various bug workarounds that should be rather harmless. This - * used to be 0x000FFFFFL before 0.9.7. - */ -# define SSL_OP_ALL 0x80000BFFU - /* DTLS options */ -# define SSL_OP_NO_QUERY_MTU 0x00001000U +# define SSL_OP_NO_QUERY_MTU 0x00001000U /* Turn on Cookie Exchange (on relevant for servers) */ -# define SSL_OP_COOKIE_EXCHANGE 0x00002000U +# define SSL_OP_COOKIE_EXCHANGE 0x00002000U /* Don't use RFC4507 ticket extension */ -# define SSL_OP_NO_TICKET 0x00004000U +# define SSL_OP_NO_TICKET 0x00004000U # ifndef OPENSSL_NO_DTLS1_METHOD /* Use Cisco's "speshul" version of DTLS_BAD_VER * (only with deprecated DTLSv1_client_method()) */ -# define SSL_OP_CISCO_ANYCONNECT 0x00008000U +# define SSL_OP_CISCO_ANYCONNECT 0x00008000U # endif /* As server, disallow session resumption on renegotiation */ @@ -318,12 +297,8 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, # define SSL_OP_NO_COMPRESSION 0x00020000U /* Permit unsafe legacy renegotiation */ # define SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION 0x00040000U -/* Does nothing: retained for compatibility */ -# define SSL_OP_SINGLE_ECDH_USE 0x0 -/* Does nothing: retained for compatibility */ -# define SSL_OP_SINGLE_DH_USE 0x0 -/* Does nothing: retained for compatibility */ -# define SSL_OP_EPHEMERAL_RSA 0x0 +/* Disable encrypt-then-mac */ +# define SSL_OP_NO_ENCRYPT_THEN_MAC 0x00080000U /* * Set on servers to choose the cipher according to the server's preferences */ @@ -336,7 +311,6 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, */ # define SSL_OP_TLS_ROLLBACK_BUG 0x00800000U -# define SSL_OP_NO_SSLv2 0x00000000U # define SSL_OP_NO_SSLv3 0x02000000U # define SSL_OP_NO_TLSv1 0x04000000U # define SSL_OP_NO_TLSv1_2 0x08000000U @@ -349,12 +323,9 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, SSL_OP_NO_TLSv1|SSL_OP_NO_TLSv1_1|SSL_OP_NO_TLSv1_2) # define SSL_OP_NO_DTLS_MASK (SSL_OP_NO_DTLSv1|SSL_OP_NO_DTLSv1_2) +/* Disallow all renegotiation */ +# define SSL_OP_NO_RENEGOTIATION 0x40000000U -/* Removed from previous versions */ -# define SSL_OP_PKCS1_CHECK_1 0x0 -# define SSL_OP_PKCS1_CHECK_2 0x0 -# define SSL_OP_NETSCAPE_CA_DN_BUG 0x0 -# define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x0U /* * Make server add server-hello extension from early version of cryptopro * draft, when GOST ciphersuite is negotiated. Required for interoperability @@ -362,6 +333,59 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, */ # define SSL_OP_CRYPTOPRO_TLSEXT_BUG 0x80000000U +/* + * SSL_OP_ALL: various bug workarounds that should be rather harmless. + * This used to be 0x000FFFFFL before 0.9.7. + * This used to be 0x80000BFFU before 1.1.1. + */ +# define SSL_OP_ALL (SSL_OP_CRYPTOPRO_TLSEXT_BUG|\ + SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS|\ + SSL_OP_LEGACY_SERVER_CONNECT|\ + SSL_OP_TLSEXT_PADDING|\ + SSL_OP_SAFARI_ECDHE_ECDSA_BUG) + +/* OBSOLETE OPTIONS: retained for compatibility */ + +/* Removed from OpenSSL 1.1.0. Was 0x00000001L */ +/* Related to removed SSLv2. */ +# define SSL_OP_MICROSOFT_SESS_ID_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000002L */ +/* Related to removed SSLv2. */ +# define SSL_OP_NETSCAPE_CHALLENGE_BUG 0x0 +/* Removed from OpenSSL 0.9.8q and 1.0.0c. Was 0x00000008L */ +/* Dead forever, see CVE-2010-4180 */ +# define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG 0x0 +/* Removed from OpenSSL 1.0.1h and 1.0.2. Was 0x00000010L */ +/* Refers to ancient SSLREF and SSLv2. */ +# define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000020 */ +# define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER 0x0 +/* Removed from OpenSSL 0.9.7h and 0.9.8b. Was 0x00000040L */ +# define SSL_OP_MSIE_SSLV2_RSA_PADDING 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000080 */ +/* Ancient SSLeay version. */ +# define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000100L */ +# define SSL_OP_TLS_D5_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000200L */ +# define SSL_OP_TLS_BLOCK_PADDING_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00080000L */ +# define SSL_OP_SINGLE_ECDH_USE 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00100000L */ +# define SSL_OP_SINGLE_DH_USE 0x0 +/* Removed from OpenSSL 1.0.1k and 1.0.2. Was 0x00200000L */ +# define SSL_OP_EPHEMERAL_RSA 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x01000000L */ +# define SSL_OP_NO_SSLv2 0x0 +/* Removed from OpenSSL 1.0.1. Was 0x08000000L */ +# define SSL_OP_PKCS1_CHECK_1 0x0 +/* Removed from OpenSSL 1.0.1. Was 0x10000000L */ +# define SSL_OP_PKCS1_CHECK_2 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x20000000L */ +# define SSL_OP_NETSCAPE_CA_DN_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x40000000L */ +# define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x0 + /* * Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success * when just a single record has been written): @@ -943,8 +967,8 @@ size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count); # define SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02 # define SSL_VERIFY_CLIENT_ONCE 0x04 -# define OpenSSL_add_ssl_algorithms() SSL_library_init() # if OPENSSL_API_COMPAT < 0x10100000L +# define OpenSSL_add_ssl_algorithms() SSL_library_init() # define SSLeay_add_ssl_algorithms() SSL_library_init() # endif @@ -1139,6 +1163,8 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) # define SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE 127 # define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB 128 # define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG 129 +# define SSL_CTRL_GET_MIN_PROTO_VERSION 130 +# define SSL_CTRL_GET_MAX_PROTO_VERSION 131 # define SSL_CERT_SET_FIRST 1 # define SSL_CERT_SET_NEXT 2 # define SSL_CERT_SET_SERVER 3 @@ -1241,7 +1267,7 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) # define SSL_CTX_set1_sigalgs_list(ctx, s) \ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)s) # define SSL_set1_sigalgs(ctx, slist, slistlen) \ - SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS,clistlen,(int *)slist) + SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS,slistlen,(int *)slist) # define SSL_set1_sigalgs_list(ctx, s) \ SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)s) # define SSL_CTX_set1_client_sigalgs(ctx, slist, slistlen) \ @@ -1270,10 +1296,18 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MIN_PROTO_VERSION, version, NULL) #define SSL_CTX_set_max_proto_version(ctx, version) \ SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MAX_PROTO_VERSION, version, NULL) +#define SSL_CTX_get_min_proto_version(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MIN_PROTO_VERSION, 0, NULL) +#define SSL_CTX_get_max_proto_version(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MAX_PROTO_VERSION, 0, NULL) #define SSL_set_min_proto_version(s, version) \ SSL_ctrl(s, SSL_CTRL_SET_MIN_PROTO_VERSION, version, NULL) #define SSL_set_max_proto_version(s, version) \ SSL_ctrl(s, SSL_CTRL_SET_MAX_PROTO_VERSION, version, NULL) +#define SSL_get_min_proto_version(s) \ + SSL_ctrl(s, SSL_CTRL_GET_MIN_PROTO_VERSION, 0, NULL) +#define SSL_get_max_proto_version(s) \ + SSL_ctrl(s, SSL_CTRL_GET_MAX_PROTO_VERSION, 0, NULL) #if OPENSSL_API_COMPAT < 0x10100000L /* Provide some compatibility macros for removed functionality. */ @@ -1324,7 +1358,7 @@ __owur int SSL_get_fd(const SSL *s); __owur int SSL_get_rfd(const SSL *s); __owur int SSL_get_wfd(const SSL *s); __owur const char *SSL_get_cipher_list(const SSL *s, int n); -__owur char *SSL_get_shared_ciphers(const SSL *s, char *buf, int len); +__owur char *SSL_get_shared_ciphers(const SSL *s, char *buf, int size); __owur int SSL_get_read_ahead(const SSL *s); __owur int SSL_pending(const SSL *s); __owur int SSL_has_pending(const SSL *s); @@ -1342,9 +1376,8 @@ __owur int SSL_set_cipher_list(SSL *s, const char *str); void SSL_set_read_ahead(SSL *s, int yes); __owur int SSL_get_verify_mode(const SSL *s); __owur int SSL_get_verify_depth(const SSL *s); -__owur int (*SSL_get_verify_callback(const SSL *s)) (int, X509_STORE_CTX *); -void SSL_set_verify(SSL *s, int mode, - int (*callback) (int ok, X509_STORE_CTX *ctx)); +__owur SSL_verify_cb SSL_get_verify_callback(const SSL *s); +void SSL_set_verify(SSL *s, int mode, SSL_verify_cb callback); void SSL_set_verify_depth(SSL *s, int depth); void SSL_set_cert_cb(SSL *s, int (*cb) (SSL *ssl, void *arg), void *arg); # ifndef OPENSSL_NO_RSA @@ -1426,7 +1459,7 @@ int SSL_SESSION_up_ref(SSL_SESSION *ses); void SSL_SESSION_free(SSL_SESSION *ses); __owur int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp); __owur int SSL_set_session(SSL *to, SSL_SESSION *session); -__owur int SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c); +int SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c); int SSL_CTX_remove_session(SSL_CTX *, SSL_SESSION *c); __owur int SSL_CTX_set_generate_session_id(SSL_CTX *, GEN_SESSION_CB); __owur int SSL_set_generate_session_id(SSL *, GEN_SESSION_CB); @@ -1443,10 +1476,8 @@ __owur STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *s); __owur int SSL_CTX_get_verify_mode(const SSL_CTX *ctx); __owur int SSL_CTX_get_verify_depth(const SSL_CTX *ctx); -__owur int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx)) (int, - X509_STORE_CTX *); -void SSL_CTX_set_verify(SSL_CTX *ctx, int mode, - int (*callback) (int, X509_STORE_CTX *)); +__owur SSL_verify_cb SSL_CTX_get_verify_callback(const SSL_CTX *ctx); +void SSL_CTX_set_verify(SSL_CTX *ctx, int mode, SSL_verify_cb callback); void SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth); void SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx, int (*cb) (X509_STORE_CTX *, void *), @@ -1501,7 +1532,7 @@ __owur int SSL_CTX_dane_mtype_set(SSL_CTX *ctx, const EVP_MD *md, uint8_t mtype, uint8_t ord); __owur int SSL_dane_enable(SSL *s, const char *basedomain); __owur int SSL_dane_tlsa_add(SSL *s, uint8_t usage, uint8_t selector, - uint8_t mtype, unsigned char *data, size_t dlen); + uint8_t mtype, unsigned const char *data, size_t dlen); __owur int SSL_get0_dane_authority(SSL *s, X509 **mcert, EVP_PKEY **mspki); __owur int SSL_get0_dane_tlsa(SSL *s, uint8_t *usage, uint8_t *selector, uint8_t *mtype, unsigned const char **data, @@ -1777,6 +1808,8 @@ void SSL_set_tmp_dh_callback(SSL *ssl, __owur const COMP_METHOD *SSL_get_current_compression(SSL *s); __owur const COMP_METHOD *SSL_get_current_expansion(SSL *s); __owur const char *SSL_COMP_get_name(const COMP_METHOD *comp); +__owur const char *SSL_COMP_get0_name(const SSL_COMP *comp); +__owur int SSL_COMP_get_id(const SSL_COMP *comp); STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void); __owur STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP) *meths); @@ -1814,7 +1847,7 @@ void SSL_set_not_resumable_session_callback(SSL *ssl, # endif __owur int SSL_session_reused(SSL *s); -__owur int SSL_is_server(SSL *s); +__owur int SSL_is_server(const SSL *s); __owur __owur SSL_CONF_CTX *SSL_CONF_CTX_new(void); int SSL_CONF_CTX_finish(SSL_CONF_CTX *cctx); @@ -2077,6 +2110,7 @@ int ERR_load_SSL_strings(void); # define SSL_F_DTLS_CONSTRUCT_HELLO_VERIFY_REQUEST 385 # define SSL_F_DTLS_GET_REASSEMBLED_MESSAGE 370 # define SSL_F_DTLS_PROCESS_HELLO_VERIFY 386 +# define SSL_F_DTLS_WAIT_FOR_DRY 592 # define SSL_F_OPENSSL_INIT_SSL 342 # define SSL_F_OSSL_STATEM_CLIENT_READ_TRANSITION 417 # define SSL_F_OSSL_STATEM_SERVER_READ_TRANSITION 418 @@ -2098,6 +2132,7 @@ int ERR_load_SSL_strings(void); # define SSL_F_SSL3_SETUP_KEY_BLOCK 157 # define SSL_F_SSL3_SETUP_READ_BUFFER 156 # define SSL_F_SSL3_SETUP_WRITE_BUFFER 291 +# define SSL_F_SSL3_TAKE_MAC 425 # define SSL_F_SSL3_WRITE_BYTES 158 # define SSL_F_SSL3_WRITE_PENDING 159 # define SSL_F_SSL_ADD_CERT_CHAIN 316 @@ -2171,6 +2206,8 @@ int ERR_load_SSL_strings(void); # define SSL_F_SSL_PARSE_SERVERHELLO_USE_SRTP_EXT 311 # define SSL_F_SSL_PEEK 270 # define SSL_F_SSL_READ 223 +# define SSL_F_SSL_RENEGOTIATE 516 +# define SSL_F_SSL_RENEGOTIATE_ABBREVIATED 546 # define SSL_F_SSL_SCAN_CLIENTHELLO_TLSEXT 320 # define SSL_F_SSL_SCAN_SERVERHELLO_TLSEXT 321 # define SSL_F_SSL_SESSION_DUP 348 @@ -2344,6 +2381,7 @@ int ERR_load_SSL_strings(void); # define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 150 # define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 151 # define SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN 204 +# define SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE 194 # define SSL_R_EXCESSIVE_MESSAGE_SIZE 152 # define SSL_R_EXTRA_DATA_IN_MESSAGE 153 # define SSL_R_FAILED_TO_INIT_ASYNC 405 diff --git a/external/openssl/include/android/openssl/ssl3.h b/external/openssl/include/android/openssl/ssl3.h index aca19223..115940ad 100644 --- a/external/openssl/include/android/openssl/ssl3.h +++ b/external/openssl/include/android/openssl/ssl3.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -252,9 +252,15 @@ extern "C" { # define SSL3_CT_FORTEZZA_DMS 20 /* * SSL3_CT_NUMBER is used to size arrays and it must be large enough to - * contain all of the cert types defined either for SSLv3 and TLSv1. + * contain all of the cert types defined for *either* SSLv3 and TLSv1. */ -# define SSL3_CT_NUMBER 9 +# define SSL3_CT_NUMBER 10 + +# if defined(TLS_CT_NUMBER) +# if TLS_CT_NUMBER != SSL3_CT_NUMBER +# error "SSL/TLS CT_NUMBER values do not match" +# endif +# endif # define SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS 0x0001 @@ -264,11 +270,14 @@ extern "C" { # define TLS1_FLAGS_SKIP_CERT_VERIFY 0x0010 /* Set if we encrypt then mac instead of usual mac then encrypt */ -# define TLS1_FLAGS_ENCRYPT_THEN_MAC 0x0100 +# define TLS1_FLAGS_ENCRYPT_THEN_MAC_READ 0x0100 +# define TLS1_FLAGS_ENCRYPT_THEN_MAC TLS1_FLAGS_ENCRYPT_THEN_MAC_READ /* Set if extended master secret extension received from peer */ # define TLS1_FLAGS_RECEIVED_EXTMS 0x0200 +# define TLS1_FLAGS_ENCRYPT_THEN_MAC_WRITE 0x0400 + # define SSL3_MT_HELLO_REQUEST 0 # define SSL3_MT_CLIENT_HELLO 1 # define SSL3_MT_SERVER_HELLO 2 diff --git a/external/openssl/include/android/openssl/symhacks.h b/external/openssl/include/android/openssl/symhacks.h index caf1f1a7..156ea6e4 100644 --- a/external/openssl/include/android/openssl/symhacks.h +++ b/external/openssl/include/android/openssl/symhacks.h @@ -1,5 +1,5 @@ /* - * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -28,21 +28,6 @@ # undef i2d_ECPKPARAMETERS # define i2d_ECPKPARAMETERS i2d_UC_ECPKPARAMETERS -/* - * These functions do not seem to exist! However, I'm paranoid... Original - * command in x509v3.h: These functions are being redefined in another - * directory, and clash when the linker is case-insensitive, so let's hide - * them a little, by giving them an extra 'o' at the beginning of the name... - */ -# undef X509v3_cleanup_extensions -# define X509v3_cleanup_extensions oX509v3_cleanup_extensions -# undef X509v3_add_extension -# define X509v3_add_extension oX509v3_add_extension -# undef X509v3_add_netscape_extensions -# define X509v3_add_netscape_extensions oX509v3_add_netscape_extensions -# undef X509v3_add_standard_extensions -# define X509v3_add_standard_extensions oX509v3_add_standard_extensions - /* This one clashes with CMS_data_create */ # undef cms_Data_create # define cms_Data_create priv_cms_Data_create diff --git a/external/openssl/include/android/openssl/tls1.h b/external/openssl/include/android/openssl/tls1.h index 23e382cd..732e87ab 100644 --- a/external/openssl/include/android/openssl/tls1.h +++ b/external/openssl/include/android/openssl/tls1.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -226,12 +226,12 @@ __owur int SSL_get_servername_type(const SSL *s); * as specified in RFC 5705. It writes |olen| bytes to |out| given a label and * optional context. (Since a zero length context is allowed, the |use_context| * flag controls whether a context is included.) It returns 1 on success and - * zero otherwise. + * 0 or -1 otherwise. */ __owur int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen, - const char *label, size_t llen, - const unsigned char *p, size_t plen, - int use_context); + const char *label, size_t llen, + const unsigned char *context, + size_t contextlen, int use_context); int SSL_get_sigalgs(SSL *s, int idx, int *psign, int *phash, int *psignandhash, @@ -298,9 +298,9 @@ SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB,0, (void (**)(void))cb) SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,(void (*)(void))cb) # define SSL_CTX_get_tlsext_status_arg(ssl, arg) \ -SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg + SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg) # define SSL_CTX_set_tlsext_status_arg(ssl, arg) \ -SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg) + SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg) #define SSL_CTX_set_tlsext_status_type(ssl, type) \ SSL_CTX_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE, type, NULL) @@ -883,7 +883,13 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) * when correcting this number, correct also SSL3_CT_NUMBER in ssl3.h (see * comment there) */ -# define TLS_CT_NUMBER 9 +# define TLS_CT_NUMBER 10 + +# if defined(SSL3_CT_NUMBER) +# if TLS_CT_NUMBER != SSL3_CT_NUMBER +# error "SSL/TLS CT_NUMBER values do not match" +# endif +# endif # define TLS1_FINISH_MAC_LENGTH 12 diff --git a/external/openssl/include/android/openssl/ui.h b/external/openssl/include/android/openssl/ui.h index 26f4f044..49e763de 100644 --- a/external/openssl/include/android/openssl/ui.h +++ b/external/openssl/include/android/openssl/ui.h @@ -339,8 +339,12 @@ int ERR_load_UI_strings(void); /* Error codes for the UI functions. */ /* Function codes. */ +# define UI_F_CLOSE_CONSOLE 115 +# define UI_F_ECHO_CONSOLE 116 # define UI_F_GENERAL_ALLOCATE_BOOLEAN 108 # define UI_F_GENERAL_ALLOCATE_PROMPT 109 +# define UI_F_NOECHO_CONSOLE 117 +# define UI_F_OPEN_CONSOLE 114 # define UI_F_UI_CREATE_METHOD 112 # define UI_F_UI_CTRL 111 # define UI_F_UI_DUP_ERROR_STRING 101 @@ -350,6 +354,7 @@ int ERR_load_UI_strings(void); # define UI_F_UI_DUP_VERIFY_STRING 106 # define UI_F_UI_GET0_RESULT 107 # define UI_F_UI_NEW_METHOD 104 +# define UI_F_UI_PROCESS 113 # define UI_F_UI_SET_RESULT 105 /* Reason codes. */ @@ -357,9 +362,14 @@ int ERR_load_UI_strings(void); # define UI_R_INDEX_TOO_LARGE 102 # define UI_R_INDEX_TOO_SMALL 103 # define UI_R_NO_RESULT_BUFFER 105 +# define UI_R_PROCESSING_ERROR 107 # define UI_R_RESULT_TOO_LARGE 100 # define UI_R_RESULT_TOO_SMALL 101 +# define UI_R_SYSASSIGN_ERROR 109 +# define UI_R_SYSDASSGN_ERROR 110 +# define UI_R_SYSQIOW_ERROR 111 # define UI_R_UNKNOWN_CONTROL_COMMAND 106 +# define UI_R_UNKNOWN_TTYGET_ERRNO_VALUE 108 # ifdef __cplusplus } diff --git a/external/openssl/include/android/openssl/x509.h b/external/openssl/include/android/openssl/x509.h index c8996f35..916afaf7 100644 --- a/external/openssl/include/android/openssl/x509.h +++ b/external/openssl/include/android/openssl/x509.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -641,7 +641,7 @@ int X509_get_signature_type(const X509 *x); /* * This one is only used so that a binary form can output, as in - * i2d_X509_NAME(X509_get_X509_PUBKEY(x),&buf) + * i2d_X509_NAME(X509_get_X509_PUBKEY(x), &buf) */ X509_PUBKEY *X509_get_X509_PUBKEY(const X509 *x); const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x); @@ -1055,6 +1055,7 @@ int ERR_load_X509_strings(void); # define X509_F_X509_LOAD_CERT_CRL_FILE 132 # define X509_F_X509_LOAD_CERT_FILE 111 # define X509_F_X509_LOAD_CRL_FILE 112 +# define X509_F_X509_LOOKUP_METH_NEW 160 # define X509_F_X509_NAME_ADD_ENTRY 113 # define X509_F_X509_NAME_ENTRY_CREATE_BY_NID 114 # define X509_F_X509_NAME_ENTRY_CREATE_BY_TXT 131 @@ -1091,6 +1092,7 @@ int ERR_load_X509_strings(void); # define X509_R_CRL_ALREADY_DELTA 127 # define X509_R_CRL_VERIFY_FAILURE 131 # define X509_R_IDP_MISMATCH 128 +# define X509_R_INVALID_ATTRIBUTES 135 # define X509_R_INVALID_DIRECTORY 113 # define X509_R_INVALID_FIELD_NAME 119 # define X509_R_INVALID_TRUST 123 diff --git a/external/openssl/include/android/openssl/x509_vfy.h b/external/openssl/include/android/openssl/x509_vfy.h index cab8005e..131b6cf7 100644 --- a/external/openssl/include/android/openssl/x509_vfy.h +++ b/external/openssl/include/android/openssl/x509_vfy.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -257,7 +257,9 @@ X509_OBJECT *X509_OBJECT_new(void); void X509_OBJECT_free(X509_OBJECT *a); X509_LOOKUP_TYPE X509_OBJECT_get_type(const X509_OBJECT *a); X509 *X509_OBJECT_get0_X509(const X509_OBJECT *a); +int X509_OBJECT_set1_X509(X509_OBJECT *a, X509 *obj); X509_CRL *X509_OBJECT_get0_X509_CRL(X509_OBJECT *a); +int X509_OBJECT_set1_X509_CRL(X509_OBJECT *a, X509_CRL *obj); X509_STORE *X509_STORE_new(void); void X509_STORE_free(X509_STORE *v); int X509_STORE_lock(X509_STORE *ctx); @@ -364,6 +366,76 @@ X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m); X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void); X509_LOOKUP_METHOD *X509_LOOKUP_file(void); +typedef int (*X509_LOOKUP_ctrl_fn)(X509_LOOKUP *ctx, int cmd, const char *argc, + long argl, char **ret); +typedef int (*X509_LOOKUP_get_by_subject_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + X509_NAME *name, + X509_OBJECT *ret); +typedef int (*X509_LOOKUP_get_by_issuer_serial_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + X509_NAME *name, + ASN1_INTEGER *serial, + X509_OBJECT *ret); +typedef int (*X509_LOOKUP_get_by_fingerprint_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + const unsigned char* bytes, + int len, + X509_OBJECT *ret); +typedef int (*X509_LOOKUP_get_by_alias_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + const char *str, + int len, + X509_OBJECT *ret); + +X509_LOOKUP_METHOD *X509_LOOKUP_meth_new(const char *name); +void X509_LOOKUP_meth_free(X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_new_item(X509_LOOKUP_METHOD *method, + int (*new_item) (X509_LOOKUP *ctx)); +int (*X509_LOOKUP_meth_get_new_item(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_free(X509_LOOKUP_METHOD *method, + void (*free_fn) (X509_LOOKUP *ctx)); +void (*X509_LOOKUP_meth_get_free(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_init(X509_LOOKUP_METHOD *method, + int (*init) (X509_LOOKUP *ctx)); +int (*X509_LOOKUP_meth_get_init(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_shutdown(X509_LOOKUP_METHOD *method, + int (*shutdown) (X509_LOOKUP *ctx)); +int (*X509_LOOKUP_meth_get_shutdown(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_ctrl(X509_LOOKUP_METHOD *method, + X509_LOOKUP_ctrl_fn ctrl_fn); +X509_LOOKUP_ctrl_fn X509_LOOKUP_meth_get_ctrl(const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_subject(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_subject_fn fn); +X509_LOOKUP_get_by_subject_fn X509_LOOKUP_meth_get_get_by_subject( + const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_issuer_serial(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_issuer_serial_fn fn); +X509_LOOKUP_get_by_issuer_serial_fn X509_LOOKUP_meth_get_get_by_issuer_serial( + const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_fingerprint(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_fingerprint_fn fn); +X509_LOOKUP_get_by_fingerprint_fn X509_LOOKUP_meth_get_get_by_fingerprint( + const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_alias(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_alias_fn fn); +X509_LOOKUP_get_by_alias_fn X509_LOOKUP_meth_get_get_by_alias( + const X509_LOOKUP_METHOD *method); + + int X509_STORE_add_cert(X509_STORE *ctx, X509 *x); int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x); @@ -393,6 +465,9 @@ int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, X509_OBJECT *ret); int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, const char *str, int len, X509_OBJECT *ret); +int X509_LOOKUP_set_method_data(X509_LOOKUP *ctx, void *data); +void *X509_LOOKUP_get_method_data(const X509_LOOKUP *ctx); +X509_STORE *X509_LOOKUP_get_store(const X509_LOOKUP *ctx); int X509_LOOKUP_shutdown(X509_LOOKUP *ctx); int X509_STORE_load_locations(X509_STORE *ctx, @@ -458,18 +533,24 @@ int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose); int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust); void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth); void X509_VERIFY_PARAM_set_auth_level(X509_VERIFY_PARAM *param, int auth_level); +time_t X509_VERIFY_PARAM_get_time(const X509_VERIFY_PARAM *param); void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t); int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param, ASN1_OBJECT *policy); int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param, STACK_OF(ASN1_OBJECT) *policies); +int X509_VERIFY_PARAM_set_inh_flags(X509_VERIFY_PARAM *param, + uint32_t flags); +uint32_t X509_VERIFY_PARAM_get_inh_flags(const X509_VERIFY_PARAM *param); + int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param, const char *name, size_t namelen); int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param, const char *name, size_t namelen); void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param, unsigned int flags); +unsigned int X509_VERIFY_PARAM_get_hostflags(const X509_VERIFY_PARAM *param); char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *); void X509_VERIFY_PARAM_move_peername(X509_VERIFY_PARAM *, X509_VERIFY_PARAM *); int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param, diff --git a/external/openssl/include/android/openssl/x509v3.h b/external/openssl/include/android/openssl/x509v3.h index f21ce7c1..c93b112f 100644 --- a/external/openssl/include/android/openssl/x509v3.h +++ b/external/openssl/include/android/openssl/x509v3.h @@ -1,5 +1,5 @@ /* - * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -355,6 +355,7 @@ struct ISSUING_DIST_POINT_st { # define EXFLAG_SI 0x20 # define EXFLAG_V1 0x40 # define EXFLAG_INVALID 0x80 +/* EXFLAG_SET is set to indicate that some values have been precomputed */ # define EXFLAG_SET 0x100 # define EXFLAG_CRITICAL 0x200 # define EXFLAG_PROXY 0x400 @@ -657,6 +658,7 @@ uint32_t X509_get_extension_flags(X509 *x); uint32_t X509_get_key_usage(X509 *x); uint32_t X509_get_extended_key_usage(X509 *x); const ASN1_OCTET_STRING *X509_get0_subject_key_id(X509 *x); +const ASN1_OCTET_STRING *X509_get0_authority_key_id(X509 *x); int X509_PURPOSE_get_count(void); X509_PURPOSE *X509_PURPOSE_get0(int idx); @@ -875,6 +877,7 @@ int ERR_load_X509V3_strings(void); # define X509V3_F_ADDR_VALIDATE_PATH_INTERNAL 166 # define X509V3_F_ASIDENTIFIERCHOICE_CANONIZE 161 # define X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL 162 +# define X509V3_F_BIGNUM_TO_STRING 167 # define X509V3_F_COPY_EMAIL 122 # define X509V3_F_COPY_ISSUER 123 # define X509V3_F_DO_DIRNAME 144 diff --git a/external/openssl/include/ios/openssl/asn1.h b/external/openssl/include/ios/openssl/asn1.h index 7cf61161..d0b1099a 100644 --- a/external/openssl/include/ios/openssl/asn1.h +++ b/external/openssl/include/ios/openssl/asn1.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -625,8 +625,8 @@ ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t); ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day, long offset_sec); int ASN1_TIME_check(const ASN1_TIME *t); -ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME - **out); +ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *t, + ASN1_GENERALIZEDTIME **out); int ASN1_TIME_set_string(ASN1_TIME *s, const char *str); int i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a); @@ -946,14 +946,17 @@ int ERR_load_ASN1_strings(void); # define ASN1_F_C2I_ASN1_INTEGER 194 # define ASN1_F_C2I_ASN1_OBJECT 196 # define ASN1_F_C2I_IBUF 226 +# define ASN1_F_C2I_UINT64_INT 101 # define ASN1_F_COLLECT_DATA 140 # define ASN1_F_D2I_ASN1_OBJECT 147 # define ASN1_F_D2I_ASN1_UINTEGER 150 # define ASN1_F_D2I_AUTOPRIVATEKEY 207 # define ASN1_F_D2I_PRIVATEKEY 154 # define ASN1_F_D2I_PUBLICKEY 155 +# define ASN1_F_DO_BUF 142 # define ASN1_F_DO_TCREATE 222 # define ASN1_F_I2D_ASN1_BIO_STREAM 211 +# define ASN1_F_I2D_ASN1_OBJECT 143 # define ASN1_F_I2D_DSA_PUBKEY 161 # define ASN1_F_I2D_EC_PUBKEY 181 # define ASN1_F_I2D_PRIVATEKEY 163 @@ -971,6 +974,8 @@ int ERR_load_ASN1_strings(void); # define ASN1_F_SMIME_READ_ASN1 212 # define ASN1_F_SMIME_TEXT 213 # define ASN1_F_STBL_MODULE_INIT 223 +# define ASN1_F_UINT32_C2I 105 +# define ASN1_F_UINT64_C2I 112 # define ASN1_F_X509_CRL_ADD0_REVOKED 169 # define ASN1_F_X509_INFO_NEW 170 # define ASN1_F_X509_NAME_ENCODE 203 @@ -1048,6 +1053,7 @@ int ERR_load_ASN1_strings(void); # define ASN1_R_MSTRING_NOT_UNIVERSAL 139 # define ASN1_R_MSTRING_WRONG_TAG 140 # define ASN1_R_NESTED_ASN1_STRING 197 +# define ASN1_R_NESTED_TOO_DEEP 201 # define ASN1_R_NON_HEX_CHARACTERS 141 # define ASN1_R_NOT_ASCII_FORMAT 190 # define ASN1_R_NOT_ENOUGH_DATA 142 diff --git a/external/openssl/include/ios/openssl/asn1t.h b/external/openssl/include/ios/openssl/asn1t.h index 8eedfb3f..a5248293 100644 --- a/external/openssl/include/ios/openssl/asn1t.h +++ b/external/openssl/include/ios/openssl/asn1t.h @@ -346,17 +346,22 @@ extern "C" { /* OPTIONAL simple type */ # define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type) +# define ASN1_OPT_EMBED(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED, 0, stname, field, type) /* IMPLICIT tagged simple type */ # define ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0) +# define ASN1_IMP_EMBED(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_EMBED) /* IMPLICIT tagged OPTIONAL simple type */ # define ASN1_IMP_OPT(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) +# define ASN1_IMP_OPT_EMBED(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED) /* Same as above but EXPLICIT */ # define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0) +# define ASN1_EXP_EMBED(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_EMBED) # define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) +# define ASN1_EXP_OPT_EMBED(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED) /* SEQUENCE OF type */ # define ASN1_SEQUENCE_OF(stname, field, type) \ diff --git a/external/openssl/include/ios/openssl/bio.h b/external/openssl/include/ios/openssl/bio.h index 9bc941b2..3a728625 100644 --- a/external/openssl/include/ios/openssl/bio.h +++ b/external/openssl/include/ios/openssl/bio.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -20,11 +20,7 @@ # include # ifndef OPENSSL_NO_SCTP -# ifndef OPENSSL_SYS_VMS -# include -# else -# include -# endif +# include # endif #ifdef __cplusplus @@ -129,11 +125,10 @@ extern "C" { # define BIO_CTRL_DGRAM_GET_MTU_OVERHEAD 49 -# define BIO_CTRL_DGRAM_SET_PEEK_MODE 50 - +/* Deliberately outside of OPENSSL_NO_SCTP - used in bss_dgram.c */ +# define BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE 50 # ifndef OPENSSL_NO_SCTP /* SCTP stuff */ -# define BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE 50 # define BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY 51 # define BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY 52 # define BIO_CTRL_DGRAM_SCTP_AUTH_CCS_RCVD 53 @@ -146,6 +141,8 @@ extern "C" { # define BIO_CTRL_DGRAM_SCTP_SAVE_SHUTDOWN 70 # endif +# define BIO_CTRL_DGRAM_SET_PEEK_MODE 71 + /* modifiers */ # define BIO_FP_READ 0x02 # define BIO_FP_WRITE 0x04 @@ -170,7 +167,7 @@ extern "C" { /* * This is used with memory BIOs: * BIO_FLAGS_MEM_RDONLY means we shouldn't free up or change the data in any way; - * BIO_FLAGS_NONCLEAR_RST means we should't clear data on reset. + * BIO_FLAGS_NONCLEAR_RST means we shouldn't clear data on reset. */ # define BIO_FLAGS_MEM_RDONLY 0x200 # define BIO_FLAGS_NONCLEAR_RST 0x400 @@ -249,7 +246,8 @@ typedef struct bio_method_st BIO_METHOD; const char *BIO_method_name(const BIO *b); int BIO_method_type(const BIO *b); -typedef void bio_info_cb(BIO *, int, const char *, int, long, long); +typedef int BIO_info_cb(BIO *, int, int); +typedef BIO_info_cb bio_info_cb; /* backward compatibility */ DEFINE_STACK_OF(BIO) @@ -550,8 +548,7 @@ int BIO_write(BIO *b, const void *data, int len); int BIO_puts(BIO *bp, const char *buf); int BIO_indent(BIO *b, int indent, int max); long BIO_ctrl(BIO *bp, int cmd, long larg, void *parg); -long BIO_callback_ctrl(BIO *b, int cmd, - void (*fp) (BIO *, int, const char *, int, long, long)); +long BIO_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp); void *BIO_ptr_ctrl(BIO *bp, int cmd, long larg); long BIO_int_ctrl(BIO *bp, int cmd, long larg, int iarg); BIO *BIO_push(BIO *b, BIO *append); @@ -733,30 +730,30 @@ __bio_h__attr__((__format__(__printf__, 3, 0))); BIO_METHOD *BIO_meth_new(int type, const char *name); void BIO_meth_free(BIO_METHOD *biom); -int (*BIO_meth_get_write(BIO_METHOD *biom)) (BIO *, const char *, int); +int (*BIO_meth_get_write(const BIO_METHOD *biom)) (BIO *, const char *, int); int BIO_meth_set_write(BIO_METHOD *biom, int (*write) (BIO *, const char *, int)); -int (*BIO_meth_get_read(BIO_METHOD *biom)) (BIO *, char *, int); +int (*BIO_meth_get_read(const BIO_METHOD *biom)) (BIO *, char *, int); int BIO_meth_set_read(BIO_METHOD *biom, int (*read) (BIO *, char *, int)); -int (*BIO_meth_get_puts(BIO_METHOD *biom)) (BIO *, const char *); +int (*BIO_meth_get_puts(const BIO_METHOD *biom)) (BIO *, const char *); int BIO_meth_set_puts(BIO_METHOD *biom, int (*puts) (BIO *, const char *)); -int (*BIO_meth_get_gets(BIO_METHOD *biom)) (BIO *, char *, int); +int (*BIO_meth_get_gets(const BIO_METHOD *biom)) (BIO *, char *, int); int BIO_meth_set_gets(BIO_METHOD *biom, int (*gets) (BIO *, char *, int)); -long (*BIO_meth_get_ctrl(BIO_METHOD *biom)) (BIO *, int, long, void *); +long (*BIO_meth_get_ctrl(const BIO_METHOD *biom)) (BIO *, int, long, void *); int BIO_meth_set_ctrl(BIO_METHOD *biom, long (*ctrl) (BIO *, int, long, void *)); -int (*BIO_meth_get_create(BIO_METHOD *bion)) (BIO *); +int (*BIO_meth_get_create(const BIO_METHOD *bion)) (BIO *); int BIO_meth_set_create(BIO_METHOD *biom, int (*create) (BIO *)); -int (*BIO_meth_get_destroy(BIO_METHOD *biom)) (BIO *); +int (*BIO_meth_get_destroy(const BIO_METHOD *biom)) (BIO *); int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy) (BIO *)); -long (*BIO_meth_get_callback_ctrl(BIO_METHOD *biom)) - (BIO *, int, bio_info_cb *); +long (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom)) + (BIO *, int, BIO_info_cb *); int BIO_meth_set_callback_ctrl(BIO_METHOD *biom, long (*callback_ctrl) (BIO *, int, - bio_info_cb *)); + BIO_info_cb *)); /* BEGIN ERROR CODES */ /* @@ -784,6 +781,7 @@ int ERR_load_BIO_strings(void); # define BIO_F_BIO_LISTEN 139 # define BIO_F_BIO_LOOKUP 135 # define BIO_F_BIO_MAKE_PAIR 121 +# define BIO_F_BIO_METH_NEW 146 # define BIO_F_BIO_NEW 108 # define BIO_F_BIO_NEW_FILE 109 # define BIO_F_BIO_NEW_MEM_BUF 126 diff --git a/external/openssl/include/ios/openssl/bn.h b/external/openssl/include/ios/openssl/bn.h index 17bd5213..301edd52 100644 --- a/external/openssl/include/ios/openssl/bn.h +++ b/external/openssl/include/ios/openssl/bn.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -119,25 +119,76 @@ void *BN_GENCB_get_arg(BN_GENCB *cb); * on the size of the number */ /* - * number of Miller-Rabin iterations for an error rate of less than 2^-80 for - * random 'b'-bit input, b >= 100 (taken from table 4.4 in the Handbook of - * Applied Cryptography [Menezes, van Oorschot, Vanstone; CRC Press 1996]; - * original paper: Damgaard, Landrock, Pomerance: Average case error - * estimates for the strong probable prime test. -- Math. Comp. 61 (1993) - * 177-194) + * BN_prime_checks_for_size() returns the number of Miller-Rabin iterations + * that will be done for checking that a random number is probably prime. The + * error rate for accepting a composite number as prime depends on the size of + * the prime |b|. The error rates used are for calculating an RSA key with 2 primes, + * and so the level is what you would expect for a key of double the size of the + * prime. + * + * This table is generated using the algorithm of FIPS PUB 186-4 + * Digital Signature Standard (DSS), section F.1, page 117. + * (https://dx.doi.org/10.6028/NIST.FIPS.186-4) + * + * The following magma script was used to generate the output: + * securitybits:=125; + * k:=1024; + * for t:=1 to 65 do + * for M:=3 to Floor(2*Sqrt(k-1)-1) do + * S:=0; + * // Sum over m + * for m:=3 to M do + * s:=0; + * // Sum over j + * for j:=2 to m do + * s+:=(RealField(32)!2)^-(j+(k-1)/j); + * end for; + * S+:=2^(m-(m-1)*t)*s; + * end for; + * A:=2^(k-2-M*t); + * B:=8*(Pi(RealField(32))^2-6)/3*2^(k-2)*S; + * pkt:=2.00743*Log(2)*k*2^-k*(A+B); + * seclevel:=Floor(-Log(2,pkt)); + * if seclevel ge securitybits then + * printf "k: %5o, security: %o bits (t: %o, M: %o)\n",k,seclevel,t,M; + * break; + * end if; + * end for; + * if seclevel ge securitybits then break; end if; + * end for; + * + * It can be run online at: + * http://magma.maths.usyd.edu.au/calc + * + * And will output: + * k: 1024, security: 129 bits (t: 6, M: 23) + * + * k is the number of bits of the prime, securitybits is the level we want to + * reach. + * + * prime length | RSA key size | # MR tests | security level + * -------------+--------------|------------+--------------- + * (b) >= 6394 | >= 12788 | 3 | 256 bit + * (b) >= 3747 | >= 7494 | 3 | 192 bit + * (b) >= 1345 | >= 2690 | 4 | 128 bit + * (b) >= 1080 | >= 2160 | 5 | 128 bit + * (b) >= 852 | >= 1704 | 5 | 112 bit + * (b) >= 476 | >= 952 | 5 | 80 bit + * (b) >= 400 | >= 800 | 6 | 80 bit + * (b) >= 347 | >= 694 | 7 | 80 bit + * (b) >= 308 | >= 616 | 8 | 80 bit + * (b) >= 55 | >= 110 | 27 | 64 bit + * (b) >= 6 | >= 12 | 34 | 64 bit */ -# define BN_prime_checks_for_size(b) ((b) >= 1300 ? 2 : \ - (b) >= 850 ? 3 : \ - (b) >= 650 ? 4 : \ - (b) >= 550 ? 5 : \ - (b) >= 450 ? 6 : \ - (b) >= 400 ? 7 : \ - (b) >= 350 ? 8 : \ - (b) >= 300 ? 9 : \ - (b) >= 250 ? 12 : \ - (b) >= 200 ? 15 : \ - (b) >= 150 ? 18 : \ - /* b >= 100 */ 27) + +# define BN_prime_checks_for_size(b) ((b) >= 3747 ? 3 : \ + (b) >= 1345 ? 4 : \ + (b) >= 476 ? 5 : \ + (b) >= 400 ? 6 : \ + (b) >= 347 ? 7 : \ + (b) >= 308 ? 8 : \ + (b) >= 55 ? 27 : \ + /* b >= 6 */ 34) # define BN_num_bytes(a) ((BN_num_bits(a)+7)/8) @@ -196,7 +247,7 @@ int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx); */ void BN_set_negative(BIGNUM *b, int n); /** BN_is_negative returns 1 if the BIGNUM is negative - * \param a pointer to the BIGNUM object + * \param b pointer to the BIGNUM object * \return 1 if a < 0 and 0 otherwise */ int BN_is_negative(const BIGNUM *b); diff --git a/external/openssl/include/ios/openssl/buffer.h b/external/openssl/include/ios/openssl/buffer.h index 91f0e07f..35160b4f 100644 --- a/external/openssl/include/ios/openssl/buffer.h +++ b/external/openssl/include/ios/openssl/buffer.h @@ -21,10 +21,7 @@ extern "C" { #endif # include - -# if !defined(NO_SYS_TYPES_H) -# include -# endif +# include /* * These names are outdated as of OpenSSL 1.1; a future release diff --git a/external/openssl/include/ios/openssl/conf.h b/external/openssl/include/ios/openssl/conf.h index 462e3c9d..e0539e31 100644 --- a/external/openssl/include/ios/openssl/conf.h +++ b/external/openssl/include/ios/openssl/conf.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -191,6 +191,7 @@ int ERR_load_CONF_strings(void); # define CONF_F_NCONF_LOAD_BIO 110 # define CONF_F_NCONF_LOAD_FP 114 # define CONF_F_NCONF_NEW 111 +# define CONF_F_SSL_MODULE_INIT 123 # define CONF_F_STR_COPY 101 /* Reason codes. */ @@ -206,8 +207,13 @@ int ERR_load_CONF_strings(void); # define CONF_R_NO_SECTION 107 # define CONF_R_NO_SUCH_FILE 114 # define CONF_R_NO_VALUE 108 +# define CONF_R_SSL_COMMAND_SECTION_EMPTY 117 +# define CONF_R_SSL_COMMAND_SECTION_NOT_FOUND 118 +# define CONF_R_SSL_SECTION_EMPTY 119 +# define CONF_R_SSL_SECTION_NOT_FOUND 120 # define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103 # define CONF_R_UNKNOWN_MODULE_NAME 113 +# define CONF_R_VARIABLE_EXPANSION_TOO_LONG 116 # define CONF_R_VARIABLE_HAS_NO_VALUE 104 # ifdef __cplusplus diff --git a/external/openssl/include/ios/openssl/crypto.h b/external/openssl/include/ios/openssl/crypto.h index bd0b1408..fa3f12af 100644 --- a/external/openssl/include/ios/openssl/crypto.h +++ b/external/openssl/include/ios/openssl/crypto.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -146,6 +146,8 @@ int CRYPTO_mem_ctrl(int mode); CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE) # define OPENSSL_secure_free(addr) \ CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE) +# define OPENSSL_secure_clear_free(addr, num) \ + CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE) # define OPENSSL_secure_actual_size(ptr) \ CRYPTO_secure_actual_size(ptr) @@ -174,7 +176,7 @@ typedef void CRYPTO_EX_new (void *parent, void *ptr, CRYPTO_EX_DATA *ad, typedef void CRYPTO_EX_free (void *parent, void *ptr, CRYPTO_EX_DATA *ad, int idx, long argl, void *argp); typedef int CRYPTO_EX_dup (CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from, - void *srcp, int idx, long argl, void *argp); + void *from_d, int idx, long argl, void *argp); __owur int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); @@ -285,6 +287,8 @@ int CRYPTO_secure_malloc_done(void); void *CRYPTO_secure_malloc(size_t num, const char *file, int line); void *CRYPTO_secure_zalloc(size_t num, const char *file, int line); void CRYPTO_secure_free(void *ptr, const char *file, int line); +void CRYPTO_secure_clear_free(void *ptr, size_t num, + const char *file, int line); int CRYPTO_secure_allocated(const void *ptr); int CRYPTO_secure_malloc_initialized(void); size_t CRYPTO_secure_actual_size(void *ptr); @@ -367,7 +371,9 @@ int CRYPTO_memcmp(const volatile void * volatile in_a, # define OPENSSL_INIT_ENGINE_CAPI 0x00002000L # define OPENSSL_INIT_ENGINE_PADLOCK 0x00004000L # define OPENSSL_INIT_ENGINE_AFALG 0x00008000L -/* OPENSSL_INIT flag 0x00010000 reserved for internal use */ +/* OPENSSL_INIT_ZLIB 0x00010000L */ +/* currently unused 0x00020000L */ +/* OPENSSL_INIT_BASE_ONLY 0x00040000L */ /* OPENSSL_INIT flag range 0xfff00000 reserved for OPENSSL_init_ssl() */ /* Max OPENSSL_INIT flag value is 0x80000000 */ diff --git a/external/openssl/include/ios/openssl/ct.h b/external/openssl/include/ios/openssl/ct.h index 6c632652..bf29fbab 100644 --- a/external/openssl/include/ios/openssl/ct.h +++ b/external/openssl/include/ios/openssl/ct.h @@ -98,6 +98,21 @@ const CTLOG_STORE *CT_POLICY_EVAL_CTX_get0_log_store(const CT_POLICY_EVAL_CTX *c void CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE(CT_POLICY_EVAL_CTX *ctx, CTLOG_STORE *log_store); +/* + * Gets the time, in milliseconds since the Unix epoch, that will be used as the + * current time when checking whether an SCT was issued in the future. + * Such SCTs will fail validation, as required by RFC6962. + */ +uint64_t CT_POLICY_EVAL_CTX_get_time(const CT_POLICY_EVAL_CTX *ctx); + +/* + * Sets the time to evaluate SCTs against, in milliseconds since the Unix epoch. + * If an SCT's timestamp is after this time, it will be interpreted as having + * been issued in the future. RFC6962 states that "TLS clients MUST reject SCTs + * whose timestamp is in the future", so an SCT will not validate in this case. + */ +void CT_POLICY_EVAL_CTX_set_time(CT_POLICY_EVAL_CTX *ctx, uint64_t time_in_ms); + /***************** * SCT functions * *****************/ @@ -467,7 +482,6 @@ int ERR_load_CT_strings(void); # define CT_F_CTLOG_NEW 117 # define CT_F_CTLOG_NEW_FROM_BASE64 118 # define CT_F_CTLOG_NEW_FROM_CONF 119 -# define CT_F_CTLOG_NEW_NULL 120 # define CT_F_CTLOG_STORE_LOAD_CTX_NEW 122 # define CT_F_CTLOG_STORE_LOAD_FILE 123 # define CT_F_CTLOG_STORE_LOAD_LOG 130 @@ -482,6 +496,7 @@ int ERR_load_CT_strings(void); # define CT_F_O2I_SCT_LIST 111 # define CT_F_O2I_SCT_SIGNATURE 112 # define CT_F_SCT_CTX_NEW 126 +# define CT_F_SCT_CTX_VERIFY 128 # define CT_F_SCT_NEW 100 # define CT_F_SCT_NEW_FROM_BASE64 127 # define CT_F_SCT_SET0_LOG_ID 101 @@ -491,7 +506,6 @@ int ERR_load_CT_strings(void); # define CT_F_SCT_SET_LOG_ENTRY_TYPE 102 # define CT_F_SCT_SET_SIGNATURE_NID 103 # define CT_F_SCT_SET_VERSION 104 -# define CT_F_SCT_CTX_VERIFY 128 /* Reason codes. */ # define CT_R_BASE64_DECODE_ERROR 108 @@ -501,6 +515,7 @@ int ERR_load_CT_strings(void); # define CT_R_LOG_CONF_MISSING_DESCRIPTION 111 # define CT_R_LOG_CONF_MISSING_KEY 112 # define CT_R_LOG_KEY_INVALID 113 +# define CT_R_SCT_FUTURE_TIMESTAMP 116 # define CT_R_SCT_INVALID 104 # define CT_R_SCT_INVALID_SIGNATURE 107 # define CT_R_SCT_LIST_INVALID 105 diff --git a/external/openssl/include/ios/openssl/dh.h b/external/openssl/include/ios/openssl/dh.h index ae309e7b..8cf879e1 100644 --- a/external/openssl/include/ios/openssl/dh.h +++ b/external/openssl/include/ios/openssl/dh.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -87,12 +87,29 @@ DECLARE_ASN1_ITEM(DHparams) */ # define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME -# define d2i_DHparams_fp(fp,x) (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ - (char *(*)())d2i_DHparams,(fp),(unsigned char **)(x)) -# define i2d_DHparams_fp(fp,x) ASN1_i2d_fp(i2d_DHparams,(fp), \ - (unsigned char *)(x)) -# define d2i_DHparams_bio(bp,x) ASN1_d2i_bio_of(DH,DH_new,d2i_DHparams,bp,x) -# define i2d_DHparams_bio(bp,x) ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x) +# define d2i_DHparams_fp(fp,x) \ + (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ + (char *(*)())d2i_DHparams, \ + (fp), \ + (unsigned char **)(x)) +# define i2d_DHparams_fp(fp,x) \ + ASN1_i2d_fp(i2d_DHparams,(fp), (unsigned char *)(x)) +# define d2i_DHparams_bio(bp,x) \ + ASN1_d2i_bio_of(DH, DH_new, d2i_DHparams, bp, x) +# define i2d_DHparams_bio(bp,x) \ + ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x) + +# define d2i_DHxparams_fp(fp,x) \ + (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ + (char *(*)())d2i_DHxparams, \ + (fp), \ + (unsigned char **)(x)) +# define i2d_DHxparams_fp(fp,x) \ + ASN1_i2d_fp(i2d_DHxparams,(fp), (unsigned char *)(x)) +# define d2i_DHxparams_bio(bp,x) \ + ASN1_d2i_bio_of(DH, DH_new, d2i_DHxparams, bp, x) +# define i2d_DHxparams_bio(bp,x) \ + ASN1_i2d_bio_of_const(DH, i2d_DHxparams, bp, x) DH *DHparams_dup(DH *); @@ -124,6 +141,7 @@ DEPRECATEDIN_0_9_8(DH *DH_generate_parameters(int prime_len, int generator, int DH_generate_parameters_ex(DH *dh, int prime_len, int generator, BN_GENCB *cb); +int DH_check_params(const DH *dh, int *ret); int DH_check(const DH *dh, int *codes); int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *codes); int DH_generate_key(DH *dh); @@ -169,7 +187,7 @@ void DH_meth_free(DH_METHOD *dhm); DH_METHOD *DH_meth_dup(const DH_METHOD *dhm); const char *DH_meth_get0_name(const DH_METHOD *dhm); int DH_meth_set1_name(DH_METHOD *dhm, const char *name); -int DH_meth_get_flags(DH_METHOD *dhm); +int DH_meth_get_flags(const DH_METHOD *dhm); int DH_meth_set_flags(DH_METHOD *dhm, int flags); void *DH_meth_get0_app_data(const DH_METHOD *dhm); int DH_meth_set0_app_data(DH_METHOD *dhm, void *app_data); diff --git a/external/openssl/include/ios/openssl/dsa.h b/external/openssl/include/ios/openssl/dsa.h index cb5fbc2f..3a7b1a62 100644 --- a/external/openssl/include/ios/openssl/dsa.h +++ b/external/openssl/include/ios/openssl/dsa.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -146,10 +146,12 @@ int DSAparams_print_fp(FILE *fp, const DSA *x); int DSA_print_fp(FILE *bp, const DSA *x, int off); # endif -# define DSS_prime_checks 50 +# define DSS_prime_checks 64 /* - * Primality test according to FIPS PUB 186[-1], Appendix 2.1: 50 rounds of - * Rabin-Miller + * Primality test according to FIPS PUB 186-4, Appendix C.3. Since we only + * have one value here we set the number of checks to 64 which is the 128 bit + * security level that is the highest level and valid for creating a 3072 bit + * DSA key. */ # define DSA_is_prime(n, callback, cb_arg) \ BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg) @@ -186,7 +188,7 @@ void DSA_meth_free(DSA_METHOD *dsam); DSA_METHOD *DSA_meth_dup(const DSA_METHOD *dsam); const char *DSA_meth_get0_name(const DSA_METHOD *dsam); int DSA_meth_set1_name(DSA_METHOD *dsam, const char *name); -int DSA_meth_get_flags(DSA_METHOD *dsam); +int DSA_meth_get_flags(const DSA_METHOD *dsam); int DSA_meth_set_flags(DSA_METHOD *dsam, int flags); void *DSA_meth_get0_app_data(const DSA_METHOD *dsam); int DSA_meth_set0_app_data(DSA_METHOD *dsam, void *app_data); @@ -260,6 +262,7 @@ int ERR_load_DSA_strings(void); # define DSA_F_DSA_SIG_NEW 102 # define DSA_F_OLD_DSA_PRIV_DECODE 122 # define DSA_F_PKEY_DSA_CTRL 120 +# define DSA_F_PKEY_DSA_CTRL_STR 104 # define DSA_F_PKEY_DSA_KEYGEN 121 /* Reason codes. */ @@ -274,6 +277,7 @@ int ERR_load_DSA_strings(void); # define DSA_R_NO_PARAMETERS_SET 107 # define DSA_R_PARAMETER_ENCODING_ERROR 105 # define DSA_R_Q_NOT_PRIME 113 +# define DSA_R_SEED_LEN_SMALL 110 # ifdef __cplusplus } diff --git a/external/openssl/include/ios/openssl/e_os2.h b/external/openssl/include/ios/openssl/e_os2.h index 99ea3477..9800e154 100644 --- a/external/openssl/include/ios/openssl/e_os2.h +++ b/external/openssl/include/ios/openssl/e_os2.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -49,7 +49,6 @@ extern "C" { # define OPENSSL_SYS_WIN32_UWIN # else # if defined(__CYGWIN__) || defined(OPENSSL_SYS_CYGWIN) -# undef OPENSSL_SYS_UNIX # define OPENSSL_SYS_WIN32_CYGWIN # else # if defined(_WIN32) || defined(OPENSSL_SYS_WIN32) @@ -212,9 +211,9 @@ extern "C" { # endif # endif -# if defined(OPENSSL_SYS_UEFI) && !defined(ssize_t) -# define ossl_ssize_t int -# define OSSL_SSIZE_MAX INT_MAX +# if defined(OPENSSL_SYS_UEFI) && !defined(ossl_ssize_t) +# define ossl_ssize_t INTN +# define OSSL_SSIZE_MAX MAX_INTN # endif # ifndef ossl_ssize_t @@ -242,7 +241,6 @@ typedef INT32 int32_t; typedef UINT32 uint32_t; typedef INT64 int64_t; typedef UINT64 uint64_t; -# define PRIu64 "%Lu" # elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ defined(__osf__) || defined(__sgi) || defined(__hpux) || \ defined(OPENSSL_SYS_VMS) || defined (__OpenBSD__) @@ -264,18 +262,6 @@ typedef unsigned __int64 uint64_t; # include # endif -/* - * We need a format operator for some client tools for uint64_t. If inttypes.h - * isn't available or did not define it, just go with hard-coded. - */ -# ifndef PRIu64 -# ifdef SIXTY_FOUR_BIT_LONG -# define PRIu64 "lu" -# else -# define PRIu64 "llu" -# endif -# endif - /* ossl_inline: portable inline definition usable in public headers */ # if !defined(inline) && !defined(__cplusplus) # if defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L diff --git a/external/openssl/include/ios/openssl/ec.h b/external/openssl/include/ios/openssl/ec.h index 656cb410..c4aeaed5 100644 --- a/external/openssl/include/ios/openssl/ec.h +++ b/external/openssl/include/ios/openssl/ec.h @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2002-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -573,11 +573,9 @@ int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p, * \param point EC_POINT object * \param form point conversion form * \param pbuf returns pointer to allocated buffer - * \param len length of the memory buffer * \param ctx BN_CTX object (optional) * \return the length of the encoded octet string or 0 if an error occurred */ - size_t EC_POINT_point2buf(const EC_GROUP *group, const EC_POINT *point, point_conversion_form_t form, unsigned char **pbuf, BN_CTX *ctx); @@ -863,7 +861,7 @@ int EC_KEY_generate_key(EC_KEY *key); int EC_KEY_check_key(const EC_KEY *key); /** Indicates if an EC_KEY can be used for signing. - * \param key the EC_KEY object + * \param eckey the EC_KEY object * \return 1 if can can sign and 0 otherwise. */ int EC_KEY_can_sign(const EC_KEY *eckey); @@ -882,11 +880,9 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, * \param key key to encode * \param form point conversion form * \param pbuf returns pointer to allocated buffer - * \param len length of the memory buffer * \param ctx BN_CTX object (optional) * \return the length of the encoded octet string or 0 if an error occurred */ - size_t EC_KEY_key2buf(const EC_KEY *key, point_conversion_form_t form, unsigned char **pbuf, BN_CTX *ctx); @@ -921,11 +917,10 @@ int EC_KEY_oct2priv(EC_KEY *key, const unsigned char *buf, size_t len); size_t EC_KEY_priv2oct(const EC_KEY *key, unsigned char *buf, size_t len); /** Encodes an EC_KEY private key to an allocated octet string - * \param key key to encode + * \param eckey key to encode * \param pbuf returns pointer to allocated buffer * \return the length of the encoded octet string or 0 if an error occurred */ - size_t EC_KEY_priv2buf(const EC_KEY *eckey, unsigned char **pbuf); /********************************************************************/ @@ -1228,7 +1223,7 @@ void EC_KEY_METHOD_set_verify(EC_KEY_METHOD *meth, const ECDSA_SIG *sig, EC_KEY *eckey)); -void EC_KEY_METHOD_get_init(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_init(const EC_KEY_METHOD *meth, int (**pinit)(EC_KEY *key), void (**pfinish)(EC_KEY *key), int (**pcopy)(EC_KEY *dest, const EC_KEY *src), @@ -1239,16 +1234,16 @@ void EC_KEY_METHOD_get_init(EC_KEY_METHOD *meth, int (**pset_public)(EC_KEY *key, const EC_POINT *pub_key)); -void EC_KEY_METHOD_get_keygen(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_keygen(const EC_KEY_METHOD *meth, int (**pkeygen)(EC_KEY *key)); -void EC_KEY_METHOD_get_compute_key(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_compute_key(const EC_KEY_METHOD *meth, int (**pck)(unsigned char **psec, size_t *pseclen, const EC_POINT *pub_key, const EC_KEY *ecdh)); -void EC_KEY_METHOD_get_sign(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_sign(const EC_KEY_METHOD *meth, int (**psign)(int type, const unsigned char *dgst, int dlen, unsigned char *sig, unsigned int *siglen, @@ -1262,7 +1257,7 @@ void EC_KEY_METHOD_get_sign(EC_KEY_METHOD *meth, const BIGNUM *in_r, EC_KEY *eckey)); -void EC_KEY_METHOD_get_verify(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_verify(const EC_KEY_METHOD *meth, int (**pverify)(int type, const unsigned char *dgst, int dgst_len, const unsigned char *sigbuf, @@ -1404,6 +1399,7 @@ int ERR_load_EC_strings(void); # define EC_F_EC_ASN1_GROUP2CURVE 153 # define EC_F_EC_ASN1_GROUP2FIELDID 154 # define EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY 208 +# define EC_F_EC_GF2M_SIMPLE_FIELD_INV 296 # define EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT 159 # define EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE 195 # define EC_F_EC_GF2M_SIMPLE_OCT2POINT 160 @@ -1413,6 +1409,7 @@ int ERR_load_EC_strings(void); # define EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES 164 # define EC_F_EC_GFP_MONT_FIELD_DECODE 133 # define EC_F_EC_GFP_MONT_FIELD_ENCODE 134 +# define EC_F_EC_GFP_MONT_FIELD_INV 297 # define EC_F_EC_GFP_MONT_FIELD_MUL 131 # define EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE 209 # define EC_F_EC_GFP_MONT_FIELD_SQR 132 @@ -1429,6 +1426,8 @@ int ERR_load_EC_strings(void); # define EC_F_EC_GFP_NIST_FIELD_MUL 200 # define EC_F_EC_GFP_NIST_FIELD_SQR 201 # define EC_F_EC_GFP_NIST_GROUP_SET_CURVE 202 +# define EC_F_EC_GFP_SIMPLE_BLIND_COORDINATES 287 +# define EC_F_EC_GFP_SIMPLE_FIELD_INV 298 # define EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT 165 # define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE 166 # define EC_F_EC_GFP_SIMPLE_MAKE_AFFINE 102 @@ -1518,6 +1517,7 @@ int ERR_load_EC_strings(void); # define EC_R_BAD_SIGNATURE 156 # define EC_R_BIGNUM_OUT_OF_RANGE 144 # define EC_R_BUFFER_TOO_SMALL 100 +# define EC_R_CANNOT_INVERT 165 # define EC_R_COORDINATES_OUT_OF_RANGE 146 # define EC_R_CURVE_DOES_NOT_SUPPORT_ECDH 160 # define EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING 159 @@ -1568,6 +1568,7 @@ int ERR_load_EC_strings(void); # define EC_R_SLOT_FULL 108 # define EC_R_UNDEFINED_GENERATOR 113 # define EC_R_UNDEFINED_ORDER 128 +# define EC_R_UNKNOWN_COFACTOR 164 # define EC_R_UNKNOWN_GROUP 129 # define EC_R_UNKNOWN_ORDER 114 # define EC_R_UNSUPPORTED_FIELD 131 diff --git a/external/openssl/include/ios/openssl/engine.h b/external/openssl/include/ios/openssl/engine.h index 319371e4..26cf7148 100644 --- a/external/openssl/include/ios/openssl/engine.h +++ b/external/openssl/include/ios/openssl/engine.h @@ -334,8 +334,6 @@ ENGINE *ENGINE_by_id(const char *id); OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_PADLOCK, NULL) # define ENGINE_load_capi() \ OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_CAPI, NULL) -# define ENGINE_load_dasync() \ - OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_DASYNC, NULL) # define ENGINE_load_afalg() \ OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_AFALG, NULL) # endif diff --git a/external/openssl/include/ios/openssl/err.h b/external/openssl/include/ios/openssl/err.h index f9390919..ba40f79b 100644 --- a/external/openssl/include/ios/openssl/err.h +++ b/external/openssl/include/ios/openssl/err.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -37,6 +37,7 @@ extern "C" { # define ERR_TXT_STRING 0x02 # define ERR_FLAG_MARK 0x01 +# define ERR_FLAG_CLEAR 0x02 # define ERR_NUM_ERRORS 16 typedef struct err_state_st { @@ -89,7 +90,7 @@ typedef struct err_state_st { # define ERR_LIB_CMS 46 # define ERR_LIB_TS 47 # define ERR_LIB_HMAC 48 -# define ERR_LIB_JPAKE 49 +/* # define ERR_LIB_JPAKE 49 */ # define ERR_LIB_CT 50 # define ERR_LIB_ASYNC 51 # define ERR_LIB_KDF 52 @@ -128,7 +129,6 @@ typedef struct err_state_st { # define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define TSerr(f,r) ERR_PUT_error(ERR_LIB_TS,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define HMACerr(f,r) ERR_PUT_error(ERR_LIB_HMAC,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define JPAKEerr(f,r) ERR_PUT_error(ERR_LIB_JPAKE,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define CTerr(f,r) ERR_PUT_error(ERR_LIB_CT,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define ASYNCerr(f,r) ERR_PUT_error(ERR_LIB_ASYNC,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define KDFerr(f,r) ERR_PUT_error(ERR_LIB_KDF,(f),(r),OPENSSL_FILE,OPENSSL_LINE) @@ -140,6 +140,7 @@ typedef struct err_state_st { # define ERR_GET_LIB(l) (int)(((l) >> 24L) & 0x0FFL) # define ERR_GET_FUNC(l) (int)(((l) >> 12L) & 0xFFFL) # define ERR_GET_REASON(l) (int)( (l) & 0xFFFL) +# define ERR_FATAL_ERROR(l) (int)( (l) & ERR_R_FATAL) /* OS functions */ # define SYS_F_FOPEN 1 @@ -159,6 +160,7 @@ typedef struct err_state_st { # define SYS_F_GETSOCKOPT 15 # define SYS_F_GETSOCKNAME 16 # define SYS_F_GETHOSTBYNAME 17 +# define SYS_F_FFLUSH 18 /* reasons */ # define ERR_R_SYS_LIB ERR_LIB_SYS/* 2 */ diff --git a/external/openssl/include/ios/openssl/evp.h b/external/openssl/include/ios/openssl/evp.h index b9c83b2b..36e29344 100644 --- a/external/openssl/include/ios/openssl/evp.h +++ b/external/openssl/include/ios/openssl/evp.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -900,6 +900,9 @@ int EVP_PKEY_security_bits(const EVP_PKEY *pkey); int EVP_PKEY_size(EVP_PKEY *pkey); int EVP_PKEY_set_type(EVP_PKEY *pkey, int type); int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len); +# ifndef OPENSSL_NO_ENGINE +int EVP_PKEY_set1_engine(EVP_PKEY *pkey, ENGINE *e); +# endif int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key); void *EVP_PKEY_get0(const EVP_PKEY *pkey); const unsigned char *EVP_PKEY_get0_hmac(const EVP_PKEY *pkey, size_t *len); @@ -1348,34 +1351,34 @@ void EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth, const char *type, const char *value)); -void EVP_PKEY_meth_get_init(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_init(const EVP_PKEY_METHOD *pmeth, int (**pinit) (EVP_PKEY_CTX *ctx)); -void EVP_PKEY_meth_get_copy(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_copy(const EVP_PKEY_METHOD *pmeth, int (**pcopy) (EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src)); -void EVP_PKEY_meth_get_cleanup(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_cleanup(const EVP_PKEY_METHOD *pmeth, void (**pcleanup) (EVP_PKEY_CTX *ctx)); -void EVP_PKEY_meth_get_paramgen(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_paramgen(const EVP_PKEY_METHOD *pmeth, int (**pparamgen_init) (EVP_PKEY_CTX *ctx), int (**pparamgen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)); -void EVP_PKEY_meth_get_keygen(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_keygen(const EVP_PKEY_METHOD *pmeth, int (**pkeygen_init) (EVP_PKEY_CTX *ctx), int (**pkeygen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)); -void EVP_PKEY_meth_get_sign(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_sign(const EVP_PKEY_METHOD *pmeth, int (**psign_init) (EVP_PKEY_CTX *ctx), int (**psign) (EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, const unsigned char *tbs, size_t tbslen)); -void EVP_PKEY_meth_get_verify(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_verify(const EVP_PKEY_METHOD *pmeth, int (**pverify_init) (EVP_PKEY_CTX *ctx), int (**pverify) (EVP_PKEY_CTX *ctx, const unsigned char *sig, @@ -1383,7 +1386,7 @@ void EVP_PKEY_meth_get_verify(EVP_PKEY_METHOD *pmeth, const unsigned char *tbs, size_t tbslen)); -void EVP_PKEY_meth_get_verify_recover(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_verify_recover(const EVP_PKEY_METHOD *pmeth, int (**pverify_recover_init) (EVP_PKEY_CTX *ctx), int (**pverify_recover) (EVP_PKEY_CTX @@ -1395,7 +1398,7 @@ void EVP_PKEY_meth_get_verify_recover(EVP_PKEY_METHOD *pmeth, char *tbs, size_t tbslen)); -void EVP_PKEY_meth_get_signctx(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_signctx(const EVP_PKEY_METHOD *pmeth, int (**psignctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx), int (**psignctx) (EVP_PKEY_CTX *ctx, @@ -1403,7 +1406,7 @@ void EVP_PKEY_meth_get_signctx(EVP_PKEY_METHOD *pmeth, size_t *siglen, EVP_MD_CTX *mctx)); -void EVP_PKEY_meth_get_verifyctx(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_verifyctx(const EVP_PKEY_METHOD *pmeth, int (**pverifyctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx), int (**pverifyctx) (EVP_PKEY_CTX *ctx, @@ -1411,7 +1414,7 @@ void EVP_PKEY_meth_get_verifyctx(EVP_PKEY_METHOD *pmeth, int siglen, EVP_MD_CTX *mctx)); -void EVP_PKEY_meth_get_encrypt(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_encrypt(const EVP_PKEY_METHOD *pmeth, int (**pencrypt_init) (EVP_PKEY_CTX *ctx), int (**pencryptfn) (EVP_PKEY_CTX *ctx, unsigned char *out, @@ -1419,7 +1422,7 @@ void EVP_PKEY_meth_get_encrypt(EVP_PKEY_METHOD *pmeth, const unsigned char *in, size_t inlen)); -void EVP_PKEY_meth_get_decrypt(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_decrypt(const EVP_PKEY_METHOD *pmeth, int (**pdecrypt_init) (EVP_PKEY_CTX *ctx), int (**pdecrypt) (EVP_PKEY_CTX *ctx, unsigned char *out, @@ -1427,13 +1430,13 @@ void EVP_PKEY_meth_get_decrypt(EVP_PKEY_METHOD *pmeth, const unsigned char *in, size_t inlen)); -void EVP_PKEY_meth_get_derive(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_derive(const EVP_PKEY_METHOD *pmeth, int (**pderive_init) (EVP_PKEY_CTX *ctx), int (**pderive) (EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen)); -void EVP_PKEY_meth_get_ctrl(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_ctrl(const EVP_PKEY_METHOD *pmeth, int (**pctrl) (EVP_PKEY_CTX *ctx, int type, int p1, void *p2), int (**pctrl_str) (EVP_PKEY_CTX *ctx, @@ -1455,11 +1458,14 @@ int ERR_load_EVP_strings(void); /* Function codes. */ # define EVP_F_AESNI_INIT_KEY 165 # define EVP_F_AES_INIT_KEY 133 +# define EVP_F_AES_OCB_CIPHER 169 # define EVP_F_AES_T4_INIT_KEY 178 +# define EVP_F_AES_WRAP_CIPHER 170 # define EVP_F_ALG_MODULE_INIT 177 # define EVP_F_CAMELLIA_INIT_KEY 159 # define EVP_F_CHACHA20_POLY1305_CTRL 182 # define EVP_F_CMLL_T4_INIT_KEY 179 +# define EVP_F_DES_EDE3_WRAP_CIPHER 171 # define EVP_F_DO_SIGVER_INIT 161 # define EVP_F_EVP_CIPHERINIT_EX 123 # define EVP_F_EVP_CIPHER_CTX_COPY 163 @@ -1479,6 +1485,7 @@ int ERR_load_EVP_strings(void); # define EVP_F_EVP_PBE_SCRYPT 181 # define EVP_F_EVP_PKCS82PKEY 111 # define EVP_F_EVP_PKEY2PKCS8 113 +# define EVP_F_EVP_PKEY_ASN1_ADD0 168 # define EVP_F_EVP_PKEY_COPY_PARAMETERS 103 # define EVP_F_EVP_PKEY_CTX_CTRL 137 # define EVP_F_EVP_PKEY_CTX_CTRL_STR 150 @@ -1499,9 +1506,12 @@ int ERR_load_EVP_strings(void); # define EVP_F_EVP_PKEY_GET0_RSA 121 # define EVP_F_EVP_PKEY_KEYGEN 146 # define EVP_F_EVP_PKEY_KEYGEN_INIT 147 +# define EVP_F_EVP_PKEY_METH_ADD0 172 +# define EVP_F_EVP_PKEY_METH_NEW 173 # define EVP_F_EVP_PKEY_NEW 106 # define EVP_F_EVP_PKEY_PARAMGEN 148 # define EVP_F_EVP_PKEY_PARAMGEN_INIT 149 +# define EVP_F_EVP_PKEY_SET1_ENGINE 187 # define EVP_F_EVP_PKEY_SIGN 140 # define EVP_F_EVP_PKEY_SIGN_INIT 141 # define EVP_F_EVP_PKEY_VERIFY 142 @@ -1546,6 +1556,7 @@ int ERR_load_EVP_strings(void); # define EVP_R_INPUT_NOT_INITIALIZED 111 # define EVP_R_INVALID_DIGEST 152 # define EVP_R_INVALID_FIPS_MODE 168 +# define EVP_R_INVALID_KEY 163 # define EVP_R_INVALID_KEY_LENGTH 130 # define EVP_R_INVALID_OPERATION 148 # define EVP_R_KEYGEN_FAILURE 120 @@ -1561,6 +1572,9 @@ int ERR_load_EVP_strings(void); # define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 150 # define EVP_R_OPERATON_NOT_INITIALIZED 151 # define EVP_R_PARTIALLY_OVERLAPPING 162 +# define EVP_R_PBKDF2_ERROR 176 +# define EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED 175 +# define EVP_R_PKEY_ASN1_METHOD_ALREADY_REGISTERED 164 # define EVP_R_PRIVATE_KEY_DECODE_ERROR 145 # define EVP_R_PRIVATE_KEY_ENCODE_ERROR 146 # define EVP_R_PUBLIC_KEY_NOT_RSA 106 @@ -1568,12 +1582,12 @@ int ERR_load_EVP_strings(void); # define EVP_R_UNKNOWN_DIGEST 161 # define EVP_R_UNKNOWN_OPTION 169 # define EVP_R_UNKNOWN_PBE_ALGORITHM 121 -# define EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS 135 # define EVP_R_UNSUPPORTED_ALGORITHM 156 # define EVP_R_UNSUPPORTED_CIPHER 107 # define EVP_R_UNSUPPORTED_KEYLENGTH 123 # define EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 124 # define EVP_R_UNSUPPORTED_KEY_SIZE 108 +# define EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS 135 # define EVP_R_UNSUPPORTED_PRF 125 # define EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM 118 # define EVP_R_UNSUPPORTED_SALT_TYPE 126 diff --git a/external/openssl/include/ios/openssl/lhash.h b/external/openssl/include/ios/openssl/lhash.h index e2ccb65d..8ecc5884 100644 --- a/external/openssl/include/ios/openssl/lhash.h +++ b/external/openssl/include/ios/openssl/lhash.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -95,7 +95,7 @@ void OPENSSL_LH_node_usage_stats_bio(const OPENSSL_LHASH *lh, BIO *out); # define _LHASH OPENSSL_LHASH # define LHASH_NODE OPENSSL_LH_NODE # define lh_error OPENSSL_LH_error -# define lh_new OPENSSL_lh_new +# define lh_new OPENSSL_LH_new # define lh_free OPENSSL_LH_free # define lh_insert OPENSSL_LH_insert # define lh_delete OPENSSL_LH_delete @@ -195,8 +195,21 @@ void OPENSSL_LH_node_usage_stats_bio(const OPENSSL_LHASH *lh, BIO *out); LHASH_OF(type) DEFINE_LHASH_OF(OPENSSL_STRING); +# ifdef _MSC_VER +/* + * push and pop this warning: + * warning C4090: 'function': different 'const' qualifiers + */ +# pragma warning (push) +# pragma warning (disable: 4090) +# endif + DEFINE_LHASH_OF(OPENSSL_CSTRING); +# ifdef _MSC_VER +# pragma warning (pop) +# endif + #ifdef __cplusplus } #endif diff --git a/external/openssl/include/ios/openssl/objects.h b/external/openssl/include/ios/openssl/objects.h index 09d614ff..d4462fee 100644 --- a/external/openssl/include/ios/openssl/objects.h +++ b/external/openssl/include/ios/openssl/objects.h @@ -992,7 +992,7 @@ const void *OBJ_bsearch_ex_(const void *key, const void *base, int num, * const void *a_; * const nid_triple const *a = a_; * - * The assignement discards a const because what you really want is: + * The assignment discards a const because what you really want is: * * const int const * const *a = a_; * @@ -1000,7 +1000,7 @@ const void *OBJ_bsearch_ex_(const void *key, const void *base, int num, * which breaks comparison functions. * * Thus we end up having to cast, sadly, or unpack the - * declarations. Or, as I finally did in this case, delcare nid_triple + * declarations. Or, as I finally did in this case, declare nid_triple * to be a struct, which it should have been in the first place. * * Ben, August 2008. diff --git a/external/openssl/include/ios/openssl/ocsp.h b/external/openssl/include/ios/openssl/ocsp.h index 08debc5b..ba1b9731 100644 --- a/external/openssl/include/ios/openssl/ocsp.h +++ b/external/openssl/include/ios/openssl/ocsp.h @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -92,7 +92,6 @@ typedef struct ocsp_resp_bytes_st OCSP_RESPBYTES; # define V_OCSP_RESPID_KEY 1 DEFINE_STACK_OF(OCSP_RESPID) -DECLARE_ASN1_FUNCTIONS(OCSP_RESPID) typedef struct ocsp_revoked_info_st OCSP_REVOKEDINFO; @@ -137,22 +136,6 @@ typedef struct ocsp_service_locator_st OCSP_SERVICELOC; # define i2d_OCSP_REQUEST_bio(bp,o) ASN1_i2d_bio_of(OCSP_REQUEST,i2d_OCSP_REQUEST,bp,o) -# define OCSP_REQUEST_sign(o,pkey,md) \ - ASN1_item_sign(ASN1_ITEM_rptr(OCSP_REQINFO),\ - &o->optionalSignature->signatureAlgorithm,NULL,\ - o->optionalSignature->signature,&o->tbsRequest,pkey,md) - -# define OCSP_BASICRESP_sign(o,pkey,md,d) \ - ASN1_item_sign(ASN1_ITEM_rptr(OCSP_RESPDATA),&o->signatureAlgorithm,NULL,\ - o->signature,&o->tbsResponseData,pkey,md) - -# define OCSP_REQUEST_verify(a,r) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_REQINFO),\ - &a->optionalSignature->signatureAlgorithm,\ - a->optionalSignature->signature,&a->tbsRequest,r) - -# define OCSP_BASICRESP_verify(a,r,d) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_RESPDATA),\ - &a->signatureAlgorithm,a->signature,&a->tbsResponseData,r) - # define ASN1_BIT_STRING_digest(data,type,md,len) \ ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING),type,data,md,len) @@ -175,8 +158,6 @@ int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it, int OCSP_REQ_CTX_nbio_d2i(OCSP_REQ_CTX *rctx, ASN1_VALUE **pval, const ASN1_ITEM *it); BIO *OCSP_REQ_CTX_get0_mem_bio(OCSP_REQ_CTX *rctx); -int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it, - ASN1_VALUE *val); int OCSP_REQ_CTX_http(OCSP_REQ_CTX *rctx, const char *op, const char *path); int OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, OCSP_REQUEST *req); int OCSP_REQ_CTX_add1_header(OCSP_REQ_CTX *rctx, @@ -210,6 +191,10 @@ int OCSP_response_status(OCSP_RESPONSE *resp); OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp); const ASN1_OCTET_STRING *OCSP_resp_get0_signature(const OCSP_BASICRESP *bs); +const X509_ALGOR *OCSP_resp_get0_tbs_sigalg(const OCSP_BASICRESP *bs); +const OCSP_RESPDATA *OCSP_resp_get0_respdata(const OCSP_BASICRESP *bs); +int OCSP_resp_get0_signer(OCSP_BASICRESP *bs, X509 **signer, + STACK_OF(X509) *extra_certs); int OCSP_resp_count(OCSP_BASICRESP *bs); OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx); diff --git a/external/openssl/include/ios/openssl/opensslconf-arm32.h b/external/openssl/include/ios/openssl/opensslconf-arm32.h deleted file mode 100644 index 18894d8a..00000000 --- a/external/openssl/include/ios/openssl/opensslconf-arm32.h +++ /dev/null @@ -1,175 +0,0 @@ -/* - * WARNING: do not edit! - * Generated by Makefile from include/openssl/opensslconf.h.in - * - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef OPENSSL_ALGORITHM_DEFINES -# error OPENSSL_ALGORITHM_DEFINES no longer supported -#endif - -/* - * OpenSSL was configured with the following options: - */ - -#ifndef OPENSSL_SYS_iOS -# define OPENSSL_SYS_iOS 1 -#endif -#ifndef OPENSSL_NO_MD2 -# define OPENSSL_NO_MD2 -#endif -#ifndef OPENSSL_NO_RC5 -# define OPENSSL_NO_RC5 -#endif -#ifndef OPENSSL_THREADS -# define OPENSSL_THREADS -#endif -#ifndef OPENSSL_NO_ASAN -# define OPENSSL_NO_ASAN -#endif -#ifndef OPENSSL_NO_ASYNC -# define OPENSSL_NO_ASYNC -#endif -#ifndef OPENSSL_NO_CRYPTO_MDEBUG -# define OPENSSL_NO_CRYPTO_MDEBUG -#endif -#ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE -# define OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE -#endif -#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 -# define OPENSSL_NO_EC_NISTP_64_GCC_128 -#endif -#ifndef OPENSSL_NO_EGD -# define OPENSSL_NO_EGD -#endif -#ifndef OPENSSL_NO_FUZZ_AFL -# define OPENSSL_NO_FUZZ_AFL -#endif -#ifndef OPENSSL_NO_FUZZ_LIBFUZZER -# define OPENSSL_NO_FUZZ_LIBFUZZER -#endif -#ifndef OPENSSL_NO_HEARTBEATS -# define OPENSSL_NO_HEARTBEATS -#endif -#ifndef OPENSSL_NO_MSAN -# define OPENSSL_NO_MSAN -#endif -#ifndef OPENSSL_NO_SCTP -# define OPENSSL_NO_SCTP -#endif -#ifndef OPENSSL_NO_SSL_TRACE -# define OPENSSL_NO_SSL_TRACE -#endif -#ifndef OPENSSL_NO_SSL3 -# define OPENSSL_NO_SSL3 -#endif -#ifndef OPENSSL_NO_SSL3_METHOD -# define OPENSSL_NO_SSL3_METHOD -#endif -#ifndef OPENSSL_NO_UBSAN -# define OPENSSL_NO_UBSAN -#endif -#ifndef OPENSSL_NO_UNIT_TEST -# define OPENSSL_NO_UNIT_TEST -#endif -#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS -# define OPENSSL_NO_WEAK_SSL_CIPHERS -#endif -#ifndef OPENSSL_NO_AFALGENG -# define OPENSSL_NO_AFALGENG -#endif - - -/* - * Sometimes OPENSSSL_NO_xxx ends up with an empty file and some compilers - * don't like that. This will hopefully silence them. - */ -#define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy; - -/* - * Applications should use -DOPENSSL_API_COMPAT= to suppress the - * declarations of functions deprecated in or before . Otherwise, they - * still won't see them if the library has been built to disable deprecated - * functions. - */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; -#endif - -#ifndef OPENSSL_FILE -# ifdef OPENSSL_NO_FILENAMES -# define OPENSSL_FILE "" -# define OPENSSL_LINE 0 -# else -# define OPENSSL_FILE __FILE__ -# define OPENSSL_LINE __LINE__ -# endif -#endif - -#ifndef OPENSSL_MIN_API -# define OPENSSL_MIN_API 0 -#endif - -#if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API -# undef OPENSSL_API_COMPAT -# define OPENSSL_API_COMPAT OPENSSL_MIN_API -#endif - -#if OPENSSL_API_COMPAT < 0x10100000L -# define DEPRECATEDIN_1_1_0(f) DECLARE_DEPRECATED(f) -#else -# define DEPRECATEDIN_1_1_0(f) -#endif - -#if OPENSSL_API_COMPAT < 0x10000000L -# define DEPRECATEDIN_1_0_0(f) DECLARE_DEPRECATED(f) -#else -# define DEPRECATEDIN_1_0_0(f) -#endif - -#if OPENSSL_API_COMPAT < 0x00908000L -# define DEPRECATEDIN_0_9_8(f) DECLARE_DEPRECATED(f) -#else -# define DEPRECATEDIN_0_9_8(f) -#endif - -#define OPENSSL_CPUID_OBJ - -/* Generate 80386 code? */ -#undef I386_ONLY - -#undef OPENSSL_UNISTD -#define OPENSSL_UNISTD - -#undef OPENSSL_EXPORT_VAR_AS_FUNCTION - -/* - * The following are cipher-specific, but are part of the public API. - */ -#if !defined(OPENSSL_SYS_UEFI) -# define BN_LLONG -/* Only one for the following should be defined */ -# undef SIXTY_FOUR_BIT_LONG -# undef SIXTY_FOUR_BIT -# define THIRTY_TWO_BIT -#endif - -#define RC4_INT unsigned char - -#ifdef __cplusplus -} -#endif diff --git a/external/openssl/include/ios/openssl/opensslconf-arm64.h b/external/openssl/include/ios/openssl/opensslconf-arm64.h index 0162bbe1..2f617e17 100644 --- a/external/openssl/include/ios/openssl/opensslconf-arm64.h +++ b/external/openssl/include/ios/openssl/opensslconf-arm64.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -102,12 +102,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/external/openssl/include/ios/openssl/opensslconf-i386.h b/external/openssl/include/ios/openssl/opensslconf-i386.h deleted file mode 100644 index 45165383..00000000 --- a/external/openssl/include/ios/openssl/opensslconf-i386.h +++ /dev/null @@ -1,175 +0,0 @@ -/* - * WARNING: do not edit! - * Generated by Makefile from include/openssl/opensslconf.h.in - * - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef OPENSSL_ALGORITHM_DEFINES -# error OPENSSL_ALGORITHM_DEFINES no longer supported -#endif - -/* - * OpenSSL was configured with the following options: - */ - -#ifndef OPENSSL_SYS_iOS -# define OPENSSL_SYS_iOS 1 -#endif -#ifndef OPENSSL_NO_MD2 -# define OPENSSL_NO_MD2 -#endif -#ifndef OPENSSL_NO_RC5 -# define OPENSSL_NO_RC5 -#endif -#ifndef OPENSSL_THREADS -# define OPENSSL_THREADS -#endif -#ifndef OPENSSL_NO_ASAN -# define OPENSSL_NO_ASAN -#endif -#ifndef OPENSSL_NO_ASYNC -# define OPENSSL_NO_ASYNC -#endif -#ifndef OPENSSL_NO_CRYPTO_MDEBUG -# define OPENSSL_NO_CRYPTO_MDEBUG -#endif -#ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE -# define OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE -#endif -#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 -# define OPENSSL_NO_EC_NISTP_64_GCC_128 -#endif -#ifndef OPENSSL_NO_EGD -# define OPENSSL_NO_EGD -#endif -#ifndef OPENSSL_NO_FUZZ_AFL -# define OPENSSL_NO_FUZZ_AFL -#endif -#ifndef OPENSSL_NO_FUZZ_LIBFUZZER -# define OPENSSL_NO_FUZZ_LIBFUZZER -#endif -#ifndef OPENSSL_NO_HEARTBEATS -# define OPENSSL_NO_HEARTBEATS -#endif -#ifndef OPENSSL_NO_MSAN -# define OPENSSL_NO_MSAN -#endif -#ifndef OPENSSL_NO_SCTP -# define OPENSSL_NO_SCTP -#endif -#ifndef OPENSSL_NO_SSL_TRACE -# define OPENSSL_NO_SSL_TRACE -#endif -#ifndef OPENSSL_NO_SSL3 -# define OPENSSL_NO_SSL3 -#endif -#ifndef OPENSSL_NO_SSL3_METHOD -# define OPENSSL_NO_SSL3_METHOD -#endif -#ifndef OPENSSL_NO_UBSAN -# define OPENSSL_NO_UBSAN -#endif -#ifndef OPENSSL_NO_UNIT_TEST -# define OPENSSL_NO_UNIT_TEST -#endif -#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS -# define OPENSSL_NO_WEAK_SSL_CIPHERS -#endif -#ifndef OPENSSL_NO_AFALGENG -# define OPENSSL_NO_AFALGENG -#endif - - -/* - * Sometimes OPENSSSL_NO_xxx ends up with an empty file and some compilers - * don't like that. This will hopefully silence them. - */ -#define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy; - -/* - * Applications should use -DOPENSSL_API_COMPAT= to suppress the - * declarations of functions deprecated in or before . Otherwise, they - * still won't see them if the library has been built to disable deprecated - * functions. - */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; -#endif - -#ifndef OPENSSL_FILE -# ifdef OPENSSL_NO_FILENAMES -# define OPENSSL_FILE "" -# define OPENSSL_LINE 0 -# else -# define OPENSSL_FILE __FILE__ -# define OPENSSL_LINE __LINE__ -# endif -#endif - -#ifndef OPENSSL_MIN_API -# define OPENSSL_MIN_API 0 -#endif - -#if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API -# undef OPENSSL_API_COMPAT -# define OPENSSL_API_COMPAT OPENSSL_MIN_API -#endif - -#if OPENSSL_API_COMPAT < 0x10100000L -# define DEPRECATEDIN_1_1_0(f) DECLARE_DEPRECATED(f) -#else -# define DEPRECATEDIN_1_1_0(f) -#endif - -#if OPENSSL_API_COMPAT < 0x10000000L -# define DEPRECATEDIN_1_0_0(f) DECLARE_DEPRECATED(f) -#else -# define DEPRECATEDIN_1_0_0(f) -#endif - -#if OPENSSL_API_COMPAT < 0x00908000L -# define DEPRECATEDIN_0_9_8(f) DECLARE_DEPRECATED(f) -#else -# define DEPRECATEDIN_0_9_8(f) -#endif - -#define OPENSSL_CPUID_OBJ - -/* Generate 80386 code? */ -#undef I386_ONLY - -#undef OPENSSL_UNISTD -#define OPENSSL_UNISTD - -#undef OPENSSL_EXPORT_VAR_AS_FUNCTION - -/* - * The following are cipher-specific, but are part of the public API. - */ -#if !defined(OPENSSL_SYS_UEFI) -# define BN_LLONG -/* Only one for the following should be defined */ -# undef SIXTY_FOUR_BIT_LONG -# undef SIXTY_FOUR_BIT -# define THIRTY_TWO_BIT -#endif - -#define RC4_INT unsigned int - -#ifdef __cplusplus -} -#endif diff --git a/external/openssl/include/ios/openssl/opensslconf-x86_64.h b/external/openssl/include/ios/openssl/opensslconf-x86_64.h index 415478ec..b0c01737 100644 --- a/external/openssl/include/ios/openssl/opensslconf-x86_64.h +++ b/external/openssl/include/ios/openssl/opensslconf-x86_64.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -102,12 +102,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/external/openssl/include/ios/openssl/opensslconf.h b/external/openssl/include/ios/openssl/opensslconf.h index 737f7ca3..514d4c5d 100644 --- a/external/openssl/include/ios/openssl/opensslconf.h +++ b/external/openssl/include/ios/openssl/opensslconf.h @@ -1,9 +1,9 @@ #ifdef __arm64__ #include "opensslconf-arm64.h" -#elif __arm__ -#include "opensslconf-arm32.h" -#elif __i386__ -#include "opensslconf-i386.h" +/* #elif __arm__ */ +/* #include "opensslconf-arm32.h" */ +/* #elif __i386__ */ +/* #include "opensslconf-i386.h" */ #elif __x86_64__ #include "opensslconf-x86_64.h" #else diff --git a/external/openssl/include/ios/openssl/opensslv.h b/external/openssl/include/ios/openssl/opensslv.h index 2d54b69b..12483c6e 100644 --- a/external/openssl/include/ios/openssl/opensslv.h +++ b/external/openssl/include/ios/openssl/opensslv.h @@ -1,5 +1,5 @@ /* - * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -39,11 +39,11 @@ extern "C" { * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for * major minor fix final patch/beta) */ -# define OPENSSL_VERSION_NUMBER 0x1010003fL +# define OPENSSL_VERSION_NUMBER 0x101000cfL # ifdef OPENSSL_FIPS -# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0c-fips 10 Nov 2016" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0l-fips 10 Sep 2019" # else -# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0c 10 Nov 2016" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0l 10 Sep 2019" # endif /*- diff --git a/external/openssl/include/ios/openssl/pem.h b/external/openssl/include/ios/openssl/pem.h index 2375d635..f7ce3c61 100644 --- a/external/openssl/include/ios/openssl/pem.h +++ b/external/openssl/include/ios/openssl/pem.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -322,7 +322,8 @@ int PEM_SignUpdate(EVP_MD_CTX *ctx, unsigned char *d, unsigned int cnt); int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen, EVP_PKEY *pkey); -int PEM_def_callback(char *buf, int num, int w, void *key); +/* The default pem_password_cb that's used internally */ +int PEM_def_callback(char *buf, int num, int rwflag, void *userdata); void PEM_proc_type(char *buf, int type); void PEM_dek_info(char *buf, const char *type, int len, char *str); diff --git a/external/openssl/include/ios/openssl/rsa.h b/external/openssl/include/ios/openssl/rsa.h index 4d6e9cc9..9c28329f 100644 --- a/external/openssl/include/ios/openssl/rsa.h +++ b/external/openssl/include/ios/openssl/rsa.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -374,7 +374,7 @@ void RSA_meth_free(RSA_METHOD *meth); RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth); const char *RSA_meth_get0_name(const RSA_METHOD *meth); int RSA_meth_set1_name(RSA_METHOD *meth, const char *name); -int RSA_meth_get_flags(RSA_METHOD *meth); +int RSA_meth_get_flags(const RSA_METHOD *meth); int RSA_meth_set_flags(RSA_METHOD *meth, int flags); void *RSA_meth_get0_app_data(const RSA_METHOD *meth); int RSA_meth_set0_app_data(RSA_METHOD *meth, void *app_data); @@ -407,9 +407,9 @@ int RSA_meth_set_priv_dec(RSA_METHOD *rsa, unsigned char *to, RSA *rsa, int padding)); int (*RSA_meth_get_mod_exp(const RSA_METHOD *meth)) - (BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx); + (BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx); int RSA_meth_set_mod_exp(RSA_METHOD *rsa, - int (*mod_exp) (BIGNUM *r0, const BIGNUM *I, RSA *rsa, + int (*mod_exp) (BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx)); int (*RSA_meth_get_bn_mod_exp(const RSA_METHOD *meth)) (BIGNUM *r, const BIGNUM *a, const BIGNUM *p, @@ -468,6 +468,7 @@ int ERR_load_RSA_strings(void); # define RSA_F_PKEY_RSA_CTRL 143 # define RSA_F_PKEY_RSA_CTRL_STR 144 # define RSA_F_PKEY_RSA_SIGN 142 +# define RSA_F_PKEY_RSA_VERIFY 149 # define RSA_F_PKEY_RSA_VERIFYRECOVER 141 # define RSA_F_RSA_ALGOR_TO_MD 156 # define RSA_F_RSA_BUILTIN_KEYGEN 129 diff --git a/external/openssl/include/ios/openssl/seed.h b/external/openssl/include/ios/openssl/seed.h index bb97131d..de10b085 100644 --- a/external/openssl/include/ios/openssl/seed.h +++ b/external/openssl/include/ios/openssl/seed.h @@ -52,9 +52,7 @@ extern "C" { # endif # endif -# if !defined(NO_SYS_TYPES_H) -# include -# endif +# include # define SEED_BLOCK_SIZE 16 # define SEED_KEY_LENGTH 16 diff --git a/external/openssl/include/ios/openssl/srtp.h b/external/openssl/include/ios/openssl/srtp.h index 5ddfa46d..0b57c235 100644 --- a/external/openssl/include/ios/openssl/srtp.h +++ b/external/openssl/include/ios/openssl/srtp.h @@ -36,7 +36,7 @@ extern "C" { # ifndef OPENSSL_NO_SRTP __owur int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles); -__owur int SSL_set_tlsext_use_srtp(SSL *ctx, const char *profiles); +__owur int SSL_set_tlsext_use_srtp(SSL *ssl, const char *profiles); __owur STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl); __owur SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s); diff --git a/external/openssl/include/ios/openssl/ssl.h b/external/openssl/include/ios/openssl/ssl.h index 86ab9125..56e20562 100644 --- a/external/openssl/include/ios/openssl/ssl.h +++ b/external/openssl/include/ios/openssl/ssl.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -95,14 +95,14 @@ extern "C" { # define SSL_TXT_NULL "NULL" # define SSL_TXT_kRSA "kRSA" -# define SSL_TXT_kDHr "kDHr" -# define SSL_TXT_kDHd "kDHd" -# define SSL_TXT_kDH "kDH" +# define SSL_TXT_kDHr "kDHr"/* this cipher class has been removed */ +# define SSL_TXT_kDHd "kDHd"/* this cipher class has been removed */ +# define SSL_TXT_kDH "kDH"/* this cipher class has been removed */ # define SSL_TXT_kEDH "kEDH"/* alias for kDHE */ # define SSL_TXT_kDHE "kDHE" -# define SSL_TXT_kECDHr "kECDHr" -# define SSL_TXT_kECDHe "kECDHe" -# define SSL_TXT_kECDH "kECDH" +# define SSL_TXT_kECDHr "kECDHr"/* this cipher class has been removed */ +# define SSL_TXT_kECDHe "kECDHe"/* this cipher class has been removed */ +# define SSL_TXT_kECDH "kECDH"/* this cipher class has been removed */ # define SSL_TXT_kEECDH "kEECDH"/* alias for kECDHE */ # define SSL_TXT_kECDHE "kECDHE" # define SSL_TXT_kPSK "kPSK" @@ -114,8 +114,8 @@ extern "C" { # define SSL_TXT_aRSA "aRSA" # define SSL_TXT_aDSS "aDSS" -# define SSL_TXT_aDH "aDH" -# define SSL_TXT_aECDH "aECDH" +# define SSL_TXT_aDH "aDH"/* this cipher class has been removed */ +# define SSL_TXT_aECDH "aECDH"/* this cipher class has been removed */ # define SSL_TXT_aECDSA "aECDSA" # define SSL_TXT_aPSK "aPSK" # define SSL_TXT_aGOST94 "aGOST94" @@ -262,54 +262,33 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, const unsigned char *in, size_t inlen, int *al, void *parse_arg); +/* Typedef for verification callback */ +typedef int (*SSL_verify_cb)(int preverify_ok, X509_STORE_CTX *x509_ctx); + /* Allow initial connection to servers that don't support RI */ # define SSL_OP_LEGACY_SERVER_CONNECT 0x00000004U -/* Removed from OpenSSL 0.9.8q and 1.0.0c */ -/* Dead forever, see CVE-2010-4180. */ -# define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG 0x0U # define SSL_OP_TLSEXT_PADDING 0x00000010U -# define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER 0x0U # define SSL_OP_SAFARI_ECDHE_ECDSA_BUG 0x00000040U -/* Ancient SSLeay version, retained for compatibility */ -# define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0x0 -# define SSL_OP_TLS_D5_BUG 0x0U -/* Removed from OpenSSL 1.1.0 */ -# define SSL_OP_TLS_BLOCK_PADDING_BUG 0x0U - -/* Hasn't done anything since OpenSSL 0.9.7h, retained for compatibility */ -# define SSL_OP_MSIE_SSLV2_RSA_PADDING 0x0 -/* Refers to ancient SSLREF and SSLv2, retained for compatibility */ -# define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG 0x0 -/* Related to removed SSLv2 */ -# define SSL_OP_MICROSOFT_SESS_ID_BUG 0x0 -# define SSL_OP_NETSCAPE_CHALLENGE_BUG 0x0 /* * Disable SSL 3.0/TLS 1.0 CBC vulnerability workaround that was added in * OpenSSL 0.9.6d. Usually (depending on the application protocol) the * workaround is not needed. Unfortunately some broken SSL/TLS * implementations cannot handle it at all, which is why we include it in - * SSL_OP_ALL. + * SSL_OP_ALL. Added in 0.9.6e */ -/* added in 0.9.6e */ # define SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS 0x00000800U -/* - * SSL_OP_ALL: various bug workarounds that should be rather harmless. This - * used to be 0x000FFFFFL before 0.9.7. - */ -# define SSL_OP_ALL 0x80000BFFU - /* DTLS options */ -# define SSL_OP_NO_QUERY_MTU 0x00001000U +# define SSL_OP_NO_QUERY_MTU 0x00001000U /* Turn on Cookie Exchange (on relevant for servers) */ -# define SSL_OP_COOKIE_EXCHANGE 0x00002000U +# define SSL_OP_COOKIE_EXCHANGE 0x00002000U /* Don't use RFC4507 ticket extension */ -# define SSL_OP_NO_TICKET 0x00004000U +# define SSL_OP_NO_TICKET 0x00004000U # ifndef OPENSSL_NO_DTLS1_METHOD /* Use Cisco's "speshul" version of DTLS_BAD_VER * (only with deprecated DTLSv1_client_method()) */ -# define SSL_OP_CISCO_ANYCONNECT 0x00008000U +# define SSL_OP_CISCO_ANYCONNECT 0x00008000U # endif /* As server, disallow session resumption on renegotiation */ @@ -318,12 +297,8 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, # define SSL_OP_NO_COMPRESSION 0x00020000U /* Permit unsafe legacy renegotiation */ # define SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION 0x00040000U -/* Does nothing: retained for compatibility */ -# define SSL_OP_SINGLE_ECDH_USE 0x0 -/* Does nothing: retained for compatibility */ -# define SSL_OP_SINGLE_DH_USE 0x0 -/* Does nothing: retained for compatibility */ -# define SSL_OP_EPHEMERAL_RSA 0x0 +/* Disable encrypt-then-mac */ +# define SSL_OP_NO_ENCRYPT_THEN_MAC 0x00080000U /* * Set on servers to choose the cipher according to the server's preferences */ @@ -336,7 +311,6 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, */ # define SSL_OP_TLS_ROLLBACK_BUG 0x00800000U -# define SSL_OP_NO_SSLv2 0x00000000U # define SSL_OP_NO_SSLv3 0x02000000U # define SSL_OP_NO_TLSv1 0x04000000U # define SSL_OP_NO_TLSv1_2 0x08000000U @@ -349,12 +323,9 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, SSL_OP_NO_TLSv1|SSL_OP_NO_TLSv1_1|SSL_OP_NO_TLSv1_2) # define SSL_OP_NO_DTLS_MASK (SSL_OP_NO_DTLSv1|SSL_OP_NO_DTLSv1_2) +/* Disallow all renegotiation */ +# define SSL_OP_NO_RENEGOTIATION 0x40000000U -/* Removed from previous versions */ -# define SSL_OP_PKCS1_CHECK_1 0x0 -# define SSL_OP_PKCS1_CHECK_2 0x0 -# define SSL_OP_NETSCAPE_CA_DN_BUG 0x0 -# define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x0U /* * Make server add server-hello extension from early version of cryptopro * draft, when GOST ciphersuite is negotiated. Required for interoperability @@ -362,6 +333,59 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, */ # define SSL_OP_CRYPTOPRO_TLSEXT_BUG 0x80000000U +/* + * SSL_OP_ALL: various bug workarounds that should be rather harmless. + * This used to be 0x000FFFFFL before 0.9.7. + * This used to be 0x80000BFFU before 1.1.1. + */ +# define SSL_OP_ALL (SSL_OP_CRYPTOPRO_TLSEXT_BUG|\ + SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS|\ + SSL_OP_LEGACY_SERVER_CONNECT|\ + SSL_OP_TLSEXT_PADDING|\ + SSL_OP_SAFARI_ECDHE_ECDSA_BUG) + +/* OBSOLETE OPTIONS: retained for compatibility */ + +/* Removed from OpenSSL 1.1.0. Was 0x00000001L */ +/* Related to removed SSLv2. */ +# define SSL_OP_MICROSOFT_SESS_ID_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000002L */ +/* Related to removed SSLv2. */ +# define SSL_OP_NETSCAPE_CHALLENGE_BUG 0x0 +/* Removed from OpenSSL 0.9.8q and 1.0.0c. Was 0x00000008L */ +/* Dead forever, see CVE-2010-4180 */ +# define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG 0x0 +/* Removed from OpenSSL 1.0.1h and 1.0.2. Was 0x00000010L */ +/* Refers to ancient SSLREF and SSLv2. */ +# define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000020 */ +# define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER 0x0 +/* Removed from OpenSSL 0.9.7h and 0.9.8b. Was 0x00000040L */ +# define SSL_OP_MSIE_SSLV2_RSA_PADDING 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000080 */ +/* Ancient SSLeay version. */ +# define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000100L */ +# define SSL_OP_TLS_D5_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000200L */ +# define SSL_OP_TLS_BLOCK_PADDING_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00080000L */ +# define SSL_OP_SINGLE_ECDH_USE 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00100000L */ +# define SSL_OP_SINGLE_DH_USE 0x0 +/* Removed from OpenSSL 1.0.1k and 1.0.2. Was 0x00200000L */ +# define SSL_OP_EPHEMERAL_RSA 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x01000000L */ +# define SSL_OP_NO_SSLv2 0x0 +/* Removed from OpenSSL 1.0.1. Was 0x08000000L */ +# define SSL_OP_PKCS1_CHECK_1 0x0 +/* Removed from OpenSSL 1.0.1. Was 0x10000000L */ +# define SSL_OP_PKCS1_CHECK_2 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x20000000L */ +# define SSL_OP_NETSCAPE_CA_DN_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x40000000L */ +# define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x0 + /* * Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success * when just a single record has been written): @@ -943,8 +967,8 @@ size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count); # define SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02 # define SSL_VERIFY_CLIENT_ONCE 0x04 -# define OpenSSL_add_ssl_algorithms() SSL_library_init() # if OPENSSL_API_COMPAT < 0x10100000L +# define OpenSSL_add_ssl_algorithms() SSL_library_init() # define SSLeay_add_ssl_algorithms() SSL_library_init() # endif @@ -1139,6 +1163,8 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) # define SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE 127 # define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB 128 # define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG 129 +# define SSL_CTRL_GET_MIN_PROTO_VERSION 130 +# define SSL_CTRL_GET_MAX_PROTO_VERSION 131 # define SSL_CERT_SET_FIRST 1 # define SSL_CERT_SET_NEXT 2 # define SSL_CERT_SET_SERVER 3 @@ -1241,7 +1267,7 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) # define SSL_CTX_set1_sigalgs_list(ctx, s) \ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)s) # define SSL_set1_sigalgs(ctx, slist, slistlen) \ - SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS,clistlen,(int *)slist) + SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS,slistlen,(int *)slist) # define SSL_set1_sigalgs_list(ctx, s) \ SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)s) # define SSL_CTX_set1_client_sigalgs(ctx, slist, slistlen) \ @@ -1270,10 +1296,18 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MIN_PROTO_VERSION, version, NULL) #define SSL_CTX_set_max_proto_version(ctx, version) \ SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MAX_PROTO_VERSION, version, NULL) +#define SSL_CTX_get_min_proto_version(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MIN_PROTO_VERSION, 0, NULL) +#define SSL_CTX_get_max_proto_version(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MAX_PROTO_VERSION, 0, NULL) #define SSL_set_min_proto_version(s, version) \ SSL_ctrl(s, SSL_CTRL_SET_MIN_PROTO_VERSION, version, NULL) #define SSL_set_max_proto_version(s, version) \ SSL_ctrl(s, SSL_CTRL_SET_MAX_PROTO_VERSION, version, NULL) +#define SSL_get_min_proto_version(s) \ + SSL_ctrl(s, SSL_CTRL_GET_MIN_PROTO_VERSION, 0, NULL) +#define SSL_get_max_proto_version(s) \ + SSL_ctrl(s, SSL_CTRL_GET_MAX_PROTO_VERSION, 0, NULL) #if OPENSSL_API_COMPAT < 0x10100000L /* Provide some compatibility macros for removed functionality. */ @@ -1324,7 +1358,7 @@ __owur int SSL_get_fd(const SSL *s); __owur int SSL_get_rfd(const SSL *s); __owur int SSL_get_wfd(const SSL *s); __owur const char *SSL_get_cipher_list(const SSL *s, int n); -__owur char *SSL_get_shared_ciphers(const SSL *s, char *buf, int len); +__owur char *SSL_get_shared_ciphers(const SSL *s, char *buf, int size); __owur int SSL_get_read_ahead(const SSL *s); __owur int SSL_pending(const SSL *s); __owur int SSL_has_pending(const SSL *s); @@ -1342,9 +1376,8 @@ __owur int SSL_set_cipher_list(SSL *s, const char *str); void SSL_set_read_ahead(SSL *s, int yes); __owur int SSL_get_verify_mode(const SSL *s); __owur int SSL_get_verify_depth(const SSL *s); -__owur int (*SSL_get_verify_callback(const SSL *s)) (int, X509_STORE_CTX *); -void SSL_set_verify(SSL *s, int mode, - int (*callback) (int ok, X509_STORE_CTX *ctx)); +__owur SSL_verify_cb SSL_get_verify_callback(const SSL *s); +void SSL_set_verify(SSL *s, int mode, SSL_verify_cb callback); void SSL_set_verify_depth(SSL *s, int depth); void SSL_set_cert_cb(SSL *s, int (*cb) (SSL *ssl, void *arg), void *arg); # ifndef OPENSSL_NO_RSA @@ -1426,7 +1459,7 @@ int SSL_SESSION_up_ref(SSL_SESSION *ses); void SSL_SESSION_free(SSL_SESSION *ses); __owur int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp); __owur int SSL_set_session(SSL *to, SSL_SESSION *session); -__owur int SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c); +int SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c); int SSL_CTX_remove_session(SSL_CTX *, SSL_SESSION *c); __owur int SSL_CTX_set_generate_session_id(SSL_CTX *, GEN_SESSION_CB); __owur int SSL_set_generate_session_id(SSL *, GEN_SESSION_CB); @@ -1443,10 +1476,8 @@ __owur STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *s); __owur int SSL_CTX_get_verify_mode(const SSL_CTX *ctx); __owur int SSL_CTX_get_verify_depth(const SSL_CTX *ctx); -__owur int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx)) (int, - X509_STORE_CTX *); -void SSL_CTX_set_verify(SSL_CTX *ctx, int mode, - int (*callback) (int, X509_STORE_CTX *)); +__owur SSL_verify_cb SSL_CTX_get_verify_callback(const SSL_CTX *ctx); +void SSL_CTX_set_verify(SSL_CTX *ctx, int mode, SSL_verify_cb callback); void SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth); void SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx, int (*cb) (X509_STORE_CTX *, void *), @@ -1501,7 +1532,7 @@ __owur int SSL_CTX_dane_mtype_set(SSL_CTX *ctx, const EVP_MD *md, uint8_t mtype, uint8_t ord); __owur int SSL_dane_enable(SSL *s, const char *basedomain); __owur int SSL_dane_tlsa_add(SSL *s, uint8_t usage, uint8_t selector, - uint8_t mtype, unsigned char *data, size_t dlen); + uint8_t mtype, unsigned const char *data, size_t dlen); __owur int SSL_get0_dane_authority(SSL *s, X509 **mcert, EVP_PKEY **mspki); __owur int SSL_get0_dane_tlsa(SSL *s, uint8_t *usage, uint8_t *selector, uint8_t *mtype, unsigned const char **data, @@ -1777,6 +1808,8 @@ void SSL_set_tmp_dh_callback(SSL *ssl, __owur const COMP_METHOD *SSL_get_current_compression(SSL *s); __owur const COMP_METHOD *SSL_get_current_expansion(SSL *s); __owur const char *SSL_COMP_get_name(const COMP_METHOD *comp); +__owur const char *SSL_COMP_get0_name(const SSL_COMP *comp); +__owur int SSL_COMP_get_id(const SSL_COMP *comp); STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void); __owur STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP) *meths); @@ -1814,7 +1847,7 @@ void SSL_set_not_resumable_session_callback(SSL *ssl, # endif __owur int SSL_session_reused(SSL *s); -__owur int SSL_is_server(SSL *s); +__owur int SSL_is_server(const SSL *s); __owur __owur SSL_CONF_CTX *SSL_CONF_CTX_new(void); int SSL_CONF_CTX_finish(SSL_CONF_CTX *cctx); @@ -2077,6 +2110,7 @@ int ERR_load_SSL_strings(void); # define SSL_F_DTLS_CONSTRUCT_HELLO_VERIFY_REQUEST 385 # define SSL_F_DTLS_GET_REASSEMBLED_MESSAGE 370 # define SSL_F_DTLS_PROCESS_HELLO_VERIFY 386 +# define SSL_F_DTLS_WAIT_FOR_DRY 592 # define SSL_F_OPENSSL_INIT_SSL 342 # define SSL_F_OSSL_STATEM_CLIENT_READ_TRANSITION 417 # define SSL_F_OSSL_STATEM_SERVER_READ_TRANSITION 418 @@ -2098,6 +2132,7 @@ int ERR_load_SSL_strings(void); # define SSL_F_SSL3_SETUP_KEY_BLOCK 157 # define SSL_F_SSL3_SETUP_READ_BUFFER 156 # define SSL_F_SSL3_SETUP_WRITE_BUFFER 291 +# define SSL_F_SSL3_TAKE_MAC 425 # define SSL_F_SSL3_WRITE_BYTES 158 # define SSL_F_SSL3_WRITE_PENDING 159 # define SSL_F_SSL_ADD_CERT_CHAIN 316 @@ -2171,6 +2206,8 @@ int ERR_load_SSL_strings(void); # define SSL_F_SSL_PARSE_SERVERHELLO_USE_SRTP_EXT 311 # define SSL_F_SSL_PEEK 270 # define SSL_F_SSL_READ 223 +# define SSL_F_SSL_RENEGOTIATE 516 +# define SSL_F_SSL_RENEGOTIATE_ABBREVIATED 546 # define SSL_F_SSL_SCAN_CLIENTHELLO_TLSEXT 320 # define SSL_F_SSL_SCAN_SERVERHELLO_TLSEXT 321 # define SSL_F_SSL_SESSION_DUP 348 @@ -2344,6 +2381,7 @@ int ERR_load_SSL_strings(void); # define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 150 # define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 151 # define SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN 204 +# define SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE 194 # define SSL_R_EXCESSIVE_MESSAGE_SIZE 152 # define SSL_R_EXTRA_DATA_IN_MESSAGE 153 # define SSL_R_FAILED_TO_INIT_ASYNC 405 diff --git a/external/openssl/include/ios/openssl/ssl3.h b/external/openssl/include/ios/openssl/ssl3.h index aca19223..115940ad 100644 --- a/external/openssl/include/ios/openssl/ssl3.h +++ b/external/openssl/include/ios/openssl/ssl3.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -252,9 +252,15 @@ extern "C" { # define SSL3_CT_FORTEZZA_DMS 20 /* * SSL3_CT_NUMBER is used to size arrays and it must be large enough to - * contain all of the cert types defined either for SSLv3 and TLSv1. + * contain all of the cert types defined for *either* SSLv3 and TLSv1. */ -# define SSL3_CT_NUMBER 9 +# define SSL3_CT_NUMBER 10 + +# if defined(TLS_CT_NUMBER) +# if TLS_CT_NUMBER != SSL3_CT_NUMBER +# error "SSL/TLS CT_NUMBER values do not match" +# endif +# endif # define SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS 0x0001 @@ -264,11 +270,14 @@ extern "C" { # define TLS1_FLAGS_SKIP_CERT_VERIFY 0x0010 /* Set if we encrypt then mac instead of usual mac then encrypt */ -# define TLS1_FLAGS_ENCRYPT_THEN_MAC 0x0100 +# define TLS1_FLAGS_ENCRYPT_THEN_MAC_READ 0x0100 +# define TLS1_FLAGS_ENCRYPT_THEN_MAC TLS1_FLAGS_ENCRYPT_THEN_MAC_READ /* Set if extended master secret extension received from peer */ # define TLS1_FLAGS_RECEIVED_EXTMS 0x0200 +# define TLS1_FLAGS_ENCRYPT_THEN_MAC_WRITE 0x0400 + # define SSL3_MT_HELLO_REQUEST 0 # define SSL3_MT_CLIENT_HELLO 1 # define SSL3_MT_SERVER_HELLO 2 diff --git a/external/openssl/include/ios/openssl/symhacks.h b/external/openssl/include/ios/openssl/symhacks.h index caf1f1a7..156ea6e4 100644 --- a/external/openssl/include/ios/openssl/symhacks.h +++ b/external/openssl/include/ios/openssl/symhacks.h @@ -1,5 +1,5 @@ /* - * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -28,21 +28,6 @@ # undef i2d_ECPKPARAMETERS # define i2d_ECPKPARAMETERS i2d_UC_ECPKPARAMETERS -/* - * These functions do not seem to exist! However, I'm paranoid... Original - * command in x509v3.h: These functions are being redefined in another - * directory, and clash when the linker is case-insensitive, so let's hide - * them a little, by giving them an extra 'o' at the beginning of the name... - */ -# undef X509v3_cleanup_extensions -# define X509v3_cleanup_extensions oX509v3_cleanup_extensions -# undef X509v3_add_extension -# define X509v3_add_extension oX509v3_add_extension -# undef X509v3_add_netscape_extensions -# define X509v3_add_netscape_extensions oX509v3_add_netscape_extensions -# undef X509v3_add_standard_extensions -# define X509v3_add_standard_extensions oX509v3_add_standard_extensions - /* This one clashes with CMS_data_create */ # undef cms_Data_create # define cms_Data_create priv_cms_Data_create diff --git a/external/openssl/include/ios/openssl/tls1.h b/external/openssl/include/ios/openssl/tls1.h index 23e382cd..732e87ab 100644 --- a/external/openssl/include/ios/openssl/tls1.h +++ b/external/openssl/include/ios/openssl/tls1.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -226,12 +226,12 @@ __owur int SSL_get_servername_type(const SSL *s); * as specified in RFC 5705. It writes |olen| bytes to |out| given a label and * optional context. (Since a zero length context is allowed, the |use_context| * flag controls whether a context is included.) It returns 1 on success and - * zero otherwise. + * 0 or -1 otherwise. */ __owur int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen, - const char *label, size_t llen, - const unsigned char *p, size_t plen, - int use_context); + const char *label, size_t llen, + const unsigned char *context, + size_t contextlen, int use_context); int SSL_get_sigalgs(SSL *s, int idx, int *psign, int *phash, int *psignandhash, @@ -298,9 +298,9 @@ SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB,0, (void (**)(void))cb) SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,(void (*)(void))cb) # define SSL_CTX_get_tlsext_status_arg(ssl, arg) \ -SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg + SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg) # define SSL_CTX_set_tlsext_status_arg(ssl, arg) \ -SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg) + SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg) #define SSL_CTX_set_tlsext_status_type(ssl, type) \ SSL_CTX_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE, type, NULL) @@ -883,7 +883,13 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) * when correcting this number, correct also SSL3_CT_NUMBER in ssl3.h (see * comment there) */ -# define TLS_CT_NUMBER 9 +# define TLS_CT_NUMBER 10 + +# if defined(SSL3_CT_NUMBER) +# if TLS_CT_NUMBER != SSL3_CT_NUMBER +# error "SSL/TLS CT_NUMBER values do not match" +# endif +# endif # define TLS1_FINISH_MAC_LENGTH 12 diff --git a/external/openssl/include/ios/openssl/ui.h b/external/openssl/include/ios/openssl/ui.h index 26f4f044..49e763de 100644 --- a/external/openssl/include/ios/openssl/ui.h +++ b/external/openssl/include/ios/openssl/ui.h @@ -339,8 +339,12 @@ int ERR_load_UI_strings(void); /* Error codes for the UI functions. */ /* Function codes. */ +# define UI_F_CLOSE_CONSOLE 115 +# define UI_F_ECHO_CONSOLE 116 # define UI_F_GENERAL_ALLOCATE_BOOLEAN 108 # define UI_F_GENERAL_ALLOCATE_PROMPT 109 +# define UI_F_NOECHO_CONSOLE 117 +# define UI_F_OPEN_CONSOLE 114 # define UI_F_UI_CREATE_METHOD 112 # define UI_F_UI_CTRL 111 # define UI_F_UI_DUP_ERROR_STRING 101 @@ -350,6 +354,7 @@ int ERR_load_UI_strings(void); # define UI_F_UI_DUP_VERIFY_STRING 106 # define UI_F_UI_GET0_RESULT 107 # define UI_F_UI_NEW_METHOD 104 +# define UI_F_UI_PROCESS 113 # define UI_F_UI_SET_RESULT 105 /* Reason codes. */ @@ -357,9 +362,14 @@ int ERR_load_UI_strings(void); # define UI_R_INDEX_TOO_LARGE 102 # define UI_R_INDEX_TOO_SMALL 103 # define UI_R_NO_RESULT_BUFFER 105 +# define UI_R_PROCESSING_ERROR 107 # define UI_R_RESULT_TOO_LARGE 100 # define UI_R_RESULT_TOO_SMALL 101 +# define UI_R_SYSASSIGN_ERROR 109 +# define UI_R_SYSDASSGN_ERROR 110 +# define UI_R_SYSQIOW_ERROR 111 # define UI_R_UNKNOWN_CONTROL_COMMAND 106 +# define UI_R_UNKNOWN_TTYGET_ERRNO_VALUE 108 # ifdef __cplusplus } diff --git a/external/openssl/include/ios/openssl/x509.h b/external/openssl/include/ios/openssl/x509.h index c8996f35..916afaf7 100644 --- a/external/openssl/include/ios/openssl/x509.h +++ b/external/openssl/include/ios/openssl/x509.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -641,7 +641,7 @@ int X509_get_signature_type(const X509 *x); /* * This one is only used so that a binary form can output, as in - * i2d_X509_NAME(X509_get_X509_PUBKEY(x),&buf) + * i2d_X509_NAME(X509_get_X509_PUBKEY(x), &buf) */ X509_PUBKEY *X509_get_X509_PUBKEY(const X509 *x); const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x); @@ -1055,6 +1055,7 @@ int ERR_load_X509_strings(void); # define X509_F_X509_LOAD_CERT_CRL_FILE 132 # define X509_F_X509_LOAD_CERT_FILE 111 # define X509_F_X509_LOAD_CRL_FILE 112 +# define X509_F_X509_LOOKUP_METH_NEW 160 # define X509_F_X509_NAME_ADD_ENTRY 113 # define X509_F_X509_NAME_ENTRY_CREATE_BY_NID 114 # define X509_F_X509_NAME_ENTRY_CREATE_BY_TXT 131 @@ -1091,6 +1092,7 @@ int ERR_load_X509_strings(void); # define X509_R_CRL_ALREADY_DELTA 127 # define X509_R_CRL_VERIFY_FAILURE 131 # define X509_R_IDP_MISMATCH 128 +# define X509_R_INVALID_ATTRIBUTES 135 # define X509_R_INVALID_DIRECTORY 113 # define X509_R_INVALID_FIELD_NAME 119 # define X509_R_INVALID_TRUST 123 diff --git a/external/openssl/include/ios/openssl/x509_vfy.h b/external/openssl/include/ios/openssl/x509_vfy.h index cab8005e..131b6cf7 100644 --- a/external/openssl/include/ios/openssl/x509_vfy.h +++ b/external/openssl/include/ios/openssl/x509_vfy.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -257,7 +257,9 @@ X509_OBJECT *X509_OBJECT_new(void); void X509_OBJECT_free(X509_OBJECT *a); X509_LOOKUP_TYPE X509_OBJECT_get_type(const X509_OBJECT *a); X509 *X509_OBJECT_get0_X509(const X509_OBJECT *a); +int X509_OBJECT_set1_X509(X509_OBJECT *a, X509 *obj); X509_CRL *X509_OBJECT_get0_X509_CRL(X509_OBJECT *a); +int X509_OBJECT_set1_X509_CRL(X509_OBJECT *a, X509_CRL *obj); X509_STORE *X509_STORE_new(void); void X509_STORE_free(X509_STORE *v); int X509_STORE_lock(X509_STORE *ctx); @@ -364,6 +366,76 @@ X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m); X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void); X509_LOOKUP_METHOD *X509_LOOKUP_file(void); +typedef int (*X509_LOOKUP_ctrl_fn)(X509_LOOKUP *ctx, int cmd, const char *argc, + long argl, char **ret); +typedef int (*X509_LOOKUP_get_by_subject_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + X509_NAME *name, + X509_OBJECT *ret); +typedef int (*X509_LOOKUP_get_by_issuer_serial_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + X509_NAME *name, + ASN1_INTEGER *serial, + X509_OBJECT *ret); +typedef int (*X509_LOOKUP_get_by_fingerprint_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + const unsigned char* bytes, + int len, + X509_OBJECT *ret); +typedef int (*X509_LOOKUP_get_by_alias_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + const char *str, + int len, + X509_OBJECT *ret); + +X509_LOOKUP_METHOD *X509_LOOKUP_meth_new(const char *name); +void X509_LOOKUP_meth_free(X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_new_item(X509_LOOKUP_METHOD *method, + int (*new_item) (X509_LOOKUP *ctx)); +int (*X509_LOOKUP_meth_get_new_item(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_free(X509_LOOKUP_METHOD *method, + void (*free_fn) (X509_LOOKUP *ctx)); +void (*X509_LOOKUP_meth_get_free(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_init(X509_LOOKUP_METHOD *method, + int (*init) (X509_LOOKUP *ctx)); +int (*X509_LOOKUP_meth_get_init(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_shutdown(X509_LOOKUP_METHOD *method, + int (*shutdown) (X509_LOOKUP *ctx)); +int (*X509_LOOKUP_meth_get_shutdown(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_ctrl(X509_LOOKUP_METHOD *method, + X509_LOOKUP_ctrl_fn ctrl_fn); +X509_LOOKUP_ctrl_fn X509_LOOKUP_meth_get_ctrl(const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_subject(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_subject_fn fn); +X509_LOOKUP_get_by_subject_fn X509_LOOKUP_meth_get_get_by_subject( + const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_issuer_serial(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_issuer_serial_fn fn); +X509_LOOKUP_get_by_issuer_serial_fn X509_LOOKUP_meth_get_get_by_issuer_serial( + const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_fingerprint(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_fingerprint_fn fn); +X509_LOOKUP_get_by_fingerprint_fn X509_LOOKUP_meth_get_get_by_fingerprint( + const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_alias(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_alias_fn fn); +X509_LOOKUP_get_by_alias_fn X509_LOOKUP_meth_get_get_by_alias( + const X509_LOOKUP_METHOD *method); + + int X509_STORE_add_cert(X509_STORE *ctx, X509 *x); int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x); @@ -393,6 +465,9 @@ int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, X509_OBJECT *ret); int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, const char *str, int len, X509_OBJECT *ret); +int X509_LOOKUP_set_method_data(X509_LOOKUP *ctx, void *data); +void *X509_LOOKUP_get_method_data(const X509_LOOKUP *ctx); +X509_STORE *X509_LOOKUP_get_store(const X509_LOOKUP *ctx); int X509_LOOKUP_shutdown(X509_LOOKUP *ctx); int X509_STORE_load_locations(X509_STORE *ctx, @@ -458,18 +533,24 @@ int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose); int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust); void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth); void X509_VERIFY_PARAM_set_auth_level(X509_VERIFY_PARAM *param, int auth_level); +time_t X509_VERIFY_PARAM_get_time(const X509_VERIFY_PARAM *param); void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t); int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param, ASN1_OBJECT *policy); int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param, STACK_OF(ASN1_OBJECT) *policies); +int X509_VERIFY_PARAM_set_inh_flags(X509_VERIFY_PARAM *param, + uint32_t flags); +uint32_t X509_VERIFY_PARAM_get_inh_flags(const X509_VERIFY_PARAM *param); + int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param, const char *name, size_t namelen); int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param, const char *name, size_t namelen); void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param, unsigned int flags); +unsigned int X509_VERIFY_PARAM_get_hostflags(const X509_VERIFY_PARAM *param); char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *); void X509_VERIFY_PARAM_move_peername(X509_VERIFY_PARAM *, X509_VERIFY_PARAM *); int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param, diff --git a/external/openssl/include/ios/openssl/x509v3.h b/external/openssl/include/ios/openssl/x509v3.h index f21ce7c1..c93b112f 100644 --- a/external/openssl/include/ios/openssl/x509v3.h +++ b/external/openssl/include/ios/openssl/x509v3.h @@ -1,5 +1,5 @@ /* - * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -355,6 +355,7 @@ struct ISSUING_DIST_POINT_st { # define EXFLAG_SI 0x20 # define EXFLAG_V1 0x40 # define EXFLAG_INVALID 0x80 +/* EXFLAG_SET is set to indicate that some values have been precomputed */ # define EXFLAG_SET 0x100 # define EXFLAG_CRITICAL 0x200 # define EXFLAG_PROXY 0x400 @@ -657,6 +658,7 @@ uint32_t X509_get_extension_flags(X509 *x); uint32_t X509_get_key_usage(X509 *x); uint32_t X509_get_extended_key_usage(X509 *x); const ASN1_OCTET_STRING *X509_get0_subject_key_id(X509 *x); +const ASN1_OCTET_STRING *X509_get0_authority_key_id(X509 *x); int X509_PURPOSE_get_count(void); X509_PURPOSE *X509_PURPOSE_get0(int idx); @@ -875,6 +877,7 @@ int ERR_load_X509V3_strings(void); # define X509V3_F_ADDR_VALIDATE_PATH_INTERNAL 166 # define X509V3_F_ASIDENTIFIERCHOICE_CANONIZE 161 # define X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL 162 +# define X509V3_F_BIGNUM_TO_STRING 167 # define X509V3_F_COPY_EMAIL 122 # define X509V3_F_COPY_ISSUER 123 # define X509V3_F_DO_DIRNAME 144 diff --git a/external/openssl/include/linux/openssl/asn1.h b/external/openssl/include/linux/openssl/asn1.h index 7cf61161..d0b1099a 100644 --- a/external/openssl/include/linux/openssl/asn1.h +++ b/external/openssl/include/linux/openssl/asn1.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -625,8 +625,8 @@ ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t); ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day, long offset_sec); int ASN1_TIME_check(const ASN1_TIME *t); -ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME - **out); +ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *t, + ASN1_GENERALIZEDTIME **out); int ASN1_TIME_set_string(ASN1_TIME *s, const char *str); int i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a); @@ -946,14 +946,17 @@ int ERR_load_ASN1_strings(void); # define ASN1_F_C2I_ASN1_INTEGER 194 # define ASN1_F_C2I_ASN1_OBJECT 196 # define ASN1_F_C2I_IBUF 226 +# define ASN1_F_C2I_UINT64_INT 101 # define ASN1_F_COLLECT_DATA 140 # define ASN1_F_D2I_ASN1_OBJECT 147 # define ASN1_F_D2I_ASN1_UINTEGER 150 # define ASN1_F_D2I_AUTOPRIVATEKEY 207 # define ASN1_F_D2I_PRIVATEKEY 154 # define ASN1_F_D2I_PUBLICKEY 155 +# define ASN1_F_DO_BUF 142 # define ASN1_F_DO_TCREATE 222 # define ASN1_F_I2D_ASN1_BIO_STREAM 211 +# define ASN1_F_I2D_ASN1_OBJECT 143 # define ASN1_F_I2D_DSA_PUBKEY 161 # define ASN1_F_I2D_EC_PUBKEY 181 # define ASN1_F_I2D_PRIVATEKEY 163 @@ -971,6 +974,8 @@ int ERR_load_ASN1_strings(void); # define ASN1_F_SMIME_READ_ASN1 212 # define ASN1_F_SMIME_TEXT 213 # define ASN1_F_STBL_MODULE_INIT 223 +# define ASN1_F_UINT32_C2I 105 +# define ASN1_F_UINT64_C2I 112 # define ASN1_F_X509_CRL_ADD0_REVOKED 169 # define ASN1_F_X509_INFO_NEW 170 # define ASN1_F_X509_NAME_ENCODE 203 @@ -1048,6 +1053,7 @@ int ERR_load_ASN1_strings(void); # define ASN1_R_MSTRING_NOT_UNIVERSAL 139 # define ASN1_R_MSTRING_WRONG_TAG 140 # define ASN1_R_NESTED_ASN1_STRING 197 +# define ASN1_R_NESTED_TOO_DEEP 201 # define ASN1_R_NON_HEX_CHARACTERS 141 # define ASN1_R_NOT_ASCII_FORMAT 190 # define ASN1_R_NOT_ENOUGH_DATA 142 diff --git a/external/openssl/include/linux/openssl/asn1t.h b/external/openssl/include/linux/openssl/asn1t.h index 8eedfb3f..a5248293 100644 --- a/external/openssl/include/linux/openssl/asn1t.h +++ b/external/openssl/include/linux/openssl/asn1t.h @@ -346,17 +346,22 @@ extern "C" { /* OPTIONAL simple type */ # define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type) +# define ASN1_OPT_EMBED(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED, 0, stname, field, type) /* IMPLICIT tagged simple type */ # define ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0) +# define ASN1_IMP_EMBED(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_EMBED) /* IMPLICIT tagged OPTIONAL simple type */ # define ASN1_IMP_OPT(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) +# define ASN1_IMP_OPT_EMBED(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED) /* Same as above but EXPLICIT */ # define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0) +# define ASN1_EXP_EMBED(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_EMBED) # define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) +# define ASN1_EXP_OPT_EMBED(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED) /* SEQUENCE OF type */ # define ASN1_SEQUENCE_OF(stname, field, type) \ diff --git a/external/openssl/include/linux/openssl/bio.h b/external/openssl/include/linux/openssl/bio.h index 9bc941b2..3a728625 100644 --- a/external/openssl/include/linux/openssl/bio.h +++ b/external/openssl/include/linux/openssl/bio.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -20,11 +20,7 @@ # include # ifndef OPENSSL_NO_SCTP -# ifndef OPENSSL_SYS_VMS -# include -# else -# include -# endif +# include # endif #ifdef __cplusplus @@ -129,11 +125,10 @@ extern "C" { # define BIO_CTRL_DGRAM_GET_MTU_OVERHEAD 49 -# define BIO_CTRL_DGRAM_SET_PEEK_MODE 50 - +/* Deliberately outside of OPENSSL_NO_SCTP - used in bss_dgram.c */ +# define BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE 50 # ifndef OPENSSL_NO_SCTP /* SCTP stuff */ -# define BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE 50 # define BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY 51 # define BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY 52 # define BIO_CTRL_DGRAM_SCTP_AUTH_CCS_RCVD 53 @@ -146,6 +141,8 @@ extern "C" { # define BIO_CTRL_DGRAM_SCTP_SAVE_SHUTDOWN 70 # endif +# define BIO_CTRL_DGRAM_SET_PEEK_MODE 71 + /* modifiers */ # define BIO_FP_READ 0x02 # define BIO_FP_WRITE 0x04 @@ -170,7 +167,7 @@ extern "C" { /* * This is used with memory BIOs: * BIO_FLAGS_MEM_RDONLY means we shouldn't free up or change the data in any way; - * BIO_FLAGS_NONCLEAR_RST means we should't clear data on reset. + * BIO_FLAGS_NONCLEAR_RST means we shouldn't clear data on reset. */ # define BIO_FLAGS_MEM_RDONLY 0x200 # define BIO_FLAGS_NONCLEAR_RST 0x400 @@ -249,7 +246,8 @@ typedef struct bio_method_st BIO_METHOD; const char *BIO_method_name(const BIO *b); int BIO_method_type(const BIO *b); -typedef void bio_info_cb(BIO *, int, const char *, int, long, long); +typedef int BIO_info_cb(BIO *, int, int); +typedef BIO_info_cb bio_info_cb; /* backward compatibility */ DEFINE_STACK_OF(BIO) @@ -550,8 +548,7 @@ int BIO_write(BIO *b, const void *data, int len); int BIO_puts(BIO *bp, const char *buf); int BIO_indent(BIO *b, int indent, int max); long BIO_ctrl(BIO *bp, int cmd, long larg, void *parg); -long BIO_callback_ctrl(BIO *b, int cmd, - void (*fp) (BIO *, int, const char *, int, long, long)); +long BIO_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp); void *BIO_ptr_ctrl(BIO *bp, int cmd, long larg); long BIO_int_ctrl(BIO *bp, int cmd, long larg, int iarg); BIO *BIO_push(BIO *b, BIO *append); @@ -733,30 +730,30 @@ __bio_h__attr__((__format__(__printf__, 3, 0))); BIO_METHOD *BIO_meth_new(int type, const char *name); void BIO_meth_free(BIO_METHOD *biom); -int (*BIO_meth_get_write(BIO_METHOD *biom)) (BIO *, const char *, int); +int (*BIO_meth_get_write(const BIO_METHOD *biom)) (BIO *, const char *, int); int BIO_meth_set_write(BIO_METHOD *biom, int (*write) (BIO *, const char *, int)); -int (*BIO_meth_get_read(BIO_METHOD *biom)) (BIO *, char *, int); +int (*BIO_meth_get_read(const BIO_METHOD *biom)) (BIO *, char *, int); int BIO_meth_set_read(BIO_METHOD *biom, int (*read) (BIO *, char *, int)); -int (*BIO_meth_get_puts(BIO_METHOD *biom)) (BIO *, const char *); +int (*BIO_meth_get_puts(const BIO_METHOD *biom)) (BIO *, const char *); int BIO_meth_set_puts(BIO_METHOD *biom, int (*puts) (BIO *, const char *)); -int (*BIO_meth_get_gets(BIO_METHOD *biom)) (BIO *, char *, int); +int (*BIO_meth_get_gets(const BIO_METHOD *biom)) (BIO *, char *, int); int BIO_meth_set_gets(BIO_METHOD *biom, int (*gets) (BIO *, char *, int)); -long (*BIO_meth_get_ctrl(BIO_METHOD *biom)) (BIO *, int, long, void *); +long (*BIO_meth_get_ctrl(const BIO_METHOD *biom)) (BIO *, int, long, void *); int BIO_meth_set_ctrl(BIO_METHOD *biom, long (*ctrl) (BIO *, int, long, void *)); -int (*BIO_meth_get_create(BIO_METHOD *bion)) (BIO *); +int (*BIO_meth_get_create(const BIO_METHOD *bion)) (BIO *); int BIO_meth_set_create(BIO_METHOD *biom, int (*create) (BIO *)); -int (*BIO_meth_get_destroy(BIO_METHOD *biom)) (BIO *); +int (*BIO_meth_get_destroy(const BIO_METHOD *biom)) (BIO *); int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy) (BIO *)); -long (*BIO_meth_get_callback_ctrl(BIO_METHOD *biom)) - (BIO *, int, bio_info_cb *); +long (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom)) + (BIO *, int, BIO_info_cb *); int BIO_meth_set_callback_ctrl(BIO_METHOD *biom, long (*callback_ctrl) (BIO *, int, - bio_info_cb *)); + BIO_info_cb *)); /* BEGIN ERROR CODES */ /* @@ -784,6 +781,7 @@ int ERR_load_BIO_strings(void); # define BIO_F_BIO_LISTEN 139 # define BIO_F_BIO_LOOKUP 135 # define BIO_F_BIO_MAKE_PAIR 121 +# define BIO_F_BIO_METH_NEW 146 # define BIO_F_BIO_NEW 108 # define BIO_F_BIO_NEW_FILE 109 # define BIO_F_BIO_NEW_MEM_BUF 126 diff --git a/external/openssl/include/linux/openssl/bn.h b/external/openssl/include/linux/openssl/bn.h index 17bd5213..301edd52 100644 --- a/external/openssl/include/linux/openssl/bn.h +++ b/external/openssl/include/linux/openssl/bn.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -119,25 +119,76 @@ void *BN_GENCB_get_arg(BN_GENCB *cb); * on the size of the number */ /* - * number of Miller-Rabin iterations for an error rate of less than 2^-80 for - * random 'b'-bit input, b >= 100 (taken from table 4.4 in the Handbook of - * Applied Cryptography [Menezes, van Oorschot, Vanstone; CRC Press 1996]; - * original paper: Damgaard, Landrock, Pomerance: Average case error - * estimates for the strong probable prime test. -- Math. Comp. 61 (1993) - * 177-194) + * BN_prime_checks_for_size() returns the number of Miller-Rabin iterations + * that will be done for checking that a random number is probably prime. The + * error rate for accepting a composite number as prime depends on the size of + * the prime |b|. The error rates used are for calculating an RSA key with 2 primes, + * and so the level is what you would expect for a key of double the size of the + * prime. + * + * This table is generated using the algorithm of FIPS PUB 186-4 + * Digital Signature Standard (DSS), section F.1, page 117. + * (https://dx.doi.org/10.6028/NIST.FIPS.186-4) + * + * The following magma script was used to generate the output: + * securitybits:=125; + * k:=1024; + * for t:=1 to 65 do + * for M:=3 to Floor(2*Sqrt(k-1)-1) do + * S:=0; + * // Sum over m + * for m:=3 to M do + * s:=0; + * // Sum over j + * for j:=2 to m do + * s+:=(RealField(32)!2)^-(j+(k-1)/j); + * end for; + * S+:=2^(m-(m-1)*t)*s; + * end for; + * A:=2^(k-2-M*t); + * B:=8*(Pi(RealField(32))^2-6)/3*2^(k-2)*S; + * pkt:=2.00743*Log(2)*k*2^-k*(A+B); + * seclevel:=Floor(-Log(2,pkt)); + * if seclevel ge securitybits then + * printf "k: %5o, security: %o bits (t: %o, M: %o)\n",k,seclevel,t,M; + * break; + * end if; + * end for; + * if seclevel ge securitybits then break; end if; + * end for; + * + * It can be run online at: + * http://magma.maths.usyd.edu.au/calc + * + * And will output: + * k: 1024, security: 129 bits (t: 6, M: 23) + * + * k is the number of bits of the prime, securitybits is the level we want to + * reach. + * + * prime length | RSA key size | # MR tests | security level + * -------------+--------------|------------+--------------- + * (b) >= 6394 | >= 12788 | 3 | 256 bit + * (b) >= 3747 | >= 7494 | 3 | 192 bit + * (b) >= 1345 | >= 2690 | 4 | 128 bit + * (b) >= 1080 | >= 2160 | 5 | 128 bit + * (b) >= 852 | >= 1704 | 5 | 112 bit + * (b) >= 476 | >= 952 | 5 | 80 bit + * (b) >= 400 | >= 800 | 6 | 80 bit + * (b) >= 347 | >= 694 | 7 | 80 bit + * (b) >= 308 | >= 616 | 8 | 80 bit + * (b) >= 55 | >= 110 | 27 | 64 bit + * (b) >= 6 | >= 12 | 34 | 64 bit */ -# define BN_prime_checks_for_size(b) ((b) >= 1300 ? 2 : \ - (b) >= 850 ? 3 : \ - (b) >= 650 ? 4 : \ - (b) >= 550 ? 5 : \ - (b) >= 450 ? 6 : \ - (b) >= 400 ? 7 : \ - (b) >= 350 ? 8 : \ - (b) >= 300 ? 9 : \ - (b) >= 250 ? 12 : \ - (b) >= 200 ? 15 : \ - (b) >= 150 ? 18 : \ - /* b >= 100 */ 27) + +# define BN_prime_checks_for_size(b) ((b) >= 3747 ? 3 : \ + (b) >= 1345 ? 4 : \ + (b) >= 476 ? 5 : \ + (b) >= 400 ? 6 : \ + (b) >= 347 ? 7 : \ + (b) >= 308 ? 8 : \ + (b) >= 55 ? 27 : \ + /* b >= 6 */ 34) # define BN_num_bytes(a) ((BN_num_bits(a)+7)/8) @@ -196,7 +247,7 @@ int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx); */ void BN_set_negative(BIGNUM *b, int n); /** BN_is_negative returns 1 if the BIGNUM is negative - * \param a pointer to the BIGNUM object + * \param b pointer to the BIGNUM object * \return 1 if a < 0 and 0 otherwise */ int BN_is_negative(const BIGNUM *b); diff --git a/external/openssl/include/linux/openssl/buffer.h b/external/openssl/include/linux/openssl/buffer.h index 91f0e07f..35160b4f 100644 --- a/external/openssl/include/linux/openssl/buffer.h +++ b/external/openssl/include/linux/openssl/buffer.h @@ -21,10 +21,7 @@ extern "C" { #endif # include - -# if !defined(NO_SYS_TYPES_H) -# include -# endif +# include /* * These names are outdated as of OpenSSL 1.1; a future release diff --git a/external/openssl/include/linux/openssl/conf.h b/external/openssl/include/linux/openssl/conf.h index 462e3c9d..e0539e31 100644 --- a/external/openssl/include/linux/openssl/conf.h +++ b/external/openssl/include/linux/openssl/conf.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -191,6 +191,7 @@ int ERR_load_CONF_strings(void); # define CONF_F_NCONF_LOAD_BIO 110 # define CONF_F_NCONF_LOAD_FP 114 # define CONF_F_NCONF_NEW 111 +# define CONF_F_SSL_MODULE_INIT 123 # define CONF_F_STR_COPY 101 /* Reason codes. */ @@ -206,8 +207,13 @@ int ERR_load_CONF_strings(void); # define CONF_R_NO_SECTION 107 # define CONF_R_NO_SUCH_FILE 114 # define CONF_R_NO_VALUE 108 +# define CONF_R_SSL_COMMAND_SECTION_EMPTY 117 +# define CONF_R_SSL_COMMAND_SECTION_NOT_FOUND 118 +# define CONF_R_SSL_SECTION_EMPTY 119 +# define CONF_R_SSL_SECTION_NOT_FOUND 120 # define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103 # define CONF_R_UNKNOWN_MODULE_NAME 113 +# define CONF_R_VARIABLE_EXPANSION_TOO_LONG 116 # define CONF_R_VARIABLE_HAS_NO_VALUE 104 # ifdef __cplusplus diff --git a/external/openssl/include/linux/openssl/crypto.h b/external/openssl/include/linux/openssl/crypto.h index bd0b1408..fa3f12af 100644 --- a/external/openssl/include/linux/openssl/crypto.h +++ b/external/openssl/include/linux/openssl/crypto.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -146,6 +146,8 @@ int CRYPTO_mem_ctrl(int mode); CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE) # define OPENSSL_secure_free(addr) \ CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE) +# define OPENSSL_secure_clear_free(addr, num) \ + CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE) # define OPENSSL_secure_actual_size(ptr) \ CRYPTO_secure_actual_size(ptr) @@ -174,7 +176,7 @@ typedef void CRYPTO_EX_new (void *parent, void *ptr, CRYPTO_EX_DATA *ad, typedef void CRYPTO_EX_free (void *parent, void *ptr, CRYPTO_EX_DATA *ad, int idx, long argl, void *argp); typedef int CRYPTO_EX_dup (CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from, - void *srcp, int idx, long argl, void *argp); + void *from_d, int idx, long argl, void *argp); __owur int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); @@ -285,6 +287,8 @@ int CRYPTO_secure_malloc_done(void); void *CRYPTO_secure_malloc(size_t num, const char *file, int line); void *CRYPTO_secure_zalloc(size_t num, const char *file, int line); void CRYPTO_secure_free(void *ptr, const char *file, int line); +void CRYPTO_secure_clear_free(void *ptr, size_t num, + const char *file, int line); int CRYPTO_secure_allocated(const void *ptr); int CRYPTO_secure_malloc_initialized(void); size_t CRYPTO_secure_actual_size(void *ptr); @@ -367,7 +371,9 @@ int CRYPTO_memcmp(const volatile void * volatile in_a, # define OPENSSL_INIT_ENGINE_CAPI 0x00002000L # define OPENSSL_INIT_ENGINE_PADLOCK 0x00004000L # define OPENSSL_INIT_ENGINE_AFALG 0x00008000L -/* OPENSSL_INIT flag 0x00010000 reserved for internal use */ +/* OPENSSL_INIT_ZLIB 0x00010000L */ +/* currently unused 0x00020000L */ +/* OPENSSL_INIT_BASE_ONLY 0x00040000L */ /* OPENSSL_INIT flag range 0xfff00000 reserved for OPENSSL_init_ssl() */ /* Max OPENSSL_INIT flag value is 0x80000000 */ diff --git a/external/openssl/include/linux/openssl/ct.h b/external/openssl/include/linux/openssl/ct.h index 6c632652..bf29fbab 100644 --- a/external/openssl/include/linux/openssl/ct.h +++ b/external/openssl/include/linux/openssl/ct.h @@ -98,6 +98,21 @@ const CTLOG_STORE *CT_POLICY_EVAL_CTX_get0_log_store(const CT_POLICY_EVAL_CTX *c void CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE(CT_POLICY_EVAL_CTX *ctx, CTLOG_STORE *log_store); +/* + * Gets the time, in milliseconds since the Unix epoch, that will be used as the + * current time when checking whether an SCT was issued in the future. + * Such SCTs will fail validation, as required by RFC6962. + */ +uint64_t CT_POLICY_EVAL_CTX_get_time(const CT_POLICY_EVAL_CTX *ctx); + +/* + * Sets the time to evaluate SCTs against, in milliseconds since the Unix epoch. + * If an SCT's timestamp is after this time, it will be interpreted as having + * been issued in the future. RFC6962 states that "TLS clients MUST reject SCTs + * whose timestamp is in the future", so an SCT will not validate in this case. + */ +void CT_POLICY_EVAL_CTX_set_time(CT_POLICY_EVAL_CTX *ctx, uint64_t time_in_ms); + /***************** * SCT functions * *****************/ @@ -467,7 +482,6 @@ int ERR_load_CT_strings(void); # define CT_F_CTLOG_NEW 117 # define CT_F_CTLOG_NEW_FROM_BASE64 118 # define CT_F_CTLOG_NEW_FROM_CONF 119 -# define CT_F_CTLOG_NEW_NULL 120 # define CT_F_CTLOG_STORE_LOAD_CTX_NEW 122 # define CT_F_CTLOG_STORE_LOAD_FILE 123 # define CT_F_CTLOG_STORE_LOAD_LOG 130 @@ -482,6 +496,7 @@ int ERR_load_CT_strings(void); # define CT_F_O2I_SCT_LIST 111 # define CT_F_O2I_SCT_SIGNATURE 112 # define CT_F_SCT_CTX_NEW 126 +# define CT_F_SCT_CTX_VERIFY 128 # define CT_F_SCT_NEW 100 # define CT_F_SCT_NEW_FROM_BASE64 127 # define CT_F_SCT_SET0_LOG_ID 101 @@ -491,7 +506,6 @@ int ERR_load_CT_strings(void); # define CT_F_SCT_SET_LOG_ENTRY_TYPE 102 # define CT_F_SCT_SET_SIGNATURE_NID 103 # define CT_F_SCT_SET_VERSION 104 -# define CT_F_SCT_CTX_VERIFY 128 /* Reason codes. */ # define CT_R_BASE64_DECODE_ERROR 108 @@ -501,6 +515,7 @@ int ERR_load_CT_strings(void); # define CT_R_LOG_CONF_MISSING_DESCRIPTION 111 # define CT_R_LOG_CONF_MISSING_KEY 112 # define CT_R_LOG_KEY_INVALID 113 +# define CT_R_SCT_FUTURE_TIMESTAMP 116 # define CT_R_SCT_INVALID 104 # define CT_R_SCT_INVALID_SIGNATURE 107 # define CT_R_SCT_LIST_INVALID 105 diff --git a/external/openssl/include/linux/openssl/dh.h b/external/openssl/include/linux/openssl/dh.h index ae309e7b..8cf879e1 100644 --- a/external/openssl/include/linux/openssl/dh.h +++ b/external/openssl/include/linux/openssl/dh.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -87,12 +87,29 @@ DECLARE_ASN1_ITEM(DHparams) */ # define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME -# define d2i_DHparams_fp(fp,x) (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ - (char *(*)())d2i_DHparams,(fp),(unsigned char **)(x)) -# define i2d_DHparams_fp(fp,x) ASN1_i2d_fp(i2d_DHparams,(fp), \ - (unsigned char *)(x)) -# define d2i_DHparams_bio(bp,x) ASN1_d2i_bio_of(DH,DH_new,d2i_DHparams,bp,x) -# define i2d_DHparams_bio(bp,x) ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x) +# define d2i_DHparams_fp(fp,x) \ + (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ + (char *(*)())d2i_DHparams, \ + (fp), \ + (unsigned char **)(x)) +# define i2d_DHparams_fp(fp,x) \ + ASN1_i2d_fp(i2d_DHparams,(fp), (unsigned char *)(x)) +# define d2i_DHparams_bio(bp,x) \ + ASN1_d2i_bio_of(DH, DH_new, d2i_DHparams, bp, x) +# define i2d_DHparams_bio(bp,x) \ + ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x) + +# define d2i_DHxparams_fp(fp,x) \ + (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ + (char *(*)())d2i_DHxparams, \ + (fp), \ + (unsigned char **)(x)) +# define i2d_DHxparams_fp(fp,x) \ + ASN1_i2d_fp(i2d_DHxparams,(fp), (unsigned char *)(x)) +# define d2i_DHxparams_bio(bp,x) \ + ASN1_d2i_bio_of(DH, DH_new, d2i_DHxparams, bp, x) +# define i2d_DHxparams_bio(bp,x) \ + ASN1_i2d_bio_of_const(DH, i2d_DHxparams, bp, x) DH *DHparams_dup(DH *); @@ -124,6 +141,7 @@ DEPRECATEDIN_0_9_8(DH *DH_generate_parameters(int prime_len, int generator, int DH_generate_parameters_ex(DH *dh, int prime_len, int generator, BN_GENCB *cb); +int DH_check_params(const DH *dh, int *ret); int DH_check(const DH *dh, int *codes); int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *codes); int DH_generate_key(DH *dh); @@ -169,7 +187,7 @@ void DH_meth_free(DH_METHOD *dhm); DH_METHOD *DH_meth_dup(const DH_METHOD *dhm); const char *DH_meth_get0_name(const DH_METHOD *dhm); int DH_meth_set1_name(DH_METHOD *dhm, const char *name); -int DH_meth_get_flags(DH_METHOD *dhm); +int DH_meth_get_flags(const DH_METHOD *dhm); int DH_meth_set_flags(DH_METHOD *dhm, int flags); void *DH_meth_get0_app_data(const DH_METHOD *dhm); int DH_meth_set0_app_data(DH_METHOD *dhm, void *app_data); diff --git a/external/openssl/include/linux/openssl/dsa.h b/external/openssl/include/linux/openssl/dsa.h index cb5fbc2f..3a7b1a62 100644 --- a/external/openssl/include/linux/openssl/dsa.h +++ b/external/openssl/include/linux/openssl/dsa.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -146,10 +146,12 @@ int DSAparams_print_fp(FILE *fp, const DSA *x); int DSA_print_fp(FILE *bp, const DSA *x, int off); # endif -# define DSS_prime_checks 50 +# define DSS_prime_checks 64 /* - * Primality test according to FIPS PUB 186[-1], Appendix 2.1: 50 rounds of - * Rabin-Miller + * Primality test according to FIPS PUB 186-4, Appendix C.3. Since we only + * have one value here we set the number of checks to 64 which is the 128 bit + * security level that is the highest level and valid for creating a 3072 bit + * DSA key. */ # define DSA_is_prime(n, callback, cb_arg) \ BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg) @@ -186,7 +188,7 @@ void DSA_meth_free(DSA_METHOD *dsam); DSA_METHOD *DSA_meth_dup(const DSA_METHOD *dsam); const char *DSA_meth_get0_name(const DSA_METHOD *dsam); int DSA_meth_set1_name(DSA_METHOD *dsam, const char *name); -int DSA_meth_get_flags(DSA_METHOD *dsam); +int DSA_meth_get_flags(const DSA_METHOD *dsam); int DSA_meth_set_flags(DSA_METHOD *dsam, int flags); void *DSA_meth_get0_app_data(const DSA_METHOD *dsam); int DSA_meth_set0_app_data(DSA_METHOD *dsam, void *app_data); @@ -260,6 +262,7 @@ int ERR_load_DSA_strings(void); # define DSA_F_DSA_SIG_NEW 102 # define DSA_F_OLD_DSA_PRIV_DECODE 122 # define DSA_F_PKEY_DSA_CTRL 120 +# define DSA_F_PKEY_DSA_CTRL_STR 104 # define DSA_F_PKEY_DSA_KEYGEN 121 /* Reason codes. */ @@ -274,6 +277,7 @@ int ERR_load_DSA_strings(void); # define DSA_R_NO_PARAMETERS_SET 107 # define DSA_R_PARAMETER_ENCODING_ERROR 105 # define DSA_R_Q_NOT_PRIME 113 +# define DSA_R_SEED_LEN_SMALL 110 # ifdef __cplusplus } diff --git a/external/openssl/include/linux/openssl/e_os2.h b/external/openssl/include/linux/openssl/e_os2.h index 99ea3477..9800e154 100644 --- a/external/openssl/include/linux/openssl/e_os2.h +++ b/external/openssl/include/linux/openssl/e_os2.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -49,7 +49,6 @@ extern "C" { # define OPENSSL_SYS_WIN32_UWIN # else # if defined(__CYGWIN__) || defined(OPENSSL_SYS_CYGWIN) -# undef OPENSSL_SYS_UNIX # define OPENSSL_SYS_WIN32_CYGWIN # else # if defined(_WIN32) || defined(OPENSSL_SYS_WIN32) @@ -212,9 +211,9 @@ extern "C" { # endif # endif -# if defined(OPENSSL_SYS_UEFI) && !defined(ssize_t) -# define ossl_ssize_t int -# define OSSL_SSIZE_MAX INT_MAX +# if defined(OPENSSL_SYS_UEFI) && !defined(ossl_ssize_t) +# define ossl_ssize_t INTN +# define OSSL_SSIZE_MAX MAX_INTN # endif # ifndef ossl_ssize_t @@ -242,7 +241,6 @@ typedef INT32 int32_t; typedef UINT32 uint32_t; typedef INT64 int64_t; typedef UINT64 uint64_t; -# define PRIu64 "%Lu" # elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ defined(__osf__) || defined(__sgi) || defined(__hpux) || \ defined(OPENSSL_SYS_VMS) || defined (__OpenBSD__) @@ -264,18 +262,6 @@ typedef unsigned __int64 uint64_t; # include # endif -/* - * We need a format operator for some client tools for uint64_t. If inttypes.h - * isn't available or did not define it, just go with hard-coded. - */ -# ifndef PRIu64 -# ifdef SIXTY_FOUR_BIT_LONG -# define PRIu64 "lu" -# else -# define PRIu64 "llu" -# endif -# endif - /* ossl_inline: portable inline definition usable in public headers */ # if !defined(inline) && !defined(__cplusplus) # if defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L diff --git a/external/openssl/include/linux/openssl/ec.h b/external/openssl/include/linux/openssl/ec.h index 656cb410..c4aeaed5 100644 --- a/external/openssl/include/linux/openssl/ec.h +++ b/external/openssl/include/linux/openssl/ec.h @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2002-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -573,11 +573,9 @@ int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p, * \param point EC_POINT object * \param form point conversion form * \param pbuf returns pointer to allocated buffer - * \param len length of the memory buffer * \param ctx BN_CTX object (optional) * \return the length of the encoded octet string or 0 if an error occurred */ - size_t EC_POINT_point2buf(const EC_GROUP *group, const EC_POINT *point, point_conversion_form_t form, unsigned char **pbuf, BN_CTX *ctx); @@ -863,7 +861,7 @@ int EC_KEY_generate_key(EC_KEY *key); int EC_KEY_check_key(const EC_KEY *key); /** Indicates if an EC_KEY can be used for signing. - * \param key the EC_KEY object + * \param eckey the EC_KEY object * \return 1 if can can sign and 0 otherwise. */ int EC_KEY_can_sign(const EC_KEY *eckey); @@ -882,11 +880,9 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, * \param key key to encode * \param form point conversion form * \param pbuf returns pointer to allocated buffer - * \param len length of the memory buffer * \param ctx BN_CTX object (optional) * \return the length of the encoded octet string or 0 if an error occurred */ - size_t EC_KEY_key2buf(const EC_KEY *key, point_conversion_form_t form, unsigned char **pbuf, BN_CTX *ctx); @@ -921,11 +917,10 @@ int EC_KEY_oct2priv(EC_KEY *key, const unsigned char *buf, size_t len); size_t EC_KEY_priv2oct(const EC_KEY *key, unsigned char *buf, size_t len); /** Encodes an EC_KEY private key to an allocated octet string - * \param key key to encode + * \param eckey key to encode * \param pbuf returns pointer to allocated buffer * \return the length of the encoded octet string or 0 if an error occurred */ - size_t EC_KEY_priv2buf(const EC_KEY *eckey, unsigned char **pbuf); /********************************************************************/ @@ -1228,7 +1223,7 @@ void EC_KEY_METHOD_set_verify(EC_KEY_METHOD *meth, const ECDSA_SIG *sig, EC_KEY *eckey)); -void EC_KEY_METHOD_get_init(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_init(const EC_KEY_METHOD *meth, int (**pinit)(EC_KEY *key), void (**pfinish)(EC_KEY *key), int (**pcopy)(EC_KEY *dest, const EC_KEY *src), @@ -1239,16 +1234,16 @@ void EC_KEY_METHOD_get_init(EC_KEY_METHOD *meth, int (**pset_public)(EC_KEY *key, const EC_POINT *pub_key)); -void EC_KEY_METHOD_get_keygen(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_keygen(const EC_KEY_METHOD *meth, int (**pkeygen)(EC_KEY *key)); -void EC_KEY_METHOD_get_compute_key(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_compute_key(const EC_KEY_METHOD *meth, int (**pck)(unsigned char **psec, size_t *pseclen, const EC_POINT *pub_key, const EC_KEY *ecdh)); -void EC_KEY_METHOD_get_sign(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_sign(const EC_KEY_METHOD *meth, int (**psign)(int type, const unsigned char *dgst, int dlen, unsigned char *sig, unsigned int *siglen, @@ -1262,7 +1257,7 @@ void EC_KEY_METHOD_get_sign(EC_KEY_METHOD *meth, const BIGNUM *in_r, EC_KEY *eckey)); -void EC_KEY_METHOD_get_verify(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_verify(const EC_KEY_METHOD *meth, int (**pverify)(int type, const unsigned char *dgst, int dgst_len, const unsigned char *sigbuf, @@ -1404,6 +1399,7 @@ int ERR_load_EC_strings(void); # define EC_F_EC_ASN1_GROUP2CURVE 153 # define EC_F_EC_ASN1_GROUP2FIELDID 154 # define EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY 208 +# define EC_F_EC_GF2M_SIMPLE_FIELD_INV 296 # define EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT 159 # define EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE 195 # define EC_F_EC_GF2M_SIMPLE_OCT2POINT 160 @@ -1413,6 +1409,7 @@ int ERR_load_EC_strings(void); # define EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES 164 # define EC_F_EC_GFP_MONT_FIELD_DECODE 133 # define EC_F_EC_GFP_MONT_FIELD_ENCODE 134 +# define EC_F_EC_GFP_MONT_FIELD_INV 297 # define EC_F_EC_GFP_MONT_FIELD_MUL 131 # define EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE 209 # define EC_F_EC_GFP_MONT_FIELD_SQR 132 @@ -1429,6 +1426,8 @@ int ERR_load_EC_strings(void); # define EC_F_EC_GFP_NIST_FIELD_MUL 200 # define EC_F_EC_GFP_NIST_FIELD_SQR 201 # define EC_F_EC_GFP_NIST_GROUP_SET_CURVE 202 +# define EC_F_EC_GFP_SIMPLE_BLIND_COORDINATES 287 +# define EC_F_EC_GFP_SIMPLE_FIELD_INV 298 # define EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT 165 # define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE 166 # define EC_F_EC_GFP_SIMPLE_MAKE_AFFINE 102 @@ -1518,6 +1517,7 @@ int ERR_load_EC_strings(void); # define EC_R_BAD_SIGNATURE 156 # define EC_R_BIGNUM_OUT_OF_RANGE 144 # define EC_R_BUFFER_TOO_SMALL 100 +# define EC_R_CANNOT_INVERT 165 # define EC_R_COORDINATES_OUT_OF_RANGE 146 # define EC_R_CURVE_DOES_NOT_SUPPORT_ECDH 160 # define EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING 159 @@ -1568,6 +1568,7 @@ int ERR_load_EC_strings(void); # define EC_R_SLOT_FULL 108 # define EC_R_UNDEFINED_GENERATOR 113 # define EC_R_UNDEFINED_ORDER 128 +# define EC_R_UNKNOWN_COFACTOR 164 # define EC_R_UNKNOWN_GROUP 129 # define EC_R_UNKNOWN_ORDER 114 # define EC_R_UNSUPPORTED_FIELD 131 diff --git a/external/openssl/include/linux/openssl/engine.h b/external/openssl/include/linux/openssl/engine.h index 319371e4..26cf7148 100644 --- a/external/openssl/include/linux/openssl/engine.h +++ b/external/openssl/include/linux/openssl/engine.h @@ -334,8 +334,6 @@ ENGINE *ENGINE_by_id(const char *id); OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_PADLOCK, NULL) # define ENGINE_load_capi() \ OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_CAPI, NULL) -# define ENGINE_load_dasync() \ - OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_DASYNC, NULL) # define ENGINE_load_afalg() \ OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_AFALG, NULL) # endif diff --git a/external/openssl/include/linux/openssl/err.h b/external/openssl/include/linux/openssl/err.h index f9390919..ba40f79b 100644 --- a/external/openssl/include/linux/openssl/err.h +++ b/external/openssl/include/linux/openssl/err.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -37,6 +37,7 @@ extern "C" { # define ERR_TXT_STRING 0x02 # define ERR_FLAG_MARK 0x01 +# define ERR_FLAG_CLEAR 0x02 # define ERR_NUM_ERRORS 16 typedef struct err_state_st { @@ -89,7 +90,7 @@ typedef struct err_state_st { # define ERR_LIB_CMS 46 # define ERR_LIB_TS 47 # define ERR_LIB_HMAC 48 -# define ERR_LIB_JPAKE 49 +/* # define ERR_LIB_JPAKE 49 */ # define ERR_LIB_CT 50 # define ERR_LIB_ASYNC 51 # define ERR_LIB_KDF 52 @@ -128,7 +129,6 @@ typedef struct err_state_st { # define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define TSerr(f,r) ERR_PUT_error(ERR_LIB_TS,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define HMACerr(f,r) ERR_PUT_error(ERR_LIB_HMAC,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define JPAKEerr(f,r) ERR_PUT_error(ERR_LIB_JPAKE,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define CTerr(f,r) ERR_PUT_error(ERR_LIB_CT,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define ASYNCerr(f,r) ERR_PUT_error(ERR_LIB_ASYNC,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define KDFerr(f,r) ERR_PUT_error(ERR_LIB_KDF,(f),(r),OPENSSL_FILE,OPENSSL_LINE) @@ -140,6 +140,7 @@ typedef struct err_state_st { # define ERR_GET_LIB(l) (int)(((l) >> 24L) & 0x0FFL) # define ERR_GET_FUNC(l) (int)(((l) >> 12L) & 0xFFFL) # define ERR_GET_REASON(l) (int)( (l) & 0xFFFL) +# define ERR_FATAL_ERROR(l) (int)( (l) & ERR_R_FATAL) /* OS functions */ # define SYS_F_FOPEN 1 @@ -159,6 +160,7 @@ typedef struct err_state_st { # define SYS_F_GETSOCKOPT 15 # define SYS_F_GETSOCKNAME 16 # define SYS_F_GETHOSTBYNAME 17 +# define SYS_F_FFLUSH 18 /* reasons */ # define ERR_R_SYS_LIB ERR_LIB_SYS/* 2 */ diff --git a/external/openssl/include/linux/openssl/evp.h b/external/openssl/include/linux/openssl/evp.h index b9c83b2b..36e29344 100644 --- a/external/openssl/include/linux/openssl/evp.h +++ b/external/openssl/include/linux/openssl/evp.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -900,6 +900,9 @@ int EVP_PKEY_security_bits(const EVP_PKEY *pkey); int EVP_PKEY_size(EVP_PKEY *pkey); int EVP_PKEY_set_type(EVP_PKEY *pkey, int type); int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len); +# ifndef OPENSSL_NO_ENGINE +int EVP_PKEY_set1_engine(EVP_PKEY *pkey, ENGINE *e); +# endif int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key); void *EVP_PKEY_get0(const EVP_PKEY *pkey); const unsigned char *EVP_PKEY_get0_hmac(const EVP_PKEY *pkey, size_t *len); @@ -1348,34 +1351,34 @@ void EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth, const char *type, const char *value)); -void EVP_PKEY_meth_get_init(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_init(const EVP_PKEY_METHOD *pmeth, int (**pinit) (EVP_PKEY_CTX *ctx)); -void EVP_PKEY_meth_get_copy(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_copy(const EVP_PKEY_METHOD *pmeth, int (**pcopy) (EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src)); -void EVP_PKEY_meth_get_cleanup(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_cleanup(const EVP_PKEY_METHOD *pmeth, void (**pcleanup) (EVP_PKEY_CTX *ctx)); -void EVP_PKEY_meth_get_paramgen(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_paramgen(const EVP_PKEY_METHOD *pmeth, int (**pparamgen_init) (EVP_PKEY_CTX *ctx), int (**pparamgen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)); -void EVP_PKEY_meth_get_keygen(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_keygen(const EVP_PKEY_METHOD *pmeth, int (**pkeygen_init) (EVP_PKEY_CTX *ctx), int (**pkeygen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)); -void EVP_PKEY_meth_get_sign(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_sign(const EVP_PKEY_METHOD *pmeth, int (**psign_init) (EVP_PKEY_CTX *ctx), int (**psign) (EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, const unsigned char *tbs, size_t tbslen)); -void EVP_PKEY_meth_get_verify(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_verify(const EVP_PKEY_METHOD *pmeth, int (**pverify_init) (EVP_PKEY_CTX *ctx), int (**pverify) (EVP_PKEY_CTX *ctx, const unsigned char *sig, @@ -1383,7 +1386,7 @@ void EVP_PKEY_meth_get_verify(EVP_PKEY_METHOD *pmeth, const unsigned char *tbs, size_t tbslen)); -void EVP_PKEY_meth_get_verify_recover(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_verify_recover(const EVP_PKEY_METHOD *pmeth, int (**pverify_recover_init) (EVP_PKEY_CTX *ctx), int (**pverify_recover) (EVP_PKEY_CTX @@ -1395,7 +1398,7 @@ void EVP_PKEY_meth_get_verify_recover(EVP_PKEY_METHOD *pmeth, char *tbs, size_t tbslen)); -void EVP_PKEY_meth_get_signctx(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_signctx(const EVP_PKEY_METHOD *pmeth, int (**psignctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx), int (**psignctx) (EVP_PKEY_CTX *ctx, @@ -1403,7 +1406,7 @@ void EVP_PKEY_meth_get_signctx(EVP_PKEY_METHOD *pmeth, size_t *siglen, EVP_MD_CTX *mctx)); -void EVP_PKEY_meth_get_verifyctx(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_verifyctx(const EVP_PKEY_METHOD *pmeth, int (**pverifyctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx), int (**pverifyctx) (EVP_PKEY_CTX *ctx, @@ -1411,7 +1414,7 @@ void EVP_PKEY_meth_get_verifyctx(EVP_PKEY_METHOD *pmeth, int siglen, EVP_MD_CTX *mctx)); -void EVP_PKEY_meth_get_encrypt(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_encrypt(const EVP_PKEY_METHOD *pmeth, int (**pencrypt_init) (EVP_PKEY_CTX *ctx), int (**pencryptfn) (EVP_PKEY_CTX *ctx, unsigned char *out, @@ -1419,7 +1422,7 @@ void EVP_PKEY_meth_get_encrypt(EVP_PKEY_METHOD *pmeth, const unsigned char *in, size_t inlen)); -void EVP_PKEY_meth_get_decrypt(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_decrypt(const EVP_PKEY_METHOD *pmeth, int (**pdecrypt_init) (EVP_PKEY_CTX *ctx), int (**pdecrypt) (EVP_PKEY_CTX *ctx, unsigned char *out, @@ -1427,13 +1430,13 @@ void EVP_PKEY_meth_get_decrypt(EVP_PKEY_METHOD *pmeth, const unsigned char *in, size_t inlen)); -void EVP_PKEY_meth_get_derive(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_derive(const EVP_PKEY_METHOD *pmeth, int (**pderive_init) (EVP_PKEY_CTX *ctx), int (**pderive) (EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen)); -void EVP_PKEY_meth_get_ctrl(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_ctrl(const EVP_PKEY_METHOD *pmeth, int (**pctrl) (EVP_PKEY_CTX *ctx, int type, int p1, void *p2), int (**pctrl_str) (EVP_PKEY_CTX *ctx, @@ -1455,11 +1458,14 @@ int ERR_load_EVP_strings(void); /* Function codes. */ # define EVP_F_AESNI_INIT_KEY 165 # define EVP_F_AES_INIT_KEY 133 +# define EVP_F_AES_OCB_CIPHER 169 # define EVP_F_AES_T4_INIT_KEY 178 +# define EVP_F_AES_WRAP_CIPHER 170 # define EVP_F_ALG_MODULE_INIT 177 # define EVP_F_CAMELLIA_INIT_KEY 159 # define EVP_F_CHACHA20_POLY1305_CTRL 182 # define EVP_F_CMLL_T4_INIT_KEY 179 +# define EVP_F_DES_EDE3_WRAP_CIPHER 171 # define EVP_F_DO_SIGVER_INIT 161 # define EVP_F_EVP_CIPHERINIT_EX 123 # define EVP_F_EVP_CIPHER_CTX_COPY 163 @@ -1479,6 +1485,7 @@ int ERR_load_EVP_strings(void); # define EVP_F_EVP_PBE_SCRYPT 181 # define EVP_F_EVP_PKCS82PKEY 111 # define EVP_F_EVP_PKEY2PKCS8 113 +# define EVP_F_EVP_PKEY_ASN1_ADD0 168 # define EVP_F_EVP_PKEY_COPY_PARAMETERS 103 # define EVP_F_EVP_PKEY_CTX_CTRL 137 # define EVP_F_EVP_PKEY_CTX_CTRL_STR 150 @@ -1499,9 +1506,12 @@ int ERR_load_EVP_strings(void); # define EVP_F_EVP_PKEY_GET0_RSA 121 # define EVP_F_EVP_PKEY_KEYGEN 146 # define EVP_F_EVP_PKEY_KEYGEN_INIT 147 +# define EVP_F_EVP_PKEY_METH_ADD0 172 +# define EVP_F_EVP_PKEY_METH_NEW 173 # define EVP_F_EVP_PKEY_NEW 106 # define EVP_F_EVP_PKEY_PARAMGEN 148 # define EVP_F_EVP_PKEY_PARAMGEN_INIT 149 +# define EVP_F_EVP_PKEY_SET1_ENGINE 187 # define EVP_F_EVP_PKEY_SIGN 140 # define EVP_F_EVP_PKEY_SIGN_INIT 141 # define EVP_F_EVP_PKEY_VERIFY 142 @@ -1546,6 +1556,7 @@ int ERR_load_EVP_strings(void); # define EVP_R_INPUT_NOT_INITIALIZED 111 # define EVP_R_INVALID_DIGEST 152 # define EVP_R_INVALID_FIPS_MODE 168 +# define EVP_R_INVALID_KEY 163 # define EVP_R_INVALID_KEY_LENGTH 130 # define EVP_R_INVALID_OPERATION 148 # define EVP_R_KEYGEN_FAILURE 120 @@ -1561,6 +1572,9 @@ int ERR_load_EVP_strings(void); # define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 150 # define EVP_R_OPERATON_NOT_INITIALIZED 151 # define EVP_R_PARTIALLY_OVERLAPPING 162 +# define EVP_R_PBKDF2_ERROR 176 +# define EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED 175 +# define EVP_R_PKEY_ASN1_METHOD_ALREADY_REGISTERED 164 # define EVP_R_PRIVATE_KEY_DECODE_ERROR 145 # define EVP_R_PRIVATE_KEY_ENCODE_ERROR 146 # define EVP_R_PUBLIC_KEY_NOT_RSA 106 @@ -1568,12 +1582,12 @@ int ERR_load_EVP_strings(void); # define EVP_R_UNKNOWN_DIGEST 161 # define EVP_R_UNKNOWN_OPTION 169 # define EVP_R_UNKNOWN_PBE_ALGORITHM 121 -# define EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS 135 # define EVP_R_UNSUPPORTED_ALGORITHM 156 # define EVP_R_UNSUPPORTED_CIPHER 107 # define EVP_R_UNSUPPORTED_KEYLENGTH 123 # define EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 124 # define EVP_R_UNSUPPORTED_KEY_SIZE 108 +# define EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS 135 # define EVP_R_UNSUPPORTED_PRF 125 # define EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM 118 # define EVP_R_UNSUPPORTED_SALT_TYPE 126 diff --git a/external/openssl/include/linux/openssl/lhash.h b/external/openssl/include/linux/openssl/lhash.h index e2ccb65d..8ecc5884 100644 --- a/external/openssl/include/linux/openssl/lhash.h +++ b/external/openssl/include/linux/openssl/lhash.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -95,7 +95,7 @@ void OPENSSL_LH_node_usage_stats_bio(const OPENSSL_LHASH *lh, BIO *out); # define _LHASH OPENSSL_LHASH # define LHASH_NODE OPENSSL_LH_NODE # define lh_error OPENSSL_LH_error -# define lh_new OPENSSL_lh_new +# define lh_new OPENSSL_LH_new # define lh_free OPENSSL_LH_free # define lh_insert OPENSSL_LH_insert # define lh_delete OPENSSL_LH_delete @@ -195,8 +195,21 @@ void OPENSSL_LH_node_usage_stats_bio(const OPENSSL_LHASH *lh, BIO *out); LHASH_OF(type) DEFINE_LHASH_OF(OPENSSL_STRING); +# ifdef _MSC_VER +/* + * push and pop this warning: + * warning C4090: 'function': different 'const' qualifiers + */ +# pragma warning (push) +# pragma warning (disable: 4090) +# endif + DEFINE_LHASH_OF(OPENSSL_CSTRING); +# ifdef _MSC_VER +# pragma warning (pop) +# endif + #ifdef __cplusplus } #endif diff --git a/external/openssl/include/linux/openssl/objects.h b/external/openssl/include/linux/openssl/objects.h index 09d614ff..d4462fee 100644 --- a/external/openssl/include/linux/openssl/objects.h +++ b/external/openssl/include/linux/openssl/objects.h @@ -992,7 +992,7 @@ const void *OBJ_bsearch_ex_(const void *key, const void *base, int num, * const void *a_; * const nid_triple const *a = a_; * - * The assignement discards a const because what you really want is: + * The assignment discards a const because what you really want is: * * const int const * const *a = a_; * @@ -1000,7 +1000,7 @@ const void *OBJ_bsearch_ex_(const void *key, const void *base, int num, * which breaks comparison functions. * * Thus we end up having to cast, sadly, or unpack the - * declarations. Or, as I finally did in this case, delcare nid_triple + * declarations. Or, as I finally did in this case, declare nid_triple * to be a struct, which it should have been in the first place. * * Ben, August 2008. diff --git a/external/openssl/include/linux/openssl/ocsp.h b/external/openssl/include/linux/openssl/ocsp.h index 08debc5b..ba1b9731 100644 --- a/external/openssl/include/linux/openssl/ocsp.h +++ b/external/openssl/include/linux/openssl/ocsp.h @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -92,7 +92,6 @@ typedef struct ocsp_resp_bytes_st OCSP_RESPBYTES; # define V_OCSP_RESPID_KEY 1 DEFINE_STACK_OF(OCSP_RESPID) -DECLARE_ASN1_FUNCTIONS(OCSP_RESPID) typedef struct ocsp_revoked_info_st OCSP_REVOKEDINFO; @@ -137,22 +136,6 @@ typedef struct ocsp_service_locator_st OCSP_SERVICELOC; # define i2d_OCSP_REQUEST_bio(bp,o) ASN1_i2d_bio_of(OCSP_REQUEST,i2d_OCSP_REQUEST,bp,o) -# define OCSP_REQUEST_sign(o,pkey,md) \ - ASN1_item_sign(ASN1_ITEM_rptr(OCSP_REQINFO),\ - &o->optionalSignature->signatureAlgorithm,NULL,\ - o->optionalSignature->signature,&o->tbsRequest,pkey,md) - -# define OCSP_BASICRESP_sign(o,pkey,md,d) \ - ASN1_item_sign(ASN1_ITEM_rptr(OCSP_RESPDATA),&o->signatureAlgorithm,NULL,\ - o->signature,&o->tbsResponseData,pkey,md) - -# define OCSP_REQUEST_verify(a,r) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_REQINFO),\ - &a->optionalSignature->signatureAlgorithm,\ - a->optionalSignature->signature,&a->tbsRequest,r) - -# define OCSP_BASICRESP_verify(a,r,d) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_RESPDATA),\ - &a->signatureAlgorithm,a->signature,&a->tbsResponseData,r) - # define ASN1_BIT_STRING_digest(data,type,md,len) \ ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING),type,data,md,len) @@ -175,8 +158,6 @@ int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it, int OCSP_REQ_CTX_nbio_d2i(OCSP_REQ_CTX *rctx, ASN1_VALUE **pval, const ASN1_ITEM *it); BIO *OCSP_REQ_CTX_get0_mem_bio(OCSP_REQ_CTX *rctx); -int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it, - ASN1_VALUE *val); int OCSP_REQ_CTX_http(OCSP_REQ_CTX *rctx, const char *op, const char *path); int OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, OCSP_REQUEST *req); int OCSP_REQ_CTX_add1_header(OCSP_REQ_CTX *rctx, @@ -210,6 +191,10 @@ int OCSP_response_status(OCSP_RESPONSE *resp); OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp); const ASN1_OCTET_STRING *OCSP_resp_get0_signature(const OCSP_BASICRESP *bs); +const X509_ALGOR *OCSP_resp_get0_tbs_sigalg(const OCSP_BASICRESP *bs); +const OCSP_RESPDATA *OCSP_resp_get0_respdata(const OCSP_BASICRESP *bs); +int OCSP_resp_get0_signer(OCSP_BASICRESP *bs, X509 **signer, + STACK_OF(X509) *extra_certs); int OCSP_resp_count(OCSP_BASICRESP *bs); OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx); diff --git a/external/openssl/include/linux/openssl/opensslconf-i386.h b/external/openssl/include/linux/openssl/opensslconf-i386.h deleted file mode 100644 index f744c941..00000000 --- a/external/openssl/include/linux/openssl/opensslconf-i386.h +++ /dev/null @@ -1,166 +0,0 @@ -/* - * WARNING: do not edit! - * Generated by Makefile from include/openssl/opensslconf.h.in - * - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef OPENSSL_ALGORITHM_DEFINES -# error OPENSSL_ALGORITHM_DEFINES no longer supported -#endif - -/* - * OpenSSL was configured with the following options: - */ - -#ifndef OPENSSL_NO_MD2 -# define OPENSSL_NO_MD2 -#endif -#ifndef OPENSSL_NO_RC5 -# define OPENSSL_NO_RC5 -#endif -#ifndef OPENSSL_THREADS -# define OPENSSL_THREADS -#endif -#ifndef OPENSSL_NO_ASAN -# define OPENSSL_NO_ASAN -#endif -#ifndef OPENSSL_NO_CRYPTO_MDEBUG -# define OPENSSL_NO_CRYPTO_MDEBUG -#endif -#ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE -# define OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE -#endif -#ifndef OPENSSL_NO_EC_NISTP_64_GCC_128 -# define OPENSSL_NO_EC_NISTP_64_GCC_128 -#endif -#ifndef OPENSSL_NO_EGD -# define OPENSSL_NO_EGD -#endif -#ifndef OPENSSL_NO_FUZZ_AFL -# define OPENSSL_NO_FUZZ_AFL -#endif -#ifndef OPENSSL_NO_FUZZ_LIBFUZZER -# define OPENSSL_NO_FUZZ_LIBFUZZER -#endif -#ifndef OPENSSL_NO_HEARTBEATS -# define OPENSSL_NO_HEARTBEATS -#endif -#ifndef OPENSSL_NO_MSAN -# define OPENSSL_NO_MSAN -#endif -#ifndef OPENSSL_NO_SCTP -# define OPENSSL_NO_SCTP -#endif -#ifndef OPENSSL_NO_SSL_TRACE -# define OPENSSL_NO_SSL_TRACE -#endif -#ifndef OPENSSL_NO_SSL3 -# define OPENSSL_NO_SSL3 -#endif -#ifndef OPENSSL_NO_SSL3_METHOD -# define OPENSSL_NO_SSL3_METHOD -#endif -#ifndef OPENSSL_NO_UBSAN -# define OPENSSL_NO_UBSAN -#endif -#ifndef OPENSSL_NO_UNIT_TEST -# define OPENSSL_NO_UNIT_TEST -#endif -#ifndef OPENSSL_NO_WEAK_SSL_CIPHERS -# define OPENSSL_NO_WEAK_SSL_CIPHERS -#endif - - -/* - * Sometimes OPENSSSL_NO_xxx ends up with an empty file and some compilers - * don't like that. This will hopefully silence them. - */ -#define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy; - -/* - * Applications should use -DOPENSSL_API_COMPAT= to suppress the - * declarations of functions deprecated in or before . Otherwise, they - * still won't see them if the library has been built to disable deprecated - * functions. - */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; -#endif - -#ifndef OPENSSL_FILE -# ifdef OPENSSL_NO_FILENAMES -# define OPENSSL_FILE "" -# define OPENSSL_LINE 0 -# else -# define OPENSSL_FILE __FILE__ -# define OPENSSL_LINE __LINE__ -# endif -#endif - -#ifndef OPENSSL_MIN_API -# define OPENSSL_MIN_API 0 -#endif - -#if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API -# undef OPENSSL_API_COMPAT -# define OPENSSL_API_COMPAT OPENSSL_MIN_API -#endif - -#if OPENSSL_API_COMPAT < 0x10100000L -# define DEPRECATEDIN_1_1_0(f) DECLARE_DEPRECATED(f) -#else -# define DEPRECATEDIN_1_1_0(f) -#endif - -#if OPENSSL_API_COMPAT < 0x10000000L -# define DEPRECATEDIN_1_0_0(f) DECLARE_DEPRECATED(f) -#else -# define DEPRECATEDIN_1_0_0(f) -#endif - -#if OPENSSL_API_COMPAT < 0x00908000L -# define DEPRECATEDIN_0_9_8(f) DECLARE_DEPRECATED(f) -#else -# define DEPRECATEDIN_0_9_8(f) -#endif - -#define OPENSSL_CPUID_OBJ - -/* Generate 80386 code? */ -#undef I386_ONLY - -#undef OPENSSL_UNISTD -#define OPENSSL_UNISTD - -#undef OPENSSL_EXPORT_VAR_AS_FUNCTION - -/* - * The following are cipher-specific, but are part of the public API. - */ -#if !defined(OPENSSL_SYS_UEFI) -# define BN_LLONG -/* Only one for the following should be defined */ -# undef SIXTY_FOUR_BIT_LONG -# undef SIXTY_FOUR_BIT -# define THIRTY_TWO_BIT -#endif - -#define RC4_INT unsigned int - -#ifdef __cplusplus -} -#endif diff --git a/external/openssl/include/linux/openssl/opensslconf-x86_64.h b/external/openssl/include/linux/openssl/opensslconf-x86_64.h index cec69427..2db88839 100644 --- a/external/openssl/include/linux/openssl/opensslconf-x86_64.h +++ b/external/openssl/include/linux/openssl/opensslconf-x86_64.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -93,12 +93,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/external/openssl/include/linux/openssl/opensslconf.h b/external/openssl/include/linux/openssl/opensslconf.h index b5258861..29627882 100644 --- a/external/openssl/include/linux/openssl/opensslconf.h +++ b/external/openssl/include/linux/openssl/opensslconf.h @@ -1,5 +1,5 @@ #if defined(__LP64__) || defined(_LP64) || defined(__x86_64) #include "opensslconf-x86_64.h" #else -#include "opensslconf-i386.h" +#error "Unsupported architecture!" #endif diff --git a/external/openssl/include/linux/openssl/opensslv.h b/external/openssl/include/linux/openssl/opensslv.h index 2d54b69b..12483c6e 100644 --- a/external/openssl/include/linux/openssl/opensslv.h +++ b/external/openssl/include/linux/openssl/opensslv.h @@ -1,5 +1,5 @@ /* - * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -39,11 +39,11 @@ extern "C" { * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for * major minor fix final patch/beta) */ -# define OPENSSL_VERSION_NUMBER 0x1010003fL +# define OPENSSL_VERSION_NUMBER 0x101000cfL # ifdef OPENSSL_FIPS -# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0c-fips 10 Nov 2016" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0l-fips 10 Sep 2019" # else -# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0c 10 Nov 2016" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0l 10 Sep 2019" # endif /*- diff --git a/external/openssl/include/linux/openssl/pem.h b/external/openssl/include/linux/openssl/pem.h index 2375d635..f7ce3c61 100644 --- a/external/openssl/include/linux/openssl/pem.h +++ b/external/openssl/include/linux/openssl/pem.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -322,7 +322,8 @@ int PEM_SignUpdate(EVP_MD_CTX *ctx, unsigned char *d, unsigned int cnt); int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen, EVP_PKEY *pkey); -int PEM_def_callback(char *buf, int num, int w, void *key); +/* The default pem_password_cb that's used internally */ +int PEM_def_callback(char *buf, int num, int rwflag, void *userdata); void PEM_proc_type(char *buf, int type); void PEM_dek_info(char *buf, const char *type, int len, char *str); diff --git a/external/openssl/include/linux/openssl/rsa.h b/external/openssl/include/linux/openssl/rsa.h index 4d6e9cc9..9c28329f 100644 --- a/external/openssl/include/linux/openssl/rsa.h +++ b/external/openssl/include/linux/openssl/rsa.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -374,7 +374,7 @@ void RSA_meth_free(RSA_METHOD *meth); RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth); const char *RSA_meth_get0_name(const RSA_METHOD *meth); int RSA_meth_set1_name(RSA_METHOD *meth, const char *name); -int RSA_meth_get_flags(RSA_METHOD *meth); +int RSA_meth_get_flags(const RSA_METHOD *meth); int RSA_meth_set_flags(RSA_METHOD *meth, int flags); void *RSA_meth_get0_app_data(const RSA_METHOD *meth); int RSA_meth_set0_app_data(RSA_METHOD *meth, void *app_data); @@ -407,9 +407,9 @@ int RSA_meth_set_priv_dec(RSA_METHOD *rsa, unsigned char *to, RSA *rsa, int padding)); int (*RSA_meth_get_mod_exp(const RSA_METHOD *meth)) - (BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx); + (BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx); int RSA_meth_set_mod_exp(RSA_METHOD *rsa, - int (*mod_exp) (BIGNUM *r0, const BIGNUM *I, RSA *rsa, + int (*mod_exp) (BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx)); int (*RSA_meth_get_bn_mod_exp(const RSA_METHOD *meth)) (BIGNUM *r, const BIGNUM *a, const BIGNUM *p, @@ -468,6 +468,7 @@ int ERR_load_RSA_strings(void); # define RSA_F_PKEY_RSA_CTRL 143 # define RSA_F_PKEY_RSA_CTRL_STR 144 # define RSA_F_PKEY_RSA_SIGN 142 +# define RSA_F_PKEY_RSA_VERIFY 149 # define RSA_F_PKEY_RSA_VERIFYRECOVER 141 # define RSA_F_RSA_ALGOR_TO_MD 156 # define RSA_F_RSA_BUILTIN_KEYGEN 129 diff --git a/external/openssl/include/linux/openssl/seed.h b/external/openssl/include/linux/openssl/seed.h index bb97131d..de10b085 100644 --- a/external/openssl/include/linux/openssl/seed.h +++ b/external/openssl/include/linux/openssl/seed.h @@ -52,9 +52,7 @@ extern "C" { # endif # endif -# if !defined(NO_SYS_TYPES_H) -# include -# endif +# include # define SEED_BLOCK_SIZE 16 # define SEED_KEY_LENGTH 16 diff --git a/external/openssl/include/linux/openssl/srtp.h b/external/openssl/include/linux/openssl/srtp.h index 5ddfa46d..0b57c235 100644 --- a/external/openssl/include/linux/openssl/srtp.h +++ b/external/openssl/include/linux/openssl/srtp.h @@ -36,7 +36,7 @@ extern "C" { # ifndef OPENSSL_NO_SRTP __owur int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles); -__owur int SSL_set_tlsext_use_srtp(SSL *ctx, const char *profiles); +__owur int SSL_set_tlsext_use_srtp(SSL *ssl, const char *profiles); __owur STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl); __owur SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s); diff --git a/external/openssl/include/linux/openssl/ssl.h b/external/openssl/include/linux/openssl/ssl.h index 86ab9125..56e20562 100644 --- a/external/openssl/include/linux/openssl/ssl.h +++ b/external/openssl/include/linux/openssl/ssl.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -95,14 +95,14 @@ extern "C" { # define SSL_TXT_NULL "NULL" # define SSL_TXT_kRSA "kRSA" -# define SSL_TXT_kDHr "kDHr" -# define SSL_TXT_kDHd "kDHd" -# define SSL_TXT_kDH "kDH" +# define SSL_TXT_kDHr "kDHr"/* this cipher class has been removed */ +# define SSL_TXT_kDHd "kDHd"/* this cipher class has been removed */ +# define SSL_TXT_kDH "kDH"/* this cipher class has been removed */ # define SSL_TXT_kEDH "kEDH"/* alias for kDHE */ # define SSL_TXT_kDHE "kDHE" -# define SSL_TXT_kECDHr "kECDHr" -# define SSL_TXT_kECDHe "kECDHe" -# define SSL_TXT_kECDH "kECDH" +# define SSL_TXT_kECDHr "kECDHr"/* this cipher class has been removed */ +# define SSL_TXT_kECDHe "kECDHe"/* this cipher class has been removed */ +# define SSL_TXT_kECDH "kECDH"/* this cipher class has been removed */ # define SSL_TXT_kEECDH "kEECDH"/* alias for kECDHE */ # define SSL_TXT_kECDHE "kECDHE" # define SSL_TXT_kPSK "kPSK" @@ -114,8 +114,8 @@ extern "C" { # define SSL_TXT_aRSA "aRSA" # define SSL_TXT_aDSS "aDSS" -# define SSL_TXT_aDH "aDH" -# define SSL_TXT_aECDH "aECDH" +# define SSL_TXT_aDH "aDH"/* this cipher class has been removed */ +# define SSL_TXT_aECDH "aECDH"/* this cipher class has been removed */ # define SSL_TXT_aECDSA "aECDSA" # define SSL_TXT_aPSK "aPSK" # define SSL_TXT_aGOST94 "aGOST94" @@ -262,54 +262,33 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, const unsigned char *in, size_t inlen, int *al, void *parse_arg); +/* Typedef for verification callback */ +typedef int (*SSL_verify_cb)(int preverify_ok, X509_STORE_CTX *x509_ctx); + /* Allow initial connection to servers that don't support RI */ # define SSL_OP_LEGACY_SERVER_CONNECT 0x00000004U -/* Removed from OpenSSL 0.9.8q and 1.0.0c */ -/* Dead forever, see CVE-2010-4180. */ -# define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG 0x0U # define SSL_OP_TLSEXT_PADDING 0x00000010U -# define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER 0x0U # define SSL_OP_SAFARI_ECDHE_ECDSA_BUG 0x00000040U -/* Ancient SSLeay version, retained for compatibility */ -# define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0x0 -# define SSL_OP_TLS_D5_BUG 0x0U -/* Removed from OpenSSL 1.1.0 */ -# define SSL_OP_TLS_BLOCK_PADDING_BUG 0x0U - -/* Hasn't done anything since OpenSSL 0.9.7h, retained for compatibility */ -# define SSL_OP_MSIE_SSLV2_RSA_PADDING 0x0 -/* Refers to ancient SSLREF and SSLv2, retained for compatibility */ -# define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG 0x0 -/* Related to removed SSLv2 */ -# define SSL_OP_MICROSOFT_SESS_ID_BUG 0x0 -# define SSL_OP_NETSCAPE_CHALLENGE_BUG 0x0 /* * Disable SSL 3.0/TLS 1.0 CBC vulnerability workaround that was added in * OpenSSL 0.9.6d. Usually (depending on the application protocol) the * workaround is not needed. Unfortunately some broken SSL/TLS * implementations cannot handle it at all, which is why we include it in - * SSL_OP_ALL. + * SSL_OP_ALL. Added in 0.9.6e */ -/* added in 0.9.6e */ # define SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS 0x00000800U -/* - * SSL_OP_ALL: various bug workarounds that should be rather harmless. This - * used to be 0x000FFFFFL before 0.9.7. - */ -# define SSL_OP_ALL 0x80000BFFU - /* DTLS options */ -# define SSL_OP_NO_QUERY_MTU 0x00001000U +# define SSL_OP_NO_QUERY_MTU 0x00001000U /* Turn on Cookie Exchange (on relevant for servers) */ -# define SSL_OP_COOKIE_EXCHANGE 0x00002000U +# define SSL_OP_COOKIE_EXCHANGE 0x00002000U /* Don't use RFC4507 ticket extension */ -# define SSL_OP_NO_TICKET 0x00004000U +# define SSL_OP_NO_TICKET 0x00004000U # ifndef OPENSSL_NO_DTLS1_METHOD /* Use Cisco's "speshul" version of DTLS_BAD_VER * (only with deprecated DTLSv1_client_method()) */ -# define SSL_OP_CISCO_ANYCONNECT 0x00008000U +# define SSL_OP_CISCO_ANYCONNECT 0x00008000U # endif /* As server, disallow session resumption on renegotiation */ @@ -318,12 +297,8 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, # define SSL_OP_NO_COMPRESSION 0x00020000U /* Permit unsafe legacy renegotiation */ # define SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION 0x00040000U -/* Does nothing: retained for compatibility */ -# define SSL_OP_SINGLE_ECDH_USE 0x0 -/* Does nothing: retained for compatibility */ -# define SSL_OP_SINGLE_DH_USE 0x0 -/* Does nothing: retained for compatibility */ -# define SSL_OP_EPHEMERAL_RSA 0x0 +/* Disable encrypt-then-mac */ +# define SSL_OP_NO_ENCRYPT_THEN_MAC 0x00080000U /* * Set on servers to choose the cipher according to the server's preferences */ @@ -336,7 +311,6 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, */ # define SSL_OP_TLS_ROLLBACK_BUG 0x00800000U -# define SSL_OP_NO_SSLv2 0x00000000U # define SSL_OP_NO_SSLv3 0x02000000U # define SSL_OP_NO_TLSv1 0x04000000U # define SSL_OP_NO_TLSv1_2 0x08000000U @@ -349,12 +323,9 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, SSL_OP_NO_TLSv1|SSL_OP_NO_TLSv1_1|SSL_OP_NO_TLSv1_2) # define SSL_OP_NO_DTLS_MASK (SSL_OP_NO_DTLSv1|SSL_OP_NO_DTLSv1_2) +/* Disallow all renegotiation */ +# define SSL_OP_NO_RENEGOTIATION 0x40000000U -/* Removed from previous versions */ -# define SSL_OP_PKCS1_CHECK_1 0x0 -# define SSL_OP_PKCS1_CHECK_2 0x0 -# define SSL_OP_NETSCAPE_CA_DN_BUG 0x0 -# define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x0U /* * Make server add server-hello extension from early version of cryptopro * draft, when GOST ciphersuite is negotiated. Required for interoperability @@ -362,6 +333,59 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, */ # define SSL_OP_CRYPTOPRO_TLSEXT_BUG 0x80000000U +/* + * SSL_OP_ALL: various bug workarounds that should be rather harmless. + * This used to be 0x000FFFFFL before 0.9.7. + * This used to be 0x80000BFFU before 1.1.1. + */ +# define SSL_OP_ALL (SSL_OP_CRYPTOPRO_TLSEXT_BUG|\ + SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS|\ + SSL_OP_LEGACY_SERVER_CONNECT|\ + SSL_OP_TLSEXT_PADDING|\ + SSL_OP_SAFARI_ECDHE_ECDSA_BUG) + +/* OBSOLETE OPTIONS: retained for compatibility */ + +/* Removed from OpenSSL 1.1.0. Was 0x00000001L */ +/* Related to removed SSLv2. */ +# define SSL_OP_MICROSOFT_SESS_ID_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000002L */ +/* Related to removed SSLv2. */ +# define SSL_OP_NETSCAPE_CHALLENGE_BUG 0x0 +/* Removed from OpenSSL 0.9.8q and 1.0.0c. Was 0x00000008L */ +/* Dead forever, see CVE-2010-4180 */ +# define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG 0x0 +/* Removed from OpenSSL 1.0.1h and 1.0.2. Was 0x00000010L */ +/* Refers to ancient SSLREF and SSLv2. */ +# define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000020 */ +# define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER 0x0 +/* Removed from OpenSSL 0.9.7h and 0.9.8b. Was 0x00000040L */ +# define SSL_OP_MSIE_SSLV2_RSA_PADDING 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000080 */ +/* Ancient SSLeay version. */ +# define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000100L */ +# define SSL_OP_TLS_D5_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000200L */ +# define SSL_OP_TLS_BLOCK_PADDING_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00080000L */ +# define SSL_OP_SINGLE_ECDH_USE 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00100000L */ +# define SSL_OP_SINGLE_DH_USE 0x0 +/* Removed from OpenSSL 1.0.1k and 1.0.2. Was 0x00200000L */ +# define SSL_OP_EPHEMERAL_RSA 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x01000000L */ +# define SSL_OP_NO_SSLv2 0x0 +/* Removed from OpenSSL 1.0.1. Was 0x08000000L */ +# define SSL_OP_PKCS1_CHECK_1 0x0 +/* Removed from OpenSSL 1.0.1. Was 0x10000000L */ +# define SSL_OP_PKCS1_CHECK_2 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x20000000L */ +# define SSL_OP_NETSCAPE_CA_DN_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x40000000L */ +# define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x0 + /* * Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success * when just a single record has been written): @@ -943,8 +967,8 @@ size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count); # define SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02 # define SSL_VERIFY_CLIENT_ONCE 0x04 -# define OpenSSL_add_ssl_algorithms() SSL_library_init() # if OPENSSL_API_COMPAT < 0x10100000L +# define OpenSSL_add_ssl_algorithms() SSL_library_init() # define SSLeay_add_ssl_algorithms() SSL_library_init() # endif @@ -1139,6 +1163,8 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) # define SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE 127 # define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB 128 # define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG 129 +# define SSL_CTRL_GET_MIN_PROTO_VERSION 130 +# define SSL_CTRL_GET_MAX_PROTO_VERSION 131 # define SSL_CERT_SET_FIRST 1 # define SSL_CERT_SET_NEXT 2 # define SSL_CERT_SET_SERVER 3 @@ -1241,7 +1267,7 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) # define SSL_CTX_set1_sigalgs_list(ctx, s) \ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)s) # define SSL_set1_sigalgs(ctx, slist, slistlen) \ - SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS,clistlen,(int *)slist) + SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS,slistlen,(int *)slist) # define SSL_set1_sigalgs_list(ctx, s) \ SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)s) # define SSL_CTX_set1_client_sigalgs(ctx, slist, slistlen) \ @@ -1270,10 +1296,18 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MIN_PROTO_VERSION, version, NULL) #define SSL_CTX_set_max_proto_version(ctx, version) \ SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MAX_PROTO_VERSION, version, NULL) +#define SSL_CTX_get_min_proto_version(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MIN_PROTO_VERSION, 0, NULL) +#define SSL_CTX_get_max_proto_version(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MAX_PROTO_VERSION, 0, NULL) #define SSL_set_min_proto_version(s, version) \ SSL_ctrl(s, SSL_CTRL_SET_MIN_PROTO_VERSION, version, NULL) #define SSL_set_max_proto_version(s, version) \ SSL_ctrl(s, SSL_CTRL_SET_MAX_PROTO_VERSION, version, NULL) +#define SSL_get_min_proto_version(s) \ + SSL_ctrl(s, SSL_CTRL_GET_MIN_PROTO_VERSION, 0, NULL) +#define SSL_get_max_proto_version(s) \ + SSL_ctrl(s, SSL_CTRL_GET_MAX_PROTO_VERSION, 0, NULL) #if OPENSSL_API_COMPAT < 0x10100000L /* Provide some compatibility macros for removed functionality. */ @@ -1324,7 +1358,7 @@ __owur int SSL_get_fd(const SSL *s); __owur int SSL_get_rfd(const SSL *s); __owur int SSL_get_wfd(const SSL *s); __owur const char *SSL_get_cipher_list(const SSL *s, int n); -__owur char *SSL_get_shared_ciphers(const SSL *s, char *buf, int len); +__owur char *SSL_get_shared_ciphers(const SSL *s, char *buf, int size); __owur int SSL_get_read_ahead(const SSL *s); __owur int SSL_pending(const SSL *s); __owur int SSL_has_pending(const SSL *s); @@ -1342,9 +1376,8 @@ __owur int SSL_set_cipher_list(SSL *s, const char *str); void SSL_set_read_ahead(SSL *s, int yes); __owur int SSL_get_verify_mode(const SSL *s); __owur int SSL_get_verify_depth(const SSL *s); -__owur int (*SSL_get_verify_callback(const SSL *s)) (int, X509_STORE_CTX *); -void SSL_set_verify(SSL *s, int mode, - int (*callback) (int ok, X509_STORE_CTX *ctx)); +__owur SSL_verify_cb SSL_get_verify_callback(const SSL *s); +void SSL_set_verify(SSL *s, int mode, SSL_verify_cb callback); void SSL_set_verify_depth(SSL *s, int depth); void SSL_set_cert_cb(SSL *s, int (*cb) (SSL *ssl, void *arg), void *arg); # ifndef OPENSSL_NO_RSA @@ -1426,7 +1459,7 @@ int SSL_SESSION_up_ref(SSL_SESSION *ses); void SSL_SESSION_free(SSL_SESSION *ses); __owur int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp); __owur int SSL_set_session(SSL *to, SSL_SESSION *session); -__owur int SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c); +int SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c); int SSL_CTX_remove_session(SSL_CTX *, SSL_SESSION *c); __owur int SSL_CTX_set_generate_session_id(SSL_CTX *, GEN_SESSION_CB); __owur int SSL_set_generate_session_id(SSL *, GEN_SESSION_CB); @@ -1443,10 +1476,8 @@ __owur STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *s); __owur int SSL_CTX_get_verify_mode(const SSL_CTX *ctx); __owur int SSL_CTX_get_verify_depth(const SSL_CTX *ctx); -__owur int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx)) (int, - X509_STORE_CTX *); -void SSL_CTX_set_verify(SSL_CTX *ctx, int mode, - int (*callback) (int, X509_STORE_CTX *)); +__owur SSL_verify_cb SSL_CTX_get_verify_callback(const SSL_CTX *ctx); +void SSL_CTX_set_verify(SSL_CTX *ctx, int mode, SSL_verify_cb callback); void SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth); void SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx, int (*cb) (X509_STORE_CTX *, void *), @@ -1501,7 +1532,7 @@ __owur int SSL_CTX_dane_mtype_set(SSL_CTX *ctx, const EVP_MD *md, uint8_t mtype, uint8_t ord); __owur int SSL_dane_enable(SSL *s, const char *basedomain); __owur int SSL_dane_tlsa_add(SSL *s, uint8_t usage, uint8_t selector, - uint8_t mtype, unsigned char *data, size_t dlen); + uint8_t mtype, unsigned const char *data, size_t dlen); __owur int SSL_get0_dane_authority(SSL *s, X509 **mcert, EVP_PKEY **mspki); __owur int SSL_get0_dane_tlsa(SSL *s, uint8_t *usage, uint8_t *selector, uint8_t *mtype, unsigned const char **data, @@ -1777,6 +1808,8 @@ void SSL_set_tmp_dh_callback(SSL *ssl, __owur const COMP_METHOD *SSL_get_current_compression(SSL *s); __owur const COMP_METHOD *SSL_get_current_expansion(SSL *s); __owur const char *SSL_COMP_get_name(const COMP_METHOD *comp); +__owur const char *SSL_COMP_get0_name(const SSL_COMP *comp); +__owur int SSL_COMP_get_id(const SSL_COMP *comp); STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void); __owur STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP) *meths); @@ -1814,7 +1847,7 @@ void SSL_set_not_resumable_session_callback(SSL *ssl, # endif __owur int SSL_session_reused(SSL *s); -__owur int SSL_is_server(SSL *s); +__owur int SSL_is_server(const SSL *s); __owur __owur SSL_CONF_CTX *SSL_CONF_CTX_new(void); int SSL_CONF_CTX_finish(SSL_CONF_CTX *cctx); @@ -2077,6 +2110,7 @@ int ERR_load_SSL_strings(void); # define SSL_F_DTLS_CONSTRUCT_HELLO_VERIFY_REQUEST 385 # define SSL_F_DTLS_GET_REASSEMBLED_MESSAGE 370 # define SSL_F_DTLS_PROCESS_HELLO_VERIFY 386 +# define SSL_F_DTLS_WAIT_FOR_DRY 592 # define SSL_F_OPENSSL_INIT_SSL 342 # define SSL_F_OSSL_STATEM_CLIENT_READ_TRANSITION 417 # define SSL_F_OSSL_STATEM_SERVER_READ_TRANSITION 418 @@ -2098,6 +2132,7 @@ int ERR_load_SSL_strings(void); # define SSL_F_SSL3_SETUP_KEY_BLOCK 157 # define SSL_F_SSL3_SETUP_READ_BUFFER 156 # define SSL_F_SSL3_SETUP_WRITE_BUFFER 291 +# define SSL_F_SSL3_TAKE_MAC 425 # define SSL_F_SSL3_WRITE_BYTES 158 # define SSL_F_SSL3_WRITE_PENDING 159 # define SSL_F_SSL_ADD_CERT_CHAIN 316 @@ -2171,6 +2206,8 @@ int ERR_load_SSL_strings(void); # define SSL_F_SSL_PARSE_SERVERHELLO_USE_SRTP_EXT 311 # define SSL_F_SSL_PEEK 270 # define SSL_F_SSL_READ 223 +# define SSL_F_SSL_RENEGOTIATE 516 +# define SSL_F_SSL_RENEGOTIATE_ABBREVIATED 546 # define SSL_F_SSL_SCAN_CLIENTHELLO_TLSEXT 320 # define SSL_F_SSL_SCAN_SERVERHELLO_TLSEXT 321 # define SSL_F_SSL_SESSION_DUP 348 @@ -2344,6 +2381,7 @@ int ERR_load_SSL_strings(void); # define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 150 # define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 151 # define SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN 204 +# define SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE 194 # define SSL_R_EXCESSIVE_MESSAGE_SIZE 152 # define SSL_R_EXTRA_DATA_IN_MESSAGE 153 # define SSL_R_FAILED_TO_INIT_ASYNC 405 diff --git a/external/openssl/include/linux/openssl/ssl3.h b/external/openssl/include/linux/openssl/ssl3.h index aca19223..115940ad 100644 --- a/external/openssl/include/linux/openssl/ssl3.h +++ b/external/openssl/include/linux/openssl/ssl3.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -252,9 +252,15 @@ extern "C" { # define SSL3_CT_FORTEZZA_DMS 20 /* * SSL3_CT_NUMBER is used to size arrays and it must be large enough to - * contain all of the cert types defined either for SSLv3 and TLSv1. + * contain all of the cert types defined for *either* SSLv3 and TLSv1. */ -# define SSL3_CT_NUMBER 9 +# define SSL3_CT_NUMBER 10 + +# if defined(TLS_CT_NUMBER) +# if TLS_CT_NUMBER != SSL3_CT_NUMBER +# error "SSL/TLS CT_NUMBER values do not match" +# endif +# endif # define SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS 0x0001 @@ -264,11 +270,14 @@ extern "C" { # define TLS1_FLAGS_SKIP_CERT_VERIFY 0x0010 /* Set if we encrypt then mac instead of usual mac then encrypt */ -# define TLS1_FLAGS_ENCRYPT_THEN_MAC 0x0100 +# define TLS1_FLAGS_ENCRYPT_THEN_MAC_READ 0x0100 +# define TLS1_FLAGS_ENCRYPT_THEN_MAC TLS1_FLAGS_ENCRYPT_THEN_MAC_READ /* Set if extended master secret extension received from peer */ # define TLS1_FLAGS_RECEIVED_EXTMS 0x0200 +# define TLS1_FLAGS_ENCRYPT_THEN_MAC_WRITE 0x0400 + # define SSL3_MT_HELLO_REQUEST 0 # define SSL3_MT_CLIENT_HELLO 1 # define SSL3_MT_SERVER_HELLO 2 diff --git a/external/openssl/include/linux/openssl/symhacks.h b/external/openssl/include/linux/openssl/symhacks.h index caf1f1a7..156ea6e4 100644 --- a/external/openssl/include/linux/openssl/symhacks.h +++ b/external/openssl/include/linux/openssl/symhacks.h @@ -1,5 +1,5 @@ /* - * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -28,21 +28,6 @@ # undef i2d_ECPKPARAMETERS # define i2d_ECPKPARAMETERS i2d_UC_ECPKPARAMETERS -/* - * These functions do not seem to exist! However, I'm paranoid... Original - * command in x509v3.h: These functions are being redefined in another - * directory, and clash when the linker is case-insensitive, so let's hide - * them a little, by giving them an extra 'o' at the beginning of the name... - */ -# undef X509v3_cleanup_extensions -# define X509v3_cleanup_extensions oX509v3_cleanup_extensions -# undef X509v3_add_extension -# define X509v3_add_extension oX509v3_add_extension -# undef X509v3_add_netscape_extensions -# define X509v3_add_netscape_extensions oX509v3_add_netscape_extensions -# undef X509v3_add_standard_extensions -# define X509v3_add_standard_extensions oX509v3_add_standard_extensions - /* This one clashes with CMS_data_create */ # undef cms_Data_create # define cms_Data_create priv_cms_Data_create diff --git a/external/openssl/include/linux/openssl/tls1.h b/external/openssl/include/linux/openssl/tls1.h index 23e382cd..732e87ab 100644 --- a/external/openssl/include/linux/openssl/tls1.h +++ b/external/openssl/include/linux/openssl/tls1.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -226,12 +226,12 @@ __owur int SSL_get_servername_type(const SSL *s); * as specified in RFC 5705. It writes |olen| bytes to |out| given a label and * optional context. (Since a zero length context is allowed, the |use_context| * flag controls whether a context is included.) It returns 1 on success and - * zero otherwise. + * 0 or -1 otherwise. */ __owur int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen, - const char *label, size_t llen, - const unsigned char *p, size_t plen, - int use_context); + const char *label, size_t llen, + const unsigned char *context, + size_t contextlen, int use_context); int SSL_get_sigalgs(SSL *s, int idx, int *psign, int *phash, int *psignandhash, @@ -298,9 +298,9 @@ SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB,0, (void (**)(void))cb) SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,(void (*)(void))cb) # define SSL_CTX_get_tlsext_status_arg(ssl, arg) \ -SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg + SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg) # define SSL_CTX_set_tlsext_status_arg(ssl, arg) \ -SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg) + SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg) #define SSL_CTX_set_tlsext_status_type(ssl, type) \ SSL_CTX_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE, type, NULL) @@ -883,7 +883,13 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) * when correcting this number, correct also SSL3_CT_NUMBER in ssl3.h (see * comment there) */ -# define TLS_CT_NUMBER 9 +# define TLS_CT_NUMBER 10 + +# if defined(SSL3_CT_NUMBER) +# if TLS_CT_NUMBER != SSL3_CT_NUMBER +# error "SSL/TLS CT_NUMBER values do not match" +# endif +# endif # define TLS1_FINISH_MAC_LENGTH 12 diff --git a/external/openssl/include/linux/openssl/ui.h b/external/openssl/include/linux/openssl/ui.h index 26f4f044..49e763de 100644 --- a/external/openssl/include/linux/openssl/ui.h +++ b/external/openssl/include/linux/openssl/ui.h @@ -339,8 +339,12 @@ int ERR_load_UI_strings(void); /* Error codes for the UI functions. */ /* Function codes. */ +# define UI_F_CLOSE_CONSOLE 115 +# define UI_F_ECHO_CONSOLE 116 # define UI_F_GENERAL_ALLOCATE_BOOLEAN 108 # define UI_F_GENERAL_ALLOCATE_PROMPT 109 +# define UI_F_NOECHO_CONSOLE 117 +# define UI_F_OPEN_CONSOLE 114 # define UI_F_UI_CREATE_METHOD 112 # define UI_F_UI_CTRL 111 # define UI_F_UI_DUP_ERROR_STRING 101 @@ -350,6 +354,7 @@ int ERR_load_UI_strings(void); # define UI_F_UI_DUP_VERIFY_STRING 106 # define UI_F_UI_GET0_RESULT 107 # define UI_F_UI_NEW_METHOD 104 +# define UI_F_UI_PROCESS 113 # define UI_F_UI_SET_RESULT 105 /* Reason codes. */ @@ -357,9 +362,14 @@ int ERR_load_UI_strings(void); # define UI_R_INDEX_TOO_LARGE 102 # define UI_R_INDEX_TOO_SMALL 103 # define UI_R_NO_RESULT_BUFFER 105 +# define UI_R_PROCESSING_ERROR 107 # define UI_R_RESULT_TOO_LARGE 100 # define UI_R_RESULT_TOO_SMALL 101 +# define UI_R_SYSASSIGN_ERROR 109 +# define UI_R_SYSDASSGN_ERROR 110 +# define UI_R_SYSQIOW_ERROR 111 # define UI_R_UNKNOWN_CONTROL_COMMAND 106 +# define UI_R_UNKNOWN_TTYGET_ERRNO_VALUE 108 # ifdef __cplusplus } diff --git a/external/openssl/include/linux/openssl/x509.h b/external/openssl/include/linux/openssl/x509.h index c8996f35..916afaf7 100644 --- a/external/openssl/include/linux/openssl/x509.h +++ b/external/openssl/include/linux/openssl/x509.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -641,7 +641,7 @@ int X509_get_signature_type(const X509 *x); /* * This one is only used so that a binary form can output, as in - * i2d_X509_NAME(X509_get_X509_PUBKEY(x),&buf) + * i2d_X509_NAME(X509_get_X509_PUBKEY(x), &buf) */ X509_PUBKEY *X509_get_X509_PUBKEY(const X509 *x); const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x); @@ -1055,6 +1055,7 @@ int ERR_load_X509_strings(void); # define X509_F_X509_LOAD_CERT_CRL_FILE 132 # define X509_F_X509_LOAD_CERT_FILE 111 # define X509_F_X509_LOAD_CRL_FILE 112 +# define X509_F_X509_LOOKUP_METH_NEW 160 # define X509_F_X509_NAME_ADD_ENTRY 113 # define X509_F_X509_NAME_ENTRY_CREATE_BY_NID 114 # define X509_F_X509_NAME_ENTRY_CREATE_BY_TXT 131 @@ -1091,6 +1092,7 @@ int ERR_load_X509_strings(void); # define X509_R_CRL_ALREADY_DELTA 127 # define X509_R_CRL_VERIFY_FAILURE 131 # define X509_R_IDP_MISMATCH 128 +# define X509_R_INVALID_ATTRIBUTES 135 # define X509_R_INVALID_DIRECTORY 113 # define X509_R_INVALID_FIELD_NAME 119 # define X509_R_INVALID_TRUST 123 diff --git a/external/openssl/include/linux/openssl/x509_vfy.h b/external/openssl/include/linux/openssl/x509_vfy.h index cab8005e..131b6cf7 100644 --- a/external/openssl/include/linux/openssl/x509_vfy.h +++ b/external/openssl/include/linux/openssl/x509_vfy.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -257,7 +257,9 @@ X509_OBJECT *X509_OBJECT_new(void); void X509_OBJECT_free(X509_OBJECT *a); X509_LOOKUP_TYPE X509_OBJECT_get_type(const X509_OBJECT *a); X509 *X509_OBJECT_get0_X509(const X509_OBJECT *a); +int X509_OBJECT_set1_X509(X509_OBJECT *a, X509 *obj); X509_CRL *X509_OBJECT_get0_X509_CRL(X509_OBJECT *a); +int X509_OBJECT_set1_X509_CRL(X509_OBJECT *a, X509_CRL *obj); X509_STORE *X509_STORE_new(void); void X509_STORE_free(X509_STORE *v); int X509_STORE_lock(X509_STORE *ctx); @@ -364,6 +366,76 @@ X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m); X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void); X509_LOOKUP_METHOD *X509_LOOKUP_file(void); +typedef int (*X509_LOOKUP_ctrl_fn)(X509_LOOKUP *ctx, int cmd, const char *argc, + long argl, char **ret); +typedef int (*X509_LOOKUP_get_by_subject_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + X509_NAME *name, + X509_OBJECT *ret); +typedef int (*X509_LOOKUP_get_by_issuer_serial_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + X509_NAME *name, + ASN1_INTEGER *serial, + X509_OBJECT *ret); +typedef int (*X509_LOOKUP_get_by_fingerprint_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + const unsigned char* bytes, + int len, + X509_OBJECT *ret); +typedef int (*X509_LOOKUP_get_by_alias_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + const char *str, + int len, + X509_OBJECT *ret); + +X509_LOOKUP_METHOD *X509_LOOKUP_meth_new(const char *name); +void X509_LOOKUP_meth_free(X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_new_item(X509_LOOKUP_METHOD *method, + int (*new_item) (X509_LOOKUP *ctx)); +int (*X509_LOOKUP_meth_get_new_item(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_free(X509_LOOKUP_METHOD *method, + void (*free_fn) (X509_LOOKUP *ctx)); +void (*X509_LOOKUP_meth_get_free(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_init(X509_LOOKUP_METHOD *method, + int (*init) (X509_LOOKUP *ctx)); +int (*X509_LOOKUP_meth_get_init(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_shutdown(X509_LOOKUP_METHOD *method, + int (*shutdown) (X509_LOOKUP *ctx)); +int (*X509_LOOKUP_meth_get_shutdown(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_ctrl(X509_LOOKUP_METHOD *method, + X509_LOOKUP_ctrl_fn ctrl_fn); +X509_LOOKUP_ctrl_fn X509_LOOKUP_meth_get_ctrl(const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_subject(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_subject_fn fn); +X509_LOOKUP_get_by_subject_fn X509_LOOKUP_meth_get_get_by_subject( + const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_issuer_serial(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_issuer_serial_fn fn); +X509_LOOKUP_get_by_issuer_serial_fn X509_LOOKUP_meth_get_get_by_issuer_serial( + const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_fingerprint(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_fingerprint_fn fn); +X509_LOOKUP_get_by_fingerprint_fn X509_LOOKUP_meth_get_get_by_fingerprint( + const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_alias(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_alias_fn fn); +X509_LOOKUP_get_by_alias_fn X509_LOOKUP_meth_get_get_by_alias( + const X509_LOOKUP_METHOD *method); + + int X509_STORE_add_cert(X509_STORE *ctx, X509 *x); int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x); @@ -393,6 +465,9 @@ int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, X509_OBJECT *ret); int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, const char *str, int len, X509_OBJECT *ret); +int X509_LOOKUP_set_method_data(X509_LOOKUP *ctx, void *data); +void *X509_LOOKUP_get_method_data(const X509_LOOKUP *ctx); +X509_STORE *X509_LOOKUP_get_store(const X509_LOOKUP *ctx); int X509_LOOKUP_shutdown(X509_LOOKUP *ctx); int X509_STORE_load_locations(X509_STORE *ctx, @@ -458,18 +533,24 @@ int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose); int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust); void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth); void X509_VERIFY_PARAM_set_auth_level(X509_VERIFY_PARAM *param, int auth_level); +time_t X509_VERIFY_PARAM_get_time(const X509_VERIFY_PARAM *param); void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t); int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param, ASN1_OBJECT *policy); int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param, STACK_OF(ASN1_OBJECT) *policies); +int X509_VERIFY_PARAM_set_inh_flags(X509_VERIFY_PARAM *param, + uint32_t flags); +uint32_t X509_VERIFY_PARAM_get_inh_flags(const X509_VERIFY_PARAM *param); + int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param, const char *name, size_t namelen); int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param, const char *name, size_t namelen); void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param, unsigned int flags); +unsigned int X509_VERIFY_PARAM_get_hostflags(const X509_VERIFY_PARAM *param); char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *); void X509_VERIFY_PARAM_move_peername(X509_VERIFY_PARAM *, X509_VERIFY_PARAM *); int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param, diff --git a/external/openssl/include/linux/openssl/x509v3.h b/external/openssl/include/linux/openssl/x509v3.h index f21ce7c1..c93b112f 100644 --- a/external/openssl/include/linux/openssl/x509v3.h +++ b/external/openssl/include/linux/openssl/x509v3.h @@ -1,5 +1,5 @@ /* - * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -355,6 +355,7 @@ struct ISSUING_DIST_POINT_st { # define EXFLAG_SI 0x20 # define EXFLAG_V1 0x40 # define EXFLAG_INVALID 0x80 +/* EXFLAG_SET is set to indicate that some values have been precomputed */ # define EXFLAG_SET 0x100 # define EXFLAG_CRITICAL 0x200 # define EXFLAG_PROXY 0x400 @@ -657,6 +658,7 @@ uint32_t X509_get_extension_flags(X509 *x); uint32_t X509_get_key_usage(X509 *x); uint32_t X509_get_extended_key_usage(X509 *x); const ASN1_OCTET_STRING *X509_get0_subject_key_id(X509 *x); +const ASN1_OCTET_STRING *X509_get0_authority_key_id(X509 *x); int X509_PURPOSE_get_count(void); X509_PURPOSE *X509_PURPOSE_get0(int idx); @@ -875,6 +877,7 @@ int ERR_load_X509V3_strings(void); # define X509V3_F_ADDR_VALIDATE_PATH_INTERNAL 166 # define X509V3_F_ASIDENTIFIERCHOICE_CANONIZE 161 # define X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL 162 +# define X509V3_F_BIGNUM_TO_STRING 167 # define X509V3_F_COPY_EMAIL 122 # define X509V3_F_COPY_ISSUER 123 # define X509V3_F_DO_DIRNAME 144 diff --git a/external/openssl/include/mac/openssl/asn1.h b/external/openssl/include/mac/openssl/asn1.h index 7cf61161..d0b1099a 100644 --- a/external/openssl/include/mac/openssl/asn1.h +++ b/external/openssl/include/mac/openssl/asn1.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -625,8 +625,8 @@ ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t); ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day, long offset_sec); int ASN1_TIME_check(const ASN1_TIME *t); -ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME - **out); +ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *t, + ASN1_GENERALIZEDTIME **out); int ASN1_TIME_set_string(ASN1_TIME *s, const char *str); int i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a); @@ -946,14 +946,17 @@ int ERR_load_ASN1_strings(void); # define ASN1_F_C2I_ASN1_INTEGER 194 # define ASN1_F_C2I_ASN1_OBJECT 196 # define ASN1_F_C2I_IBUF 226 +# define ASN1_F_C2I_UINT64_INT 101 # define ASN1_F_COLLECT_DATA 140 # define ASN1_F_D2I_ASN1_OBJECT 147 # define ASN1_F_D2I_ASN1_UINTEGER 150 # define ASN1_F_D2I_AUTOPRIVATEKEY 207 # define ASN1_F_D2I_PRIVATEKEY 154 # define ASN1_F_D2I_PUBLICKEY 155 +# define ASN1_F_DO_BUF 142 # define ASN1_F_DO_TCREATE 222 # define ASN1_F_I2D_ASN1_BIO_STREAM 211 +# define ASN1_F_I2D_ASN1_OBJECT 143 # define ASN1_F_I2D_DSA_PUBKEY 161 # define ASN1_F_I2D_EC_PUBKEY 181 # define ASN1_F_I2D_PRIVATEKEY 163 @@ -971,6 +974,8 @@ int ERR_load_ASN1_strings(void); # define ASN1_F_SMIME_READ_ASN1 212 # define ASN1_F_SMIME_TEXT 213 # define ASN1_F_STBL_MODULE_INIT 223 +# define ASN1_F_UINT32_C2I 105 +# define ASN1_F_UINT64_C2I 112 # define ASN1_F_X509_CRL_ADD0_REVOKED 169 # define ASN1_F_X509_INFO_NEW 170 # define ASN1_F_X509_NAME_ENCODE 203 @@ -1048,6 +1053,7 @@ int ERR_load_ASN1_strings(void); # define ASN1_R_MSTRING_NOT_UNIVERSAL 139 # define ASN1_R_MSTRING_WRONG_TAG 140 # define ASN1_R_NESTED_ASN1_STRING 197 +# define ASN1_R_NESTED_TOO_DEEP 201 # define ASN1_R_NON_HEX_CHARACTERS 141 # define ASN1_R_NOT_ASCII_FORMAT 190 # define ASN1_R_NOT_ENOUGH_DATA 142 diff --git a/external/openssl/include/mac/openssl/asn1t.h b/external/openssl/include/mac/openssl/asn1t.h index 8eedfb3f..a5248293 100644 --- a/external/openssl/include/mac/openssl/asn1t.h +++ b/external/openssl/include/mac/openssl/asn1t.h @@ -346,17 +346,22 @@ extern "C" { /* OPTIONAL simple type */ # define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type) +# define ASN1_OPT_EMBED(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED, 0, stname, field, type) /* IMPLICIT tagged simple type */ # define ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0) +# define ASN1_IMP_EMBED(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_EMBED) /* IMPLICIT tagged OPTIONAL simple type */ # define ASN1_IMP_OPT(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) +# define ASN1_IMP_OPT_EMBED(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED) /* Same as above but EXPLICIT */ # define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0) +# define ASN1_EXP_EMBED(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_EMBED) # define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) +# define ASN1_EXP_OPT_EMBED(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED) /* SEQUENCE OF type */ # define ASN1_SEQUENCE_OF(stname, field, type) \ diff --git a/external/openssl/include/mac/openssl/bio.h b/external/openssl/include/mac/openssl/bio.h index 9bc941b2..3a728625 100644 --- a/external/openssl/include/mac/openssl/bio.h +++ b/external/openssl/include/mac/openssl/bio.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -20,11 +20,7 @@ # include # ifndef OPENSSL_NO_SCTP -# ifndef OPENSSL_SYS_VMS -# include -# else -# include -# endif +# include # endif #ifdef __cplusplus @@ -129,11 +125,10 @@ extern "C" { # define BIO_CTRL_DGRAM_GET_MTU_OVERHEAD 49 -# define BIO_CTRL_DGRAM_SET_PEEK_MODE 50 - +/* Deliberately outside of OPENSSL_NO_SCTP - used in bss_dgram.c */ +# define BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE 50 # ifndef OPENSSL_NO_SCTP /* SCTP stuff */ -# define BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE 50 # define BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY 51 # define BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY 52 # define BIO_CTRL_DGRAM_SCTP_AUTH_CCS_RCVD 53 @@ -146,6 +141,8 @@ extern "C" { # define BIO_CTRL_DGRAM_SCTP_SAVE_SHUTDOWN 70 # endif +# define BIO_CTRL_DGRAM_SET_PEEK_MODE 71 + /* modifiers */ # define BIO_FP_READ 0x02 # define BIO_FP_WRITE 0x04 @@ -170,7 +167,7 @@ extern "C" { /* * This is used with memory BIOs: * BIO_FLAGS_MEM_RDONLY means we shouldn't free up or change the data in any way; - * BIO_FLAGS_NONCLEAR_RST means we should't clear data on reset. + * BIO_FLAGS_NONCLEAR_RST means we shouldn't clear data on reset. */ # define BIO_FLAGS_MEM_RDONLY 0x200 # define BIO_FLAGS_NONCLEAR_RST 0x400 @@ -249,7 +246,8 @@ typedef struct bio_method_st BIO_METHOD; const char *BIO_method_name(const BIO *b); int BIO_method_type(const BIO *b); -typedef void bio_info_cb(BIO *, int, const char *, int, long, long); +typedef int BIO_info_cb(BIO *, int, int); +typedef BIO_info_cb bio_info_cb; /* backward compatibility */ DEFINE_STACK_OF(BIO) @@ -550,8 +548,7 @@ int BIO_write(BIO *b, const void *data, int len); int BIO_puts(BIO *bp, const char *buf); int BIO_indent(BIO *b, int indent, int max); long BIO_ctrl(BIO *bp, int cmd, long larg, void *parg); -long BIO_callback_ctrl(BIO *b, int cmd, - void (*fp) (BIO *, int, const char *, int, long, long)); +long BIO_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp); void *BIO_ptr_ctrl(BIO *bp, int cmd, long larg); long BIO_int_ctrl(BIO *bp, int cmd, long larg, int iarg); BIO *BIO_push(BIO *b, BIO *append); @@ -733,30 +730,30 @@ __bio_h__attr__((__format__(__printf__, 3, 0))); BIO_METHOD *BIO_meth_new(int type, const char *name); void BIO_meth_free(BIO_METHOD *biom); -int (*BIO_meth_get_write(BIO_METHOD *biom)) (BIO *, const char *, int); +int (*BIO_meth_get_write(const BIO_METHOD *biom)) (BIO *, const char *, int); int BIO_meth_set_write(BIO_METHOD *biom, int (*write) (BIO *, const char *, int)); -int (*BIO_meth_get_read(BIO_METHOD *biom)) (BIO *, char *, int); +int (*BIO_meth_get_read(const BIO_METHOD *biom)) (BIO *, char *, int); int BIO_meth_set_read(BIO_METHOD *biom, int (*read) (BIO *, char *, int)); -int (*BIO_meth_get_puts(BIO_METHOD *biom)) (BIO *, const char *); +int (*BIO_meth_get_puts(const BIO_METHOD *biom)) (BIO *, const char *); int BIO_meth_set_puts(BIO_METHOD *biom, int (*puts) (BIO *, const char *)); -int (*BIO_meth_get_gets(BIO_METHOD *biom)) (BIO *, char *, int); +int (*BIO_meth_get_gets(const BIO_METHOD *biom)) (BIO *, char *, int); int BIO_meth_set_gets(BIO_METHOD *biom, int (*gets) (BIO *, char *, int)); -long (*BIO_meth_get_ctrl(BIO_METHOD *biom)) (BIO *, int, long, void *); +long (*BIO_meth_get_ctrl(const BIO_METHOD *biom)) (BIO *, int, long, void *); int BIO_meth_set_ctrl(BIO_METHOD *biom, long (*ctrl) (BIO *, int, long, void *)); -int (*BIO_meth_get_create(BIO_METHOD *bion)) (BIO *); +int (*BIO_meth_get_create(const BIO_METHOD *bion)) (BIO *); int BIO_meth_set_create(BIO_METHOD *biom, int (*create) (BIO *)); -int (*BIO_meth_get_destroy(BIO_METHOD *biom)) (BIO *); +int (*BIO_meth_get_destroy(const BIO_METHOD *biom)) (BIO *); int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy) (BIO *)); -long (*BIO_meth_get_callback_ctrl(BIO_METHOD *biom)) - (BIO *, int, bio_info_cb *); +long (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom)) + (BIO *, int, BIO_info_cb *); int BIO_meth_set_callback_ctrl(BIO_METHOD *biom, long (*callback_ctrl) (BIO *, int, - bio_info_cb *)); + BIO_info_cb *)); /* BEGIN ERROR CODES */ /* @@ -784,6 +781,7 @@ int ERR_load_BIO_strings(void); # define BIO_F_BIO_LISTEN 139 # define BIO_F_BIO_LOOKUP 135 # define BIO_F_BIO_MAKE_PAIR 121 +# define BIO_F_BIO_METH_NEW 146 # define BIO_F_BIO_NEW 108 # define BIO_F_BIO_NEW_FILE 109 # define BIO_F_BIO_NEW_MEM_BUF 126 diff --git a/external/openssl/include/mac/openssl/bn.h b/external/openssl/include/mac/openssl/bn.h index 17bd5213..301edd52 100644 --- a/external/openssl/include/mac/openssl/bn.h +++ b/external/openssl/include/mac/openssl/bn.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -119,25 +119,76 @@ void *BN_GENCB_get_arg(BN_GENCB *cb); * on the size of the number */ /* - * number of Miller-Rabin iterations for an error rate of less than 2^-80 for - * random 'b'-bit input, b >= 100 (taken from table 4.4 in the Handbook of - * Applied Cryptography [Menezes, van Oorschot, Vanstone; CRC Press 1996]; - * original paper: Damgaard, Landrock, Pomerance: Average case error - * estimates for the strong probable prime test. -- Math. Comp. 61 (1993) - * 177-194) + * BN_prime_checks_for_size() returns the number of Miller-Rabin iterations + * that will be done for checking that a random number is probably prime. The + * error rate for accepting a composite number as prime depends on the size of + * the prime |b|. The error rates used are for calculating an RSA key with 2 primes, + * and so the level is what you would expect for a key of double the size of the + * prime. + * + * This table is generated using the algorithm of FIPS PUB 186-4 + * Digital Signature Standard (DSS), section F.1, page 117. + * (https://dx.doi.org/10.6028/NIST.FIPS.186-4) + * + * The following magma script was used to generate the output: + * securitybits:=125; + * k:=1024; + * for t:=1 to 65 do + * for M:=3 to Floor(2*Sqrt(k-1)-1) do + * S:=0; + * // Sum over m + * for m:=3 to M do + * s:=0; + * // Sum over j + * for j:=2 to m do + * s+:=(RealField(32)!2)^-(j+(k-1)/j); + * end for; + * S+:=2^(m-(m-1)*t)*s; + * end for; + * A:=2^(k-2-M*t); + * B:=8*(Pi(RealField(32))^2-6)/3*2^(k-2)*S; + * pkt:=2.00743*Log(2)*k*2^-k*(A+B); + * seclevel:=Floor(-Log(2,pkt)); + * if seclevel ge securitybits then + * printf "k: %5o, security: %o bits (t: %o, M: %o)\n",k,seclevel,t,M; + * break; + * end if; + * end for; + * if seclevel ge securitybits then break; end if; + * end for; + * + * It can be run online at: + * http://magma.maths.usyd.edu.au/calc + * + * And will output: + * k: 1024, security: 129 bits (t: 6, M: 23) + * + * k is the number of bits of the prime, securitybits is the level we want to + * reach. + * + * prime length | RSA key size | # MR tests | security level + * -------------+--------------|------------+--------------- + * (b) >= 6394 | >= 12788 | 3 | 256 bit + * (b) >= 3747 | >= 7494 | 3 | 192 bit + * (b) >= 1345 | >= 2690 | 4 | 128 bit + * (b) >= 1080 | >= 2160 | 5 | 128 bit + * (b) >= 852 | >= 1704 | 5 | 112 bit + * (b) >= 476 | >= 952 | 5 | 80 bit + * (b) >= 400 | >= 800 | 6 | 80 bit + * (b) >= 347 | >= 694 | 7 | 80 bit + * (b) >= 308 | >= 616 | 8 | 80 bit + * (b) >= 55 | >= 110 | 27 | 64 bit + * (b) >= 6 | >= 12 | 34 | 64 bit */ -# define BN_prime_checks_for_size(b) ((b) >= 1300 ? 2 : \ - (b) >= 850 ? 3 : \ - (b) >= 650 ? 4 : \ - (b) >= 550 ? 5 : \ - (b) >= 450 ? 6 : \ - (b) >= 400 ? 7 : \ - (b) >= 350 ? 8 : \ - (b) >= 300 ? 9 : \ - (b) >= 250 ? 12 : \ - (b) >= 200 ? 15 : \ - (b) >= 150 ? 18 : \ - /* b >= 100 */ 27) + +# define BN_prime_checks_for_size(b) ((b) >= 3747 ? 3 : \ + (b) >= 1345 ? 4 : \ + (b) >= 476 ? 5 : \ + (b) >= 400 ? 6 : \ + (b) >= 347 ? 7 : \ + (b) >= 308 ? 8 : \ + (b) >= 55 ? 27 : \ + /* b >= 6 */ 34) # define BN_num_bytes(a) ((BN_num_bits(a)+7)/8) @@ -196,7 +247,7 @@ int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx); */ void BN_set_negative(BIGNUM *b, int n); /** BN_is_negative returns 1 if the BIGNUM is negative - * \param a pointer to the BIGNUM object + * \param b pointer to the BIGNUM object * \return 1 if a < 0 and 0 otherwise */ int BN_is_negative(const BIGNUM *b); diff --git a/external/openssl/include/mac/openssl/buffer.h b/external/openssl/include/mac/openssl/buffer.h index 91f0e07f..35160b4f 100644 --- a/external/openssl/include/mac/openssl/buffer.h +++ b/external/openssl/include/mac/openssl/buffer.h @@ -21,10 +21,7 @@ extern "C" { #endif # include - -# if !defined(NO_SYS_TYPES_H) -# include -# endif +# include /* * These names are outdated as of OpenSSL 1.1; a future release diff --git a/external/openssl/include/mac/openssl/conf.h b/external/openssl/include/mac/openssl/conf.h index 462e3c9d..e0539e31 100644 --- a/external/openssl/include/mac/openssl/conf.h +++ b/external/openssl/include/mac/openssl/conf.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -191,6 +191,7 @@ int ERR_load_CONF_strings(void); # define CONF_F_NCONF_LOAD_BIO 110 # define CONF_F_NCONF_LOAD_FP 114 # define CONF_F_NCONF_NEW 111 +# define CONF_F_SSL_MODULE_INIT 123 # define CONF_F_STR_COPY 101 /* Reason codes. */ @@ -206,8 +207,13 @@ int ERR_load_CONF_strings(void); # define CONF_R_NO_SECTION 107 # define CONF_R_NO_SUCH_FILE 114 # define CONF_R_NO_VALUE 108 +# define CONF_R_SSL_COMMAND_SECTION_EMPTY 117 +# define CONF_R_SSL_COMMAND_SECTION_NOT_FOUND 118 +# define CONF_R_SSL_SECTION_EMPTY 119 +# define CONF_R_SSL_SECTION_NOT_FOUND 120 # define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103 # define CONF_R_UNKNOWN_MODULE_NAME 113 +# define CONF_R_VARIABLE_EXPANSION_TOO_LONG 116 # define CONF_R_VARIABLE_HAS_NO_VALUE 104 # ifdef __cplusplus diff --git a/external/openssl/include/mac/openssl/crypto.h b/external/openssl/include/mac/openssl/crypto.h index bd0b1408..fa3f12af 100644 --- a/external/openssl/include/mac/openssl/crypto.h +++ b/external/openssl/include/mac/openssl/crypto.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -146,6 +146,8 @@ int CRYPTO_mem_ctrl(int mode); CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE) # define OPENSSL_secure_free(addr) \ CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE) +# define OPENSSL_secure_clear_free(addr, num) \ + CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE) # define OPENSSL_secure_actual_size(ptr) \ CRYPTO_secure_actual_size(ptr) @@ -174,7 +176,7 @@ typedef void CRYPTO_EX_new (void *parent, void *ptr, CRYPTO_EX_DATA *ad, typedef void CRYPTO_EX_free (void *parent, void *ptr, CRYPTO_EX_DATA *ad, int idx, long argl, void *argp); typedef int CRYPTO_EX_dup (CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from, - void *srcp, int idx, long argl, void *argp); + void *from_d, int idx, long argl, void *argp); __owur int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); @@ -285,6 +287,8 @@ int CRYPTO_secure_malloc_done(void); void *CRYPTO_secure_malloc(size_t num, const char *file, int line); void *CRYPTO_secure_zalloc(size_t num, const char *file, int line); void CRYPTO_secure_free(void *ptr, const char *file, int line); +void CRYPTO_secure_clear_free(void *ptr, size_t num, + const char *file, int line); int CRYPTO_secure_allocated(const void *ptr); int CRYPTO_secure_malloc_initialized(void); size_t CRYPTO_secure_actual_size(void *ptr); @@ -367,7 +371,9 @@ int CRYPTO_memcmp(const volatile void * volatile in_a, # define OPENSSL_INIT_ENGINE_CAPI 0x00002000L # define OPENSSL_INIT_ENGINE_PADLOCK 0x00004000L # define OPENSSL_INIT_ENGINE_AFALG 0x00008000L -/* OPENSSL_INIT flag 0x00010000 reserved for internal use */ +/* OPENSSL_INIT_ZLIB 0x00010000L */ +/* currently unused 0x00020000L */ +/* OPENSSL_INIT_BASE_ONLY 0x00040000L */ /* OPENSSL_INIT flag range 0xfff00000 reserved for OPENSSL_init_ssl() */ /* Max OPENSSL_INIT flag value is 0x80000000 */ diff --git a/external/openssl/include/mac/openssl/ct.h b/external/openssl/include/mac/openssl/ct.h index 6c632652..bf29fbab 100644 --- a/external/openssl/include/mac/openssl/ct.h +++ b/external/openssl/include/mac/openssl/ct.h @@ -98,6 +98,21 @@ const CTLOG_STORE *CT_POLICY_EVAL_CTX_get0_log_store(const CT_POLICY_EVAL_CTX *c void CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE(CT_POLICY_EVAL_CTX *ctx, CTLOG_STORE *log_store); +/* + * Gets the time, in milliseconds since the Unix epoch, that will be used as the + * current time when checking whether an SCT was issued in the future. + * Such SCTs will fail validation, as required by RFC6962. + */ +uint64_t CT_POLICY_EVAL_CTX_get_time(const CT_POLICY_EVAL_CTX *ctx); + +/* + * Sets the time to evaluate SCTs against, in milliseconds since the Unix epoch. + * If an SCT's timestamp is after this time, it will be interpreted as having + * been issued in the future. RFC6962 states that "TLS clients MUST reject SCTs + * whose timestamp is in the future", so an SCT will not validate in this case. + */ +void CT_POLICY_EVAL_CTX_set_time(CT_POLICY_EVAL_CTX *ctx, uint64_t time_in_ms); + /***************** * SCT functions * *****************/ @@ -467,7 +482,6 @@ int ERR_load_CT_strings(void); # define CT_F_CTLOG_NEW 117 # define CT_F_CTLOG_NEW_FROM_BASE64 118 # define CT_F_CTLOG_NEW_FROM_CONF 119 -# define CT_F_CTLOG_NEW_NULL 120 # define CT_F_CTLOG_STORE_LOAD_CTX_NEW 122 # define CT_F_CTLOG_STORE_LOAD_FILE 123 # define CT_F_CTLOG_STORE_LOAD_LOG 130 @@ -482,6 +496,7 @@ int ERR_load_CT_strings(void); # define CT_F_O2I_SCT_LIST 111 # define CT_F_O2I_SCT_SIGNATURE 112 # define CT_F_SCT_CTX_NEW 126 +# define CT_F_SCT_CTX_VERIFY 128 # define CT_F_SCT_NEW 100 # define CT_F_SCT_NEW_FROM_BASE64 127 # define CT_F_SCT_SET0_LOG_ID 101 @@ -491,7 +506,6 @@ int ERR_load_CT_strings(void); # define CT_F_SCT_SET_LOG_ENTRY_TYPE 102 # define CT_F_SCT_SET_SIGNATURE_NID 103 # define CT_F_SCT_SET_VERSION 104 -# define CT_F_SCT_CTX_VERIFY 128 /* Reason codes. */ # define CT_R_BASE64_DECODE_ERROR 108 @@ -501,6 +515,7 @@ int ERR_load_CT_strings(void); # define CT_R_LOG_CONF_MISSING_DESCRIPTION 111 # define CT_R_LOG_CONF_MISSING_KEY 112 # define CT_R_LOG_KEY_INVALID 113 +# define CT_R_SCT_FUTURE_TIMESTAMP 116 # define CT_R_SCT_INVALID 104 # define CT_R_SCT_INVALID_SIGNATURE 107 # define CT_R_SCT_LIST_INVALID 105 diff --git a/external/openssl/include/mac/openssl/dh.h b/external/openssl/include/mac/openssl/dh.h index ae309e7b..8cf879e1 100644 --- a/external/openssl/include/mac/openssl/dh.h +++ b/external/openssl/include/mac/openssl/dh.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -87,12 +87,29 @@ DECLARE_ASN1_ITEM(DHparams) */ # define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME -# define d2i_DHparams_fp(fp,x) (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ - (char *(*)())d2i_DHparams,(fp),(unsigned char **)(x)) -# define i2d_DHparams_fp(fp,x) ASN1_i2d_fp(i2d_DHparams,(fp), \ - (unsigned char *)(x)) -# define d2i_DHparams_bio(bp,x) ASN1_d2i_bio_of(DH,DH_new,d2i_DHparams,bp,x) -# define i2d_DHparams_bio(bp,x) ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x) +# define d2i_DHparams_fp(fp,x) \ + (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ + (char *(*)())d2i_DHparams, \ + (fp), \ + (unsigned char **)(x)) +# define i2d_DHparams_fp(fp,x) \ + ASN1_i2d_fp(i2d_DHparams,(fp), (unsigned char *)(x)) +# define d2i_DHparams_bio(bp,x) \ + ASN1_d2i_bio_of(DH, DH_new, d2i_DHparams, bp, x) +# define i2d_DHparams_bio(bp,x) \ + ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x) + +# define d2i_DHxparams_fp(fp,x) \ + (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ + (char *(*)())d2i_DHxparams, \ + (fp), \ + (unsigned char **)(x)) +# define i2d_DHxparams_fp(fp,x) \ + ASN1_i2d_fp(i2d_DHxparams,(fp), (unsigned char *)(x)) +# define d2i_DHxparams_bio(bp,x) \ + ASN1_d2i_bio_of(DH, DH_new, d2i_DHxparams, bp, x) +# define i2d_DHxparams_bio(bp,x) \ + ASN1_i2d_bio_of_const(DH, i2d_DHxparams, bp, x) DH *DHparams_dup(DH *); @@ -124,6 +141,7 @@ DEPRECATEDIN_0_9_8(DH *DH_generate_parameters(int prime_len, int generator, int DH_generate_parameters_ex(DH *dh, int prime_len, int generator, BN_GENCB *cb); +int DH_check_params(const DH *dh, int *ret); int DH_check(const DH *dh, int *codes); int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *codes); int DH_generate_key(DH *dh); @@ -169,7 +187,7 @@ void DH_meth_free(DH_METHOD *dhm); DH_METHOD *DH_meth_dup(const DH_METHOD *dhm); const char *DH_meth_get0_name(const DH_METHOD *dhm); int DH_meth_set1_name(DH_METHOD *dhm, const char *name); -int DH_meth_get_flags(DH_METHOD *dhm); +int DH_meth_get_flags(const DH_METHOD *dhm); int DH_meth_set_flags(DH_METHOD *dhm, int flags); void *DH_meth_get0_app_data(const DH_METHOD *dhm); int DH_meth_set0_app_data(DH_METHOD *dhm, void *app_data); diff --git a/external/openssl/include/mac/openssl/dsa.h b/external/openssl/include/mac/openssl/dsa.h index cb5fbc2f..3a7b1a62 100644 --- a/external/openssl/include/mac/openssl/dsa.h +++ b/external/openssl/include/mac/openssl/dsa.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -146,10 +146,12 @@ int DSAparams_print_fp(FILE *fp, const DSA *x); int DSA_print_fp(FILE *bp, const DSA *x, int off); # endif -# define DSS_prime_checks 50 +# define DSS_prime_checks 64 /* - * Primality test according to FIPS PUB 186[-1], Appendix 2.1: 50 rounds of - * Rabin-Miller + * Primality test according to FIPS PUB 186-4, Appendix C.3. Since we only + * have one value here we set the number of checks to 64 which is the 128 bit + * security level that is the highest level and valid for creating a 3072 bit + * DSA key. */ # define DSA_is_prime(n, callback, cb_arg) \ BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg) @@ -186,7 +188,7 @@ void DSA_meth_free(DSA_METHOD *dsam); DSA_METHOD *DSA_meth_dup(const DSA_METHOD *dsam); const char *DSA_meth_get0_name(const DSA_METHOD *dsam); int DSA_meth_set1_name(DSA_METHOD *dsam, const char *name); -int DSA_meth_get_flags(DSA_METHOD *dsam); +int DSA_meth_get_flags(const DSA_METHOD *dsam); int DSA_meth_set_flags(DSA_METHOD *dsam, int flags); void *DSA_meth_get0_app_data(const DSA_METHOD *dsam); int DSA_meth_set0_app_data(DSA_METHOD *dsam, void *app_data); @@ -260,6 +262,7 @@ int ERR_load_DSA_strings(void); # define DSA_F_DSA_SIG_NEW 102 # define DSA_F_OLD_DSA_PRIV_DECODE 122 # define DSA_F_PKEY_DSA_CTRL 120 +# define DSA_F_PKEY_DSA_CTRL_STR 104 # define DSA_F_PKEY_DSA_KEYGEN 121 /* Reason codes. */ @@ -274,6 +277,7 @@ int ERR_load_DSA_strings(void); # define DSA_R_NO_PARAMETERS_SET 107 # define DSA_R_PARAMETER_ENCODING_ERROR 105 # define DSA_R_Q_NOT_PRIME 113 +# define DSA_R_SEED_LEN_SMALL 110 # ifdef __cplusplus } diff --git a/external/openssl/include/mac/openssl/e_os2.h b/external/openssl/include/mac/openssl/e_os2.h index 99ea3477..9800e154 100644 --- a/external/openssl/include/mac/openssl/e_os2.h +++ b/external/openssl/include/mac/openssl/e_os2.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -49,7 +49,6 @@ extern "C" { # define OPENSSL_SYS_WIN32_UWIN # else # if defined(__CYGWIN__) || defined(OPENSSL_SYS_CYGWIN) -# undef OPENSSL_SYS_UNIX # define OPENSSL_SYS_WIN32_CYGWIN # else # if defined(_WIN32) || defined(OPENSSL_SYS_WIN32) @@ -212,9 +211,9 @@ extern "C" { # endif # endif -# if defined(OPENSSL_SYS_UEFI) && !defined(ssize_t) -# define ossl_ssize_t int -# define OSSL_SSIZE_MAX INT_MAX +# if defined(OPENSSL_SYS_UEFI) && !defined(ossl_ssize_t) +# define ossl_ssize_t INTN +# define OSSL_SSIZE_MAX MAX_INTN # endif # ifndef ossl_ssize_t @@ -242,7 +241,6 @@ typedef INT32 int32_t; typedef UINT32 uint32_t; typedef INT64 int64_t; typedef UINT64 uint64_t; -# define PRIu64 "%Lu" # elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ defined(__osf__) || defined(__sgi) || defined(__hpux) || \ defined(OPENSSL_SYS_VMS) || defined (__OpenBSD__) @@ -264,18 +262,6 @@ typedef unsigned __int64 uint64_t; # include # endif -/* - * We need a format operator for some client tools for uint64_t. If inttypes.h - * isn't available or did not define it, just go with hard-coded. - */ -# ifndef PRIu64 -# ifdef SIXTY_FOUR_BIT_LONG -# define PRIu64 "lu" -# else -# define PRIu64 "llu" -# endif -# endif - /* ossl_inline: portable inline definition usable in public headers */ # if !defined(inline) && !defined(__cplusplus) # if defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L diff --git a/external/openssl/include/mac/openssl/ec.h b/external/openssl/include/mac/openssl/ec.h index 656cb410..c4aeaed5 100644 --- a/external/openssl/include/mac/openssl/ec.h +++ b/external/openssl/include/mac/openssl/ec.h @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2002-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -573,11 +573,9 @@ int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p, * \param point EC_POINT object * \param form point conversion form * \param pbuf returns pointer to allocated buffer - * \param len length of the memory buffer * \param ctx BN_CTX object (optional) * \return the length of the encoded octet string or 0 if an error occurred */ - size_t EC_POINT_point2buf(const EC_GROUP *group, const EC_POINT *point, point_conversion_form_t form, unsigned char **pbuf, BN_CTX *ctx); @@ -863,7 +861,7 @@ int EC_KEY_generate_key(EC_KEY *key); int EC_KEY_check_key(const EC_KEY *key); /** Indicates if an EC_KEY can be used for signing. - * \param key the EC_KEY object + * \param eckey the EC_KEY object * \return 1 if can can sign and 0 otherwise. */ int EC_KEY_can_sign(const EC_KEY *eckey); @@ -882,11 +880,9 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, * \param key key to encode * \param form point conversion form * \param pbuf returns pointer to allocated buffer - * \param len length of the memory buffer * \param ctx BN_CTX object (optional) * \return the length of the encoded octet string or 0 if an error occurred */ - size_t EC_KEY_key2buf(const EC_KEY *key, point_conversion_form_t form, unsigned char **pbuf, BN_CTX *ctx); @@ -921,11 +917,10 @@ int EC_KEY_oct2priv(EC_KEY *key, const unsigned char *buf, size_t len); size_t EC_KEY_priv2oct(const EC_KEY *key, unsigned char *buf, size_t len); /** Encodes an EC_KEY private key to an allocated octet string - * \param key key to encode + * \param eckey key to encode * \param pbuf returns pointer to allocated buffer * \return the length of the encoded octet string or 0 if an error occurred */ - size_t EC_KEY_priv2buf(const EC_KEY *eckey, unsigned char **pbuf); /********************************************************************/ @@ -1228,7 +1223,7 @@ void EC_KEY_METHOD_set_verify(EC_KEY_METHOD *meth, const ECDSA_SIG *sig, EC_KEY *eckey)); -void EC_KEY_METHOD_get_init(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_init(const EC_KEY_METHOD *meth, int (**pinit)(EC_KEY *key), void (**pfinish)(EC_KEY *key), int (**pcopy)(EC_KEY *dest, const EC_KEY *src), @@ -1239,16 +1234,16 @@ void EC_KEY_METHOD_get_init(EC_KEY_METHOD *meth, int (**pset_public)(EC_KEY *key, const EC_POINT *pub_key)); -void EC_KEY_METHOD_get_keygen(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_keygen(const EC_KEY_METHOD *meth, int (**pkeygen)(EC_KEY *key)); -void EC_KEY_METHOD_get_compute_key(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_compute_key(const EC_KEY_METHOD *meth, int (**pck)(unsigned char **psec, size_t *pseclen, const EC_POINT *pub_key, const EC_KEY *ecdh)); -void EC_KEY_METHOD_get_sign(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_sign(const EC_KEY_METHOD *meth, int (**psign)(int type, const unsigned char *dgst, int dlen, unsigned char *sig, unsigned int *siglen, @@ -1262,7 +1257,7 @@ void EC_KEY_METHOD_get_sign(EC_KEY_METHOD *meth, const BIGNUM *in_r, EC_KEY *eckey)); -void EC_KEY_METHOD_get_verify(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_verify(const EC_KEY_METHOD *meth, int (**pverify)(int type, const unsigned char *dgst, int dgst_len, const unsigned char *sigbuf, @@ -1404,6 +1399,7 @@ int ERR_load_EC_strings(void); # define EC_F_EC_ASN1_GROUP2CURVE 153 # define EC_F_EC_ASN1_GROUP2FIELDID 154 # define EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY 208 +# define EC_F_EC_GF2M_SIMPLE_FIELD_INV 296 # define EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT 159 # define EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE 195 # define EC_F_EC_GF2M_SIMPLE_OCT2POINT 160 @@ -1413,6 +1409,7 @@ int ERR_load_EC_strings(void); # define EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES 164 # define EC_F_EC_GFP_MONT_FIELD_DECODE 133 # define EC_F_EC_GFP_MONT_FIELD_ENCODE 134 +# define EC_F_EC_GFP_MONT_FIELD_INV 297 # define EC_F_EC_GFP_MONT_FIELD_MUL 131 # define EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE 209 # define EC_F_EC_GFP_MONT_FIELD_SQR 132 @@ -1429,6 +1426,8 @@ int ERR_load_EC_strings(void); # define EC_F_EC_GFP_NIST_FIELD_MUL 200 # define EC_F_EC_GFP_NIST_FIELD_SQR 201 # define EC_F_EC_GFP_NIST_GROUP_SET_CURVE 202 +# define EC_F_EC_GFP_SIMPLE_BLIND_COORDINATES 287 +# define EC_F_EC_GFP_SIMPLE_FIELD_INV 298 # define EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT 165 # define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE 166 # define EC_F_EC_GFP_SIMPLE_MAKE_AFFINE 102 @@ -1518,6 +1517,7 @@ int ERR_load_EC_strings(void); # define EC_R_BAD_SIGNATURE 156 # define EC_R_BIGNUM_OUT_OF_RANGE 144 # define EC_R_BUFFER_TOO_SMALL 100 +# define EC_R_CANNOT_INVERT 165 # define EC_R_COORDINATES_OUT_OF_RANGE 146 # define EC_R_CURVE_DOES_NOT_SUPPORT_ECDH 160 # define EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING 159 @@ -1568,6 +1568,7 @@ int ERR_load_EC_strings(void); # define EC_R_SLOT_FULL 108 # define EC_R_UNDEFINED_GENERATOR 113 # define EC_R_UNDEFINED_ORDER 128 +# define EC_R_UNKNOWN_COFACTOR 164 # define EC_R_UNKNOWN_GROUP 129 # define EC_R_UNKNOWN_ORDER 114 # define EC_R_UNSUPPORTED_FIELD 131 diff --git a/external/openssl/include/mac/openssl/engine.h b/external/openssl/include/mac/openssl/engine.h index 319371e4..26cf7148 100644 --- a/external/openssl/include/mac/openssl/engine.h +++ b/external/openssl/include/mac/openssl/engine.h @@ -334,8 +334,6 @@ ENGINE *ENGINE_by_id(const char *id); OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_PADLOCK, NULL) # define ENGINE_load_capi() \ OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_CAPI, NULL) -# define ENGINE_load_dasync() \ - OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_DASYNC, NULL) # define ENGINE_load_afalg() \ OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_AFALG, NULL) # endif diff --git a/external/openssl/include/mac/openssl/err.h b/external/openssl/include/mac/openssl/err.h index f9390919..ba40f79b 100644 --- a/external/openssl/include/mac/openssl/err.h +++ b/external/openssl/include/mac/openssl/err.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -37,6 +37,7 @@ extern "C" { # define ERR_TXT_STRING 0x02 # define ERR_FLAG_MARK 0x01 +# define ERR_FLAG_CLEAR 0x02 # define ERR_NUM_ERRORS 16 typedef struct err_state_st { @@ -89,7 +90,7 @@ typedef struct err_state_st { # define ERR_LIB_CMS 46 # define ERR_LIB_TS 47 # define ERR_LIB_HMAC 48 -# define ERR_LIB_JPAKE 49 +/* # define ERR_LIB_JPAKE 49 */ # define ERR_LIB_CT 50 # define ERR_LIB_ASYNC 51 # define ERR_LIB_KDF 52 @@ -128,7 +129,6 @@ typedef struct err_state_st { # define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define TSerr(f,r) ERR_PUT_error(ERR_LIB_TS,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define HMACerr(f,r) ERR_PUT_error(ERR_LIB_HMAC,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define JPAKEerr(f,r) ERR_PUT_error(ERR_LIB_JPAKE,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define CTerr(f,r) ERR_PUT_error(ERR_LIB_CT,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define ASYNCerr(f,r) ERR_PUT_error(ERR_LIB_ASYNC,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define KDFerr(f,r) ERR_PUT_error(ERR_LIB_KDF,(f),(r),OPENSSL_FILE,OPENSSL_LINE) @@ -140,6 +140,7 @@ typedef struct err_state_st { # define ERR_GET_LIB(l) (int)(((l) >> 24L) & 0x0FFL) # define ERR_GET_FUNC(l) (int)(((l) >> 12L) & 0xFFFL) # define ERR_GET_REASON(l) (int)( (l) & 0xFFFL) +# define ERR_FATAL_ERROR(l) (int)( (l) & ERR_R_FATAL) /* OS functions */ # define SYS_F_FOPEN 1 @@ -159,6 +160,7 @@ typedef struct err_state_st { # define SYS_F_GETSOCKOPT 15 # define SYS_F_GETSOCKNAME 16 # define SYS_F_GETHOSTBYNAME 17 +# define SYS_F_FFLUSH 18 /* reasons */ # define ERR_R_SYS_LIB ERR_LIB_SYS/* 2 */ diff --git a/external/openssl/include/mac/openssl/evp.h b/external/openssl/include/mac/openssl/evp.h index b9c83b2b..36e29344 100644 --- a/external/openssl/include/mac/openssl/evp.h +++ b/external/openssl/include/mac/openssl/evp.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -900,6 +900,9 @@ int EVP_PKEY_security_bits(const EVP_PKEY *pkey); int EVP_PKEY_size(EVP_PKEY *pkey); int EVP_PKEY_set_type(EVP_PKEY *pkey, int type); int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len); +# ifndef OPENSSL_NO_ENGINE +int EVP_PKEY_set1_engine(EVP_PKEY *pkey, ENGINE *e); +# endif int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key); void *EVP_PKEY_get0(const EVP_PKEY *pkey); const unsigned char *EVP_PKEY_get0_hmac(const EVP_PKEY *pkey, size_t *len); @@ -1348,34 +1351,34 @@ void EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth, const char *type, const char *value)); -void EVP_PKEY_meth_get_init(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_init(const EVP_PKEY_METHOD *pmeth, int (**pinit) (EVP_PKEY_CTX *ctx)); -void EVP_PKEY_meth_get_copy(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_copy(const EVP_PKEY_METHOD *pmeth, int (**pcopy) (EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src)); -void EVP_PKEY_meth_get_cleanup(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_cleanup(const EVP_PKEY_METHOD *pmeth, void (**pcleanup) (EVP_PKEY_CTX *ctx)); -void EVP_PKEY_meth_get_paramgen(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_paramgen(const EVP_PKEY_METHOD *pmeth, int (**pparamgen_init) (EVP_PKEY_CTX *ctx), int (**pparamgen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)); -void EVP_PKEY_meth_get_keygen(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_keygen(const EVP_PKEY_METHOD *pmeth, int (**pkeygen_init) (EVP_PKEY_CTX *ctx), int (**pkeygen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)); -void EVP_PKEY_meth_get_sign(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_sign(const EVP_PKEY_METHOD *pmeth, int (**psign_init) (EVP_PKEY_CTX *ctx), int (**psign) (EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, const unsigned char *tbs, size_t tbslen)); -void EVP_PKEY_meth_get_verify(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_verify(const EVP_PKEY_METHOD *pmeth, int (**pverify_init) (EVP_PKEY_CTX *ctx), int (**pverify) (EVP_PKEY_CTX *ctx, const unsigned char *sig, @@ -1383,7 +1386,7 @@ void EVP_PKEY_meth_get_verify(EVP_PKEY_METHOD *pmeth, const unsigned char *tbs, size_t tbslen)); -void EVP_PKEY_meth_get_verify_recover(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_verify_recover(const EVP_PKEY_METHOD *pmeth, int (**pverify_recover_init) (EVP_PKEY_CTX *ctx), int (**pverify_recover) (EVP_PKEY_CTX @@ -1395,7 +1398,7 @@ void EVP_PKEY_meth_get_verify_recover(EVP_PKEY_METHOD *pmeth, char *tbs, size_t tbslen)); -void EVP_PKEY_meth_get_signctx(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_signctx(const EVP_PKEY_METHOD *pmeth, int (**psignctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx), int (**psignctx) (EVP_PKEY_CTX *ctx, @@ -1403,7 +1406,7 @@ void EVP_PKEY_meth_get_signctx(EVP_PKEY_METHOD *pmeth, size_t *siglen, EVP_MD_CTX *mctx)); -void EVP_PKEY_meth_get_verifyctx(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_verifyctx(const EVP_PKEY_METHOD *pmeth, int (**pverifyctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx), int (**pverifyctx) (EVP_PKEY_CTX *ctx, @@ -1411,7 +1414,7 @@ void EVP_PKEY_meth_get_verifyctx(EVP_PKEY_METHOD *pmeth, int siglen, EVP_MD_CTX *mctx)); -void EVP_PKEY_meth_get_encrypt(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_encrypt(const EVP_PKEY_METHOD *pmeth, int (**pencrypt_init) (EVP_PKEY_CTX *ctx), int (**pencryptfn) (EVP_PKEY_CTX *ctx, unsigned char *out, @@ -1419,7 +1422,7 @@ void EVP_PKEY_meth_get_encrypt(EVP_PKEY_METHOD *pmeth, const unsigned char *in, size_t inlen)); -void EVP_PKEY_meth_get_decrypt(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_decrypt(const EVP_PKEY_METHOD *pmeth, int (**pdecrypt_init) (EVP_PKEY_CTX *ctx), int (**pdecrypt) (EVP_PKEY_CTX *ctx, unsigned char *out, @@ -1427,13 +1430,13 @@ void EVP_PKEY_meth_get_decrypt(EVP_PKEY_METHOD *pmeth, const unsigned char *in, size_t inlen)); -void EVP_PKEY_meth_get_derive(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_derive(const EVP_PKEY_METHOD *pmeth, int (**pderive_init) (EVP_PKEY_CTX *ctx), int (**pderive) (EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen)); -void EVP_PKEY_meth_get_ctrl(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_ctrl(const EVP_PKEY_METHOD *pmeth, int (**pctrl) (EVP_PKEY_CTX *ctx, int type, int p1, void *p2), int (**pctrl_str) (EVP_PKEY_CTX *ctx, @@ -1455,11 +1458,14 @@ int ERR_load_EVP_strings(void); /* Function codes. */ # define EVP_F_AESNI_INIT_KEY 165 # define EVP_F_AES_INIT_KEY 133 +# define EVP_F_AES_OCB_CIPHER 169 # define EVP_F_AES_T4_INIT_KEY 178 +# define EVP_F_AES_WRAP_CIPHER 170 # define EVP_F_ALG_MODULE_INIT 177 # define EVP_F_CAMELLIA_INIT_KEY 159 # define EVP_F_CHACHA20_POLY1305_CTRL 182 # define EVP_F_CMLL_T4_INIT_KEY 179 +# define EVP_F_DES_EDE3_WRAP_CIPHER 171 # define EVP_F_DO_SIGVER_INIT 161 # define EVP_F_EVP_CIPHERINIT_EX 123 # define EVP_F_EVP_CIPHER_CTX_COPY 163 @@ -1479,6 +1485,7 @@ int ERR_load_EVP_strings(void); # define EVP_F_EVP_PBE_SCRYPT 181 # define EVP_F_EVP_PKCS82PKEY 111 # define EVP_F_EVP_PKEY2PKCS8 113 +# define EVP_F_EVP_PKEY_ASN1_ADD0 168 # define EVP_F_EVP_PKEY_COPY_PARAMETERS 103 # define EVP_F_EVP_PKEY_CTX_CTRL 137 # define EVP_F_EVP_PKEY_CTX_CTRL_STR 150 @@ -1499,9 +1506,12 @@ int ERR_load_EVP_strings(void); # define EVP_F_EVP_PKEY_GET0_RSA 121 # define EVP_F_EVP_PKEY_KEYGEN 146 # define EVP_F_EVP_PKEY_KEYGEN_INIT 147 +# define EVP_F_EVP_PKEY_METH_ADD0 172 +# define EVP_F_EVP_PKEY_METH_NEW 173 # define EVP_F_EVP_PKEY_NEW 106 # define EVP_F_EVP_PKEY_PARAMGEN 148 # define EVP_F_EVP_PKEY_PARAMGEN_INIT 149 +# define EVP_F_EVP_PKEY_SET1_ENGINE 187 # define EVP_F_EVP_PKEY_SIGN 140 # define EVP_F_EVP_PKEY_SIGN_INIT 141 # define EVP_F_EVP_PKEY_VERIFY 142 @@ -1546,6 +1556,7 @@ int ERR_load_EVP_strings(void); # define EVP_R_INPUT_NOT_INITIALIZED 111 # define EVP_R_INVALID_DIGEST 152 # define EVP_R_INVALID_FIPS_MODE 168 +# define EVP_R_INVALID_KEY 163 # define EVP_R_INVALID_KEY_LENGTH 130 # define EVP_R_INVALID_OPERATION 148 # define EVP_R_KEYGEN_FAILURE 120 @@ -1561,6 +1572,9 @@ int ERR_load_EVP_strings(void); # define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 150 # define EVP_R_OPERATON_NOT_INITIALIZED 151 # define EVP_R_PARTIALLY_OVERLAPPING 162 +# define EVP_R_PBKDF2_ERROR 176 +# define EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED 175 +# define EVP_R_PKEY_ASN1_METHOD_ALREADY_REGISTERED 164 # define EVP_R_PRIVATE_KEY_DECODE_ERROR 145 # define EVP_R_PRIVATE_KEY_ENCODE_ERROR 146 # define EVP_R_PUBLIC_KEY_NOT_RSA 106 @@ -1568,12 +1582,12 @@ int ERR_load_EVP_strings(void); # define EVP_R_UNKNOWN_DIGEST 161 # define EVP_R_UNKNOWN_OPTION 169 # define EVP_R_UNKNOWN_PBE_ALGORITHM 121 -# define EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS 135 # define EVP_R_UNSUPPORTED_ALGORITHM 156 # define EVP_R_UNSUPPORTED_CIPHER 107 # define EVP_R_UNSUPPORTED_KEYLENGTH 123 # define EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 124 # define EVP_R_UNSUPPORTED_KEY_SIZE 108 +# define EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS 135 # define EVP_R_UNSUPPORTED_PRF 125 # define EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM 118 # define EVP_R_UNSUPPORTED_SALT_TYPE 126 diff --git a/external/openssl/include/mac/openssl/lhash.h b/external/openssl/include/mac/openssl/lhash.h index e2ccb65d..8ecc5884 100644 --- a/external/openssl/include/mac/openssl/lhash.h +++ b/external/openssl/include/mac/openssl/lhash.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -95,7 +95,7 @@ void OPENSSL_LH_node_usage_stats_bio(const OPENSSL_LHASH *lh, BIO *out); # define _LHASH OPENSSL_LHASH # define LHASH_NODE OPENSSL_LH_NODE # define lh_error OPENSSL_LH_error -# define lh_new OPENSSL_lh_new +# define lh_new OPENSSL_LH_new # define lh_free OPENSSL_LH_free # define lh_insert OPENSSL_LH_insert # define lh_delete OPENSSL_LH_delete @@ -195,8 +195,21 @@ void OPENSSL_LH_node_usage_stats_bio(const OPENSSL_LHASH *lh, BIO *out); LHASH_OF(type) DEFINE_LHASH_OF(OPENSSL_STRING); +# ifdef _MSC_VER +/* + * push and pop this warning: + * warning C4090: 'function': different 'const' qualifiers + */ +# pragma warning (push) +# pragma warning (disable: 4090) +# endif + DEFINE_LHASH_OF(OPENSSL_CSTRING); +# ifdef _MSC_VER +# pragma warning (pop) +# endif + #ifdef __cplusplus } #endif diff --git a/external/openssl/include/mac/openssl/objects.h b/external/openssl/include/mac/openssl/objects.h index 09d614ff..d4462fee 100644 --- a/external/openssl/include/mac/openssl/objects.h +++ b/external/openssl/include/mac/openssl/objects.h @@ -992,7 +992,7 @@ const void *OBJ_bsearch_ex_(const void *key, const void *base, int num, * const void *a_; * const nid_triple const *a = a_; * - * The assignement discards a const because what you really want is: + * The assignment discards a const because what you really want is: * * const int const * const *a = a_; * @@ -1000,7 +1000,7 @@ const void *OBJ_bsearch_ex_(const void *key, const void *base, int num, * which breaks comparison functions. * * Thus we end up having to cast, sadly, or unpack the - * declarations. Or, as I finally did in this case, delcare nid_triple + * declarations. Or, as I finally did in this case, declare nid_triple * to be a struct, which it should have been in the first place. * * Ben, August 2008. diff --git a/external/openssl/include/mac/openssl/ocsp.h b/external/openssl/include/mac/openssl/ocsp.h index 08debc5b..ba1b9731 100644 --- a/external/openssl/include/mac/openssl/ocsp.h +++ b/external/openssl/include/mac/openssl/ocsp.h @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -92,7 +92,6 @@ typedef struct ocsp_resp_bytes_st OCSP_RESPBYTES; # define V_OCSP_RESPID_KEY 1 DEFINE_STACK_OF(OCSP_RESPID) -DECLARE_ASN1_FUNCTIONS(OCSP_RESPID) typedef struct ocsp_revoked_info_st OCSP_REVOKEDINFO; @@ -137,22 +136,6 @@ typedef struct ocsp_service_locator_st OCSP_SERVICELOC; # define i2d_OCSP_REQUEST_bio(bp,o) ASN1_i2d_bio_of(OCSP_REQUEST,i2d_OCSP_REQUEST,bp,o) -# define OCSP_REQUEST_sign(o,pkey,md) \ - ASN1_item_sign(ASN1_ITEM_rptr(OCSP_REQINFO),\ - &o->optionalSignature->signatureAlgorithm,NULL,\ - o->optionalSignature->signature,&o->tbsRequest,pkey,md) - -# define OCSP_BASICRESP_sign(o,pkey,md,d) \ - ASN1_item_sign(ASN1_ITEM_rptr(OCSP_RESPDATA),&o->signatureAlgorithm,NULL,\ - o->signature,&o->tbsResponseData,pkey,md) - -# define OCSP_REQUEST_verify(a,r) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_REQINFO),\ - &a->optionalSignature->signatureAlgorithm,\ - a->optionalSignature->signature,&a->tbsRequest,r) - -# define OCSP_BASICRESP_verify(a,r,d) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_RESPDATA),\ - &a->signatureAlgorithm,a->signature,&a->tbsResponseData,r) - # define ASN1_BIT_STRING_digest(data,type,md,len) \ ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING),type,data,md,len) @@ -175,8 +158,6 @@ int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it, int OCSP_REQ_CTX_nbio_d2i(OCSP_REQ_CTX *rctx, ASN1_VALUE **pval, const ASN1_ITEM *it); BIO *OCSP_REQ_CTX_get0_mem_bio(OCSP_REQ_CTX *rctx); -int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it, - ASN1_VALUE *val); int OCSP_REQ_CTX_http(OCSP_REQ_CTX *rctx, const char *op, const char *path); int OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, OCSP_REQUEST *req); int OCSP_REQ_CTX_add1_header(OCSP_REQ_CTX *rctx, @@ -210,6 +191,10 @@ int OCSP_response_status(OCSP_RESPONSE *resp); OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp); const ASN1_OCTET_STRING *OCSP_resp_get0_signature(const OCSP_BASICRESP *bs); +const X509_ALGOR *OCSP_resp_get0_tbs_sigalg(const OCSP_BASICRESP *bs); +const OCSP_RESPDATA *OCSP_resp_get0_respdata(const OCSP_BASICRESP *bs); +int OCSP_resp_get0_signer(OCSP_BASICRESP *bs, X509 **signer, + STACK_OF(X509) *extra_certs); int OCSP_resp_count(OCSP_BASICRESP *bs); OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx); diff --git a/external/openssl/include/mac/openssl/opensslconf.h b/external/openssl/include/mac/openssl/opensslconf.h index f5d2ff36..568fbd05 100644 --- a/external/openssl/include/mac/openssl/opensslconf.h +++ b/external/openssl/include/mac/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by Makefile from include/openssl/opensslconf.h.in * - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -99,12 +99,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE diff --git a/external/openssl/include/mac/openssl/opensslv.h b/external/openssl/include/mac/openssl/opensslv.h index 2d54b69b..12483c6e 100644 --- a/external/openssl/include/mac/openssl/opensslv.h +++ b/external/openssl/include/mac/openssl/opensslv.h @@ -1,5 +1,5 @@ /* - * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -39,11 +39,11 @@ extern "C" { * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for * major minor fix final patch/beta) */ -# define OPENSSL_VERSION_NUMBER 0x1010003fL +# define OPENSSL_VERSION_NUMBER 0x101000cfL # ifdef OPENSSL_FIPS -# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0c-fips 10 Nov 2016" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0l-fips 10 Sep 2019" # else -# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0c 10 Nov 2016" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0l 10 Sep 2019" # endif /*- diff --git a/external/openssl/include/mac/openssl/pem.h b/external/openssl/include/mac/openssl/pem.h index 2375d635..f7ce3c61 100644 --- a/external/openssl/include/mac/openssl/pem.h +++ b/external/openssl/include/mac/openssl/pem.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -322,7 +322,8 @@ int PEM_SignUpdate(EVP_MD_CTX *ctx, unsigned char *d, unsigned int cnt); int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen, EVP_PKEY *pkey); -int PEM_def_callback(char *buf, int num, int w, void *key); +/* The default pem_password_cb that's used internally */ +int PEM_def_callback(char *buf, int num, int rwflag, void *userdata); void PEM_proc_type(char *buf, int type); void PEM_dek_info(char *buf, const char *type, int len, char *str); diff --git a/external/openssl/include/mac/openssl/rsa.h b/external/openssl/include/mac/openssl/rsa.h index 4d6e9cc9..9c28329f 100644 --- a/external/openssl/include/mac/openssl/rsa.h +++ b/external/openssl/include/mac/openssl/rsa.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -374,7 +374,7 @@ void RSA_meth_free(RSA_METHOD *meth); RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth); const char *RSA_meth_get0_name(const RSA_METHOD *meth); int RSA_meth_set1_name(RSA_METHOD *meth, const char *name); -int RSA_meth_get_flags(RSA_METHOD *meth); +int RSA_meth_get_flags(const RSA_METHOD *meth); int RSA_meth_set_flags(RSA_METHOD *meth, int flags); void *RSA_meth_get0_app_data(const RSA_METHOD *meth); int RSA_meth_set0_app_data(RSA_METHOD *meth, void *app_data); @@ -407,9 +407,9 @@ int RSA_meth_set_priv_dec(RSA_METHOD *rsa, unsigned char *to, RSA *rsa, int padding)); int (*RSA_meth_get_mod_exp(const RSA_METHOD *meth)) - (BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx); + (BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx); int RSA_meth_set_mod_exp(RSA_METHOD *rsa, - int (*mod_exp) (BIGNUM *r0, const BIGNUM *I, RSA *rsa, + int (*mod_exp) (BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx)); int (*RSA_meth_get_bn_mod_exp(const RSA_METHOD *meth)) (BIGNUM *r, const BIGNUM *a, const BIGNUM *p, @@ -468,6 +468,7 @@ int ERR_load_RSA_strings(void); # define RSA_F_PKEY_RSA_CTRL 143 # define RSA_F_PKEY_RSA_CTRL_STR 144 # define RSA_F_PKEY_RSA_SIGN 142 +# define RSA_F_PKEY_RSA_VERIFY 149 # define RSA_F_PKEY_RSA_VERIFYRECOVER 141 # define RSA_F_RSA_ALGOR_TO_MD 156 # define RSA_F_RSA_BUILTIN_KEYGEN 129 diff --git a/external/openssl/include/mac/openssl/seed.h b/external/openssl/include/mac/openssl/seed.h index bb97131d..de10b085 100644 --- a/external/openssl/include/mac/openssl/seed.h +++ b/external/openssl/include/mac/openssl/seed.h @@ -52,9 +52,7 @@ extern "C" { # endif # endif -# if !defined(NO_SYS_TYPES_H) -# include -# endif +# include # define SEED_BLOCK_SIZE 16 # define SEED_KEY_LENGTH 16 diff --git a/external/openssl/include/mac/openssl/srtp.h b/external/openssl/include/mac/openssl/srtp.h index 5ddfa46d..0b57c235 100644 --- a/external/openssl/include/mac/openssl/srtp.h +++ b/external/openssl/include/mac/openssl/srtp.h @@ -36,7 +36,7 @@ extern "C" { # ifndef OPENSSL_NO_SRTP __owur int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles); -__owur int SSL_set_tlsext_use_srtp(SSL *ctx, const char *profiles); +__owur int SSL_set_tlsext_use_srtp(SSL *ssl, const char *profiles); __owur STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl); __owur SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s); diff --git a/external/openssl/include/mac/openssl/ssl.h b/external/openssl/include/mac/openssl/ssl.h index 86ab9125..56e20562 100644 --- a/external/openssl/include/mac/openssl/ssl.h +++ b/external/openssl/include/mac/openssl/ssl.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -95,14 +95,14 @@ extern "C" { # define SSL_TXT_NULL "NULL" # define SSL_TXT_kRSA "kRSA" -# define SSL_TXT_kDHr "kDHr" -# define SSL_TXT_kDHd "kDHd" -# define SSL_TXT_kDH "kDH" +# define SSL_TXT_kDHr "kDHr"/* this cipher class has been removed */ +# define SSL_TXT_kDHd "kDHd"/* this cipher class has been removed */ +# define SSL_TXT_kDH "kDH"/* this cipher class has been removed */ # define SSL_TXT_kEDH "kEDH"/* alias for kDHE */ # define SSL_TXT_kDHE "kDHE" -# define SSL_TXT_kECDHr "kECDHr" -# define SSL_TXT_kECDHe "kECDHe" -# define SSL_TXT_kECDH "kECDH" +# define SSL_TXT_kECDHr "kECDHr"/* this cipher class has been removed */ +# define SSL_TXT_kECDHe "kECDHe"/* this cipher class has been removed */ +# define SSL_TXT_kECDH "kECDH"/* this cipher class has been removed */ # define SSL_TXT_kEECDH "kEECDH"/* alias for kECDHE */ # define SSL_TXT_kECDHE "kECDHE" # define SSL_TXT_kPSK "kPSK" @@ -114,8 +114,8 @@ extern "C" { # define SSL_TXT_aRSA "aRSA" # define SSL_TXT_aDSS "aDSS" -# define SSL_TXT_aDH "aDH" -# define SSL_TXT_aECDH "aECDH" +# define SSL_TXT_aDH "aDH"/* this cipher class has been removed */ +# define SSL_TXT_aECDH "aECDH"/* this cipher class has been removed */ # define SSL_TXT_aECDSA "aECDSA" # define SSL_TXT_aPSK "aPSK" # define SSL_TXT_aGOST94 "aGOST94" @@ -262,54 +262,33 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, const unsigned char *in, size_t inlen, int *al, void *parse_arg); +/* Typedef for verification callback */ +typedef int (*SSL_verify_cb)(int preverify_ok, X509_STORE_CTX *x509_ctx); + /* Allow initial connection to servers that don't support RI */ # define SSL_OP_LEGACY_SERVER_CONNECT 0x00000004U -/* Removed from OpenSSL 0.9.8q and 1.0.0c */ -/* Dead forever, see CVE-2010-4180. */ -# define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG 0x0U # define SSL_OP_TLSEXT_PADDING 0x00000010U -# define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER 0x0U # define SSL_OP_SAFARI_ECDHE_ECDSA_BUG 0x00000040U -/* Ancient SSLeay version, retained for compatibility */ -# define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0x0 -# define SSL_OP_TLS_D5_BUG 0x0U -/* Removed from OpenSSL 1.1.0 */ -# define SSL_OP_TLS_BLOCK_PADDING_BUG 0x0U - -/* Hasn't done anything since OpenSSL 0.9.7h, retained for compatibility */ -# define SSL_OP_MSIE_SSLV2_RSA_PADDING 0x0 -/* Refers to ancient SSLREF and SSLv2, retained for compatibility */ -# define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG 0x0 -/* Related to removed SSLv2 */ -# define SSL_OP_MICROSOFT_SESS_ID_BUG 0x0 -# define SSL_OP_NETSCAPE_CHALLENGE_BUG 0x0 /* * Disable SSL 3.0/TLS 1.0 CBC vulnerability workaround that was added in * OpenSSL 0.9.6d. Usually (depending on the application protocol) the * workaround is not needed. Unfortunately some broken SSL/TLS * implementations cannot handle it at all, which is why we include it in - * SSL_OP_ALL. + * SSL_OP_ALL. Added in 0.9.6e */ -/* added in 0.9.6e */ # define SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS 0x00000800U -/* - * SSL_OP_ALL: various bug workarounds that should be rather harmless. This - * used to be 0x000FFFFFL before 0.9.7. - */ -# define SSL_OP_ALL 0x80000BFFU - /* DTLS options */ -# define SSL_OP_NO_QUERY_MTU 0x00001000U +# define SSL_OP_NO_QUERY_MTU 0x00001000U /* Turn on Cookie Exchange (on relevant for servers) */ -# define SSL_OP_COOKIE_EXCHANGE 0x00002000U +# define SSL_OP_COOKIE_EXCHANGE 0x00002000U /* Don't use RFC4507 ticket extension */ -# define SSL_OP_NO_TICKET 0x00004000U +# define SSL_OP_NO_TICKET 0x00004000U # ifndef OPENSSL_NO_DTLS1_METHOD /* Use Cisco's "speshul" version of DTLS_BAD_VER * (only with deprecated DTLSv1_client_method()) */ -# define SSL_OP_CISCO_ANYCONNECT 0x00008000U +# define SSL_OP_CISCO_ANYCONNECT 0x00008000U # endif /* As server, disallow session resumption on renegotiation */ @@ -318,12 +297,8 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, # define SSL_OP_NO_COMPRESSION 0x00020000U /* Permit unsafe legacy renegotiation */ # define SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION 0x00040000U -/* Does nothing: retained for compatibility */ -# define SSL_OP_SINGLE_ECDH_USE 0x0 -/* Does nothing: retained for compatibility */ -# define SSL_OP_SINGLE_DH_USE 0x0 -/* Does nothing: retained for compatibility */ -# define SSL_OP_EPHEMERAL_RSA 0x0 +/* Disable encrypt-then-mac */ +# define SSL_OP_NO_ENCRYPT_THEN_MAC 0x00080000U /* * Set on servers to choose the cipher according to the server's preferences */ @@ -336,7 +311,6 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, */ # define SSL_OP_TLS_ROLLBACK_BUG 0x00800000U -# define SSL_OP_NO_SSLv2 0x00000000U # define SSL_OP_NO_SSLv3 0x02000000U # define SSL_OP_NO_TLSv1 0x04000000U # define SSL_OP_NO_TLSv1_2 0x08000000U @@ -349,12 +323,9 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, SSL_OP_NO_TLSv1|SSL_OP_NO_TLSv1_1|SSL_OP_NO_TLSv1_2) # define SSL_OP_NO_DTLS_MASK (SSL_OP_NO_DTLSv1|SSL_OP_NO_DTLSv1_2) +/* Disallow all renegotiation */ +# define SSL_OP_NO_RENEGOTIATION 0x40000000U -/* Removed from previous versions */ -# define SSL_OP_PKCS1_CHECK_1 0x0 -# define SSL_OP_PKCS1_CHECK_2 0x0 -# define SSL_OP_NETSCAPE_CA_DN_BUG 0x0 -# define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x0U /* * Make server add server-hello extension from early version of cryptopro * draft, when GOST ciphersuite is negotiated. Required for interoperability @@ -362,6 +333,59 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, */ # define SSL_OP_CRYPTOPRO_TLSEXT_BUG 0x80000000U +/* + * SSL_OP_ALL: various bug workarounds that should be rather harmless. + * This used to be 0x000FFFFFL before 0.9.7. + * This used to be 0x80000BFFU before 1.1.1. + */ +# define SSL_OP_ALL (SSL_OP_CRYPTOPRO_TLSEXT_BUG|\ + SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS|\ + SSL_OP_LEGACY_SERVER_CONNECT|\ + SSL_OP_TLSEXT_PADDING|\ + SSL_OP_SAFARI_ECDHE_ECDSA_BUG) + +/* OBSOLETE OPTIONS: retained for compatibility */ + +/* Removed from OpenSSL 1.1.0. Was 0x00000001L */ +/* Related to removed SSLv2. */ +# define SSL_OP_MICROSOFT_SESS_ID_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000002L */ +/* Related to removed SSLv2. */ +# define SSL_OP_NETSCAPE_CHALLENGE_BUG 0x0 +/* Removed from OpenSSL 0.9.8q and 1.0.0c. Was 0x00000008L */ +/* Dead forever, see CVE-2010-4180 */ +# define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG 0x0 +/* Removed from OpenSSL 1.0.1h and 1.0.2. Was 0x00000010L */ +/* Refers to ancient SSLREF and SSLv2. */ +# define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000020 */ +# define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER 0x0 +/* Removed from OpenSSL 0.9.7h and 0.9.8b. Was 0x00000040L */ +# define SSL_OP_MSIE_SSLV2_RSA_PADDING 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000080 */ +/* Ancient SSLeay version. */ +# define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000100L */ +# define SSL_OP_TLS_D5_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000200L */ +# define SSL_OP_TLS_BLOCK_PADDING_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00080000L */ +# define SSL_OP_SINGLE_ECDH_USE 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00100000L */ +# define SSL_OP_SINGLE_DH_USE 0x0 +/* Removed from OpenSSL 1.0.1k and 1.0.2. Was 0x00200000L */ +# define SSL_OP_EPHEMERAL_RSA 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x01000000L */ +# define SSL_OP_NO_SSLv2 0x0 +/* Removed from OpenSSL 1.0.1. Was 0x08000000L */ +# define SSL_OP_PKCS1_CHECK_1 0x0 +/* Removed from OpenSSL 1.0.1. Was 0x10000000L */ +# define SSL_OP_PKCS1_CHECK_2 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x20000000L */ +# define SSL_OP_NETSCAPE_CA_DN_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x40000000L */ +# define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x0 + /* * Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success * when just a single record has been written): @@ -943,8 +967,8 @@ size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count); # define SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02 # define SSL_VERIFY_CLIENT_ONCE 0x04 -# define OpenSSL_add_ssl_algorithms() SSL_library_init() # if OPENSSL_API_COMPAT < 0x10100000L +# define OpenSSL_add_ssl_algorithms() SSL_library_init() # define SSLeay_add_ssl_algorithms() SSL_library_init() # endif @@ -1139,6 +1163,8 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) # define SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE 127 # define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB 128 # define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG 129 +# define SSL_CTRL_GET_MIN_PROTO_VERSION 130 +# define SSL_CTRL_GET_MAX_PROTO_VERSION 131 # define SSL_CERT_SET_FIRST 1 # define SSL_CERT_SET_NEXT 2 # define SSL_CERT_SET_SERVER 3 @@ -1241,7 +1267,7 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) # define SSL_CTX_set1_sigalgs_list(ctx, s) \ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)s) # define SSL_set1_sigalgs(ctx, slist, slistlen) \ - SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS,clistlen,(int *)slist) + SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS,slistlen,(int *)slist) # define SSL_set1_sigalgs_list(ctx, s) \ SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)s) # define SSL_CTX_set1_client_sigalgs(ctx, slist, slistlen) \ @@ -1270,10 +1296,18 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MIN_PROTO_VERSION, version, NULL) #define SSL_CTX_set_max_proto_version(ctx, version) \ SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MAX_PROTO_VERSION, version, NULL) +#define SSL_CTX_get_min_proto_version(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MIN_PROTO_VERSION, 0, NULL) +#define SSL_CTX_get_max_proto_version(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MAX_PROTO_VERSION, 0, NULL) #define SSL_set_min_proto_version(s, version) \ SSL_ctrl(s, SSL_CTRL_SET_MIN_PROTO_VERSION, version, NULL) #define SSL_set_max_proto_version(s, version) \ SSL_ctrl(s, SSL_CTRL_SET_MAX_PROTO_VERSION, version, NULL) +#define SSL_get_min_proto_version(s) \ + SSL_ctrl(s, SSL_CTRL_GET_MIN_PROTO_VERSION, 0, NULL) +#define SSL_get_max_proto_version(s) \ + SSL_ctrl(s, SSL_CTRL_GET_MAX_PROTO_VERSION, 0, NULL) #if OPENSSL_API_COMPAT < 0x10100000L /* Provide some compatibility macros for removed functionality. */ @@ -1324,7 +1358,7 @@ __owur int SSL_get_fd(const SSL *s); __owur int SSL_get_rfd(const SSL *s); __owur int SSL_get_wfd(const SSL *s); __owur const char *SSL_get_cipher_list(const SSL *s, int n); -__owur char *SSL_get_shared_ciphers(const SSL *s, char *buf, int len); +__owur char *SSL_get_shared_ciphers(const SSL *s, char *buf, int size); __owur int SSL_get_read_ahead(const SSL *s); __owur int SSL_pending(const SSL *s); __owur int SSL_has_pending(const SSL *s); @@ -1342,9 +1376,8 @@ __owur int SSL_set_cipher_list(SSL *s, const char *str); void SSL_set_read_ahead(SSL *s, int yes); __owur int SSL_get_verify_mode(const SSL *s); __owur int SSL_get_verify_depth(const SSL *s); -__owur int (*SSL_get_verify_callback(const SSL *s)) (int, X509_STORE_CTX *); -void SSL_set_verify(SSL *s, int mode, - int (*callback) (int ok, X509_STORE_CTX *ctx)); +__owur SSL_verify_cb SSL_get_verify_callback(const SSL *s); +void SSL_set_verify(SSL *s, int mode, SSL_verify_cb callback); void SSL_set_verify_depth(SSL *s, int depth); void SSL_set_cert_cb(SSL *s, int (*cb) (SSL *ssl, void *arg), void *arg); # ifndef OPENSSL_NO_RSA @@ -1426,7 +1459,7 @@ int SSL_SESSION_up_ref(SSL_SESSION *ses); void SSL_SESSION_free(SSL_SESSION *ses); __owur int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp); __owur int SSL_set_session(SSL *to, SSL_SESSION *session); -__owur int SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c); +int SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c); int SSL_CTX_remove_session(SSL_CTX *, SSL_SESSION *c); __owur int SSL_CTX_set_generate_session_id(SSL_CTX *, GEN_SESSION_CB); __owur int SSL_set_generate_session_id(SSL *, GEN_SESSION_CB); @@ -1443,10 +1476,8 @@ __owur STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *s); __owur int SSL_CTX_get_verify_mode(const SSL_CTX *ctx); __owur int SSL_CTX_get_verify_depth(const SSL_CTX *ctx); -__owur int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx)) (int, - X509_STORE_CTX *); -void SSL_CTX_set_verify(SSL_CTX *ctx, int mode, - int (*callback) (int, X509_STORE_CTX *)); +__owur SSL_verify_cb SSL_CTX_get_verify_callback(const SSL_CTX *ctx); +void SSL_CTX_set_verify(SSL_CTX *ctx, int mode, SSL_verify_cb callback); void SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth); void SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx, int (*cb) (X509_STORE_CTX *, void *), @@ -1501,7 +1532,7 @@ __owur int SSL_CTX_dane_mtype_set(SSL_CTX *ctx, const EVP_MD *md, uint8_t mtype, uint8_t ord); __owur int SSL_dane_enable(SSL *s, const char *basedomain); __owur int SSL_dane_tlsa_add(SSL *s, uint8_t usage, uint8_t selector, - uint8_t mtype, unsigned char *data, size_t dlen); + uint8_t mtype, unsigned const char *data, size_t dlen); __owur int SSL_get0_dane_authority(SSL *s, X509 **mcert, EVP_PKEY **mspki); __owur int SSL_get0_dane_tlsa(SSL *s, uint8_t *usage, uint8_t *selector, uint8_t *mtype, unsigned const char **data, @@ -1777,6 +1808,8 @@ void SSL_set_tmp_dh_callback(SSL *ssl, __owur const COMP_METHOD *SSL_get_current_compression(SSL *s); __owur const COMP_METHOD *SSL_get_current_expansion(SSL *s); __owur const char *SSL_COMP_get_name(const COMP_METHOD *comp); +__owur const char *SSL_COMP_get0_name(const SSL_COMP *comp); +__owur int SSL_COMP_get_id(const SSL_COMP *comp); STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void); __owur STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP) *meths); @@ -1814,7 +1847,7 @@ void SSL_set_not_resumable_session_callback(SSL *ssl, # endif __owur int SSL_session_reused(SSL *s); -__owur int SSL_is_server(SSL *s); +__owur int SSL_is_server(const SSL *s); __owur __owur SSL_CONF_CTX *SSL_CONF_CTX_new(void); int SSL_CONF_CTX_finish(SSL_CONF_CTX *cctx); @@ -2077,6 +2110,7 @@ int ERR_load_SSL_strings(void); # define SSL_F_DTLS_CONSTRUCT_HELLO_VERIFY_REQUEST 385 # define SSL_F_DTLS_GET_REASSEMBLED_MESSAGE 370 # define SSL_F_DTLS_PROCESS_HELLO_VERIFY 386 +# define SSL_F_DTLS_WAIT_FOR_DRY 592 # define SSL_F_OPENSSL_INIT_SSL 342 # define SSL_F_OSSL_STATEM_CLIENT_READ_TRANSITION 417 # define SSL_F_OSSL_STATEM_SERVER_READ_TRANSITION 418 @@ -2098,6 +2132,7 @@ int ERR_load_SSL_strings(void); # define SSL_F_SSL3_SETUP_KEY_BLOCK 157 # define SSL_F_SSL3_SETUP_READ_BUFFER 156 # define SSL_F_SSL3_SETUP_WRITE_BUFFER 291 +# define SSL_F_SSL3_TAKE_MAC 425 # define SSL_F_SSL3_WRITE_BYTES 158 # define SSL_F_SSL3_WRITE_PENDING 159 # define SSL_F_SSL_ADD_CERT_CHAIN 316 @@ -2171,6 +2206,8 @@ int ERR_load_SSL_strings(void); # define SSL_F_SSL_PARSE_SERVERHELLO_USE_SRTP_EXT 311 # define SSL_F_SSL_PEEK 270 # define SSL_F_SSL_READ 223 +# define SSL_F_SSL_RENEGOTIATE 516 +# define SSL_F_SSL_RENEGOTIATE_ABBREVIATED 546 # define SSL_F_SSL_SCAN_CLIENTHELLO_TLSEXT 320 # define SSL_F_SSL_SCAN_SERVERHELLO_TLSEXT 321 # define SSL_F_SSL_SESSION_DUP 348 @@ -2344,6 +2381,7 @@ int ERR_load_SSL_strings(void); # define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 150 # define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 151 # define SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN 204 +# define SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE 194 # define SSL_R_EXCESSIVE_MESSAGE_SIZE 152 # define SSL_R_EXTRA_DATA_IN_MESSAGE 153 # define SSL_R_FAILED_TO_INIT_ASYNC 405 diff --git a/external/openssl/include/mac/openssl/ssl3.h b/external/openssl/include/mac/openssl/ssl3.h index aca19223..115940ad 100644 --- a/external/openssl/include/mac/openssl/ssl3.h +++ b/external/openssl/include/mac/openssl/ssl3.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -252,9 +252,15 @@ extern "C" { # define SSL3_CT_FORTEZZA_DMS 20 /* * SSL3_CT_NUMBER is used to size arrays and it must be large enough to - * contain all of the cert types defined either for SSLv3 and TLSv1. + * contain all of the cert types defined for *either* SSLv3 and TLSv1. */ -# define SSL3_CT_NUMBER 9 +# define SSL3_CT_NUMBER 10 + +# if defined(TLS_CT_NUMBER) +# if TLS_CT_NUMBER != SSL3_CT_NUMBER +# error "SSL/TLS CT_NUMBER values do not match" +# endif +# endif # define SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS 0x0001 @@ -264,11 +270,14 @@ extern "C" { # define TLS1_FLAGS_SKIP_CERT_VERIFY 0x0010 /* Set if we encrypt then mac instead of usual mac then encrypt */ -# define TLS1_FLAGS_ENCRYPT_THEN_MAC 0x0100 +# define TLS1_FLAGS_ENCRYPT_THEN_MAC_READ 0x0100 +# define TLS1_FLAGS_ENCRYPT_THEN_MAC TLS1_FLAGS_ENCRYPT_THEN_MAC_READ /* Set if extended master secret extension received from peer */ # define TLS1_FLAGS_RECEIVED_EXTMS 0x0200 +# define TLS1_FLAGS_ENCRYPT_THEN_MAC_WRITE 0x0400 + # define SSL3_MT_HELLO_REQUEST 0 # define SSL3_MT_CLIENT_HELLO 1 # define SSL3_MT_SERVER_HELLO 2 diff --git a/external/openssl/include/mac/openssl/symhacks.h b/external/openssl/include/mac/openssl/symhacks.h index caf1f1a7..156ea6e4 100644 --- a/external/openssl/include/mac/openssl/symhacks.h +++ b/external/openssl/include/mac/openssl/symhacks.h @@ -1,5 +1,5 @@ /* - * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -28,21 +28,6 @@ # undef i2d_ECPKPARAMETERS # define i2d_ECPKPARAMETERS i2d_UC_ECPKPARAMETERS -/* - * These functions do not seem to exist! However, I'm paranoid... Original - * command in x509v3.h: These functions are being redefined in another - * directory, and clash when the linker is case-insensitive, so let's hide - * them a little, by giving them an extra 'o' at the beginning of the name... - */ -# undef X509v3_cleanup_extensions -# define X509v3_cleanup_extensions oX509v3_cleanup_extensions -# undef X509v3_add_extension -# define X509v3_add_extension oX509v3_add_extension -# undef X509v3_add_netscape_extensions -# define X509v3_add_netscape_extensions oX509v3_add_netscape_extensions -# undef X509v3_add_standard_extensions -# define X509v3_add_standard_extensions oX509v3_add_standard_extensions - /* This one clashes with CMS_data_create */ # undef cms_Data_create # define cms_Data_create priv_cms_Data_create diff --git a/external/openssl/include/mac/openssl/tls1.h b/external/openssl/include/mac/openssl/tls1.h index 23e382cd..732e87ab 100644 --- a/external/openssl/include/mac/openssl/tls1.h +++ b/external/openssl/include/mac/openssl/tls1.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -226,12 +226,12 @@ __owur int SSL_get_servername_type(const SSL *s); * as specified in RFC 5705. It writes |olen| bytes to |out| given a label and * optional context. (Since a zero length context is allowed, the |use_context| * flag controls whether a context is included.) It returns 1 on success and - * zero otherwise. + * 0 or -1 otherwise. */ __owur int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen, - const char *label, size_t llen, - const unsigned char *p, size_t plen, - int use_context); + const char *label, size_t llen, + const unsigned char *context, + size_t contextlen, int use_context); int SSL_get_sigalgs(SSL *s, int idx, int *psign, int *phash, int *psignandhash, @@ -298,9 +298,9 @@ SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB,0, (void (**)(void))cb) SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,(void (*)(void))cb) # define SSL_CTX_get_tlsext_status_arg(ssl, arg) \ -SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg + SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg) # define SSL_CTX_set_tlsext_status_arg(ssl, arg) \ -SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg) + SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg) #define SSL_CTX_set_tlsext_status_type(ssl, type) \ SSL_CTX_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE, type, NULL) @@ -883,7 +883,13 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) * when correcting this number, correct also SSL3_CT_NUMBER in ssl3.h (see * comment there) */ -# define TLS_CT_NUMBER 9 +# define TLS_CT_NUMBER 10 + +# if defined(SSL3_CT_NUMBER) +# if TLS_CT_NUMBER != SSL3_CT_NUMBER +# error "SSL/TLS CT_NUMBER values do not match" +# endif +# endif # define TLS1_FINISH_MAC_LENGTH 12 diff --git a/external/openssl/include/mac/openssl/ui.h b/external/openssl/include/mac/openssl/ui.h index 26f4f044..49e763de 100644 --- a/external/openssl/include/mac/openssl/ui.h +++ b/external/openssl/include/mac/openssl/ui.h @@ -339,8 +339,12 @@ int ERR_load_UI_strings(void); /* Error codes for the UI functions. */ /* Function codes. */ +# define UI_F_CLOSE_CONSOLE 115 +# define UI_F_ECHO_CONSOLE 116 # define UI_F_GENERAL_ALLOCATE_BOOLEAN 108 # define UI_F_GENERAL_ALLOCATE_PROMPT 109 +# define UI_F_NOECHO_CONSOLE 117 +# define UI_F_OPEN_CONSOLE 114 # define UI_F_UI_CREATE_METHOD 112 # define UI_F_UI_CTRL 111 # define UI_F_UI_DUP_ERROR_STRING 101 @@ -350,6 +354,7 @@ int ERR_load_UI_strings(void); # define UI_F_UI_DUP_VERIFY_STRING 106 # define UI_F_UI_GET0_RESULT 107 # define UI_F_UI_NEW_METHOD 104 +# define UI_F_UI_PROCESS 113 # define UI_F_UI_SET_RESULT 105 /* Reason codes. */ @@ -357,9 +362,14 @@ int ERR_load_UI_strings(void); # define UI_R_INDEX_TOO_LARGE 102 # define UI_R_INDEX_TOO_SMALL 103 # define UI_R_NO_RESULT_BUFFER 105 +# define UI_R_PROCESSING_ERROR 107 # define UI_R_RESULT_TOO_LARGE 100 # define UI_R_RESULT_TOO_SMALL 101 +# define UI_R_SYSASSIGN_ERROR 109 +# define UI_R_SYSDASSGN_ERROR 110 +# define UI_R_SYSQIOW_ERROR 111 # define UI_R_UNKNOWN_CONTROL_COMMAND 106 +# define UI_R_UNKNOWN_TTYGET_ERRNO_VALUE 108 # ifdef __cplusplus } diff --git a/external/openssl/include/mac/openssl/x509.h b/external/openssl/include/mac/openssl/x509.h index c8996f35..916afaf7 100644 --- a/external/openssl/include/mac/openssl/x509.h +++ b/external/openssl/include/mac/openssl/x509.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -641,7 +641,7 @@ int X509_get_signature_type(const X509 *x); /* * This one is only used so that a binary form can output, as in - * i2d_X509_NAME(X509_get_X509_PUBKEY(x),&buf) + * i2d_X509_NAME(X509_get_X509_PUBKEY(x), &buf) */ X509_PUBKEY *X509_get_X509_PUBKEY(const X509 *x); const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x); @@ -1055,6 +1055,7 @@ int ERR_load_X509_strings(void); # define X509_F_X509_LOAD_CERT_CRL_FILE 132 # define X509_F_X509_LOAD_CERT_FILE 111 # define X509_F_X509_LOAD_CRL_FILE 112 +# define X509_F_X509_LOOKUP_METH_NEW 160 # define X509_F_X509_NAME_ADD_ENTRY 113 # define X509_F_X509_NAME_ENTRY_CREATE_BY_NID 114 # define X509_F_X509_NAME_ENTRY_CREATE_BY_TXT 131 @@ -1091,6 +1092,7 @@ int ERR_load_X509_strings(void); # define X509_R_CRL_ALREADY_DELTA 127 # define X509_R_CRL_VERIFY_FAILURE 131 # define X509_R_IDP_MISMATCH 128 +# define X509_R_INVALID_ATTRIBUTES 135 # define X509_R_INVALID_DIRECTORY 113 # define X509_R_INVALID_FIELD_NAME 119 # define X509_R_INVALID_TRUST 123 diff --git a/external/openssl/include/mac/openssl/x509_vfy.h b/external/openssl/include/mac/openssl/x509_vfy.h index cab8005e..131b6cf7 100644 --- a/external/openssl/include/mac/openssl/x509_vfy.h +++ b/external/openssl/include/mac/openssl/x509_vfy.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -257,7 +257,9 @@ X509_OBJECT *X509_OBJECT_new(void); void X509_OBJECT_free(X509_OBJECT *a); X509_LOOKUP_TYPE X509_OBJECT_get_type(const X509_OBJECT *a); X509 *X509_OBJECT_get0_X509(const X509_OBJECT *a); +int X509_OBJECT_set1_X509(X509_OBJECT *a, X509 *obj); X509_CRL *X509_OBJECT_get0_X509_CRL(X509_OBJECT *a); +int X509_OBJECT_set1_X509_CRL(X509_OBJECT *a, X509_CRL *obj); X509_STORE *X509_STORE_new(void); void X509_STORE_free(X509_STORE *v); int X509_STORE_lock(X509_STORE *ctx); @@ -364,6 +366,76 @@ X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m); X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void); X509_LOOKUP_METHOD *X509_LOOKUP_file(void); +typedef int (*X509_LOOKUP_ctrl_fn)(X509_LOOKUP *ctx, int cmd, const char *argc, + long argl, char **ret); +typedef int (*X509_LOOKUP_get_by_subject_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + X509_NAME *name, + X509_OBJECT *ret); +typedef int (*X509_LOOKUP_get_by_issuer_serial_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + X509_NAME *name, + ASN1_INTEGER *serial, + X509_OBJECT *ret); +typedef int (*X509_LOOKUP_get_by_fingerprint_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + const unsigned char* bytes, + int len, + X509_OBJECT *ret); +typedef int (*X509_LOOKUP_get_by_alias_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + const char *str, + int len, + X509_OBJECT *ret); + +X509_LOOKUP_METHOD *X509_LOOKUP_meth_new(const char *name); +void X509_LOOKUP_meth_free(X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_new_item(X509_LOOKUP_METHOD *method, + int (*new_item) (X509_LOOKUP *ctx)); +int (*X509_LOOKUP_meth_get_new_item(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_free(X509_LOOKUP_METHOD *method, + void (*free_fn) (X509_LOOKUP *ctx)); +void (*X509_LOOKUP_meth_get_free(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_init(X509_LOOKUP_METHOD *method, + int (*init) (X509_LOOKUP *ctx)); +int (*X509_LOOKUP_meth_get_init(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_shutdown(X509_LOOKUP_METHOD *method, + int (*shutdown) (X509_LOOKUP *ctx)); +int (*X509_LOOKUP_meth_get_shutdown(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_ctrl(X509_LOOKUP_METHOD *method, + X509_LOOKUP_ctrl_fn ctrl_fn); +X509_LOOKUP_ctrl_fn X509_LOOKUP_meth_get_ctrl(const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_subject(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_subject_fn fn); +X509_LOOKUP_get_by_subject_fn X509_LOOKUP_meth_get_get_by_subject( + const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_issuer_serial(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_issuer_serial_fn fn); +X509_LOOKUP_get_by_issuer_serial_fn X509_LOOKUP_meth_get_get_by_issuer_serial( + const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_fingerprint(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_fingerprint_fn fn); +X509_LOOKUP_get_by_fingerprint_fn X509_LOOKUP_meth_get_get_by_fingerprint( + const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_alias(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_alias_fn fn); +X509_LOOKUP_get_by_alias_fn X509_LOOKUP_meth_get_get_by_alias( + const X509_LOOKUP_METHOD *method); + + int X509_STORE_add_cert(X509_STORE *ctx, X509 *x); int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x); @@ -393,6 +465,9 @@ int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, X509_OBJECT *ret); int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, const char *str, int len, X509_OBJECT *ret); +int X509_LOOKUP_set_method_data(X509_LOOKUP *ctx, void *data); +void *X509_LOOKUP_get_method_data(const X509_LOOKUP *ctx); +X509_STORE *X509_LOOKUP_get_store(const X509_LOOKUP *ctx); int X509_LOOKUP_shutdown(X509_LOOKUP *ctx); int X509_STORE_load_locations(X509_STORE *ctx, @@ -458,18 +533,24 @@ int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose); int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust); void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth); void X509_VERIFY_PARAM_set_auth_level(X509_VERIFY_PARAM *param, int auth_level); +time_t X509_VERIFY_PARAM_get_time(const X509_VERIFY_PARAM *param); void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t); int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param, ASN1_OBJECT *policy); int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param, STACK_OF(ASN1_OBJECT) *policies); +int X509_VERIFY_PARAM_set_inh_flags(X509_VERIFY_PARAM *param, + uint32_t flags); +uint32_t X509_VERIFY_PARAM_get_inh_flags(const X509_VERIFY_PARAM *param); + int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param, const char *name, size_t namelen); int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param, const char *name, size_t namelen); void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param, unsigned int flags); +unsigned int X509_VERIFY_PARAM_get_hostflags(const X509_VERIFY_PARAM *param); char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *); void X509_VERIFY_PARAM_move_peername(X509_VERIFY_PARAM *, X509_VERIFY_PARAM *); int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param, diff --git a/external/openssl/include/mac/openssl/x509v3.h b/external/openssl/include/mac/openssl/x509v3.h index f21ce7c1..c93b112f 100644 --- a/external/openssl/include/mac/openssl/x509v3.h +++ b/external/openssl/include/mac/openssl/x509v3.h @@ -1,5 +1,5 @@ /* - * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -355,6 +355,7 @@ struct ISSUING_DIST_POINT_st { # define EXFLAG_SI 0x20 # define EXFLAG_V1 0x40 # define EXFLAG_INVALID 0x80 +/* EXFLAG_SET is set to indicate that some values have been precomputed */ # define EXFLAG_SET 0x100 # define EXFLAG_CRITICAL 0x200 # define EXFLAG_PROXY 0x400 @@ -657,6 +658,7 @@ uint32_t X509_get_extension_flags(X509 *x); uint32_t X509_get_key_usage(X509 *x); uint32_t X509_get_extended_key_usage(X509 *x); const ASN1_OCTET_STRING *X509_get0_subject_key_id(X509 *x); +const ASN1_OCTET_STRING *X509_get0_authority_key_id(X509 *x); int X509_PURPOSE_get_count(void); X509_PURPOSE *X509_PURPOSE_get0(int idx); @@ -875,6 +877,7 @@ int ERR_load_X509V3_strings(void); # define X509V3_F_ADDR_VALIDATE_PATH_INTERNAL 166 # define X509V3_F_ASIDENTIFIERCHOICE_CANONIZE 161 # define X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL 162 +# define X509V3_F_BIGNUM_TO_STRING 167 # define X509V3_F_COPY_EMAIL 122 # define X509V3_F_COPY_ISSUER 123 # define X509V3_F_DO_DIRNAME 144 diff --git a/external/openssl/include/win32/openssl/__DECC_INCLUDE_EPILOGUE.H b/external/openssl/include/win32/openssl/__DECC_INCLUDE_EPILOGUE.H deleted file mode 100644 index c350018a..00000000 --- a/external/openssl/include/win32/openssl/__DECC_INCLUDE_EPILOGUE.H +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -/* - * This file is only used by HP C on VMS, and is included automatically - * after each header file from this directory - */ - -/* restore state. Must correspond to the save in __decc_include_prologue.h */ -#pragma names restore diff --git a/external/openssl/include/win32/openssl/__DECC_INCLUDE_PROLOGUE.H b/external/openssl/include/win32/openssl/__DECC_INCLUDE_PROLOGUE.H deleted file mode 100644 index 9a9c777f..00000000 --- a/external/openssl/include/win32/openssl/__DECC_INCLUDE_PROLOGUE.H +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -/* - * This file is only used by HP C on VMS, and is included automatically - * after each header file from this directory - */ - -/* save state */ -#pragma names save -/* have the compiler shorten symbols larger than 31 chars to 23 chars - * followed by a 8 hex char CRC - */ -#pragma names as_is,shortened diff --git a/external/openssl/include/win32/openssl/applink.c b/external/openssl/include/win32/openssl/applink.c deleted file mode 100644 index 238dbff3..00000000 --- a/external/openssl/include/win32/openssl/applink.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright 2004-2016 The OpenSSL Project Authors. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - */ - -#define APPLINK_STDIN 1 -#define APPLINK_STDOUT 2 -#define APPLINK_STDERR 3 -#define APPLINK_FPRINTF 4 -#define APPLINK_FGETS 5 -#define APPLINK_FREAD 6 -#define APPLINK_FWRITE 7 -#define APPLINK_FSETMOD 8 -#define APPLINK_FEOF 9 -#define APPLINK_FCLOSE 10 /* should not be used */ - -#define APPLINK_FOPEN 11 /* solely for completeness */ -#define APPLINK_FSEEK 12 -#define APPLINK_FTELL 13 -#define APPLINK_FFLUSH 14 -#define APPLINK_FERROR 15 -#define APPLINK_CLEARERR 16 -#define APPLINK_FILENO 17 /* to be used with below */ - -#define APPLINK_OPEN 18 /* formally can't be used, as flags can vary */ -#define APPLINK_READ 19 -#define APPLINK_WRITE 20 -#define APPLINK_LSEEK 21 -#define APPLINK_CLOSE 22 -#define APPLINK_MAX 22 /* always same as last macro */ - -#ifndef APPMACROS_ONLY -# include -# include -# include - -static void *app_stdin(void) -{ - return stdin; -} - -static void *app_stdout(void) -{ - return stdout; -} - -static void *app_stderr(void) -{ - return stderr; -} - -static int app_feof(FILE *fp) -{ - return feof(fp); -} - -static int app_ferror(FILE *fp) -{ - return ferror(fp); -} - -static void app_clearerr(FILE *fp) -{ - clearerr(fp); -} - -static int app_fileno(FILE *fp) -{ - return _fileno(fp); -} - -static int app_fsetmod(FILE *fp, char mod) -{ - return _setmode(_fileno(fp), mod == 'b' ? _O_BINARY : _O_TEXT); -} - -#ifdef __cplusplus -extern "C" { -#endif - -__declspec(dllexport) -void ** -# if defined(__BORLANDC__) -/* - * __stdcall appears to be the only way to get the name - * decoration right with Borland C. Otherwise it works - * purely incidentally, as we pass no parameters. - */ -__stdcall -# else -__cdecl -# endif -OPENSSL_Applink(void) -{ - static int once = 1; - static void *OPENSSL_ApplinkTable[APPLINK_MAX + 1] = - { (void *)APPLINK_MAX }; - - if (once) { - OPENSSL_ApplinkTable[APPLINK_STDIN] = app_stdin; - OPENSSL_ApplinkTable[APPLINK_STDOUT] = app_stdout; - OPENSSL_ApplinkTable[APPLINK_STDERR] = app_stderr; - OPENSSL_ApplinkTable[APPLINK_FPRINTF] = fprintf; - OPENSSL_ApplinkTable[APPLINK_FGETS] = fgets; - OPENSSL_ApplinkTable[APPLINK_FREAD] = fread; - OPENSSL_ApplinkTable[APPLINK_FWRITE] = fwrite; - OPENSSL_ApplinkTable[APPLINK_FSETMOD] = app_fsetmod; - OPENSSL_ApplinkTable[APPLINK_FEOF] = app_feof; - OPENSSL_ApplinkTable[APPLINK_FCLOSE] = fclose; - - OPENSSL_ApplinkTable[APPLINK_FOPEN] = fopen; - OPENSSL_ApplinkTable[APPLINK_FSEEK] = fseek; - OPENSSL_ApplinkTable[APPLINK_FTELL] = ftell; - OPENSSL_ApplinkTable[APPLINK_FFLUSH] = fflush; - OPENSSL_ApplinkTable[APPLINK_FERROR] = app_ferror; - OPENSSL_ApplinkTable[APPLINK_CLEARERR] = app_clearerr; - OPENSSL_ApplinkTable[APPLINK_FILENO] = app_fileno; - - OPENSSL_ApplinkTable[APPLINK_OPEN] = _open; - OPENSSL_ApplinkTable[APPLINK_READ] = _read; - OPENSSL_ApplinkTable[APPLINK_WRITE] = _write; - OPENSSL_ApplinkTable[APPLINK_LSEEK] = _lseek; - OPENSSL_ApplinkTable[APPLINK_CLOSE] = _close; - - once = 0; - } - - return OPENSSL_ApplinkTable; -} - -#ifdef __cplusplus -} -#endif -#endif diff --git a/external/openssl/include/win32/openssl/asn1.h b/external/openssl/include/win32/openssl/asn1.h index 7cf61161..d0b1099a 100644 --- a/external/openssl/include/win32/openssl/asn1.h +++ b/external/openssl/include/win32/openssl/asn1.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -625,8 +625,8 @@ ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t); ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, int offset_day, long offset_sec); int ASN1_TIME_check(const ASN1_TIME *t); -ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME - **out); +ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *t, + ASN1_GENERALIZEDTIME **out); int ASN1_TIME_set_string(ASN1_TIME *s, const char *str); int i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a); @@ -946,14 +946,17 @@ int ERR_load_ASN1_strings(void); # define ASN1_F_C2I_ASN1_INTEGER 194 # define ASN1_F_C2I_ASN1_OBJECT 196 # define ASN1_F_C2I_IBUF 226 +# define ASN1_F_C2I_UINT64_INT 101 # define ASN1_F_COLLECT_DATA 140 # define ASN1_F_D2I_ASN1_OBJECT 147 # define ASN1_F_D2I_ASN1_UINTEGER 150 # define ASN1_F_D2I_AUTOPRIVATEKEY 207 # define ASN1_F_D2I_PRIVATEKEY 154 # define ASN1_F_D2I_PUBLICKEY 155 +# define ASN1_F_DO_BUF 142 # define ASN1_F_DO_TCREATE 222 # define ASN1_F_I2D_ASN1_BIO_STREAM 211 +# define ASN1_F_I2D_ASN1_OBJECT 143 # define ASN1_F_I2D_DSA_PUBKEY 161 # define ASN1_F_I2D_EC_PUBKEY 181 # define ASN1_F_I2D_PRIVATEKEY 163 @@ -971,6 +974,8 @@ int ERR_load_ASN1_strings(void); # define ASN1_F_SMIME_READ_ASN1 212 # define ASN1_F_SMIME_TEXT 213 # define ASN1_F_STBL_MODULE_INIT 223 +# define ASN1_F_UINT32_C2I 105 +# define ASN1_F_UINT64_C2I 112 # define ASN1_F_X509_CRL_ADD0_REVOKED 169 # define ASN1_F_X509_INFO_NEW 170 # define ASN1_F_X509_NAME_ENCODE 203 @@ -1048,6 +1053,7 @@ int ERR_load_ASN1_strings(void); # define ASN1_R_MSTRING_NOT_UNIVERSAL 139 # define ASN1_R_MSTRING_WRONG_TAG 140 # define ASN1_R_NESTED_ASN1_STRING 197 +# define ASN1_R_NESTED_TOO_DEEP 201 # define ASN1_R_NON_HEX_CHARACTERS 141 # define ASN1_R_NOT_ASCII_FORMAT 190 # define ASN1_R_NOT_ENOUGH_DATA 142 diff --git a/external/openssl/include/win32/openssl/asn1t.h b/external/openssl/include/win32/openssl/asn1t.h index 8eedfb3f..a5248293 100644 --- a/external/openssl/include/win32/openssl/asn1t.h +++ b/external/openssl/include/win32/openssl/asn1t.h @@ -346,17 +346,22 @@ extern "C" { /* OPTIONAL simple type */ # define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type) +# define ASN1_OPT_EMBED(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED, 0, stname, field, type) /* IMPLICIT tagged simple type */ # define ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0) +# define ASN1_IMP_EMBED(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_EMBED) /* IMPLICIT tagged OPTIONAL simple type */ # define ASN1_IMP_OPT(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) +# define ASN1_IMP_OPT_EMBED(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED) /* Same as above but EXPLICIT */ # define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0) +# define ASN1_EXP_EMBED(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_EMBED) # define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) +# define ASN1_EXP_OPT_EMBED(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED) /* SEQUENCE OF type */ # define ASN1_SEQUENCE_OF(stname, field, type) \ diff --git a/external/openssl/include/win32/openssl/bio.h b/external/openssl/include/win32/openssl/bio.h index 9bc941b2..3a728625 100644 --- a/external/openssl/include/win32/openssl/bio.h +++ b/external/openssl/include/win32/openssl/bio.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -20,11 +20,7 @@ # include # ifndef OPENSSL_NO_SCTP -# ifndef OPENSSL_SYS_VMS -# include -# else -# include -# endif +# include # endif #ifdef __cplusplus @@ -129,11 +125,10 @@ extern "C" { # define BIO_CTRL_DGRAM_GET_MTU_OVERHEAD 49 -# define BIO_CTRL_DGRAM_SET_PEEK_MODE 50 - +/* Deliberately outside of OPENSSL_NO_SCTP - used in bss_dgram.c */ +# define BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE 50 # ifndef OPENSSL_NO_SCTP /* SCTP stuff */ -# define BIO_CTRL_DGRAM_SCTP_SET_IN_HANDSHAKE 50 # define BIO_CTRL_DGRAM_SCTP_ADD_AUTH_KEY 51 # define BIO_CTRL_DGRAM_SCTP_NEXT_AUTH_KEY 52 # define BIO_CTRL_DGRAM_SCTP_AUTH_CCS_RCVD 53 @@ -146,6 +141,8 @@ extern "C" { # define BIO_CTRL_DGRAM_SCTP_SAVE_SHUTDOWN 70 # endif +# define BIO_CTRL_DGRAM_SET_PEEK_MODE 71 + /* modifiers */ # define BIO_FP_READ 0x02 # define BIO_FP_WRITE 0x04 @@ -170,7 +167,7 @@ extern "C" { /* * This is used with memory BIOs: * BIO_FLAGS_MEM_RDONLY means we shouldn't free up or change the data in any way; - * BIO_FLAGS_NONCLEAR_RST means we should't clear data on reset. + * BIO_FLAGS_NONCLEAR_RST means we shouldn't clear data on reset. */ # define BIO_FLAGS_MEM_RDONLY 0x200 # define BIO_FLAGS_NONCLEAR_RST 0x400 @@ -249,7 +246,8 @@ typedef struct bio_method_st BIO_METHOD; const char *BIO_method_name(const BIO *b); int BIO_method_type(const BIO *b); -typedef void bio_info_cb(BIO *, int, const char *, int, long, long); +typedef int BIO_info_cb(BIO *, int, int); +typedef BIO_info_cb bio_info_cb; /* backward compatibility */ DEFINE_STACK_OF(BIO) @@ -550,8 +548,7 @@ int BIO_write(BIO *b, const void *data, int len); int BIO_puts(BIO *bp, const char *buf); int BIO_indent(BIO *b, int indent, int max); long BIO_ctrl(BIO *bp, int cmd, long larg, void *parg); -long BIO_callback_ctrl(BIO *b, int cmd, - void (*fp) (BIO *, int, const char *, int, long, long)); +long BIO_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp); void *BIO_ptr_ctrl(BIO *bp, int cmd, long larg); long BIO_int_ctrl(BIO *bp, int cmd, long larg, int iarg); BIO *BIO_push(BIO *b, BIO *append); @@ -733,30 +730,30 @@ __bio_h__attr__((__format__(__printf__, 3, 0))); BIO_METHOD *BIO_meth_new(int type, const char *name); void BIO_meth_free(BIO_METHOD *biom); -int (*BIO_meth_get_write(BIO_METHOD *biom)) (BIO *, const char *, int); +int (*BIO_meth_get_write(const BIO_METHOD *biom)) (BIO *, const char *, int); int BIO_meth_set_write(BIO_METHOD *biom, int (*write) (BIO *, const char *, int)); -int (*BIO_meth_get_read(BIO_METHOD *biom)) (BIO *, char *, int); +int (*BIO_meth_get_read(const BIO_METHOD *biom)) (BIO *, char *, int); int BIO_meth_set_read(BIO_METHOD *biom, int (*read) (BIO *, char *, int)); -int (*BIO_meth_get_puts(BIO_METHOD *biom)) (BIO *, const char *); +int (*BIO_meth_get_puts(const BIO_METHOD *biom)) (BIO *, const char *); int BIO_meth_set_puts(BIO_METHOD *biom, int (*puts) (BIO *, const char *)); -int (*BIO_meth_get_gets(BIO_METHOD *biom)) (BIO *, char *, int); +int (*BIO_meth_get_gets(const BIO_METHOD *biom)) (BIO *, char *, int); int BIO_meth_set_gets(BIO_METHOD *biom, int (*gets) (BIO *, char *, int)); -long (*BIO_meth_get_ctrl(BIO_METHOD *biom)) (BIO *, int, long, void *); +long (*BIO_meth_get_ctrl(const BIO_METHOD *biom)) (BIO *, int, long, void *); int BIO_meth_set_ctrl(BIO_METHOD *biom, long (*ctrl) (BIO *, int, long, void *)); -int (*BIO_meth_get_create(BIO_METHOD *bion)) (BIO *); +int (*BIO_meth_get_create(const BIO_METHOD *bion)) (BIO *); int BIO_meth_set_create(BIO_METHOD *biom, int (*create) (BIO *)); -int (*BIO_meth_get_destroy(BIO_METHOD *biom)) (BIO *); +int (*BIO_meth_get_destroy(const BIO_METHOD *biom)) (BIO *); int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy) (BIO *)); -long (*BIO_meth_get_callback_ctrl(BIO_METHOD *biom)) - (BIO *, int, bio_info_cb *); +long (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom)) + (BIO *, int, BIO_info_cb *); int BIO_meth_set_callback_ctrl(BIO_METHOD *biom, long (*callback_ctrl) (BIO *, int, - bio_info_cb *)); + BIO_info_cb *)); /* BEGIN ERROR CODES */ /* @@ -784,6 +781,7 @@ int ERR_load_BIO_strings(void); # define BIO_F_BIO_LISTEN 139 # define BIO_F_BIO_LOOKUP 135 # define BIO_F_BIO_MAKE_PAIR 121 +# define BIO_F_BIO_METH_NEW 146 # define BIO_F_BIO_NEW 108 # define BIO_F_BIO_NEW_FILE 109 # define BIO_F_BIO_NEW_MEM_BUF 126 diff --git a/external/openssl/include/win32/openssl/bn.h b/external/openssl/include/win32/openssl/bn.h index 17bd5213..301edd52 100644 --- a/external/openssl/include/win32/openssl/bn.h +++ b/external/openssl/include/win32/openssl/bn.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -119,25 +119,76 @@ void *BN_GENCB_get_arg(BN_GENCB *cb); * on the size of the number */ /* - * number of Miller-Rabin iterations for an error rate of less than 2^-80 for - * random 'b'-bit input, b >= 100 (taken from table 4.4 in the Handbook of - * Applied Cryptography [Menezes, van Oorschot, Vanstone; CRC Press 1996]; - * original paper: Damgaard, Landrock, Pomerance: Average case error - * estimates for the strong probable prime test. -- Math. Comp. 61 (1993) - * 177-194) + * BN_prime_checks_for_size() returns the number of Miller-Rabin iterations + * that will be done for checking that a random number is probably prime. The + * error rate for accepting a composite number as prime depends on the size of + * the prime |b|. The error rates used are for calculating an RSA key with 2 primes, + * and so the level is what you would expect for a key of double the size of the + * prime. + * + * This table is generated using the algorithm of FIPS PUB 186-4 + * Digital Signature Standard (DSS), section F.1, page 117. + * (https://dx.doi.org/10.6028/NIST.FIPS.186-4) + * + * The following magma script was used to generate the output: + * securitybits:=125; + * k:=1024; + * for t:=1 to 65 do + * for M:=3 to Floor(2*Sqrt(k-1)-1) do + * S:=0; + * // Sum over m + * for m:=3 to M do + * s:=0; + * // Sum over j + * for j:=2 to m do + * s+:=(RealField(32)!2)^-(j+(k-1)/j); + * end for; + * S+:=2^(m-(m-1)*t)*s; + * end for; + * A:=2^(k-2-M*t); + * B:=8*(Pi(RealField(32))^2-6)/3*2^(k-2)*S; + * pkt:=2.00743*Log(2)*k*2^-k*(A+B); + * seclevel:=Floor(-Log(2,pkt)); + * if seclevel ge securitybits then + * printf "k: %5o, security: %o bits (t: %o, M: %o)\n",k,seclevel,t,M; + * break; + * end if; + * end for; + * if seclevel ge securitybits then break; end if; + * end for; + * + * It can be run online at: + * http://magma.maths.usyd.edu.au/calc + * + * And will output: + * k: 1024, security: 129 bits (t: 6, M: 23) + * + * k is the number of bits of the prime, securitybits is the level we want to + * reach. + * + * prime length | RSA key size | # MR tests | security level + * -------------+--------------|------------+--------------- + * (b) >= 6394 | >= 12788 | 3 | 256 bit + * (b) >= 3747 | >= 7494 | 3 | 192 bit + * (b) >= 1345 | >= 2690 | 4 | 128 bit + * (b) >= 1080 | >= 2160 | 5 | 128 bit + * (b) >= 852 | >= 1704 | 5 | 112 bit + * (b) >= 476 | >= 952 | 5 | 80 bit + * (b) >= 400 | >= 800 | 6 | 80 bit + * (b) >= 347 | >= 694 | 7 | 80 bit + * (b) >= 308 | >= 616 | 8 | 80 bit + * (b) >= 55 | >= 110 | 27 | 64 bit + * (b) >= 6 | >= 12 | 34 | 64 bit */ -# define BN_prime_checks_for_size(b) ((b) >= 1300 ? 2 : \ - (b) >= 850 ? 3 : \ - (b) >= 650 ? 4 : \ - (b) >= 550 ? 5 : \ - (b) >= 450 ? 6 : \ - (b) >= 400 ? 7 : \ - (b) >= 350 ? 8 : \ - (b) >= 300 ? 9 : \ - (b) >= 250 ? 12 : \ - (b) >= 200 ? 15 : \ - (b) >= 150 ? 18 : \ - /* b >= 100 */ 27) + +# define BN_prime_checks_for_size(b) ((b) >= 3747 ? 3 : \ + (b) >= 1345 ? 4 : \ + (b) >= 476 ? 5 : \ + (b) >= 400 ? 6 : \ + (b) >= 347 ? 7 : \ + (b) >= 308 ? 8 : \ + (b) >= 55 ? 27 : \ + /* b >= 6 */ 34) # define BN_num_bytes(a) ((BN_num_bits(a)+7)/8) @@ -196,7 +247,7 @@ int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx); */ void BN_set_negative(BIGNUM *b, int n); /** BN_is_negative returns 1 if the BIGNUM is negative - * \param a pointer to the BIGNUM object + * \param b pointer to the BIGNUM object * \return 1 if a < 0 and 0 otherwise */ int BN_is_negative(const BIGNUM *b); diff --git a/external/openssl/include/win32/openssl/buffer.h b/external/openssl/include/win32/openssl/buffer.h index 91f0e07f..35160b4f 100644 --- a/external/openssl/include/win32/openssl/buffer.h +++ b/external/openssl/include/win32/openssl/buffer.h @@ -21,10 +21,7 @@ extern "C" { #endif # include - -# if !defined(NO_SYS_TYPES_H) -# include -# endif +# include /* * These names are outdated as of OpenSSL 1.1; a future release diff --git a/external/openssl/include/win32/openssl/conf.h b/external/openssl/include/win32/openssl/conf.h index 462e3c9d..e0539e31 100644 --- a/external/openssl/include/win32/openssl/conf.h +++ b/external/openssl/include/win32/openssl/conf.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -191,6 +191,7 @@ int ERR_load_CONF_strings(void); # define CONF_F_NCONF_LOAD_BIO 110 # define CONF_F_NCONF_LOAD_FP 114 # define CONF_F_NCONF_NEW 111 +# define CONF_F_SSL_MODULE_INIT 123 # define CONF_F_STR_COPY 101 /* Reason codes. */ @@ -206,8 +207,13 @@ int ERR_load_CONF_strings(void); # define CONF_R_NO_SECTION 107 # define CONF_R_NO_SUCH_FILE 114 # define CONF_R_NO_VALUE 108 +# define CONF_R_SSL_COMMAND_SECTION_EMPTY 117 +# define CONF_R_SSL_COMMAND_SECTION_NOT_FOUND 118 +# define CONF_R_SSL_SECTION_EMPTY 119 +# define CONF_R_SSL_SECTION_NOT_FOUND 120 # define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 103 # define CONF_R_UNKNOWN_MODULE_NAME 113 +# define CONF_R_VARIABLE_EXPANSION_TOO_LONG 116 # define CONF_R_VARIABLE_HAS_NO_VALUE 104 # ifdef __cplusplus diff --git a/external/openssl/include/win32/openssl/crypto.h b/external/openssl/include/win32/openssl/crypto.h index bd0b1408..fa3f12af 100644 --- a/external/openssl/include/win32/openssl/crypto.h +++ b/external/openssl/include/win32/openssl/crypto.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -146,6 +146,8 @@ int CRYPTO_mem_ctrl(int mode); CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE) # define OPENSSL_secure_free(addr) \ CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE) +# define OPENSSL_secure_clear_free(addr, num) \ + CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE) # define OPENSSL_secure_actual_size(ptr) \ CRYPTO_secure_actual_size(ptr) @@ -174,7 +176,7 @@ typedef void CRYPTO_EX_new (void *parent, void *ptr, CRYPTO_EX_DATA *ad, typedef void CRYPTO_EX_free (void *parent, void *ptr, CRYPTO_EX_DATA *ad, int idx, long argl, void *argp); typedef int CRYPTO_EX_dup (CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from, - void *srcp, int idx, long argl, void *argp); + void *from_d, int idx, long argl, void *argp); __owur int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); @@ -285,6 +287,8 @@ int CRYPTO_secure_malloc_done(void); void *CRYPTO_secure_malloc(size_t num, const char *file, int line); void *CRYPTO_secure_zalloc(size_t num, const char *file, int line); void CRYPTO_secure_free(void *ptr, const char *file, int line); +void CRYPTO_secure_clear_free(void *ptr, size_t num, + const char *file, int line); int CRYPTO_secure_allocated(const void *ptr); int CRYPTO_secure_malloc_initialized(void); size_t CRYPTO_secure_actual_size(void *ptr); @@ -367,7 +371,9 @@ int CRYPTO_memcmp(const volatile void * volatile in_a, # define OPENSSL_INIT_ENGINE_CAPI 0x00002000L # define OPENSSL_INIT_ENGINE_PADLOCK 0x00004000L # define OPENSSL_INIT_ENGINE_AFALG 0x00008000L -/* OPENSSL_INIT flag 0x00010000 reserved for internal use */ +/* OPENSSL_INIT_ZLIB 0x00010000L */ +/* currently unused 0x00020000L */ +/* OPENSSL_INIT_BASE_ONLY 0x00040000L */ /* OPENSSL_INIT flag range 0xfff00000 reserved for OPENSSL_init_ssl() */ /* Max OPENSSL_INIT flag value is 0x80000000 */ diff --git a/external/openssl/include/win32/openssl/ct.h b/external/openssl/include/win32/openssl/ct.h index 6c632652..bf29fbab 100644 --- a/external/openssl/include/win32/openssl/ct.h +++ b/external/openssl/include/win32/openssl/ct.h @@ -98,6 +98,21 @@ const CTLOG_STORE *CT_POLICY_EVAL_CTX_get0_log_store(const CT_POLICY_EVAL_CTX *c void CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE(CT_POLICY_EVAL_CTX *ctx, CTLOG_STORE *log_store); +/* + * Gets the time, in milliseconds since the Unix epoch, that will be used as the + * current time when checking whether an SCT was issued in the future. + * Such SCTs will fail validation, as required by RFC6962. + */ +uint64_t CT_POLICY_EVAL_CTX_get_time(const CT_POLICY_EVAL_CTX *ctx); + +/* + * Sets the time to evaluate SCTs against, in milliseconds since the Unix epoch. + * If an SCT's timestamp is after this time, it will be interpreted as having + * been issued in the future. RFC6962 states that "TLS clients MUST reject SCTs + * whose timestamp is in the future", so an SCT will not validate in this case. + */ +void CT_POLICY_EVAL_CTX_set_time(CT_POLICY_EVAL_CTX *ctx, uint64_t time_in_ms); + /***************** * SCT functions * *****************/ @@ -467,7 +482,6 @@ int ERR_load_CT_strings(void); # define CT_F_CTLOG_NEW 117 # define CT_F_CTLOG_NEW_FROM_BASE64 118 # define CT_F_CTLOG_NEW_FROM_CONF 119 -# define CT_F_CTLOG_NEW_NULL 120 # define CT_F_CTLOG_STORE_LOAD_CTX_NEW 122 # define CT_F_CTLOG_STORE_LOAD_FILE 123 # define CT_F_CTLOG_STORE_LOAD_LOG 130 @@ -482,6 +496,7 @@ int ERR_load_CT_strings(void); # define CT_F_O2I_SCT_LIST 111 # define CT_F_O2I_SCT_SIGNATURE 112 # define CT_F_SCT_CTX_NEW 126 +# define CT_F_SCT_CTX_VERIFY 128 # define CT_F_SCT_NEW 100 # define CT_F_SCT_NEW_FROM_BASE64 127 # define CT_F_SCT_SET0_LOG_ID 101 @@ -491,7 +506,6 @@ int ERR_load_CT_strings(void); # define CT_F_SCT_SET_LOG_ENTRY_TYPE 102 # define CT_F_SCT_SET_SIGNATURE_NID 103 # define CT_F_SCT_SET_VERSION 104 -# define CT_F_SCT_CTX_VERIFY 128 /* Reason codes. */ # define CT_R_BASE64_DECODE_ERROR 108 @@ -501,6 +515,7 @@ int ERR_load_CT_strings(void); # define CT_R_LOG_CONF_MISSING_DESCRIPTION 111 # define CT_R_LOG_CONF_MISSING_KEY 112 # define CT_R_LOG_KEY_INVALID 113 +# define CT_R_SCT_FUTURE_TIMESTAMP 116 # define CT_R_SCT_INVALID 104 # define CT_R_SCT_INVALID_SIGNATURE 107 # define CT_R_SCT_LIST_INVALID 105 diff --git a/external/openssl/include/win32/openssl/dh.h b/external/openssl/include/win32/openssl/dh.h index ae309e7b..8cf879e1 100644 --- a/external/openssl/include/win32/openssl/dh.h +++ b/external/openssl/include/win32/openssl/dh.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -87,12 +87,29 @@ DECLARE_ASN1_ITEM(DHparams) */ # define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME -# define d2i_DHparams_fp(fp,x) (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ - (char *(*)())d2i_DHparams,(fp),(unsigned char **)(x)) -# define i2d_DHparams_fp(fp,x) ASN1_i2d_fp(i2d_DHparams,(fp), \ - (unsigned char *)(x)) -# define d2i_DHparams_bio(bp,x) ASN1_d2i_bio_of(DH,DH_new,d2i_DHparams,bp,x) -# define i2d_DHparams_bio(bp,x) ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x) +# define d2i_DHparams_fp(fp,x) \ + (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ + (char *(*)())d2i_DHparams, \ + (fp), \ + (unsigned char **)(x)) +# define i2d_DHparams_fp(fp,x) \ + ASN1_i2d_fp(i2d_DHparams,(fp), (unsigned char *)(x)) +# define d2i_DHparams_bio(bp,x) \ + ASN1_d2i_bio_of(DH, DH_new, d2i_DHparams, bp, x) +# define i2d_DHparams_bio(bp,x) \ + ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x) + +# define d2i_DHxparams_fp(fp,x) \ + (DH *)ASN1_d2i_fp((char *(*)())DH_new, \ + (char *(*)())d2i_DHxparams, \ + (fp), \ + (unsigned char **)(x)) +# define i2d_DHxparams_fp(fp,x) \ + ASN1_i2d_fp(i2d_DHxparams,(fp), (unsigned char *)(x)) +# define d2i_DHxparams_bio(bp,x) \ + ASN1_d2i_bio_of(DH, DH_new, d2i_DHxparams, bp, x) +# define i2d_DHxparams_bio(bp,x) \ + ASN1_i2d_bio_of_const(DH, i2d_DHxparams, bp, x) DH *DHparams_dup(DH *); @@ -124,6 +141,7 @@ DEPRECATEDIN_0_9_8(DH *DH_generate_parameters(int prime_len, int generator, int DH_generate_parameters_ex(DH *dh, int prime_len, int generator, BN_GENCB *cb); +int DH_check_params(const DH *dh, int *ret); int DH_check(const DH *dh, int *codes); int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, int *codes); int DH_generate_key(DH *dh); @@ -169,7 +187,7 @@ void DH_meth_free(DH_METHOD *dhm); DH_METHOD *DH_meth_dup(const DH_METHOD *dhm); const char *DH_meth_get0_name(const DH_METHOD *dhm); int DH_meth_set1_name(DH_METHOD *dhm, const char *name); -int DH_meth_get_flags(DH_METHOD *dhm); +int DH_meth_get_flags(const DH_METHOD *dhm); int DH_meth_set_flags(DH_METHOD *dhm, int flags); void *DH_meth_get0_app_data(const DH_METHOD *dhm); int DH_meth_set0_app_data(DH_METHOD *dhm, void *app_data); diff --git a/external/openssl/include/win32/openssl/dsa.h b/external/openssl/include/win32/openssl/dsa.h index cb5fbc2f..3a7b1a62 100644 --- a/external/openssl/include/win32/openssl/dsa.h +++ b/external/openssl/include/win32/openssl/dsa.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -146,10 +146,12 @@ int DSAparams_print_fp(FILE *fp, const DSA *x); int DSA_print_fp(FILE *bp, const DSA *x, int off); # endif -# define DSS_prime_checks 50 +# define DSS_prime_checks 64 /* - * Primality test according to FIPS PUB 186[-1], Appendix 2.1: 50 rounds of - * Rabin-Miller + * Primality test according to FIPS PUB 186-4, Appendix C.3. Since we only + * have one value here we set the number of checks to 64 which is the 128 bit + * security level that is the highest level and valid for creating a 3072 bit + * DSA key. */ # define DSA_is_prime(n, callback, cb_arg) \ BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg) @@ -186,7 +188,7 @@ void DSA_meth_free(DSA_METHOD *dsam); DSA_METHOD *DSA_meth_dup(const DSA_METHOD *dsam); const char *DSA_meth_get0_name(const DSA_METHOD *dsam); int DSA_meth_set1_name(DSA_METHOD *dsam, const char *name); -int DSA_meth_get_flags(DSA_METHOD *dsam); +int DSA_meth_get_flags(const DSA_METHOD *dsam); int DSA_meth_set_flags(DSA_METHOD *dsam, int flags); void *DSA_meth_get0_app_data(const DSA_METHOD *dsam); int DSA_meth_set0_app_data(DSA_METHOD *dsam, void *app_data); @@ -260,6 +262,7 @@ int ERR_load_DSA_strings(void); # define DSA_F_DSA_SIG_NEW 102 # define DSA_F_OLD_DSA_PRIV_DECODE 122 # define DSA_F_PKEY_DSA_CTRL 120 +# define DSA_F_PKEY_DSA_CTRL_STR 104 # define DSA_F_PKEY_DSA_KEYGEN 121 /* Reason codes. */ @@ -274,6 +277,7 @@ int ERR_load_DSA_strings(void); # define DSA_R_NO_PARAMETERS_SET 107 # define DSA_R_PARAMETER_ENCODING_ERROR 105 # define DSA_R_Q_NOT_PRIME 113 +# define DSA_R_SEED_LEN_SMALL 110 # ifdef __cplusplus } diff --git a/external/openssl/include/win32/openssl/e_os2.h b/external/openssl/include/win32/openssl/e_os2.h index 99ea3477..9800e154 100644 --- a/external/openssl/include/win32/openssl/e_os2.h +++ b/external/openssl/include/win32/openssl/e_os2.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -49,7 +49,6 @@ extern "C" { # define OPENSSL_SYS_WIN32_UWIN # else # if defined(__CYGWIN__) || defined(OPENSSL_SYS_CYGWIN) -# undef OPENSSL_SYS_UNIX # define OPENSSL_SYS_WIN32_CYGWIN # else # if defined(_WIN32) || defined(OPENSSL_SYS_WIN32) @@ -212,9 +211,9 @@ extern "C" { # endif # endif -# if defined(OPENSSL_SYS_UEFI) && !defined(ssize_t) -# define ossl_ssize_t int -# define OSSL_SSIZE_MAX INT_MAX +# if defined(OPENSSL_SYS_UEFI) && !defined(ossl_ssize_t) +# define ossl_ssize_t INTN +# define OSSL_SSIZE_MAX MAX_INTN # endif # ifndef ossl_ssize_t @@ -242,7 +241,6 @@ typedef INT32 int32_t; typedef UINT32 uint32_t; typedef INT64 int64_t; typedef UINT64 uint64_t; -# define PRIu64 "%Lu" # elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ defined(__osf__) || defined(__sgi) || defined(__hpux) || \ defined(OPENSSL_SYS_VMS) || defined (__OpenBSD__) @@ -264,18 +262,6 @@ typedef unsigned __int64 uint64_t; # include # endif -/* - * We need a format operator for some client tools for uint64_t. If inttypes.h - * isn't available or did not define it, just go with hard-coded. - */ -# ifndef PRIu64 -# ifdef SIXTY_FOUR_BIT_LONG -# define PRIu64 "lu" -# else -# define PRIu64 "llu" -# endif -# endif - /* ossl_inline: portable inline definition usable in public headers */ # if !defined(inline) && !defined(__cplusplus) # if defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L diff --git a/external/openssl/include/win32/openssl/ec.h b/external/openssl/include/win32/openssl/ec.h index 656cb410..c4aeaed5 100644 --- a/external/openssl/include/win32/openssl/ec.h +++ b/external/openssl/include/win32/openssl/ec.h @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2002-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -573,11 +573,9 @@ int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *p, * \param point EC_POINT object * \param form point conversion form * \param pbuf returns pointer to allocated buffer - * \param len length of the memory buffer * \param ctx BN_CTX object (optional) * \return the length of the encoded octet string or 0 if an error occurred */ - size_t EC_POINT_point2buf(const EC_GROUP *group, const EC_POINT *point, point_conversion_form_t form, unsigned char **pbuf, BN_CTX *ctx); @@ -863,7 +861,7 @@ int EC_KEY_generate_key(EC_KEY *key); int EC_KEY_check_key(const EC_KEY *key); /** Indicates if an EC_KEY can be used for signing. - * \param key the EC_KEY object + * \param eckey the EC_KEY object * \return 1 if can can sign and 0 otherwise. */ int EC_KEY_can_sign(const EC_KEY *eckey); @@ -882,11 +880,9 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, * \param key key to encode * \param form point conversion form * \param pbuf returns pointer to allocated buffer - * \param len length of the memory buffer * \param ctx BN_CTX object (optional) * \return the length of the encoded octet string or 0 if an error occurred */ - size_t EC_KEY_key2buf(const EC_KEY *key, point_conversion_form_t form, unsigned char **pbuf, BN_CTX *ctx); @@ -921,11 +917,10 @@ int EC_KEY_oct2priv(EC_KEY *key, const unsigned char *buf, size_t len); size_t EC_KEY_priv2oct(const EC_KEY *key, unsigned char *buf, size_t len); /** Encodes an EC_KEY private key to an allocated octet string - * \param key key to encode + * \param eckey key to encode * \param pbuf returns pointer to allocated buffer * \return the length of the encoded octet string or 0 if an error occurred */ - size_t EC_KEY_priv2buf(const EC_KEY *eckey, unsigned char **pbuf); /********************************************************************/ @@ -1228,7 +1223,7 @@ void EC_KEY_METHOD_set_verify(EC_KEY_METHOD *meth, const ECDSA_SIG *sig, EC_KEY *eckey)); -void EC_KEY_METHOD_get_init(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_init(const EC_KEY_METHOD *meth, int (**pinit)(EC_KEY *key), void (**pfinish)(EC_KEY *key), int (**pcopy)(EC_KEY *dest, const EC_KEY *src), @@ -1239,16 +1234,16 @@ void EC_KEY_METHOD_get_init(EC_KEY_METHOD *meth, int (**pset_public)(EC_KEY *key, const EC_POINT *pub_key)); -void EC_KEY_METHOD_get_keygen(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_keygen(const EC_KEY_METHOD *meth, int (**pkeygen)(EC_KEY *key)); -void EC_KEY_METHOD_get_compute_key(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_compute_key(const EC_KEY_METHOD *meth, int (**pck)(unsigned char **psec, size_t *pseclen, const EC_POINT *pub_key, const EC_KEY *ecdh)); -void EC_KEY_METHOD_get_sign(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_sign(const EC_KEY_METHOD *meth, int (**psign)(int type, const unsigned char *dgst, int dlen, unsigned char *sig, unsigned int *siglen, @@ -1262,7 +1257,7 @@ void EC_KEY_METHOD_get_sign(EC_KEY_METHOD *meth, const BIGNUM *in_r, EC_KEY *eckey)); -void EC_KEY_METHOD_get_verify(EC_KEY_METHOD *meth, +void EC_KEY_METHOD_get_verify(const EC_KEY_METHOD *meth, int (**pverify)(int type, const unsigned char *dgst, int dgst_len, const unsigned char *sigbuf, @@ -1404,6 +1399,7 @@ int ERR_load_EC_strings(void); # define EC_F_EC_ASN1_GROUP2CURVE 153 # define EC_F_EC_ASN1_GROUP2FIELDID 154 # define EC_F_EC_GF2M_MONTGOMERY_POINT_MULTIPLY 208 +# define EC_F_EC_GF2M_SIMPLE_FIELD_INV 296 # define EC_F_EC_GF2M_SIMPLE_GROUP_CHECK_DISCRIMINANT 159 # define EC_F_EC_GF2M_SIMPLE_GROUP_SET_CURVE 195 # define EC_F_EC_GF2M_SIMPLE_OCT2POINT 160 @@ -1413,6 +1409,7 @@ int ERR_load_EC_strings(void); # define EC_F_EC_GF2M_SIMPLE_SET_COMPRESSED_COORDINATES 164 # define EC_F_EC_GFP_MONT_FIELD_DECODE 133 # define EC_F_EC_GFP_MONT_FIELD_ENCODE 134 +# define EC_F_EC_GFP_MONT_FIELD_INV 297 # define EC_F_EC_GFP_MONT_FIELD_MUL 131 # define EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE 209 # define EC_F_EC_GFP_MONT_FIELD_SQR 132 @@ -1429,6 +1426,8 @@ int ERR_load_EC_strings(void); # define EC_F_EC_GFP_NIST_FIELD_MUL 200 # define EC_F_EC_GFP_NIST_FIELD_SQR 201 # define EC_F_EC_GFP_NIST_GROUP_SET_CURVE 202 +# define EC_F_EC_GFP_SIMPLE_BLIND_COORDINATES 287 +# define EC_F_EC_GFP_SIMPLE_FIELD_INV 298 # define EC_F_EC_GFP_SIMPLE_GROUP_CHECK_DISCRIMINANT 165 # define EC_F_EC_GFP_SIMPLE_GROUP_SET_CURVE 166 # define EC_F_EC_GFP_SIMPLE_MAKE_AFFINE 102 @@ -1518,6 +1517,7 @@ int ERR_load_EC_strings(void); # define EC_R_BAD_SIGNATURE 156 # define EC_R_BIGNUM_OUT_OF_RANGE 144 # define EC_R_BUFFER_TOO_SMALL 100 +# define EC_R_CANNOT_INVERT 165 # define EC_R_COORDINATES_OUT_OF_RANGE 146 # define EC_R_CURVE_DOES_NOT_SUPPORT_ECDH 160 # define EC_R_CURVE_DOES_NOT_SUPPORT_SIGNING 159 @@ -1568,6 +1568,7 @@ int ERR_load_EC_strings(void); # define EC_R_SLOT_FULL 108 # define EC_R_UNDEFINED_GENERATOR 113 # define EC_R_UNDEFINED_ORDER 128 +# define EC_R_UNKNOWN_COFACTOR 164 # define EC_R_UNKNOWN_GROUP 129 # define EC_R_UNKNOWN_ORDER 114 # define EC_R_UNSUPPORTED_FIELD 131 diff --git a/external/openssl/include/win32/openssl/engine.h b/external/openssl/include/win32/openssl/engine.h index 319371e4..26cf7148 100644 --- a/external/openssl/include/win32/openssl/engine.h +++ b/external/openssl/include/win32/openssl/engine.h @@ -334,8 +334,6 @@ ENGINE *ENGINE_by_id(const char *id); OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_PADLOCK, NULL) # define ENGINE_load_capi() \ OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_CAPI, NULL) -# define ENGINE_load_dasync() \ - OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_DASYNC, NULL) # define ENGINE_load_afalg() \ OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_AFALG, NULL) # endif diff --git a/external/openssl/include/win32/openssl/err.h b/external/openssl/include/win32/openssl/err.h index f9390919..ba40f79b 100644 --- a/external/openssl/include/win32/openssl/err.h +++ b/external/openssl/include/win32/openssl/err.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -37,6 +37,7 @@ extern "C" { # define ERR_TXT_STRING 0x02 # define ERR_FLAG_MARK 0x01 +# define ERR_FLAG_CLEAR 0x02 # define ERR_NUM_ERRORS 16 typedef struct err_state_st { @@ -89,7 +90,7 @@ typedef struct err_state_st { # define ERR_LIB_CMS 46 # define ERR_LIB_TS 47 # define ERR_LIB_HMAC 48 -# define ERR_LIB_JPAKE 49 +/* # define ERR_LIB_JPAKE 49 */ # define ERR_LIB_CT 50 # define ERR_LIB_ASYNC 51 # define ERR_LIB_KDF 52 @@ -128,7 +129,6 @@ typedef struct err_state_st { # define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define TSerr(f,r) ERR_PUT_error(ERR_LIB_TS,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define HMACerr(f,r) ERR_PUT_error(ERR_LIB_HMAC,(f),(r),OPENSSL_FILE,OPENSSL_LINE) -# define JPAKEerr(f,r) ERR_PUT_error(ERR_LIB_JPAKE,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define CTerr(f,r) ERR_PUT_error(ERR_LIB_CT,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define ASYNCerr(f,r) ERR_PUT_error(ERR_LIB_ASYNC,(f),(r),OPENSSL_FILE,OPENSSL_LINE) # define KDFerr(f,r) ERR_PUT_error(ERR_LIB_KDF,(f),(r),OPENSSL_FILE,OPENSSL_LINE) @@ -140,6 +140,7 @@ typedef struct err_state_st { # define ERR_GET_LIB(l) (int)(((l) >> 24L) & 0x0FFL) # define ERR_GET_FUNC(l) (int)(((l) >> 12L) & 0xFFFL) # define ERR_GET_REASON(l) (int)( (l) & 0xFFFL) +# define ERR_FATAL_ERROR(l) (int)( (l) & ERR_R_FATAL) /* OS functions */ # define SYS_F_FOPEN 1 @@ -159,6 +160,7 @@ typedef struct err_state_st { # define SYS_F_GETSOCKOPT 15 # define SYS_F_GETSOCKNAME 16 # define SYS_F_GETHOSTBYNAME 17 +# define SYS_F_FFLUSH 18 /* reasons */ # define ERR_R_SYS_LIB ERR_LIB_SYS/* 2 */ diff --git a/external/openssl/include/win32/openssl/evp.h b/external/openssl/include/win32/openssl/evp.h index b9c83b2b..36e29344 100644 --- a/external/openssl/include/win32/openssl/evp.h +++ b/external/openssl/include/win32/openssl/evp.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -900,6 +900,9 @@ int EVP_PKEY_security_bits(const EVP_PKEY *pkey); int EVP_PKEY_size(EVP_PKEY *pkey); int EVP_PKEY_set_type(EVP_PKEY *pkey, int type); int EVP_PKEY_set_type_str(EVP_PKEY *pkey, const char *str, int len); +# ifndef OPENSSL_NO_ENGINE +int EVP_PKEY_set1_engine(EVP_PKEY *pkey, ENGINE *e); +# endif int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key); void *EVP_PKEY_get0(const EVP_PKEY *pkey); const unsigned char *EVP_PKEY_get0_hmac(const EVP_PKEY *pkey, size_t *len); @@ -1348,34 +1351,34 @@ void EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth, const char *type, const char *value)); -void EVP_PKEY_meth_get_init(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_init(const EVP_PKEY_METHOD *pmeth, int (**pinit) (EVP_PKEY_CTX *ctx)); -void EVP_PKEY_meth_get_copy(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_copy(const EVP_PKEY_METHOD *pmeth, int (**pcopy) (EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src)); -void EVP_PKEY_meth_get_cleanup(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_cleanup(const EVP_PKEY_METHOD *pmeth, void (**pcleanup) (EVP_PKEY_CTX *ctx)); -void EVP_PKEY_meth_get_paramgen(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_paramgen(const EVP_PKEY_METHOD *pmeth, int (**pparamgen_init) (EVP_PKEY_CTX *ctx), int (**pparamgen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)); -void EVP_PKEY_meth_get_keygen(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_keygen(const EVP_PKEY_METHOD *pmeth, int (**pkeygen_init) (EVP_PKEY_CTX *ctx), int (**pkeygen) (EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)); -void EVP_PKEY_meth_get_sign(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_sign(const EVP_PKEY_METHOD *pmeth, int (**psign_init) (EVP_PKEY_CTX *ctx), int (**psign) (EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, const unsigned char *tbs, size_t tbslen)); -void EVP_PKEY_meth_get_verify(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_verify(const EVP_PKEY_METHOD *pmeth, int (**pverify_init) (EVP_PKEY_CTX *ctx), int (**pverify) (EVP_PKEY_CTX *ctx, const unsigned char *sig, @@ -1383,7 +1386,7 @@ void EVP_PKEY_meth_get_verify(EVP_PKEY_METHOD *pmeth, const unsigned char *tbs, size_t tbslen)); -void EVP_PKEY_meth_get_verify_recover(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_verify_recover(const EVP_PKEY_METHOD *pmeth, int (**pverify_recover_init) (EVP_PKEY_CTX *ctx), int (**pverify_recover) (EVP_PKEY_CTX @@ -1395,7 +1398,7 @@ void EVP_PKEY_meth_get_verify_recover(EVP_PKEY_METHOD *pmeth, char *tbs, size_t tbslen)); -void EVP_PKEY_meth_get_signctx(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_signctx(const EVP_PKEY_METHOD *pmeth, int (**psignctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx), int (**psignctx) (EVP_PKEY_CTX *ctx, @@ -1403,7 +1406,7 @@ void EVP_PKEY_meth_get_signctx(EVP_PKEY_METHOD *pmeth, size_t *siglen, EVP_MD_CTX *mctx)); -void EVP_PKEY_meth_get_verifyctx(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_verifyctx(const EVP_PKEY_METHOD *pmeth, int (**pverifyctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx), int (**pverifyctx) (EVP_PKEY_CTX *ctx, @@ -1411,7 +1414,7 @@ void EVP_PKEY_meth_get_verifyctx(EVP_PKEY_METHOD *pmeth, int siglen, EVP_MD_CTX *mctx)); -void EVP_PKEY_meth_get_encrypt(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_encrypt(const EVP_PKEY_METHOD *pmeth, int (**pencrypt_init) (EVP_PKEY_CTX *ctx), int (**pencryptfn) (EVP_PKEY_CTX *ctx, unsigned char *out, @@ -1419,7 +1422,7 @@ void EVP_PKEY_meth_get_encrypt(EVP_PKEY_METHOD *pmeth, const unsigned char *in, size_t inlen)); -void EVP_PKEY_meth_get_decrypt(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_decrypt(const EVP_PKEY_METHOD *pmeth, int (**pdecrypt_init) (EVP_PKEY_CTX *ctx), int (**pdecrypt) (EVP_PKEY_CTX *ctx, unsigned char *out, @@ -1427,13 +1430,13 @@ void EVP_PKEY_meth_get_decrypt(EVP_PKEY_METHOD *pmeth, const unsigned char *in, size_t inlen)); -void EVP_PKEY_meth_get_derive(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_derive(const EVP_PKEY_METHOD *pmeth, int (**pderive_init) (EVP_PKEY_CTX *ctx), int (**pderive) (EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen)); -void EVP_PKEY_meth_get_ctrl(EVP_PKEY_METHOD *pmeth, +void EVP_PKEY_meth_get_ctrl(const EVP_PKEY_METHOD *pmeth, int (**pctrl) (EVP_PKEY_CTX *ctx, int type, int p1, void *p2), int (**pctrl_str) (EVP_PKEY_CTX *ctx, @@ -1455,11 +1458,14 @@ int ERR_load_EVP_strings(void); /* Function codes. */ # define EVP_F_AESNI_INIT_KEY 165 # define EVP_F_AES_INIT_KEY 133 +# define EVP_F_AES_OCB_CIPHER 169 # define EVP_F_AES_T4_INIT_KEY 178 +# define EVP_F_AES_WRAP_CIPHER 170 # define EVP_F_ALG_MODULE_INIT 177 # define EVP_F_CAMELLIA_INIT_KEY 159 # define EVP_F_CHACHA20_POLY1305_CTRL 182 # define EVP_F_CMLL_T4_INIT_KEY 179 +# define EVP_F_DES_EDE3_WRAP_CIPHER 171 # define EVP_F_DO_SIGVER_INIT 161 # define EVP_F_EVP_CIPHERINIT_EX 123 # define EVP_F_EVP_CIPHER_CTX_COPY 163 @@ -1479,6 +1485,7 @@ int ERR_load_EVP_strings(void); # define EVP_F_EVP_PBE_SCRYPT 181 # define EVP_F_EVP_PKCS82PKEY 111 # define EVP_F_EVP_PKEY2PKCS8 113 +# define EVP_F_EVP_PKEY_ASN1_ADD0 168 # define EVP_F_EVP_PKEY_COPY_PARAMETERS 103 # define EVP_F_EVP_PKEY_CTX_CTRL 137 # define EVP_F_EVP_PKEY_CTX_CTRL_STR 150 @@ -1499,9 +1506,12 @@ int ERR_load_EVP_strings(void); # define EVP_F_EVP_PKEY_GET0_RSA 121 # define EVP_F_EVP_PKEY_KEYGEN 146 # define EVP_F_EVP_PKEY_KEYGEN_INIT 147 +# define EVP_F_EVP_PKEY_METH_ADD0 172 +# define EVP_F_EVP_PKEY_METH_NEW 173 # define EVP_F_EVP_PKEY_NEW 106 # define EVP_F_EVP_PKEY_PARAMGEN 148 # define EVP_F_EVP_PKEY_PARAMGEN_INIT 149 +# define EVP_F_EVP_PKEY_SET1_ENGINE 187 # define EVP_F_EVP_PKEY_SIGN 140 # define EVP_F_EVP_PKEY_SIGN_INIT 141 # define EVP_F_EVP_PKEY_VERIFY 142 @@ -1546,6 +1556,7 @@ int ERR_load_EVP_strings(void); # define EVP_R_INPUT_NOT_INITIALIZED 111 # define EVP_R_INVALID_DIGEST 152 # define EVP_R_INVALID_FIPS_MODE 168 +# define EVP_R_INVALID_KEY 163 # define EVP_R_INVALID_KEY_LENGTH 130 # define EVP_R_INVALID_OPERATION 148 # define EVP_R_KEYGEN_FAILURE 120 @@ -1561,6 +1572,9 @@ int ERR_load_EVP_strings(void); # define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 150 # define EVP_R_OPERATON_NOT_INITIALIZED 151 # define EVP_R_PARTIALLY_OVERLAPPING 162 +# define EVP_R_PBKDF2_ERROR 176 +# define EVP_R_PKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTERED 175 +# define EVP_R_PKEY_ASN1_METHOD_ALREADY_REGISTERED 164 # define EVP_R_PRIVATE_KEY_DECODE_ERROR 145 # define EVP_R_PRIVATE_KEY_ENCODE_ERROR 146 # define EVP_R_PUBLIC_KEY_NOT_RSA 106 @@ -1568,12 +1582,12 @@ int ERR_load_EVP_strings(void); # define EVP_R_UNKNOWN_DIGEST 161 # define EVP_R_UNKNOWN_OPTION 169 # define EVP_R_UNKNOWN_PBE_ALGORITHM 121 -# define EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS 135 # define EVP_R_UNSUPPORTED_ALGORITHM 156 # define EVP_R_UNSUPPORTED_CIPHER 107 # define EVP_R_UNSUPPORTED_KEYLENGTH 123 # define EVP_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 124 # define EVP_R_UNSUPPORTED_KEY_SIZE 108 +# define EVP_R_UNSUPPORTED_NUMBER_OF_ROUNDS 135 # define EVP_R_UNSUPPORTED_PRF 125 # define EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM 118 # define EVP_R_UNSUPPORTED_SALT_TYPE 126 diff --git a/external/openssl/include/win32/openssl/lhash.h b/external/openssl/include/win32/openssl/lhash.h index e2ccb65d..8ecc5884 100644 --- a/external/openssl/include/win32/openssl/lhash.h +++ b/external/openssl/include/win32/openssl/lhash.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -95,7 +95,7 @@ void OPENSSL_LH_node_usage_stats_bio(const OPENSSL_LHASH *lh, BIO *out); # define _LHASH OPENSSL_LHASH # define LHASH_NODE OPENSSL_LH_NODE # define lh_error OPENSSL_LH_error -# define lh_new OPENSSL_lh_new +# define lh_new OPENSSL_LH_new # define lh_free OPENSSL_LH_free # define lh_insert OPENSSL_LH_insert # define lh_delete OPENSSL_LH_delete @@ -195,8 +195,21 @@ void OPENSSL_LH_node_usage_stats_bio(const OPENSSL_LHASH *lh, BIO *out); LHASH_OF(type) DEFINE_LHASH_OF(OPENSSL_STRING); +# ifdef _MSC_VER +/* + * push and pop this warning: + * warning C4090: 'function': different 'const' qualifiers + */ +# pragma warning (push) +# pragma warning (disable: 4090) +# endif + DEFINE_LHASH_OF(OPENSSL_CSTRING); +# ifdef _MSC_VER +# pragma warning (pop) +# endif + #ifdef __cplusplus } #endif diff --git a/external/openssl/include/win32/openssl/objects.h b/external/openssl/include/win32/openssl/objects.h index 09d614ff..d4462fee 100644 --- a/external/openssl/include/win32/openssl/objects.h +++ b/external/openssl/include/win32/openssl/objects.h @@ -992,7 +992,7 @@ const void *OBJ_bsearch_ex_(const void *key, const void *base, int num, * const void *a_; * const nid_triple const *a = a_; * - * The assignement discards a const because what you really want is: + * The assignment discards a const because what you really want is: * * const int const * const *a = a_; * @@ -1000,7 +1000,7 @@ const void *OBJ_bsearch_ex_(const void *key, const void *base, int num, * which breaks comparison functions. * * Thus we end up having to cast, sadly, or unpack the - * declarations. Or, as I finally did in this case, delcare nid_triple + * declarations. Or, as I finally did in this case, declare nid_triple * to be a struct, which it should have been in the first place. * * Ben, August 2008. diff --git a/external/openssl/include/win32/openssl/ocsp.h b/external/openssl/include/win32/openssl/ocsp.h index 08debc5b..ba1b9731 100644 --- a/external/openssl/include/win32/openssl/ocsp.h +++ b/external/openssl/include/win32/openssl/ocsp.h @@ -1,5 +1,5 @@ /* - * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -92,7 +92,6 @@ typedef struct ocsp_resp_bytes_st OCSP_RESPBYTES; # define V_OCSP_RESPID_KEY 1 DEFINE_STACK_OF(OCSP_RESPID) -DECLARE_ASN1_FUNCTIONS(OCSP_RESPID) typedef struct ocsp_revoked_info_st OCSP_REVOKEDINFO; @@ -137,22 +136,6 @@ typedef struct ocsp_service_locator_st OCSP_SERVICELOC; # define i2d_OCSP_REQUEST_bio(bp,o) ASN1_i2d_bio_of(OCSP_REQUEST,i2d_OCSP_REQUEST,bp,o) -# define OCSP_REQUEST_sign(o,pkey,md) \ - ASN1_item_sign(ASN1_ITEM_rptr(OCSP_REQINFO),\ - &o->optionalSignature->signatureAlgorithm,NULL,\ - o->optionalSignature->signature,&o->tbsRequest,pkey,md) - -# define OCSP_BASICRESP_sign(o,pkey,md,d) \ - ASN1_item_sign(ASN1_ITEM_rptr(OCSP_RESPDATA),&o->signatureAlgorithm,NULL,\ - o->signature,&o->tbsResponseData,pkey,md) - -# define OCSP_REQUEST_verify(a,r) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_REQINFO),\ - &a->optionalSignature->signatureAlgorithm,\ - a->optionalSignature->signature,&a->tbsRequest,r) - -# define OCSP_BASICRESP_verify(a,r,d) ASN1_item_verify(ASN1_ITEM_rptr(OCSP_RESPDATA),\ - &a->signatureAlgorithm,a->signature,&a->tbsResponseData,r) - # define ASN1_BIT_STRING_digest(data,type,md,len) \ ASN1_item_digest(ASN1_ITEM_rptr(ASN1_BIT_STRING),type,data,md,len) @@ -175,8 +158,6 @@ int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it, int OCSP_REQ_CTX_nbio_d2i(OCSP_REQ_CTX *rctx, ASN1_VALUE **pval, const ASN1_ITEM *it); BIO *OCSP_REQ_CTX_get0_mem_bio(OCSP_REQ_CTX *rctx); -int OCSP_REQ_CTX_i2d(OCSP_REQ_CTX *rctx, const ASN1_ITEM *it, - ASN1_VALUE *val); int OCSP_REQ_CTX_http(OCSP_REQ_CTX *rctx, const char *op, const char *path); int OCSP_REQ_CTX_set1_req(OCSP_REQ_CTX *rctx, OCSP_REQUEST *req); int OCSP_REQ_CTX_add1_header(OCSP_REQ_CTX *rctx, @@ -210,6 +191,10 @@ int OCSP_response_status(OCSP_RESPONSE *resp); OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp); const ASN1_OCTET_STRING *OCSP_resp_get0_signature(const OCSP_BASICRESP *bs); +const X509_ALGOR *OCSP_resp_get0_tbs_sigalg(const OCSP_BASICRESP *bs); +const OCSP_RESPDATA *OCSP_resp_get0_respdata(const OCSP_BASICRESP *bs); +int OCSP_resp_get0_signer(OCSP_BASICRESP *bs, X509 **signer, + STACK_OF(X509) *extra_certs); int OCSP_resp_count(OCSP_BASICRESP *bs); OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx); diff --git a/external/openssl/include/win32/openssl/opensslconf.h b/external/openssl/include/win32/openssl/opensslconf.h index 7dd6aa21..b9f6a2dc 100644 --- a/external/openssl/include/win32/openssl/opensslconf.h +++ b/external/openssl/include/win32/openssl/opensslconf.h @@ -2,7 +2,7 @@ * WARNING: do not edit! * Generated by makefile from include\openssl\opensslconf.h.in * - * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -37,6 +37,9 @@ extern "C" { #ifndef OPENSSL_NO_ASAN # define OPENSSL_NO_ASAN #endif +#ifndef OPENSSL_NO_ASM +# define OPENSSL_NO_ASM +#endif #ifndef OPENSSL_NO_CRYPTO_MDEBUG # define OPENSSL_NO_CRYPTO_MDEBUG #endif @@ -99,12 +102,18 @@ extern "C" { * still won't see them if the library has been built to disable deprecated * functions. */ -#if defined(OPENSSL_NO_DEPRECATED) -# define DECLARE_DEPRECATED(f) -#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) -# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); -#else -# define DECLARE_DEPRECATED(f) f; +#ifndef DECLARE_DEPRECATED +# if defined(OPENSSL_NO_DEPRECATED) +# define DECLARE_DEPRECATED(f) +# else +# define DECLARE_DEPRECATED(f) f; +# ifdef __GNUC__ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0) +# undef DECLARE_DEPRECATED +# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated)); +# endif +# endif +# endif #endif #ifndef OPENSSL_FILE @@ -144,7 +153,7 @@ extern "C" { # define DEPRECATEDIN_0_9_8(f) #endif -#define OPENSSL_CPUID_OBJ + /* Generate 80386 code? */ #undef I386_ONLY diff --git a/external/openssl/include/win32/openssl/opensslv.h b/external/openssl/include/win32/openssl/opensslv.h index 2d54b69b..12483c6e 100644 --- a/external/openssl/include/win32/openssl/opensslv.h +++ b/external/openssl/include/win32/openssl/opensslv.h @@ -1,5 +1,5 @@ /* - * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -39,11 +39,11 @@ extern "C" { * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for * major minor fix final patch/beta) */ -# define OPENSSL_VERSION_NUMBER 0x1010003fL +# define OPENSSL_VERSION_NUMBER 0x101000cfL # ifdef OPENSSL_FIPS -# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0c-fips 10 Nov 2016" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0l-fips 10 Sep 2019" # else -# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0c 10 Nov 2016" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0l 10 Sep 2019" # endif /*- diff --git a/external/openssl/include/win32/openssl/pem.h b/external/openssl/include/win32/openssl/pem.h index 2375d635..f7ce3c61 100644 --- a/external/openssl/include/win32/openssl/pem.h +++ b/external/openssl/include/win32/openssl/pem.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -322,7 +322,8 @@ int PEM_SignUpdate(EVP_MD_CTX *ctx, unsigned char *d, unsigned int cnt); int PEM_SignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, unsigned int *siglen, EVP_PKEY *pkey); -int PEM_def_callback(char *buf, int num, int w, void *key); +/* The default pem_password_cb that's used internally */ +int PEM_def_callback(char *buf, int num, int rwflag, void *userdata); void PEM_proc_type(char *buf, int type); void PEM_dek_info(char *buf, const char *type, int len, char *str); diff --git a/external/openssl/include/win32/openssl/rsa.h b/external/openssl/include/win32/openssl/rsa.h index 4d6e9cc9..9c28329f 100644 --- a/external/openssl/include/win32/openssl/rsa.h +++ b/external/openssl/include/win32/openssl/rsa.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -374,7 +374,7 @@ void RSA_meth_free(RSA_METHOD *meth); RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth); const char *RSA_meth_get0_name(const RSA_METHOD *meth); int RSA_meth_set1_name(RSA_METHOD *meth, const char *name); -int RSA_meth_get_flags(RSA_METHOD *meth); +int RSA_meth_get_flags(const RSA_METHOD *meth); int RSA_meth_set_flags(RSA_METHOD *meth, int flags); void *RSA_meth_get0_app_data(const RSA_METHOD *meth); int RSA_meth_set0_app_data(RSA_METHOD *meth, void *app_data); @@ -407,9 +407,9 @@ int RSA_meth_set_priv_dec(RSA_METHOD *rsa, unsigned char *to, RSA *rsa, int padding)); int (*RSA_meth_get_mod_exp(const RSA_METHOD *meth)) - (BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx); + (BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx); int RSA_meth_set_mod_exp(RSA_METHOD *rsa, - int (*mod_exp) (BIGNUM *r0, const BIGNUM *I, RSA *rsa, + int (*mod_exp) (BIGNUM *r0, const BIGNUM *i, RSA *rsa, BN_CTX *ctx)); int (*RSA_meth_get_bn_mod_exp(const RSA_METHOD *meth)) (BIGNUM *r, const BIGNUM *a, const BIGNUM *p, @@ -468,6 +468,7 @@ int ERR_load_RSA_strings(void); # define RSA_F_PKEY_RSA_CTRL 143 # define RSA_F_PKEY_RSA_CTRL_STR 144 # define RSA_F_PKEY_RSA_SIGN 142 +# define RSA_F_PKEY_RSA_VERIFY 149 # define RSA_F_PKEY_RSA_VERIFYRECOVER 141 # define RSA_F_RSA_ALGOR_TO_MD 156 # define RSA_F_RSA_BUILTIN_KEYGEN 129 diff --git a/external/openssl/include/win32/openssl/seed.h b/external/openssl/include/win32/openssl/seed.h index bb97131d..de10b085 100644 --- a/external/openssl/include/win32/openssl/seed.h +++ b/external/openssl/include/win32/openssl/seed.h @@ -52,9 +52,7 @@ extern "C" { # endif # endif -# if !defined(NO_SYS_TYPES_H) -# include -# endif +# include # define SEED_BLOCK_SIZE 16 # define SEED_KEY_LENGTH 16 diff --git a/external/openssl/include/win32/openssl/srtp.h b/external/openssl/include/win32/openssl/srtp.h index 5ddfa46d..0b57c235 100644 --- a/external/openssl/include/win32/openssl/srtp.h +++ b/external/openssl/include/win32/openssl/srtp.h @@ -36,7 +36,7 @@ extern "C" { # ifndef OPENSSL_NO_SRTP __owur int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles); -__owur int SSL_set_tlsext_use_srtp(SSL *ctx, const char *profiles); +__owur int SSL_set_tlsext_use_srtp(SSL *ssl, const char *profiles); __owur STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl); __owur SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s); diff --git a/external/openssl/include/win32/openssl/ssl.h b/external/openssl/include/win32/openssl/ssl.h index 86ab9125..56e20562 100644 --- a/external/openssl/include/win32/openssl/ssl.h +++ b/external/openssl/include/win32/openssl/ssl.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -95,14 +95,14 @@ extern "C" { # define SSL_TXT_NULL "NULL" # define SSL_TXT_kRSA "kRSA" -# define SSL_TXT_kDHr "kDHr" -# define SSL_TXT_kDHd "kDHd" -# define SSL_TXT_kDH "kDH" +# define SSL_TXT_kDHr "kDHr"/* this cipher class has been removed */ +# define SSL_TXT_kDHd "kDHd"/* this cipher class has been removed */ +# define SSL_TXT_kDH "kDH"/* this cipher class has been removed */ # define SSL_TXT_kEDH "kEDH"/* alias for kDHE */ # define SSL_TXT_kDHE "kDHE" -# define SSL_TXT_kECDHr "kECDHr" -# define SSL_TXT_kECDHe "kECDHe" -# define SSL_TXT_kECDH "kECDH" +# define SSL_TXT_kECDHr "kECDHr"/* this cipher class has been removed */ +# define SSL_TXT_kECDHe "kECDHe"/* this cipher class has been removed */ +# define SSL_TXT_kECDH "kECDH"/* this cipher class has been removed */ # define SSL_TXT_kEECDH "kEECDH"/* alias for kECDHE */ # define SSL_TXT_kECDHE "kECDHE" # define SSL_TXT_kPSK "kPSK" @@ -114,8 +114,8 @@ extern "C" { # define SSL_TXT_aRSA "aRSA" # define SSL_TXT_aDSS "aDSS" -# define SSL_TXT_aDH "aDH" -# define SSL_TXT_aECDH "aECDH" +# define SSL_TXT_aDH "aDH"/* this cipher class has been removed */ +# define SSL_TXT_aECDH "aECDH"/* this cipher class has been removed */ # define SSL_TXT_aECDSA "aECDSA" # define SSL_TXT_aPSK "aPSK" # define SSL_TXT_aGOST94 "aGOST94" @@ -262,54 +262,33 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, const unsigned char *in, size_t inlen, int *al, void *parse_arg); +/* Typedef for verification callback */ +typedef int (*SSL_verify_cb)(int preverify_ok, X509_STORE_CTX *x509_ctx); + /* Allow initial connection to servers that don't support RI */ # define SSL_OP_LEGACY_SERVER_CONNECT 0x00000004U -/* Removed from OpenSSL 0.9.8q and 1.0.0c */ -/* Dead forever, see CVE-2010-4180. */ -# define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG 0x0U # define SSL_OP_TLSEXT_PADDING 0x00000010U -# define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER 0x0U # define SSL_OP_SAFARI_ECDHE_ECDSA_BUG 0x00000040U -/* Ancient SSLeay version, retained for compatibility */ -# define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0x0 -# define SSL_OP_TLS_D5_BUG 0x0U -/* Removed from OpenSSL 1.1.0 */ -# define SSL_OP_TLS_BLOCK_PADDING_BUG 0x0U - -/* Hasn't done anything since OpenSSL 0.9.7h, retained for compatibility */ -# define SSL_OP_MSIE_SSLV2_RSA_PADDING 0x0 -/* Refers to ancient SSLREF and SSLv2, retained for compatibility */ -# define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG 0x0 -/* Related to removed SSLv2 */ -# define SSL_OP_MICROSOFT_SESS_ID_BUG 0x0 -# define SSL_OP_NETSCAPE_CHALLENGE_BUG 0x0 /* * Disable SSL 3.0/TLS 1.0 CBC vulnerability workaround that was added in * OpenSSL 0.9.6d. Usually (depending on the application protocol) the * workaround is not needed. Unfortunately some broken SSL/TLS * implementations cannot handle it at all, which is why we include it in - * SSL_OP_ALL. + * SSL_OP_ALL. Added in 0.9.6e */ -/* added in 0.9.6e */ # define SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS 0x00000800U -/* - * SSL_OP_ALL: various bug workarounds that should be rather harmless. This - * used to be 0x000FFFFFL before 0.9.7. - */ -# define SSL_OP_ALL 0x80000BFFU - /* DTLS options */ -# define SSL_OP_NO_QUERY_MTU 0x00001000U +# define SSL_OP_NO_QUERY_MTU 0x00001000U /* Turn on Cookie Exchange (on relevant for servers) */ -# define SSL_OP_COOKIE_EXCHANGE 0x00002000U +# define SSL_OP_COOKIE_EXCHANGE 0x00002000U /* Don't use RFC4507 ticket extension */ -# define SSL_OP_NO_TICKET 0x00004000U +# define SSL_OP_NO_TICKET 0x00004000U # ifndef OPENSSL_NO_DTLS1_METHOD /* Use Cisco's "speshul" version of DTLS_BAD_VER * (only with deprecated DTLSv1_client_method()) */ -# define SSL_OP_CISCO_ANYCONNECT 0x00008000U +# define SSL_OP_CISCO_ANYCONNECT 0x00008000U # endif /* As server, disallow session resumption on renegotiation */ @@ -318,12 +297,8 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, # define SSL_OP_NO_COMPRESSION 0x00020000U /* Permit unsafe legacy renegotiation */ # define SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION 0x00040000U -/* Does nothing: retained for compatibility */ -# define SSL_OP_SINGLE_ECDH_USE 0x0 -/* Does nothing: retained for compatibility */ -# define SSL_OP_SINGLE_DH_USE 0x0 -/* Does nothing: retained for compatibility */ -# define SSL_OP_EPHEMERAL_RSA 0x0 +/* Disable encrypt-then-mac */ +# define SSL_OP_NO_ENCRYPT_THEN_MAC 0x00080000U /* * Set on servers to choose the cipher according to the server's preferences */ @@ -336,7 +311,6 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, */ # define SSL_OP_TLS_ROLLBACK_BUG 0x00800000U -# define SSL_OP_NO_SSLv2 0x00000000U # define SSL_OP_NO_SSLv3 0x02000000U # define SSL_OP_NO_TLSv1 0x04000000U # define SSL_OP_NO_TLSv1_2 0x08000000U @@ -349,12 +323,9 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, SSL_OP_NO_TLSv1|SSL_OP_NO_TLSv1_1|SSL_OP_NO_TLSv1_2) # define SSL_OP_NO_DTLS_MASK (SSL_OP_NO_DTLSv1|SSL_OP_NO_DTLSv1_2) +/* Disallow all renegotiation */ +# define SSL_OP_NO_RENEGOTIATION 0x40000000U -/* Removed from previous versions */ -# define SSL_OP_PKCS1_CHECK_1 0x0 -# define SSL_OP_PKCS1_CHECK_2 0x0 -# define SSL_OP_NETSCAPE_CA_DN_BUG 0x0 -# define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x0U /* * Make server add server-hello extension from early version of cryptopro * draft, when GOST ciphersuite is negotiated. Required for interoperability @@ -362,6 +333,59 @@ typedef int (*custom_ext_parse_cb) (SSL *s, unsigned int ext_type, */ # define SSL_OP_CRYPTOPRO_TLSEXT_BUG 0x80000000U +/* + * SSL_OP_ALL: various bug workarounds that should be rather harmless. + * This used to be 0x000FFFFFL before 0.9.7. + * This used to be 0x80000BFFU before 1.1.1. + */ +# define SSL_OP_ALL (SSL_OP_CRYPTOPRO_TLSEXT_BUG|\ + SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS|\ + SSL_OP_LEGACY_SERVER_CONNECT|\ + SSL_OP_TLSEXT_PADDING|\ + SSL_OP_SAFARI_ECDHE_ECDSA_BUG) + +/* OBSOLETE OPTIONS: retained for compatibility */ + +/* Removed from OpenSSL 1.1.0. Was 0x00000001L */ +/* Related to removed SSLv2. */ +# define SSL_OP_MICROSOFT_SESS_ID_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000002L */ +/* Related to removed SSLv2. */ +# define SSL_OP_NETSCAPE_CHALLENGE_BUG 0x0 +/* Removed from OpenSSL 0.9.8q and 1.0.0c. Was 0x00000008L */ +/* Dead forever, see CVE-2010-4180 */ +# define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG 0x0 +/* Removed from OpenSSL 1.0.1h and 1.0.2. Was 0x00000010L */ +/* Refers to ancient SSLREF and SSLv2. */ +# define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000020 */ +# define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER 0x0 +/* Removed from OpenSSL 0.9.7h and 0.9.8b. Was 0x00000040L */ +# define SSL_OP_MSIE_SSLV2_RSA_PADDING 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000080 */ +/* Ancient SSLeay version. */ +# define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000100L */ +# define SSL_OP_TLS_D5_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00000200L */ +# define SSL_OP_TLS_BLOCK_PADDING_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00080000L */ +# define SSL_OP_SINGLE_ECDH_USE 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x00100000L */ +# define SSL_OP_SINGLE_DH_USE 0x0 +/* Removed from OpenSSL 1.0.1k and 1.0.2. Was 0x00200000L */ +# define SSL_OP_EPHEMERAL_RSA 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x01000000L */ +# define SSL_OP_NO_SSLv2 0x0 +/* Removed from OpenSSL 1.0.1. Was 0x08000000L */ +# define SSL_OP_PKCS1_CHECK_1 0x0 +/* Removed from OpenSSL 1.0.1. Was 0x10000000L */ +# define SSL_OP_PKCS1_CHECK_2 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x20000000L */ +# define SSL_OP_NETSCAPE_CA_DN_BUG 0x0 +/* Removed from OpenSSL 1.1.0. Was 0x40000000L */ +# define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x0 + /* * Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success * when just a single record has been written): @@ -943,8 +967,8 @@ size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count); # define SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02 # define SSL_VERIFY_CLIENT_ONCE 0x04 -# define OpenSSL_add_ssl_algorithms() SSL_library_init() # if OPENSSL_API_COMPAT < 0x10100000L +# define OpenSSL_add_ssl_algorithms() SSL_library_init() # define SSLeay_add_ssl_algorithms() SSL_library_init() # endif @@ -1139,6 +1163,8 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) # define SSL_CTRL_GET_TLSEXT_STATUS_REQ_TYPE 127 # define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB 128 # define SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG 129 +# define SSL_CTRL_GET_MIN_PROTO_VERSION 130 +# define SSL_CTRL_GET_MAX_PROTO_VERSION 131 # define SSL_CERT_SET_FIRST 1 # define SSL_CERT_SET_NEXT 2 # define SSL_CERT_SET_SERVER 3 @@ -1241,7 +1267,7 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) # define SSL_CTX_set1_sigalgs_list(ctx, s) \ SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)s) # define SSL_set1_sigalgs(ctx, slist, slistlen) \ - SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS,clistlen,(int *)slist) + SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS,slistlen,(int *)slist) # define SSL_set1_sigalgs_list(ctx, s) \ SSL_ctrl(ctx,SSL_CTRL_SET_SIGALGS_LIST,0,(char *)s) # define SSL_CTX_set1_client_sigalgs(ctx, slist, slistlen) \ @@ -1270,10 +1296,18 @@ DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION) SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MIN_PROTO_VERSION, version, NULL) #define SSL_CTX_set_max_proto_version(ctx, version) \ SSL_CTX_ctrl(ctx, SSL_CTRL_SET_MAX_PROTO_VERSION, version, NULL) +#define SSL_CTX_get_min_proto_version(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MIN_PROTO_VERSION, 0, NULL) +#define SSL_CTX_get_max_proto_version(ctx) \ + SSL_CTX_ctrl(ctx, SSL_CTRL_GET_MAX_PROTO_VERSION, 0, NULL) #define SSL_set_min_proto_version(s, version) \ SSL_ctrl(s, SSL_CTRL_SET_MIN_PROTO_VERSION, version, NULL) #define SSL_set_max_proto_version(s, version) \ SSL_ctrl(s, SSL_CTRL_SET_MAX_PROTO_VERSION, version, NULL) +#define SSL_get_min_proto_version(s) \ + SSL_ctrl(s, SSL_CTRL_GET_MIN_PROTO_VERSION, 0, NULL) +#define SSL_get_max_proto_version(s) \ + SSL_ctrl(s, SSL_CTRL_GET_MAX_PROTO_VERSION, 0, NULL) #if OPENSSL_API_COMPAT < 0x10100000L /* Provide some compatibility macros for removed functionality. */ @@ -1324,7 +1358,7 @@ __owur int SSL_get_fd(const SSL *s); __owur int SSL_get_rfd(const SSL *s); __owur int SSL_get_wfd(const SSL *s); __owur const char *SSL_get_cipher_list(const SSL *s, int n); -__owur char *SSL_get_shared_ciphers(const SSL *s, char *buf, int len); +__owur char *SSL_get_shared_ciphers(const SSL *s, char *buf, int size); __owur int SSL_get_read_ahead(const SSL *s); __owur int SSL_pending(const SSL *s); __owur int SSL_has_pending(const SSL *s); @@ -1342,9 +1376,8 @@ __owur int SSL_set_cipher_list(SSL *s, const char *str); void SSL_set_read_ahead(SSL *s, int yes); __owur int SSL_get_verify_mode(const SSL *s); __owur int SSL_get_verify_depth(const SSL *s); -__owur int (*SSL_get_verify_callback(const SSL *s)) (int, X509_STORE_CTX *); -void SSL_set_verify(SSL *s, int mode, - int (*callback) (int ok, X509_STORE_CTX *ctx)); +__owur SSL_verify_cb SSL_get_verify_callback(const SSL *s); +void SSL_set_verify(SSL *s, int mode, SSL_verify_cb callback); void SSL_set_verify_depth(SSL *s, int depth); void SSL_set_cert_cb(SSL *s, int (*cb) (SSL *ssl, void *arg), void *arg); # ifndef OPENSSL_NO_RSA @@ -1426,7 +1459,7 @@ int SSL_SESSION_up_ref(SSL_SESSION *ses); void SSL_SESSION_free(SSL_SESSION *ses); __owur int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp); __owur int SSL_set_session(SSL *to, SSL_SESSION *session); -__owur int SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c); +int SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c); int SSL_CTX_remove_session(SSL_CTX *, SSL_SESSION *c); __owur int SSL_CTX_set_generate_session_id(SSL_CTX *, GEN_SESSION_CB); __owur int SSL_set_generate_session_id(SSL *, GEN_SESSION_CB); @@ -1443,10 +1476,8 @@ __owur STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *s); __owur int SSL_CTX_get_verify_mode(const SSL_CTX *ctx); __owur int SSL_CTX_get_verify_depth(const SSL_CTX *ctx); -__owur int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx)) (int, - X509_STORE_CTX *); -void SSL_CTX_set_verify(SSL_CTX *ctx, int mode, - int (*callback) (int, X509_STORE_CTX *)); +__owur SSL_verify_cb SSL_CTX_get_verify_callback(const SSL_CTX *ctx); +void SSL_CTX_set_verify(SSL_CTX *ctx, int mode, SSL_verify_cb callback); void SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth); void SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx, int (*cb) (X509_STORE_CTX *, void *), @@ -1501,7 +1532,7 @@ __owur int SSL_CTX_dane_mtype_set(SSL_CTX *ctx, const EVP_MD *md, uint8_t mtype, uint8_t ord); __owur int SSL_dane_enable(SSL *s, const char *basedomain); __owur int SSL_dane_tlsa_add(SSL *s, uint8_t usage, uint8_t selector, - uint8_t mtype, unsigned char *data, size_t dlen); + uint8_t mtype, unsigned const char *data, size_t dlen); __owur int SSL_get0_dane_authority(SSL *s, X509 **mcert, EVP_PKEY **mspki); __owur int SSL_get0_dane_tlsa(SSL *s, uint8_t *usage, uint8_t *selector, uint8_t *mtype, unsigned const char **data, @@ -1777,6 +1808,8 @@ void SSL_set_tmp_dh_callback(SSL *ssl, __owur const COMP_METHOD *SSL_get_current_compression(SSL *s); __owur const COMP_METHOD *SSL_get_current_expansion(SSL *s); __owur const char *SSL_COMP_get_name(const COMP_METHOD *comp); +__owur const char *SSL_COMP_get0_name(const SSL_COMP *comp); +__owur int SSL_COMP_get_id(const SSL_COMP *comp); STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void); __owur STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP) *meths); @@ -1814,7 +1847,7 @@ void SSL_set_not_resumable_session_callback(SSL *ssl, # endif __owur int SSL_session_reused(SSL *s); -__owur int SSL_is_server(SSL *s); +__owur int SSL_is_server(const SSL *s); __owur __owur SSL_CONF_CTX *SSL_CONF_CTX_new(void); int SSL_CONF_CTX_finish(SSL_CONF_CTX *cctx); @@ -2077,6 +2110,7 @@ int ERR_load_SSL_strings(void); # define SSL_F_DTLS_CONSTRUCT_HELLO_VERIFY_REQUEST 385 # define SSL_F_DTLS_GET_REASSEMBLED_MESSAGE 370 # define SSL_F_DTLS_PROCESS_HELLO_VERIFY 386 +# define SSL_F_DTLS_WAIT_FOR_DRY 592 # define SSL_F_OPENSSL_INIT_SSL 342 # define SSL_F_OSSL_STATEM_CLIENT_READ_TRANSITION 417 # define SSL_F_OSSL_STATEM_SERVER_READ_TRANSITION 418 @@ -2098,6 +2132,7 @@ int ERR_load_SSL_strings(void); # define SSL_F_SSL3_SETUP_KEY_BLOCK 157 # define SSL_F_SSL3_SETUP_READ_BUFFER 156 # define SSL_F_SSL3_SETUP_WRITE_BUFFER 291 +# define SSL_F_SSL3_TAKE_MAC 425 # define SSL_F_SSL3_WRITE_BYTES 158 # define SSL_F_SSL3_WRITE_PENDING 159 # define SSL_F_SSL_ADD_CERT_CHAIN 316 @@ -2171,6 +2206,8 @@ int ERR_load_SSL_strings(void); # define SSL_F_SSL_PARSE_SERVERHELLO_USE_SRTP_EXT 311 # define SSL_F_SSL_PEEK 270 # define SSL_F_SSL_READ 223 +# define SSL_F_SSL_RENEGOTIATE 516 +# define SSL_F_SSL_RENEGOTIATE_ABBREVIATED 546 # define SSL_F_SSL_SCAN_CLIENTHELLO_TLSEXT 320 # define SSL_F_SSL_SCAN_SERVERHELLO_TLSEXT 321 # define SSL_F_SSL_SESSION_DUP 348 @@ -2344,6 +2381,7 @@ int ERR_load_SSL_strings(void); # define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 150 # define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 151 # define SSL_R_ERROR_SETTING_TLSA_BASE_DOMAIN 204 +# define SSL_R_EXCEEDS_MAX_FRAGMENT_SIZE 194 # define SSL_R_EXCESSIVE_MESSAGE_SIZE 152 # define SSL_R_EXTRA_DATA_IN_MESSAGE 153 # define SSL_R_FAILED_TO_INIT_ASYNC 405 diff --git a/external/openssl/include/win32/openssl/ssl3.h b/external/openssl/include/win32/openssl/ssl3.h index aca19223..115940ad 100644 --- a/external/openssl/include/win32/openssl/ssl3.h +++ b/external/openssl/include/win32/openssl/ssl3.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -252,9 +252,15 @@ extern "C" { # define SSL3_CT_FORTEZZA_DMS 20 /* * SSL3_CT_NUMBER is used to size arrays and it must be large enough to - * contain all of the cert types defined either for SSLv3 and TLSv1. + * contain all of the cert types defined for *either* SSLv3 and TLSv1. */ -# define SSL3_CT_NUMBER 9 +# define SSL3_CT_NUMBER 10 + +# if defined(TLS_CT_NUMBER) +# if TLS_CT_NUMBER != SSL3_CT_NUMBER +# error "SSL/TLS CT_NUMBER values do not match" +# endif +# endif # define SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS 0x0001 @@ -264,11 +270,14 @@ extern "C" { # define TLS1_FLAGS_SKIP_CERT_VERIFY 0x0010 /* Set if we encrypt then mac instead of usual mac then encrypt */ -# define TLS1_FLAGS_ENCRYPT_THEN_MAC 0x0100 +# define TLS1_FLAGS_ENCRYPT_THEN_MAC_READ 0x0100 +# define TLS1_FLAGS_ENCRYPT_THEN_MAC TLS1_FLAGS_ENCRYPT_THEN_MAC_READ /* Set if extended master secret extension received from peer */ # define TLS1_FLAGS_RECEIVED_EXTMS 0x0200 +# define TLS1_FLAGS_ENCRYPT_THEN_MAC_WRITE 0x0400 + # define SSL3_MT_HELLO_REQUEST 0 # define SSL3_MT_CLIENT_HELLO 1 # define SSL3_MT_SERVER_HELLO 2 diff --git a/external/openssl/include/win32/openssl/symhacks.h b/external/openssl/include/win32/openssl/symhacks.h index caf1f1a7..156ea6e4 100644 --- a/external/openssl/include/win32/openssl/symhacks.h +++ b/external/openssl/include/win32/openssl/symhacks.h @@ -1,5 +1,5 @@ /* - * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -28,21 +28,6 @@ # undef i2d_ECPKPARAMETERS # define i2d_ECPKPARAMETERS i2d_UC_ECPKPARAMETERS -/* - * These functions do not seem to exist! However, I'm paranoid... Original - * command in x509v3.h: These functions are being redefined in another - * directory, and clash when the linker is case-insensitive, so let's hide - * them a little, by giving them an extra 'o' at the beginning of the name... - */ -# undef X509v3_cleanup_extensions -# define X509v3_cleanup_extensions oX509v3_cleanup_extensions -# undef X509v3_add_extension -# define X509v3_add_extension oX509v3_add_extension -# undef X509v3_add_netscape_extensions -# define X509v3_add_netscape_extensions oX509v3_add_netscape_extensions -# undef X509v3_add_standard_extensions -# define X509v3_add_standard_extensions oX509v3_add_standard_extensions - /* This one clashes with CMS_data_create */ # undef cms_Data_create # define cms_Data_create priv_cms_Data_create diff --git a/external/openssl/include/win32/openssl/tls1.h b/external/openssl/include/win32/openssl/tls1.h index 23e382cd..732e87ab 100644 --- a/external/openssl/include/win32/openssl/tls1.h +++ b/external/openssl/include/win32/openssl/tls1.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -226,12 +226,12 @@ __owur int SSL_get_servername_type(const SSL *s); * as specified in RFC 5705. It writes |olen| bytes to |out| given a label and * optional context. (Since a zero length context is allowed, the |use_context| * flag controls whether a context is included.) It returns 1 on success and - * zero otherwise. + * 0 or -1 otherwise. */ __owur int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen, - const char *label, size_t llen, - const unsigned char *p, size_t plen, - int use_context); + const char *label, size_t llen, + const unsigned char *context, + size_t contextlen, int use_context); int SSL_get_sigalgs(SSL *s, int idx, int *psign, int *phash, int *psignandhash, @@ -298,9 +298,9 @@ SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB,0, (void (**)(void))cb) SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB,(void (*)(void))cb) # define SSL_CTX_get_tlsext_status_arg(ssl, arg) \ -SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg + SSL_CTX_ctrl(ssl,SSL_CTRL_GET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg) # define SSL_CTX_set_tlsext_status_arg(ssl, arg) \ -SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg) + SSL_CTX_ctrl(ssl,SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG,0, (void *)arg) #define SSL_CTX_set_tlsext_status_type(ssl, type) \ SSL_CTX_ctrl(ssl, SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE, type, NULL) @@ -883,7 +883,13 @@ SSL_CTX_callback_ctrl(ssl,SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB,(void (*)(void))cb) * when correcting this number, correct also SSL3_CT_NUMBER in ssl3.h (see * comment there) */ -# define TLS_CT_NUMBER 9 +# define TLS_CT_NUMBER 10 + +# if defined(SSL3_CT_NUMBER) +# if TLS_CT_NUMBER != SSL3_CT_NUMBER +# error "SSL/TLS CT_NUMBER values do not match" +# endif +# endif # define TLS1_FINISH_MAC_LENGTH 12 diff --git a/external/openssl/include/win32/openssl/ui.h b/external/openssl/include/win32/openssl/ui.h index 26f4f044..49e763de 100644 --- a/external/openssl/include/win32/openssl/ui.h +++ b/external/openssl/include/win32/openssl/ui.h @@ -339,8 +339,12 @@ int ERR_load_UI_strings(void); /* Error codes for the UI functions. */ /* Function codes. */ +# define UI_F_CLOSE_CONSOLE 115 +# define UI_F_ECHO_CONSOLE 116 # define UI_F_GENERAL_ALLOCATE_BOOLEAN 108 # define UI_F_GENERAL_ALLOCATE_PROMPT 109 +# define UI_F_NOECHO_CONSOLE 117 +# define UI_F_OPEN_CONSOLE 114 # define UI_F_UI_CREATE_METHOD 112 # define UI_F_UI_CTRL 111 # define UI_F_UI_DUP_ERROR_STRING 101 @@ -350,6 +354,7 @@ int ERR_load_UI_strings(void); # define UI_F_UI_DUP_VERIFY_STRING 106 # define UI_F_UI_GET0_RESULT 107 # define UI_F_UI_NEW_METHOD 104 +# define UI_F_UI_PROCESS 113 # define UI_F_UI_SET_RESULT 105 /* Reason codes. */ @@ -357,9 +362,14 @@ int ERR_load_UI_strings(void); # define UI_R_INDEX_TOO_LARGE 102 # define UI_R_INDEX_TOO_SMALL 103 # define UI_R_NO_RESULT_BUFFER 105 +# define UI_R_PROCESSING_ERROR 107 # define UI_R_RESULT_TOO_LARGE 100 # define UI_R_RESULT_TOO_SMALL 101 +# define UI_R_SYSASSIGN_ERROR 109 +# define UI_R_SYSDASSGN_ERROR 110 +# define UI_R_SYSQIOW_ERROR 111 # define UI_R_UNKNOWN_CONTROL_COMMAND 106 +# define UI_R_UNKNOWN_TTYGET_ERRNO_VALUE 108 # ifdef __cplusplus } diff --git a/external/openssl/include/win32/openssl/x509.h b/external/openssl/include/win32/openssl/x509.h index c8996f35..916afaf7 100644 --- a/external/openssl/include/win32/openssl/x509.h +++ b/external/openssl/include/win32/openssl/x509.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -641,7 +641,7 @@ int X509_get_signature_type(const X509 *x); /* * This one is only used so that a binary form can output, as in - * i2d_X509_NAME(X509_get_X509_PUBKEY(x),&buf) + * i2d_X509_NAME(X509_get_X509_PUBKEY(x), &buf) */ X509_PUBKEY *X509_get_X509_PUBKEY(const X509 *x); const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x); @@ -1055,6 +1055,7 @@ int ERR_load_X509_strings(void); # define X509_F_X509_LOAD_CERT_CRL_FILE 132 # define X509_F_X509_LOAD_CERT_FILE 111 # define X509_F_X509_LOAD_CRL_FILE 112 +# define X509_F_X509_LOOKUP_METH_NEW 160 # define X509_F_X509_NAME_ADD_ENTRY 113 # define X509_F_X509_NAME_ENTRY_CREATE_BY_NID 114 # define X509_F_X509_NAME_ENTRY_CREATE_BY_TXT 131 @@ -1091,6 +1092,7 @@ int ERR_load_X509_strings(void); # define X509_R_CRL_ALREADY_DELTA 127 # define X509_R_CRL_VERIFY_FAILURE 131 # define X509_R_IDP_MISMATCH 128 +# define X509_R_INVALID_ATTRIBUTES 135 # define X509_R_INVALID_DIRECTORY 113 # define X509_R_INVALID_FIELD_NAME 119 # define X509_R_INVALID_TRUST 123 diff --git a/external/openssl/include/win32/openssl/x509_vfy.h b/external/openssl/include/win32/openssl/x509_vfy.h index cab8005e..131b6cf7 100644 --- a/external/openssl/include/win32/openssl/x509_vfy.h +++ b/external/openssl/include/win32/openssl/x509_vfy.h @@ -1,5 +1,5 @@ /* - * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -257,7 +257,9 @@ X509_OBJECT *X509_OBJECT_new(void); void X509_OBJECT_free(X509_OBJECT *a); X509_LOOKUP_TYPE X509_OBJECT_get_type(const X509_OBJECT *a); X509 *X509_OBJECT_get0_X509(const X509_OBJECT *a); +int X509_OBJECT_set1_X509(X509_OBJECT *a, X509 *obj); X509_CRL *X509_OBJECT_get0_X509_CRL(X509_OBJECT *a); +int X509_OBJECT_set1_X509_CRL(X509_OBJECT *a, X509_CRL *obj); X509_STORE *X509_STORE_new(void); void X509_STORE_free(X509_STORE *v); int X509_STORE_lock(X509_STORE *ctx); @@ -364,6 +366,76 @@ X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m); X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void); X509_LOOKUP_METHOD *X509_LOOKUP_file(void); +typedef int (*X509_LOOKUP_ctrl_fn)(X509_LOOKUP *ctx, int cmd, const char *argc, + long argl, char **ret); +typedef int (*X509_LOOKUP_get_by_subject_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + X509_NAME *name, + X509_OBJECT *ret); +typedef int (*X509_LOOKUP_get_by_issuer_serial_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + X509_NAME *name, + ASN1_INTEGER *serial, + X509_OBJECT *ret); +typedef int (*X509_LOOKUP_get_by_fingerprint_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + const unsigned char* bytes, + int len, + X509_OBJECT *ret); +typedef int (*X509_LOOKUP_get_by_alias_fn)(X509_LOOKUP *ctx, + X509_LOOKUP_TYPE type, + const char *str, + int len, + X509_OBJECT *ret); + +X509_LOOKUP_METHOD *X509_LOOKUP_meth_new(const char *name); +void X509_LOOKUP_meth_free(X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_new_item(X509_LOOKUP_METHOD *method, + int (*new_item) (X509_LOOKUP *ctx)); +int (*X509_LOOKUP_meth_get_new_item(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_free(X509_LOOKUP_METHOD *method, + void (*free_fn) (X509_LOOKUP *ctx)); +void (*X509_LOOKUP_meth_get_free(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_init(X509_LOOKUP_METHOD *method, + int (*init) (X509_LOOKUP *ctx)); +int (*X509_LOOKUP_meth_get_init(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_shutdown(X509_LOOKUP_METHOD *method, + int (*shutdown) (X509_LOOKUP *ctx)); +int (*X509_LOOKUP_meth_get_shutdown(const X509_LOOKUP_METHOD* method)) + (X509_LOOKUP *ctx); + +int X509_LOOKUP_meth_set_ctrl(X509_LOOKUP_METHOD *method, + X509_LOOKUP_ctrl_fn ctrl_fn); +X509_LOOKUP_ctrl_fn X509_LOOKUP_meth_get_ctrl(const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_subject(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_subject_fn fn); +X509_LOOKUP_get_by_subject_fn X509_LOOKUP_meth_get_get_by_subject( + const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_issuer_serial(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_issuer_serial_fn fn); +X509_LOOKUP_get_by_issuer_serial_fn X509_LOOKUP_meth_get_get_by_issuer_serial( + const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_fingerprint(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_fingerprint_fn fn); +X509_LOOKUP_get_by_fingerprint_fn X509_LOOKUP_meth_get_get_by_fingerprint( + const X509_LOOKUP_METHOD *method); + +int X509_LOOKUP_meth_set_get_by_alias(X509_LOOKUP_METHOD *method, + X509_LOOKUP_get_by_alias_fn fn); +X509_LOOKUP_get_by_alias_fn X509_LOOKUP_meth_get_get_by_alias( + const X509_LOOKUP_METHOD *method); + + int X509_STORE_add_cert(X509_STORE *ctx, X509 *x); int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x); @@ -393,6 +465,9 @@ int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, X509_OBJECT *ret); int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type, const char *str, int len, X509_OBJECT *ret); +int X509_LOOKUP_set_method_data(X509_LOOKUP *ctx, void *data); +void *X509_LOOKUP_get_method_data(const X509_LOOKUP *ctx); +X509_STORE *X509_LOOKUP_get_store(const X509_LOOKUP *ctx); int X509_LOOKUP_shutdown(X509_LOOKUP *ctx); int X509_STORE_load_locations(X509_STORE *ctx, @@ -458,18 +533,24 @@ int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose); int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust); void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth); void X509_VERIFY_PARAM_set_auth_level(X509_VERIFY_PARAM *param, int auth_level); +time_t X509_VERIFY_PARAM_get_time(const X509_VERIFY_PARAM *param); void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t); int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param, ASN1_OBJECT *policy); int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param, STACK_OF(ASN1_OBJECT) *policies); +int X509_VERIFY_PARAM_set_inh_flags(X509_VERIFY_PARAM *param, + uint32_t flags); +uint32_t X509_VERIFY_PARAM_get_inh_flags(const X509_VERIFY_PARAM *param); + int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param, const char *name, size_t namelen); int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param, const char *name, size_t namelen); void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param, unsigned int flags); +unsigned int X509_VERIFY_PARAM_get_hostflags(const X509_VERIFY_PARAM *param); char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *); void X509_VERIFY_PARAM_move_peername(X509_VERIFY_PARAM *, X509_VERIFY_PARAM *); int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param, diff --git a/external/openssl/include/win32/openssl/x509v3.h b/external/openssl/include/win32/openssl/x509v3.h index f21ce7c1..c93b112f 100644 --- a/external/openssl/include/win32/openssl/x509v3.h +++ b/external/openssl/include/win32/openssl/x509v3.h @@ -1,5 +1,5 @@ /* - * Copyright 1999-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -355,6 +355,7 @@ struct ISSUING_DIST_POINT_st { # define EXFLAG_SI 0x20 # define EXFLAG_V1 0x40 # define EXFLAG_INVALID 0x80 +/* EXFLAG_SET is set to indicate that some values have been precomputed */ # define EXFLAG_SET 0x100 # define EXFLAG_CRITICAL 0x200 # define EXFLAG_PROXY 0x400 @@ -657,6 +658,7 @@ uint32_t X509_get_extension_flags(X509 *x); uint32_t X509_get_key_usage(X509 *x); uint32_t X509_get_extended_key_usage(X509 *x); const ASN1_OCTET_STRING *X509_get0_subject_key_id(X509 *x); +const ASN1_OCTET_STRING *X509_get0_authority_key_id(X509 *x); int X509_PURPOSE_get_count(void); X509_PURPOSE *X509_PURPOSE_get0(int idx); @@ -875,6 +877,7 @@ int ERR_load_X509V3_strings(void); # define X509V3_F_ADDR_VALIDATE_PATH_INTERNAL 166 # define X509V3_F_ASIDENTIFIERCHOICE_CANONIZE 161 # define X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL 162 +# define X509V3_F_BIGNUM_TO_STRING 167 # define X509V3_F_COPY_EMAIL 122 # define X509V3_F_COPY_ISSUER 123 # define X509V3_F_DO_DIRNAME 144 diff --git a/external/openssl/prebuilt/android/arm64-v8a/libcrypto.a b/external/openssl/prebuilt/android/arm64-v8a/libcrypto.a index 778bc67d..c6795ae4 100644 Binary files a/external/openssl/prebuilt/android/arm64-v8a/libcrypto.a and b/external/openssl/prebuilt/android/arm64-v8a/libcrypto.a differ diff --git a/external/openssl/prebuilt/android/arm64-v8a/libssl.a b/external/openssl/prebuilt/android/arm64-v8a/libssl.a index 77878223..316384a0 100644 Binary files a/external/openssl/prebuilt/android/arm64-v8a/libssl.a and b/external/openssl/prebuilt/android/arm64-v8a/libssl.a differ diff --git a/external/openssl/prebuilt/android/armeabi-v7a/libcrypto.a b/external/openssl/prebuilt/android/armeabi-v7a/libcrypto.a index 4b7a9bb3..328dc8d5 100644 Binary files a/external/openssl/prebuilt/android/armeabi-v7a/libcrypto.a and b/external/openssl/prebuilt/android/armeabi-v7a/libcrypto.a differ diff --git a/external/openssl/prebuilt/android/armeabi-v7a/libssl.a b/external/openssl/prebuilt/android/armeabi-v7a/libssl.a index c1d16ab4..2a0f4b3e 100644 Binary files a/external/openssl/prebuilt/android/armeabi-v7a/libssl.a and b/external/openssl/prebuilt/android/armeabi-v7a/libssl.a differ diff --git a/external/openssl/prebuilt/android/x86/libcrypto.a b/external/openssl/prebuilt/android/x86/libcrypto.a index 65c57176..8c254616 100644 Binary files a/external/openssl/prebuilt/android/x86/libcrypto.a and b/external/openssl/prebuilt/android/x86/libcrypto.a differ diff --git a/external/openssl/prebuilt/android/x86/libssl.a b/external/openssl/prebuilt/android/x86/libssl.a index e71653b7..10cfed24 100644 Binary files a/external/openssl/prebuilt/android/x86/libssl.a and b/external/openssl/prebuilt/android/x86/libssl.a differ diff --git a/external/openssl/prebuilt/ios/libcrypto.a b/external/openssl/prebuilt/ios/libcrypto.a index 69bdc7d4..156eb5e4 100644 Binary files a/external/openssl/prebuilt/ios/libcrypto.a and b/external/openssl/prebuilt/ios/libcrypto.a differ diff --git a/external/openssl/prebuilt/ios/libssl.a b/external/openssl/prebuilt/ios/libssl.a index 3105806a..7c788ee8 100644 Binary files a/external/openssl/prebuilt/ios/libssl.a and b/external/openssl/prebuilt/ios/libssl.a differ diff --git a/external/openssl/prebuilt/linux/64-bit/libcrypto.a b/external/openssl/prebuilt/linux/64-bit/libcrypto.a index 380fe7a4..0d88e66e 100644 Binary files a/external/openssl/prebuilt/linux/64-bit/libcrypto.a and b/external/openssl/prebuilt/linux/64-bit/libcrypto.a differ diff --git a/external/openssl/prebuilt/linux/64-bit/libssl.a b/external/openssl/prebuilt/linux/64-bit/libssl.a index dd6acdda..ffea4c11 100644 Binary files a/external/openssl/prebuilt/linux/64-bit/libssl.a and b/external/openssl/prebuilt/linux/64-bit/libssl.a differ diff --git a/external/openssl/prebuilt/mac/libcrypto.a b/external/openssl/prebuilt/mac/libcrypto.a index 1078caac..0d88387e 100644 Binary files a/external/openssl/prebuilt/mac/libcrypto.a and b/external/openssl/prebuilt/mac/libcrypto.a differ diff --git a/external/openssl/prebuilt/mac/libssl.a b/external/openssl/prebuilt/mac/libssl.a index feabaabe..91547bf9 100644 Binary files a/external/openssl/prebuilt/mac/libssl.a and b/external/openssl/prebuilt/mac/libssl.a differ diff --git a/external/openssl/prebuilt/win32/libcrypto-1_1.dll b/external/openssl/prebuilt/win32/libcrypto-1_1.dll index 42067611..cd4a27be 100644 Binary files a/external/openssl/prebuilt/win32/libcrypto-1_1.dll and b/external/openssl/prebuilt/win32/libcrypto-1_1.dll differ diff --git a/external/openssl/prebuilt/win32/libcrypto.lib b/external/openssl/prebuilt/win32/libcrypto.lib index 10cd1a62..fd82fcb2 100644 Binary files a/external/openssl/prebuilt/win32/libcrypto.lib and b/external/openssl/prebuilt/win32/libcrypto.lib differ diff --git a/external/openssl/prebuilt/win32/libssl-1_1.dll b/external/openssl/prebuilt/win32/libssl-1_1.dll index 9165579f..817078c1 100644 Binary files a/external/openssl/prebuilt/win32/libssl-1_1.dll and b/external/openssl/prebuilt/win32/libssl-1_1.dll differ diff --git a/external/openssl/prebuilt/win32/libssl.lib b/external/openssl/prebuilt/win32/libssl.lib index 359aaa5d..d5f490e1 100644 Binary files a/external/openssl/prebuilt/win32/libssl.lib and b/external/openssl/prebuilt/win32/libssl.lib differ diff --git a/external/png/prebuilt/linux/64-bit/libpng.a b/external/png/prebuilt/linux/64-bit/libpng.a index 48173c73..44000d50 100644 Binary files a/external/png/prebuilt/linux/64-bit/libpng.a and b/external/png/prebuilt/linux/64-bit/libpng.a differ diff --git a/external/png/prebuilt/mac/libpng.a b/external/png/prebuilt/mac/libpng.a index cb61aa7d..d1220301 100644 Binary files a/external/png/prebuilt/mac/libpng.a and b/external/png/prebuilt/mac/libpng.a differ diff --git a/external/webp/prebuilt/mac/libwebp.a b/external/webp/prebuilt/mac/libwebp.a index 3acc3299..b44a0639 100644 Binary files a/external/webp/prebuilt/mac/libwebp.a and b/external/webp/prebuilt/mac/libwebp.a differ diff --git a/external/websockets/prebuilt/linux/64-bit/libwebsockets.a b/external/websockets/prebuilt/linux/64-bit/libwebsockets.a index 01816501..50e3bbd3 100644 Binary files a/external/websockets/prebuilt/linux/64-bit/libwebsockets.a and b/external/websockets/prebuilt/linux/64-bit/libwebsockets.a differ diff --git a/external/websockets/prebuilt/mac/libwebsockets.a b/external/websockets/prebuilt/mac/libwebsockets.a index 178bb105..3f9e7ba0 100644 Binary files a/external/websockets/prebuilt/mac/libwebsockets.a and b/external/websockets/prebuilt/mac/libwebsockets.a differ diff --git a/external/zlib/prebuilt/mac/libz.a b/external/zlib/prebuilt/mac/libz.a index 9dfea70c..51473519 100644 Binary files a/external/zlib/prebuilt/mac/libz.a and b/external/zlib/prebuilt/mac/libz.a differ diff --git a/install-deps-linux.sh b/install-deps-linux.sh index 50d319d9..46404e17 100755 --- a/install-deps-linux.sh +++ b/install-deps-linux.sh @@ -19,6 +19,7 @@ DEPENDS+=' libxi-dev' DEPENDS+=' libfontconfig1-dev' DEPENDS+=' libglew-dev' DEPENDS+=' libgtk-3-dev' +DEPENDS+=' libxxf86vm-dev' DEPENDS+=' binutils' sudo apt-get install --yes $DEPENDS diff --git a/templates/CMakeLists.txt b/templates/CMakeLists.txt index 4f043e2b..b6653a42 100644 --- a/templates/CMakeLists.txt +++ b/templates/CMakeLists.txt @@ -99,7 +99,6 @@ elseif(APPLE) ) set(APP_UI_RES ${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/Icon.icns - ${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/Info.plist ${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/ConsoleWindow.xib ) list(APPEND GAME_SOURCE @@ -134,12 +133,11 @@ if(APPLE) set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}") set_xcode_property(${APP_NAME} INSTALL_PATH "\${LOCAL_APPS_DIR}") # fix archive no file if(MACOSX) + set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)") + set_xcode_property(${APP_NAME} OTHER_LDFLAGS[arch=x86_64] "-pagezero_size 10000 -image_base 100000000 $(inherited)") set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${RUNTIME_SRC_ROOT}/proj.ios_mac/mac/Info.plist" ) - set_target_properties(${APP_NAME} PROPERTIES - LINK_FLAGS "-pagezero_size 10000 -image_base 100000000" - ) elseif(IOS) set_xcode_property(${APP_NAME} INFOPLIST_FILE "${RUNTIME_SRC_ROOT}/proj.ios_mac/ios/Info.plist") set_xcode_property(${APP_NAME} ASSETCATALOG_COMPILER_APPICON_NAME "AppIcon") diff --git a/templates/frameworks/runtime-src/proj.android/app/AndroidManifest.xml b/templates/frameworks/runtime-src/proj.android/app/AndroidManifest.xml index fe40e4e5..7f42ad97 100644 --- a/templates/frameworks/runtime-src/proj.android/app/AndroidManifest.xml +++ b/templates/frameworks/runtime-src/proj.android/app/AndroidManifest.xml @@ -7,7 +7,8 @@ diff --git a/templates/frameworks/runtime-src/proj.android/app/build.gradle b/templates/frameworks/runtime-src/proj.android/app/build.gradle index df8d39c1..371f891c 100644 --- a/templates/frameworks/runtime-src/proj.android/app/build.gradle +++ b/templates/frameworks/runtime-src/proj.android/app/build.gradle @@ -67,6 +67,8 @@ android { renderscriptDebuggable true } } + buildToolsVersion PROP_BUILD_TOOLS_VERSION + ndkVersion PROP_NDK_VERSION } android.applicationVariants.all { variant -> diff --git a/templates/frameworks/runtime-src/proj.android/build.gradle b/templates/frameworks/runtime-src/proj.android/build.gradle index 0b3e0602..6ad59ec4 100644 --- a/templates/frameworks/runtime-src/proj.android/build.gradle +++ b/templates/frameworks/runtime-src/proj.android/build.gradle @@ -4,11 +4,11 @@ buildscript { repositories { google() //jcenter() - maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'} + maven{ url 'https://maven.aliyun.com/nexus/content/groups/public/'} } dependencies { - classpath 'com.android.tools.build:gradle:4.1.0' + classpath 'com.android.tools.build:gradle:7.3.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -19,7 +19,7 @@ allprojects { repositories { google() // jcenter() - maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'} + maven{ url 'https://maven.aliyun.com/nexus/content/groups/public/'} } } diff --git a/templates/frameworks/runtime-src/proj.android/gradle.properties b/templates/frameworks/runtime-src/proj.android/gradle.properties index df277e66..0336df4b 100644 --- a/templates/frameworks/runtime-src/proj.android/gradle.properties +++ b/templates/frameworks/runtime-src/proj.android/gradle.properties @@ -26,12 +26,17 @@ PROP_MIN_SDK_VERSION=16 # Android SDK version that will be used as the latest version of android this application has been tested on PROP_TARGET_SDK_VERSION=28 +# buildToolsVersion +PROP_BUILD_TOOLS_VERSION=30.0.3 + +# ndkVersion +PROP_NDK_VERSION=20.1.5948944 # List of CPU Archtexture to build that application with # Available architextures (armeabi-v7a | arm64-v8a | x86) # To build for multiple architexture, use the `:` between them # Example - PROP_APP_ABI=armeabi-v7a:arm64-v8a:x86 -PROP_APP_ABI=armeabi-v7a +PROP_APP_ABI=arm64-v8a # uncomment it and fill in sign information for release mode #RELEASE_STORE_FILE=file path of keystore @@ -39,4 +44,6 @@ PROP_APP_ABI=armeabi-v7a #RELEASE_KEY_ALIAS=alias of key #RELEASE_KEY_PASSWORD=password of key -android.injected.testOnly=false \ No newline at end of file +android.injected.testOnly=false +android.useAndroidX=true +android.enableJetifier=true diff --git a/templates/frameworks/runtime-src/proj.android/gradle/wrapper/gradle-wrapper.properties b/templates/frameworks/runtime-src/proj.android/gradle/wrapper/gradle-wrapper.properties index ae7ee2bd..30d1b3ed 100644 --- a/templates/frameworks/runtime-src/proj.android/gradle/wrapper/gradle-wrapper.properties +++ b/templates/frameworks/runtime-src/proj.android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip diff --git a/templates/src/cocos/cocos2d/Cocos2d.lua b/templates/src/cocos/cocos2d/Cocos2d.lua index 1f59f6bb..f96e1fb4 100644 --- a/templates/src/cocos/cocos2d/Cocos2d.lua +++ b/templates/src/cocos/cocos2d/Cocos2d.lua @@ -477,73 +477,3 @@ end function cc.blendFunc(_src, _dst) return {src = _src, dst = _dst} end - -cc.mat4 = cc.mat4 or {} - -function cc.mat4.new(...) - local params = {...} - local size = #params - local obj = {} - - if 1 == size then - assert(type(params[1]) == "table" , "type of input params are wrong to new a mat4 when num of params is 1") - for i= 1, 16 do - if params[1][i] ~= nil then - obj[i] = params[1][i] - else - obj[i] = 0 - end - end - elseif 16 == size then - for i= 1, 16 do - obj[i] = params[i] - end - end - - setmetatable(obj, {__index = cc.mat4}) - - return obj -end - -function cc.mat4.getInversed(self) - return mat4_getInversed(self) -end - -function cc.mat4.transformVector(...) - return mat4_transformVector(...) -end - -function cc.mat4.multiply(self, mat) - return mat4_multiply(self, mat) -end - -function cc.mat4.decompose(self, scale, rotation, translation) - return mat4_decompose(self, scale ,rotation, translation) -end - -function cc.mat4.createIdentity() - return cc.mat4.new(1.0 ,0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.0, 1.0) -end - -function cc.mat4.translate(self,vec3) - return mat4_translate(self,vec3) -end - -function cc.mat4.createRotationZ(self,angle) - return mat4_createRotationZ(self,angle) -end - -function cc.mat4.setIdentity(self) - return mat4_setIdentity(self) -end - -function cc.mat4.createTranslation(...) - return mat4_createTranslation(...) -end - -function cc.mat4.createRotation(...) - return mat4_createRotation(...) -end diff --git a/templates/src/cocos/cocos2d/Cocos2dConstants.lua b/templates/src/cocos/cocos2d/Cocos2dConstants.lua index 4de70b01..7f5d022e 100644 --- a/templates/src/cocos/cocos2d/Cocos2dConstants.lua +++ b/templates/src/cocos/cocos2d/Cocos2dConstants.lua @@ -208,188 +208,189 @@ cc.LabelOverflow = CLAMP = 1, SHRINK = 2, RESIZE_HEIGHT = 3 -}; +} +-- Mouse +cc.MouseButton = { + BUTTON_UNSET = -1, + BUTTON_LEFT = 0, + BUTTON_RIGHT = 1, + BUTTON_MIDDLE = 2, + BUTTON_4 = 3, + BUTTON_5 = 4, + BUTTON_6 = 5, + BUTTON_7 = 6, + BUTTON_8 = 7 +} -- keyboard -cc.KeyCodeKey = +cc.KeyCode = { - "KEY_NONE", - "KEY_PAUSE", - "KEY_SCROLL_LOCK", - "KEY_PRINT", - "KEY_SYSREQ", - "KEY_BREAK", - "KEY_ESCAPE", - "KEY_BACKSPACE", - "KEY_TAB", - "KEY_BACK_TAB", - "KEY_RETURN", - "KEY_CAPS_LOCK", - "KEY_SHIFT", - "KEY_RIGHT_SHIFT", - "KEY_CTRL", - "KEY_RIGHT_CTRL", - "KEY_ALT", - "KEY_RIGHT_ALT", - "KEY_MENU", - "KEY_HYPER", - "KEY_INSERT", - "KEY_HOME", - "KEY_PG_UP", - "KEY_DELETE", - "KEY_END", - "KEY_PG_DOWN", - "KEY_LEFT_ARROW", - "KEY_RIGHT_ARROW", - "KEY_UP_ARROW", - "KEY_DOWN_ARROW", - "KEY_NUM_LOCK", - "KEY_KP_PLUS", - "KEY_KP_MINUS", - "KEY_KP_MULTIPLY", - "KEY_KP_DIVIDE", - "KEY_KP_ENTER", - "KEY_KP_HOME", - "KEY_KP_UP", - "KEY_KP_PG_UP", - "KEY_KP_LEFT", - "KEY_KP_FIVE", - "KEY_KP_RIGHT", - "KEY_KP_END", - "KEY_KP_DOWN", - "KEY_KP_PG_DOWN", - "KEY_KP_INSERT", - "KEY_KP_DELETE", - "KEY_F1", - "KEY_F2", - "KEY_F3", - "KEY_F4", - "KEY_F5", - "KEY_F6", - "KEY_F7", - "KEY_F8", - "KEY_F9", - "KEY_F10", - "KEY_F11", - "KEY_F12", - "KEY_SPACE", - "KEY_EXCLAM", - "KEY_QUOTE", - "KEY_NUMBER", - "KEY_DOLLAR", - "KEY_PERCENT", - "KEY_CIRCUMFLEX", - "KEY_AMPERSAND", - "KEY_APOSTROPHE", - "KEY_LEFT_PARENTHESIS", - "KEY_RIGHT_PARENTHESIS", - "KEY_ASTERISK", - "KEY_PLUS", - "KEY_COMMA", - "KEY_MINUS", - "KEY_PERIOD", - "KEY_SLASH", - "KEY_0", - "KEY_1", - "KEY_2", - "KEY_3", - "KEY_4", - "KEY_5", - "KEY_6", - "KEY_7", - "KEY_8", - "KEY_9", - "KEY_COLON", - "KEY_SEMICOLON", - "KEY_LESS_THAN", - "KEY_EQUAL", - "KEY_GREATER_THAN", - "KEY_QUESTION", - "KEY_AT", - "KEY_CAPITAL_A", - "KEY_CAPITAL_B", - "KEY_CAPITAL_C", - "KEY_CAPITAL_D", - "KEY_CAPITAL_E", - "KEY_CAPITAL_F", - "KEY_CAPITAL_G", - "KEY_CAPITAL_H", - "KEY_CAPITAL_I", - "KEY_CAPITAL_J", - "KEY_CAPITAL_K", - "KEY_CAPITAL_L", - "KEY_CAPITAL_M", - "KEY_CAPITAL_N", - "KEY_CAPITAL_O", - "KEY_CAPITAL_P", - "KEY_CAPITAL_Q", - "KEY_CAPITAL_R", - "KEY_CAPITAL_S", - "KEY_CAPITAL_T", - "KEY_CAPITAL_U", - "KEY_CAPITAL_V", - "KEY_CAPITAL_W", - "KEY_CAPITAL_X", - "KEY_CAPITAL_Y", - "KEY_CAPITAL_Z", - "KEY_LEFT_BRACKET", - "KEY_BACK_SLASH", - "KEY_RIGHT_BRACKET", - "KEY_UNDERSCORE", - "KEY_GRAVE", - "KEY_A", - "KEY_B", - "KEY_C", - "KEY_D", - "KEY_E", - "KEY_F", - "KEY_G", - "KEY_H", - "KEY_I", - "KEY_J", - "KEY_K", - "KEY_L", - "KEY_M", - "KEY_N", - "KEY_O", - "KEY_P", - "KEY_Q", - "KEY_R", - "KEY_S", - "KEY_T", - "KEY_U", - "KEY_V", - "KEY_W", - "KEY_X", - "KEY_Y", - "KEY_Z", - "KEY_LEFT_BRACE", - "KEY_BAR", - "KEY_RIGHT_BRACE", - "KEY_TILDE", - "KEY_EURO", - "KEY_POUND", - "KEY_YEN", - "KEY_MIDDLE_DOT", - "KEY_SEARCH", - "KEY_DPAD_LEFT", - "KEY_DPAD_RIGHT", - "KEY_DPAD_UP", - "KEY_DPAD_DOWN", - "KEY_DPAD_CENTER", - "KEY_ENTER", - "KEY_PLAY", + KEY_NONE = 0, + KEY_PAUSE = 1, + KEY_SCROLL_LOCK = 2, + KEY_PRINT = 3, + KEY_SYSREQ = 4, + KEY_BREAK = 5, + KEY_ESCAPE = 6, + KEY_BACKSPACE = 7, + KEY_TAB = 8, + KEY_BACK_TAB = 9, + KEY_RETURN = 10, + KEY_CAPS_LOCK = 11, + KEY_LEFT_SHIFT = 12, + KEY_RIGHT_SHIFT = 13, + KEY_LEFT_CTRL = 14, + KEY_RIGHT_CTRL = 15, + KEY_LEFT_ALT = 16, + KEY_RIGHT_ALT = 17, + KEY_MENU = 18, + KEY_HYPER = 19, + KEY_INSERT = 20, + KEY_HOME = 21, + KEY_PG_UP = 22, + KEY_DELETE = 23, + KEY_END = 24, + KEY_PG_DOWN = 25, + KEY_LEFT_ARROW = 26, + KEY_RIGHT_ARROW = 27, + KEY_UP_ARROW = 28, + KEY_DOWN_ARROW = 29, + KEY_NUM_LOCK = 30, + KEY_KP_PLUS = 31, + KEY_KP_MINUS = 32, + KEY_KP_MULTIPLY = 33, + KEY_KP_DIVIDE = 34, + KEY_KP_ENTER = 35, + KEY_KP_HOME = 36, + KEY_KP_UP = 37, + KEY_KP_PG_UP = 38, + KEY_KP_LEFT = 39, + KEY_KP_FIVE = 40, + KEY_KP_RIGHT = 41, + KEY_KP_END = 42, + KEY_KP_DOWN = 43, + KEY_KP_PG_DOWN = 44, + KEY_KP_INSERT = 45, + KEY_KP_DELETE = 46, + KEY_F1 = 47, + KEY_F2 = 48, + KEY_F3 = 49, + KEY_F4 = 50, + KEY_F5 = 51, + KEY_F6 = 52, + KEY_F7 = 53, + KEY_F8 = 54, + KEY_F9 = 55, + KEY_F10 = 56, + KEY_F11 = 57, + KEY_F12 = 58, + KEY_SPACE = 59, + KEY_EXCLAM = 60, + KEY_QUOTE = 61, + KEY_NUMBER = 62, + KEY_DOLLAR = 63, + KEY_PERCENT = 64, + KEY_CIRCUMFLEX = 65, + KEY_AMPERSAND = 66, + KEY_APOSTROPHE = 67, + KEY_LEFT_PARENTHESIS = 68, + KEY_RIGHT_PARENTHESIS = 69, + KEY_ASTERISK = 70, + KEY_PLUS = 71, + KEY_COMMA = 72, + KEY_MINUS = 73, + KEY_PERIOD = 74, + KEY_SLASH = 75, + KEY_0 = 76, + KEY_1 = 77, + KEY_2 = 78, + KEY_3 = 79, + KEY_4 = 80, + KEY_5 = 81, + KEY_6 = 82, + KEY_7 = 83, + KEY_8 = 84, + KEY_9 = 85, + KEY_COLON = 86, + KEY_SEMICOLON = 87, + KEY_LESS_THAN = 88, + KEY_EQUAL = 89, + KEY_GREATER_THAN = 90, + KEY_QUESTION = 91, + KEY_AT = 92, + KEY_CAPITAL_A = 93, + KEY_CAPITAL_B = 94, + KEY_CAPITAL_C = 95, + KEY_CAPITAL_D = 96, + KEY_CAPITAL_E = 97, + KEY_CAPITAL_F = 98, + KEY_CAPITAL_G = 99, + KEY_CAPITAL_H = 100, + KEY_CAPITAL_I = 101, + KEY_CAPITAL_J = 102, + KEY_CAPITAL_K = 103, + KEY_CAPITAL_L = 104, + KEY_CAPITAL_M = 105, + KEY_CAPITAL_N = 106, + KEY_CAPITAL_O = 107, + KEY_CAPITAL_P = 108, + KEY_CAPITAL_Q = 109, + KEY_CAPITAL_R = 110, + KEY_CAPITAL_S = 111, + KEY_CAPITAL_T = 112, + KEY_CAPITAL_U = 113, + KEY_CAPITAL_V = 114, + KEY_CAPITAL_W = 115, + KEY_CAPITAL_X = 116, + KEY_CAPITAL_Y = 117, + KEY_CAPITAL_Z = 118, + KEY_LEFT_BRACKET = 119, + KEY_BACK_SLASH = 120, + KEY_RIGHT_BRACKET = 121, + KEY_UNDERSCORE = 122, + KEY_GRAVE = 123, + KEY_A = 124, + KEY_B = 125, + KEY_C = 126, + KEY_D = 127, + KEY_E = 128, + KEY_F = 129, + KEY_G = 130, + KEY_H = 131, + KEY_I = 132, + KEY_J = 133, + KEY_K = 134, + KEY_L = 135, + KEY_M = 136, + KEY_N = 137, + KEY_O = 138, + KEY_P = 139, + KEY_Q = 140, + KEY_R = 141, + KEY_S = 142, + KEY_T = 143, + KEY_U = 144, + KEY_V = 145, + KEY_W = 146, + KEY_X = 147, + KEY_Y = 148, + KEY_Z = 149, + KEY_LEFT_BRACE = 150, + KEY_BAR = 151, + KEY_RIGHT_BRACE = 152, + KEY_TILDE = 153, + KEY_EURO = 154, + KEY_POUND = 155, + KEY_YEN = 156, + KEY_MIDDLE_DOT = 157, + KEY_SEARCH = 158, + KEY_DPAD_LEFT = 158, + KEY_DPAD_RIGHT = 160, + KEY_DPAD_UP = 161, + KEY_DPAD_DOWN = 162, + KEY_DPAD_CENTER = 163, + KEY_ENTER = 164, + KEY_PLAY = 165 } - -cc.KeyCode = {} -for k,v in ipairs(cc.KeyCodeKey) do - cc.KeyCode[v] = k - 1 -end - -cc.KeyCode.KEY_BACK = cc.KeyCode.KEY_ESCAPE -cc.KeyCode.KEY_LEFT_SHIFT = cc.KeyCode.KEY_SHIFT -cc.KeyCode.KEY_LEFT_CTRL = cc.KeyCode.KEY_CTRL -cc.KeyCode.KEY_LEFT_ALT = cc.KeyCode.KEY_ALT - -- camera cc.CameraFlag = { diff --git a/templates/src/cocos/cocos2d/RendererConstants.lua b/templates/src/cocos/cocos2d/RendererConstants.lua index e9b82d01..123921d3 100644 --- a/templates/src/cocos/cocos2d/RendererConstants.lua +++ b/templates/src/cocos/cocos2d/RendererConstants.lua @@ -64,3 +64,37 @@ cc.backendBlendFactor = { ONE_MINUS_CONSTANT_ALPHA = 12, BLEND_CLOLOR = 13 } + +cc.backendProgramType = { + POSITION_COLOR_LENGTH_TEXTURE = 0, + POSITION_COLOR_TEXTURE_AS_POINTSIZE = 1, + POSITION_COLOR = 2, + POSITION = 3, + POSITION_UCOLOR = 4, + POSITION_TEXTURE = 5, + POSITION_TEXTURE_COLOR = 6, + POSITION_TEXTURE_COLOR_ALPHA_TEST = 7, + LABEL_NORMAL = 8, + LABLE_OUTLINE = 9, + LABLE_DISTANCEFIELD_GLOW = 10, + LABEL_DISTANCE_NORMAL = 11, + LAYER_RADIA_GRADIENT = 12, + ETC1 = 13, + ETC1_GRAY = 14, + GRAY_SCALE = 15, + CAMERA_CLEAR = 16, + TERRAIN_3D = 17, + LINE_COLOR_3D = 18, + SKYBOX_3D = 19, + SKINPOSITION_TEXTURE_3D = 20, + SKINPOSITION_NORMAL_TEXTURE_3D = 21, + POSITION_NORMAL_TEXTURE_3D = 22, + POSITION_NORMAL_3D = 23, + POSITION_TEXTURE_3D = 24, + POSITION_3D = 25, + POSITION_BUMPEDNORMAL_TEXTURE_3D = 26, + SKINPOSITION_BUMPEDNORMAL_TEXTURE_3D = 27, + PARTICLE_TEXTURE_3D = 28, + PARTICLE_COLOR_3D = 29, + CUSTOM_PROGRAM = 30 +} diff --git a/templates/src/cocos/ui/GuiConstants.lua b/templates/src/cocos/ui/GuiConstants.lua index 5ef07ac1..ffc580e8 100644 --- a/templates/src/cocos/ui/GuiConstants.lua +++ b/templates/src/cocos/ui/GuiConstants.lua @@ -1,235 +1,220 @@ if nil == ccui then - return + return end -ccui.BrightStyle = -{ - none = -1, - normal = 0, - highlight = 1, +ccui.BrightStyle = { + NONE = -1, + NORMAL = 0, + HIGHLIGHT = 1, } -ccui.TextureResType = -{ - localType = 0, - plistType = 1, +ccui.TextureResType = { + LOCAL = 0, + PLIST = 1, } -ccui.TouchEventType = -{ - began = 0, - moved = 1, - ended = 2, - canceled = 3, +ccui.TouchEventType = { + BEGAN = 0, + MOVED = 1, + ENDED = 2, + CANCELED = 3, } -ccui.SizeType = -{ - absolute = 0, - percent = 1, +ccui.SizeType = { + ABSOLUTE = 0, + PERCENT = 1, } ccui.PositionType = { - absolute = 0, - percent = 1, -} - -ccui.CheckBoxEventType = -{ - selected = 0, - unselected = 1, -} - -ccui.RadioButtonEventType= -{ - selected = 0, - unselected = 1 -} - -ccui.RadioButtonGroupEventType= -{ - select_changed = 0 -} - -ccui.TextFiledEventType = -{ - attach_with_ime = 0, - detach_with_ime = 1, - insert_text = 2, - delete_backward = 3, -} - -ccui.LayoutBackGroundColorType = -{ - none = 0, - solid = 1, - gradient = 2, -} - -ccui.LayoutType = -{ - ABSOLUTE = 0, - VERTICAL = 1, - HORIZONTAL = 2, - RELATIVE = 3, -} - -ccui.LayoutParameterType = -{ - none = 0, - linear = 1, - relative = 2, -} - -ccui.LinearGravity = -{ - none = 0, - left = 1, - top = 2, - right = 3, - bottom = 4, - centerVertical = 5, - centerHorizontal = 6, -} - -ccui.RelativeAlign = -{ - alignNone = 0, - alignParentTopLeft = 1, - alignParentTopCenterHorizontal = 2, - alignParentTopRight = 3, - alignParentLeftCenterVertical = 4, - centerInParent = 5, - alignParentRightCenterVertical = 6, - alignParentLeftBottom = 7, - alignParentBottomCenterHorizontal = 8, - alignParentRightBottom = 9, - locationAboveLeftAlign = 10, - locationAboveCenter = 11, - locationAboveRightAlign = 12, - locationLeftOfTopAlign = 13, - locationLeftOfCenter = 14, - locationLeftOfBottomAlign = 15, - locationRightOfTopAlign = 16, - locationRightOfCenter = 17, - locationRightOfBottomAlign = 18, - locationBelowLeftAlign = 19, - locationBelowCenter = 20, - locationBelowRightAlign = 21, + ABSOLUTE = 0, + PERCENT = 1, } -ccui.SliderEventType = { - percentChanged = 0, - slideBallDown = 1, - slideBallUp = 2, - slideBallCancel = 3 +ccui.CheckBoxEventType = { + SELECTED = 0, + UNSELECTED = 1, } -ccui.LoadingBarDirection = { LEFT = 0, RIGHT = 1} +ccui.RadioButtonEventType = { + SELECTED = 0, + UNSELECTED = 1 +} -ccui.ScrollViewDir = { - none = 0, - vertical = 1, - horizontal = 2, - both = 3, +ccui.RadioButtonGroupEventType = { + SELECT_CHANGED = 0 } -ccui.ScrollViewMoveDir = { - none = 0, - up = 1, - down = 2, - left = 3, - right = 4, +ccui.TextFiledEventType = { + ATTACH_WITH_IME = 0, + DETACH_WITH_IME = 1, + INSERT_TEXT = 2, + DELETE_BACKWARD = 3, } -ccui.ScrollviewEventType = { - scrollToTop = 0, - scrollToBottom = 1, - scrollToLeft = 2, - scrollToRight = 3, - scrolling = 4, - bounceTop = 5, - bounceBottom = 6, - bounceLeft = 7, - bounceRight = 8, - containerMoved = 9, - autoscrollEnded = 10, +ccui.LayoutType = { + ABSOLUTE = 0, + VERTICAL = 1, + HORIZONTAL = 2, + RELATIVE = 3, } -ccui.ListViewDirection = { - none = 0, - vertical = 1, - horizontal = 2, +ccui.LayoutClippingType = { + STENCIL = 0, + SCISSOR = 1, } -ccui.ListViewMoveDirection = { - none = 0, - up = 1, - down = 2, - left = 3, - right = 4, +ccui.LayoutBackGroundColorType = { + NONE = 0, + SOLID = 1, + GRADIENT = 2, } -ccui.ListViewEventType = { - ONSELECTEDITEM_START = 0, - ONSELECTEDITEM_END = 1, +ccui.LayoutParameterType = { + NONE = 0, + LINEAR = 1, + RELATIVE = 2, } -ccui.PageViewEventType = { - turning = 0, +ccui.LinearGravity = { + NONE = 0, + LEFT = 1, + TOP = 2, + RIGHT = 3, + BOTTOM = 4, + CENTER_VERTICAL = 5, + CENTER_HORIZONTAL = 6, } -ccui.PageViewDirection = { - NONE = 0, - VERTICAL = 1, - HORIZONTAL = 2, - BOTH = 3 +ccui.RelativeAlign = { + NONE = 0, + PARENT_TOP_LEFT = 1, + PARENT_TOP_CENTER_HORIZONTAL = 2, + PARENT_TOP_RIGHT = 3, + PARENT_LEFT_CENTER_VERTICAL = 4, + CENTER_IN_PARENT = 5, + PARENT_RIGHT_CENTER_VERTICAL = 6, + PARENT_LEFT_BOTTOM = 7, + PARENT_BOTTOM_CENTER_HORIZONTAL = 8, + PARENT_RIGHT_BOTTOM = 9, + LOCATION_ABOVE_LEFTALIGN = 10, + LOCATION_ABOVE_CENTER = 11, + LOCATION_ABOVE_RIGHTALIGN = 12, + LOCATION_LEFT_OF_TOPALIGN = 13, + LOCATION_LEFT_OF_CENTER = 14, + LOCATION_LEFT_OF_BOTTOMALIGN = 15, + LOCATION_RIGHT_OF_TOPALIGN = 16, + LOCATION_RIGHT_OF_CENTER = 17, + LOCATION_RIGHT_OF_BOTTOMALIGN = 18, + LOCATION_BELOW_LEFTALIGN = 19, + LOCATION_BELOW_CENTER = 20, + LOCATION_BELOW_RIGHTALIGN = 21, } -ccui.PVTouchDir = { - touchLeft = 0, - touchRight = 1, - touchUp = 2, - touchDown = 3 +ccui.SliderEventType = { + ON_PERCENTAGE_CHANGED = 0, + ON_SLIDEBALL_DOWN = 1, + ON_SLIDEBALL_UP = 2, + ON_SLIDEBALL_CANCEL = 3, +} + +ccui.LoadingBarDirection = { + LEFT = 0, + RIGHT = 1 +} + +ccui.ScrollViewDirection = { + NONE = 0, + VERTICAL = 1, + HORIZONTAL = 2, + BOTH = 3, +} + +ccui.ScrollViewMoveDirection = { + TOP = 0, + BOTTOM = 1, + LEFT = 2, + RIGHT = 3, +} + +ccui.ScrollviewEventType = { + SCROLL_TO_TOP = 0, + SCROLL_TO_BOTTOM = 1, + SCROLL_TO_LEFT = 2, + SCROLL_TO_RIGHT = 3, + SCROLLING = 4, + BOUNCE_TOP = 5, + BOUNCE_BOTTOM = 6, + BOUNCE_LEFT = 7, + BOUNCE_RIGHT = 8, + CONTAINER_MOVED = 9, + SCROLLING_BEGAN = 10, + SCROLLING_ENDED = 11, + AUTOSCROLL_ENDED = 12, } ccui.ListViewGravity = { - left = 0, - right = 1, - centerHorizontal = 2, - top = 3, - bottom = 4 , - centerVertical = 5, + LEFT = 0, + RIGHT = 1, + CENTER_HORIZONTAL = 2, + TOP = 3, + BOTTOM = 4, + CENTER_VERTICAL = 5, +} + +ccui.ListViewEventType = { + ON_SELECTED_ITEM_START = 0, + ON_SELECTED_ITEM_END = 1, +} + +ccui.ListViewMagneticType = { + NONE = 0, + CENTER = 1, + BOTH_END = 2, + LEFT = 3, + RIGHT = 4, + TOP = 5, + BOTTOM = 6, +} + +ccui.PageViewEventType = { + TURNING = 0, +} + +ccui.PageViewTouchDirection = { + LEFT = 0, + RIGHT = 1, + UP = 2, + DOWN = 3 } ccui.TextType = { - SYSTEM = 0, - TTF = 1, + SYSTEM = 0, + TTF = 1, } -ccui.LayoutComponent.HorizontalEdge = { - None = 0, - Left = 1, - Right = 2, - Center = 3, +ccui.LayoutComponentHorizontalEdge = { + None = 0, + Left = 1, + Right = 2, + Center = 3, } -ccui.LayoutComponent.VerticalEdge = { - None = 0, - Bottom = 1, - Top = 2, - Center = 3, +ccui.LayoutComponentVerticalEdge = { + None = 0, + Bottom = 1, + Top = 2, + Center = 3, } ccui.VideoPlayerEvent = { - PLAYING = 0, - PAUSED = 1, - STOPPED= 2, - COMPLETED =3, + PLAYING = 0, + PAUSED = 1, + STOPPED = 2, + COMPLETED = 3, } ccui.MovementEventType = { - START = 0, - COMPLETE = 1, - LOOP_COMPLETE = 2, + START = 0, + COMPLETE = 1, + LOOP_COMPLETE = 2, } diff --git a/templates/src/framework/AppBase.lua b/templates/src/framework/AppBase.lua index d566bdee..bf4a4afd 100755 --- a/templates/src/framework/AppBase.lua +++ b/templates/src/framework/AppBase.lua @@ -23,9 +23,6 @@ end function AppBase:exit() cc.Director:getInstance():endToLua() - if device.platform == "windows" or device.platform == "mac" then - os.exit() - end end function AppBase:enterScene(sceneName, transitionType, time, more, ...) diff --git a/templates/src/framework/NodeEx.lua b/templates/src/framework/NodeEx.lua index f0e6db69..d81016d7 100644 --- a/templates/src/framework/NodeEx.lua +++ b/templates/src/framework/NodeEx.lua @@ -164,6 +164,21 @@ function Node:setNodeEventEnabled(enabled) return self end +--[[ + Check if event enabled + @function isNodeEventEnabled + @param integer evt, value can be: + cc.NODE_EVENT + cc.NODE_ENTER_FRAME_EVENT + cc.NODE_TOUCH_EVENT + cc.KEYPAD_EVENT + cc.ACCELEROMETER_EVENT + cc.MOUSE_EVENT +]]-- +function Node:isNodeEventEnabled(evt) + return self._LuaListeners and self._LuaListeners[evt] ~= nil +end + local function KeypadEventCodeConvert(code) local key if code == 6 then @@ -232,20 +247,6 @@ function Node:isKeypadEnabled() return false end -local function MouseEventCodeConvert(code) - local key - if code == 0 then - key = "left" - elseif code == 1 then - key = "right" - elseif code == 2 then - key = "middle" - else - key = tostring(code) - end - return key -end - function Node:setMouseEnabled(enable) if enable == self:isMouseEnabled() then return self @@ -255,20 +256,14 @@ function Node:setMouseEnabled(enable) if enable then local dealFunc = function(mouse, name) local tp = mouse:getLocationInView() - local sp = mouse:getStartLocationInView() - local pp = mouse:getPreviousLocationInView() - -- call listener self._LuaListeners[c.MOUSE_EVENT]{ name = name, x = tp.x, y = tp.y, - startX = sp.x, - startY = sp.y, - prevX = pp.x, - prevY = pp.y, - scroll = mouse:getScrollY(), - key = MouseEventCodeConvert(mouse:getMouseButton()) + scrollX = mouse:getScrollX(), + scrollY = mouse:getScrollY(), + button = mouse:getMouseButton() } end @@ -462,10 +457,11 @@ end function Node:addNodeEventListener(evt, hdl) self._LuaListeners = self._LuaListeners or {} if evt == c.NODE_EVENT then - self:registerScriptHandler(function(evt) - -- call listener - self._LuaListeners[c.NODE_EVENT]{name = evt} - end) + if not self._LuaListeners[c.NODE_EVENT] then -- NODE_EVENT only start ONCE + self:registerScriptHandler(function(evt) + self._LuaListeners[c.NODE_EVENT]{name = evt} -- call listener in setNodeEventEnabled + end) + end end self._LuaListeners[evt] = hdl diff --git a/templates/src/framework/display.lua b/templates/src/framework/display.lua index 998b627c..c8839582 100644 --- a/templates/src/framework/display.lua +++ b/templates/src/framework/display.lua @@ -456,22 +456,20 @@ function display.newSprite(filename, x, y, params) if string.byte(filename) == 35 then -- first char is # local frame = display.newSpriteFrame(string.sub(filename, 2)) if frame then + sprite = spriteClass:createWithSpriteFrame(frame) if params and params.capInsets then - sprite = spriteClass:createWithSpriteFrame(frame, params.capInsets) - else - sprite = spriteClass:createWithSpriteFrame(frame) + sprite:setCapInsets(params.capInsets) end end else if display.TEXTURES_PIXEL_FORMAT[filename] then cc.Texture2D:setDefaultAlphaPixelFormat(display.TEXTURES_PIXEL_FORMAT[filename]) sprite = spriteClass:create(filename) - cc.Texture2D:setDefaultAlphaPixelFormat(cc.TEXTURE2D_PIXEL_FORMAT_RGBA8888) + cc.Texture2D:setDefaultAlphaPixelFormat(cc.backendPixelFormat.RGBA8888) else + sprite = spriteClass:create(filename) if params and params.capInsets then - sprite = spriteClass:create(filename, params.capInsets) - else - sprite = spriteClass:create(filename) + sprite:setCapInsets(params.capInsets) end end end @@ -677,6 +675,32 @@ function display.newCircle(radius, params) return circle end +--[[ +local sector = display.newSector(50, 45, { + segments = 10, + scale = 1, + borderWidth = 1, + fillColor = cc.c4f(0.0, 1.0, 0.0, 1.0), + borderColor = cc.c4f(1.0, 0.0, 0.0, 1.0), +}) +]]-- +function display.newSector(radius, angle, params) + local segments = params.segments or 10 + local points = {} + local alpha = angle / (segments - 1) + local start = - angle / 2 + + table.insert(points, {0, 0}) -- center + for i = 0, segments - 1 do + local rad = math.rad(start + alpha * i) + local x = radius * math.cos(rad) + local y = radius * math.sin(rad) + table.insert(points, {x, y}) + end + + return display.newPolygon(points, params) +end + --[[ Create a rect DrawNode @function newRect @@ -987,9 +1011,13 @@ end @function addImageAsync @param string imagePath @param function callback + @param string callkey + @param backendPixelFormat fmt ]]-- -function display.addImageAsync(imagePath, callback) - sharedTextureCache:addImageAsync(imagePath, callback) +function display.addImageAsync(imagePath, callback, callkey, fmt) + callkey = callkey or imagePath + fmt = fmt or cc.backendPixelFormat.RGBA8888 + sharedTextureCache:addImageAsync(imagePath, callback, callkey, fmt) end --[[ diff --git a/templates/src/framework/functions.lua b/templates/src/framework/functions.lua index 3f142c7b..b66bb29c 100644 --- a/templates/src/framework/functions.lua +++ b/templates/src/framework/functions.lua @@ -300,19 +300,7 @@ end @function math.newrandomseed ]]-- function math.newrandomseed() - local ok, socket = pcall(function() - return require("socket") - end) - - if ok then -- Luasocket's gettime return microsecond - math.randomseed(socket.gettime()) - else - math.randomseed(os.time()) - end - math.random() - math.random() - math.random() - math.random() + math.randomseed(tostring(os.time()):reverse():sub(1, 6)) end --[[ diff --git a/templates/src/framework/toluaEx.lua b/templates/src/framework/toluaEx.lua index d6f55772..8702264a 100755 --- a/templates/src/framework/toluaEx.lua +++ b/templates/src/framework/toluaEx.lua @@ -1,47 +1,22 @@ function tolua.cloneTable(src) - if type(src)~="table" then + if type(src) ~= "table" then return nil end local dest = {} - for k, v in pairs(src) do - dest[k] = v - end + for k, v in pairs(src) do + dest[k] = v + end - local mt = getmetatable(src) - if mt then - setmetatable(dest, mt) - end + local mt = getmetatable(src) + if mt then + setmetatable(dest, mt) + end - return dest + return dest end -function tolua.fullgc(classes) - collectgarbage("collect") - - if type(classes) == "string" then - classes = {classes} - else - classes = {} - end - - local o = tolua.getregval("tolua_gc") - local t = tolua.cloneTable(o) - if t then - tolua.setregval("tolua_gc", t) - end - - for i,v in ipairs(classes) do - o = tolua.getubox(v) - t = tolua.cloneTable(o) - if o then - tolua.setubox(v, t) - end - end - - o = nil - t = nil - - collectgarbage("collect") +function tolua.fullgc() + collectgarbage("collect") end diff --git a/tests/res/audio/effect.mp3 b/tests/res/audio/effect.mp3 new file mode 100644 index 00000000..0a72bf11 Binary files /dev/null and b/tests/res/audio/effect.mp3 differ diff --git a/tests/res/dragonbones/mecha_1004d_ske.json b/tests/res/dragonbones/mecha_1004d_ske.json new file mode 100644 index 00000000..53f47b2e --- /dev/null +++ b/tests/res/dragonbones/mecha_1004d_ske.json @@ -0,0 +1 @@ +{"frameRate":25,"name":"mecha_1004d","version":"5.5","compatibleVersion":"5.5","armature":[{"type":"Armature","frameRate":25,"name":"mecha_1004d","aabb":{"x":-232.77,"y":-275.91,"width":464.76,"height":315.24},"bone":[{"name":"root1"},{"inheritScale":false,"name":"effect_r","parent":"root1","transform":{"x":208,"y":25,"skX":-46.2343,"skY":-23.9186,"scX":2.1416,"scY":2.3753}},{"inheritScale":false,"name":"effect_l","parent":"root1","transform":{"x":238.55,"y":-21.55,"skX":-35.0775,"skY":-20.0269,"scX":2.4973,"scY":2.496}},{"inheritScale":false,"length":24,"name":"root","parent":"root1","transform":{"x":-0.25,"y":-96.75,"skX":90.2632,"skY":90.2632}},{"inheritScale":false,"length":35,"name":"thigh_l","parent":"root","transform":{"x":-2.37,"y":-27.45,"skX":-40.9701,"skY":-40.9714,"scX":0.9869,"scY":0.9853}},{"inheritScale":false,"length":35,"name":"thigh_r","parent":"root","transform":{"x":2.38,"y":27.98,"skX":3.5596,"skY":3.567,"scX":0.9859,"scY":0.9981}},{"inheritScale":false,"length":24,"name":"pelvis","parent":"root","transform":{"x":-0.0889,"y":0.543,"skX":-174.7594,"skY":-174.7594,"scX":0.9802,"scY":0.9952}},{"inheritScale":false,"length":61,"name":"calf_r","parent":"thigh_r","transform":{"x":35.65,"y":0.01,"skX":16.144,"skY":16.1453,"scX":0.9955,"scY":0.9905}},{"inheritScale":false,"length":49,"name":"calf_l","parent":"thigh_l","transform":{"x":35.37,"y":-0.01,"skX":32.6682,"skY":32.6684,"scX":0.9945,"scY":0.9954}},{"inheritScale":false,"length":54,"name":"chest","parent":"pelvis","transform":{"x":25,"y":-0.01,"skX":-5.2066,"skY":-5.2246,"scX":0.9979,"scY":0.9998}},{"inheritScale":false,"name":"foot_l","parent":"calf_l","transform":{"x":49.56,"y":-0.02,"skX":8.0381,"skY":8.0381,"scX":0.9955}},{"inheritScale":false,"name":"foot_r","parent":"calf_r","transform":{"x":61.46,"skX":-19.9771,"skY":-19.9771,"scX":0.9955}},{"inheritScale":false,"length":37,"name":"shouder_l","parent":"chest","transform":{"x":60.22,"y":62.24,"skX":-164.5083,"skY":-164.5031,"scX":0.9868,"scY":0.9948}},{"inheritScale":false,"length":37,"name":"shouder_r","parent":"chest","transform":{"x":48.03,"y":-62.2,"skX":-147.477,"skY":-147.4808,"scX":0.9972,"scY":0.9986}},{"inheritScale":false,"length":49,"name":"forearm_r","parent":"shouder_r","transform":{"x":37.51,"y":0.01,"skX":-38.002,"skY":-38.0045,"scX":0.9973,"scY":0.994}},{"inheritScale":false,"length":48,"name":"forearm_l","parent":"shouder_l","transform":{"x":37.59,"y":-0.01,"skX":-42.3216,"skY":-42.3089,"scX":0.9979,"scY":0.987}},{"inheritScale":false,"name":"hand_r","parent":"forearm_r","transform":{"x":49.66,"y":0.05,"skX":3.3187,"skY":3.3187,"scX":1.0446,"scY":0.9963}},{"inheritScale":false,"name":"hand_l","parent":"forearm_l","transform":{"x":48.07,"y":-0.02,"skX":118.8939,"skY":119.4238,"scX":0.9894,"scY":0.9954}},{"inheritScale":false,"name":"weapon_hand_l","parent":"hand_l","transform":{"x":-0.05,"y":0.01,"skX":139.1057,"skY":139.1066,"scX":0.9967,"scY":0.9984}},{"inheritRotation":false,"inheritScale":false,"name":"weapon_hand_r","parent":"hand_r","transform":{"x":-0.01,"y":0.03,"skX":-17.7736,"skY":-17.7744,"scX":0.9981,"scY":0.999}}],"slot":[{"name":"forearm_l","parent":"forearm_l"},{"name":"hand_l","parent":"hand_l"},{"name":"shouder_l","parent":"shouder_l"},{"name":"weapon_hand_l","parent":"weapon_hand_l"},{"displayIndex":-1,"name":"effect_l","parent":"effect_l"},{"name":"foot_l","parent":"foot_l"},{"name":"thigh_l","parent":"thigh_l"},{"name":"calf_l","parent":"calf_l"},{"name":"pelvis","parent":"pelvis"},{"name":"chest","parent":"chest"},{"name":"foot_r","parent":"foot_r"},{"name":"calf_r","parent":"calf_r"},{"name":"thigh_r","parent":"thigh_r"},{"name":"shouder_r","parent":"shouder_r"},{"name":"weapon_hand_r","parent":"weapon_hand_r"},{"name":"hand_r","parent":"hand_r"},{"name":"forearm_r","parent":"forearm_r"},{"displayIndex":-1,"name":"effect_r","parent":"effect_r"}],"skin":[{"name":"","slot":[{"name":"foot_r","display":[{"name":"mecha_1004d_folder/textures/foot_r_0","transform":{"x":9.3,"y":2.05,"scX":1.1693,"scY":1.1693}},{"name":"mecha_1004d_folder/textures/foot_r_1","transform":{"x":7.55,"y":1.45,"scX":1.1693,"scY":1.1693}}]},{"name":"thigh_r","display":[{"name":"mecha_1004d_folder/textures/thigh_r_0","transform":{"x":8,"y":2,"skX":-0.32,"skY":-0.32}},{"name":"mecha_1004d_folder/textures/thigh_r_1","transform":{"x":7.95,"y":3.45,"skX":-0.32,"skY":-0.32}}]},{"name":"weapon_hand_r","display":[{"type":"armature","name":"weapon_replace"},{"type":"armature","name":"weapon_replace","transform":{"x":-59.15,"y":4.25}},{"type":"armature","name":"weapon_replace","transform":{"x":-53.45,"y":15.35}}]},{"name":"shouder_l","display":[{"name":"mecha_1004d_folder/textures/shouder_l_1","transform":{"x":2.5,"y":0.4,"skX":-0.4,"skY":-0.4}},{"name":"mecha_1004d_folder/textures/shouder_l_2","transform":{"x":3.4,"skX":-0.4,"skY":-0.4}},{"name":"mecha_1004d_folder/textures/shouder_l_0","transform":{"x":5.95,"y":0.45,"skX":-0.4,"skY":-0.4}}]},{"name":"weapon_hand_l","display":[{"type":"armature","name":"weapon_replace"}]},{"name":"effect_r","display":[{"type":"armature","name":"we_bl_4"},{"type":"armature","name":"we_bl_5"}]},{"name":"hand_l","display":[{"name":"mecha_1004d_folder/textures/hand_l_2","transform":{"x":-3,"y":-8.55,"skX":-118.58,"skY":-118.58}},{"name":"mecha_1004d_folder/textures/hand_l_3","transform":{"x":-9.35,"y":-7.95,"skX":-118.58,"skY":-118.58}},{"name":"mecha_1004d_folder/textures/hand_l_0","transform":{"x":-9.5,"y":-4.9,"skX":-118.58,"skY":-118.58}},{"name":"mecha_1004d_folder/textures/hand_l_1","transform":{"x":-6.3,"y":-2.2,"skX":-118.58,"skY":-118.58}}]},{"name":"calf_l","display":[{"name":"mecha_1004d_folder/textures/calf_l_0","transform":{"x":24.35,"y":2.65,"skX":-0.71,"skY":-0.71,"scX":1.3158,"scY":1.3158}},{"name":"mecha_1004d_folder/textures/calf_l_1","transform":{"x":28.9,"y":2.55,"skX":-0.71,"skY":-0.71,"scX":1.3158,"scY":1.3158}}]},{"name":"chest","display":[{"name":"mecha_1004d_folder/textures/chest_0","transform":{"x":63.3,"y":-2.05,"skX":4.83,"skY":4.83}},{"name":"mecha_1004d_folder/textures/chest_1","transform":{"x":57.75,"y":-1.1,"skX":4.83,"skY":4.83}},{"name":"mecha_1004d_folder/textures/chest_3","transform":{"x":51.35,"y":-7.6,"skX":4.83,"skY":4.83}},{"name":"mecha_1004d_folder/textures/chest_2","transform":{"x":54.3,"y":-1.4,"skX":4.83,"skY":4.83}}]},{"name":"calf_r","display":[{"name":"mecha_1004d_folder/textures/calf_r_0","transform":{"x":30.35,"y":2.2,"skX":0.05,"skY":0.05,"scX":1.2105,"scY":1.2105}},{"name":"mecha_1004d_folder/textures/calf_r_1","transform":{"x":27.9,"y":3.5,"skX":0.05,"skY":0.05,"scX":1.2105,"scY":1.2105}}]},{"name":"shouder_r","display":[{"name":"mecha_1004d_folder/textures/shouder_r_1","transform":{"x":2.9,"y":0.5,"skX":1.62,"skY":1.62}},{"name":"mecha_1004d_folder/textures/shouder_r_2","transform":{"x":4,"y":-0.3,"skX":1.62,"skY":1.62}},{"name":"mecha_1004d_folder/textures/shouder_r_0","transform":{"x":3.5,"y":-1.4,"skX":1.62,"skY":1.62}}]},{"name":"effect_l","display":[{"type":"armature","name":"we_bl_4"}]},{"name":"hand_r","display":[{"name":"mecha_1004d_folder/textures/hand_r_2","transform":{"x":8.5,"y":-4.5}},{"name":"mecha_1004d_folder/textures/hand_r_1","transform":{"x":9.95,"y":-4.95}},{"name":"mecha_1004d_folder/textures/hand_r_3","transform":{"x":11.5,"y":-3.45}}]},{"name":"forearm_r","display":[{"name":"mecha_1004d_folder/textures/forearm_r_3","transform":{"x":23,"y":6.4,"skX":-0.19,"skY":-0.19}},{"name":"mecha_1004d_folder/textures/forearm_r_2","transform":{"x":21.45,"y":5.8,"skX":-0.19,"skY":-0.19}}]},{"name":"forearm_l","display":[{"name":"mecha_1004d_folder/textures/forearm_l_2","transform":{"x":25.05,"y":-7.65,"skX":0.59,"skY":0.59}},{"name":"mecha_1004d_folder/textures/forearm_l_1","transform":{"x":17.55,"y":-7.75,"skX":0.59,"skY":0.59}},{"name":"mecha_1004d_folder/textures/forearm_l_0","transform":{"x":11.9,"y":1.55,"skX":0.59,"skY":0.59}}]},{"name":"thigh_l","display":[{"name":"mecha_1004d_folder/textures/thigh_l_0","transform":{"x":7.45,"y":1.9,"skX":-0.4,"skY":-0.4}}]},{"name":"foot_l","display":[{"name":"mecha_1004d_folder/textures/foot_l_0","transform":{"x":2.5,"y":0.35,"scX":1.1959,"scY":1.1959}}]},{"name":"pelvis","display":[{"name":"mecha_1004d_folder/textures/pelvis_0","transform":{"x":-7.75,"y":-3,"skX":3.86,"skY":3.86}},{"name":"mecha_1004d_folder/textures/pelvis_1","transform":{"x":-7,"y":0.95,"skX":3.86,"skY":3.86}},{"name":"mecha_1004d_folder/textures/pelvis_3","transform":{"x":-3.9,"y":-1.25,"skX":3.86,"skY":3.86}}]}]}],"animation":[{"duration":60,"playTimes":0,"fadeInTime":0.2,"name":"idle","bone":[{"name":"pelvis","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-1.95,"y":0.01},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-1.5},{"duration":0}]},{"name":"chest","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.14,"y":0.7},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-0.48},{"duration":0}]},{"name":"shouder_r","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":3.73,"y":-1.38},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":1.98},{"duration":0}]},{"name":"shouder_l","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":1.41,"y":1.73},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":1.98},{"duration":0}]},{"name":"forearm_l","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.12,"y":-0.05},{"duration":0}]},{"name":"forearm_r","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.07,"y":0.01},{"duration":0}]},{"name":"hand_r","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.04,"y":-0.07},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-1.5},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"hand_l","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.01,"y":0.01},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-0.75},{"duration":0}]},{"name":"weapon_hand_l","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.04,"y":0.01},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-0.92},{"duration":0}]},{"name":"weapon_hand_r","rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-3.01},{"duration":0}]},{"name":"thigh_r","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-1.09,"y":1.31},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":0.25},{"duration":0}]},{"name":"thigh_l","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-2.81,"y":-1.34},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":7.53},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.97},{"duration":0}]},{"name":"calf_r","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.06,"y":0.07},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-1.75},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"calf_l","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":0.11,"y":-0.11},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":-10.55},{"duration":0}],"scaleFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":1.03},{"duration":0}]},{"name":"foot_r","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.04,"y":-0.03},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":1.5},{"duration":0}]},{"name":"foot_l","translateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"x":-0.01,"y":0.04},{"duration":0}],"rotateFrame":[{"duration":30,"tweenEasing":0},{"duration":30,"tweenEasing":0,"rotate":3.03},{"duration":0}]}]},{"duration":58,"playTimes":0,"fadeInTime":0.2,"name":"walk","frame":[{"duration":27},{"duration":31,"sound":"walk"},{"duration":0,"sound":"walk"}],"bone":[{"name":"pelvis","translateFrame":[{"duration":10,"tweenEasing":0,"x":0.05,"y":-0.03},{"duration":2,"tweenEasing":0,"x":0.04},{"duration":17,"tweenEasing":0,"x":-2.91,"y":-0.09},{"duration":8,"tweenEasing":0,"x":0.05,"y":-0.03},{"duration":5,"tweenEasing":0,"y":-0.03},{"duration":16,"tweenEasing":0,"x":-6.65,"y":0.2},{"duration":0,"x":-0.6,"y":-0.02}],"rotateFrame":[{"duration":10,"tweenEasing":0,"rotate":6.25},{"duration":2,"tweenEasing":0,"rotate":5.25},{"duration":17,"tweenEasing":0,"rotate":5},{"duration":8,"tweenEasing":0,"rotate":5.75},{"duration":5,"tweenEasing":0,"rotate":5.5},{"duration":16,"tweenEasing":0,"rotate":5.75},{"duration":0,"rotate":6.05}],"scaleFrame":[{"duration":10,"tweenEasing":0,"x":1.01},{"duration":19,"tweenEasing":0,"x":0.98},{"duration":8,"tweenEasing":0,"x":0.98},{"duration":21}]},{"name":"chest","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.39,"y":1.17},{"duration":7,"tweenEasing":0,"x":-2.74,"y":1.66},{"duration":2,"tweenEasing":0,"x":0.18,"y":1.74},{"duration":7,"tweenEasing":0,"x":0.23,"y":1.8},{"duration":7,"tweenEasing":0,"x":6.91,"y":1.15},{"duration":3,"tweenEasing":0,"x":4.47,"y":1.12},{"duration":3,"tweenEasing":0,"x":0.18,"y":1.44},{"duration":5,"tweenEasing":0,"x":-1.76,"y":1.6},{"duration":2,"tweenEasing":0,"x":-0.18,"y":1.55},{"duration":3,"tweenEasing":0,"x":0.09,"y":1.45},{"duration":7,"tweenEasing":0,"x":-0.3,"y":1.49},{"duration":9,"tweenEasing":0,"x":4.32,"y":0.83},{"duration":0,"x":2.05,"y":1.04}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-4.04},{"duration":7,"tweenEasing":0,"rotate":-3.46},{"duration":2,"tweenEasing":0,"rotate":-2.94},{"duration":7,"tweenEasing":0,"rotate":-3.06},{"duration":7,"tweenEasing":0,"rotate":-4.75},{"duration":3,"tweenEasing":0,"rotate":-6.6},{"duration":3,"tweenEasing":0,"rotate":-5.2},{"duration":5,"tweenEasing":0,"rotate":-3.88},{"duration":2,"tweenEasing":0,"rotate":-4.26},{"duration":3,"tweenEasing":0,"rotate":-4.62},{"duration":7,"tweenEasing":0,"rotate":-5.53},{"duration":9,"tweenEasing":0,"rotate":-7.66},{"duration":0,"rotate":-5.3}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99},{"duration":9,"tweenEasing":0},{"duration":7,"tweenEasing":0},{"duration":7,"tweenEasing":0,"x":1.01},{"duration":32}]},{"name":"shouder_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-10.85,"y":54.86},{"duration":7,"tweenEasing":0,"x":-10.22,"y":53.31},{"duration":2,"tweenEasing":0,"x":-7.01,"y":43.2},{"duration":7,"tweenEasing":0,"x":-5.99,"y":40.84},{"duration":7,"tweenEasing":0,"x":-3.35,"y":33.5},{"duration":3,"tweenEasing":0,"x":-3.92,"y":28.52},{"duration":3,"tweenEasing":0,"x":-5.7,"y":31.34},{"duration":5,"tweenEasing":0,"x":-7.17,"y":32.76},{"duration":2,"tweenEasing":0,"x":-8.29,"y":40.92},{"duration":3,"tweenEasing":0,"x":-8.59,"y":43.71},{"duration":7,"tweenEasing":0,"x":-8.78,"y":46.72},{"duration":9,"tweenEasing":0,"x":-8.94,"y":52.07},{"duration":0,"x":-10.14,"y":54.33}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-19.52},{"duration":7,"tweenEasing":0,"rotate":-17.27},{"duration":2,"tweenEasing":0,"rotate":-10.54},{"duration":7,"tweenEasing":0,"rotate":-8.54},{"duration":7,"tweenEasing":0,"rotate":-2.29},{"duration":3,"tweenEasing":0,"rotate":2.3},{"duration":3,"tweenEasing":0,"rotate":1.76},{"duration":5,"tweenEasing":0,"rotate":0.78},{"duration":2,"tweenEasing":0,"rotate":-0.48},{"duration":3,"tweenEasing":0,"rotate":-1.48},{"duration":7,"tweenEasing":0,"rotate":-2.99},{"duration":9,"tweenEasing":0,"rotate":-7.27},{"duration":0,"rotate":-17.54}]},{"name":"shouder_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":15.04,"y":-59.71},{"duration":7,"tweenEasing":0,"x":14.25,"y":-59.09},{"duration":2,"tweenEasing":0,"x":11.48,"y":-50.81},{"duration":7,"tweenEasing":0,"x":10.63,"y":-48.85},{"duration":7,"tweenEasing":0,"x":8.36,"y":-42.71},{"duration":3,"tweenEasing":0,"x":9.39,"y":-39.14},{"duration":3,"tweenEasing":0,"x":11.01,"y":-41.18},{"duration":5,"tweenEasing":0,"x":12.45,"y":-42.62},{"duration":2,"tweenEasing":0,"x":13.32,"y":-49.71},{"duration":3,"tweenEasing":0,"x":13.42,"y":-52.26},{"duration":7,"tweenEasing":0,"x":13.47,"y":-54.83},{"duration":9,"tweenEasing":0,"x":13.25,"y":-58.42},{"duration":0,"x":14.25,"y":-59.62}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":9.06},{"duration":7,"tweenEasing":0,"rotate":8.05},{"duration":2,"tweenEasing":0,"rotate":5.76},{"duration":7,"tweenEasing":0,"rotate":4.5},{"duration":7,"tweenEasing":0,"rotate":-0.28},{"duration":3,"tweenEasing":0,"rotate":-5.21},{"duration":3,"tweenEasing":0,"rotate":-6.5},{"duration":5,"tweenEasing":0,"rotate":-5.98},{"duration":2,"tweenEasing":0,"rotate":-2.48},{"duration":3,"tweenEasing":0,"rotate":-0.98},{"duration":7,"tweenEasing":0,"rotate":1.52},{"duration":9,"tweenEasing":0,"rotate":7.27},{"duration":0,"rotate":9.53}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.85},{"duration":7,"tweenEasing":0,"x":0.87},{"duration":2,"tweenEasing":0,"x":0.91},{"duration":7,"tweenEasing":0,"x":0.91},{"duration":7,"tweenEasing":0,"x":0.89},{"duration":3,"tweenEasing":0,"x":0.87},{"duration":8,"tweenEasing":0,"x":0.86},{"duration":2,"tweenEasing":0,"x":0.86},{"duration":10,"tweenEasing":0,"x":0.87},{"duration":9,"tweenEasing":0,"x":0.87},{"duration":0,"x":0.86}]},{"name":"forearm_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":5.11,"y":-0.73},{"duration":7,"tweenEasing":0,"x":4.98,"y":-0.83},{"duration":2,"tweenEasing":0,"x":4.85,"y":-0.65},{"duration":7,"tweenEasing":0,"x":4.89,"y":-0.44},{"duration":7,"tweenEasing":0,"x":5.02,"y":-0.41},{"duration":3,"tweenEasing":0,"x":5.22,"y":-0.23},{"duration":3,"tweenEasing":0,"x":5.21,"y":-0.3},{"duration":5,"tweenEasing":0,"x":5.22,"y":-0.2},{"duration":2,"tweenEasing":0,"x":5.24,"y":-0.43},{"duration":3,"tweenEasing":0,"x":5.27,"y":-0.5},{"duration":7,"tweenEasing":0,"x":5.26,"y":-0.65},{"duration":9,"tweenEasing":0,"x":5.17,"y":-0.74},{"duration":0,"x":5.1,"y":-0.84}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":6.96},{"duration":7,"tweenEasing":0,"rotate":6.97},{"duration":2,"tweenEasing":0,"rotate":7.24},{"duration":7,"tweenEasing":0,"rotate":7.74},{"duration":7,"tweenEasing":0,"rotate":8.73},{"duration":3,"tweenEasing":0,"rotate":9.96},{"duration":3,"tweenEasing":0,"rotate":8.7},{"duration":5,"tweenEasing":0,"rotate":6.69},{"duration":2,"tweenEasing":0,"rotate":3.2},{"duration":3,"tweenEasing":0,"rotate":1.95},{"duration":7,"tweenEasing":0,"rotate":0.44},{"duration":9,"tweenEasing":0,"rotate":0.2},{"duration":0,"rotate":5.68}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.85,"y":1.01},{"duration":7,"tweenEasing":0,"x":0.89,"y":1.01},{"duration":2,"tweenEasing":0,"x":0.95,"y":1.01},{"duration":7,"tweenEasing":0,"x":0.95},{"duration":7,"tweenEasing":0,"x":0.96},{"duration":3,"tweenEasing":0,"x":0.95},{"duration":3,"tweenEasing":0,"x":0.95},{"duration":5,"tweenEasing":0,"x":0.94},{"duration":2,"tweenEasing":0,"x":0.93},{"duration":3,"tweenEasing":0,"x":0.93},{"duration":7,"tweenEasing":0,"x":0.92},{"duration":9,"tweenEasing":0,"x":0.9},{"duration":0,"x":0.86,"y":1.01}]},{"name":"forearm_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":7.73,"y":1.35},{"duration":7,"tweenEasing":0,"x":7.76,"y":1.45},{"duration":2,"tweenEasing":0,"x":7.67,"y":1.31},{"duration":7,"tweenEasing":0,"x":7.72,"y":1.28},{"duration":7,"tweenEasing":0,"x":7.59,"y":1.2},{"duration":3,"tweenEasing":0,"x":7.53,"y":1.25},{"duration":3,"tweenEasing":0,"x":7.57,"y":1.22},{"duration":5,"tweenEasing":0,"x":7.52,"y":1.07},{"duration":2,"tweenEasing":0,"x":7.35,"y":1.1},{"duration":3,"tweenEasing":0,"x":7.33,"y":1.15},{"duration":7,"tweenEasing":0,"x":7.44,"y":1.12},{"duration":9,"tweenEasing":0,"x":7.8,"y":1.25},{"duration":0,"x":7.7,"y":1.38}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":6.52},{"duration":7,"tweenEasing":0,"rotate":6.27},{"duration":2,"tweenEasing":0,"rotate":5.52},{"duration":7,"tweenEasing":0,"rotate":5.27},{"duration":7,"tweenEasing":0,"rotate":6.51},{"duration":3,"tweenEasing":0,"rotate":9.5},{"duration":3,"tweenEasing":0,"rotate":10},{"duration":5,"tweenEasing":0,"rotate":10.25},{"duration":2,"tweenEasing":0,"rotate":9.5},{"duration":3,"tweenEasing":0,"rotate":9.01},{"duration":7,"tweenEasing":0,"rotate":8.77},{"duration":9,"tweenEasing":0,"rotate":8.53},{"duration":0,"rotate":7.78}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":16,"tweenEasing":0,"x":1.03},{"duration":7,"tweenEasing":0,"x":1.03},{"duration":3,"tweenEasing":0,"x":1.03,"y":1.01},{"duration":3,"tweenEasing":0,"x":1.03,"y":1.01},{"duration":5,"tweenEasing":0,"x":1.03},{"duration":2,"tweenEasing":0,"x":1.03,"y":1.01},{"duration":3,"tweenEasing":0,"x":1.02},{"duration":7,"tweenEasing":0,"x":1.02},{"duration":9,"x":1.03}]},{"name":"hand_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.86,"y":-0.44},{"duration":7,"tweenEasing":0,"x":0.76,"y":-0.28},{"duration":2,"tweenEasing":0,"x":0.67,"y":-0.33},{"duration":7,"tweenEasing":0,"x":0.61,"y":-0.22},{"duration":7,"tweenEasing":0,"x":0.62,"y":-0.37},{"duration":3,"tweenEasing":0,"x":0.62,"y":-0.33},{"duration":3,"tweenEasing":0,"x":0.66,"y":-0.03},{"duration":5,"tweenEasing":0,"x":0.74,"y":-0.12},{"duration":2,"tweenEasing":0,"x":0.86,"y":-0.38},{"duration":3,"tweenEasing":0,"x":0.95,"y":-0.33},{"duration":7,"tweenEasing":0,"x":0.92,"y":-0.3},{"duration":9,"tweenEasing":0,"x":0.94,"y":-0.31},{"duration":0,"x":0.89,"y":-0.31}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-5.5},{"duration":7,"tweenEasing":0,"rotate":-5},{"duration":2,"tweenEasing":0,"rotate":-4.5},{"duration":7,"tweenEasing":0,"rotate":-4.25},{"duration":7,"tweenEasing":0,"rotate":-5.25},{"duration":3,"tweenEasing":0,"rotate":-7.5},{"duration":3,"tweenEasing":0,"rotate":-7.25},{"duration":5,"tweenEasing":0,"rotate":-6.25},{"duration":2,"tweenEasing":0,"rotate":-1.75},{"duration":3,"tweenEasing":0,"rotate":-0.25},{"duration":7,"tweenEasing":0,"rotate":0.25},{"duration":9,"tweenEasing":0,"rotate":-1.5},{"duration":0,"rotate":-4.75}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":7,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":7,"tweenEasing":0,"x":0.98},{"duration":7,"tweenEasing":0,"x":0.97},{"duration":3,"tweenEasing":0,"x":0.97},{"duration":3,"tweenEasing":0,"x":0.96},{"duration":5,"tweenEasing":0,"x":0.96},{"duration":5,"tweenEasing":0,"x":0.97},{"duration":7,"tweenEasing":0,"x":0.97},{"duration":9,"tweenEasing":0,"x":0.98},{"duration":0,"x":0.98,"y":0.99}]},{"name":"hand_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.82,"y":0.57},{"duration":7,"tweenEasing":0,"x":0.59,"y":0.54},{"duration":2,"tweenEasing":0,"x":0.27,"y":0.72},{"duration":7,"tweenEasing":0,"x":0.27,"y":0.6},{"duration":7,"tweenEasing":0,"x":0.24,"y":0.81},{"duration":3,"tweenEasing":0,"x":0.16,"y":0.89},{"duration":3,"tweenEasing":0,"x":0.17,"y":0.8},{"duration":5,"tweenEasing":0,"x":0.25,"y":0.9},{"duration":2,"tweenEasing":0,"x":0.37,"y":0.92},{"duration":3,"tweenEasing":0,"x":0.45,"y":0.91},{"duration":7,"tweenEasing":0,"x":0.5,"y":0.89},{"duration":9,"tweenEasing":0,"x":0.61,"y":0.87},{"duration":0,"x":0.76,"y":0.68}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":5.14},{"duration":7,"tweenEasing":0,"rotate":6.86},{"duration":2,"tweenEasing":0,"rotate":9.82},{"duration":7,"tweenEasing":0,"rotate":9.31},{"duration":7,"tweenEasing":0,"rotate":7.06},{"duration":3,"tweenEasing":0,"rotate":4.3},{"duration":3,"tweenEasing":0,"rotate":4.05},{"duration":5,"tweenEasing":0,"rotate":5.06},{"duration":2,"tweenEasing":0,"rotate":7.32},{"duration":3,"tweenEasing":0,"rotate":8.08},{"duration":7,"tweenEasing":0,"rotate":9.08},{"duration":9,"tweenEasing":0,"rotate":9.35},{"duration":0,"rotate":5.91}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99,"y":0.95},{"duration":7,"tweenEasing":0,"x":0.99,"y":0.96},{"duration":2,"tweenEasing":0,"y":0.97},{"duration":7,"tweenEasing":0,"y":0.97},{"duration":23,"tweenEasing":0,"x":0.99,"y":0.97},{"duration":7,"tweenEasing":0,"x":0.99,"y":0.97},{"duration":9,"tweenEasing":0,"y":0.97},{"duration":0,"y":0.96}]},{"name":"weapon_hand_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.11,"y":0.01},{"duration":7,"tweenEasing":0,"x":0.11,"y":-0.01},{"duration":2,"tweenEasing":0,"x":0.05,"y":0.04},{"duration":7,"tweenEasing":0,"x":0.05,"y":0.03},{"duration":7,"tweenEasing":0,"x":0.09,"y":0.02},{"duration":3,"tweenEasing":0,"y":0.04},{"duration":3,"tweenEasing":0,"x":0.02,"y":0.01},{"duration":5,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.02},{"duration":3,"tweenEasing":0,"x":0.08,"y":0.03},{"duration":7,"tweenEasing":0,"x":0.06,"y":0.01},{"duration":9,"tweenEasing":0,"x":0.05,"y":0.03},{"duration":0,"x":0.12,"y":-0.04}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":21.05},{"duration":7,"tweenEasing":0,"rotate":19.94},{"duration":2,"tweenEasing":0,"rotate":17.95},{"duration":7,"tweenEasing":0,"rotate":18.42},{"duration":7,"tweenEasing":0,"rotate":20.58},{"duration":3,"tweenEasing":0,"rotate":23.19},{"duration":3,"tweenEasing":0,"rotate":23.94},{"duration":5,"tweenEasing":0,"rotate":23.5},{"duration":2,"tweenEasing":0,"rotate":22.36},{"duration":3,"tweenEasing":0,"rotate":21.8},{"duration":7,"tweenEasing":0,"rotate":21.24},{"duration":9,"tweenEasing":0,"rotate":20.8},{"duration":0,"rotate":21.25}]},{"name":"weapon_hand_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.04,"y":-0.01},{"duration":7,"tweenEasing":0,"x":-0.03},{"duration":2,"tweenEasing":0,"x":-0.03,"y":0.05},{"duration":7,"tweenEasing":0,"x":-0.05,"y":0.07},{"duration":7,"tweenEasing":0,"x":-0.03,"y":0.01},{"duration":3,"tweenEasing":0,"x":-0.04,"y":-0.03},{"duration":3,"tweenEasing":0,"x":-0.03,"y":0.01},{"duration":5,"tweenEasing":0,"x":-0.01,"y":-0.03},{"duration":2,"tweenEasing":0,"x":-0.02,"y":-0.02},{"duration":3,"tweenEasing":0,"x":-0.03,"y":-0.01},{"duration":7,"tweenEasing":0,"y":0.06},{"duration":9,"tweenEasing":0,"x":-0.02,"y":0.06},{"duration":0,"x":-0.04}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-3.01},{"duration":7,"tweenEasing":0},{"duration":2,"tweenEasing":0,"rotate":6.76},{"duration":7,"tweenEasing":0,"rotate":8.77},{"duration":7,"tweenEasing":0,"rotate":14.4},{"duration":3,"tweenEasing":0,"rotate":18.27},{"duration":3,"tweenEasing":0,"rotate":19.78},{"duration":5,"tweenEasing":0,"rotate":21.53},{"duration":2,"tweenEasing":0,"rotate":24.53},{"duration":3,"tweenEasing":0,"rotate":24.28},{"duration":7,"tweenEasing":0,"rotate":21.78},{"duration":9,"tweenEasing":0,"rotate":12.52},{"duration":0,"rotate":-0.5}]},{"name":"root","translateFrame":[{"duration":10,"tweenEasing":0,"x":-10.2,"y":6},{"duration":19,"tweenEasing":0,"x":-9.25,"y":0.15},{"duration":8,"tweenEasing":0,"x":-10.2,"y":6.45},{"duration":21,"tweenEasing":0,"x":-11.2,"y":6.2},{"duration":0,"x":-10.3,"y":5.95}]},{"name":"thigh_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":4.01,"y":-18.65},{"duration":2,"tweenEasing":0,"x":7.51,"y":-19.05},{"duration":5,"tweenEasing":0,"x":8.91,"y":-19.41},{"duration":2,"tweenEasing":0,"x":7.15,"y":-20.13},{"duration":7,"tweenEasing":0,"x":4.55,"y":-20.62},{"duration":7,"tweenEasing":0,"x":-0.31,"y":-22.16},{"duration":3,"tweenEasing":0,"x":3.19,"y":-23.54},{"duration":3,"tweenEasing":0,"x":7.89,"y":-24.42},{"duration":5,"tweenEasing":0,"x":9.28,"y":-24.92},{"duration":2,"tweenEasing":0,"x":6.24,"y":-24.81},{"duration":3,"tweenEasing":0,"x":2.79,"y":-24.59},{"duration":7,"tweenEasing":0,"x":-1.46,"y":-24.02},{"duration":9,"tweenEasing":0,"x":-4.15,"y":-21.96},{"duration":0,"x":1.01,"y":-19.18}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-21.02},{"duration":2,"tweenEasing":0,"rotate":-22.53},{"duration":5,"tweenEasing":0,"rotate":-26.04},{"duration":2,"tweenEasing":0,"rotate":-53.15},{"duration":7,"tweenEasing":0,"rotate":-58.92},{"duration":7,"tweenEasing":0,"rotate":-60.43},{"duration":3,"tweenEasing":0,"rotate":-72.97},{"duration":3,"tweenEasing":0,"rotate":-65.19},{"duration":5,"tweenEasing":0,"rotate":-68.71},{"duration":2,"tweenEasing":0,"rotate":-61.43},{"duration":3,"tweenEasing":0,"rotate":-54.4},{"duration":7,"tweenEasing":0,"rotate":-44.36},{"duration":9,"tweenEasing":0,"rotate":-31.31},{"duration":0,"rotate":-21.52}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":5,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":9,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":7,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":10,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":7,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":9,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":0,"x":1.01}]},{"name":"thigh_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-3.92,"y":18.44},{"duration":7,"tweenEasing":0,"x":-2.32,"y":18.74},{"duration":2,"tweenEasing":0,"x":-6.97,"y":19.88},{"duration":7,"tweenEasing":0,"x":-10.26,"y":20.24},{"duration":7,"tweenEasing":0,"x":-16.06,"y":21.61},{"duration":3,"tweenEasing":0,"x":-12.5,"y":23.28},{"duration":3,"tweenEasing":0,"x":-7.64,"y":24.11},{"duration":2,"tweenEasing":0,"x":-5.54,"y":24.65},{"duration":3,"tweenEasing":0,"x":-4.94,"y":24.74},{"duration":2,"tweenEasing":0,"x":-6.19,"y":24.45},{"duration":3,"tweenEasing":0,"x":-8.64,"y":24.41},{"duration":7,"tweenEasing":0,"x":-11.74,"y":24.08},{"duration":9,"tweenEasing":0,"x":-13.1,"y":22.08},{"duration":0,"x":-7.02,"y":19.06}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-20.58},{"duration":7,"tweenEasing":0,"rotate":-21.34},{"duration":2,"tweenEasing":0,"rotate":-5.52},{"duration":7,"tweenEasing":0,"rotate":1.26},{"duration":7,"tweenEasing":0,"rotate":20.33},{"duration":3,"tweenEasing":0,"rotate":26.84},{"duration":3,"tweenEasing":0,"rotate":21.33},{"duration":2,"tweenEasing":0,"rotate":19.83},{"duration":3,"tweenEasing":0,"rotate":16.31},{"duration":2,"tweenEasing":0,"rotate":1.76},{"duration":3,"tweenEasing":0,"rotate":-8.29},{"duration":7,"tweenEasing":0,"rotate":-15.32},{"duration":9,"tweenEasing":0,"rotate":-18.83},{"duration":0,"rotate":-19.05}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.02},{"duration":7,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":7,"tweenEasing":0,"x":1.01},{"duration":7,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.97,"y":1.01},{"duration":3,"tweenEasing":0,"x":0.98,"y":1.01},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":3,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0},{"duration":7,"tweenEasing":0,"x":1.01},{"duration":9,"tweenEasing":0,"x":1.01},{"duration":0,"x":1.01,"y":1.01}]},{"name":"calf_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.31,"y":-0.21},{"duration":2,"tweenEasing":0,"x":0.32,"y":-0.17},{"duration":5,"tweenEasing":0,"x":0.29,"y":-0.21},{"duration":2,"tweenEasing":0,"x":0.19,"y":-0.17},{"duration":7,"tweenEasing":0,"x":0.22,"y":-0.2},{"duration":7,"tweenEasing":0,"x":0.2,"y":-0.26},{"duration":3,"tweenEasing":0,"x":0.28,"y":-0.34},{"duration":3,"tweenEasing":0,"x":0.23,"y":-0.14},{"duration":5,"tweenEasing":0,"x":0.25,"y":-0.26},{"duration":2,"tweenEasing":0,"x":0.31,"y":-0.12},{"duration":3,"tweenEasing":0,"x":0.32,"y":-0.15},{"duration":7,"tweenEasing":0,"x":0.34,"y":-0.14},{"duration":9,"tweenEasing":0,"x":0.4,"y":-0.26},{"duration":0,"x":0.45,"y":-0.39}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":48.14},{"duration":2,"tweenEasing":0,"rotate":58.43},{"duration":5,"tweenEasing":0,"rotate":64.7},{"duration":2,"tweenEasing":0,"rotate":80.26},{"duration":7,"tweenEasing":0,"rotate":79.51},{"duration":7,"tweenEasing":0,"rotate":56.68},{"duration":3,"tweenEasing":0,"rotate":52.2},{"duration":3,"tweenEasing":0,"rotate":42.17},{"duration":5,"tweenEasing":0,"rotate":48.44},{"duration":2,"tweenEasing":0,"rotate":48.66},{"duration":3,"tweenEasing":0,"rotate":43.64},{"duration":7,"tweenEasing":0,"rotate":35.85},{"duration":9,"tweenEasing":0,"rotate":32.07},{"duration":0,"rotate":41.6}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":2,"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":7,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":7,"tweenEasing":0,"x":1.01},{"duration":3,"tweenEasing":0,"x":1.02,"y":1.01},{"duration":3,"tweenEasing":0,"x":1.02,"y":1.01},{"duration":5,"tweenEasing":0,"x":1.01,"y":1.01},{"duration":2,"tweenEasing":0,"x":0.99,"y":1.01},{"duration":10,"tweenEasing":0,"x":0.99},{"duration":9,"tweenEasing":0,"x":0.99},{"duration":0,"x":0.98}]},{"name":"calf_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.23,"y":-0.13},{"duration":7,"tweenEasing":0,"x":-0.2,"y":-0.11},{"duration":2,"tweenEasing":0,"x":-0.2,"y":-0.17},{"duration":7,"tweenEasing":0,"x":-0.16,"y":-0.22},{"duration":7,"tweenEasing":0,"x":-0.1,"y":-0.21},{"duration":3,"tweenEasing":0,"x":0.01,"y":-0.26},{"duration":3,"tweenEasing":0,"y":-0.2},{"duration":2,"tweenEasing":0,"x":-0.01,"y":-0.23},{"duration":3,"tweenEasing":0,"y":-0.2},{"duration":2,"tweenEasing":0,"x":-0.04,"y":-0.13},{"duration":3,"tweenEasing":0,"x":-0.07,"y":-0.1},{"duration":7,"tweenEasing":0,"x":-0.08,"y":-0.1},{"duration":9,"tweenEasing":0,"x":-0.12,"y":-0.06},{"duration":0,"x":-0.18,"y":-0.15}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":26.19},{"duration":7,"tweenEasing":0,"rotate":27.35},{"duration":2,"tweenEasing":0,"rotate":23.54},{"duration":7,"tweenEasing":0,"rotate":19.51},{"duration":7,"tweenEasing":0,"rotate":10.96},{"duration":3,"tweenEasing":0,"rotate":20.49},{"duration":3,"tweenEasing":0,"rotate":36.56},{"duration":2,"tweenEasing":0,"rotate":47.6},{"duration":3,"tweenEasing":0,"rotate":54.38},{"duration":2,"tweenEasing":0,"rotate":63.92},{"duration":3,"tweenEasing":0,"rotate":66.19},{"duration":7,"tweenEasing":0,"rotate":62.92},{"duration":9,"tweenEasing":0,"rotate":43.86},{"duration":0,"rotate":24.05}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.01},{"duration":7,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":7,"tweenEasing":0,"x":1.02},{"duration":7,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":3,"tweenEasing":0,"y":0.99},{"duration":5,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":2,"tweenEasing":0,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":7,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":9,"tweenEasing":0,"x":0.98},{"duration":0}]},{"name":"foot_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-1.36,"y":-0.26},{"duration":2,"tweenEasing":0,"x":-1.5,"y":-0.23},{"duration":5,"tweenEasing":0,"x":-1.42,"y":-0.27},{"duration":2,"tweenEasing":0,"x":-1.25,"y":-0.05},{"duration":7,"tweenEasing":0,"x":-1.1,"y":-0.26},{"duration":7,"tweenEasing":0,"x":-0.96,"y":0.15},{"duration":3,"tweenEasing":0,"x":-0.98,"y":-0.08},{"duration":3,"tweenEasing":0,"x":-1.09},{"duration":5,"tweenEasing":0,"x":-1.09,"y":0.03},{"duration":2,"tweenEasing":0,"x":-0.99,"y":0.35},{"duration":3,"tweenEasing":0,"x":-0.97,"y":0.2},{"duration":7,"tweenEasing":0,"x":-0.99,"y":0.19},{"duration":9,"tweenEasing":0,"x":-1.1,"y":-0.15},{"duration":0,"x":-1.33,"y":-0.13}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-20.1},{"duration":2,"tweenEasing":0,"rotate":-16.61},{"duration":5,"tweenEasing":0,"rotate":-12.35},{"duration":2,"tweenEasing":0,"rotate":10.49},{"duration":7,"tweenEasing":0,"rotate":13.25},{"duration":7,"tweenEasing":0,"rotate":3.01},{"duration":3,"tweenEasing":0,"rotate":5.76},{"duration":3,"tweenEasing":0,"rotate":23.03},{"duration":5,"tweenEasing":0,"rotate":20.28},{"duration":2,"tweenEasing":0,"rotate":12.78},{"duration":3,"tweenEasing":0,"rotate":10.78},{"duration":7,"tweenEasing":0,"rotate":8.52},{"duration":9,"tweenEasing":0,"rotate":-0.75},{"duration":0,"rotate":-16.03}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":0.97,"y":0.99},{"duration":5,"tweenEasing":0,"x":0.97,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":7,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":7,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":20,"tweenEasing":0},{"duration":9,"tweenEasing":0},{"duration":0,"x":0.98}]},{"name":"foot_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":9.56,"y":-0.87},{"duration":7,"tweenEasing":0,"x":9.49,"y":-0.62},{"duration":2,"tweenEasing":0,"x":9.45,"y":-0.44},{"duration":7,"tweenEasing":0,"x":9.45,"y":-0.55},{"duration":7,"tweenEasing":0,"x":9.42,"y":-0.77},{"duration":3,"tweenEasing":0,"x":9.29,"y":-1.04},{"duration":3,"tweenEasing":0,"x":9.26,"y":-1.12},{"duration":2,"tweenEasing":0,"x":9.2,"y":-1.13},{"duration":3,"tweenEasing":0,"x":9.22,"y":-1.22},{"duration":2,"tweenEasing":0,"x":9.35,"y":-1.02},{"duration":3,"tweenEasing":0,"x":9.53,"y":-0.95},{"duration":7,"tweenEasing":0,"x":9.67,"y":-1.01},{"duration":9,"tweenEasing":0,"x":9.77,"y":-0.62},{"duration":0,"x":9.62,"y":-0.7}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-6.94},{"duration":7,"tweenEasing":0,"rotate":-7.25},{"duration":2,"tweenEasing":0,"rotate":-19},{"duration":7,"tweenEasing":0,"rotate":-21.75},{"duration":7,"tweenEasing":0,"rotate":-31.28},{"duration":3,"tweenEasing":0,"rotate":-44.59},{"duration":3,"tweenEasing":0,"rotate":-49.88},{"duration":2,"tweenEasing":0,"rotate":-47.9},{"duration":3,"tweenEasing":0,"rotate":-44.39},{"duration":2,"tweenEasing":0,"rotate":-31.6},{"duration":3,"tweenEasing":0,"rotate":-20.56},{"duration":7,"tweenEasing":0,"rotate":-18.8},{"duration":9,"tweenEasing":0,"rotate":-26.94},{"duration":0,"rotate":-13.54}],"scaleFrame":[{"duration":19,"tweenEasing":0},{"duration":7,"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":10,"tweenEasing":0,"y":0.99},{"duration":7,"tweenEasing":0,"y":0.99},{"duration":9,"tweenEasing":0,"x":1.01},{"duration":0}]}],"slot":[{"name":"pelvis","displayFrame":[{"duration":58,"value":1}]},{"name":"forearm_r","displayFrame":[{"duration":58,"value":1}]},{"name":"hand_r","displayFrame":[{"duration":58,"value":1}]},{"name":"shouder_r","displayFrame":[{"duration":58,"value":1}]},{"name":"chest","displayFrame":[{"duration":58,"value":1}]},{"name":"shouder_l","displayFrame":[{"duration":58,"value":1}]},{"name":"hand_l","displayFrame":[{"duration":58,"value":1}]},{"name":"forearm_l","displayFrame":[{"duration":58,"value":1}]},{"name":"calf_r","displayFrame":[{"duration":58,"value":1}]},{"name":"foot_r","displayFrame":[{"duration":58,"value":1}]},{"name":"calf_l","displayFrame":[{"duration":58,"value":1}]}]},{"duration":66,"fadeInTime":0.1,"name":"death","bone":[{"name":"pelvis","translateFrame":[{"duration":6,"tweenEasing":0,"x":0.01,"y":-0.02},{"duration":4,"tweenEasing":0,"x":0.02,"y":-0.04},{"duration":2,"tweenEasing":0,"x":0.03,"y":-0.01},{"duration":10,"tweenEasing":0,"x":0.05,"y":0.01},{"duration":10,"tweenEasing":0,"x":0.02,"y":-0.02},{"duration":5,"tweenEasing":0,"x":0.04,"y":0.01},{"duration":2,"tweenEasing":0,"x":0.01,"y":-0.01},{"duration":3,"tweenEasing":0,"x":0.01},{"duration":3,"tweenEasing":0,"x":2.22,"y":-1.07},{"duration":2,"tweenEasing":0,"x":0.04,"y":-0.13},{"duration":3,"tweenEasing":0,"x":-0.4,"y":-1.02},{"duration":4,"tweenEasing":0,"y":-0.05},{"duration":3,"tweenEasing":0,"x":-3.97,"y":-2.04},{"duration":9,"tweenEasing":0,"x":1.08,"y":-2.01},{"duration":0,"x":0.03,"y":-0.07}],"rotateFrame":[{"duration":6,"tweenEasing":0,"rotate":17.28},{"duration":4,"tweenEasing":0,"rotate":5.5},{"duration":2,"tweenEasing":0,"rotate":-5.5},{"duration":10,"tweenEasing":0,"rotate":-6},{"duration":10,"tweenEasing":0,"rotate":1.75},{"duration":5,"tweenEasing":0,"rotate":5.5},{"duration":2,"tweenEasing":0,"rotate":-7},{"duration":3,"tweenEasing":0,"rotate":-10.51},{"duration":3,"tweenEasing":0,"rotate":6.51},{"duration":2,"tweenEasing":0,"rotate":20.04},{"duration":3,"tweenEasing":0,"rotate":41.37},{"duration":4,"tweenEasing":0,"rotate":82.99},{"duration":3,"tweenEasing":0,"rotate":84},{"duration":9,"tweenEasing":0,"rotate":87.25},{"duration":0,"rotate":85}],"scaleFrame":[{"duration":6,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":10,"tweenEasing":0,"x":0.98},{"duration":10,"tweenEasing":0,"x":0.98},{"duration":5,"tweenEasing":0,"x":0.96},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":3,"tweenEasing":0,"x":0.98},{"duration":3,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":4,"tweenEasing":0,"x":1.04},{"duration":3,"tweenEasing":0,"x":1.04},{"duration":9,"x":1.03}]},{"name":"chest","translateFrame":[{"duration":6,"tweenEasing":0,"y":-4.42},{"duration":3,"tweenEasing":0,"x":-0.17,"y":1.78},{"tweenEasing":0,"x":0.29,"y":3.02},{"duration":2,"tweenEasing":0,"x":-1.23,"y":5.4},{"duration":10,"tweenEasing":0,"x":-1.7,"y":5.86},{"duration":10,"tweenEasing":0,"x":-0.75,"y":3.36},{"duration":5,"tweenEasing":0,"x":0.08,"y":-0.35},{"duration":2,"tweenEasing":0,"x":0.26,"y":0.23},{"duration":3,"tweenEasing":0,"x":0.07,"y":0.29},{"duration":3,"tweenEasing":0,"x":-0.22,"y":-2.19},{"duration":2,"tweenEasing":0,"x":-0.77,"y":0.29},{"duration":3,"tweenEasing":0,"x":-1.18,"y":2.7},{"duration":4,"tweenEasing":0,"x":-0.82,"y":2.41},{"duration":3,"tweenEasing":0,"x":-0.6,"y":1.43},{"duration":4,"tweenEasing":0,"x":-0.64,"y":1.64},{"duration":5,"tweenEasing":0,"x":-0.73,"y":3.3},{"duration":0,"x":-0.44,"y":1.56}],"rotateFrame":[{"duration":6,"tweenEasing":0,"rotate":44.35},{"duration":3,"tweenEasing":0,"rotate":24.74},{"tweenEasing":0,"rotate":10.26},{"duration":2,"tweenEasing":0,"rotate":8.29},{"duration":10,"tweenEasing":0,"rotate":4.32},{"duration":10,"tweenEasing":0,"rotate":1.32},{"duration":5,"tweenEasing":0,"rotate":1.88},{"duration":2,"tweenEasing":0,"rotate":-2.13},{"duration":3,"tweenEasing":0,"rotate":-0.44},{"duration":3,"tweenEasing":0,"rotate":15.76},{"duration":2,"tweenEasing":0,"rotate":37.03},{"duration":3,"tweenEasing":0,"rotate":17.21},{"duration":4,"tweenEasing":0,"rotate":-25.71},{"duration":3,"tweenEasing":0,"rotate":15.88},{"duration":4,"tweenEasing":0,"rotate":-3.38},{"duration":5,"tweenEasing":0,"rotate":12.65},{"duration":0,"rotate":15.67}],"scaleFrame":[{"duration":6,"tweenEasing":0,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.01,"y":0.99},{"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":1.03},{"duration":10,"tweenEasing":0,"x":0.99},{"duration":10,"tweenEasing":0,"x":0.93},{"duration":5,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":3,"tweenEasing":0,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.95,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.94,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0},{"duration":5,"x":1.01}]},{"name":"shouder_r","translateFrame":[{"duration":6,"tweenEasing":0,"x":-16.22,"y":47.36},{"duration":3,"tweenEasing":0,"x":8.72,"y":51.8},{"tweenEasing":0,"x":19.98,"y":43.1},{"duration":2,"tweenEasing":0,"x":10.45,"y":34.31},{"duration":10,"tweenEasing":0,"x":-5.07,"y":31.15},{"duration":10,"tweenEasing":0,"x":-12.46,"y":33.56},{"duration":5,"tweenEasing":0,"x":3.55,"y":36.17},{"duration":2,"tweenEasing":0,"x":5.2,"y":29.39},{"duration":3,"tweenEasing":0,"x":5.7,"y":24.72},{"duration":3,"tweenEasing":0,"x":-2.77,"y":17.7},{"duration":2,"tweenEasing":0,"x":-19.27,"y":25.65},{"duration":3,"tweenEasing":0,"x":-7.75,"y":42.19},{"duration":4,"tweenEasing":0,"x":-21.74,"y":89.67},{"duration":3,"tweenEasing":0,"x":-6.07,"y":82.06},{"duration":4,"tweenEasing":0,"x":-9.08,"y":84.68},{"duration":5,"tweenEasing":0,"x":-3.8,"y":80.9},{"duration":0,"x":-3.27,"y":80.99}],"rotateFrame":[{"duration":6,"tweenEasing":0,"rotate":-81.03},{"duration":3,"tweenEasing":0,"rotate":69.12},{"tweenEasing":0,"rotate":70.36},{"duration":2,"tweenEasing":0,"rotate":7.92},{"duration":10,"tweenEasing":0,"rotate":-7.21},{"duration":10,"tweenEasing":0,"rotate":6.38},{"duration":5,"tweenEasing":0,"rotate":-12.29},{"duration":2,"tweenEasing":0,"rotate":32.33},{"duration":3,"tweenEasing":0,"rotate":78.92},{"duration":3,"tweenEasing":0,"rotate":23.95},{"duration":2,"tweenEasing":0,"rotate":-17.09},{"duration":3,"tweenEasing":0,"rotate":-30.39},{"duration":4,"tweenEasing":0,"rotate":-8.51},{"duration":3,"tweenEasing":0,"rotate":-68.19},{"duration":4,"tweenEasing":0,"rotate":-62.93},{"duration":5,"tweenEasing":0,"rotate":-55.67},{"duration":0,"rotate":-55.92}]},{"name":"shouder_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":11.61,"y":-72.42},{"duration":2,"tweenEasing":0,"x":-5.76,"y":-80.78},{"duration":3,"tweenEasing":0,"x":-8.72,"y":-78.39},{"tweenEasing":0,"x":-2.95,"y":-57.72},{"duration":2,"tweenEasing":0,"x":1.41,"y":-46.96},{"duration":10,"tweenEasing":0,"x":12.62,"y":-30.94},{"duration":10,"tweenEasing":0,"x":25.11,"y":-34.39},{"duration":5,"tweenEasing":0,"x":9.83,"y":-43.13},{"duration":2,"tweenEasing":0,"x":8.63,"y":-34.7},{"duration":3,"tweenEasing":0,"x":7.65,"y":-29.28},{"duration":3,"tweenEasing":0,"x":12.49,"y":-20.29},{"duration":2,"tweenEasing":0,"x":19.59,"y":-26.56},{"duration":3,"tweenEasing":0,"x":8.86,"y":-55.46},{"duration":4,"tweenEasing":0,"x":18.47,"y":-101.99},{"duration":3,"tweenEasing":0,"x":-1.56,"y":-87.6},{"duration":4,"tweenEasing":0,"x":1,"y":-89.75},{"duration":5,"tweenEasing":0,"x":-3.49,"y":-86.4},{"duration":0,"x":-3.68,"y":-86.97}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-106.06},{"duration":2,"tweenEasing":0,"rotate":-8.75},{"duration":3,"tweenEasing":0,"rotate":3.7},{"tweenEasing":0,"rotate":16.47},{"duration":2,"tweenEasing":0,"rotate":17.43},{"duration":10,"tweenEasing":0,"rotate":16.36},{"duration":10,"tweenEasing":0,"rotate":1.1},{"duration":5,"tweenEasing":0,"rotate":25.08},{"duration":2,"tweenEasing":0,"rotate":27.28},{"duration":3,"tweenEasing":0,"rotate":21},{"duration":3,"tweenEasing":0,"rotate":-9.44},{"duration":2,"tweenEasing":0,"rotate":-30.15},{"duration":3,"tweenEasing":0,"rotate":1.96},{"duration":4,"tweenEasing":0,"rotate":-20.8},{"duration":3,"tweenEasing":0,"rotate":-28.08},{"duration":4,"tweenEasing":0,"rotate":-20.04},{"duration":5,"tweenEasing":0,"rotate":-19.34},{"duration":0,"rotate":-19.1}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":0.88,"y":0.99},{"duration":2,"tweenEasing":0,"x":1.08,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.09,"y":0.99},{"tweenEasing":0,"x":1.01,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":10,"tweenEasing":0,"x":0.94,"y":0.99},{"duration":10,"tweenEasing":0,"x":1.01},{"duration":5,"tweenEasing":0,"x":0.94,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.86,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.84},{"duration":3,"tweenEasing":0,"x":0.81,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.78,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.82},{"duration":4,"tweenEasing":0,"x":0.72,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.19},{"duration":4,"tweenEasing":0,"x":1.18},{"duration":5,"tweenEasing":0,"x":1.2},{"duration":0,"x":1.15}]},{"name":"forearm_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.48,"y":0.64},{"duration":2,"tweenEasing":0,"x":-1.64,"y":-1.2},{"duration":3,"tweenEasing":0,"x":-1.85,"y":-1.3},{"tweenEasing":0,"x":-1.3,"y":-1.64},{"duration":2,"tweenEasing":0,"x":-0.93,"y":-1.66},{"duration":10,"tweenEasing":0,"x":-0.47,"y":-1.5},{"duration":10,"tweenEasing":0,"x":-0.45,"y":-0.94},{"duration":5,"tweenEasing":0,"x":-1.01,"y":-1.68},{"duration":2,"tweenEasing":0,"x":-0.1,"y":-1.35},{"duration":3,"tweenEasing":0,"x":-0.24,"y":-0.78},{"duration":3,"tweenEasing":0,"x":-0.02,"y":-0.24},{"duration":2,"tweenEasing":0,"x":-0.06,"y":-0.06},{"duration":3,"tweenEasing":0,"x":-0.57,"y":-0.8},{"duration":4,"tweenEasing":0,"x":0.2,"y":-0.35},{"duration":3,"tweenEasing":0,"x":-1.5,"y":-0.29},{"duration":4,"tweenEasing":0,"x":-1.45,"y":-0.28},{"duration":5,"tweenEasing":0,"x":-1.67,"y":-0.27},{"duration":0,"x":-1.47,"y":-0.31}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-1.88},{"duration":2,"tweenEasing":0,"rotate":-14.52},{"duration":3,"tweenEasing":0,"rotate":-11.52},{"tweenEasing":0,"rotate":-12.78},{"duration":2,"tweenEasing":0,"rotate":-12.29},{"duration":10,"tweenEasing":0,"rotate":-7.79},{"duration":10,"tweenEasing":0,"rotate":11.55},{"duration":5,"tweenEasing":0,"rotate":1.93},{"duration":2,"tweenEasing":0,"rotate":4.68},{"duration":3,"tweenEasing":0,"rotate":5.43},{"duration":3,"tweenEasing":0,"rotate":4.15},{"duration":2,"tweenEasing":0,"rotate":-0.93},{"duration":3,"tweenEasing":0,"rotate":5.3},{"duration":4,"tweenEasing":0,"rotate":40.88},{"duration":3,"tweenEasing":0,"rotate":36.08},{"duration":4,"tweenEasing":0,"rotate":29.81},{"duration":5,"tweenEasing":0,"rotate":39.09},{"duration":0,"rotate":40.61}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.03,"y":1.01},{"duration":2,"tweenEasing":0,"x":0.87,"y":1.01},{"duration":3,"tweenEasing":0,"x":0.86,"y":1.01},{"tweenEasing":0,"x":0.83},{"duration":2,"tweenEasing":0,"x":0.83},{"duration":10,"tweenEasing":0,"x":0.85},{"duration":10,"tweenEasing":0,"x":0.94,"y":1.01},{"duration":5,"tweenEasing":0,"x":0.82,"y":1.01},{"duration":2,"tweenEasing":0,"x":0.76,"y":1.01},{"duration":3,"tweenEasing":0,"x":0.75,"y":1.01},{"duration":3,"tweenEasing":0,"x":0.7,"y":1.01},{"duration":2,"tweenEasing":0,"x":0.66,"y":1.01},{"duration":3,"tweenEasing":0,"x":0.66},{"duration":4,"tweenEasing":0,"x":0.66},{"duration":3,"tweenEasing":0,"x":0.66,"y":1.01},{"duration":4,"tweenEasing":0,"x":0.66},{"duration":5,"tweenEasing":0,"x":0.66,"y":1.01},{"duration":0,"x":0.76,"y":1.01}]},{"name":"forearm_r","translateFrame":[{"duration":6,"tweenEasing":0,"x":-0.66,"y":1.47},{"duration":3,"tweenEasing":0,"x":-8.6,"y":2.14},{"tweenEasing":0,"x":-18.64,"y":2.76},{"duration":2,"tweenEasing":0,"x":-15.02,"y":3.45},{"duration":10,"tweenEasing":0,"x":1.05,"y":2.52},{"duration":10,"tweenEasing":0,"x":-0.94,"y":2.74},{"duration":5,"tweenEasing":0,"x":0.49,"y":2.49},{"duration":2,"tweenEasing":0,"x":3.72,"y":2.31},{"duration":3,"tweenEasing":0,"x":6.09,"y":1.85},{"duration":3,"tweenEasing":0,"x":4.52,"y":1.75},{"duration":2,"tweenEasing":0,"x":6.2,"y":1.52},{"duration":3,"tweenEasing":0,"x":0.7,"y":1.43},{"duration":4,"tweenEasing":0,"x":-21.35,"y":0.38},{"duration":3,"tweenEasing":0,"x":-17.39,"y":-0.07},{"duration":4,"tweenEasing":0,"x":-15.42,"y":-0.08},{"duration":5,"tweenEasing":0,"x":-19.02,"y":0.03},{"duration":0,"x":-18.49,"y":0.04}],"rotateFrame":[{"duration":6,"tweenEasing":0,"rotate":-10.55},{"duration":3,"tweenEasing":0,"rotate":-146.71},{"tweenEasing":0,"rotate":-125.63},{"duration":2,"tweenEasing":0,"rotate":-48.42},{"duration":10,"tweenEasing":0,"rotate":-26.84},{"duration":10,"tweenEasing":0,"rotate":-54.95},{"duration":5,"tweenEasing":0,"rotate":13.27},{"duration":2,"tweenEasing":0,"rotate":-4.33},{"duration":3,"tweenEasing":0,"rotate":-41.41},{"duration":3,"tweenEasing":0,"rotate":4.18},{"duration":2,"tweenEasing":0,"rotate":-9.62},{"duration":3,"tweenEasing":0,"rotate":-4.1},{"duration":4,"tweenEasing":0,"rotate":-31.67},{"duration":3,"tweenEasing":0,"rotate":-4.85},{"duration":4,"tweenEasing":0,"rotate":12.72},{"duration":5,"tweenEasing":0,"rotate":-9.87},{"duration":0,"rotate":-12.37}],"scaleFrame":[{"duration":6,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.89,"y":0.99},{"tweenEasing":0,"x":0.82,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.77,"y":0.99},{"duration":10,"tweenEasing":0,"x":0.9,"y":0.99},{"duration":10,"tweenEasing":0,"x":0.95,"y":0.99},{"duration":5,"tweenEasing":0,"x":0.92},{"duration":2,"tweenEasing":0,"x":0.89},{"duration":3,"tweenEasing":0,"x":0.67},{"duration":3,"tweenEasing":0,"x":0.87,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.93},{"duration":4,"tweenEasing":0,"x":0.74},{"duration":3,"tweenEasing":0,"x":0.77},{"duration":4,"tweenEasing":0,"x":0.74,"y":0.99},{"duration":5,"x":0.72,"y":0.99}]},{"name":"hand_r","translateFrame":[{"duration":6,"tweenEasing":0,"x":1.05,"y":-0.2},{"duration":3,"tweenEasing":0,"x":-0.59,"y":-1.24},{"tweenEasing":0,"x":-1.19,"y":-1.28},{"duration":2,"tweenEasing":0,"x":-1.58,"y":-0.5},{"duration":10,"tweenEasing":0,"x":-0.44,"y":-0.11},{"duration":10,"tweenEasing":0,"x":0.01,"y":-0.19},{"duration":5,"tweenEasing":0,"x":0.14,"y":0.66},{"duration":2,"tweenEasing":0,"x":0.21,"y":0.91},{"duration":3,"tweenEasing":0,"x":-0.3,"y":1.8},{"duration":3,"tweenEasing":0,"x":0.83,"y":1.07},{"duration":2,"tweenEasing":0,"x":0.5,"y":0.19},{"duration":3,"tweenEasing":0,"x":0.8,"y":-0.01},{"duration":4,"tweenEasing":0,"x":1.54,"y":-0.89},{"duration":3,"tweenEasing":0,"x":1.52,"y":-1.07},{"duration":4,"tweenEasing":0,"x":1.48,"y":-1.17},{"duration":5,"tweenEasing":0,"x":1.47,"y":-1.02},{"duration":0,"x":1.43,"y":-1.04}],"rotateFrame":[{"duration":6,"tweenEasing":0,"rotate":4.03},{"duration":3,"tweenEasing":0,"rotate":-12.06},{"tweenEasing":0,"rotate":152.64},{"duration":2,"tweenEasing":0,"rotate":130.33},{"duration":10,"tweenEasing":0,"rotate":134.36},{"duration":10,"tweenEasing":0,"rotate":144.41},{"duration":5,"tweenEasing":0,"rotate":90.23},{"duration":2,"tweenEasing":0,"rotate":79.72},{"duration":3,"tweenEasing":0,"rotate":71.89},{"duration":3,"tweenEasing":0,"rotate":59.63},{"duration":2,"tweenEasing":0,"rotate":110.84},{"duration":3,"tweenEasing":0,"rotate":121.36},{"duration":4,"tweenEasing":0,"rotate":146.89},{"duration":3,"tweenEasing":0,"rotate":155.42},{"duration":4,"tweenEasing":0,"rotate":148.64},{"duration":5,"tweenEasing":0,"rotate":148.89},{"duration":0,"rotate":149.89}],"scaleFrame":[{"duration":6,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.65,"y":0.99},{"tweenEasing":0,"x":0.69},{"duration":2,"tweenEasing":0},{"duration":27,"tweenEasing":0,"x":1.01},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":3,"tweenEasing":0,"x":1.03},{"duration":2,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":4,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":12,"x":0.97}]},{"name":"hand_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.75,"y":0.57},{"duration":2,"tweenEasing":0,"x":0.3,"y":-0.06},{"duration":3,"tweenEasing":0,"x":0.25,"y":-0.4},{"tweenEasing":0,"x":0.83},{"duration":2,"tweenEasing":0,"x":0.99,"y":0.12},{"duration":10,"tweenEasing":0,"x":1.02,"y":0.31},{"duration":10,"tweenEasing":0,"x":0.57,"y":0.3},{"duration":5,"tweenEasing":0,"x":0.84,"y":-0.26},{"duration":2,"tweenEasing":0,"x":1.3,"y":0.25},{"duration":3,"tweenEasing":0,"x":0.66,"y":0.71},{"duration":3,"tweenEasing":0,"x":0.39,"y":1.22},{"duration":2,"tweenEasing":0,"x":-6.35,"y":1.47},{"duration":3,"tweenEasing":0,"x":-18.98,"y":0.39},{"duration":4,"tweenEasing":0,"x":-2.29,"y":0.27},{"duration":3,"tweenEasing":0,"x":-2.72,"y":0.18},{"duration":4,"tweenEasing":0,"x":-2.78,"y":0.33},{"duration":5,"tweenEasing":0,"x":-1.19,"y":0.08},{"duration":0,"x":-0.08,"y":0.23}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":3.25},{"duration":2,"tweenEasing":0,"rotate":15.58},{"duration":3,"tweenEasing":0,"rotate":32.47},{"tweenEasing":0,"rotate":59.31},{"duration":2,"tweenEasing":0,"rotate":63.85},{"duration":10,"tweenEasing":0,"rotate":64.64},{"duration":10,"tweenEasing":0,"rotate":35.73},{"duration":5,"tweenEasing":0,"rotate":26.18},{"duration":2,"tweenEasing":0,"rotate":7.62},{"duration":3,"tweenEasing":0,"rotate":4.93},{"duration":3,"tweenEasing":0,"rotate":12.32},{"duration":2,"tweenEasing":0,"rotate":37.9},{"duration":3,"tweenEasing":0,"rotate":48.02},{"duration":4,"tweenEasing":0,"rotate":51.68},{"duration":3,"tweenEasing":0,"rotate":13.57},{"duration":4,"tweenEasing":0,"rotate":27.35},{"duration":5,"tweenEasing":0,"rotate":3.06},{"duration":0,"rotate":-0.06}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.01,"y":1.02},{"duration":2,"tweenEasing":0,"x":0.98,"y":0.91},{"duration":3,"tweenEasing":0,"x":0.98,"y":0.92},{"tweenEasing":0,"x":0.98,"y":0.92},{"duration":2,"tweenEasing":0,"x":0.97,"y":0.91},{"duration":10,"tweenEasing":0,"x":0.97,"y":0.89},{"duration":10,"tweenEasing":0,"x":0.97,"y":0.89},{"duration":5,"tweenEasing":0,"x":0.96,"y":0.86},{"duration":2,"tweenEasing":0,"x":0.96,"y":0.83},{"duration":3,"tweenEasing":0,"x":0.96,"y":0.82},{"duration":3,"tweenEasing":0,"x":0.94,"y":0.76},{"duration":2,"tweenEasing":0,"x":0.93,"y":0.75},{"duration":3,"tweenEasing":0,"x":0.94,"y":0.75},{"duration":4,"tweenEasing":0,"y":0.97},{"duration":7,"tweenEasing":0,"x":1.02,"y":1.02},{"duration":5,"tweenEasing":0,"x":1.02,"y":1.02},{"duration":0,"x":1.01,"y":1.02}]},{"name":"weapon_hand_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.02,"y":0.01},{"duration":2,"tweenEasing":0,"x":0.09},{"duration":3,"tweenEasing":0,"x":0.07,"y":-0.05},{"tweenEasing":0,"x":0.09,"y":-0.05},{"duration":2,"tweenEasing":0,"x":0.06,"y":-0.04},{"duration":10,"tweenEasing":0,"x":0.09,"y":-0.05},{"duration":10,"tweenEasing":0,"x":0.06,"y":-0.01},{"duration":5,"tweenEasing":0,"x":0.08,"y":0.01},{"duration":2,"tweenEasing":0,"x":0.06},{"duration":3,"tweenEasing":0,"x":0.05,"y":0.02},{"duration":3,"tweenEasing":0,"x":0.04,"y":0.03},{"duration":2,"tweenEasing":0,"x":0.07},{"duration":3,"tweenEasing":0,"x":0.08,"y":0.04},{"duration":4,"tweenEasing":0,"x":0.05,"y":-0.02},{"duration":3,"tweenEasing":0,"x":0.06,"y":0.01},{"duration":4,"tweenEasing":0,"x":0.09,"y":0.01},{"duration":5,"tweenEasing":0,"x":0.05,"y":-0.01},{"duration":0,"x":0.09,"y":0.02}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":4.42},{"duration":2,"tweenEasing":0,"rotate":24.72},{"duration":3,"tweenEasing":0,"rotate":16.51},{"tweenEasing":0,"rotate":9.6},{"duration":2,"tweenEasing":0,"rotate":9.71},{"duration":10,"tweenEasing":0,"rotate":11.52},{"duration":10,"tweenEasing":0,"rotate":25.31},{"duration":5,"tweenEasing":0,"rotate":20.24},{"duration":2,"tweenEasing":0,"rotate":29.56},{"duration":3,"tweenEasing":0,"rotate":31.39},{"duration":3,"tweenEasing":0,"rotate":27.05},{"duration":2,"tweenEasing":0,"rotate":-4.88},{"duration":3,"tweenEasing":0,"rotate":-52.41},{"duration":4,"tweenEasing":0,"rotate":-105.87},{"duration":3,"tweenEasing":0,"rotate":-81.38},{"duration":4,"tweenEasing":0,"rotate":-80.53},{"duration":5,"tweenEasing":0,"rotate":-79.97},{"duration":0,"rotate":-80.88}]},{"name":"weapon_hand_r","translateFrame":[{"duration":6,"tweenEasing":0,"x":0.01,"y":-0.04},{"duration":3,"tweenEasing":0,"x":0.01,"y":-0.07},{"tweenEasing":0,"x":0.05,"y":-0.01},{"duration":2,"tweenEasing":0,"x":0.06},{"duration":10,"tweenEasing":0,"x":0.02,"y":-0.01},{"duration":10,"tweenEasing":0,"x":0.06,"y":-0.02},{"duration":7,"tweenEasing":0,"x":0.02},{"duration":3,"tweenEasing":0,"x":0.02},{"duration":3,"tweenEasing":0,"x":0.06,"y":-0.01},{"duration":2,"tweenEasing":0,"x":0.03,"y":0.01},{"duration":3,"tweenEasing":0,"x":0.03},{"duration":4,"tweenEasing":0,"x":0.01,"y":-0.02},{"duration":3,"tweenEasing":0,"x":-0.02,"y":0.02},{"duration":4,"tweenEasing":0,"x":-0.02,"y":0.02},{"duration":5,"tweenEasing":0,"x":-0.03,"y":0.02},{"duration":0,"x":-0.04,"y":0.02}],"rotateFrame":[{"duration":6,"tweenEasing":0,"rotate":-6.02},{"duration":3,"tweenEasing":0,"rotate":93.01},{"tweenEasing":0,"rotate":105.4},{"duration":2,"tweenEasing":0,"rotate":104.02},{"duration":27,"tweenEasing":0,"rotate":107.78},{"duration":3,"tweenEasing":0,"rotate":107.78},{"duration":3,"tweenEasing":0,"rotate":121.04},{"duration":2,"tweenEasing":0,"rotate":155.41},{"duration":3,"tweenEasing":0,"rotate":159.93},{"duration":4,"tweenEasing":0,"rotate":-179.75},{"duration":12,"rotate":-159.98}]},{"name":"root","translateFrame":[{"duration":6,"tweenEasing":0,"x":-57.1,"y":3.8},{"duration":4,"tweenEasing":0,"x":-103.6,"y":-3.45},{"duration":2,"tweenEasing":0,"x":-104.85,"y":-9.95},{"duration":10,"tweenEasing":0,"x":-97.65,"y":-1.55},{"duration":10,"tweenEasing":0,"x":-102.75,"y":4.3},{"duration":5,"tweenEasing":0,"x":-85.95,"y":-1.55},{"duration":2,"tweenEasing":0,"x":-35.35,"y":1.9},{"duration":6,"tweenEasing":0,"x":-14.2,"y":42.9},{"duration":5,"tweenEasing":0,"x":2.75,"y":49.55},{"duration":16,"tweenEasing":0,"x":22.1,"y":76.05},{"duration":0,"x":25.85,"y":81.4}]},{"name":"thigh_r","translateFrame":[{"duration":6,"tweenEasing":0,"x":2.18,"y":-18.08},{"duration":3,"tweenEasing":0,"x":4.11,"y":-24.65},{"tweenEasing":0,"x":5.35,"y":-16.54},{"duration":2,"tweenEasing":0,"x":7.11,"y":-15.49},{"duration":10,"tweenEasing":0,"x":7.94,"y":-12.53},{"duration":10,"tweenEasing":0,"x":7.45,"y":-15.71},{"duration":5,"tweenEasing":0,"x":9.44,"y":-21.94},{"duration":2,"tweenEasing":0,"x":9.82,"y":-20.3},{"duration":3,"tweenEasing":0,"x":9.68,"y":-17.79},{"duration":3,"tweenEasing":0,"x":4.53,"y":-10.63},{"duration":2,"tweenEasing":0,"x":-0.54,"y":-16.67},{"duration":3,"tweenEasing":0,"x":4.93,"y":-26.35},{"duration":4,"tweenEasing":0,"x":13.17,"y":-27.36},{"duration":3,"tweenEasing":0,"x":5.81,"y":-28.23},{"duration":4,"tweenEasing":0,"x":6.52,"y":-27.39},{"duration":5,"tweenEasing":0,"x":8.12,"y":-25.3},{"duration":0,"x":8.53,"y":-23.06}],"rotateFrame":[{"duration":6,"tweenEasing":0,"rotate":-44.61},{"duration":3,"tweenEasing":0,"rotate":-48.38},{"tweenEasing":0,"rotate":-43.86},{"duration":2,"tweenEasing":0,"rotate":-43.35},{"duration":10,"tweenEasing":0,"rotate":-54.15},{"duration":10,"tweenEasing":0,"rotate":-64.69},{"duration":5,"tweenEasing":0,"rotate":-42.6},{"duration":2,"tweenEasing":0,"rotate":-29.05},{"duration":3,"tweenEasing":0,"rotate":-2.5},{"duration":3,"tweenEasing":0,"rotate":2},{"duration":2,"tweenEasing":0,"rotate":14.27},{"duration":3,"tweenEasing":0,"rotate":37.86},{"duration":4,"tweenEasing":0,"rotate":71.48},{"duration":3,"tweenEasing":0,"rotate":61.96},{"duration":4,"tweenEasing":0,"rotate":63.96},{"duration":5,"tweenEasing":0,"rotate":67.22},{"duration":0,"rotate":63.46}],"scaleFrame":[{"duration":6,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":10,"tweenEasing":0,"x":0.96,"y":0.99},{"duration":10,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":5,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":2,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.02},{"duration":3,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":16,"x":1.02,"y":0.99}]},{"name":"thigh_l","translateFrame":[{"tweenEasing":0,"x":-2.21,"y":17.84},{"duration":5,"tweenEasing":0,"x":-1.98,"y":26.35},{"duration":3,"tweenEasing":0,"x":-4.01,"y":24.18},{"tweenEasing":0,"x":-7.33,"y":19.52},{"duration":2,"tweenEasing":0,"x":-7,"y":15.33},{"duration":10,"tweenEasing":0,"x":-7.75,"y":12.39},{"duration":10,"tweenEasing":0,"x":-7.26,"y":15.51},{"duration":5,"tweenEasing":0,"x":-9.21,"y":21.65},{"duration":2,"tweenEasing":0,"x":-9.65,"y":20.04},{"duration":3,"tweenEasing":0,"x":-9.5,"y":17.65},{"duration":3,"tweenEasing":0,"x":-0.14,"y":8.44},{"duration":2,"tweenEasing":0,"x":0.56,"y":16.32},{"duration":3,"tweenEasing":0,"x":-5.69,"y":23.9},{"duration":4,"tweenEasing":0,"x":-12.98,"y":26.81},{"duration":3,"tweenEasing":0,"x":-13.6,"y":23.76},{"duration":4,"tweenEasing":0,"x":-4.3,"y":22.91},{"duration":5,"tweenEasing":0,"x":-4.16,"y":22.9},{"duration":0,"x":-8.27,"y":22.62}],"rotateFrame":[{"tweenEasing":0,"rotate":-23.85},{"duration":5,"tweenEasing":0,"rotate":39},{"duration":3,"tweenEasing":0,"rotate":-6.78},{"tweenEasing":0,"rotate":12.3},{"duration":2,"tweenEasing":0,"rotate":19.83},{"duration":10,"tweenEasing":0,"rotate":16.07},{"duration":10,"tweenEasing":0,"rotate":-1.5},{"duration":5,"tweenEasing":0,"rotate":32.36},{"duration":2,"tweenEasing":0,"rotate":36.86},{"duration":3,"tweenEasing":0,"rotate":49.37},{"duration":3,"tweenEasing":0,"rotate":66.15},{"duration":2,"tweenEasing":0,"rotate":87.74},{"duration":3,"tweenEasing":0,"rotate":100.55},{"duration":4,"tweenEasing":0,"rotate":114.09},{"duration":3,"tweenEasing":0,"rotate":118.87},{"duration":4,"tweenEasing":0,"rotate":120.64},{"duration":5,"tweenEasing":0,"rotate":117.35},{"duration":0,"rotate":116.86}],"scaleFrame":[{"tweenEasing":0},{"duration":5,"tweenEasing":0,"x":0.77,"y":1.01},{"duration":3,"tweenEasing":0,"x":0.91},{"tweenEasing":0,"x":0.9},{"duration":2,"tweenEasing":0,"x":0.89},{"duration":10,"tweenEasing":0,"x":0.87},{"duration":10,"tweenEasing":0,"x":0.9},{"duration":5,"tweenEasing":0,"x":0.86,"y":1.01},{"duration":2,"tweenEasing":0,"x":0.89,"y":1.01},{"duration":3,"tweenEasing":0,"x":0.81,"y":1.01},{"duration":3,"tweenEasing":0,"x":0.91},{"duration":2,"tweenEasing":0,"x":0.93},{"duration":3,"tweenEasing":0,"x":0.93},{"duration":4,"tweenEasing":0,"x":0.92,"y":1.01},{"duration":3,"tweenEasing":0,"x":0.73,"y":1.01},{"duration":4,"tweenEasing":0,"x":0.66,"y":1.01},{"duration":5,"tweenEasing":0,"x":0.82,"y":1.01},{"duration":0,"x":0.79,"y":1.01}]},{"name":"calf_r","translateFrame":[{"duration":6,"tweenEasing":0,"x":-0.01,"y":-0.28},{"duration":3,"tweenEasing":0,"x":-0.25,"y":-0.22},{"tweenEasing":0,"x":-0.18,"y":-0.15},{"duration":2,"tweenEasing":0,"x":-0.2,"y":-0.16},{"duration":10,"tweenEasing":0,"x":-0.35,"y":-0.11},{"duration":10,"tweenEasing":0,"x":-0.25,"y":-0.33},{"duration":5,"tweenEasing":0,"x":0.06,"y":-0.14},{"duration":2,"tweenEasing":0,"x":0.11,"y":-0.16},{"duration":3,"tweenEasing":0,"x":0.1,"y":-0.01},{"duration":3,"tweenEasing":0,"x":0.09,"y":-0.01},{"duration":2,"tweenEasing":0,"x":0.2,"y":-0.15},{"duration":3,"tweenEasing":0,"x":0.15,"y":-0.23},{"duration":4,"tweenEasing":0,"x":0.09,"y":-0.35},{"duration":3,"tweenEasing":0,"x":0.06,"y":-0.24},{"duration":4,"tweenEasing":0,"x":0.11,"y":-0.16},{"duration":5,"tweenEasing":0,"x":0.11,"y":-0.36},{"duration":0,"x":0.12,"y":-0.21}],"rotateFrame":[{"duration":6,"tweenEasing":0,"rotate":31.33},{"duration":3,"tweenEasing":0,"rotate":45.37},{"tweenEasing":0,"rotate":32.33},{"duration":2,"tweenEasing":0,"rotate":30.83},{"duration":10,"tweenEasing":0,"rotate":51.13},{"duration":10,"tweenEasing":0,"rotate":64.19},{"duration":5,"tweenEasing":0,"rotate":57.91},{"duration":2,"tweenEasing":0,"rotate":66.96},{"duration":3,"tweenEasing":0,"rotate":78.23},{"duration":3,"tweenEasing":0,"rotate":63.48},{"duration":2,"tweenEasing":0,"rotate":50.96},{"duration":3,"tweenEasing":0,"rotate":43.38},{"duration":4,"tweenEasing":0,"rotate":39.35},{"duration":3,"tweenEasing":0,"rotate":31.56},{"duration":4,"tweenEasing":0,"rotate":15.28},{"duration":5,"tweenEasing":0,"rotate":10.01},{"duration":0,"rotate":16.53}],"scaleFrame":[{"duration":6,"tweenEasing":0,"x":1.01,"y":1.01},{"duration":3,"tweenEasing":0,"x":1.04},{"tweenEasing":0,"x":1.04,"y":1.01},{"duration":2,"tweenEasing":0,"x":1.03,"y":1.01},{"duration":10,"tweenEasing":0,"x":1.02},{"duration":10,"tweenEasing":0,"x":1.03},{"duration":5,"tweenEasing":0,"x":1.04},{"duration":2,"tweenEasing":0,"x":1.04},{"duration":3,"tweenEasing":0,"x":1.05,"y":1.01},{"duration":3,"tweenEasing":0,"x":1.04,"y":1.01},{"duration":2,"tweenEasing":0,"x":1.02,"y":1.01},{"duration":3,"tweenEasing":0,"x":1.04},{"duration":4,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.05},{"duration":4,"tweenEasing":0,"x":1.05},{"duration":5,"tweenEasing":0,"x":1.05,"y":1.01},{"duration":0,"x":1.05}]},{"name":"calf_l","translateFrame":[{"tweenEasing":0,"x":-0.28,"y":-0.03},{"duration":5,"tweenEasing":0,"x":0.32,"y":-0.75},{"duration":3,"tweenEasing":0,"x":0.22,"y":-0.19},{"tweenEasing":0,"x":0.32,"y":-0.41},{"duration":2,"tweenEasing":0,"x":0.33,"y":-0.43},{"duration":10,"tweenEasing":0,"x":0.41,"y":-0.39},{"duration":10,"tweenEasing":0,"x":0.2,"y":-0.3},{"duration":5,"tweenEasing":0,"x":0.27,"y":-0.72},{"duration":2,"tweenEasing":0,"x":0.24,"y":-0.35},{"duration":3,"tweenEasing":0,"x":-0.03,"y":-0.21},{"duration":3,"tweenEasing":0,"x":-0.17,"y":-0.26},{"duration":2,"tweenEasing":0,"x":-0.26,"y":-0.42},{"duration":3,"tweenEasing":0,"x":-0.3,"y":-0.44},{"duration":4,"tweenEasing":0,"x":-0.34,"y":-0.27},{"duration":3,"tweenEasing":0,"x":-0.26,"y":-0.48},{"duration":4,"tweenEasing":0,"x":-0.28,"y":-0.44},{"duration":5,"tweenEasing":0,"x":-0.36,"y":-0.34},{"duration":0,"x":-0.33,"y":-0.37}],"rotateFrame":[{"tweenEasing":0,"rotate":41.36},{"duration":5,"tweenEasing":0,"rotate":16.91},{"duration":3,"tweenEasing":0,"rotate":40.79},{"tweenEasing":0,"rotate":14.94},{"duration":2,"tweenEasing":0,"rotate":6.91},{"duration":10,"tweenEasing":0,"rotate":24.2},{"duration":10,"tweenEasing":0,"rotate":45.3},{"duration":5,"tweenEasing":0,"rotate":8.15},{"duration":2,"tweenEasing":0,"rotate":22.24},{"duration":3,"tweenEasing":0,"rotate":48.05},{"duration":3,"tweenEasing":0,"rotate":31.31},{"duration":2,"tweenEasing":0,"rotate":16.24},{"duration":3,"tweenEasing":0,"rotate":5.93},{"duration":4,"tweenEasing":0,"rotate":-6.36},{"duration":3,"tweenEasing":0,"rotate":16.85},{"duration":4,"tweenEasing":0,"rotate":10.27},{"duration":5,"tweenEasing":0,"rotate":-5.17},{"duration":0,"rotate":-6.69}],"scaleFrame":[{"tweenEasing":0,"x":0.95},{"duration":5,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.02,"y":0.99},{"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":10,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":10,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":5,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":3,"tweenEasing":0},{"duration":3,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":3,"tweenEasing":0,"x":1.05,"y":0.99},{"duration":4,"tweenEasing":0,"x":1.05,"y":0.99},{"duration":5,"x":1.03}]},{"name":"foot_r","translateFrame":[{"duration":6,"tweenEasing":0,"x":-1.13,"y":-0.06},{"duration":3,"tweenEasing":0,"x":-1.29,"y":-0.06},{"tweenEasing":0,"x":-1.3,"y":-0.19},{"duration":2,"tweenEasing":0,"x":-1.25,"y":-0.09},{"duration":10,"tweenEasing":0,"x":-1.29,"y":-0.4},{"duration":10,"tweenEasing":0,"x":-1.28,"y":-0.24},{"duration":5,"tweenEasing":0,"x":-1.4},{"duration":2,"tweenEasing":0,"x":-1.29,"y":-0.03},{"duration":3,"tweenEasing":0,"x":-1.3,"y":0.06},{"duration":3,"tweenEasing":0,"x":-1.58},{"duration":2,"tweenEasing":0,"x":-1.63,"y":-0.06},{"duration":3,"tweenEasing":0,"x":-1.54,"y":0.11},{"duration":4,"tweenEasing":0,"x":-1.1,"y":0.07},{"duration":3,"tweenEasing":0,"x":-1.18,"y":-0.07},{"duration":4,"tweenEasing":0,"x":-1.37,"y":0.07},{"duration":5,"tweenEasing":0,"x":-1.38,"y":0.16},{"duration":0,"x":-1.4,"y":0.08}],"rotateFrame":[{"duration":6,"tweenEasing":0,"rotate":13.28},{"duration":3,"tweenEasing":0,"rotate":3.76},{"tweenEasing":0,"rotate":12.78},{"duration":2,"tweenEasing":0,"rotate":14.03},{"duration":10,"tweenEasing":0,"rotate":3.51},{"duration":10,"tweenEasing":0,"rotate":0.75},{"duration":5,"tweenEasing":0,"rotate":-15.05},{"duration":2,"tweenEasing":0,"rotate":48.6},{"duration":3,"tweenEasing":0,"rotate":27.29},{"duration":3,"tweenEasing":0,"rotate":49.32},{"duration":2,"tweenEasing":0,"rotate":65.14},{"duration":3,"tweenEasing":0,"rotate":51.39},{"duration":4,"tweenEasing":0,"rotate":12.5},{"duration":3,"tweenEasing":0,"rotate":53.41},{"duration":4,"tweenEasing":0,"rotate":38.58},{"duration":5,"tweenEasing":0,"rotate":35.06},{"duration":0,"rotate":35.57}],"scaleFrame":[{"duration":32,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.92},{"duration":3,"tweenEasing":0,"x":0.97,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":2,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":7,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":5,"tweenEasing":0,"x":0.97,"y":0.99},{"duration":0,"y":0.99}]},{"name":"foot_l","translateFrame":[{"tweenEasing":0,"x":9.41,"y":-0.93},{"duration":5,"tweenEasing":0,"x":8.62,"y":-1.21},{"duration":3,"tweenEasing":0,"x":8.77,"y":-1.21},{"tweenEasing":0,"x":8.91,"y":-1.14},{"duration":2,"tweenEasing":0,"x":8.97,"y":-1.27},{"duration":10,"tweenEasing":0,"x":8.81,"y":-1.28},{"duration":10,"tweenEasing":0,"x":8.78,"y":-1.26},{"duration":5,"tweenEasing":0,"x":8.77,"y":-1.28},{"duration":2,"tweenEasing":0,"x":8.92,"y":-1.14},{"duration":3,"tweenEasing":0,"x":8.48,"y":-1.05},{"duration":3,"tweenEasing":0,"x":8.67,"y":-0.99},{"duration":2,"tweenEasing":0,"x":8.57,"y":-0.82},{"duration":3,"tweenEasing":0,"x":8.49,"y":-0.83},{"duration":4,"tweenEasing":0,"x":8.59,"y":-0.88},{"duration":3,"tweenEasing":0,"x":8.88,"y":-0.75},{"duration":4,"tweenEasing":0,"x":8.75,"y":-0.71},{"duration":5,"tweenEasing":0,"x":8.59,"y":-0.72},{"duration":0,"x":8.63,"y":-0.6}],"rotateFrame":[{"tweenEasing":0,"rotate":-17.55},{"duration":5,"tweenEasing":0,"rotate":-55.87},{"duration":3,"tweenEasing":0,"rotate":-34.03},{"tweenEasing":0,"rotate":-27.28},{"duration":2,"tweenEasing":0,"rotate":-26.79},{"duration":10,"tweenEasing":0,"rotate":-40.34},{"duration":10,"tweenEasing":0,"rotate":-43.84},{"duration":5,"tweenEasing":0,"rotate":-40.58},{"duration":2,"tweenEasing":0,"rotate":27.58},{"duration":3,"tweenEasing":0,"rotate":-2.01},{"duration":3,"tweenEasing":0,"rotate":25.82},{"duration":2,"tweenEasing":0,"rotate":8.52},{"duration":3,"tweenEasing":0,"rotate":1.76},{"duration":4,"tweenEasing":0,"rotate":5.03},{"duration":3,"tweenEasing":0,"rotate":-6.71},{"duration":4,"tweenEasing":0,"rotate":13.13},{"duration":5,"tweenEasing":0,"rotate":1.29},{"duration":0,"rotate":2.29}],"scaleFrame":[{"duration":32,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.03},{"duration":3,"tweenEasing":0,"x":1.03},{"duration":8,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":4,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.94,"y":0.99},{"duration":5,"x":1.03,"y":0.99}]}],"slot":[{"name":"pelvis","displayFrame":[{"duration":66,"value":1}]},{"name":"forearm_r","displayFrame":[{"duration":66,"value":1}]},{"name":"hand_r","displayFrame":[{"duration":66,"value":-1}]},{"name":"shouder_r","displayFrame":[{"duration":66,"value":1}]},{"name":"chest","displayFrame":[{"duration":50,"value":1},{"duration":16,"value":2}]},{"name":"forearm_l","displayFrame":[{"duration":66,"value":1}]},{"name":"calf_r","displayFrame":[{"duration":66,"value":1}]},{"name":"foot_r","displayFrame":[{"duration":66,"value":1}]},{"name":"calf_l","displayFrame":[{"duration":66,"value":1}]}]},{"duration":9,"fadeInTime":0.1,"name":"hit","bone":[{"name":"pelvis","translateFrame":[{"tweenEasing":0,"x":0.05,"y":-0.09},{"duration":4,"tweenEasing":0,"x":0.02,"y":-0.04},{"duration":4,"tweenEasing":0,"x":0.04,"y":-0.01},{"duration":0,"x":0.02,"y":-0.01}],"rotateFrame":[{"tweenEasing":0,"rotate":6.75},{"duration":4,"tweenEasing":0,"rotate":-8.5},{"duration":4,"tweenEasing":0,"rotate":-10.01},{"duration":0,"rotate":-7}],"scaleFrame":[{"tweenEasing":0,"x":0.97},{"duration":8,"x":0.99}]},{"name":"chest","translateFrame":[{"tweenEasing":0,"x":-0.51,"y":0.82},{"duration":2,"tweenEasing":0,"x":0.23,"y":1.24},{"duration":2,"tweenEasing":0,"x":0.49,"y":-2.96},{"duration":4,"tweenEasing":0,"x":0.18,"y":0.97},{"duration":0,"x":0.12,"y":0.25}],"rotateFrame":[{"tweenEasing":0,"rotate":27.42},{"duration":2,"tweenEasing":0,"rotate":33.34},{"duration":2,"tweenEasing":0,"rotate":5.29},{"duration":4,"tweenEasing":0,"rotate":2.27},{"duration":0,"rotate":-2.97}],"scaleFrame":[{"tweenEasing":0,"x":0.99,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.94,"y":0.99},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0,"x":1.02},{"duration":0,"x":1.01}]},{"name":"shouder_r","translateFrame":[{"tweenEasing":0,"x":-9.53,"y":38.52},{"duration":2,"tweenEasing":0,"x":-14.68,"y":9.08},{"duration":2,"tweenEasing":0,"x":6.64,"y":-10.66},{"duration":4,"tweenEasing":0,"x":9.17,"y":-12.06},{"duration":0,"x":8.94,"y":-12.12}],"rotateFrame":[{"tweenEasing":0,"rotate":-38.87},{"duration":2,"tweenEasing":0,"rotate":-31.32},{"duration":2,"tweenEasing":0,"rotate":6.94},{"duration":4,"tweenEasing":0,"rotate":14.17},{"duration":0,"rotate":8.92}]},{"name":"shouder_l","translateFrame":[{"tweenEasing":0,"x":11.2,"y":-40.24},{"duration":2,"tweenEasing":0,"x":20.13,"y":-10.5},{"duration":2,"tweenEasing":0,"x":-2.49,"y":14.81},{"duration":4,"tweenEasing":0,"x":-4.81,"y":17.52},{"duration":0,"x":-4.43,"y":17.43}],"rotateFrame":[{"tweenEasing":0,"rotate":-38.11},{"duration":2,"tweenEasing":0,"rotate":-36.55},{"duration":2,"tweenEasing":0,"rotate":-18.59},{"duration":4,"tweenEasing":0,"rotate":-16.13},{"duration":0,"rotate":-9.84}],"scaleFrame":[{"tweenEasing":0,"x":0.9},{"duration":2,"tweenEasing":0,"x":1.14},{"duration":2,"tweenEasing":0,"x":1.19},{"duration":4,"tweenEasing":0,"x":1.2},{"duration":0,"x":1.12}]},{"name":"forearm_l","translateFrame":[{"tweenEasing":0,"x":4.97,"y":0.19},{"duration":2,"tweenEasing":0,"x":-0.73,"y":-0.01},{"duration":2,"tweenEasing":0,"x":-0.89,"y":-0.24},{"duration":4,"tweenEasing":0,"x":-0.9,"y":-0.25},{"duration":0,"x":-0.44,"y":0.05}],"rotateFrame":[{"tweenEasing":0,"rotate":15.75},{"duration":2,"tweenEasing":0,"rotate":21.34},{"duration":2,"tweenEasing":0,"rotate":27.35},{"duration":4,"tweenEasing":0,"rotate":26.6},{"duration":0,"rotate":19.55}],"scaleFrame":[{"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":4,"tweenEasing":0,"x":0.95},{"duration":0,"x":0.89}]},{"name":"forearm_r","translateFrame":[{"tweenEasing":0,"x":6.09,"y":1.17},{"duration":2,"tweenEasing":0,"x":1.56,"y":0.36},{"duration":2,"tweenEasing":0,"x":-6.74,"y":-0.81},{"duration":4,"tweenEasing":0,"x":-10.71,"y":-1.18},{"duration":0,"x":-7.55,"y":-0.86}],"rotateFrame":[{"tweenEasing":0,"rotate":-18.3},{"duration":2,"tweenEasing":0,"rotate":14.66},{"duration":2,"tweenEasing":0,"rotate":19.51},{"duration":4,"tweenEasing":0,"rotate":19},{"duration":0,"rotate":15.51}],"scaleFrame":[{"tweenEasing":0,"x":1.03,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.95},{"duration":6,"x":1.02}]},{"name":"hand_r","translateFrame":[{"tweenEasing":0,"x":0.7,"y":-0.3},{"duration":2,"tweenEasing":0,"x":0.07,"y":-0.08},{"duration":2,"tweenEasing":0,"x":-0.39,"y":0.12},{"duration":4,"tweenEasing":0,"x":-0.45,"y":-0.19},{"duration":0,"x":-0.46,"y":0.1}],"rotateFrame":[{"tweenEasing":0,"rotate":-1.49},{"duration":2,"tweenEasing":0,"rotate":0.24},{"duration":2,"tweenEasing":0,"rotate":0.26},{"duration":4,"tweenEasing":0,"rotate":0.51},{"duration":0,"rotate":0.5}],"scaleFrame":[{"tweenEasing":0,"x":0.98,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.95},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":0,"x":1.03}]},{"name":"hand_l","translateFrame":[{"tweenEasing":0,"x":0.17,"y":0.79},{"duration":2,"tweenEasing":0,"x":0.25,"y":0.18},{"duration":2,"tweenEasing":0,"x":0.38,"y":-0.13},{"duration":4,"tweenEasing":0,"x":0.3,"y":-0.26},{"duration":0,"x":0.08,"y":-0.58}],"rotateFrame":[{"tweenEasing":0},{"duration":2,"tweenEasing":0,"rotate":-0.01},{"duration":2,"tweenEasing":0,"rotate":0.01},{"duration":4,"tweenEasing":0,"rotate":0.04},{"duration":0,"rotate":0.15}],"scaleFrame":[{"tweenEasing":0,"x":1.01,"y":1.01},{"duration":2,"tweenEasing":0,"x":1.01,"y":1.02},{"duration":2,"tweenEasing":0,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.99,"y":0.96},{"duration":0,"x":0.97,"y":0.91}]},{"name":"weapon_hand_l","translateFrame":[{"tweenEasing":0,"x":0.02,"y":0.01},{"duration":2,"tweenEasing":0,"x":0.03,"y":-0.01},{"duration":2,"tweenEasing":0,"x":0.02,"y":0.04},{"duration":4,"tweenEasing":0,"x":0.02,"y":0.01},{"duration":0,"x":0.01,"y":0.02}],"rotateFrame":[{"tweenEasing":0,"rotate":24.8},{"duration":2,"tweenEasing":0,"rotate":8.08},{"duration":2,"tweenEasing":0,"rotate":-9.64},{"duration":4,"tweenEasing":0,"rotate":-21.02},{"duration":0,"rotate":-30.54}]},{"name":"weapon_hand_r","translateFrame":[{"tweenEasing":0,"x":0.01,"y":-0.06},{"duration":2,"tweenEasing":0,"x":-0.01,"y":-0.01},{"duration":2,"tweenEasing":0,"x":0.01,"y":-0.01},{"duration":4,"tweenEasing":0,"x":0.01},{"duration":0,"x":0.01,"y":-0.01}],"rotateFrame":[{"tweenEasing":0,"rotate":-12.54},{"duration":2,"tweenEasing":0,"rotate":-9.28},{"duration":2,"tweenEasing":0,"rotate":25.03},{"duration":4,"tweenEasing":0,"rotate":45.83},{"duration":0,"rotate":24.78}]},{"name":"root","translateFrame":[{"tweenEasing":0,"x":22.65,"y":8.35},{"duration":4,"tweenEasing":0,"x":-5.05,"y":9.2},{"duration":4,"tweenEasing":0,"x":-19.9,"y":13.5},{"duration":0,"x":-14.75,"y":12.45}]},{"name":"thigh_r","translateFrame":[{"tweenEasing":0,"x":3.27,"y":-5.25},{"duration":2,"tweenEasing":0,"x":4.88,"y":2.39},{"duration":2,"tweenEasing":0,"x":5.29,"y":7.07},{"duration":4,"tweenEasing":0,"x":4.86,"y":3.57},{"duration":0,"x":3.48,"y":3.43}],"rotateFrame":[{"tweenEasing":0,"rotate":15.02},{"duration":2,"tweenEasing":0,"rotate":-23.27},{"duration":2,"tweenEasing":0,"rotate":-7.24},{"duration":4,"tweenEasing":0,"rotate":-12.24},{"duration":0,"rotate":-2.99}],"scaleFrame":[{"tweenEasing":0,"x":1.02,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.78,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.78},{"duration":4,"tweenEasing":0,"x":0.72},{"duration":0,"x":0.79}]},{"name":"thigh_l","translateFrame":[{"tweenEasing":0,"x":-3.18,"y":5.08},{"duration":2,"tweenEasing":0,"x":-4.79,"y":-2.52},{"duration":2,"tweenEasing":0,"x":-4.39,"y":0.67},{"duration":4,"tweenEasing":0,"x":-4.78,"y":-3.69},{"duration":0,"x":-3.45,"y":-3.44}],"rotateFrame":[{"tweenEasing":0,"rotate":-9.79},{"duration":2,"tweenEasing":0,"rotate":-6.03},{"duration":2,"tweenEasing":0,"rotate":-8.79},{"duration":4,"tweenEasing":0,"rotate":-10.29},{"duration":0,"rotate":-10.04}],"scaleFrame":[{"duration":9,"x":1.01}]},{"name":"calf_r","translateFrame":[{"tweenEasing":0,"x":0.29,"y":-0.16},{"duration":2,"tweenEasing":0,"x":-0.52,"y":-0.16},{"duration":2,"tweenEasing":0,"x":-0.49,"y":0.1},{"duration":4,"tweenEasing":0,"x":-0.62,"y":0.08},{"duration":0,"x":-0.42,"y":0.21}],"rotateFrame":[{"tweenEasing":0,"rotate":5.31},{"duration":2,"tweenEasing":0,"rotate":28.71},{"duration":2,"tweenEasing":0,"rotate":22.72},{"duration":4,"tweenEasing":0,"rotate":25.67},{"duration":0,"rotate":17.72}],"scaleFrame":[{"tweenEasing":0,"x":1.02,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.96},{"duration":6,"x":0.95}]},{"name":"calf_l","translateFrame":[{"tweenEasing":0,"x":-0.04,"y":-0.14},{"duration":2,"tweenEasing":0,"y":-0.1},{"duration":2,"tweenEasing":0,"x":-0.05,"y":-0.15},{"duration":4,"tweenEasing":0,"x":-0.04,"y":-0.14},{"duration":0,"x":-0.06,"y":-0.2}],"rotateFrame":[{"tweenEasing":0,"rotate":35.07},{"duration":2,"tweenEasing":0,"rotate":6.03},{"duration":2,"tweenEasing":0,"rotate":-2.48},{"duration":4,"tweenEasing":0,"rotate":-4.24},{"duration":0,"rotate":1.03}],"scaleFrame":[{"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":0.96},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":4,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":0,"x":0.93}]},{"name":"foot_r","translateFrame":[{"tweenEasing":0,"x":-1.27,"y":-0.07},{"duration":2,"tweenEasing":0,"x":0.05,"y":-0.32},{"duration":2,"tweenEasing":0,"x":-0.17,"y":-0.4},{"duration":4,"tweenEasing":0,"x":-0.17,"y":-0.52},{"duration":0,"x":-0.14,"y":-0.51}],"rotateFrame":[{"tweenEasing":0,"rotate":-20.33},{"duration":2,"tweenEasing":0,"rotate":-5.51},{"duration":2,"tweenEasing":0,"rotate":-15.56},{"duration":4,"tweenEasing":0,"rotate":-13.55},{"duration":0,"rotate":-14.8}]},{"name":"foot_l","translateFrame":[{"tweenEasing":0,"x":0.31,"y":0.12},{"duration":2,"tweenEasing":0,"x":0.08,"y":0.01},{"duration":2,"tweenEasing":0,"x":-0.07,"y":-0.02},{"duration":4,"tweenEasing":0,"x":-0.13,"y":0.05},{"duration":0,"x":-0.01,"y":0.02}],"rotateFrame":[{"tweenEasing":0,"rotate":-25.26},{"duration":2,"tweenEasing":0,"rotate":-0.03},{"duration":2,"tweenEasing":0,"rotate":11.27},{"duration":4,"tweenEasing":0,"rotate":14.52},{"duration":0,"rotate":8.97}]}],"slot":[{"name":"pelvis","displayFrame":[{"value":1},{"duration":8}]},{"name":"forearm_r","displayFrame":[{"duration":9,"value":1}]},{"name":"hand_r","displayFrame":[{"value":1},{"duration":8}]},{"name":"shouder_r","displayFrame":[{"duration":9,"value":1}]},{"name":"chest","displayFrame":[{"value":1},{"duration":8}]},{"name":"shouder_l","displayFrame":[{"value":1},{"duration":8}]},{"name":"calf_r","displayFrame":[{"value":1},{"duration":8}]}]},{"duration":14,"fadeInTime":0.2,"name":"attack_01","frame":[{"duration":4},{"duration":0,"sound":"200025"}],"bone":[{"name":"pelvis","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.04,"y":-0.05},{"tweenEasing":0,"x":0.01,"y":-0.14},{"duration":2,"tweenEasing":0,"x":0.03,"y":-0.12},{"duration":2,"tweenEasing":0,"x":1.83,"y":0.06},{"duration":4,"tweenEasing":0,"x":0.02,"y":-0.13},{"duration":0,"x":1.23,"y":-0.64}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-5.75},{"tweenEasing":0,"rotate":0.25},{"duration":2,"tweenEasing":0,"rotate":13.52},{"duration":2,"tweenEasing":0,"rotate":22.3},{"duration":4,"tweenEasing":0,"rotate":24.3},{"duration":0,"rotate":17.78}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":0,"x":0.96}]},{"name":"chest","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.21,"y":-1.32},{"tweenEasing":0,"x":-1.02,"y":0.14},{"duration":2,"tweenEasing":0,"x":-1.82,"y":3.65},{"duration":2,"tweenEasing":0,"x":-1.86,"y":4.27},{"duration":4,"tweenEasing":0,"x":-1.86,"y":3.71},{"duration":0,"x":-1.45,"y":2.22}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":5.96},{"tweenEasing":0,"rotate":7.79},{"duration":2,"tweenEasing":0,"rotate":10.03},{"duration":2,"tweenEasing":0,"rotate":1.45},{"duration":4,"tweenEasing":0,"rotate":-0.75},{"duration":0,"rotate":1.89}],"scaleFrame":[{"duration":5,"tweenEasing":0},{"tweenEasing":0,"x":1.03},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":4,"tweenEasing":0,"x":0.97},{"duration":0,"x":0.98}]},{"name":"shouder_r","translateFrame":[{"duration":2,"tweenEasing":0,"x":7.83,"y":-1.17},{"duration":3,"tweenEasing":0,"x":11.81,"y":0.22},{"tweenEasing":0,"x":8.28,"y":8.73},{"duration":2,"tweenEasing":0,"x":-12.11,"y":106.95},{"duration":2,"tweenEasing":0,"x":-11.12,"y":108.1},{"duration":4,"tweenEasing":0,"x":-15.24,"y":97.4},{"duration":0,"x":-15.49,"y":55.1}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-129.6},{"duration":3,"tweenEasing":0,"rotate":167.8},{"tweenEasing":0,"rotate":176.6},{"duration":2,"tweenEasing":0,"rotate":-74.75},{"duration":2,"tweenEasing":0,"rotate":-56.5},{"duration":4,"tweenEasing":0,"rotate":-60.7},{"duration":0,"rotate":-54.25}]},{"name":"shouder_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":2.1,"y":-2.14},{"tweenEasing":0,"x":-8.66,"y":-32.23},{"duration":2,"tweenEasing":0,"x":26.23,"y":-107.84},{"duration":2,"tweenEasing":0,"x":21.59,"y":-110.42},{"duration":4,"tweenEasing":0,"x":21.69,"y":-107.7},{"duration":0,"x":23.55,"y":-77.25}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-48.37},{"tweenEasing":0,"rotate":1.39},{"duration":2,"tweenEasing":0,"rotate":24.27},{"duration":2,"tweenEasing":0,"rotate":24.73},{"duration":4,"tweenEasing":0,"rotate":26.04},{"duration":0,"rotate":13.44}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.67},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":1.06},{"duration":4,"tweenEasing":0,"x":1.06},{"duration":0,"x":1.04}]},{"name":"forearm_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":-1.06,"y":1.01},{"tweenEasing":0,"x":1.5,"y":-0.3},{"duration":2,"tweenEasing":0,"x":4,"y":-0.91},{"duration":2,"tweenEasing":0,"x":3.71,"y":-0.31},{"duration":4,"tweenEasing":0,"x":3.7,"y":-0.26},{"duration":0,"x":2.03,"y":7.18}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":12.19},{"tweenEasing":0,"rotate":-34.07},{"duration":2,"tweenEasing":0,"rotate":5.44},{"duration":2,"tweenEasing":0,"rotate":28.28},{"duration":4,"tweenEasing":0,"rotate":24.27},{"duration":0,"rotate":1.22}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":0.78,"y":1.01},{"tweenEasing":0,"x":0.95,"y":1.01},{"duration":2,"tweenEasing":0,"y":1.01},{"duration":2,"tweenEasing":0,"x":1.25,"y":1.01},{"duration":4,"tweenEasing":0,"x":1.13,"y":1.01},{"duration":0,"x":1.15,"y":1.01}]},{"name":"forearm_r","translateFrame":[{"duration":2,"tweenEasing":0,"x":5.42,"y":0.84},{"duration":3,"tweenEasing":0,"x":5.51,"y":0.79},{"tweenEasing":0,"x":6.67,"y":0.86},{"duration":2,"tweenEasing":0,"x":6.46,"y":1.57},{"duration":2,"tweenEasing":0,"x":7.22,"y":1.21},{"duration":4,"tweenEasing":0,"x":6.78,"y":1.41},{"duration":0,"x":1.24,"y":-0.89}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":12.78},{"duration":3,"tweenEasing":0,"rotate":12.78},{"tweenEasing":0,"rotate":-15.8},{"duration":2,"tweenEasing":0,"rotate":0.41},{"duration":2,"tweenEasing":0,"rotate":-14.66},{"duration":4,"tweenEasing":0,"rotate":14.63},{"duration":0,"rotate":2.97}],"scaleFrame":[{"duration":2,"tweenEasing":0,"x":1.03,"y":1.01},{"duration":3,"tweenEasing":0,"x":1.03,"y":1.01},{"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":1.03},{"duration":4,"tweenEasing":0,"x":1.03},{"duration":0,"x":1.02}]},{"name":"hand_r","translateFrame":[{"duration":2,"tweenEasing":0,"x":0.5,"y":-0.45},{"duration":3,"tweenEasing":0,"x":0.44,"y":-0.46},{"tweenEasing":0,"x":1.18,"y":-0.15},{"duration":2,"tweenEasing":0,"x":0.39,"y":-0.22},{"duration":2,"tweenEasing":0,"x":0.35,"y":0.02},{"duration":4,"tweenEasing":0,"x":0.44,"y":-0.15},{"duration":0,"x":-3.42,"y":-0.85}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":6.76},{"duration":3,"tweenEasing":0,"rotate":6.75},{"tweenEasing":0,"rotate":-2.5},{"duration":2,"tweenEasing":0,"rotate":76.22},{"duration":2,"tweenEasing":0,"rotate":58.71},{"duration":4,"tweenEasing":0,"rotate":41.93},{"duration":0,"rotate":38.08}],"scaleFrame":[{"duration":2,"tweenEasing":0,"x":1.17},{"duration":3,"tweenEasing":0,"x":1.17},{"tweenEasing":0,"x":1.03},{"duration":2,"tweenEasing":0,"x":0.94},{"duration":2,"tweenEasing":0,"x":0.96},{"duration":4,"tweenEasing":0,"x":0.97},{"duration":0,"x":0.98}]},{"name":"hand_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.84,"y":-1.09},{"tweenEasing":0,"x":-0.64,"y":1.37},{"duration":2,"tweenEasing":0,"x":-16.19,"y":-0.82},{"duration":2,"tweenEasing":0,"x":-17.14,"y":-1.08},{"duration":4,"tweenEasing":0,"x":-16.86,"y":-1.09},{"duration":0,"x":-18.75,"y":-0.73}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-2.57},{"tweenEasing":0,"rotate":4.32},{"duration":2,"tweenEasing":0,"rotate":-19.52},{"duration":2,"tweenEasing":0,"rotate":-14.64},{"duration":4,"tweenEasing":0,"rotate":-0.79},{"duration":0,"rotate":14.44}],"scaleFrame":[{"duration":5,"tweenEasing":0,"y":0.96},{"tweenEasing":0,"y":0.96},{"duration":2,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":2,"tweenEasing":0,"x":1.07,"y":1.19},{"duration":4,"tweenEasing":0,"x":1.02,"y":1.05},{"duration":0,"x":1.02,"y":1.03}]},{"name":"weapon_hand_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.04,"y":0.02},{"tweenEasing":0,"x":0.01},{"duration":2,"tweenEasing":0,"x":0.05,"y":0.03},{"duration":2,"tweenEasing":0,"x":0.08,"y":-0.03},{"duration":4,"tweenEasing":0,"x":0.08,"y":-0.06},{"duration":0,"x":0.09,"y":0.05}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":3.1},{"tweenEasing":0,"rotate":32.41},{"duration":2,"tweenEasing":0,"rotate":6.87},{"duration":2,"tweenEasing":0,"rotate":-13.06},{"duration":4,"tweenEasing":0,"rotate":-13.08},{"duration":0,"rotate":-8.52}]},{"name":"weapon_hand_r","translateFrame":[{"duration":2,"tweenEasing":0,"x":0.03,"y":-0.03},{"duration":3,"tweenEasing":0,"x":0.03,"y":-0.05},{"tweenEasing":0,"x":0.05,"y":0.02},{"duration":2,"tweenEasing":0,"x":-0.04,"y":-0.05},{"duration":2,"tweenEasing":0,"x":-0.01,"y":-0.08},{"duration":4,"tweenEasing":0,"x":-0.04,"y":-0.08},{"duration":0,"x":-0.03,"y":-0.02}],"rotateFrame":[{"duration":2,"tweenEasing":0,"rotate":-96.78},{"duration":3,"tweenEasing":0,"rotate":-156.22},{"tweenEasing":0,"clockwise":1,"rotate":-179.75},{"duration":2,"tweenEasing":0,"rotate":38.81},{"duration":2,"tweenEasing":0,"rotate":39.31},{"duration":4,"tweenEasing":0,"rotate":29.29},{"duration":0,"rotate":15.52}]},{"name":"root","translateFrame":[{"duration":5,"tweenEasing":0,"x":23.5,"y":-0.45},{"tweenEasing":0,"x":9.05,"y":18.8},{"duration":4,"tweenEasing":0,"x":3.35,"y":26.95},{"duration":4,"tweenEasing":0,"x":6.25,"y":28.7},{"duration":0,"x":4.2,"y":19.2}]},{"name":"thigh_r","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.85,"y":2.4},{"tweenEasing":0,"x":6.91,"y":-21.62},{"duration":2,"tweenEasing":0,"x":12.56,"y":-49.03},{"duration":2,"tweenEasing":0,"x":17,"y":-50.06},{"duration":4,"tweenEasing":0,"x":16.71,"y":-47.16},{"duration":0,"x":11.09,"y":-31.49}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":4.5},{"tweenEasing":0,"rotate":-0.5},{"duration":2,"tweenEasing":0,"rotate":27.82},{"duration":2,"tweenEasing":0,"rotate":29.32},{"duration":4,"tweenEasing":0,"rotate":26.56},{"duration":0,"rotate":17.58}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":0.96},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":4,"tweenEasing":0,"x":0.97},{"duration":0,"x":0.98}]},{"name":"thigh_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":-0.87,"y":-2.59},{"tweenEasing":0,"x":-6.79,"y":21.1},{"duration":2,"tweenEasing":0,"x":-12.35,"y":48.03},{"duration":2,"tweenEasing":0,"x":-13.2,"y":49.38},{"duration":4,"tweenEasing":0,"x":-16.52,"y":46.24},{"duration":0,"x":-11.08,"y":30.81}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":15.06},{"tweenEasing":0,"rotate":-33.12},{"duration":2,"tweenEasing":0,"rotate":-10.04},{"duration":2,"tweenEasing":0,"rotate":-10.04},{"duration":4,"tweenEasing":0,"rotate":-7.03},{"duration":0,"rotate":-4.75}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":0.96,"y":1.01},{"tweenEasing":0,"x":1.01,"y":1.01},{"duration":8,"x":0.98,"y":1.01}]},{"name":"calf_r","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.16,"y":-0.05},{"tweenEasing":0,"x":0.07,"y":-0.16},{"duration":2,"tweenEasing":0,"x":0.01,"y":-0.1},{"duration":2,"tweenEasing":0,"x":-0.06,"y":-0.07},{"duration":4,"tweenEasing":0,"x":-0.04,"y":-0.12},{"duration":0,"x":0.44,"y":-7.58}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":10.3},{"tweenEasing":0,"rotate":39.9},{"duration":2,"tweenEasing":0,"rotate":19.86},{"duration":2,"tweenEasing":0,"rotate":22.62},{"duration":4,"tweenEasing":0,"rotate":26.38},{"duration":0,"rotate":25.1}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":1.03,"y":1.01},{"tweenEasing":0,"x":0.99,"y":1.01},{"duration":4,"tweenEasing":0,"x":1.05,"y":1.01},{"duration":4,"tweenEasing":0,"x":1.05,"y":1.01},{"duration":0,"x":1.01,"y":1.01}]},{"name":"calf_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.16,"y":0.06},{"tweenEasing":0,"x":-0.24,"y":-0.24},{"duration":2,"tweenEasing":0,"x":-0.19,"y":-0.03},{"duration":2,"tweenEasing":0,"x":-0.2,"y":-0.02},{"duration":4,"tweenEasing":0,"x":-0.21,"y":-0.06},{"duration":0,"x":-0.19,"y":0.03}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":5.94},{"tweenEasing":0,"rotate":32.87},{"duration":2,"tweenEasing":0,"rotate":-32.11},{"duration":2,"tweenEasing":0,"rotate":-32.11},{"duration":4,"tweenEasing":0,"rotate":-32.1},{"duration":0,"rotate":-21.33}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":0.96},{"tweenEasing":0,"x":0.93},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0,"x":1.21},{"duration":0,"x":1.14}]},{"name":"foot_r","translateFrame":[{"duration":5,"tweenEasing":0,"x":-1.2,"y":-0.14},{"tweenEasing":0,"x":-1.25,"y":-0.19},{"duration":2,"tweenEasing":0,"x":-1.35,"y":-0.17},{"duration":2,"tweenEasing":0,"x":-1.4,"y":0.04},{"duration":4,"tweenEasing":0,"x":-1.4,"y":-0.02},{"duration":0,"x":-1.68,"y":0.12}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-4.04},{"tweenEasing":0,"rotate":-35.15},{"duration":2,"tweenEasing":0,"rotate":-47.69},{"duration":2,"tweenEasing":0,"rotate":-52.7},{"duration":4,"tweenEasing":0,"rotate":-54.2},{"duration":0,"rotate":-43.45}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01},{"duration":8}]},{"name":"foot_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.41,"y":0.12},{"tweenEasing":0,"x":9.7,"y":-0.23},{"duration":2,"tweenEasing":0,"x":9.18,"y":-0.4},{"duration":2,"tweenEasing":0,"x":9.24,"y":-0.34},{"duration":4,"tweenEasing":0,"x":-0.48,"y":-0.36},{"duration":0,"x":-2.63,"y":-1.92}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-21.05},{"tweenEasing":0,"rotate":0.19},{"duration":2,"tweenEasing":0,"rotate":42.16},{"duration":2,"tweenEasing":0,"rotate":42.15},{"duration":4,"tweenEasing":0,"rotate":39.26},{"duration":0,"rotate":26.17}]}],"slot":[{"name":"pelvis","displayFrame":[{"duration":6},{"duration":8,"value":2},{"duration":0,"value":1}]},{"name":"forearm_r","displayFrame":[{"duration":14,"value":1}]},{"name":"hand_r","displayFrame":[{"duration":6},{"duration":8,"value":1}]},{"name":"shouder_r","displayFrame":[{"duration":14,"value":1}]},{"name":"chest","displayFrame":[{"duration":6},{"duration":8,"value":2},{"duration":0,"value":1}]},{"name":"shouder_l","displayFrame":[{"duration":6},{"duration":8,"value":2}]},{"name":"hand_l","displayFrame":[{"duration":6},{"duration":8,"value":2},{"duration":0,"value":3}]},{"name":"forearm_l","displayFrame":[{"duration":6},{"duration":8,"value":2}]},{"name":"effect_r","displayFrame":[{"duration":6,"value":-1},{"duration":5},{"duration":3,"value":-1}]},{"name":"calf_r","displayFrame":[{"duration":6},{"duration":8,"value":1}]},{"name":"calf_l","displayFrame":[{"duration":6},{"duration":8,"value":1},{"duration":0}]}]},{"duration":48,"fadeInTime":0.2,"name":"skill_03","frame":[{"duration":33},{"sound":"200029"},{"duration":0,"events":[{"name":"onTimeStart"}]}],"bone":[{"name":"pelvis","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.04,"y":-0.02},{"duration":31,"tweenEasing":0,"x":0.03,"y":-0.08},{"duration":2,"tweenEasing":0,"x":0.03,"y":-0.06},{"duration":2,"tweenEasing":0,"x":0.02,"y":-0.05},{"duration":4,"tweenEasing":0,"x":0.02,"y":-0.09},{"duration":3,"tweenEasing":0,"x":8.52,"y":-0.88},{"duration":3,"tweenEasing":0,"x":0.03,"y":-0.09},{"duration":0,"x":-0.03,"y":-0.09}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":23.05},{"duration":31,"tweenEasing":0,"rotate":7.25},{"duration":2,"tweenEasing":0,"rotate":-22.53},{"duration":2,"tweenEasing":0,"rotate":23.8},{"duration":4,"tweenEasing":0,"rotate":49.66},{"duration":3,"tweenEasing":0,"rotate":39.11},{"duration":3,"tweenEasing":0,"rotate":24.81},{"duration":0,"rotate":12.3}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.96,"y":0.99},{"duration":31,"tweenEasing":0,"x":1.03},{"duration":2,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.97,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":0,"x":0.99}]},{"name":"chest","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.92,"y":0.53},{"duration":31,"tweenEasing":0,"x":-0.24,"y":0.97},{"duration":2,"tweenEasing":0,"x":-1.49,"y":6.66},{"duration":2,"tweenEasing":0,"x":-1.73,"y":-2.35},{"duration":4,"tweenEasing":0,"x":-4.98,"y":-12.12},{"duration":3,"tweenEasing":0,"x":-5.47,"y":-15.32},{"duration":3,"tweenEasing":0,"x":-3.43,"y":-12.88},{"duration":0,"x":-0.89,"y":-6.66}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":21.69},{"duration":31,"tweenEasing":0,"rotate":-3.4},{"duration":2,"tweenEasing":0,"rotate":1.59},{"duration":2,"tweenEasing":0,"rotate":47.72},{"duration":4,"tweenEasing":0,"rotate":23.57},{"duration":3,"tweenEasing":0,"rotate":30.93},{"duration":3,"tweenEasing":0,"rotate":22.58},{"duration":0,"rotate":11.3}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.97,"y":0.99},{"duration":31,"tweenEasing":0,"x":1.03},{"duration":2,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":4,"tweenEasing":0,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":0,"x":0.99}]},{"name":"shouder_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-13.52,"y":40.87},{"duration":2,"tweenEasing":0,"x":-4.87,"y":38.87},{"duration":29,"tweenEasing":0,"x":-9.2,"y":42.09},{"duration":2,"tweenEasing":0,"x":-3.89,"y":44.4},{"duration":2,"tweenEasing":0,"x":-20.24,"y":71.04},{"duration":4,"tweenEasing":0,"x":-20.31,"y":71.88},{"duration":3,"tweenEasing":0,"x":-21.45,"y":67.91},{"duration":3,"tweenEasing":0,"x":-7.9,"y":47.44},{"duration":0,"x":-5.52,"y":37.58}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-32.21},{"duration":2,"tweenEasing":0,"rotate":-26.21},{"duration":29,"tweenEasing":0,"rotate":-56.66},{"duration":2,"tweenEasing":0,"rotate":-179.92},{"duration":2,"tweenEasing":0,"rotate":-100.73},{"duration":4,"tweenEasing":0,"rotate":-102.06},{"duration":3,"tweenEasing":0,"rotate":-113.23},{"duration":3,"tweenEasing":0,"rotate":-70.65},{"duration":0,"rotate":-31.81}]},{"name":"shouder_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":30.61,"y":-59.53},{"duration":2,"tweenEasing":0,"x":18.08,"y":-47.26},{"duration":29,"tweenEasing":0,"x":16.49,"y":-45.48},{"duration":2,"tweenEasing":0,"x":8.54,"y":-49.19},{"duration":2,"tweenEasing":0,"x":28.51,"y":-71.5},{"duration":4,"tweenEasing":0,"x":23.12,"y":-71.11},{"duration":3,"tweenEasing":0,"x":29.82,"y":-69.97},{"duration":3,"tweenEasing":0,"x":27.73,"y":-59.24},{"duration":0,"x":15.46,"y":-39.24}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-2.11},{"duration":2,"tweenEasing":0,"rotate":-7.16},{"duration":29,"tweenEasing":0,"rotate":-40.37},{"duration":2,"tweenEasing":0,"rotate":-126.51},{"duration":2,"tweenEasing":0,"rotate":-54.13},{"duration":4,"tweenEasing":0,"rotate":-56.46},{"duration":3,"tweenEasing":0,"rotate":-59.88},{"duration":3,"tweenEasing":0,"rotate":-43.84},{"duration":0,"rotate":-21.78}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.91,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":29,"tweenEasing":0,"x":0.97,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.95,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.95,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.98},{"duration":3,"tweenEasing":0,"x":0.96},{"duration":0,"x":0.99}]},{"name":"forearm_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":4.74,"y":-0.94},{"duration":2,"tweenEasing":0,"x":5.05},{"duration":29,"tweenEasing":0,"x":4.93,"y":0.63},{"duration":2,"tweenEasing":0,"x":5.91,"y":-1.18},{"duration":2,"tweenEasing":0,"x":4.69,"y":-0.1},{"duration":4,"tweenEasing":0,"x":4.45,"y":-0.05},{"duration":3,"tweenEasing":0,"x":4.45,"y":0.11},{"duration":3,"tweenEasing":0,"x":4.59,"y":-0.08},{"duration":0,"x":1.72}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-10.87},{"duration":2,"tweenEasing":0,"rotate":-22.37},{"duration":29,"tweenEasing":0,"rotate":-31.14},{"duration":2,"tweenEasing":0,"rotate":-41.66},{"duration":2,"tweenEasing":0,"rotate":-36.65},{"duration":4,"tweenEasing":0,"rotate":-42.16},{"duration":3,"tweenEasing":0,"rotate":-37.89},{"duration":3,"tweenEasing":0,"rotate":-5.03},{"duration":0,"rotate":-2.51}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.91,"y":1.01},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":29,"tweenEasing":0,"x":1.03,"y":1.01},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":1.03},{"duration":3,"tweenEasing":0,"x":1.02},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":0,"y":1.01}]},{"name":"forearm_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":6.87,"y":1.13},{"duration":2,"tweenEasing":0,"x":5.29,"y":1.37},{"duration":29,"tweenEasing":0,"x":1.58,"y":0.27},{"duration":2,"tweenEasing":0,"x":8.33,"y":1.24},{"duration":2,"tweenEasing":0,"x":7.65,"y":1.15},{"duration":4,"tweenEasing":0,"x":7.32,"y":1.12},{"duration":3,"tweenEasing":0,"x":7.55,"y":0.99},{"duration":3,"tweenEasing":0,"x":7.73,"y":1.32},{"duration":0,"x":6.44,"y":1.14}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-5.79},{"duration":2,"tweenEasing":0,"rotate":-33.15},{"duration":29,"tweenEasing":0,"rotate":-45.42},{"duration":2,"tweenEasing":0,"rotate":12.03},{"duration":2,"tweenEasing":0,"rotate":-11.34},{"duration":4,"tweenEasing":0,"rotate":-0.79},{"duration":3,"tweenEasing":0,"rotate":6.95},{"duration":3,"tweenEasing":0,"rotate":-7.3},{"duration":0,"rotate":-9.52}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.03},{"duration":2,"tweenEasing":0,"x":0.93,"y":0.99},{"duration":29,"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":1.03},{"duration":2,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":7,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":0,"x":1.02,"y":0.99}]},{"name":"hand_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.65,"y":-0.29},{"duration":2,"tweenEasing":0,"x":0.97,"y":-1.53},{"duration":29,"tweenEasing":0,"x":2.3,"y":-1.37},{"duration":2,"tweenEasing":0,"x":0.92,"y":-0.39},{"duration":2,"tweenEasing":0,"x":1.22,"y":-0.41},{"duration":4,"tweenEasing":0,"x":1.04,"y":-0.29},{"duration":3,"tweenEasing":0,"x":1.01,"y":-0.34},{"duration":3,"tweenEasing":0,"x":0.92,"y":-0.14},{"duration":0,"x":0.57,"y":-0.31}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":12.01},{"duration":2,"tweenEasing":0,"rotate":18.07},{"duration":29,"tweenEasing":0,"rotate":18.27},{"duration":2,"tweenEasing":0,"rotate":-6.26},{"duration":2,"tweenEasing":0,"rotate":48.15},{"duration":4,"tweenEasing":0,"rotate":37.86},{"duration":3,"tweenEasing":0,"rotate":44.89},{"duration":3,"tweenEasing":0,"rotate":46.12},{"duration":0,"rotate":34.82}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99},{"duration":2,"tweenEasing":0,"x":0.94,"y":0.99},{"duration":29,"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":4,"tweenEasing":0,"x":0.97},{"duration":6,"x":0.98}]},{"name":"hand_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.42,"y":0.68},{"duration":2,"tweenEasing":0,"x":-0.05,"y":1.21},{"duration":29,"tweenEasing":0,"x":-0.09,"y":0.44},{"duration":2,"tweenEasing":0,"x":2.11,"y":1.77},{"duration":2,"tweenEasing":0,"x":-0.19,"y":0.85},{"duration":4,"tweenEasing":0,"x":-0.23,"y":0.73},{"duration":3,"tweenEasing":0,"x":-0.25,"y":0.82},{"duration":3,"tweenEasing":0,"x":-0.15,"y":0.71},{"duration":0,"x":0.01,"y":0.39}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":11.13},{"duration":2,"tweenEasing":0,"rotate":14.81},{"duration":29,"tweenEasing":0,"rotate":13.5},{"duration":2,"tweenEasing":0,"rotate":-0.66},{"duration":2,"tweenEasing":0,"rotate":51.14},{"duration":4,"tweenEasing":0,"rotate":57.16},{"duration":3,"tweenEasing":0,"rotate":59.68},{"duration":3,"tweenEasing":0,"rotate":39.57},{"duration":0,"rotate":19.81}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.98,"y":0.93},{"duration":2,"tweenEasing":0,"y":1.01},{"duration":29,"tweenEasing":0,"x":1.01,"y":1.02},{"duration":2,"tweenEasing":0,"x":1.11,"y":1.34},{"duration":6,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":3,"tweenEasing":0,"y":0.98},{"duration":0,"x":1.01,"y":0.99}]},{"name":"weapon_hand_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.07,"y":0.03},{"duration":2,"tweenEasing":0,"x":0.03},{"duration":29,"tweenEasing":0,"x":0.01,"y":0.03},{"duration":2,"tweenEasing":0,"x":0.06,"y":-0.05},{"duration":2,"tweenEasing":0,"x":0.04,"y":0.02},{"duration":4,"tweenEasing":0,"x":0.02},{"duration":3,"tweenEasing":0,"y":0.03},{"duration":3,"tweenEasing":0,"x":0.04},{"duration":0,"x":0.06,"y":0.13}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":21.59},{"duration":2,"tweenEasing":0,"rotate":19.03},{"duration":29,"tweenEasing":0,"rotate":16.97},{"duration":2,"tweenEasing":0,"rotate":13.9},{"duration":6,"tweenEasing":0,"rotate":18.48},{"duration":3,"tweenEasing":0,"rotate":18.48},{"duration":3,"tweenEasing":0,"rotate":17.86},{"duration":0,"rotate":9.1}]},{"name":"weapon_hand_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.02,"y":0.02},{"duration":2,"tweenEasing":0,"x":-0.03,"y":-0.05},{"duration":29,"tweenEasing":0,"x":0.05,"y":-0.06},{"duration":2,"tweenEasing":0,"x":0.07,"y":-0.03},{"duration":2,"tweenEasing":0,"x":0.03,"y":-0.03},{"duration":4,"tweenEasing":0,"x":0.06,"y":-0.05},{"duration":3,"tweenEasing":0,"x":0.06,"y":-0.05},{"duration":3,"tweenEasing":0,"x":-0.01,"y":-0.07},{"duration":0,"x":-0.03,"y":0.04}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":31.29},{"duration":2,"tweenEasing":0,"rotate":-28.61},{"duration":29,"tweenEasing":0,"rotate":-69.47},{"duration":2,"tweenEasing":0,"rotate":176.49},{"duration":2,"tweenEasing":0,"rotate":21.15},{"duration":4,"tweenEasing":0,"rotate":22.28},{"duration":3,"tweenEasing":0,"rotate":22.28},{"duration":3,"tweenEasing":0,"rotate":28.28},{"duration":0,"rotate":32.29}]},{"name":"effect_r","translateFrame":[{"duration":5,"x":-164.4,"y":-257.55},{"duration":28,"tweenEasing":0,"x":-164.4,"y":-257.55},{"duration":3,"x":-167.4,"y":-324.55},{"duration":12,"x":-6.45,"y":6.45}],"rotateFrame":[{"duration":33,"rotate":35.08},{"duration":3,"rotate":35.08},{"duration":12,"rotate":7.52}],"scaleFrame":[{"duration":33,"x":0.18,"y":0.16},{"duration":3,"x":0.18,"y":0.16},{"duration":4,"tweenEasing":0,"x":1.21,"y":1.09},{"duration":8,"x":1.68,"y":1.51}]},{"name":"effect_l","scaleFrame":[{"duration":36},{"duration":4,"tweenEasing":0},{"duration":8,"x":1.4,"y":1.4}]},{"name":"root","translateFrame":[{"duration":3,"tweenEasing":0,"x":-18.9,"y":36.95},{"duration":31,"tweenEasing":0,"x":37.9,"y":-80.65},{"duration":2,"tweenEasing":0,"x":49.6,"y":-138.95},{"duration":2,"tweenEasing":0,"x":18.1,"y":43.1},{"duration":7,"tweenEasing":0,"x":17.25,"y":41.75},{"duration":3,"tweenEasing":0,"x":14.4,"y":40.8},{"duration":0,"x":7.2,"y":20.45}]},{"name":"thigh_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":4.72,"y":-13.54},{"duration":31,"tweenEasing":0,"x":-3.74,"y":-15.56},{"duration":2,"tweenEasing":0,"x":2.13,"y":-21.42},{"duration":2,"tweenEasing":0,"x":6.38,"y":-19.53},{"duration":4,"tweenEasing":0,"x":6.32,"y":-21.17},{"duration":3,"tweenEasing":0,"x":15.88,"y":-21.01},{"duration":3,"tweenEasing":0,"x":5.98,"y":-21.71},{"duration":0,"x":-5.59,"y":-11.37}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-63.19},{"duration":31,"tweenEasing":0,"rotate":-33.31},{"duration":2,"tweenEasing":0,"rotate":-11.76},{"duration":2,"tweenEasing":0,"rotate":-0.5},{"duration":4,"tweenEasing":0,"rotate":1},{"duration":3,"tweenEasing":0,"rotate":-1.59},{"duration":3,"tweenEasing":0,"rotate":5.01},{"duration":0,"rotate":5.51}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.94,"y":0.99},{"duration":31,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":0.9},{"duration":4,"tweenEasing":0,"x":0.91},{"duration":3,"tweenEasing":0,"x":0.84},{"duration":3,"tweenEasing":0,"x":0.84},{"duration":0,"x":0.92}]},{"name":"thigh_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-4.6,"y":13.45},{"duration":2,"tweenEasing":0,"x":3.75,"y":15.2},{"duration":29,"tweenEasing":0,"x":-6.54,"y":6.82},{"duration":2,"tweenEasing":0,"x":-2.08,"y":21},{"duration":2,"tweenEasing":0,"x":-6.25,"y":19.18},{"duration":4,"tweenEasing":0,"x":-6.13,"y":20.64},{"duration":3,"tweenEasing":0,"x":1.27,"y":18.96},{"duration":3,"tweenEasing":0,"x":-5.82,"y":21.24},{"duration":0,"x":-2.98,"y":10.67}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-43.89},{"duration":2,"tweenEasing":0,"rotate":37.86},{"duration":29,"tweenEasing":0,"rotate":-63.16},{"duration":2,"tweenEasing":0,"rotate":-39.39},{"duration":2,"tweenEasing":0,"rotate":-61.15},{"duration":4,"tweenEasing":0,"rotate":-63.15},{"duration":3,"tweenEasing":0,"rotate":-78.7},{"duration":3,"tweenEasing":0,"rotate":-66.92},{"duration":0,"rotate":-33.58}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99,"y":1.01},{"duration":2,"tweenEasing":0,"x":0.94,"y":1.01},{"duration":29,"tweenEasing":0,"y":1.01},{"duration":2,"tweenEasing":0,"x":1.02,"y":1.01},{"duration":2,"tweenEasing":0,"x":0.9,"y":1.01},{"duration":4,"tweenEasing":0,"x":0.94,"y":1.01},{"duration":3,"tweenEasing":0,"x":0.97},{"duration":3,"y":1.01}]},{"name":"calf_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.12,"y":-0.22},{"duration":31,"tweenEasing":0,"x":0.27,"y":-0.67},{"duration":2,"tweenEasing":0,"x":0.88,"y":-0.2},{"duration":2,"tweenEasing":0,"x":0.16,"y":-0.14},{"duration":4,"tweenEasing":0,"x":0.09,"y":-0.2},{"duration":3,"tweenEasing":0,"x":0.14,"y":-0.19},{"duration":3,"tweenEasing":0,"x":0.13,"y":-0.21},{"duration":0,"x":0.04,"y":-0.07}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":97.06},{"duration":31,"tweenEasing":0,"rotate":81.5},{"duration":2,"tweenEasing":0,"rotate":11.26},{"duration":2,"tweenEasing":0,"rotate":58.17},{"duration":4,"tweenEasing":0,"rotate":56.18},{"duration":3,"tweenEasing":0,"rotate":65.16},{"duration":3,"tweenEasing":0,"rotate":48.14},{"duration":0,"rotate":13.54}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.94},{"duration":31,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.97,"y":1.01},{"duration":3,"tweenEasing":0,"x":0.93},{"duration":0,"x":0.95,"y":0.99}]},{"name":"calf_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.16,"y":-0.42},{"duration":2,"tweenEasing":0,"x":0.45,"y":-0.13},{"duration":29,"tweenEasing":0,"x":0.35,"y":-0.6},{"duration":2,"tweenEasing":0,"x":0.24,"y":-0.14},{"duration":2,"tweenEasing":0,"x":0.16,"y":-0.64},{"duration":4,"tweenEasing":0,"x":0.09,"y":-0.52},{"duration":3,"tweenEasing":0,"x":0.09,"y":-0.49},{"duration":3,"tweenEasing":0,"x":-0.01,"y":-0.39},{"duration":0,"x":-5.91,"y":-0.03}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":17.05},{"duration":2,"tweenEasing":0,"rotate":-17.87},{"duration":29,"tweenEasing":0,"rotate":103.48},{"duration":2,"tweenEasing":0,"rotate":56.4},{"duration":2,"tweenEasing":0,"rotate":68.88},{"duration":4,"tweenEasing":0,"rotate":69.4},{"duration":3,"tweenEasing":0,"rotate":82.2},{"duration":3,"tweenEasing":0,"rotate":71.17},{"duration":0,"rotate":35.8}],"scaleFrame":[{"duration":3,"tweenEasing":0,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.96},{"duration":29,"tweenEasing":0,"x":0.94,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.96},{"duration":2,"tweenEasing":0,"x":0.77},{"duration":4,"tweenEasing":0,"x":0.81},{"duration":3,"tweenEasing":0,"x":0.85},{"duration":3,"tweenEasing":0,"x":1.04},{"duration":0,"x":0.94}]},{"name":"foot_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.11,"y":-0.11},{"duration":31,"tweenEasing":0,"x":-0.4,"y":-0.38},{"duration":2,"tweenEasing":0,"x":-0.13,"y":0.21},{"duration":2,"tweenEasing":0,"x":-1.26,"y":0.03},{"duration":4,"tweenEasing":0,"x":-1.22,"y":-0.18},{"duration":3,"tweenEasing":0,"x":-1.21,"y":-0.01},{"duration":3,"tweenEasing":0,"x":-0.06,"y":-0.13},{"duration":0,"x":0.17,"y":-0.24}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-33.88},{"duration":31,"tweenEasing":0,"rotate":13},{"duration":2,"tweenEasing":0,"rotate":43.62},{"duration":2,"tweenEasing":0,"rotate":-56.95},{"duration":4,"tweenEasing":0,"rotate":-56.21},{"duration":3,"tweenEasing":0,"rotate":-62.46},{"duration":3,"tweenEasing":0,"rotate":-51.69},{"duration":0,"rotate":-17.16}],"scaleFrame":[{"duration":3,"tweenEasing":0},{"duration":31,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.96,"y":0.99},{"duration":12}]},{"name":"foot_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.28,"y":0.1},{"duration":2,"tweenEasing":0,"x":10.08,"y":-0.53},{"duration":29,"tweenEasing":0,"x":11.49,"y":-0.66},{"duration":2,"tweenEasing":0,"x":11.02,"y":-0.16},{"duration":2,"tweenEasing":0,"x":10.08,"y":-0.05},{"duration":4,"tweenEasing":0,"x":9.97,"y":-0.05},{"duration":3,"tweenEasing":0,"x":9.85,"y":-0.09},{"duration":3,"tweenEasing":0,"x":0.01,"y":-0.12},{"duration":0,"x":4.52,"y":-0.18}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":26.83},{"duration":2,"tweenEasing":0,"rotate":8.27},{"duration":29,"tweenEasing":0,"rotate":-20.08},{"duration":2,"tweenEasing":0,"rotate":4.75},{"duration":2,"tweenEasing":0,"rotate":-7.97},{"duration":4,"tweenEasing":0,"rotate":-6.42},{"duration":3,"tweenEasing":0,"rotate":-3.63},{"duration":3,"tweenEasing":0,"rotate":-4.23},{"duration":0,"rotate":-2.27}],"scaleFrame":[{"duration":3,"tweenEasing":0},{"duration":2,"tweenEasing":0,"y":0.99},{"duration":29,"tweenEasing":0,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":12}]}],"slot":[{"name":"pelvis","displayFrame":[{"duration":48,"value":1}]},{"name":"forearm_r","displayFrame":[{"duration":48,"value":1}]},{"name":"hand_r","displayFrame":[{"duration":48,"value":1}]},{"name":"shouder_r","displayFrame":[{"duration":48,"value":1}]},{"name":"chest","displayFrame":[{"duration":36,"value":1},{"duration":9,"value":3},{"duration":3,"value":1}]},{"name":"shouder_l","displayFrame":[{"duration":48,"value":1}]},{"name":"hand_l","displayFrame":[{"duration":5,"value":1},{"duration":29},{"duration":2,"value":3},{"duration":12,"value":1},{"duration":0}]},{"name":"forearm_l","displayFrame":[{"duration":48,"value":1}]},{"name":"effect_r","displayFrame":[{"duration":36,"value":-1},{"duration":5},{"duration":7,"value":-1}]},{"name":"effect_l","displayFrame":[{"duration":36,"value":-1},{"duration":5},{"duration":7,"value":-1}]},{"name":"calf_r","displayFrame":[{"duration":3},{"duration":42,"value":1},{"duration":3}]},{"name":"foot_r","displayFrame":[{"duration":3},{"duration":42,"value":1},{"duration":3}]},{"name":"calf_l","displayFrame":[{"duration":3},{"duration":42,"value":1},{"duration":3}]}]},{"duration":14,"fadeInTime":0.2,"name":"skill_01","frame":[{"duration":5},{"duration":0,"sound":"200026"}],"bone":[{"name":"pelvis","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.05,"y":-0.1},{"tweenEasing":0,"x":0.05,"y":-0.1},{"tweenEasing":0,"x":0.16,"y":0.07},{"duration":7,"x":0.02}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-0.25},{"tweenEasing":0,"rotate":-0.25},{"tweenEasing":0,"rotate":-1},{"duration":7,"tweenEasing":0,"rotate":-1.5},{"duration":0,"rotate":-0.25}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.98},{"tweenEasing":0},{"duration":7,"tweenEasing":0,"x":0.99},{"duration":0,"x":1.01}]},{"name":"chest","translateFrame":[{"duration":5,"tweenEasing":0,"x":-0.02},{"tweenEasing":0,"x":-0.02,"y":-0.05},{"tweenEasing":0,"x":-0.69,"y":0.87},{"duration":7,"tweenEasing":0,"x":-0.82,"y":2.04},{"duration":0,"x":-0.65,"y":1.71}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":10.32},{"tweenEasing":0,"rotate":10.32},{"tweenEasing":0,"rotate":-1.49},{"duration":7,"tweenEasing":0,"rotate":-0.49},{"duration":0,"rotate":-0.3}],"scaleFrame":[{"duration":5,"tweenEasing":0},{"tweenEasing":0},{"tweenEasing":0,"x":1.02},{"duration":7,"tweenEasing":0,"x":0.94},{"duration":0,"x":0.96}]},{"name":"shouder_r","translateFrame":[{"duration":5,"tweenEasing":0,"x":5.9,"y":-4.76},{"tweenEasing":0,"x":0.98,"y":-2.35},{"tweenEasing":0,"x":-6.16,"y":32.88},{"duration":7,"tweenEasing":0,"x":-3.19,"y":106.61},{"duration":0,"x":-2.58,"y":101.77}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":44.91},{"tweenEasing":0,"rotate":45.66},{"tweenEasing":0,"rotate":61.1},{"duration":7,"tweenEasing":0,"rotate":-91.96},{"duration":0,"rotate":-79.76}]},{"name":"shouder_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":2.17,"y":-5.35},{"tweenEasing":0,"x":2.8,"y":-4.95},{"tweenEasing":0,"x":11.77,"y":-40.19},{"duration":7,"tweenEasing":0,"x":21.73,"y":-121.8},{"duration":0,"x":19.56,"y":-114.39}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-19.79},{"tweenEasing":0,"rotate":-18.04},{"tweenEasing":0,"rotate":23.73},{"duration":7,"tweenEasing":0,"rotate":44.71},{"duration":0,"rotate":42.09}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":0.97,"y":1.01},{"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.96},{"duration":7,"tweenEasing":0,"x":1.05},{"duration":0,"x":1.02}]},{"name":"forearm_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":4.98,"y":-0.01},{"tweenEasing":0,"x":4.82,"y":0.07},{"tweenEasing":0,"x":4.63,"y":-0.74},{"duration":7,"tweenEasing":0,"x":4.47,"y":-0.46},{"duration":0,"x":4.3,"y":-0.89}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-0.8},{"tweenEasing":0,"rotate":-8.57},{"tweenEasing":0,"rotate":-24.34},{"duration":7,"tweenEasing":0,"rotate":-18.82},{"duration":0,"rotate":-26.6}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":1.03,"y":1.01},{"tweenEasing":0,"x":1.03,"y":1.01},{"tweenEasing":0,"x":0.93,"y":1.01},{"duration":7,"tweenEasing":0,"x":0.84,"y":1.01},{"duration":0,"x":0.85,"y":1.01}]},{"name":"forearm_r","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.83,"y":-0.25},{"tweenEasing":0,"x":1.14,"y":-0.12},{"tweenEasing":0,"x":5.74,"y":0.78},{"duration":7,"tweenEasing":0,"x":7.57,"y":1.39},{"duration":0,"x":7.72,"y":1.18}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-22.9},{"tweenEasing":0,"rotate":-10.41},{"tweenEasing":0,"rotate":-62.21},{"duration":7,"tweenEasing":0,"rotate":3.51},{"duration":0,"rotate":2.22}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":1.03,"y":1.01},{"duration":7,"tweenEasing":0,"x":1.02},{"duration":0,"x":1.02,"y":1.01}]},{"name":"hand_r","translateFrame":[{"duration":5,"tweenEasing":0,"x":-0.21},{"tweenEasing":0,"x":0.02,"y":-0.17},{"tweenEasing":0,"x":0.6,"y":-0.12},{"duration":7,"tweenEasing":0,"x":1.16,"y":-0.51},{"duration":0,"x":0.98,"y":-0.26}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-22.03},{"tweenEasing":0,"rotate":-22.3},{"tweenEasing":0,"rotate":3.75},{"duration":7,"tweenEasing":0,"rotate":95.26},{"duration":0,"rotate":83.25}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":0.99},{"duration":7,"tweenEasing":0,"x":0.97},{"duration":0,"x":0.99}]},{"name":"hand_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.25,"y":0.27},{"tweenEasing":0,"x":0.13,"y":0.52},{"tweenEasing":0,"x":0.37,"y":0.98},{"duration":7,"tweenEasing":0,"x":1.9,"y":-0.29},{"duration":0,"x":1.63,"y":0.04}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":0.5},{"tweenEasing":0,"rotate":-2.27},{"tweenEasing":0,"rotate":-12.92},{"duration":7,"tweenEasing":0,"rotate":-20.48},{"duration":0,"rotate":-23.94}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":1.01,"y":1.02},{"tweenEasing":0,"x":1.01,"y":1.03},{"tweenEasing":0,"x":0.98,"y":0.92},{"duration":7,"tweenEasing":0,"x":0.94,"y":0.76},{"duration":0,"x":0.96,"y":0.81}]},{"name":"weapon_hand_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.04},{"tweenEasing":0,"x":0.04,"y":0.01},{"tweenEasing":0,"x":0.03,"y":0.03},{"duration":7,"tweenEasing":0,"x":0.08,"y":0.01},{"duration":0,"x":0.06,"y":0.03}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":13.43},{"tweenEasing":0,"rotate":14.56},{"tweenEasing":0,"rotate":26.23},{"duration":7,"tweenEasing":0,"rotate":23.18},{"duration":0,"rotate":32.77}]},{"name":"weapon_hand_r","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.01},{"tweenEasing":0,"x":-0.04},{"tweenEasing":0},{"duration":7,"tweenEasing":0,"x":-0.03,"y":-0.08},{"duration":0,"x":-0.02,"y":-0.06}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":19.53},{"tweenEasing":0,"rotate":26.53},{"tweenEasing":0,"rotate":13.24},{"duration":7,"tweenEasing":0,"rotate":19.02},{"duration":0,"rotate":17.77}]},{"name":"effect_r","translateFrame":[{"duration":7,"x":87,"y":-163.45},{"duration":3,"tweenEasing":0,"x":87,"y":-163.45},{"duration":4,"x":67,"y":-148}],"rotateFrame":[{"duration":7,"rotate":121.12},{"duration":3,"tweenEasing":0,"rotate":121.12},{"duration":4,"rotate":125.08}],"scaleFrame":[{"duration":7,"x":0.35,"y":0.76},{"duration":3,"tweenEasing":0,"x":0.35,"y":0.76},{"duration":4,"x":0.12,"y":0.42}]},{"name":"root","translateFrame":[{"duration":5,"tweenEasing":0,"x":1,"y":10.6},{"duration":2,"tweenEasing":0,"x":1,"y":10.6},{"duration":7,"x":-5.4,"y":21.9}]},{"name":"thigh_r","translateFrame":[{"duration":5,"tweenEasing":0,"x":1.84,"y":-0.16},{"tweenEasing":0,"x":1.84,"y":-0.16},{"tweenEasing":0,"x":6.08,"y":-16.45},{"duration":7,"tweenEasing":0,"x":7.31,"y":-34.98},{"duration":0,"x":4.64,"y":-29.72}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-12.51},{"tweenEasing":0,"rotate":-12.51},{"tweenEasing":0,"rotate":-8.25},{"duration":7,"tweenEasing":0,"rotate":12.27},{"duration":0,"rotate":7.26}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":0.89},{"tweenEasing":0,"x":0.89},{"tweenEasing":0},{"duration":7,"x":1.02}]},{"name":"thigh_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":-1.75,"y":0.01},{"tweenEasing":0,"x":-1.75,"y":0.01},{"tweenEasing":0,"x":-5.62,"y":16.4},{"duration":7,"tweenEasing":0,"x":-7.17,"y":34.48},{"duration":0,"x":-4.54,"y":29.37}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-15.06},{"tweenEasing":0,"rotate":-15.06},{"tweenEasing":0,"rotate":-26.1},{"duration":7,"tweenEasing":0,"rotate":-8.29},{"duration":0,"rotate":-31.37}],"scaleFrame":[{"duration":6,"tweenEasing":0,"x":1.01,"y":1.01},{"tweenEasing":0,"x":1.01,"y":1.01},{"duration":7,"tweenEasing":0,"x":0.95,"y":1.01},{"duration":0,"x":1.01,"y":1.01}]},{"name":"calf_r","translateFrame":[{"duration":5,"tweenEasing":0,"x":-0.17,"y":-0.15},{"tweenEasing":0,"x":-0.17,"y":-0.15},{"tweenEasing":0,"x":0.2,"y":-0.18},{"duration":7,"tweenEasing":0,"x":0.33,"y":-0.12},{"duration":0,"x":0.34,"y":-0.12}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":23.5},{"tweenEasing":0,"rotate":23.5},{"tweenEasing":0,"rotate":40.63},{"duration":7,"tweenEasing":0,"rotate":27.65},{"duration":0,"rotate":29.9}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":0.94,"y":1.01},{"tweenEasing":0,"x":0.94,"y":1.01},{"tweenEasing":0,"x":0.98,"y":1.01},{"duration":7,"tweenEasing":0,"x":1.04,"y":1.01},{"duration":0,"x":1.02,"y":1.01}]},{"name":"calf_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":-0.07,"y":-0.07},{"tweenEasing":0,"x":-0.07,"y":-0.07},{"tweenEasing":0,"x":-0.16,"y":-0.16},{"duration":7,"tweenEasing":0,"x":-0.02,"y":-0.02},{"duration":0,"x":-0.18,"y":-0.12}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":23.57},{"tweenEasing":0,"rotate":23.57},{"tweenEasing":0,"rotate":17.59},{"duration":7,"tweenEasing":0,"rotate":-32.13},{"duration":0,"rotate":6.8}],"scaleFrame":[{"duration":5,"tweenEasing":0,"x":0.94},{"tweenEasing":0,"x":0.94},{"tweenEasing":0,"x":0.89},{"duration":7,"tweenEasing":0,"x":0.98},{"duration":0,"x":0.94}]},{"name":"foot_r","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.05,"y":-0.42},{"tweenEasing":0,"x":0.05,"y":-0.42},{"tweenEasing":0,"x":-1.22,"y":-0.3},{"duration":7,"tweenEasing":0,"x":-1.13,"y":-0.18},{"duration":0,"x":-1.09,"y":-0.08}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-11.03},{"tweenEasing":0,"rotate":-11.03},{"tweenEasing":0,"rotate":-32.38},{"duration":7,"tweenEasing":0,"rotate":-39.91},{"duration":0,"rotate":-37.15}]},{"name":"foot_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":0.2,"y":0.03},{"tweenEasing":0,"x":0.2,"y":0.03},{"tweenEasing":0,"x":9.67,"y":-0.2},{"duration":7,"tweenEasing":0,"x":9.2,"y":-0.34},{"duration":0,"x":9.45,"y":-0.18}],"rotateFrame":[{"duration":5,"tweenEasing":0,"rotate":-8.55},{"tweenEasing":0,"rotate":-8.55},{"tweenEasing":0,"rotate":8.43},{"duration":7,"tweenEasing":0,"rotate":40.37},{"duration":0,"rotate":24.52}]}],"slot":[{"name":"pelvis","displayFrame":[{"duration":6},{"duration":8,"value":1}]},{"name":"forearm_r","displayFrame":[{"duration":14,"value":1}]},{"name":"hand_r","displayFrame":[{"duration":6},{"duration":8,"value":1}]},{"name":"shouder_r","displayFrame":[{"duration":14,"value":1}]},{"name":"chest","displayFrame":[{"duration":6},{"value":1},{"duration":7,"value":2}]},{"name":"shouder_l","displayFrame":[{"duration":14,"value":1}]},{"name":"hand_l","displayFrame":[{"duration":5},{"duration":9,"value":1}]},{"name":"forearm_l","displayFrame":[{"duration":14,"value":1}]},{"name":"effect_r","displayFrame":[{"duration":7,"value":-1},{"duration":4,"value":1},{"duration":3,"value":-1}]},{"name":"calf_r","displayFrame":[{"duration":6},{"duration":8,"value":1}]},{"name":"foot_r","displayFrame":[{"duration":6},{"duration":8,"value":1}]},{"name":"calf_l","displayFrame":[{"duration":6},{"duration":8,"value":1}]}]},{"duration":49,"playTimes":0,"name":"skill_04","frame":[{"duration":35},{"events":[{"name":"onTimeStart"}]},{"duration":0,"sound":"200030"}],"bone":[{"name":"pelvis","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.01,"y":-0.01},{"duration":4,"tweenEasing":0,"x":0.02},{"duration":2,"tweenEasing":0,"x":0.04,"y":-0.1},{"tweenEasing":0,"x":0.03,"y":-0.12},{"duration":2,"tweenEasing":0,"x":0.01,"y":-0.06},{"duration":4,"tweenEasing":0,"x":2.01,"y":-0.64},{"duration":4,"tweenEasing":0,"x":0.02,"y":-0.12},{"duration":4,"tweenEasing":0,"x":0.01,"y":-0.11},{"duration":4,"tweenEasing":0,"x":0.01,"y":-0.05},{"duration":4,"tweenEasing":0,"y":-0.05},{"duration":4,"tweenEasing":0,"x":3.67,"y":0.2},{"duration":2,"tweenEasing":0,"x":0.04,"y":-0.12},{"duration":6,"tweenEasing":0,"x":0.02,"y":-0.12},{"duration":2,"tweenEasing":0,"x":0.05,"y":-0.12},{"duration":3,"tweenEasing":0,"x":1.7,"y":0.28},{"duration":0,"x":1.05,"y":0.34}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-5},{"duration":4,"tweenEasing":0,"rotate":1.25},{"duration":2,"tweenEasing":0,"rotate":4.5},{"tweenEasing":0,"rotate":15.52},{"duration":2,"tweenEasing":0,"rotate":1.25},{"duration":4,"tweenEasing":0,"rotate":-17.02},{"duration":4,"tweenEasing":0,"rotate":-22.03},{"duration":4,"tweenEasing":0,"rotate":-17.27},{"duration":4,"tweenEasing":0,"rotate":-14.51},{"duration":4,"tweenEasing":0,"rotate":-13.51},{"duration":4,"tweenEasing":0,"rotate":-15.26},{"duration":2,"tweenEasing":0,"rotate":-10.76},{"duration":6,"tweenEasing":0,"rotate":-5.25},{"duration":2,"tweenEasing":0,"rotate":2.25},{"duration":3,"tweenEasing":0,"rotate":3.5},{"duration":0,"rotate":2.02}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.99},{"tweenEasing":0,"x":0.95,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":4,"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":11}]},{"name":"chest","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.6,"y":-2.12},{"duration":4,"tweenEasing":0,"x":-1.16,"y":-9.29},{"duration":2,"tweenEasing":0,"x":-2.17,"y":-11.91},{"tweenEasing":0,"x":0.83,"y":-3.27},{"tweenEasing":0,"x":0.17,"y":4.32},{"tweenEasing":0,"x":-0.56,"y":9.06},{"duration":4,"tweenEasing":0,"x":-3.92,"y":12.2},{"duration":4,"tweenEasing":0,"x":-5.11,"y":13.42},{"duration":4,"tweenEasing":0,"x":-4.56,"y":13.11},{"duration":4,"tweenEasing":0,"x":-3.19,"y":10.62},{"duration":4,"tweenEasing":0,"x":-1.9,"y":8.76},{"duration":3,"tweenEasing":0,"x":-0.76,"y":5.52},{"tweenEasing":0,"x":-1.84,"y":-0.16},{"duration":2,"tweenEasing":0,"x":0.41,"y":-0.14},{"duration":2,"tweenEasing":0,"x":0.29,"y":-0.63},{"duration":4,"tweenEasing":0,"x":1.76,"y":-0.18},{"duration":2,"tweenEasing":0,"x":-0.08,"y":-3.83},{"duration":3,"tweenEasing":0,"y":-3.9},{"duration":0,"x":0.05,"y":-2.05}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":22.04},{"duration":4,"tweenEasing":0,"rotate":36.83},{"duration":2,"tweenEasing":0,"rotate":45.91},{"tweenEasing":0,"rotate":21.73},{"tweenEasing":0,"rotate":5.63},{"tweenEasing":0,"rotate":-7.09},{"duration":4,"tweenEasing":0,"rotate":-6.82},{"duration":4,"tweenEasing":0,"rotate":-3.87},{"duration":4,"tweenEasing":0,"rotate":-9.13},{"duration":4,"tweenEasing":0,"rotate":-5.12},{"duration":4,"tweenEasing":0,"rotate":-2.55},{"duration":3,"tweenEasing":0,"rotate":9.67},{"tweenEasing":0,"rotate":14.08},{"duration":2,"tweenEasing":0,"rotate":11.46},{"duration":2,"tweenEasing":0,"rotate":4.36},{"duration":4,"tweenEasing":0,"rotate":1.99},{"duration":2,"tweenEasing":0,"rotate":6.98},{"duration":3,"tweenEasing":0,"rotate":6.24},{"duration":0,"rotate":5.48}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.94,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":2,"tweenEasing":0,"y":0.99},{"tweenEasing":0,"x":0.97,"y":0.99},{"tweenEasing":0,"x":0.96},{"tweenEasing":0,"x":0.99,"y":0.99},{"duration":4,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":4,"tweenEasing":0,"x":1.04,"y":0.99},{"duration":8,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":4,"tweenEasing":0,"x":1.03,"y":0.99},{"duration":3,"tweenEasing":0},{"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":3,"x":0.98}]},{"name":"shouder_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-1.81,"y":29.41},{"duration":4,"tweenEasing":0,"x":-4.51,"y":46.6},{"duration":2,"tweenEasing":0,"x":-10.93,"y":48.88},{"tweenEasing":0,"x":-9.37,"y":49.01},{"tweenEasing":0,"x":-12.99,"y":48.34},{"tweenEasing":0,"x":-6.19,"y":28.59},{"duration":4,"tweenEasing":0,"x":-5.62,"y":33.26},{"duration":4,"tweenEasing":0,"x":-3.33,"y":27.83},{"duration":4,"tweenEasing":0,"x":-4.94,"y":31.62},{"duration":4,"tweenEasing":0,"x":-6.94,"y":30.44},{"duration":4,"tweenEasing":0,"x":-8.34,"y":36.6},{"duration":3,"tweenEasing":0,"x":-6.26,"y":41.08},{"tweenEasing":0,"x":-7.68,"y":31.7},{"duration":2,"tweenEasing":0,"x":-4.26,"y":34.95},{"duration":2,"tweenEasing":0,"x":1.08,"y":36.38},{"duration":4,"tweenEasing":0,"x":4.47,"y":36.74},{"duration":2,"tweenEasing":0,"x":-7,"y":39.82},{"duration":3,"tweenEasing":0,"x":-6.87,"y":32.44},{"duration":0,"x":-7.02,"y":33.86}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-12.49},{"duration":4,"tweenEasing":0,"rotate":-44.39},{"duration":2,"tweenEasing":0,"rotate":-98.28},{"tweenEasing":0,"rotate":-77.58},{"tweenEasing":0,"rotate":-27.39},{"tweenEasing":0,"rotate":19.32},{"duration":4,"tweenEasing":0,"rotate":30.48},{"duration":4,"tweenEasing":0,"rotate":37.88},{"duration":4,"tweenEasing":0,"rotate":43.42},{"duration":4,"tweenEasing":0,"rotate":33.66},{"duration":4,"tweenEasing":0,"rotate":-4.43},{"duration":3,"tweenEasing":0,"rotate":-83.73},{"tweenEasing":0,"rotate":-87.15},{"duration":2,"tweenEasing":0,"rotate":-26.55},{"duration":2,"tweenEasing":0,"rotate":23.26},{"duration":4,"tweenEasing":0,"rotate":28.25},{"duration":2,"tweenEasing":0,"rotate":12.12},{"duration":3,"tweenEasing":0,"rotate":9.89},{"duration":0,"rotate":4.62}]},{"name":"shouder_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":31.8,"y":-18.41},{"duration":4,"tweenEasing":0,"x":24.93,"y":-48.7},{"duration":2,"tweenEasing":0,"x":22.06,"y":-60.39},{"tweenEasing":0,"x":28,"y":-72.02},{"tweenEasing":0,"x":29.08,"y":-61.03},{"tweenEasing":0,"x":21.52,"y":-50.93},{"duration":4,"tweenEasing":0,"x":13.15,"y":-42.71},{"duration":4,"tweenEasing":0,"x":-5.27,"y":-24.35},{"duration":4,"tweenEasing":0,"x":0.51,"y":-34.21},{"duration":4,"tweenEasing":0,"x":1.25,"y":-28.01},{"duration":4,"tweenEasing":0,"x":4.49,"y":-29.64},{"duration":3,"tweenEasing":0,"x":16.01,"y":-31.7},{"tweenEasing":0,"x":21.42,"y":-37.55},{"duration":2,"tweenEasing":0,"x":17.09,"y":-39.6},{"duration":2,"tweenEasing":0,"x":11.05,"y":-58.46},{"duration":4,"tweenEasing":0,"x":7.92,"y":-59.96},{"duration":2,"tweenEasing":0,"x":22.08,"y":-43.36},{"duration":3,"tweenEasing":0,"x":23.21,"y":-38.56},{"duration":0,"x":16.72,"y":-21.43}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-86.68},{"duration":4,"tweenEasing":0,"rotate":-74.91},{"duration":2,"tweenEasing":0,"rotate":-76.2},{"tweenEasing":0,"rotate":13.95},{"tweenEasing":0,"rotate":48.88},{"tweenEasing":0,"rotate":69.25},{"duration":4,"tweenEasing":0,"rotate":76.9},{"duration":4,"tweenEasing":0,"rotate":72.26},{"duration":4,"tweenEasing":0,"rotate":71.52},{"duration":4,"tweenEasing":0,"rotate":54.72},{"duration":4,"tweenEasing":0,"rotate":44.97},{"duration":3,"tweenEasing":0,"rotate":-66.42},{"tweenEasing":0,"rotate":-110.91},{"duration":2,"tweenEasing":0,"rotate":-82.96},{"duration":2,"tweenEasing":0,"rotate":18.99},{"duration":4,"tweenEasing":0,"rotate":33.01},{"duration":2,"tweenEasing":0,"rotate":15.39},{"duration":3,"tweenEasing":0,"rotate":5.87},{"duration":0,"rotate":-5.67}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.71,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.71,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.72},{"tweenEasing":0,"x":0.67,"y":0.99},{"tweenEasing":0,"x":0.75,"y":0.99},{"tweenEasing":0,"x":0.83,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.83,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.84,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.89,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.84,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.82,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.71,"y":0.99},{"tweenEasing":0,"x":0.72},{"duration":2,"tweenEasing":0,"x":0.72},{"duration":2,"tweenEasing":0,"x":0.67,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.73,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.67,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.72,"y":0.99},{"duration":0,"x":0.84}]},{"name":"forearm_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-13.05,"y":2.2},{"duration":4,"tweenEasing":0,"x":-18.78,"y":1.25},{"duration":2,"tweenEasing":0,"x":-7.29,"y":0.85},{"tweenEasing":0,"x":-1.06,"y":-1.94},{"tweenEasing":0,"x":4.75,"y":-2.01},{"tweenEasing":0,"x":4.22,"y":-1.84},{"duration":4,"tweenEasing":0,"x":4.05,"y":-1.72},{"duration":4,"tweenEasing":0,"x":4.18,"y":-1.51},{"duration":4,"tweenEasing":0,"x":3.98,"y":-1.43},{"duration":4,"tweenEasing":0,"x":4.56,"y":-1.25},{"duration":4,"tweenEasing":0,"x":4.84,"y":-1.09},{"duration":3,"tweenEasing":0,"x":-9.92,"y":1.88},{"tweenEasing":0,"x":-6.24,"y":1.73},{"duration":2,"tweenEasing":0,"x":-10.6,"y":1.92},{"duration":2,"tweenEasing":0,"x":4.69,"y":-1.14},{"duration":4,"tweenEasing":0,"x":5.26,"y":-1.58},{"duration":2,"tweenEasing":0,"x":3.75,"y":-1.23},{"duration":3,"tweenEasing":0,"x":1.18,"y":-0.86},{"duration":0,"x":0.57,"y":-0.17}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":51.21},{"duration":4,"tweenEasing":0,"rotate":6.28},{"duration":2,"tweenEasing":0,"rotate":-13.79},{"tweenEasing":0,"rotate":-71.21},{"tweenEasing":0,"rotate":-79.47},{"tweenEasing":0,"rotate":-76.39},{"duration":4,"tweenEasing":0,"rotate":-75.38},{"duration":4,"tweenEasing":0,"rotate":-69.85},{"duration":4,"tweenEasing":0,"rotate":-54.26},{"duration":4,"tweenEasing":0,"rotate":-58.05},{"duration":4,"tweenEasing":0,"rotate":-69.35},{"duration":3,"tweenEasing":0,"rotate":-2.17},{"tweenEasing":0,"rotate":18.3},{"duration":2,"tweenEasing":0,"rotate":3.62},{"duration":2,"tweenEasing":0,"rotate":-15.23},{"duration":4,"tweenEasing":0,"rotate":-14.7},{"duration":2,"tweenEasing":0,"rotate":-16.5},{"duration":3,"tweenEasing":0,"rotate":-9.18},{"duration":0,"rotate":-1.07}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":0.97},{"tweenEasing":0,"x":0.97},{"tweenEasing":0,"x":0.68},{"tweenEasing":0,"x":0.78},{"duration":4,"tweenEasing":0,"x":0.78},{"duration":4,"tweenEasing":0,"x":0.79},{"duration":4,"tweenEasing":0,"x":0.78},{"duration":4,"tweenEasing":0,"x":0.79},{"duration":4,"tweenEasing":0,"x":0.79},{"duration":3,"tweenEasing":0,"x":0.78,"y":1.01},{"tweenEasing":0,"x":0.66},{"duration":2,"tweenEasing":0,"x":0.96},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":1.11,"y":1.01},{"duration":2,"tweenEasing":0,"x":0.79},{"duration":3,"tweenEasing":0,"x":0.81},{"duration":0}]},{"name":"forearm_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":7.52,"y":1.45},{"duration":4,"tweenEasing":0,"x":2.52,"y":1.56},{"duration":2,"tweenEasing":0,"x":2.26,"y":0.56},{"tweenEasing":0,"x":6.76,"y":0.92},{"tweenEasing":0,"x":3.85,"y":1.37},{"tweenEasing":0,"x":5.96,"y":1.64},{"duration":4,"tweenEasing":0,"x":6.35,"y":1.65},{"duration":4,"tweenEasing":0,"x":7.02,"y":1.45},{"duration":4,"tweenEasing":0,"x":6.92,"y":1.58},{"duration":4,"tweenEasing":0,"x":6.72,"y":1.5},{"duration":4,"tweenEasing":0,"x":0.39,"y":1.86},{"tweenEasing":0,"x":-5.1,"y":-0.11},{"duration":2,"tweenEasing":0,"x":-7.02,"y":-0.18},{"tweenEasing":0,"x":-10.71,"y":-0.27},{"duration":2,"tweenEasing":0,"x":-3.03,"y":1.55},{"duration":2,"tweenEasing":0,"x":6.58,"y":1.62},{"duration":4,"tweenEasing":0,"x":7.11,"y":1.64},{"duration":2,"tweenEasing":0,"x":7.62,"y":1.24},{"duration":3,"tweenEasing":0,"x":7.09,"y":1},{"duration":0,"x":4.09,"y":0.38}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-48.17},{"duration":4,"tweenEasing":0,"rotate":-44.41},{"duration":2,"tweenEasing":0,"rotate":-15.39},{"tweenEasing":0,"rotate":-13.88},{"tweenEasing":0,"rotate":-27.88},{"tweenEasing":0,"rotate":-27.59},{"duration":4,"tweenEasing":0,"rotate":-22.07},{"duration":4,"tweenEasing":0,"rotate":1.71},{"duration":4,"tweenEasing":0,"rotate":7.95},{"duration":4,"tweenEasing":0,"rotate":14.22},{"duration":4,"tweenEasing":0,"rotate":-23.11},{"tweenEasing":0,"rotate":-33.11},{"duration":2,"tweenEasing":0,"rotate":-36.04},{"tweenEasing":0,"rotate":-41.9},{"duration":2,"tweenEasing":0,"rotate":-38.91},{"duration":2,"tweenEasing":0,"rotate":-0.33},{"duration":4,"tweenEasing":0,"rotate":1.17},{"duration":2,"tweenEasing":0,"rotate":-3.08},{"duration":3,"tweenEasing":0,"rotate":-4.07},{"duration":0,"rotate":-5.29}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.92,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.79},{"tweenEasing":0,"x":0.77,"y":0.99},{"tweenEasing":0,"x":1.03,"y":0.99},{"tweenEasing":0,"x":1.06,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.93},{"duration":4,"tweenEasing":0,"x":0.98},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":0.89,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.99,"y":0.99},{"tweenEasing":0,"x":0.99,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.75},{"duration":2,"tweenEasing":0,"x":0.95},{"duration":4,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":3,"x":1.02}]},{"name":"hand_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.41,"y":-0.4},{"duration":4,"tweenEasing":0,"x":1.23,"y":0.3},{"duration":2,"tweenEasing":0,"x":0.22,"y":0.84},{"tweenEasing":0,"x":0.42,"y":0.85},{"tweenEasing":0,"x":1.34,"y":-0.34},{"tweenEasing":0,"x":-16.3,"y":-0.36},{"duration":4,"tweenEasing":0,"x":-16.6,"y":0.2},{"duration":4,"tweenEasing":0,"x":-16.78,"y":1.32},{"duration":4,"tweenEasing":0,"x":-16.29,"y":1.5},{"duration":4,"tweenEasing":0,"x":-16.35,"y":1.55},{"duration":4,"tweenEasing":0,"x":-16.81,"y":-1},{"duration":3,"tweenEasing":0,"x":1.86,"y":-0.72},{"tweenEasing":0,"x":2.02,"y":-0.72},{"duration":2,"tweenEasing":0,"x":0.71,"y":-1.22},{"duration":2,"tweenEasing":0,"x":0.48,"y":0.49},{"duration":4,"tweenEasing":0,"x":0.57,"y":0.45},{"duration":2,"tweenEasing":0,"x":0.4,"y":0.26},{"duration":3,"tweenEasing":0,"x":0.39,"y":0.03},{"duration":0,"x":0.1,"y":-0.07}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":32.39},{"duration":4,"tweenEasing":0,"rotate":27.11},{"duration":2,"tweenEasing":0,"rotate":9.99},{"tweenEasing":0,"rotate":1.71},{"tweenEasing":0,"rotate":-10.02},{"tweenEasing":0,"rotate":-36.63},{"duration":4,"tweenEasing":0,"rotate":-43.92},{"duration":4,"tweenEasing":0,"rotate":-72.73},{"duration":4,"tweenEasing":0,"rotate":-81.97},{"duration":4,"tweenEasing":0,"rotate":-85.48},{"duration":4,"tweenEasing":0,"rotate":-26.35},{"duration":3,"tweenEasing":0,"rotate":15.32},{"tweenEasing":0,"rotate":2.27},{"duration":2,"tweenEasing":0,"rotate":0.7},{"duration":2,"tweenEasing":0,"rotate":-5.27},{"duration":4,"tweenEasing":0,"rotate":-3.51},{"duration":2,"tweenEasing":0,"rotate":-1.75},{"duration":3,"tweenEasing":0,"rotate":-2.25},{"duration":0,"rotate":-1.88}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.91,"y":0.99},{"duration":2,"tweenEasing":0,"x":1.04,"y":0.99},{"tweenEasing":0,"x":1.01,"y":0.99},{"tweenEasing":0,"x":0.98,"y":0.99},{"tweenEasing":0,"x":0.76,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.73,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.72,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.89,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.94,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.94},{"duration":3,"tweenEasing":0,"x":0.9,"y":0.99},{"tweenEasing":0,"x":1.01,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.85,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":4,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":3,"tweenEasing":0,"x":0.99},{"duration":0,"x":1.03}]},{"name":"hand_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.03,"y":0.07},{"duration":4,"tweenEasing":0,"x":-0.37,"y":0.02},{"duration":2,"tweenEasing":0,"x":-0.18,"y":-0.11},{"tweenEasing":0,"x":0.01,"y":1.36},{"tweenEasing":0,"x":1.4,"y":2.25},{"tweenEasing":0,"x":-19.16,"y":2.06},{"duration":4,"tweenEasing":0,"x":-21.87,"y":1.91},{"duration":4,"tweenEasing":0,"x":-26.38,"y":2.04},{"duration":4,"tweenEasing":0,"x":-27.55,"y":1.44},{"duration":4,"tweenEasing":0,"x":-18.99,"y":2.08},{"duration":4,"tweenEasing":0,"x":-18.49,"y":2.41},{"duration":3,"tweenEasing":0,"x":1.25,"y":-1.12},{"tweenEasing":0,"x":0.76,"y":-1.21},{"duration":2,"tweenEasing":0,"x":0.41,"y":-0.39},{"duration":2,"tweenEasing":0,"x":-16.51,"y":1.15},{"duration":4,"tweenEasing":0,"x":-16.63,"y":0.46},{"duration":2,"tweenEasing":0,"x":1.06,"y":1.17},{"duration":3,"tweenEasing":0,"x":1.02,"y":1.27},{"duration":0,"x":0.19,"y":0.81}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":11.31},{"duration":4,"tweenEasing":0,"rotate":16.08},{"duration":2,"tweenEasing":0,"rotate":12.83},{"tweenEasing":0,"rotate":10.56},{"tweenEasing":0,"rotate":-2.49},{"tweenEasing":0,"rotate":-18.64},{"duration":4,"tweenEasing":0,"rotate":-21.89},{"duration":4,"tweenEasing":0,"rotate":-29.35},{"duration":4,"tweenEasing":0,"rotate":-38.6},{"duration":4,"tweenEasing":0,"rotate":-20.87},{"duration":4,"tweenEasing":0,"rotate":-14.89},{"duration":3,"tweenEasing":0,"rotate":9.64},{"tweenEasing":0,"rotate":14.89},{"duration":2,"tweenEasing":0,"rotate":8.59},{"duration":2,"tweenEasing":0,"rotate":-1.87},{"duration":4,"tweenEasing":0,"rotate":13.3},{"duration":2,"tweenEasing":0,"rotate":34.08},{"duration":3,"tweenEasing":0,"rotate":30.57},{"duration":0,"rotate":13.79}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99,"y":0.96},{"duration":4,"tweenEasing":0,"x":0.99,"y":0.96},{"duration":2,"tweenEasing":0,"x":1.01,"y":1.02},{"tweenEasing":0,"y":0.99},{"tweenEasing":0,"x":0.99,"y":0.98},{"tweenEasing":0,"x":0.99,"y":0.96},{"duration":4,"tweenEasing":0,"x":0.99,"y":0.95},{"duration":4,"tweenEasing":0,"x":0.99,"y":0.93},{"duration":4,"tweenEasing":0,"x":0.96,"y":0.84},{"duration":4,"tweenEasing":0,"x":0.96,"y":0.85},{"duration":4,"tweenEasing":0,"x":0.97,"y":0.88},{"duration":3,"tweenEasing":0,"x":0.97,"y":0.88},{"tweenEasing":0,"x":0.94,"y":0.75},{"duration":2,"tweenEasing":0,"x":0.99,"y":0.94},{"duration":2,"tweenEasing":0,"x":0.97,"y":0.89},{"duration":4,"tweenEasing":0,"x":0.99,"y":0.92},{"duration":2,"tweenEasing":0,"x":0.98,"y":0.9},{"duration":3,"tweenEasing":0,"x":0.98,"y":0.9},{"duration":0,"y":0.99}]},{"name":"weapon_hand_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.02,"y":0.02},{"duration":4,"tweenEasing":0,"x":0.01,"y":0.01},{"duration":2,"tweenEasing":0,"x":0.02,"y":0.01},{"tweenEasing":0,"x":0.03,"y":0.02},{"tweenEasing":0,"x":0.03,"y":0.03},{"tweenEasing":0,"x":0.02,"y":0.02},{"duration":4,"tweenEasing":0,"x":0.02,"y":0.01},{"duration":4,"tweenEasing":0,"x":0.03,"y":0.01},{"duration":4,"tweenEasing":0,"x":0.04,"y":0.03},{"duration":4,"tweenEasing":0,"x":0.01,"y":-0.01},{"duration":4,"tweenEasing":0,"x":0.01,"y":0.01},{"duration":3,"tweenEasing":0,"x":0.03,"y":-0.06},{"tweenEasing":0,"x":0.01,"y":-0.01},{"duration":2,"tweenEasing":0,"x":0.03,"y":-0.05},{"duration":2,"tweenEasing":0,"x":0.09,"y":0.02},{"duration":4,"tweenEasing":0,"x":0.07},{"duration":2,"tweenEasing":0,"x":0.08},{"duration":3,"tweenEasing":0,"x":0.09,"y":0.03},{"duration":0,"y":0.03}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":63.44},{"duration":4,"tweenEasing":0,"rotate":53.3},{"duration":2,"tweenEasing":0,"rotate":21.2},{"tweenEasing":0,"rotate":31.53},{"tweenEasing":0,"rotate":27.28},{"tweenEasing":0,"rotate":28.26},{"duration":4,"tweenEasing":0,"rotate":29.29},{"duration":4,"tweenEasing":0,"rotate":31.3},{"duration":4,"tweenEasing":0,"rotate":34.31},{"duration":4,"tweenEasing":0,"rotate":29.21},{"duration":4,"tweenEasing":0,"rotate":26.54},{"duration":3,"tweenEasing":0,"rotate":2.14},{"tweenEasing":0,"rotate":-7.6},{"duration":2,"tweenEasing":0,"rotate":-1.74},{"duration":2,"tweenEasing":0,"rotate":26.12},{"duration":4,"tweenEasing":0,"rotate":19.34},{"duration":2,"tweenEasing":0,"rotate":22.31},{"duration":3,"tweenEasing":0,"rotate":25.99},{"duration":0,"rotate":29.54}]},{"name":"weapon_hand_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.02},{"duration":4,"tweenEasing":0,"x":-0.01,"y":-0.07},{"duration":2,"tweenEasing":0,"x":0.02,"y":-0.05},{"tweenEasing":0,"x":0.02,"y":-0.05},{"tweenEasing":0,"x":0.04,"y":-0.04},{"tweenEasing":0,"x":-0.07,"y":-0.04},{"duration":4,"tweenEasing":0,"x":-0.02,"y":-0.05},{"duration":4,"tweenEasing":0,"y":-0.06},{"duration":4,"tweenEasing":0,"x":0.04,"y":-0.1},{"duration":4,"tweenEasing":0,"x":0.07,"y":-0.05},{"duration":4,"tweenEasing":0,"x":-0.06,"y":-0.07},{"duration":3,"tweenEasing":0,"x":0.03,"y":-0.07},{"tweenEasing":0,"x":0.04,"y":-0.06},{"tweenEasing":0,"x":-0.04,"y":-0.03},{"tweenEasing":0,"x":-0.05,"y":-0.09},{"duration":2,"tweenEasing":0,"x":-0.04,"y":0.01},{"duration":4,"tweenEasing":0,"x":0.01,"y":-0.01},{"duration":2,"tweenEasing":0,"x":-0.01,"y":-0.01},{"duration":3,"tweenEasing":0,"y":-0.02},{"duration":0,"x":-0.03,"y":-0.02}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":1.25},{"duration":4,"tweenEasing":0,"rotate":-22.33},{"duration":2,"tweenEasing":0,"rotate":-63.97},{"tweenEasing":0,"rotate":-58.46},{"tweenEasing":0,"rotate":-45.93},{"tweenEasing":0,"rotate":-24.34},{"duration":4,"tweenEasing":0,"rotate":-8.78},{"duration":4,"tweenEasing":0,"rotate":2},{"duration":4,"tweenEasing":0,"rotate":0.75},{"duration":4,"tweenEasing":0,"rotate":3.76},{"duration":4,"tweenEasing":0,"rotate":-62.22},{"duration":3,"tweenEasing":0,"rotate":-94.51},{"tweenEasing":0,"rotate":-107.56},{"tweenEasing":0,"rotate":-48.94},{"tweenEasing":0,"rotate":-10.04},{"duration":2,"tweenEasing":0,"rotate":28.78},{"duration":4,"tweenEasing":0,"rotate":37.55},{"duration":2,"tweenEasing":0,"rotate":28.53},{"duration":3,"tweenEasing":0,"rotate":25.53},{"duration":0,"rotate":14.9}]},{"name":"effect_r","translateFrame":[{"duration":49,"x":-195,"y":-151}],"rotateFrame":[{"duration":49,"rotate":35.08}],"scaleFrame":[{"duration":49,"x":0.18,"y":0.16}]},{"name":"effect_l","translateFrame":[{"duration":5,"tweenEasing":0,"x":-221.45,"y":19.55},{"duration":44,"x":-221.55,"y":19.55}],"rotateFrame":[{"duration":49,"rotate":27.55}],"scaleFrame":[{"duration":49,"x":0.94,"y":0.94}]},{"name":"root","translateFrame":[{"duration":3,"tweenEasing":0,"x":-2.65,"y":13.2},{"duration":4,"tweenEasing":0,"x":-3.45,"y":33},{"duration":2,"tweenEasing":0,"x":1.55,"y":33.7},{"tweenEasing":0,"x":4.45,"y":14.7},{"duration":6,"tweenEasing":0,"x":9.4,"y":2.8},{"duration":4,"tweenEasing":0,"x":5.85,"y":16.05},{"duration":4,"tweenEasing":0,"x":8.6,"y":13.95},{"duration":4,"tweenEasing":0,"x":9.55,"y":11.35},{"duration":8,"tweenEasing":0,"x":10.2,"y":10.35},{"duration":2,"tweenEasing":0,"x":1.35,"y":25.85},{"duration":6,"tweenEasing":0,"x":7.2,"y":5.4},{"duration":5,"tweenEasing":0,"x":0.7,"y":4.05},{"duration":0,"x":0.3,"y":1.7}]},{"name":"thigh_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":6.32,"y":-9.19},{"duration":4,"tweenEasing":0,"x":5.95,"y":-24.18},{"duration":2,"tweenEasing":0,"x":7.33,"y":-25.24},{"tweenEasing":0,"x":10.62,"y":-23.77},{"tweenEasing":0,"x":9.21,"y":-21},{"tweenEasing":0,"x":8.17,"y":-18.61},{"duration":4,"tweenEasing":0,"x":10.09,"y":-16.68},{"duration":4,"tweenEasing":0,"x":8.31,"y":-13.01},{"duration":4,"tweenEasing":0,"x":6.75,"y":-13.49},{"duration":4,"tweenEasing":0,"x":5.76,"y":-9.38},{"duration":4,"tweenEasing":0,"x":7.39,"y":-13.13},{"duration":3,"tweenEasing":0,"x":9.56,"y":-14.93},{"tweenEasing":0,"x":9.83,"y":-12.7},{"duration":2,"tweenEasing":0,"x":6.58,"y":-12.85},{"duration":2,"tweenEasing":0,"x":5.7,"y":-14.7},{"duration":4,"tweenEasing":0,"x":3.55,"y":-16.89},{"duration":2,"tweenEasing":0,"x":4.27,"y":-15.94},{"duration":3,"tweenEasing":0,"x":5.78,"y":-13.99},{"duration":0,"x":3.72,"y":-6.72}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-20.02},{"duration":4,"tweenEasing":0,"rotate":-21.77},{"duration":2,"tweenEasing":0,"rotate":-15.26},{"tweenEasing":0,"rotate":-3},{"tweenEasing":0,"rotate":22.3},{"tweenEasing":0,"rotate":11.01},{"duration":4,"tweenEasing":0,"rotate":0.5},{"duration":4,"tweenEasing":0,"rotate":-13.76},{"duration":4,"tweenEasing":0,"rotate":-6.25},{"duration":4,"tweenEasing":0,"rotate":-3.5},{"duration":4,"tweenEasing":0,"rotate":0.5},{"duration":3,"tweenEasing":0,"rotate":-6.38},{"tweenEasing":0,"rotate":-13.5},{"duration":2,"tweenEasing":0,"rotate":-13},{"duration":2,"tweenEasing":0,"rotate":9.76},{"duration":4,"tweenEasing":0,"rotate":14.27},{"duration":2,"tweenEasing":0,"rotate":7.01},{"duration":3,"tweenEasing":0,"rotate":4.5},{"duration":0,"rotate":0.25}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.95,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.97,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.93},{"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.01,"y":0.99},{"tweenEasing":0,"x":1.02,"y":0.99},{"duration":4,"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":0.98},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":0.97},{"duration":4,"tweenEasing":0,"x":0.99},{"duration":3,"tweenEasing":0,"x":0.92},{"tweenEasing":0,"x":0.82},{"duration":2,"tweenEasing":0,"x":0.82},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":2,"tweenEasing":0},{"duration":3,"x":0.98}]},{"name":"thigh_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-6.25,"y":9.07},{"duration":4,"tweenEasing":0,"x":-5.83,"y":23.93},{"duration":2,"tweenEasing":0,"x":-7.09,"y":24.73},{"tweenEasing":0,"x":-10.41,"y":23.23},{"tweenEasing":0,"x":-9.05,"y":20.53},{"tweenEasing":0,"x":-8.36,"y":17.22},{"duration":4,"tweenEasing":0,"x":-6.02,"y":15.29},{"duration":4,"tweenEasing":0,"x":-8.17,"y":12.61},{"duration":4,"tweenEasing":0,"x":-6.68,"y":13.17},{"duration":4,"tweenEasing":0,"x":-5.7,"y":9.17},{"duration":4,"tweenEasing":0,"x":-7.29,"y":12.89},{"duration":3,"tweenEasing":0,"x":-2.21,"y":15.23},{"tweenEasing":0,"x":-3.2,"y":13.76},{"duration":2,"tweenEasing":0,"x":-6.45,"y":12.51},{"duration":2,"tweenEasing":0,"x":-5.67,"y":14.35},{"duration":4,"tweenEasing":0,"x":-6.86,"y":14.06},{"duration":2,"tweenEasing":0,"x":-4.13,"y":15.55},{"duration":3,"tweenEasing":0,"x":-2.39,"y":14.45},{"duration":0,"x":-1.47,"y":7.4}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-14.06},{"duration":4,"tweenEasing":0,"rotate":-46.39},{"duration":2,"tweenEasing":0,"rotate":-52.64},{"tweenEasing":0,"rotate":-16.57},{"tweenEasing":0,"rotate":14.06},{"tweenEasing":0,"rotate":-3.77},{"duration":4,"tweenEasing":0,"rotate":-14.56},{"duration":4,"tweenEasing":0,"rotate":-25.35},{"duration":4,"tweenEasing":0,"rotate":-26.1},{"duration":4,"tweenEasing":0,"rotate":-18.58},{"duration":4,"tweenEasing":0,"rotate":-16.82},{"duration":3,"tweenEasing":0,"rotate":-33.88},{"tweenEasing":0,"rotate":-37.38},{"duration":2,"tweenEasing":0,"rotate":-35.13},{"duration":2,"tweenEasing":0,"rotate":-7.03},{"duration":4,"tweenEasing":0,"rotate":-4.02},{"duration":2,"tweenEasing":0,"rotate":-7.78},{"duration":3,"tweenEasing":0,"rotate":-9.04},{"duration":0,"rotate":-5.78}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":0.99,"y":1.01},{"duration":2,"tweenEasing":0,"x":0.97,"y":1.01},{"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":0.95},{"tweenEasing":0,"x":0.99},{"duration":4,"tweenEasing":0,"x":1.01},{"duration":12,"tweenEasing":0,"x":1.02},{"duration":4,"tweenEasing":0,"x":1.02},{"duration":3,"tweenEasing":0,"x":1.01,"y":1.01},{"tweenEasing":0,"y":1.01},{"duration":2,"tweenEasing":0,"y":1.01},{"duration":2,"tweenEasing":0},{"duration":4,"tweenEasing":0},{"duration":5,"x":1.02}]},{"name":"calf_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.02,"y":-0.27},{"duration":4,"tweenEasing":0,"x":0.16,"y":-0.41},{"duration":2,"tweenEasing":0,"x":0.04,"y":-0.34},{"tweenEasing":0,"x":0.16,"y":-0.13},{"tweenEasing":0,"x":0.38,"y":-0.29},{"tweenEasing":0,"x":0.28,"y":-0.16},{"duration":4,"tweenEasing":0,"x":0.26,"y":-0.11},{"duration":4,"tweenEasing":0,"x":0.09,"y":-0.23},{"duration":4,"tweenEasing":0,"x":0.09,"y":-0.24},{"duration":4,"tweenEasing":0,"x":0.07,"y":-0.21},{"duration":4,"tweenEasing":0,"x":0.12,"y":-0.16},{"duration":3,"tweenEasing":0,"x":0.02,"y":-0.35},{"tweenEasing":0,"x":-0.09,"y":-0.17},{"duration":2,"tweenEasing":0,"x":-0.02,"y":-0.16},{"duration":2,"tweenEasing":0,"x":0.32,"y":-0.04},{"duration":4,"tweenEasing":0,"x":0.31,"y":-0.1},{"duration":2,"tweenEasing":0,"x":0.12,"y":-0.02},{"duration":3,"tweenEasing":0,"x":0.06,"y":-0.07},{"duration":0,"x":0.04,"y":0.07}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":44.1},{"duration":4,"tweenEasing":0,"rotate":71.21},{"duration":2,"tweenEasing":0,"rotate":66.43},{"tweenEasing":0,"rotate":41.41},{"tweenEasing":0,"rotate":-3.72},{"tweenEasing":0,"rotate":12.33},{"duration":4,"tweenEasing":0,"rotate":28.87},{"duration":4,"tweenEasing":0,"rotate":48.64},{"duration":4,"tweenEasing":0,"rotate":38.38},{"duration":4,"tweenEasing":0,"rotate":29.35},{"duration":4,"tweenEasing":0,"rotate":27.61},{"duration":3,"tweenEasing":0,"rotate":40.86},{"tweenEasing":0,"rotate":48.58},{"duration":2,"tweenEasing":0,"rotate":46.32},{"duration":2,"tweenEasing":0,"rotate":8.81},{"duration":4,"tweenEasing":0,"rotate":0.29},{"duration":2,"tweenEasing":0,"rotate":7.04},{"duration":3,"tweenEasing":0,"rotate":9.29},{"duration":0,"rotate":7.77}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.93,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.96},{"duration":2,"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.98},{"tweenEasing":0,"y":0.99},{"tweenEasing":0,"x":0.99,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.97},{"duration":4,"tweenEasing":0,"x":0.98},{"duration":4,"tweenEasing":0,"x":0.96,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.97,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.92},{"tweenEasing":0,"x":0.87},{"duration":2,"tweenEasing":0,"x":0.86},{"duration":2,"tweenEasing":0,"x":0.96,"y":0.99},{"duration":4,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":3,"x":0.97}]},{"name":"calf_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.12,"y":-0.18},{"duration":4,"tweenEasing":0,"x":-0.22,"y":-0.37},{"duration":2,"tweenEasing":0,"x":-0.15,"y":-0.62},{"tweenEasing":0,"x":-0.18,"y":-0.11},{"tweenEasing":0,"x":0.08,"y":-0.08},{"tweenEasing":0,"x":-0.06,"y":-0.03},{"duration":4,"tweenEasing":0,"x":-0.15,"y":-0.05},{"duration":4,"tweenEasing":0,"x":-0.23,"y":-0.19},{"duration":4,"tweenEasing":0,"x":-0.21,"y":-0.1},{"duration":4,"tweenEasing":0,"x":-0.17,"y":-0.2},{"duration":4,"tweenEasing":0,"x":-0.17,"y":-0.25},{"duration":3,"tweenEasing":0,"x":-0.19,"y":-0.33},{"tweenEasing":0,"x":-0.12,"y":-0.43},{"duration":2,"tweenEasing":0,"x":-0.13,"y":-0.4},{"duration":2,"tweenEasing":0,"x":-0.04,"y":-0.05},{"duration":4,"tweenEasing":0,"x":-0.11,"y":0.01},{"duration":2,"tweenEasing":0,"x":-0.24,"y":-0.26},{"duration":3,"tweenEasing":0,"x":-0.18,"y":-0.18},{"duration":0,"x":-0.14,"y":-0.29}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":7.55},{"duration":4,"tweenEasing":0,"rotate":28.59},{"duration":2,"tweenEasing":0,"rotate":40.35},{"tweenEasing":0,"rotate":5.06},{"tweenEasing":0,"rotate":-32.11},{"tweenEasing":0,"rotate":-2.24},{"duration":4,"tweenEasing":0,"rotate":14.57},{"duration":4,"tweenEasing":0,"rotate":29.11},{"duration":4,"tweenEasing":0,"rotate":32.62},{"duration":4,"tweenEasing":0,"rotate":27.84},{"duration":4,"tweenEasing":0,"rotate":22.59},{"duration":3,"tweenEasing":0,"rotate":35.88},{"tweenEasing":0,"rotate":36.88},{"duration":2,"tweenEasing":0,"rotate":34.87},{"duration":2,"tweenEasing":0,"rotate":3.27},{"duration":4,"tweenEasing":0,"rotate":-2.99},{"duration":2,"tweenEasing":0,"rotate":-2.98},{"duration":3,"tweenEasing":0,"rotate":-0.22},{"duration":0,"rotate":1.78}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.01},{"duration":4,"tweenEasing":0,"x":1.06,"y":0.99},{"duration":2,"tweenEasing":0,"x":1.12,"y":0.99},{"tweenEasing":0,"x":1.13},{"tweenEasing":0,"x":1.18,"y":0.99},{"tweenEasing":0,"x":1.14},{"duration":4,"tweenEasing":0,"x":1.12},{"duration":4,"tweenEasing":0,"x":1.09},{"duration":4,"tweenEasing":0,"x":1.1},{"duration":4,"tweenEasing":0,"x":1.05},{"duration":4,"tweenEasing":0,"x":1.09},{"duration":3,"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":1.09},{"duration":4,"tweenEasing":0,"x":1.11},{"duration":2,"tweenEasing":0,"x":1.13},{"duration":3,"tweenEasing":0,"x":1.11},{"duration":0,"x":1.06}]},{"name":"foot_r","translateFrame":[{"duration":3,"tweenEasing":0,"y":-0.19},{"duration":4,"tweenEasing":0,"x":-0.15,"y":-0.27},{"duration":2,"tweenEasing":0,"x":-0.18,"y":-0.17},{"tweenEasing":0,"x":-0.15,"y":-0.05},{"tweenEasing":0,"x":-0.08,"y":-0.22},{"tweenEasing":0,"x":-0.04,"y":-0.19},{"duration":4,"tweenEasing":0,"x":-0.07,"y":-0.18},{"duration":4,"tweenEasing":0,"x":-0.09,"y":-0.16},{"duration":4,"tweenEasing":0,"x":-0.07,"y":-0.18},{"duration":4,"tweenEasing":0,"x":-0.06,"y":-0.08},{"duration":4,"tweenEasing":0,"x":-0.02,"y":-0.19},{"duration":3,"tweenEasing":0,"x":-0.03,"y":-0.28},{"tweenEasing":0,"x":-0.05,"y":-0.29},{"duration":2,"tweenEasing":0,"x":-0.09,"y":-0.22},{"duration":2,"tweenEasing":0,"y":-0.17},{"duration":4,"tweenEasing":0,"x":-0.05,"y":-0.12},{"duration":2,"tweenEasing":0,"x":-0.02,"y":-0.18},{"duration":3,"tweenEasing":0,"x":0.02,"y":-0.16},{"duration":0,"x":0.02,"y":-0.19}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-24.09},{"duration":4,"tweenEasing":0,"rotate":-49.44},{"duration":2,"tweenEasing":0,"rotate":-51.2},{"tweenEasing":0,"rotate":-38.4},{"tweenEasing":0,"rotate":-18.57},{"tweenEasing":0,"rotate":-23.34},{"duration":4,"tweenEasing":0,"rotate":-29.36},{"duration":4,"tweenEasing":0,"rotate":-34.89},{"duration":4,"tweenEasing":0,"rotate":-32.13},{"duration":4,"tweenEasing":0,"rotate":-25.85},{"duration":4,"tweenEasing":0,"rotate":-28.11},{"duration":3,"tweenEasing":0,"rotate":-34.63},{"tweenEasing":0,"rotate":-35.13},{"duration":2,"tweenEasing":0,"rotate":-33.37},{"duration":2,"tweenEasing":0,"rotate":-18.57},{"duration":4,"tweenEasing":0,"rotate":-14.55},{"duration":2,"tweenEasing":0,"rotate":-14.05},{"duration":3,"tweenEasing":0,"rotate":-13.8},{"duration":0,"rotate":-8.03}]},{"name":"foot_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.03,"y":0.11},{"duration":4,"tweenEasing":0,"x":-0.23,"y":-0.06},{"duration":2,"tweenEasing":0,"x":-0.26,"y":-0.21},{"tweenEasing":0,"x":-0.27,"y":-0.15},{"tweenEasing":0,"x":-0.33,"y":-0.29},{"tweenEasing":0,"x":-0.27,"y":-0.27},{"duration":4,"tweenEasing":0,"x":-0.16,"y":-0.31},{"duration":4,"tweenEasing":0,"x":-0.09,"y":-0.11},{"duration":4,"tweenEasing":0,"x":-0.11,"y":-0.28},{"duration":4,"tweenEasing":0,"x":0.03,"y":0.06},{"duration":4,"tweenEasing":0,"x":-0.09,"y":-0.29},{"duration":3,"tweenEasing":0,"x":0.02,"y":-0.16},{"tweenEasing":0,"x":0.06,"y":0.12},{"duration":2,"tweenEasing":0,"x":0.07,"y":-0.02},{"duration":2,"tweenEasing":0,"x":-0.12,"y":-0.15},{"duration":4,"tweenEasing":0,"x":-0.18,"y":-0.16},{"duration":2,"tweenEasing":0,"x":-0.25,"y":-0.08},{"duration":3,"tweenEasing":0,"x":-0.25,"y":-0.27},{"duration":0,"x":-0.08,"y":-0.05}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":6.52},{"duration":4,"tweenEasing":0,"rotate":17.84},{"duration":2,"tweenEasing":0,"rotate":12.36},{"tweenEasing":0,"rotate":11.61},{"tweenEasing":0,"rotate":18.16},{"tweenEasing":0,"rotate":6.1},{"duration":4,"tweenEasing":0,"rotate":0.08},{"duration":4,"tweenEasing":0,"rotate":-3.7},{"duration":4,"tweenEasing":0,"rotate":-6.44},{"duration":4,"tweenEasing":0,"rotate":-9.22},{"duration":4,"tweenEasing":0,"rotate":-5.7},{"duration":3,"tweenEasing":0,"rotate":-1.98},{"tweenEasing":0,"rotate":0.49},{"duration":2,"tweenEasing":0,"rotate":0.24},{"duration":2,"tweenEasing":0,"rotate":3.82},{"duration":4,"tweenEasing":0,"rotate":7.09},{"duration":2,"tweenEasing":0,"rotate":10.86},{"duration":3,"tweenEasing":0,"rotate":9.34},{"duration":0,"rotate":4.05}]}],"slot":[{"name":"pelvis","displayFrame":[{"duration":49,"value":1}]},{"name":"forearm_r","displayFrame":[{"duration":49,"value":1}]},{"name":"hand_r","displayFrame":[{"duration":3,"value":1},{"duration":3,"value":2},{"duration":6,"value":1},{"duration":12},{"duration":18,"value":1},{"duration":7}]},{"name":"shouder_r","displayFrame":[{"duration":49,"value":1}]},{"name":"chest","displayFrame":[{"duration":49,"value":1}]},{"name":"shouder_l","displayFrame":[{"duration":9},{"value":1},{"duration":22,"value":2},{"duration":6},{"duration":8,"value":1},{"duration":3}]},{"name":"hand_l","displayFrame":[{"duration":20},{"duration":12,"value":1},{"duration":6},{"duration":11,"value":1},{"duration":0}]},{"name":"forearm_l","displayFrame":[{"duration":11},{"duration":21,"value":2},{"duration":6},{"duration":6,"value":2},{"duration":2,"value":1},{"duration":3}]},{"name":"effect_r","colorFrame":[{"duration":29,"tweenEasing":0},{"duration":5,"tweenEasing":0},{"tweenEasing":0,"value":{"aM":0}},{"duration":14}]},{"name":"effect_l","colorFrame":[{"duration":5,"tweenEasing":0,"value":{"aM":17}},{"duration":21},{"duration":8,"tweenEasing":0},{"value":{"aM":0}},{"duration":14}]}]},{"duration":14,"fadeInTime":0.2,"name":"skill_05","bone":[{"name":"pelvis","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.01,"y":-0.09},{"tweenEasing":0,"x":-4.45,"y":4.16},{"tweenEasing":0,"x":-1.18,"y":0.7},{"tweenEasing":0,"x":0.01,"y":-0.06},{"duration":3,"tweenEasing":0,"y":-0.09},{"duration":2,"tweenEasing":0,"x":0.05,"y":-0.07},{"duration":2,"tweenEasing":0,"y":-0.09},{"duration":0,"x":0.03,"y":-0.14}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-3.75},{"tweenEasing":0,"rotate":-6.5},{"tweenEasing":0,"rotate":-7.51},{"tweenEasing":0,"rotate":-8.01},{"duration":3,"tweenEasing":0,"rotate":5.75},{"duration":2,"tweenEasing":0,"rotate":8.01},{"duration":2,"tweenEasing":0,"rotate":6.5},{"duration":0,"rotate":5}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":0.97},{"tweenEasing":0,"x":0.94},{"duration":3,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":0,"x":1.01}]},{"name":"chest","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.36,"y":1.16},{"tweenEasing":0,"x":-0.29,"y":1.23},{"tweenEasing":0,"x":3.59,"y":1.35},{"tweenEasing":0,"x":-0.21,"y":1.93},{"duration":3,"tweenEasing":0,"x":-0.29,"y":1.89},{"duration":2,"tweenEasing":0,"x":-0.28,"y":1.84},{"duration":2,"tweenEasing":0,"x":-0.21,"y":1.85},{"duration":0,"x":-0.15,"y":1.6}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":4.88},{"tweenEasing":0,"rotate":5.16},{"tweenEasing":0,"rotate":14.13},{"tweenEasing":0,"rotate":22.76},{"duration":3,"tweenEasing":0,"rotate":61.65},{"duration":2,"tweenEasing":0,"rotate":62.37},{"duration":2,"tweenEasing":0,"rotate":65.64},{"duration":0,"rotate":23.25}],"scaleFrame":[{"duration":4,"tweenEasing":0},{"tweenEasing":0,"x":0.99},{"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.99,"y":0.99},{"duration":0,"x":0.93,"y":0.99}]},{"name":"shouder_r","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.55,"y":-6.07},{"tweenEasing":0,"x":5.47,"y":-1.92},{"tweenEasing":0,"x":-5.32,"y":54.03},{"tweenEasing":0,"x":-11.23,"y":101.12},{"duration":3,"tweenEasing":0,"x":-10.24,"y":101.82},{"duration":2,"tweenEasing":0,"x":-15.51,"y":102.42},{"duration":2,"tweenEasing":0,"x":-12.71,"y":104.34},{"duration":0,"x":-19.02,"y":47.32}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-162.66},{"tweenEasing":0,"rotate":-172.91},{"tweenEasing":0,"rotate":169.22},{"tweenEasing":0,"rotate":-151.56},{"duration":3,"tweenEasing":0,"rotate":-106.04},{"duration":2,"tweenEasing":0,"rotate":-109.51},{"duration":2,"tweenEasing":0,"rotate":-123.06},{"duration":0,"rotate":-42.04}]},{"name":"shouder_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":5.07,"y":3.41},{"tweenEasing":0,"x":11.93,"y":-5.16},{"tweenEasing":0,"x":22.77,"y":-61.77},{"tweenEasing":0,"x":24.21,"y":-106.73},{"duration":3,"tweenEasing":0,"x":20.23,"y":-124.79},{"duration":2,"tweenEasing":0,"x":19.91,"y":-121.93},{"duration":2,"tweenEasing":0,"x":13.59,"y":-116.92},{"duration":0,"x":28.39,"y":-61.41}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-25.76},{"tweenEasing":0,"rotate":-34.23},{"tweenEasing":0,"rotate":-33.54},{"tweenEasing":0,"rotate":13.36},{"duration":3,"tweenEasing":0,"rotate":-23.07},{"duration":2,"tweenEasing":0,"rotate":-22.52},{"duration":2,"tweenEasing":0,"rotate":-29.32},{"duration":0,"rotate":-25.73}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.11},{"tweenEasing":0,"x":1.12,"y":0.99},{"tweenEasing":0,"x":0.81},{"tweenEasing":0,"x":1.01,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.04,"y":0.99},{"duration":2,"tweenEasing":0,"x":1.04,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.97,"y":0.99},{"duration":0,"x":0.74}]},{"name":"forearm_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.57,"y":0.41},{"tweenEasing":0,"x":-0.74,"y":0.49},{"tweenEasing":0,"x":5.63,"y":0.45},{"tweenEasing":0,"x":4.59,"y":-0.72},{"duration":3,"tweenEasing":0,"x":4.44,"y":-0.41},{"duration":2,"tweenEasing":0,"x":4.33,"y":-0.44},{"duration":2,"tweenEasing":0,"x":4.54,"y":-0.69},{"duration":0,"x":6.18,"y":-0.15}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-6.07},{"tweenEasing":0,"rotate":-5.31},{"tweenEasing":0,"rotate":-18.73},{"tweenEasing":0,"rotate":-39.38},{"duration":3,"tweenEasing":0,"rotate":-25.84},{"duration":2,"tweenEasing":0,"rotate":9.71},{"duration":2,"tweenEasing":0,"rotate":17.97},{"duration":0,"rotate":-15.7}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":0.9},{"tweenEasing":0,"x":0.92},{"tweenEasing":0,"x":1.01,"y":1.01},{"tweenEasing":0},{"duration":3,"tweenEasing":0,"x":1.18,"y":1.01},{"duration":2,"tweenEasing":0,"x":1.09},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":0,"x":0.99}]},{"name":"forearm_r","translateFrame":[{"duration":4,"tweenEasing":0,"x":-13.85,"y":-1.39},{"tweenEasing":0,"x":-3.52,"y":-0.34},{"tweenEasing":0,"x":4.65,"y":0.88},{"tweenEasing":0,"x":3,"y":0.15},{"duration":3,"tweenEasing":0,"x":1.52,"y":1.91},{"duration":2,"tweenEasing":0,"x":6.68,"y":1.47},{"duration":2,"tweenEasing":0,"x":4.32,"y":1.6},{"duration":0,"x":7.74,"y":1.27}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-4.07},{"tweenEasing":0,"rotate":-0.52},{"tweenEasing":0,"rotate":-7.76},{"tweenEasing":0,"rotate":-7.12},{"duration":3,"tweenEasing":0,"rotate":-46.18},{"duration":2,"tweenEasing":0,"rotate":-42.68},{"duration":2,"tweenEasing":0,"rotate":-18.64},{"duration":0,"rotate":3.52}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.03},{"tweenEasing":0,"x":0.99},{"tweenEasing":0,"y":0.99},{"tweenEasing":0,"x":0.97,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":1.03},{"duration":0,"x":1.03,"y":0.99}]},{"name":"hand_r","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.02,"y":-0.11},{"tweenEasing":0,"x":-0.59,"y":-0.4},{"tweenEasing":0,"x":0.66,"y":-0.83},{"tweenEasing":0,"x":3.05,"y":-0.01},{"duration":3,"tweenEasing":0,"x":-0.13,"y":-0.46},{"duration":2,"tweenEasing":0,"x":-0.06,"y":-0.37},{"duration":2,"tweenEasing":0,"x":0.31,"y":-0.2},{"duration":0,"x":0.87,"y":-0.17}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":50.93},{"tweenEasing":0,"rotate":39.09},{"tweenEasing":0,"rotate":15.28},{"tweenEasing":0,"rotate":-9.78},{"duration":3,"tweenEasing":0,"rotate":85.25},{"duration":2,"tweenEasing":0,"rotate":87.25},{"duration":2,"tweenEasing":0,"rotate":77.75},{"duration":0,"rotate":13.53}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.03,"y":0.99},{"tweenEasing":0,"x":1.04,"y":0.99},{"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":0.96,"y":0.99},{"duration":3,"tweenEasing":0,"x":0.94},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":0,"x":0.95}]},{"name":"hand_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":1,"y":-0.76},{"tweenEasing":0,"x":1.05,"y":-0.61},{"tweenEasing":0,"x":-0.31,"y":1.2},{"tweenEasing":0,"x":-16.19,"y":1.56},{"duration":3,"tweenEasing":0,"x":-16.5,"y":1.11},{"duration":2,"tweenEasing":0,"x":-16.06,"y":0.39},{"duration":2,"tweenEasing":0,"x":-16.34,"y":0.27},{"duration":0,"x":0.15,"y":1.03}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":1.32},{"tweenEasing":0,"rotate":1.31},{"tweenEasing":0,"rotate":2.76},{"tweenEasing":0,"rotate":15.64},{"duration":3,"tweenEasing":0,"rotate":7.1},{"duration":2,"tweenEasing":0,"rotate":-19.59},{"duration":2,"tweenEasing":0,"rotate":-27.06},{"duration":0,"rotate":15.83}],"scaleFrame":[{"duration":4,"tweenEasing":0,"y":1.01},{"tweenEasing":0,"x":1.01,"y":1.01},{"tweenEasing":0,"x":1.01,"y":1.02},{"tweenEasing":0,"x":0.98,"y":0.91},{"duration":3,"tweenEasing":0,"x":1.05,"y":1.14},{"duration":2,"tweenEasing":0,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.96,"y":0.82},{"duration":0,"x":0.99,"y":0.97}]},{"name":"weapon_hand_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.02,"y":0.04},{"tweenEasing":0,"x":0.01,"y":0.02},{"tweenEasing":0,"y":0.01},{"tweenEasing":0,"x":0.08,"y":0.03},{"duration":3,"tweenEasing":0,"x":0.02},{"duration":2,"tweenEasing":0,"x":0.05},{"duration":2,"tweenEasing":0,"x":0.07,"y":0.03},{"duration":0,"y":0.02}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":9.92},{"tweenEasing":0,"rotate":10.21},{"tweenEasing":0,"rotate":18.65},{"tweenEasing":0,"rotate":17.41},{"duration":3,"tweenEasing":0,"rotate":9.92},{"duration":2,"tweenEasing":0,"rotate":6.1},{"duration":2,"tweenEasing":0,"rotate":12.54},{"duration":0,"rotate":29.4}]},{"name":"weapon_hand_r","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.01,"y":-0.08},{"tweenEasing":0,"x":0.02,"y":-0.1},{"tweenEasing":0,"x":0.02,"y":-0.02},{"tweenEasing":0,"x":0.02},{"duration":3,"tweenEasing":0,"x":0.06,"y":-0.06},{"duration":2,"tweenEasing":0,"x":-0.03,"y":-0.08},{"duration":2,"tweenEasing":0,"x":0.07,"y":-0.08},{"duration":0,"x":-0.03,"y":-0.07}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-101.03},{"tweenEasing":0,"rotate":-112.83},{"tweenEasing":0,"rotate":-120.87},{"tweenEasing":0,"rotate":-84.74},{"duration":3,"tweenEasing":0,"rotate":16.27},{"duration":2,"tweenEasing":0,"rotate":18.77},{"duration":2,"tweenEasing":0,"rotate":21.15},{"duration":0,"rotate":19.65}]},{"name":"effect_r","translateFrame":[{"duration":14,"x":38,"y":-21}],"rotateFrame":[{"duration":14,"rotate":13.67}],"scaleFrame":[{"duration":14,"x":1.08,"y":1.06}]},{"name":"root","translateFrame":[{"duration":6,"tweenEasing":0,"x":30.3,"y":8.7},{"tweenEasing":0,"x":41.9,"y":14.1},{"duration":3,"tweenEasing":0,"x":42.7,"y":53.1},{"duration":2,"tweenEasing":0,"x":44.05,"y":49.25},{"duration":2,"tweenEasing":0,"x":32.15,"y":51.6},{"duration":0,"x":3.75,"y":7.9}]},{"name":"thigh_r","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.22,"y":-7.99},{"tweenEasing":0,"x":-1.67,"y":-9.45},{"tweenEasing":0,"x":4.98,"y":-29.33},{"tweenEasing":0,"x":11.49,"y":-35.87},{"duration":3,"tweenEasing":0,"x":5.08,"y":-27.92},{"duration":2,"tweenEasing":0,"x":3.48,"y":-26.34},{"duration":2,"tweenEasing":0,"x":3.88,"y":-25.85},{"duration":0,"x":4.33,"y":-22.36}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":14.52},{"tweenEasing":0,"rotate":18.78},{"tweenEasing":0,"rotate":12.77},{"tweenEasing":0,"rotate":4},{"duration":3,"tweenEasing":0,"rotate":20.54},{"duration":2,"tweenEasing":0,"rotate":3.25},{"duration":2,"tweenEasing":0,"rotate":-11.51},{"duration":0,"rotate":13.27}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.01,"y":0.99},{"tweenEasing":0,"x":1.02,"y":0.99},{"tweenEasing":0,"y":0.99},{"tweenEasing":0,"x":1.01},{"duration":3,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":0.99},{"duration":0,"x":1.02,"y":0.99}]},{"name":"thigh_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.25,"y":7.66},{"tweenEasing":0,"x":-7.24,"y":17.63},{"tweenEasing":0,"x":-9.65,"y":28.63},{"tweenEasing":0,"x":-11.33,"y":35.09},{"duration":3,"tweenEasing":0,"x":-5.02,"y":27.33},{"duration":2,"tweenEasing":0,"x":-3.28,"y":25.79},{"duration":2,"tweenEasing":0,"x":-3.88,"y":25.23},{"duration":0,"x":-4.17,"y":21.88}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-13.81},{"tweenEasing":0,"rotate":-27.86},{"tweenEasing":0,"rotate":-13.81},{"tweenEasing":0,"rotate":-6.78},{"duration":3,"tweenEasing":0,"rotate":-84.23},{"duration":2,"tweenEasing":0,"rotate":-85.73},{"duration":2,"tweenEasing":0,"rotate":-89.5},{"duration":0,"rotate":-29.87}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.02},{"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":0.98},{"tweenEasing":0,"x":0.97},{"duration":3,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0},{"duration":0,"x":1.02,"y":1.01}]},{"name":"calf_r","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.2,"y":-0.2},{"tweenEasing":0,"x":0.34,"y":-0.01},{"tweenEasing":0,"x":0.52,"y":-0.24},{"tweenEasing":0,"x":0.64,"y":-0.23},{"duration":3,"tweenEasing":0,"x":0.63,"y":-0.27},{"duration":2,"tweenEasing":0,"x":0.55,"y":-0.16},{"duration":2,"tweenEasing":0,"x":0.49,"y":-0.34},{"duration":0,"x":0.27,"y":-0.1}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":8.32},{"tweenEasing":0,"rotate":9.08},{"tweenEasing":0,"rotate":35.92},{"tweenEasing":0,"rotate":54.72},{"duration":3,"tweenEasing":0,"rotate":65.46},{"duration":2,"tweenEasing":0,"rotate":81.24},{"duration":2,"tweenEasing":0,"rotate":96.99},{"duration":0,"rotate":7.31}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":0.98,"y":0.99},{"tweenEasing":0,"x":0.98,"y":0.99},{"tweenEasing":0,"x":1.01},{"tweenEasing":0,"x":1.04},{"duration":3,"tweenEasing":0,"x":1.04},{"duration":2,"tweenEasing":0,"x":1.05},{"duration":2,"tweenEasing":0,"x":1.05},{"duration":0,"x":0.98,"y":0.99}]},{"name":"calf_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":-0.15,"y":-0.18},{"tweenEasing":0,"x":-0.05,"y":-0.36},{"tweenEasing":0,"x":-0.46,"y":-0.23},{"tweenEasing":0,"x":0.03,"y":0.05},{"duration":3,"tweenEasing":0,"x":0.28,"y":-0.32},{"duration":2,"tweenEasing":0,"x":0.29,"y":-0.36},{"duration":2,"tweenEasing":0,"x":0.06,"y":-0.34},{"duration":0,"x":-0.22,"y":-0.25}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":47.11},{"tweenEasing":0,"rotate":62.67},{"tweenEasing":0,"rotate":13.28},{"tweenEasing":0,"rotate":-11.53},{"duration":3,"tweenEasing":0,"rotate":76.2},{"duration":2,"tweenEasing":0,"rotate":81.22},{"duration":2,"tweenEasing":0,"rotate":72.96},{"duration":0,"rotate":20.35}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.02,"y":0.99},{"tweenEasing":0,"x":1.03,"y":0.99},{"tweenEasing":0,"x":0.92,"y":0.99},{"tweenEasing":0,"x":0.95,"y":0.99},{"duration":3,"tweenEasing":0},{"duration":2,"tweenEasing":0,"x":0.87},{"duration":2,"tweenEasing":0,"x":0.95,"y":0.99},{"duration":0,"x":1.08}]},{"name":"foot_r","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.01,"y":-0.19},{"tweenEasing":0,"x":0.05,"y":-0.34},{"tweenEasing":0,"x":-0.84,"y":-0.15},{"tweenEasing":0,"x":-0.89,"y":-0.21},{"duration":3,"tweenEasing":0,"x":-0.94,"y":0.1},{"duration":2,"tweenEasing":0,"x":-0.87,"y":0.1},{"duration":2,"tweenEasing":0,"x":-0.99,"y":0.01},{"duration":0,"x":-0.03,"y":-0.27}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":4.22},{"tweenEasing":0,"rotate":5.97},{"tweenEasing":0,"rotate":13.51},{"tweenEasing":0,"rotate":19.78},{"duration":3,"tweenEasing":0,"rotate":-30.32},{"duration":2,"tweenEasing":0,"rotate":-14.52},{"duration":2,"tweenEasing":0,"rotate":-19.03},{"duration":0,"rotate":-20.58}],"scaleFrame":[{"duration":4,"tweenEasing":0,"x":1.03,"y":0.99},{"tweenEasing":0,"x":1.02,"y":0.99},{"tweenEasing":0,"x":0.98,"y":0.99},{"tweenEasing":0,"x":0.98,"y":0.99},{"duration":3,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":2,"tweenEasing":0,"x":1.01,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.98,"y":0.99},{"duration":0}]},{"name":"foot_l","translateFrame":[{"duration":4,"tweenEasing":0,"x":0.35,"y":0.05},{"tweenEasing":0,"x":0.62,"y":-0.21},{"tweenEasing":0,"x":0.45,"y":1.03},{"tweenEasing":0,"x":9.49,"y":-0.18},{"duration":3,"tweenEasing":0,"x":0.08,"y":0.4},{"duration":2,"tweenEasing":0,"x":9.81,"y":0.22},{"duration":2,"tweenEasing":0,"x":9.54,"y":-0.09},{"duration":0,"x":-0.09,"y":-0.05}],"rotateFrame":[{"duration":4,"tweenEasing":0,"rotate":-33.28},{"tweenEasing":0,"rotate":-11.98},{"tweenEasing":0,"rotate":14.98},{"tweenEasing":0,"rotate":18.76},{"duration":3,"tweenEasing":0,"rotate":8.52},{"duration":2,"tweenEasing":0,"rotate":4.91},{"duration":2,"tweenEasing":0,"rotate":17.01},{"duration":0,"rotate":20.33}],"scaleFrame":[{"duration":4,"tweenEasing":0},{"tweenEasing":0,"x":0.97,"y":0.99},{"tweenEasing":0,"x":0.97,"y":0.99},{"duration":6,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":0.98},{"duration":0,"x":0.99,"y":0.99}]}],"slot":[{"name":"pelvis","displayFrame":[{"duration":14,"value":1}]},{"name":"forearm_r","displayFrame":[{"duration":14,"value":1}]},{"name":"hand_r","displayFrame":[{"duration":6,"value":-1},{"duration":8,"value":1}]},{"name":"shouder_r","displayFrame":[{"duration":5,"value":2},{"duration":9,"value":1}]},{"name":"chest","displayFrame":[{"duration":5},{"value":1},{"duration":8,"value":2},{"duration":0,"value":1}]},{"name":"shouder_l","displayFrame":[{"duration":5},{"value":1},{"duration":8,"value":2},{"duration":0,"value":1}]},{"name":"hand_l","displayFrame":[{"duration":6},{"value":1},{"duration":7,"value":2},{"duration":0}]},{"name":"forearm_l","displayFrame":[{"duration":5},{"value":1},{"duration":8,"value":2},{"duration":0}]},{"name":"effect_r","displayFrame":[{"duration":6,"value":-1},{"duration":5},{"duration":3,"value":-1}]},{"name":"thigh_r","displayFrame":[{"duration":5},{"duration":9,"value":1},{"duration":0}]},{"name":"calf_r","displayFrame":[{"duration":5},{"duration":9,"value":1},{"duration":0}]},{"name":"foot_r","displayFrame":[{"duration":5},{"duration":9,"value":1},{"duration":0}]},{"name":"calf_l","displayFrame":[{"duration":5},{"duration":2,"value":1},{"duration":3},{"duration":4,"value":1},{"duration":0}]}]},{"duration":28,"playTimes":0,"fadeInTime":0.2,"name":"victory","bone":[{"name":"pelvis","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.02,"y":-0.02},{"duration":11,"tweenEasing":0,"x":0.01,"y":-0.11},{"duration":2,"tweenEasing":0,"x":0.01,"y":-0.11},{"duration":6,"tweenEasing":0,"x":0.04,"y":-0.14},{"duration":6,"tweenEasing":0,"x":0.1,"y":-0.07},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":6},{"duration":11,"tweenEasing":0,"rotate":-8},{"duration":2,"tweenEasing":0,"rotate":-8.25},{"duration":6,"tweenEasing":0,"rotate":-5.64},{"duration":6,"tweenEasing":0,"rotate":-2.97},{"duration":0}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.97},{"duration":11,"tweenEasing":0},{"duration":2,"tweenEasing":0},{"duration":6,"tweenEasing":0,"x":0.99},{"duration":6,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"chest","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.34,"y":1.95},{"duration":11,"tweenEasing":0,"x":0.19,"y":2.01},{"duration":2,"tweenEasing":0,"x":0.21,"y":2.13},{"duration":6,"tweenEasing":0,"x":0.23,"y":2.02},{"duration":6,"tweenEasing":0,"x":-0.79,"y":0.43},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":2.34},{"duration":11,"tweenEasing":0,"rotate":7.01},{"duration":2,"tweenEasing":0,"rotate":7.26},{"duration":6,"tweenEasing":0,"rotate":5.79},{"duration":6,"tweenEasing":0,"rotate":2.25},{"duration":0}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.94},{"duration":11,"tweenEasing":0,"x":1.02},{"duration":2,"tweenEasing":0,"x":1.02},{"duration":12}]},{"name":"shouder_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-2.7,"y":-3.44},{"duration":11,"tweenEasing":0,"x":14.25,"y":9.48},{"duration":2,"tweenEasing":0,"x":14.25,"y":9.48},{"duration":6,"tweenEasing":0,"x":8.43,"y":1.55},{"duration":6,"tweenEasing":0,"x":3.36,"y":0.86},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":24.66},{"duration":11,"tweenEasing":0,"rotate":-127.17},{"duration":2,"tweenEasing":0,"rotate":-127.17},{"duration":6,"tweenEasing":0,"rotate":-102.81},{"duration":6,"tweenEasing":0,"rotate":-44.58},{"duration":0}]},{"name":"shouder_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":12.28,"y":-0.92},{"duration":11,"tweenEasing":0,"x":-5.34,"y":-16.66},{"duration":2,"tweenEasing":0,"x":-5.34,"y":-16.66},{"duration":6,"tweenEasing":0,"x":0.51,"y":-6.97},{"duration":6,"tweenEasing":0,"x":1.05,"y":-4.05},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-24.49},{"duration":11,"tweenEasing":0,"rotate":-7.86},{"duration":2,"tweenEasing":0,"rotate":18.69},{"duration":6,"tweenEasing":0,"rotate":19.28},{"duration":6,"tweenEasing":0,"rotate":9.77},{"duration":0}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.94},{"duration":11,"tweenEasing":0,"x":0.9},{"duration":2,"tweenEasing":0,"x":0.88,"y":0.99},{"duration":6,"tweenEasing":0,"x":0.87,"y":0.99},{"duration":6,"tweenEasing":0,"x":0.91},{"duration":0}]},{"name":"forearm_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.08,"y":0.35},{"duration":11,"tweenEasing":0,"x":0.09,"y":0.17},{"duration":2,"tweenEasing":0,"x":0.17,"y":-0.57},{"duration":6,"tweenEasing":0,"x":0.38,"y":-0.6},{"duration":6,"tweenEasing":0,"x":0.37,"y":-0.28},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":5.94},{"duration":11,"tweenEasing":0,"rotate":9.46},{"duration":2,"tweenEasing":0,"rotate":-12.33},{"duration":6,"tweenEasing":0,"rotate":-14.34},{"duration":6,"tweenEasing":0,"rotate":-8.3},{"duration":0}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.98},{"duration":11,"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":0.9},{"duration":6,"tweenEasing":0,"x":0.92},{"duration":6,"tweenEasing":0,"x":1.02},{"duration":0}]},{"name":"forearm_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-1.11,"y":-0.32},{"duration":11,"tweenEasing":0,"x":0.55,"y":-0.42},{"duration":2,"tweenEasing":0,"x":0.55,"y":-0.42},{"duration":6,"tweenEasing":0,"x":0.12,"y":0.02},{"duration":6,"tweenEasing":0,"x":6.92,"y":1.22},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":16.97},{"duration":11,"tweenEasing":0,"rotate":3.95},{"duration":2,"tweenEasing":0,"rotate":3.95},{"duration":6,"tweenEasing":0,"rotate":-2.5},{"duration":6,"tweenEasing":0,"rotate":-0.84},{"duration":0}],"scaleFrame":[{"duration":3,"tweenEasing":0,"y":0.99},{"duration":11,"tweenEasing":0,"x":0.91,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.91,"y":0.99},{"duration":6,"tweenEasing":0,"x":0.84,"y":0.99},{"duration":6,"tweenEasing":0,"x":0.82,"y":0.99},{"duration":0}]},{"name":"hand_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.46,"y":-0.78},{"duration":11,"tweenEasing":0,"x":2.79,"y":-1.42},{"duration":2,"tweenEasing":0,"x":2.79,"y":-1.42},{"duration":6,"tweenEasing":0,"x":2.25,"y":-1.79},{"duration":6,"tweenEasing":0,"x":0.1,"y":-0.89},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":0.01},{"duration":11,"tweenEasing":0,"rotate":-3.52},{"duration":2,"tweenEasing":0,"rotate":-3.52},{"duration":6,"tweenEasing":0,"rotate":-4.04},{"duration":6,"tweenEasing":0,"rotate":-3.04},{"duration":0}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.02,"y":0.99},{"duration":11,"tweenEasing":0,"x":0.95,"y":0.99},{"duration":2,"tweenEasing":0,"x":0.95,"y":0.99},{"duration":6,"tweenEasing":0,"x":0.88,"y":0.99},{"duration":6,"tweenEasing":0,"x":0.82,"y":0.99},{"duration":0}]},{"name":"hand_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.19,"y":-0.17},{"duration":11,"tweenEasing":0,"x":0.2,"y":1.08},{"duration":2,"tweenEasing":0,"x":0.53,"y":1.1},{"duration":6,"tweenEasing":0,"x":0.59,"y":1.18},{"duration":6,"tweenEasing":0,"x":0.25,"y":0.68},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":0.01},{"duration":11,"tweenEasing":0,"rotate":-0.23},{"duration":2,"tweenEasing":0,"rotate":9.23},{"duration":6,"tweenEasing":0,"rotate":8.42},{"duration":6,"tweenEasing":0,"rotate":3.5},{"duration":0}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.99,"y":0.98},{"duration":11,"tweenEasing":0,"x":0.99,"y":0.98},{"duration":2,"tweenEasing":0,"x":0.97,"y":0.89},{"duration":6,"tweenEasing":0,"x":0.98,"y":0.91},{"duration":6}]},{"name":"weapon_hand_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.02,"y":0.04},{"duration":11,"tweenEasing":0,"x":0.01,"y":0.03},{"duration":2,"tweenEasing":0,"x":0.01,"y":0.02},{"duration":6,"tweenEasing":0,"x":0.05,"y":0.01},{"duration":6,"tweenEasing":0,"x":0.05,"y":0.03},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-11.56},{"duration":11,"tweenEasing":0,"rotate":35.02},{"duration":2,"tweenEasing":0,"rotate":34.46},{"duration":6,"tweenEasing":0,"rotate":35.98},{"duration":6,"tweenEasing":0,"rotate":26.72},{"duration":0}]},{"name":"weapon_hand_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.06,"y":-0.02},{"tweenEasing":0,"x":8.3,"y":-2.89},{"tweenEasing":0,"x":8.3,"y":-2.89},{"tweenEasing":0,"x":8.23,"y":-2.89},{"tweenEasing":0,"x":8.19,"y":-2.99},{"tweenEasing":0,"x":8.23,"y":-2.89},{"tweenEasing":0,"x":8.23,"y":-2.89},{"tweenEasing":0,"x":8.27,"y":-2.99},{"tweenEasing":0,"x":8.23,"y":-2.89},{"tweenEasing":0,"x":8.16,"y":-2.89},{"tweenEasing":0,"x":8.27,"y":-2.92},{"tweenEasing":0,"x":8.3,"y":-2.89},{"tweenEasing":0,"x":8.23,"y":-2.89},{"tweenEasing":0,"x":24.52,"y":-20.18},{"duration":6,"tweenEasing":0,"x":0.04,"y":-0.06},{"duration":6,"tweenEasing":0,"x":-0.07},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":72.69},{"tweenEasing":0,"rotate":-95.52},{"tweenEasing":0,"rotate":-151.72},{"tweenEasing":0,"rotate":124.8},{"tweenEasing":0,"rotate":63.15},{"tweenEasing":0,"rotate":5.26},{"tweenEasing":0,"rotate":-57.46},{"tweenEasing":0,"rotate":-116.85},{"tweenEasing":0,"rotate":-174.24},{"tweenEasing":0,"rotate":123.54},{"tweenEasing":0,"rotate":64.15},{"tweenEasing":0,"rotate":6.51},{"tweenEasing":0,"rotate":-55.46},{"tweenEasing":0,"rotate":-104.3},{"duration":6,"tweenEasing":0,"rotate":-96.77},{"duration":6,"tweenEasing":0,"rotate":-55.71},{"duration":0}]},{"name":"root","translateFrame":[{"duration":3,"tweenEasing":0,"x":-4.85,"y":14.4},{"duration":11,"tweenEasing":0,"x":8.25,"y":1.85},{"duration":2,"tweenEasing":0,"x":8.25,"y":1.85},{"duration":6,"tweenEasing":0,"x":2.05,"y":8.55},{"duration":6,"tweenEasing":0,"x":1.05,"y":4.3},{"duration":0}]},{"name":"thigh_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.57,"y":-1.47},{"duration":11,"tweenEasing":0,"x":4.74,"y":-4.13},{"duration":2,"tweenEasing":0,"x":4.89,"y":-4.13},{"duration":6,"tweenEasing":0,"x":4.53,"y":-3.36},{"duration":6,"tweenEasing":0,"x":3.49,"y":-0.94},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-22.27},{"duration":11,"tweenEasing":0,"rotate":3},{"duration":2,"tweenEasing":0,"rotate":2.75},{"duration":6,"tweenEasing":0,"rotate":-11.76},{"duration":6,"tweenEasing":0,"rotate":-8.5},{"duration":0}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.84,"y":0.99},{"duration":11,"tweenEasing":0,"x":1.01},{"duration":2,"tweenEasing":0,"x":1.01},{"duration":6,"tweenEasing":0,"x":0.93},{"duration":6,"tweenEasing":0,"x":0.95},{"duration":0}]},{"name":"thigh_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.57,"y":1.44},{"duration":11,"tweenEasing":0,"x":-4.62,"y":3.86},{"duration":2,"tweenEasing":0,"x":-4.82,"y":3.86},{"duration":6,"tweenEasing":0,"x":-4.5,"y":3.08},{"duration":6,"tweenEasing":0,"x":-1.5,"y":2.04},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-19.58},{"duration":11,"tweenEasing":0,"rotate":3.01},{"duration":2,"tweenEasing":0,"rotate":3.51},{"duration":6,"tweenEasing":0,"rotate":-9.54},{"duration":6,"tweenEasing":0,"rotate":-6.03},{"duration":0}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":1.01},{"duration":11,"tweenEasing":0,"x":0.98},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":6,"tweenEasing":0,"x":1.01},{"duration":6,"tweenEasing":0,"x":1.01},{"duration":0}]},{"name":"calf_r","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.26,"y":-0.24},{"duration":11,"tweenEasing":0,"x":0.17,"y":-0.03},{"duration":2,"tweenEasing":0,"x":0.19,"y":-0.01},{"duration":6,"tweenEasing":0,"x":-0.08,"y":-0.07},{"duration":6,"tweenEasing":0,"x":-0.07,"y":-0.09},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":33.01},{"duration":11,"tweenEasing":0,"rotate":9.04},{"duration":2,"tweenEasing":0,"rotate":9.54},{"duration":6,"tweenEasing":0,"rotate":27.29},{"duration":6,"tweenEasing":0,"rotate":17.02},{"duration":0}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.94},{"duration":11,"tweenEasing":0,"x":0.97},{"duration":2,"tweenEasing":0,"x":0.97},{"duration":6,"tweenEasing":0,"x":0.94},{"duration":6,"tweenEasing":0,"x":0.96},{"duration":0}]},{"name":"calf_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":-0.06,"y":-0.36},{"duration":11,"tweenEasing":0,"x":0.03,"y":0.02},{"duration":2,"tweenEasing":0,"x":0.05},{"duration":6,"tweenEasing":0,"x":-0.08,"y":-0.13},{"duration":6,"tweenEasing":0,"y":-0.15},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":20.59},{"duration":11,"tweenEasing":0,"rotate":-0.02},{"duration":2,"tweenEasing":0,"rotate":-0.77},{"duration":6,"tweenEasing":0,"rotate":13.3},{"duration":6,"tweenEasing":0,"rotate":8.28},{"duration":0}],"scaleFrame":[{"duration":3,"tweenEasing":0,"x":0.9},{"duration":11,"tweenEasing":0,"x":1.04},{"duration":2,"tweenEasing":0,"x":1.04},{"duration":6,"tweenEasing":0,"x":0.99},{"duration":6,"tweenEasing":0,"x":0.99},{"duration":0}]},{"name":"foot_r","translateFrame":[{"tweenEasing":0,"x":0.03,"y":-0.2},{"duration":2,"tweenEasing":0,"y":-0.13},{"duration":11,"tweenEasing":0,"x":-0.01,"y":-0.2},{"duration":2,"tweenEasing":0,"x":0.02,"y":-0.27},{"duration":6,"tweenEasing":0,"x":0.02,"y":-0.4},{"duration":6,"tweenEasing":0,"x":0.01,"y":-0.13},{"duration":0}],"rotateFrame":[{"tweenEasing":0,"rotate":-10.78},{"duration":2,"tweenEasing":0,"rotate":-11.2},{"duration":11,"tweenEasing":0,"rotate":-12.04},{"duration":2,"tweenEasing":0,"rotate":-12.29},{"duration":6,"tweenEasing":0,"rotate":-15.55},{"duration":6,"tweenEasing":0,"rotate":-8.53},{"duration":0}]},{"name":"foot_l","translateFrame":[{"duration":3,"tweenEasing":0,"x":0.14,"y":0.09},{"duration":11,"tweenEasing":0,"x":0.02,"y":0.03},{"duration":2,"tweenEasing":0,"x":-0.01},{"duration":6,"tweenEasing":0,"x":0.11,"y":0.01},{"duration":6,"tweenEasing":0,"x":0.1,"y":-0.11},{"duration":0}],"rotateFrame":[{"duration":3,"tweenEasing":0,"rotate":-1.08},{"duration":11,"tweenEasing":0,"rotate":-2.98},{"duration":2,"tweenEasing":0,"rotate":-2.73},{"duration":6,"tweenEasing":0,"rotate":-3.76},{"duration":6,"tweenEasing":0,"rotate":-2.26},{"duration":0}]}],"slot":[{"name":"forearm_r","displayFrame":[{"duration":28,"value":1}]},{"name":"weapon_hand_r","displayFrame":[{"duration":4},{"value":1},{"duration":4},{"duration":2,"value":2},{"duration":17}]},{"name":"shouder_r","displayFrame":[{"duration":28,"value":1}]}]}],"defaultActions":[{"gotoAndPlay":"idle"}]},{"type":"Armature","frameRate":25,"name":"we_bl_4","aabb":{"x":-83,"y":-221,"width":224,"height":246},"bone":[{"inheritScale":false,"name":"b"}],"slot":[{"name":"b","parent":"b"}],"skin":[{"name":"","slot":[{"name":"b","display":[{"name":"we_bl_4_f/1","transform":{"x":29,"y":-98}},{"name":"we_bl_4_f/2","transform":{"x":50,"y":-91.5}},{"name":"we_bl_4_f/3","transform":{"x":40,"y":-68}},{"name":"we_bl_4_f/4","transform":{"x":23.5,"y":-38}},{"name":"we_bl_4_f/5","transform":{"x":12.5,"y":-34}}]}]}],"animation":[{"duration":5,"name":"fade_in","slot":[{"name":"b","displayFrame":[{},{"value":1},{"value":2},{"value":3},{"value":4},{"duration":0,"value":-1}]}]}],"defaultActions":[{"gotoAndPlay":"fade_in"}]},{"type":"Armature","frameRate":25,"name":"we_bl_5","aabb":{"x":-97,"y":-26,"width":184,"height":236},"bone":[{"inheritScale":false,"name":"b"}],"slot":[{"name":"b","parent":"b"}],"skin":[{"name":"","slot":[{"name":"b","display":[{"name":"we_bl_5_f/1","transform":{"x":-5,"y":92}},{"name":"we_bl_5_f/2","transform":{"x":10.5,"y":64}},{"name":"we_bl_5_f/3","transform":{"x":-7,"y":57}},{"name":"we_bl_5_f/4","transform":{"x":-6,"y":18.5}},{"name":"we_bl_5_f/5","transform":{"x":-4,"y":-2.5}}]}]}],"animation":[{"duration":5,"name":"fade_in","slot":[{"name":"b","displayFrame":[{},{"value":1},{"value":2},{"value":3},{"value":4},{"duration":0,"value":-1}]}]}],"defaultActions":[{"gotoAndPlay":"fade_in"}]},{"type":"Armature","frameRate":25,"name":"weapon_replace","aabb":{"x":-56,"y":-44,"width":313,"height":102},"bone":[{"inheritScale":false,"name":"b","transform":{"x":100.5,"y":7}}],"slot":[{"name":"b","parent":"b"}],"skin":[{"name":"","slot":[{"name":"b","display":[{"name":"weapon_replace_folder/weapon_hand_r_4"}]}]}],"animation":[{"duration":0,"name":"a_1"}],"defaultActions":[{"gotoAndPlay":"a_1"}]}]} \ No newline at end of file diff --git a/tests/res/dragonbones/mecha_1004d_tex.json b/tests/res/dragonbones/mecha_1004d_tex.json new file mode 100644 index 00000000..d99021f5 --- /dev/null +++ b/tests/res/dragonbones/mecha_1004d_tex.json @@ -0,0 +1 @@ +{"SubTexture":[{"width":105,"y":130,"height":82,"name":"mecha_1004d_folder/textures/forearm_l_1","x":859},{"width":100,"y":214,"height":72,"name":"mecha_1004d_folder/textures/forearm_l_2","x":859},{"width":80,"y":288,"height":65,"name":"mecha_1004d_folder/textures/forearm_l_0","x":859},{"width":26,"y":510,"height":19,"name":"mecha_1004d_folder/textures/hand_l_1","x":961},{"width":26,"y":212,"height":25,"name":"mecha_1004d_folder/textures/hand_l_2","x":496},{"width":26,"y":485,"height":22,"name":"mecha_1004d_folder/textures/hand_l_0","x":990},{"width":27,"y":485,"height":23,"name":"mecha_1004d_folder/textures/hand_l_3","x":961},{"width":70,"y":186,"height":61,"name":"mecha_1004d_folder/textures/shouder_l_0","x":311},{"width":69,"y":951,"height":56,"name":"mecha_1004d_folder/textures/shouder_l_2","x":1},{"width":63,"y":1,"height":59,"name":"mecha_1004d_folder/textures/shouder_l_1","x":960},{"width":29,"y":128,"height":83,"name":"mecha_1004d_folder/textures/foot_l_0","x":966},{"width":83,"y":353,"height":56,"name":"mecha_1004d_folder/textures/thigh_l_0","x":418},{"width":61,"y":546,"height":44,"name":"mecha_1004d_folder/textures/calf_l_0","x":957},{"width":74,"y":951,"height":46,"name":"mecha_1004d_folder/textures/calf_l_1","x":72},{"width":68,"y":546,"height":61,"name":"mecha_1004d_folder/textures/pelvis_0","x":887},{"width":64,"y":347,"height":71,"name":"mecha_1004d_folder/textures/pelvis_1","x":941},{"width":58,"y":62,"height":64,"name":"mecha_1004d_folder/textures/pelvis_3","x":960},{"width":163,"y":185,"height":184,"name":"mecha_1004d_folder/textures/chest_1","x":694},{"width":154,"y":1,"height":183,"name":"mecha_1004d_folder/textures/chest_0","x":227},{"width":163,"y":185,"height":186,"name":"mecha_1004d_folder/textures/chest_3","x":529},{"width":168,"y":1,"height":182,"name":"mecha_1004d_folder/textures/chest_2","x":384},{"width":35,"y":592,"height":64,"name":"mecha_1004d_folder/textures/foot_r_0","x":957},{"width":30,"y":355,"height":85,"name":"mecha_1004d_folder/textures/foot_r_1","x":887},{"width":76,"y":130,"height":47,"name":"mecha_1004d_folder/textures/calf_r_1","x":758},{"width":72,"y":671,"height":39,"name":"mecha_1004d_folder/textures/calf_r_0","x":290},{"width":82,"y":186,"height":58,"name":"mecha_1004d_folder/textures/thigh_r_0","x":227},{"width":82,"y":288,"height":57,"name":"mecha_1004d_folder/textures/thigh_r_1","x":941},{"width":59,"y":214,"height":61,"name":"mecha_1004d_folder/textures/shouder_r_0","x":961},{"width":72,"y":485,"height":59,"name":"mecha_1004d_folder/textures/shouder_r_2","x":887},{"width":68,"y":420,"height":63,"name":"mecha_1004d_folder/textures/shouder_r_1","x":941},{"width":29,"y":185,"height":25,"name":"mecha_1004d_folder/textures/hand_r_3","x":496},{"width":26,"y":442,"height":24,"name":"mecha_1004d_folder/textures/hand_r_1","x":887},{"width":27,"y":509,"height":21,"name":"mecha_1004d_folder/textures/hand_r_2","x":990},{"width":102,"y":671,"height":39,"name":"mecha_1004d_folder/textures/forearm_r_3","x":186},{"width":111,"y":185,"height":56,"name":"mecha_1004d_folder/textures/forearm_r_2","x":383},{"frameX":0,"frameHeight":118,"y":353,"frameY":0,"frameWidth":203,"width":202,"height":117,"name":"we_bl_4_f/5","x":214},{"frameX":0,"frameHeight":237,"y":713,"frameY":0,"frameWidth":182,"width":182,"height":236,"name":"we_bl_4_f/2","x":1},{"frameX":0,"frameHeight":128,"y":1,"frameY":0,"frameWidth":201,"width":200,"height":127,"name":"we_bl_4_f/4","x":758},{"width":224,"y":1,"height":246,"name":"we_bl_4_f/1","x":1},{"frameX":-1,"frameHeight":196,"y":475,"frameY":-1,"frameWidth":198,"width":196,"height":194,"name":"we_bl_4_f/3","x":186},{"frameX":0,"frameHeight":236,"y":475,"frameY":0,"frameWidth":184,"width":183,"height":236,"name":"we_bl_5_f/1","x":1},{"frameX":-1,"frameHeight":121,"y":371,"frameY":0,"frameWidth":192,"width":191,"height":121,"name":"we_bl_5_f/5","x":694},{"width":202,"y":1,"height":145,"name":"we_bl_5_f/4","x":554},{"width":185,"y":713,"height":212,"name":"we_bl_5_f/2","x":185},{"frameX":-1,"frameHeight":224,"y":249,"frameY":0,"frameWidth":212,"width":211,"height":224,"name":"we_bl_5_f/3","x":1},{"width":313,"y":249,"height":102,"name":"weapon_replace_folder/weapon_hand_r_4","x":214}],"width":1024,"height":1024,"name":"mecha_1004d","imagePath":"mecha_1004d_tex.png"} \ No newline at end of file diff --git a/tests/res/dragonbones/mecha_1004d_tex.png b/tests/res/dragonbones/mecha_1004d_tex.png new file mode 100644 index 00000000..507d282e Binary files /dev/null and b/tests/res/dragonbones/mecha_1004d_tex.png differ diff --git a/tests/res/editbox.png b/tests/res/editbox.png new file mode 100644 index 00000000..d6182f09 Binary files /dev/null and b/tests/res/editbox.png differ diff --git a/tests/src/app/scenes/MainScene.lua b/tests/src/app/scenes/MainScene.lua index ea62274d..f1084972 100755 --- a/tests/src/app/scenes/MainScene.lua +++ b/tests/src/app/scenes/MainScene.lua @@ -10,6 +10,8 @@ function MainScene:ctor() "Test_Audio", "Test_ClippingRectangleNode", "Test_CocosStudio", + "Test_DragonBones", + "Test_EditBox", "Test_FairyGUI", "Test_KeypadEvent", "Test_LuaProtobuf", diff --git a/tests/src/app/views/Test_Audio.lua b/tests/src/app/views/Test_Audio.lua index f8bad169..e3ace02c 100755 --- a/tests/src/app/views/Test_Audio.lua +++ b/tests/src/app/views/Test_Audio.lua @@ -60,6 +60,7 @@ function TestCase:ctor() audio.loadFile("audio/bgm.ogg", loadedCB) audio.loadFile("audio/effect.ogg", loadedCB) audio.loadFile("audio/bgm.aac", loadedCB) + audio.loadFile("audio/effect.mp3", loadedCB) btn:setVisible(false) end end) diff --git a/tests/src/app/views/Test_DragonBones.lua b/tests/src/app/views/Test_DragonBones.lua new file mode 100644 index 00000000..c6c474b7 --- /dev/null +++ b/tests/src/app/views/Test_DragonBones.lua @@ -0,0 +1,35 @@ +local BaseLayer = require("app.scenes.BaseLayer") + +local TestCase = class("Test_DragonBones", BaseLayer) + +function TestCase:ctor() + self.super.ctor(self) + + -- tips + if not app._isDBLoaded then + -- DragonBones runtime will cache json and atlas, only need load once + dragonBones.CCFactory:loadDragonBonesData("dragonbones/mecha_1004d_ske.json") + dragonBones.CCFactory:loadTextureAtlasData("dragonbones/mecha_1004d_tex.json") + app._isDBLoaded = true + end + local db = dragonBones.CCFactory:buildArmatureDisplay("mecha_1004d") + self.db = db + local ani = db:getAnimation() + ani:play("walk") + db:addDBEventListener("loopComplete", function(event) + local attackState = ani:getState("attack_01") + if not attackState then + attackState = ani:fadeIn("attack_01", 0.1, 1, 1) + attackState.resetToPose = false + attackState.autoFadeOutTime = 0.1 + attackState.timeScale = 0.5 + attackState:addBoneMask("chest") + attackState:addBoneMask("effect_l") + attackState:addBoneMask("effect_r") + end + end) + db:addTo(self) + db:pos(display.cx, display.cy - 100) +end + +return TestCase diff --git a/tests/src/app/views/Test_EditBox.lua b/tests/src/app/views/Test_EditBox.lua new file mode 100644 index 00000000..1f2d41ed --- /dev/null +++ b/tests/src/app/views/Test_EditBox.lua @@ -0,0 +1,72 @@ +local BaseLayer = require("app.scenes.BaseLayer") + +local TestCase = class("Test_EditBox", BaseLayer) + +function TestCase:ctor() + self.super.ctor(self) + + -- tips + self:addTextUIInput() + self:addPDUIInput() +end + +-- 文本输入框 +function TestCase:addTextUIInput() + local editbox = ccui.EditBox:create(cc.size(134, 43), "editbox.png", 0) + editbox:setInputMode(cc.EDITBOX_INPUT_MODE_SINGLELINE) + editbox:setTextHorizontalAlignment(cc.TEXT_ALIGNMENT_CENTER) + editbox:setPlaceholderFontSize(22) + editbox:setFontSize(22) + editbox:setPosition(display.width / 2, display.height / 2) + self:addChild(editbox) + -- editbox:setText("默认文本") + editbox:setPlaceHolder("输入文本") -- 提示输入文本 + editbox:registerScriptEditBoxHandler(function(event, target) + if event == "began" then + -- 开始输入 + print("开始输入") + elseif event == "changed" then + -- 输入框内容发生变化 + print("输入框内容发生变化") + local text = editbox:getText() + print(text) + elseif event == "ended" then + -- 输入结束 + print("输入结束") + elseif event == "return" then + -- 从输入框返回 + print("从输入框返回") + end + end) +end + +-- 密码输入框 +function TestCase:addPDUIInput() + local editbox = ccui.EditBox:create(cc.size(134, 43), "editbox.png", 0) + editbox:setInputMode(cc.EDITBOX_INPUT_MODE_SINGLELINE) + editbox:setPlaceholderFontSize(22) + editbox:setFontSize(22) + editbox:setPosition(display.width / 2, display.height / 2 - 100) + self:addChild(editbox) + editbox:setPlaceHolder("输入密码") + editbox:setInputFlag(cc.EDITBOX_INPUT_FLAG_PASSWORD) + editbox:registerScriptEditBoxHandler(function(event, target) + if event == "began" then + -- 开始输入 + print("开始输入") + elseif event == "changed" then + -- 输入框内容发生变化 + print("输入框内容发生变化") + local text = editbox:getText() + print(text) + elseif event == "ended" then + -- 输入结束 + print("输入结束") + elseif event == "return" then + -- 从输入框返回 + print("从输入框返回") + end + end) +end + +return TestCase diff --git a/tests/src/app/views/Test_FairyGUI.lua b/tests/src/app/views/Test_FairyGUI.lua index 465f55b9..3e574eff 100755 --- a/tests/src/app/views/Test_FairyGUI.lua +++ b/tests/src/app/views/Test_FairyGUI.lua @@ -16,18 +16,14 @@ function TestCase:ctor() -- btn event, fairy has it's own EventDispatcher, cover the cocos's node local btn = view:getChild("n9") - btn:addEventListener(fairygui.UIEventType.TouchEnd, function(context) - local input = context:getInput() - local touchPos = input:getTouch():getLocation() - if btn:displayObject():hitTest(touchPos) then - print("touch ended") + btn:addEventListener(fairygui.UIEventType.Click, function(context) + -- 不能在fgui事件里面做删除自己等操作,内部会崩. + self:performWithDelay(function() self.fairyRoot:release() -- XXX:场景切换的时候需要释放fairygui的静态数据,避免不必要的异常 fairygui.HtmlObject:clearStaticPools() fairygui.DragDropManager:destroyInstance() - else - print("touch canceled") - end + end, 0) end) local btnOpenWin = view:getChild("btnOpenWin") diff --git a/tests/src/app/views/Test_Spine.lua b/tests/src/app/views/Test_Spine.lua index 8fdf1d2f..5ac7585b 100755 --- a/tests/src/app/views/Test_Spine.lua +++ b/tests/src/app/views/Test_Spine.lua @@ -14,6 +14,25 @@ function TestCase:ctor() spineSP:setAnimation(0, "run", true) -- aim mode spineSP:setAnimation(1, "aim", false) + + self:performWithDelay(function() + spineSP:setAnimation(2, "shoot", false) + spineSP:registerSpineEventHandler(function(event) + if event.animation == "shoot" and event.trackIndex == 2 then + spineSP:clearTrack(2) + spineSP:setEmptyAnimation(1, 0.1) -- remove aim, back to run only + end + end, sp.EventType.ANIMATION_COMPLETE) + end, 4) + + local y = 0 + spineSP:setPostUpdateWorldTransformsListener(function() + if y > 247 then + return + end + y = y + 1 + spineSP:updateBone("crosshair", {x = 400, y = y}) + end) end return TestCase diff --git a/tools/runner/CMakeLists.txt b/tools/runner/CMakeLists.txt index d8cceb58..b4628c71 100644 --- a/tools/runner/CMakeLists.txt +++ b/tools/runner/CMakeLists.txt @@ -43,7 +43,6 @@ elseif(MACOSX) ) set(APP_UI_RES ${CMAKE_CURRENT_SOURCE_DIR}/proj.mac/Icon.icns - ${CMAKE_CURRENT_SOURCE_DIR}/proj.mac/Info.plist ${CMAKE_CURRENT_SOURCE_DIR}/proj.mac/ConsoleWindow.xib ) list(APPEND GAME_SOURCE @@ -66,14 +65,13 @@ setup_cocos_app_config(${APP_NAME}) # always open COCOS2D_DEBUG in cocos2d target_compile_definitions(cocos2d PUBLIC $<$:COCOS2D_DEBUG=1>) if(MACOSX) + set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)") set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}") set_xcode_property(${APP_NAME} INSTALL_PATH "\${LOCAL_APPS_DIR}") # fix archive no file + set_xcode_property(${APP_NAME} OTHER_LDFLAGS[arch=x86_64] "-pagezero_size 10000 -image_base 100000000 $(inherited)") set_target_properties(${APP_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/proj.mac/Info.plist" ) - set_target_properties(${APP_NAME} PROPERTIES - LINK_FLAGS "-pagezero_size 10000 -image_base 100000000" - ) elseif(WINDOWS) cocos_copy_target_dll(${APP_NAME}) endif() diff --git a/tools/runner/proj.mac/main.mm b/tools/runner/proj.mac/main.mm index 00eb05cd..e039ab9a 100644 --- a/tools/runner/proj.mac/main.mm +++ b/tools/runner/proj.mac/main.mm @@ -101,6 +101,9 @@ int main(int argc, char *argv[]) CommandSetup *cmd = CommandSetup::getInstance(); cmd->setRelauncher(relaunchSelf); cmd->setEngineRootPath(getEngineRoot()); + if (argc > 2 && strcmp(argv[1], "-NSDocumentRevisionsDebugMode") == 0) { + argc = 1; // not parse -NSDocumentRevisionsDebugMode YES + } cmd->parseCommand(argc, argv); cmd->setupEngine(); @@ -108,12 +111,12 @@ int main(int argc, char *argv[]) // create after GLView inited ConsoleWindowController *consoleController = [[ConsoleWindowController alloc] initWithWindowNibName:@"ConsoleWindow"]; [consoleController.window orderFrontRegardless]; -#endif std::string logPath = cmd->getLogPath(); if (logPath.size() > 0) { [consoleController openLogToFile:logPath.c_str()]; } +#endif setupMenu();// after GLView inited diff --git a/tools/runner/proj.win32/main.cpp b/tools/runner/proj.win32/main.cpp index df52a290..d7fb666f 100644 --- a/tools/runner/proj.win32/main.cpp +++ b/tools/runner/proj.win32/main.cpp @@ -67,12 +67,19 @@ static void relaunchSelf(std::string& cmdLine) if (!GetModuleFileName(NULL, szAppDir, MAX_PATH)) return; - int len = wcslen(szAppDir) + 1; + char* old_locale = _strdup(setlocale(LC_CTYPE, NULL)); //store the old locale + setlocale(LC_CTYPE, setlocale(LC_ALL, "")); //use LC_ALL to make wcstombs work with chinese. + + int len = wcslen(szAppDir) * sizeof(wchar_t) + 1; char* chAppDir = (char*)malloc(len); + memset(chAppDir, 0, len); wcstombs(chAppDir, szAppDir, len); - chAppDir[len - 1] = '\0'; - std::string exePath(chAppDir); + //restore the old locale. + setlocale(LC_CTYPE, old_locale); + free(old_locale); // free memory + + std::string exePath(chAppDir); free(chAppDir); // free memory std::string winCmd = exePath + " " + cmdLine;