|
|
@@ -0,0 +1,4183 @@
|
|
|
+#include "Base.h"
|
|
|
+#include "ScriptController.h"
|
|
|
+#include "CheckBox.h"
|
|
|
+#include "lua_CheckBox.h"
|
|
|
+#include "lua_Global.h"
|
|
|
+
|
|
|
+namespace gameplay
|
|
|
+{
|
|
|
+
|
|
|
+void luaRegister_CheckBox()
|
|
|
+{
|
|
|
+ ScriptController* sc = ScriptController::getInstance();
|
|
|
+
|
|
|
+ const luaL_Reg lua_members[] =
|
|
|
+ {
|
|
|
+ {"addListener", lua_CheckBox_addListener},
|
|
|
+ {"addRef", lua_CheckBox_addRef},
|
|
|
+ {"createAnimation", lua_CheckBox_createAnimation},
|
|
|
+ {"createAnimationFromBy", lua_CheckBox_createAnimationFromBy},
|
|
|
+ {"createAnimationFromTo", lua_CheckBox_createAnimationFromTo},
|
|
|
+ {"destroyAnimation", lua_CheckBox_destroyAnimation},
|
|
|
+ {"disable", lua_CheckBox_disable},
|
|
|
+ {"enable", lua_CheckBox_enable},
|
|
|
+ {"getAlignment", lua_CheckBox_getAlignment},
|
|
|
+ {"getAnimation", lua_CheckBox_getAnimation},
|
|
|
+ {"getAnimationPropertyComponentCount", lua_CheckBox_getAnimationPropertyComponentCount},
|
|
|
+ {"getAnimationPropertyValue", lua_CheckBox_getAnimationPropertyValue},
|
|
|
+ {"getAutoHeight", lua_CheckBox_getAutoHeight},
|
|
|
+ {"getAutoWidth", lua_CheckBox_getAutoWidth},
|
|
|
+ {"getBorder", lua_CheckBox_getBorder},
|
|
|
+ {"getBounds", lua_CheckBox_getBounds},
|
|
|
+ {"getClip", lua_CheckBox_getClip},
|
|
|
+ {"getClipBounds", lua_CheckBox_getClipBounds},
|
|
|
+ {"getConsumeTouchEvents", lua_CheckBox_getConsumeTouchEvents},
|
|
|
+ {"getCursorColor", lua_CheckBox_getCursorColor},
|
|
|
+ {"getCursorRegion", lua_CheckBox_getCursorRegion},
|
|
|
+ {"getCursorUVs", lua_CheckBox_getCursorUVs},
|
|
|
+ {"getFont", lua_CheckBox_getFont},
|
|
|
+ {"getFontSize", lua_CheckBox_getFontSize},
|
|
|
+ {"getHeight", lua_CheckBox_getHeight},
|
|
|
+ {"getID", lua_CheckBox_getID},
|
|
|
+ {"getImageColor", lua_CheckBox_getImageColor},
|
|
|
+ {"getImageRegion", lua_CheckBox_getImageRegion},
|
|
|
+ {"getImageSize", lua_CheckBox_getImageSize},
|
|
|
+ {"getImageUVs", lua_CheckBox_getImageUVs},
|
|
|
+ {"getMargin", lua_CheckBox_getMargin},
|
|
|
+ {"getOpacity", lua_CheckBox_getOpacity},
|
|
|
+ {"getPadding", lua_CheckBox_getPadding},
|
|
|
+ {"getRefCount", lua_CheckBox_getRefCount},
|
|
|
+ {"getSkinColor", lua_CheckBox_getSkinColor},
|
|
|
+ {"getSkinRegion", lua_CheckBox_getSkinRegion},
|
|
|
+ {"getState", lua_CheckBox_getState},
|
|
|
+ {"getStyle", lua_CheckBox_getStyle},
|
|
|
+ {"getText", lua_CheckBox_getText},
|
|
|
+ {"getTextAlignment", lua_CheckBox_getTextAlignment},
|
|
|
+ {"getTextColor", lua_CheckBox_getTextColor},
|
|
|
+ {"getTextRightToLeft", lua_CheckBox_getTextRightToLeft},
|
|
|
+ {"getWidth", lua_CheckBox_getWidth},
|
|
|
+ {"getX", lua_CheckBox_getX},
|
|
|
+ {"getY", lua_CheckBox_getY},
|
|
|
+ {"getZIndex", lua_CheckBox_getZIndex},
|
|
|
+ {"isChecked", lua_CheckBox_isChecked},
|
|
|
+ {"isEnabled", lua_CheckBox_isEnabled},
|
|
|
+ {"release", lua_CheckBox_release},
|
|
|
+ {"setAlignment", lua_CheckBox_setAlignment},
|
|
|
+ {"setAnimationPropertyValue", lua_CheckBox_setAnimationPropertyValue},
|
|
|
+ {"setAutoHeight", lua_CheckBox_setAutoHeight},
|
|
|
+ {"setAutoWidth", lua_CheckBox_setAutoWidth},
|
|
|
+ {"setBorder", lua_CheckBox_setBorder},
|
|
|
+ {"setBounds", lua_CheckBox_setBounds},
|
|
|
+ {"setChecked", lua_CheckBox_setChecked},
|
|
|
+ {"setConsumeTouchEvents", lua_CheckBox_setConsumeTouchEvents},
|
|
|
+ {"setCursorColor", lua_CheckBox_setCursorColor},
|
|
|
+ {"setCursorRegion", lua_CheckBox_setCursorRegion},
|
|
|
+ {"setFont", lua_CheckBox_setFont},
|
|
|
+ {"setFontSize", lua_CheckBox_setFontSize},
|
|
|
+ {"setImageColor", lua_CheckBox_setImageColor},
|
|
|
+ {"setImageRegion", lua_CheckBox_setImageRegion},
|
|
|
+ {"setImageSize", lua_CheckBox_setImageSize},
|
|
|
+ {"setMargin", lua_CheckBox_setMargin},
|
|
|
+ {"setOpacity", lua_CheckBox_setOpacity},
|
|
|
+ {"setPadding", lua_CheckBox_setPadding},
|
|
|
+ {"setPosition", lua_CheckBox_setPosition},
|
|
|
+ {"setSize", lua_CheckBox_setSize},
|
|
|
+ {"setSkinColor", lua_CheckBox_setSkinColor},
|
|
|
+ {"setSkinRegion", lua_CheckBox_setSkinRegion},
|
|
|
+ {"setState", lua_CheckBox_setState},
|
|
|
+ {"setStyle", lua_CheckBox_setStyle},
|
|
|
+ {"setText", lua_CheckBox_setText},
|
|
|
+ {"setTextAlignment", lua_CheckBox_setTextAlignment},
|
|
|
+ {"setTextColor", lua_CheckBox_setTextColor},
|
|
|
+ {"setTextRightToLeft", lua_CheckBox_setTextRightToLeft},
|
|
|
+ {"setZIndex", lua_CheckBox_setZIndex},
|
|
|
+ {NULL, NULL}
|
|
|
+ };
|
|
|
+ const luaL_Reg lua_statics[] =
|
|
|
+ {
|
|
|
+ {"ANIMATE_OPACITY", lua_CheckBox_static_ANIMATE_OPACITY},
|
|
|
+ {"ANIMATE_POSITION", lua_CheckBox_static_ANIMATE_POSITION},
|
|
|
+ {"ANIMATE_POSITION_X", lua_CheckBox_static_ANIMATE_POSITION_X},
|
|
|
+ {"ANIMATE_POSITION_Y", lua_CheckBox_static_ANIMATE_POSITION_Y},
|
|
|
+ {"ANIMATE_SIZE", lua_CheckBox_static_ANIMATE_SIZE},
|
|
|
+ {"ANIMATE_SIZE_HEIGHT", lua_CheckBox_static_ANIMATE_SIZE_HEIGHT},
|
|
|
+ {"ANIMATE_SIZE_WIDTH", lua_CheckBox_static_ANIMATE_SIZE_WIDTH},
|
|
|
+ {NULL, NULL}
|
|
|
+ };
|
|
|
+ std::vector<std::string> scopePath;
|
|
|
+
|
|
|
+ sc->registerClass("CheckBox", lua_members, NULL, lua_CheckBox__gc, lua_statics, scopePath);
|
|
|
+}
|
|
|
+
|
|
|
+static CheckBox* getInstance(lua_State* state)
|
|
|
+{
|
|
|
+ void* userdata = luaL_checkudata(state, 1, "CheckBox");
|
|
|
+ luaL_argcheck(state, userdata != NULL, 1, "'CheckBox' expected.");
|
|
|
+ return (CheckBox*)((ScriptController::LuaObject*)userdata)->instance;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox__gc(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ void* userdata = luaL_checkudata(state, 1, "CheckBox");
|
|
|
+ luaL_argcheck(state, userdata != NULL, 1, "'CheckBox' expected.");
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)userdata;
|
|
|
+ if (object->owns)
|
|
|
+ {
|
|
|
+ CheckBox* instance = (CheckBox*)object->instance;
|
|
|
+ SAFE_RELEASE(instance);
|
|
|
+ }
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_addListener(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 3) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ void* userdata2 = ScriptController::getInstance()->getObjectPointer(2, "ControlListener");
|
|
|
+ if (!userdata2)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to retrieve a valid object pointer of type 'Control::Listener' for parameter 2.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ Control::Listener* param1 = (Control::Listener*)((ScriptController::LuaObject*)userdata2)->instance;
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ int param2 = (int)luaL_checkint(state, 3);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->addListener(param1, param2);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 3).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_addRef(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->addRef();
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_createAnimation(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING &&
|
|
|
+ lua_type(state, 3) == LUA_TSTRING)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ const char* param1 = luaL_checkstring(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ const char* param2 = luaL_checkstring(state, 3);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)instance->createAnimation(param1, param2);
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Animation");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING &&
|
|
|
+ lua_type(state, 3) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ const char* param1 = luaL_checkstring(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ void* userdata3 = ScriptController::getInstance()->getObjectPointer(3, "Properties");
|
|
|
+ if (!userdata3)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to retrieve a valid object pointer of type 'Properties' for parameter 3.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ Properties* param2 = (Properties*)((ScriptController::LuaObject*)userdata3)->instance;
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)instance->createAnimation(param1, param2);
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Animation");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 7:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING &&
|
|
|
+ lua_type(state, 3) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 4) == LUA_TNUMBER &&
|
|
|
+ (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) &&
|
|
|
+ (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) &&
|
|
|
+ lua_type(state, 7) == LUA_TSTRING)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ const char* param1 = luaL_checkstring(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ int param2 = (int)luaL_checkint(state, 3);
|
|
|
+
|
|
|
+ // Get parameter 3 off the stack.
|
|
|
+ unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 4);
|
|
|
+
|
|
|
+ // Get parameter 4 off the stack.
|
|
|
+ unsigned long* param4 = ScriptController::getInstance()->getUnsignedLongPointer(5);
|
|
|
+
|
|
|
+ // Get parameter 5 off the stack.
|
|
|
+ float* param5 = ScriptController::getInstance()->getFloatPointer(6);
|
|
|
+
|
|
|
+ // Get parameter 6 off the stack.
|
|
|
+ Curve::InterpolationType param6 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 7));
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6);
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Animation");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 9:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING &&
|
|
|
+ lua_type(state, 3) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 4) == LUA_TNUMBER &&
|
|
|
+ (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) &&
|
|
|
+ (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) &&
|
|
|
+ (lua_type(state, 7) == LUA_TTABLE || lua_type(state, 7) == LUA_TLIGHTUSERDATA) &&
|
|
|
+ (lua_type(state, 8) == LUA_TTABLE || lua_type(state, 8) == LUA_TLIGHTUSERDATA) &&
|
|
|
+ lua_type(state, 9) == LUA_TSTRING)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ const char* param1 = luaL_checkstring(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ int param2 = (int)luaL_checkint(state, 3);
|
|
|
+
|
|
|
+ // Get parameter 3 off the stack.
|
|
|
+ unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 4);
|
|
|
+
|
|
|
+ // Get parameter 4 off the stack.
|
|
|
+ unsigned long* param4 = ScriptController::getInstance()->getUnsignedLongPointer(5);
|
|
|
+
|
|
|
+ // Get parameter 5 off the stack.
|
|
|
+ float* param5 = ScriptController::getInstance()->getFloatPointer(6);
|
|
|
+
|
|
|
+ // Get parameter 6 off the stack.
|
|
|
+ float* param6 = ScriptController::getInstance()->getFloatPointer(7);
|
|
|
+
|
|
|
+ // Get parameter 7 off the stack.
|
|
|
+ float* param7 = ScriptController::getInstance()->getFloatPointer(8);
|
|
|
+
|
|
|
+ // Get parameter 8 off the stack.
|
|
|
+ Curve::InterpolationType param8 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 9));
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8);
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Animation");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 3, 7 or 9).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_createAnimationFromBy(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 7:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING &&
|
|
|
+ lua_type(state, 3) == LUA_TNUMBER &&
|
|
|
+ (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) &&
|
|
|
+ (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) &&
|
|
|
+ lua_type(state, 6) == LUA_TSTRING &&
|
|
|
+ lua_type(state, 7) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ const char* param1 = luaL_checkstring(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ int param2 = (int)luaL_checkint(state, 3);
|
|
|
+
|
|
|
+ // Get parameter 3 off the stack.
|
|
|
+ float* param3 = ScriptController::getInstance()->getFloatPointer(4);
|
|
|
+
|
|
|
+ // Get parameter 4 off the stack.
|
|
|
+ float* param4 = ScriptController::getInstance()->getFloatPointer(5);
|
|
|
+
|
|
|
+ // Get parameter 5 off the stack.
|
|
|
+ Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6));
|
|
|
+
|
|
|
+ // Get parameter 6 off the stack.
|
|
|
+ unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6);
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Animation");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 7).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_createAnimationFromTo(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 7:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING &&
|
|
|
+ lua_type(state, 3) == LUA_TNUMBER &&
|
|
|
+ (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) &&
|
|
|
+ (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) &&
|
|
|
+ lua_type(state, 6) == LUA_TSTRING &&
|
|
|
+ lua_type(state, 7) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ const char* param1 = luaL_checkstring(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ int param2 = (int)luaL_checkint(state, 3);
|
|
|
+
|
|
|
+ // Get parameter 3 off the stack.
|
|
|
+ float* param3 = ScriptController::getInstance()->getFloatPointer(4);
|
|
|
+
|
|
|
+ // Get parameter 4 off the stack.
|
|
|
+ float* param4 = ScriptController::getInstance()->getFloatPointer(5);
|
|
|
+
|
|
|
+ // Get parameter 5 off the stack.
|
|
|
+ Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6));
|
|
|
+
|
|
|
+ // Get parameter 6 off the stack.
|
|
|
+ unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6);
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Animation");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 7).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_destroyAnimation(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->destroyAnimation();
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ const char* param1 = luaL_checkstring(state, 2);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->destroyAnimation(param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_disable(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->disable();
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_enable(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->enable();
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getAlignment(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ Control::Alignment result = instance->getAlignment();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushstring(state, lua_stringFromEnum_ControlAlignment(result).c_str());
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getAnimation(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)instance->getAnimation();
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Animation");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ const char* param1 = luaL_checkstring(state, 2);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)instance->getAnimation(param1);
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Animation");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getAnimationPropertyComponentCount(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ int param1 = (int)luaL_checkint(state, 2);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ unsigned int result = instance->getAnimationPropertyComponentCount(param1);
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushunsigned(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getAnimationPropertyValue(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 3) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ int param1 = (int)luaL_checkint(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ void* userdata3 = ScriptController::getInstance()->getObjectPointer(3, "AnimationValue");
|
|
|
+ if (!userdata3)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to retrieve a valid object pointer of type 'AnimationValue' for parameter 3.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ AnimationValue* param2 = (AnimationValue*)((ScriptController::LuaObject*)userdata3)->instance;
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->getAnimationPropertyValue(param1, param2);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 3).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getAutoHeight(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ bool result = instance->getAutoHeight();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushboolean(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getAutoWidth(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ bool result = instance->getAutoWidth();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushboolean(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getBorder(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)&(instance->getBorder());
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "ThemeSideRegions");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)&(instance->getBorder(param1));
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "ThemeSideRegions");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getBounds(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)&(instance->getBounds());
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Rectangle");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getClip(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)&(instance->getClip());
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Rectangle");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getClipBounds(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)&(instance->getClipBounds());
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Rectangle");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getConsumeTouchEvents(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ bool result = instance->getConsumeTouchEvents();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushboolean(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getCursorColor(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)&(instance->getCursorColor(param1));
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Vector4");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getCursorRegion(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)&(instance->getCursorRegion(param1));
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Rectangle");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getCursorUVs(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)&(instance->getCursorUVs(param1));
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "ThemeUVs");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getFont(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)instance->getFont();
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Font");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)instance->getFont(param1);
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Font");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getFontSize(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ unsigned int result = instance->getFontSize();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushunsigned(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ unsigned int result = instance->getFontSize(param1);
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushunsigned(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getHeight(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ float result = instance->getHeight();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushnumber(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getID(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ const char* result = instance->getID();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushstring(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getImageColor(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING &&
|
|
|
+ lua_type(state, 3) == LUA_TSTRING)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ const char* param1 = luaL_checkstring(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3));
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)&(instance->getImageColor(param1, param2));
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Vector4");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 3).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getImageRegion(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING &&
|
|
|
+ lua_type(state, 3) == LUA_TSTRING)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ const char* param1 = luaL_checkstring(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3));
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)&(instance->getImageRegion(param1, param2));
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Rectangle");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 3).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getImageSize(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)&(instance->getImageSize());
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Vector2");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getImageUVs(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING &&
|
|
|
+ lua_type(state, 3) == LUA_TSTRING)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ const char* param1 = luaL_checkstring(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3));
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)&(instance->getImageUVs(param1, param2));
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "ThemeUVs");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 3).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getMargin(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)&(instance->getMargin());
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "ThemeSideRegions");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getOpacity(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ float result = instance->getOpacity();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushnumber(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ float result = instance->getOpacity(param1);
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushnumber(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getPadding(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)&(instance->getPadding());
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "ThemeSideRegions");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getRefCount(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ unsigned int result = instance->getRefCount();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushunsigned(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getSkinColor(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)&(instance->getSkinColor());
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Vector4");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)&(instance->getSkinColor(param1));
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Vector4");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getSkinRegion(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)&(instance->getSkinRegion());
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Rectangle");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)&(instance->getSkinRegion(param1));
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Rectangle");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getState(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ Control::State result = instance->getState();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushstring(state, lua_stringFromEnum_ControlState(result).c_str());
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getStyle(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)instance->getStyle();
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "ThemeStyle");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getText(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ const char* result = instance->getText();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushstring(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getTextAlignment(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ Font::Justify result = instance->getTextAlignment();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushstring(state, lua_stringFromEnum_FontJustify(result).c_str());
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ Font::Justify result = instance->getTextAlignment(param1);
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushstring(state, lua_stringFromEnum_FontJustify(result).c_str());
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getTextColor(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)&(instance->getTextColor());
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Vector4");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ ScriptController::LuaObject* object = (ScriptController::LuaObject*)lua_newuserdata(state, sizeof(ScriptController::LuaObject));
|
|
|
+ object->instance = (void*)&(instance->getTextColor(param1));
|
|
|
+ object->owns = false;
|
|
|
+ luaL_getmetatable(state, "Vector4");
|
|
|
+ lua_setmetatable(state, -2);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getTextRightToLeft(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ bool result = instance->getTextRightToLeft();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushboolean(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ bool result = instance->getTextRightToLeft(param1);
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushboolean(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getWidth(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ float result = instance->getWidth();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushnumber(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getX(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ float result = instance->getX();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushnumber(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getY(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ float result = instance->getY();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushnumber(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_getZIndex(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ int result = instance->getZIndex();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushinteger(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_isChecked(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ bool result = instance->isChecked();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushboolean(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_isEnabled(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ bool result = instance->isEnabled();
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushboolean(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_release(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->release();
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 1).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setAlignment(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ Control::Alignment param1 = (Control::Alignment)lua_enumFromString_ControlAlignment(luaL_checkstring(state, 2));
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setAlignment(param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setAnimationPropertyValue(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 3) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ int param1 = (int)luaL_checkint(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ void* userdata3 = ScriptController::getInstance()->getObjectPointer(3, "AnimationValue");
|
|
|
+ if (!userdata3)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to retrieve a valid object pointer of type 'AnimationValue' for parameter 3.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ AnimationValue* param2 = (AnimationValue*)((ScriptController::LuaObject*)userdata3)->instance;
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setAnimationPropertyValue(param1, param2);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 4:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 3) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 4) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ int param1 = (int)luaL_checkint(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ void* userdata3 = ScriptController::getInstance()->getObjectPointer(3, "AnimationValue");
|
|
|
+ if (!userdata3)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to retrieve a valid object pointer of type 'AnimationValue' for parameter 3.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ AnimationValue* param2 = (AnimationValue*)((ScriptController::LuaObject*)userdata3)->instance;
|
|
|
+
|
|
|
+ // Get parameter 3 off the stack.
|
|
|
+ float param3 = (float)luaL_checknumber(state, 4);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setAnimationPropertyValue(param1, param2, param3);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 3 or 4).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setAutoHeight(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TBOOLEAN)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ bool param1 = (luaL_checkint(state, 2) != 0);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setAutoHeight(param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setAutoWidth(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TBOOLEAN)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ bool param1 = (luaL_checkint(state, 2) != 0);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setAutoWidth(param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setBorder(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 5:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 3) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 4) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 5) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ float param1 = (float)luaL_checknumber(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ float param2 = (float)luaL_checknumber(state, 3);
|
|
|
+
|
|
|
+ // Get parameter 3 off the stack.
|
|
|
+ float param3 = (float)luaL_checknumber(state, 4);
|
|
|
+
|
|
|
+ // Get parameter 4 off the stack.
|
|
|
+ float param4 = (float)luaL_checknumber(state, 5);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setBorder(param1, param2, param3, param4);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 6:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 3) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 4) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 5) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 6) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ float param1 = (float)luaL_checknumber(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ float param2 = (float)luaL_checknumber(state, 3);
|
|
|
+
|
|
|
+ // Get parameter 3 off the stack.
|
|
|
+ float param3 = (float)luaL_checknumber(state, 4);
|
|
|
+
|
|
|
+ // Get parameter 4 off the stack.
|
|
|
+ float param4 = (float)luaL_checknumber(state, 5);
|
|
|
+
|
|
|
+ // Get parameter 5 off the stack.
|
|
|
+ unsigned char param5 = (unsigned char)luaL_checkunsigned(state, 6);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setBorder(param1, param2, param3, param4, param5);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 5 or 6).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setBounds(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ void* userdata2 = ScriptController::getInstance()->getObjectPointer(2, "Rectangle");
|
|
|
+ if (!userdata2)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to retrieve a valid object pointer of type 'Rectangle' for parameter 2.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ Rectangle* param1 = (Rectangle*)((ScriptController::LuaObject*)userdata2)->instance;
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setBounds(*param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setChecked(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TBOOLEAN)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ bool param1 = (luaL_checkint(state, 2) != 0);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setChecked(param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setConsumeTouchEvents(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TBOOLEAN)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ bool param1 = (luaL_checkint(state, 2) != 0);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setConsumeTouchEvents(param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setCursorColor(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 3) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ void* userdata2 = ScriptController::getInstance()->getObjectPointer(2, "Vector4");
|
|
|
+ if (!userdata2)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to retrieve a valid object pointer of type 'Vector4' for parameter 2.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ Vector4* param1 = (Vector4*)((ScriptController::LuaObject*)userdata2)->instance;
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setCursorColor(*param1, param2);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 3).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setCursorRegion(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 3) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ void* userdata2 = ScriptController::getInstance()->getObjectPointer(2, "Rectangle");
|
|
|
+ if (!userdata2)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to retrieve a valid object pointer of type 'Rectangle' for parameter 2.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ Rectangle* param1 = (Rectangle*)((ScriptController::LuaObject*)userdata2)->instance;
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setCursorRegion(*param1, param2);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 3).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setFont(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ void* userdata2 = ScriptController::getInstance()->getObjectPointer(2, "Font");
|
|
|
+ if (!userdata2)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to retrieve a valid object pointer of type 'Font' for parameter 2.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ Font* param1 = (Font*)((ScriptController::LuaObject*)userdata2)->instance;
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setFont(param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 3) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ void* userdata2 = ScriptController::getInstance()->getObjectPointer(2, "Font");
|
|
|
+ if (!userdata2)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to retrieve a valid object pointer of type 'Font' for parameter 2.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ Font* param1 = (Font*)((ScriptController::LuaObject*)userdata2)->instance;
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setFont(param1, param2);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setFontSize(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setFontSize(param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 3) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setFontSize(param1, param2);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setImageColor(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING &&
|
|
|
+ lua_type(state, 3) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ const char* param1 = luaL_checkstring(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ void* userdata3 = ScriptController::getInstance()->getObjectPointer(3, "Vector4");
|
|
|
+ if (!userdata3)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to retrieve a valid object pointer of type 'Vector4' for parameter 3.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ Vector4* param2 = (Vector4*)((ScriptController::LuaObject*)userdata3)->instance;
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setImageColor(param1, *param2);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 4:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING &&
|
|
|
+ lua_type(state, 3) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 4) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ const char* param1 = luaL_checkstring(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ void* userdata3 = ScriptController::getInstance()->getObjectPointer(3, "Vector4");
|
|
|
+ if (!userdata3)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to retrieve a valid object pointer of type 'Vector4' for parameter 3.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ Vector4* param2 = (Vector4*)((ScriptController::LuaObject*)userdata3)->instance;
|
|
|
+
|
|
|
+ // Get parameter 3 off the stack.
|
|
|
+ unsigned char param3 = (unsigned char)luaL_checkunsigned(state, 4);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setImageColor(param1, *param2, param3);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 3 or 4).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setImageRegion(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING &&
|
|
|
+ lua_type(state, 3) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ const char* param1 = luaL_checkstring(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ void* userdata3 = ScriptController::getInstance()->getObjectPointer(3, "Rectangle");
|
|
|
+ if (!userdata3)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to retrieve a valid object pointer of type 'Rectangle' for parameter 3.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ Rectangle* param2 = (Rectangle*)((ScriptController::LuaObject*)userdata3)->instance;
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setImageRegion(param1, *param2);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 4:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING &&
|
|
|
+ lua_type(state, 3) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 4) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ const char* param1 = luaL_checkstring(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ void* userdata3 = ScriptController::getInstance()->getObjectPointer(3, "Rectangle");
|
|
|
+ if (!userdata3)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to retrieve a valid object pointer of type 'Rectangle' for parameter 3.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ Rectangle* param2 = (Rectangle*)((ScriptController::LuaObject*)userdata3)->instance;
|
|
|
+
|
|
|
+ // Get parameter 3 off the stack.
|
|
|
+ unsigned char param3 = (unsigned char)luaL_checkunsigned(state, 4);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setImageRegion(param1, *param2, param3);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 3 or 4).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setImageSize(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 3) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ float param1 = (float)luaL_checknumber(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ float param2 = (float)luaL_checknumber(state, 3);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setImageSize(param1, param2);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 3).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setMargin(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 5:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 3) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 4) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 5) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ float param1 = (float)luaL_checknumber(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ float param2 = (float)luaL_checknumber(state, 3);
|
|
|
+
|
|
|
+ // Get parameter 3 off the stack.
|
|
|
+ float param3 = (float)luaL_checknumber(state, 4);
|
|
|
+
|
|
|
+ // Get parameter 4 off the stack.
|
|
|
+ float param4 = (float)luaL_checknumber(state, 5);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setMargin(param1, param2, param3, param4);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 5).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setOpacity(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ float param1 = (float)luaL_checknumber(state, 2);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setOpacity(param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 3) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ float param1 = (float)luaL_checknumber(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setOpacity(param1, param2);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setPadding(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 5:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 3) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 4) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 5) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ float param1 = (float)luaL_checknumber(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ float param2 = (float)luaL_checknumber(state, 3);
|
|
|
+
|
|
|
+ // Get parameter 3 off the stack.
|
|
|
+ float param3 = (float)luaL_checknumber(state, 4);
|
|
|
+
|
|
|
+ // Get parameter 4 off the stack.
|
|
|
+ float param4 = (float)luaL_checknumber(state, 5);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setPadding(param1, param2, param3, param4);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 5).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setPosition(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 3) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ float param1 = (float)luaL_checknumber(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ float param2 = (float)luaL_checknumber(state, 3);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setPosition(param1, param2);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 3).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setSize(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TNUMBER &&
|
|
|
+ lua_type(state, 3) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ float param1 = (float)luaL_checknumber(state, 2);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ float param2 = (float)luaL_checknumber(state, 3);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setSize(param1, param2);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 3).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setSkinColor(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ void* userdata2 = ScriptController::getInstance()->getObjectPointer(2, "Vector4");
|
|
|
+ if (!userdata2)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to retrieve a valid object pointer of type 'Vector4' for parameter 2.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ Vector4* param1 = (Vector4*)((ScriptController::LuaObject*)userdata2)->instance;
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setSkinColor(*param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 3) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ void* userdata2 = ScriptController::getInstance()->getObjectPointer(2, "Vector4");
|
|
|
+ if (!userdata2)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to retrieve a valid object pointer of type 'Vector4' for parameter 2.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ Vector4* param1 = (Vector4*)((ScriptController::LuaObject*)userdata2)->instance;
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setSkinColor(*param1, param2);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setSkinRegion(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ void* userdata2 = ScriptController::getInstance()->getObjectPointer(2, "Rectangle");
|
|
|
+ if (!userdata2)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to retrieve a valid object pointer of type 'Rectangle' for parameter 2.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ Rectangle* param1 = (Rectangle*)((ScriptController::LuaObject*)userdata2)->instance;
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setSkinRegion(*param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 3) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ void* userdata2 = ScriptController::getInstance()->getObjectPointer(2, "Rectangle");
|
|
|
+ if (!userdata2)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to retrieve a valid object pointer of type 'Rectangle' for parameter 2.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ Rectangle* param1 = (Rectangle*)((ScriptController::LuaObject*)userdata2)->instance;
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setSkinRegion(*param1, param2);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setState(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setState(param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setStyle(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ void* userdata2 = ScriptController::getInstance()->getObjectPointer(2, "ThemeStyle");
|
|
|
+ if (!userdata2)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to retrieve a valid object pointer of type 'Theme::Style' for parameter 2.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ Theme::Style* param1 = (Theme::Style*)((ScriptController::LuaObject*)userdata2)->instance;
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setStyle(param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setText(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ const char* param1 = luaL_checkstring(state, 2);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setText(param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setTextAlignment(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ Font::Justify param1 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 2));
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setTextAlignment(param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TSTRING &&
|
|
|
+ lua_type(state, 3) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ Font::Justify param1 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 2));
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setTextAlignment(param1, param2);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setTextColor(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TUSERDATA)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ void* userdata2 = ScriptController::getInstance()->getObjectPointer(2, "Vector4");
|
|
|
+ if (!userdata2)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to retrieve a valid object pointer of type 'Vector4' for parameter 2.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ Vector4* param1 = (Vector4*)((ScriptController::LuaObject*)userdata2)->instance;
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setTextColor(*param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 3) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ void* userdata2 = ScriptController::getInstance()->getObjectPointer(2, "Vector4");
|
|
|
+ if (!userdata2)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to retrieve a valid object pointer of type 'Vector4' for parameter 2.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ Vector4* param1 = (Vector4*)((ScriptController::LuaObject*)userdata2)->instance;
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setTextColor(*param1, param2);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setTextRightToLeft(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TBOOLEAN)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ bool param1 = (luaL_checkint(state, 2) != 0);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setTextRightToLeft(param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case 3:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TBOOLEAN &&
|
|
|
+ lua_type(state, 3) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ bool param1 = (luaL_checkint(state, 2) != 0);
|
|
|
+
|
|
|
+ // Get parameter 2 off the stack.
|
|
|
+ unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setTextRightToLeft(param1, param2);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_setZIndex(lua_State* state)
|
|
|
+{
|
|
|
+ // Get the number of parameters.
|
|
|
+ int paramCount = lua_gettop(state);
|
|
|
+
|
|
|
+ // Attempt to match the parameters to a valid binding.
|
|
|
+ switch (paramCount)
|
|
|
+ {
|
|
|
+ case 2:
|
|
|
+ {
|
|
|
+ if (lua_type(state, 1) == LUA_TUSERDATA &&
|
|
|
+ lua_type(state, 2) == LUA_TNUMBER)
|
|
|
+ {
|
|
|
+ // Get parameter 1 off the stack.
|
|
|
+ int param1 = (int)luaL_checkint(state, 2);
|
|
|
+
|
|
|
+ CheckBox* instance = getInstance(state);
|
|
|
+ instance->setZIndex(param1);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Failed to match the given parameters to a valid function signature.");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 2).");
|
|
|
+ lua_error(state);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_static_ANIMATE_OPACITY(lua_State* state)
|
|
|
+{
|
|
|
+ // Validate the number of parameters.
|
|
|
+ if (lua_gettop(state) > 0)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 0).");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+
|
|
|
+ int result = CheckBox::ANIMATE_OPACITY;
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushinteger(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_static_ANIMATE_POSITION(lua_State* state)
|
|
|
+{
|
|
|
+ // Validate the number of parameters.
|
|
|
+ if (lua_gettop(state) > 0)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 0).");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+
|
|
|
+ int result = CheckBox::ANIMATE_POSITION;
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushinteger(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_static_ANIMATE_POSITION_X(lua_State* state)
|
|
|
+{
|
|
|
+ // Validate the number of parameters.
|
|
|
+ if (lua_gettop(state) > 0)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 0).");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+
|
|
|
+ int result = CheckBox::ANIMATE_POSITION_X;
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushinteger(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_static_ANIMATE_POSITION_Y(lua_State* state)
|
|
|
+{
|
|
|
+ // Validate the number of parameters.
|
|
|
+ if (lua_gettop(state) > 0)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 0).");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+
|
|
|
+ int result = CheckBox::ANIMATE_POSITION_Y;
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushinteger(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_static_ANIMATE_SIZE(lua_State* state)
|
|
|
+{
|
|
|
+ // Validate the number of parameters.
|
|
|
+ if (lua_gettop(state) > 0)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 0).");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+
|
|
|
+ int result = CheckBox::ANIMATE_SIZE;
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushinteger(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_static_ANIMATE_SIZE_HEIGHT(lua_State* state)
|
|
|
+{
|
|
|
+ // Validate the number of parameters.
|
|
|
+ if (lua_gettop(state) > 0)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 0).");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+
|
|
|
+ int result = CheckBox::ANIMATE_SIZE_HEIGHT;
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushinteger(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+int lua_CheckBox_static_ANIMATE_SIZE_WIDTH(lua_State* state)
|
|
|
+{
|
|
|
+ // Validate the number of parameters.
|
|
|
+ if (lua_gettop(state) > 0)
|
|
|
+ {
|
|
|
+ lua_pushstring(state, "Invalid number of parameters (expected 0).");
|
|
|
+ lua_error(state);
|
|
|
+ }
|
|
|
+
|
|
|
+ int result = CheckBox::ANIMATE_SIZE_WIDTH;
|
|
|
+
|
|
|
+ // Push the return value onto the stack.
|
|
|
+ lua_pushinteger(state, result);
|
|
|
+
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+}
|