lua_Button.cpp 144 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404
  1. #include "Base.h"
  2. #include "ScriptController.h"
  3. #include "lua_Button.h"
  4. #include "Animation.h"
  5. #include "AnimationTarget.h"
  6. #include "Base.h"
  7. #include "Button.h"
  8. #include "Control.h"
  9. #include "Game.h"
  10. #include "Label.h"
  11. #include "Node.h"
  12. #include "Ref.h"
  13. #include "ScriptController.h"
  14. #include "ScriptTarget.h"
  15. #include "lua_ControlAlignment.h"
  16. #include "lua_ControlListenerEventType.h"
  17. #include "lua_ControlState.h"
  18. #include "lua_CurveInterpolationType.h"
  19. #include "lua_FontJustify.h"
  20. namespace gameplay
  21. {
  22. void luaRegister_Button()
  23. {
  24. const luaL_Reg lua_members[] =
  25. {
  26. {"addListener", lua_Button_addListener},
  27. {"addRef", lua_Button_addRef},
  28. {"addScriptCallback", lua_Button_addScriptCallback},
  29. {"createAnimation", lua_Button_createAnimation},
  30. {"createAnimationFromBy", lua_Button_createAnimationFromBy},
  31. {"createAnimationFromTo", lua_Button_createAnimationFromTo},
  32. {"destroyAnimation", lua_Button_destroyAnimation},
  33. {"disable", lua_Button_disable},
  34. {"enable", lua_Button_enable},
  35. {"getAlignment", lua_Button_getAlignment},
  36. {"getAnimation", lua_Button_getAnimation},
  37. {"getAnimationPropertyComponentCount", lua_Button_getAnimationPropertyComponentCount},
  38. {"getAnimationPropertyValue", lua_Button_getAnimationPropertyValue},
  39. {"getAutoHeight", lua_Button_getAutoHeight},
  40. {"getAutoWidth", lua_Button_getAutoWidth},
  41. {"getBorder", lua_Button_getBorder},
  42. {"getBounds", lua_Button_getBounds},
  43. {"getClip", lua_Button_getClip},
  44. {"getClipBounds", lua_Button_getClipBounds},
  45. {"getConsumeInputEvents", lua_Button_getConsumeInputEvents},
  46. {"getCursorColor", lua_Button_getCursorColor},
  47. {"getCursorRegion", lua_Button_getCursorRegion},
  48. {"getCursorUVs", lua_Button_getCursorUVs},
  49. {"getFocusIndex", lua_Button_getFocusIndex},
  50. {"getFont", lua_Button_getFont},
  51. {"getFontSize", lua_Button_getFontSize},
  52. {"getHeight", lua_Button_getHeight},
  53. {"getId", lua_Button_getId},
  54. {"getImageColor", lua_Button_getImageColor},
  55. {"getImageRegion", lua_Button_getImageRegion},
  56. {"getImageUVs", lua_Button_getImageUVs},
  57. {"getMargin", lua_Button_getMargin},
  58. {"getOpacity", lua_Button_getOpacity},
  59. {"getPadding", lua_Button_getPadding},
  60. {"getRefCount", lua_Button_getRefCount},
  61. {"getSkinColor", lua_Button_getSkinColor},
  62. {"getSkinRegion", lua_Button_getSkinRegion},
  63. {"getState", lua_Button_getState},
  64. {"getStyle", lua_Button_getStyle},
  65. {"getText", lua_Button_getText},
  66. {"getTextAlignment", lua_Button_getTextAlignment},
  67. {"getTextColor", lua_Button_getTextColor},
  68. {"getTextRightToLeft", lua_Button_getTextRightToLeft},
  69. {"getWidth", lua_Button_getWidth},
  70. {"getX", lua_Button_getX},
  71. {"getY", lua_Button_getY},
  72. {"getZIndex", lua_Button_getZIndex},
  73. {"isContainer", lua_Button_isContainer},
  74. {"isEnabled", lua_Button_isEnabled},
  75. {"release", lua_Button_release},
  76. {"removeScriptCallback", lua_Button_removeScriptCallback},
  77. {"setAlignment", lua_Button_setAlignment},
  78. {"setAnimationPropertyValue", lua_Button_setAnimationPropertyValue},
  79. {"setAutoHeight", lua_Button_setAutoHeight},
  80. {"setAutoWidth", lua_Button_setAutoWidth},
  81. {"setBorder", lua_Button_setBorder},
  82. {"setBounds", lua_Button_setBounds},
  83. {"setConsumeInputEvents", lua_Button_setConsumeInputEvents},
  84. {"setCursorColor", lua_Button_setCursorColor},
  85. {"setCursorRegion", lua_Button_setCursorRegion},
  86. {"setFocusIndex", lua_Button_setFocusIndex},
  87. {"setFont", lua_Button_setFont},
  88. {"setFontSize", lua_Button_setFontSize},
  89. {"setImageColor", lua_Button_setImageColor},
  90. {"setImageRegion", lua_Button_setImageRegion},
  91. {"setMargin", lua_Button_setMargin},
  92. {"setOpacity", lua_Button_setOpacity},
  93. {"setPadding", lua_Button_setPadding},
  94. {"setPosition", lua_Button_setPosition},
  95. {"setSize", lua_Button_setSize},
  96. {"setSkinColor", lua_Button_setSkinColor},
  97. {"setSkinRegion", lua_Button_setSkinRegion},
  98. {"setState", lua_Button_setState},
  99. {"setStyle", lua_Button_setStyle},
  100. {"setText", lua_Button_setText},
  101. {"setTextAlignment", lua_Button_setTextAlignment},
  102. {"setTextColor", lua_Button_setTextColor},
  103. {"setTextRightToLeft", lua_Button_setTextRightToLeft},
  104. {"setZIndex", lua_Button_setZIndex},
  105. {NULL, NULL}
  106. };
  107. const luaL_Reg lua_statics[] =
  108. {
  109. {"ANIMATE_OPACITY", lua_Button_static_ANIMATE_OPACITY},
  110. {"ANIMATE_POSITION", lua_Button_static_ANIMATE_POSITION},
  111. {"ANIMATE_POSITION_X", lua_Button_static_ANIMATE_POSITION_X},
  112. {"ANIMATE_POSITION_Y", lua_Button_static_ANIMATE_POSITION_Y},
  113. {"ANIMATE_SIZE", lua_Button_static_ANIMATE_SIZE},
  114. {"ANIMATE_SIZE_HEIGHT", lua_Button_static_ANIMATE_SIZE_HEIGHT},
  115. {"ANIMATE_SIZE_WIDTH", lua_Button_static_ANIMATE_SIZE_WIDTH},
  116. {"create", lua_Button_static_create},
  117. {NULL, NULL}
  118. };
  119. std::vector<std::string> scopePath;
  120. ScriptUtil::registerClass("Button", lua_members, NULL, lua_Button__gc, lua_statics, scopePath);
  121. }
  122. static Button* getInstance(lua_State* state)
  123. {
  124. void* userdata = luaL_checkudata(state, 1, "Button");
  125. luaL_argcheck(state, userdata != NULL, 1, "'Button' expected.");
  126. return (Button*)((ScriptUtil::LuaObject*)userdata)->instance;
  127. }
  128. int lua_Button__gc(lua_State* state)
  129. {
  130. // Get the number of parameters.
  131. int paramCount = lua_gettop(state);
  132. // Attempt to match the parameters to a valid binding.
  133. switch (paramCount)
  134. {
  135. case 1:
  136. {
  137. if ((lua_type(state, 1) == LUA_TUSERDATA))
  138. {
  139. void* userdata = luaL_checkudata(state, 1, "Button");
  140. luaL_argcheck(state, userdata != NULL, 1, "'Button' expected.");
  141. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)userdata;
  142. if (object->owns)
  143. {
  144. Button* instance = (Button*)object->instance;
  145. SAFE_RELEASE(instance);
  146. }
  147. return 0;
  148. }
  149. else
  150. {
  151. lua_pushstring(state, "lua_Button__gc - Failed to match the given parameters to a valid function signature.");
  152. lua_error(state);
  153. }
  154. break;
  155. }
  156. default:
  157. {
  158. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  159. lua_error(state);
  160. break;
  161. }
  162. }
  163. return 0;
  164. }
  165. int lua_Button_addListener(lua_State* state)
  166. {
  167. // Get the number of parameters.
  168. int paramCount = lua_gettop(state);
  169. // Attempt to match the parameters to a valid binding.
  170. switch (paramCount)
  171. {
  172. case 3:
  173. {
  174. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  175. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
  176. lua_type(state, 3) == LUA_TNUMBER)
  177. {
  178. // Get parameter 1 off the stack.
  179. ScriptUtil::LuaArray<Control::Listener> param1 = ScriptUtil::getObjectPointer<Control::Listener>(2, "ControlListener", false);
  180. // Get parameter 2 off the stack.
  181. int param2 = (int)luaL_checkint(state, 3);
  182. Button* instance = getInstance(state);
  183. instance->addListener(param1, param2);
  184. return 0;
  185. }
  186. else
  187. {
  188. lua_pushstring(state, "lua_Button_addListener - Failed to match the given parameters to a valid function signature.");
  189. lua_error(state);
  190. }
  191. break;
  192. }
  193. default:
  194. {
  195. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  196. lua_error(state);
  197. break;
  198. }
  199. }
  200. return 0;
  201. }
  202. int lua_Button_addRef(lua_State* state)
  203. {
  204. // Get the number of parameters.
  205. int paramCount = lua_gettop(state);
  206. // Attempt to match the parameters to a valid binding.
  207. switch (paramCount)
  208. {
  209. case 1:
  210. {
  211. if ((lua_type(state, 1) == LUA_TUSERDATA))
  212. {
  213. Button* instance = getInstance(state);
  214. instance->addRef();
  215. return 0;
  216. }
  217. else
  218. {
  219. lua_pushstring(state, "lua_Button_addRef - Failed to match the given parameters to a valid function signature.");
  220. lua_error(state);
  221. }
  222. break;
  223. }
  224. default:
  225. {
  226. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  227. lua_error(state);
  228. break;
  229. }
  230. }
  231. return 0;
  232. }
  233. int lua_Button_addScriptCallback(lua_State* state)
  234. {
  235. // Get the number of parameters.
  236. int paramCount = lua_gettop(state);
  237. // Attempt to match the parameters to a valid binding.
  238. switch (paramCount)
  239. {
  240. case 3:
  241. {
  242. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  243. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  244. (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
  245. {
  246. // Get parameter 1 off the stack.
  247. std::string param1 = ScriptUtil::getString(2, true);
  248. // Get parameter 2 off the stack.
  249. std::string param2 = ScriptUtil::getString(3, true);
  250. Button* instance = getInstance(state);
  251. instance->addScriptCallback(param1, param2);
  252. return 0;
  253. }
  254. else
  255. {
  256. lua_pushstring(state, "lua_Button_addScriptCallback - Failed to match the given parameters to a valid function signature.");
  257. lua_error(state);
  258. }
  259. break;
  260. }
  261. default:
  262. {
  263. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  264. lua_error(state);
  265. break;
  266. }
  267. }
  268. return 0;
  269. }
  270. int lua_Button_createAnimation(lua_State* state)
  271. {
  272. // Get the number of parameters.
  273. int paramCount = lua_gettop(state);
  274. // Attempt to match the parameters to a valid binding.
  275. switch (paramCount)
  276. {
  277. case 3:
  278. {
  279. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  280. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  281. (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
  282. {
  283. // Get parameter 1 off the stack.
  284. ScriptUtil::LuaArray<const char> param1 = ScriptUtil::getString(2, false);
  285. // Get parameter 2 off the stack.
  286. ScriptUtil::LuaArray<const char> param2 = ScriptUtil::getString(3, false);
  287. Button* instance = getInstance(state);
  288. void* returnPtr = (void*)instance->createAnimation(param1, param2);
  289. if (returnPtr)
  290. {
  291. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  292. object->instance = returnPtr;
  293. object->owns = false;
  294. luaL_getmetatable(state, "Animation");
  295. lua_setmetatable(state, -2);
  296. }
  297. else
  298. {
  299. lua_pushnil(state);
  300. }
  301. return 1;
  302. }
  303. else if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  304. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  305. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  306. {
  307. // Get parameter 1 off the stack.
  308. ScriptUtil::LuaArray<const char> param1 = ScriptUtil::getString(2, false);
  309. // Get parameter 2 off the stack.
  310. ScriptUtil::LuaArray<Properties> param2 = ScriptUtil::getObjectPointer<Properties>(3, "Properties", false);
  311. Button* instance = getInstance(state);
  312. void* returnPtr = (void*)instance->createAnimation(param1, param2);
  313. if (returnPtr)
  314. {
  315. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  316. object->instance = returnPtr;
  317. object->owns = false;
  318. luaL_getmetatable(state, "Animation");
  319. lua_setmetatable(state, -2);
  320. }
  321. else
  322. {
  323. lua_pushnil(state);
  324. }
  325. return 1;
  326. }
  327. else
  328. {
  329. lua_pushstring(state, "lua_Button_createAnimation - Failed to match the given parameters to a valid function signature.");
  330. lua_error(state);
  331. }
  332. break;
  333. }
  334. case 7:
  335. {
  336. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  337. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  338. lua_type(state, 3) == LUA_TNUMBER &&
  339. lua_type(state, 4) == LUA_TNUMBER &&
  340. (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) &&
  341. (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) &&
  342. (lua_type(state, 7) == LUA_TSTRING || lua_type(state, 7) == LUA_TNIL))
  343. {
  344. // Get parameter 1 off the stack.
  345. ScriptUtil::LuaArray<const char> param1 = ScriptUtil::getString(2, false);
  346. // Get parameter 2 off the stack.
  347. int param2 = (int)luaL_checkint(state, 3);
  348. // Get parameter 3 off the stack.
  349. unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 4);
  350. // Get parameter 4 off the stack.
  351. ScriptUtil::LuaArray<unsigned long> param4 = ScriptUtil::getUnsignedLongPointer(5);
  352. // Get parameter 5 off the stack.
  353. ScriptUtil::LuaArray<float> param5 = ScriptUtil::getFloatPointer(6);
  354. // Get parameter 6 off the stack.
  355. Curve::InterpolationType param6 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 7));
  356. Button* instance = getInstance(state);
  357. void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6);
  358. if (returnPtr)
  359. {
  360. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  361. object->instance = returnPtr;
  362. object->owns = false;
  363. luaL_getmetatable(state, "Animation");
  364. lua_setmetatable(state, -2);
  365. }
  366. else
  367. {
  368. lua_pushnil(state);
  369. }
  370. return 1;
  371. }
  372. else
  373. {
  374. lua_pushstring(state, "lua_Button_createAnimation - Failed to match the given parameters to a valid function signature.");
  375. lua_error(state);
  376. }
  377. break;
  378. }
  379. case 9:
  380. {
  381. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  382. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  383. lua_type(state, 3) == LUA_TNUMBER &&
  384. lua_type(state, 4) == LUA_TNUMBER &&
  385. (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) &&
  386. (lua_type(state, 6) == LUA_TTABLE || lua_type(state, 6) == LUA_TLIGHTUSERDATA) &&
  387. (lua_type(state, 7) == LUA_TTABLE || lua_type(state, 7) == LUA_TLIGHTUSERDATA) &&
  388. (lua_type(state, 8) == LUA_TTABLE || lua_type(state, 8) == LUA_TLIGHTUSERDATA) &&
  389. (lua_type(state, 9) == LUA_TSTRING || lua_type(state, 9) == LUA_TNIL))
  390. {
  391. // Get parameter 1 off the stack.
  392. ScriptUtil::LuaArray<const char> param1 = ScriptUtil::getString(2, false);
  393. // Get parameter 2 off the stack.
  394. int param2 = (int)luaL_checkint(state, 3);
  395. // Get parameter 3 off the stack.
  396. unsigned int param3 = (unsigned int)luaL_checkunsigned(state, 4);
  397. // Get parameter 4 off the stack.
  398. ScriptUtil::LuaArray<unsigned long> param4 = ScriptUtil::getUnsignedLongPointer(5);
  399. // Get parameter 5 off the stack.
  400. ScriptUtil::LuaArray<float> param5 = ScriptUtil::getFloatPointer(6);
  401. // Get parameter 6 off the stack.
  402. ScriptUtil::LuaArray<float> param6 = ScriptUtil::getFloatPointer(7);
  403. // Get parameter 7 off the stack.
  404. ScriptUtil::LuaArray<float> param7 = ScriptUtil::getFloatPointer(8);
  405. // Get parameter 8 off the stack.
  406. Curve::InterpolationType param8 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 9));
  407. Button* instance = getInstance(state);
  408. void* returnPtr = (void*)instance->createAnimation(param1, param2, param3, param4, param5, param6, param7, param8);
  409. if (returnPtr)
  410. {
  411. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  412. object->instance = returnPtr;
  413. object->owns = false;
  414. luaL_getmetatable(state, "Animation");
  415. lua_setmetatable(state, -2);
  416. }
  417. else
  418. {
  419. lua_pushnil(state);
  420. }
  421. return 1;
  422. }
  423. else
  424. {
  425. lua_pushstring(state, "lua_Button_createAnimation - Failed to match the given parameters to a valid function signature.");
  426. lua_error(state);
  427. }
  428. break;
  429. }
  430. default:
  431. {
  432. lua_pushstring(state, "Invalid number of parameters (expected 3, 7 or 9).");
  433. lua_error(state);
  434. break;
  435. }
  436. }
  437. return 0;
  438. }
  439. int lua_Button_createAnimationFromBy(lua_State* state)
  440. {
  441. // Get the number of parameters.
  442. int paramCount = lua_gettop(state);
  443. // Attempt to match the parameters to a valid binding.
  444. switch (paramCount)
  445. {
  446. case 7:
  447. {
  448. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  449. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  450. lua_type(state, 3) == LUA_TNUMBER &&
  451. (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) &&
  452. (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) &&
  453. (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) &&
  454. lua_type(state, 7) == LUA_TNUMBER)
  455. {
  456. // Get parameter 1 off the stack.
  457. ScriptUtil::LuaArray<const char> param1 = ScriptUtil::getString(2, false);
  458. // Get parameter 2 off the stack.
  459. int param2 = (int)luaL_checkint(state, 3);
  460. // Get parameter 3 off the stack.
  461. ScriptUtil::LuaArray<float> param3 = ScriptUtil::getFloatPointer(4);
  462. // Get parameter 4 off the stack.
  463. ScriptUtil::LuaArray<float> param4 = ScriptUtil::getFloatPointer(5);
  464. // Get parameter 5 off the stack.
  465. Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6));
  466. // Get parameter 6 off the stack.
  467. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7);
  468. Button* instance = getInstance(state);
  469. void* returnPtr = (void*)instance->createAnimationFromBy(param1, param2, param3, param4, param5, param6);
  470. if (returnPtr)
  471. {
  472. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  473. object->instance = returnPtr;
  474. object->owns = false;
  475. luaL_getmetatable(state, "Animation");
  476. lua_setmetatable(state, -2);
  477. }
  478. else
  479. {
  480. lua_pushnil(state);
  481. }
  482. return 1;
  483. }
  484. else
  485. {
  486. lua_pushstring(state, "lua_Button_createAnimationFromBy - Failed to match the given parameters to a valid function signature.");
  487. lua_error(state);
  488. }
  489. break;
  490. }
  491. default:
  492. {
  493. lua_pushstring(state, "Invalid number of parameters (expected 7).");
  494. lua_error(state);
  495. break;
  496. }
  497. }
  498. return 0;
  499. }
  500. int lua_Button_createAnimationFromTo(lua_State* state)
  501. {
  502. // Get the number of parameters.
  503. int paramCount = lua_gettop(state);
  504. // Attempt to match the parameters to a valid binding.
  505. switch (paramCount)
  506. {
  507. case 7:
  508. {
  509. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  510. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  511. lua_type(state, 3) == LUA_TNUMBER &&
  512. (lua_type(state, 4) == LUA_TTABLE || lua_type(state, 4) == LUA_TLIGHTUSERDATA) &&
  513. (lua_type(state, 5) == LUA_TTABLE || lua_type(state, 5) == LUA_TLIGHTUSERDATA) &&
  514. (lua_type(state, 6) == LUA_TSTRING || lua_type(state, 6) == LUA_TNIL) &&
  515. lua_type(state, 7) == LUA_TNUMBER)
  516. {
  517. // Get parameter 1 off the stack.
  518. ScriptUtil::LuaArray<const char> param1 = ScriptUtil::getString(2, false);
  519. // Get parameter 2 off the stack.
  520. int param2 = (int)luaL_checkint(state, 3);
  521. // Get parameter 3 off the stack.
  522. ScriptUtil::LuaArray<float> param3 = ScriptUtil::getFloatPointer(4);
  523. // Get parameter 4 off the stack.
  524. ScriptUtil::LuaArray<float> param4 = ScriptUtil::getFloatPointer(5);
  525. // Get parameter 5 off the stack.
  526. Curve::InterpolationType param5 = (Curve::InterpolationType)lua_enumFromString_CurveInterpolationType(luaL_checkstring(state, 6));
  527. // Get parameter 6 off the stack.
  528. unsigned long param6 = (unsigned long)luaL_checkunsigned(state, 7);
  529. Button* instance = getInstance(state);
  530. void* returnPtr = (void*)instance->createAnimationFromTo(param1, param2, param3, param4, param5, param6);
  531. if (returnPtr)
  532. {
  533. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  534. object->instance = returnPtr;
  535. object->owns = false;
  536. luaL_getmetatable(state, "Animation");
  537. lua_setmetatable(state, -2);
  538. }
  539. else
  540. {
  541. lua_pushnil(state);
  542. }
  543. return 1;
  544. }
  545. else
  546. {
  547. lua_pushstring(state, "lua_Button_createAnimationFromTo - Failed to match the given parameters to a valid function signature.");
  548. lua_error(state);
  549. }
  550. break;
  551. }
  552. default:
  553. {
  554. lua_pushstring(state, "Invalid number of parameters (expected 7).");
  555. lua_error(state);
  556. break;
  557. }
  558. }
  559. return 0;
  560. }
  561. int lua_Button_destroyAnimation(lua_State* state)
  562. {
  563. // Get the number of parameters.
  564. int paramCount = lua_gettop(state);
  565. // Attempt to match the parameters to a valid binding.
  566. switch (paramCount)
  567. {
  568. case 1:
  569. {
  570. if ((lua_type(state, 1) == LUA_TUSERDATA))
  571. {
  572. Button* instance = getInstance(state);
  573. instance->destroyAnimation();
  574. return 0;
  575. }
  576. else
  577. {
  578. lua_pushstring(state, "lua_Button_destroyAnimation - Failed to match the given parameters to a valid function signature.");
  579. lua_error(state);
  580. }
  581. break;
  582. }
  583. case 2:
  584. {
  585. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  586. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  587. {
  588. // Get parameter 1 off the stack.
  589. ScriptUtil::LuaArray<const char> param1 = ScriptUtil::getString(2, false);
  590. Button* instance = getInstance(state);
  591. instance->destroyAnimation(param1);
  592. return 0;
  593. }
  594. else
  595. {
  596. lua_pushstring(state, "lua_Button_destroyAnimation - Failed to match the given parameters to a valid function signature.");
  597. lua_error(state);
  598. }
  599. break;
  600. }
  601. default:
  602. {
  603. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  604. lua_error(state);
  605. break;
  606. }
  607. }
  608. return 0;
  609. }
  610. int lua_Button_disable(lua_State* state)
  611. {
  612. // Get the number of parameters.
  613. int paramCount = lua_gettop(state);
  614. // Attempt to match the parameters to a valid binding.
  615. switch (paramCount)
  616. {
  617. case 1:
  618. {
  619. if ((lua_type(state, 1) == LUA_TUSERDATA))
  620. {
  621. Button* instance = getInstance(state);
  622. instance->disable();
  623. return 0;
  624. }
  625. else
  626. {
  627. lua_pushstring(state, "lua_Button_disable - Failed to match the given parameters to a valid function signature.");
  628. lua_error(state);
  629. }
  630. break;
  631. }
  632. default:
  633. {
  634. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  635. lua_error(state);
  636. break;
  637. }
  638. }
  639. return 0;
  640. }
  641. int lua_Button_enable(lua_State* state)
  642. {
  643. // Get the number of parameters.
  644. int paramCount = lua_gettop(state);
  645. // Attempt to match the parameters to a valid binding.
  646. switch (paramCount)
  647. {
  648. case 1:
  649. {
  650. if ((lua_type(state, 1) == LUA_TUSERDATA))
  651. {
  652. Button* instance = getInstance(state);
  653. instance->enable();
  654. return 0;
  655. }
  656. else
  657. {
  658. lua_pushstring(state, "lua_Button_enable - Failed to match the given parameters to a valid function signature.");
  659. lua_error(state);
  660. }
  661. break;
  662. }
  663. default:
  664. {
  665. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  666. lua_error(state);
  667. break;
  668. }
  669. }
  670. return 0;
  671. }
  672. int lua_Button_getAlignment(lua_State* state)
  673. {
  674. // Get the number of parameters.
  675. int paramCount = lua_gettop(state);
  676. // Attempt to match the parameters to a valid binding.
  677. switch (paramCount)
  678. {
  679. case 1:
  680. {
  681. if ((lua_type(state, 1) == LUA_TUSERDATA))
  682. {
  683. Button* instance = getInstance(state);
  684. Control::Alignment result = instance->getAlignment();
  685. // Push the return value onto the stack.
  686. lua_pushstring(state, lua_stringFromEnum_ControlAlignment(result));
  687. return 1;
  688. }
  689. else
  690. {
  691. lua_pushstring(state, "lua_Button_getAlignment - Failed to match the given parameters to a valid function signature.");
  692. lua_error(state);
  693. }
  694. break;
  695. }
  696. default:
  697. {
  698. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  699. lua_error(state);
  700. break;
  701. }
  702. }
  703. return 0;
  704. }
  705. int lua_Button_getAnimation(lua_State* state)
  706. {
  707. // Get the number of parameters.
  708. int paramCount = lua_gettop(state);
  709. // Attempt to match the parameters to a valid binding.
  710. switch (paramCount)
  711. {
  712. case 1:
  713. {
  714. if ((lua_type(state, 1) == LUA_TUSERDATA))
  715. {
  716. Button* instance = getInstance(state);
  717. void* returnPtr = (void*)instance->getAnimation();
  718. if (returnPtr)
  719. {
  720. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  721. object->instance = returnPtr;
  722. object->owns = false;
  723. luaL_getmetatable(state, "Animation");
  724. lua_setmetatable(state, -2);
  725. }
  726. else
  727. {
  728. lua_pushnil(state);
  729. }
  730. return 1;
  731. }
  732. else
  733. {
  734. lua_pushstring(state, "lua_Button_getAnimation - Failed to match the given parameters to a valid function signature.");
  735. lua_error(state);
  736. }
  737. break;
  738. }
  739. case 2:
  740. {
  741. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  742. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  743. {
  744. // Get parameter 1 off the stack.
  745. ScriptUtil::LuaArray<const char> param1 = ScriptUtil::getString(2, false);
  746. Button* instance = getInstance(state);
  747. void* returnPtr = (void*)instance->getAnimation(param1);
  748. if (returnPtr)
  749. {
  750. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  751. object->instance = returnPtr;
  752. object->owns = false;
  753. luaL_getmetatable(state, "Animation");
  754. lua_setmetatable(state, -2);
  755. }
  756. else
  757. {
  758. lua_pushnil(state);
  759. }
  760. return 1;
  761. }
  762. else
  763. {
  764. lua_pushstring(state, "lua_Button_getAnimation - Failed to match the given parameters to a valid function signature.");
  765. lua_error(state);
  766. }
  767. break;
  768. }
  769. default:
  770. {
  771. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  772. lua_error(state);
  773. break;
  774. }
  775. }
  776. return 0;
  777. }
  778. int lua_Button_getAnimationPropertyComponentCount(lua_State* state)
  779. {
  780. // Get the number of parameters.
  781. int paramCount = lua_gettop(state);
  782. // Attempt to match the parameters to a valid binding.
  783. switch (paramCount)
  784. {
  785. case 2:
  786. {
  787. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  788. lua_type(state, 2) == LUA_TNUMBER)
  789. {
  790. // Get parameter 1 off the stack.
  791. int param1 = (int)luaL_checkint(state, 2);
  792. Button* instance = getInstance(state);
  793. unsigned int result = instance->getAnimationPropertyComponentCount(param1);
  794. // Push the return value onto the stack.
  795. lua_pushunsigned(state, result);
  796. return 1;
  797. }
  798. else
  799. {
  800. lua_pushstring(state, "lua_Button_getAnimationPropertyComponentCount - Failed to match the given parameters to a valid function signature.");
  801. lua_error(state);
  802. }
  803. break;
  804. }
  805. default:
  806. {
  807. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  808. lua_error(state);
  809. break;
  810. }
  811. }
  812. return 0;
  813. }
  814. int lua_Button_getAnimationPropertyValue(lua_State* state)
  815. {
  816. // Get the number of parameters.
  817. int paramCount = lua_gettop(state);
  818. // Attempt to match the parameters to a valid binding.
  819. switch (paramCount)
  820. {
  821. case 3:
  822. {
  823. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  824. lua_type(state, 2) == LUA_TNUMBER &&
  825. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  826. {
  827. // Get parameter 1 off the stack.
  828. int param1 = (int)luaL_checkint(state, 2);
  829. // Get parameter 2 off the stack.
  830. ScriptUtil::LuaArray<AnimationValue> param2 = ScriptUtil::getObjectPointer<AnimationValue>(3, "AnimationValue", false);
  831. Button* instance = getInstance(state);
  832. instance->getAnimationPropertyValue(param1, param2);
  833. return 0;
  834. }
  835. else
  836. {
  837. lua_pushstring(state, "lua_Button_getAnimationPropertyValue - Failed to match the given parameters to a valid function signature.");
  838. lua_error(state);
  839. }
  840. break;
  841. }
  842. default:
  843. {
  844. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  845. lua_error(state);
  846. break;
  847. }
  848. }
  849. return 0;
  850. }
  851. int lua_Button_getAutoHeight(lua_State* state)
  852. {
  853. // Get the number of parameters.
  854. int paramCount = lua_gettop(state);
  855. // Attempt to match the parameters to a valid binding.
  856. switch (paramCount)
  857. {
  858. case 1:
  859. {
  860. if ((lua_type(state, 1) == LUA_TUSERDATA))
  861. {
  862. Button* instance = getInstance(state);
  863. bool result = instance->getAutoHeight();
  864. // Push the return value onto the stack.
  865. lua_pushboolean(state, result);
  866. return 1;
  867. }
  868. else
  869. {
  870. lua_pushstring(state, "lua_Button_getAutoHeight - Failed to match the given parameters to a valid function signature.");
  871. lua_error(state);
  872. }
  873. break;
  874. }
  875. default:
  876. {
  877. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  878. lua_error(state);
  879. break;
  880. }
  881. }
  882. return 0;
  883. }
  884. int lua_Button_getAutoWidth(lua_State* state)
  885. {
  886. // Get the number of parameters.
  887. int paramCount = lua_gettop(state);
  888. // Attempt to match the parameters to a valid binding.
  889. switch (paramCount)
  890. {
  891. case 1:
  892. {
  893. if ((lua_type(state, 1) == LUA_TUSERDATA))
  894. {
  895. Button* instance = getInstance(state);
  896. bool result = instance->getAutoWidth();
  897. // Push the return value onto the stack.
  898. lua_pushboolean(state, result);
  899. return 1;
  900. }
  901. else
  902. {
  903. lua_pushstring(state, "lua_Button_getAutoWidth - Failed to match the given parameters to a valid function signature.");
  904. lua_error(state);
  905. }
  906. break;
  907. }
  908. default:
  909. {
  910. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  911. lua_error(state);
  912. break;
  913. }
  914. }
  915. return 0;
  916. }
  917. int lua_Button_getBorder(lua_State* state)
  918. {
  919. // Get the number of parameters.
  920. int paramCount = lua_gettop(state);
  921. // Attempt to match the parameters to a valid binding.
  922. switch (paramCount)
  923. {
  924. case 1:
  925. {
  926. if ((lua_type(state, 1) == LUA_TUSERDATA))
  927. {
  928. Button* instance = getInstance(state);
  929. void* returnPtr = (void*)&(instance->getBorder());
  930. if (returnPtr)
  931. {
  932. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  933. object->instance = returnPtr;
  934. object->owns = false;
  935. luaL_getmetatable(state, "ThemeSideRegions");
  936. lua_setmetatable(state, -2);
  937. }
  938. else
  939. {
  940. lua_pushnil(state);
  941. }
  942. return 1;
  943. }
  944. else
  945. {
  946. lua_pushstring(state, "lua_Button_getBorder - Failed to match the given parameters to a valid function signature.");
  947. lua_error(state);
  948. }
  949. break;
  950. }
  951. case 2:
  952. {
  953. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  954. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  955. {
  956. // Get parameter 1 off the stack.
  957. Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
  958. Button* instance = getInstance(state);
  959. void* returnPtr = (void*)&(instance->getBorder(param1));
  960. if (returnPtr)
  961. {
  962. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  963. object->instance = returnPtr;
  964. object->owns = false;
  965. luaL_getmetatable(state, "ThemeSideRegions");
  966. lua_setmetatable(state, -2);
  967. }
  968. else
  969. {
  970. lua_pushnil(state);
  971. }
  972. return 1;
  973. }
  974. else
  975. {
  976. lua_pushstring(state, "lua_Button_getBorder - Failed to match the given parameters to a valid function signature.");
  977. lua_error(state);
  978. }
  979. break;
  980. }
  981. default:
  982. {
  983. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  984. lua_error(state);
  985. break;
  986. }
  987. }
  988. return 0;
  989. }
  990. int lua_Button_getBounds(lua_State* state)
  991. {
  992. // Get the number of parameters.
  993. int paramCount = lua_gettop(state);
  994. // Attempt to match the parameters to a valid binding.
  995. switch (paramCount)
  996. {
  997. case 1:
  998. {
  999. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1000. {
  1001. Button* instance = getInstance(state);
  1002. void* returnPtr = (void*)&(instance->getBounds());
  1003. if (returnPtr)
  1004. {
  1005. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  1006. object->instance = returnPtr;
  1007. object->owns = false;
  1008. luaL_getmetatable(state, "Rectangle");
  1009. lua_setmetatable(state, -2);
  1010. }
  1011. else
  1012. {
  1013. lua_pushnil(state);
  1014. }
  1015. return 1;
  1016. }
  1017. else
  1018. {
  1019. lua_pushstring(state, "lua_Button_getBounds - Failed to match the given parameters to a valid function signature.");
  1020. lua_error(state);
  1021. }
  1022. break;
  1023. }
  1024. default:
  1025. {
  1026. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1027. lua_error(state);
  1028. break;
  1029. }
  1030. }
  1031. return 0;
  1032. }
  1033. int lua_Button_getClip(lua_State* state)
  1034. {
  1035. // Get the number of parameters.
  1036. int paramCount = lua_gettop(state);
  1037. // Attempt to match the parameters to a valid binding.
  1038. switch (paramCount)
  1039. {
  1040. case 1:
  1041. {
  1042. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1043. {
  1044. Button* instance = getInstance(state);
  1045. void* returnPtr = (void*)&(instance->getClip());
  1046. if (returnPtr)
  1047. {
  1048. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  1049. object->instance = returnPtr;
  1050. object->owns = false;
  1051. luaL_getmetatable(state, "Rectangle");
  1052. lua_setmetatable(state, -2);
  1053. }
  1054. else
  1055. {
  1056. lua_pushnil(state);
  1057. }
  1058. return 1;
  1059. }
  1060. else
  1061. {
  1062. lua_pushstring(state, "lua_Button_getClip - Failed to match the given parameters to a valid function signature.");
  1063. lua_error(state);
  1064. }
  1065. break;
  1066. }
  1067. default:
  1068. {
  1069. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1070. lua_error(state);
  1071. break;
  1072. }
  1073. }
  1074. return 0;
  1075. }
  1076. int lua_Button_getClipBounds(lua_State* state)
  1077. {
  1078. // Get the number of parameters.
  1079. int paramCount = lua_gettop(state);
  1080. // Attempt to match the parameters to a valid binding.
  1081. switch (paramCount)
  1082. {
  1083. case 1:
  1084. {
  1085. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1086. {
  1087. Button* instance = getInstance(state);
  1088. void* returnPtr = (void*)&(instance->getClipBounds());
  1089. if (returnPtr)
  1090. {
  1091. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  1092. object->instance = returnPtr;
  1093. object->owns = false;
  1094. luaL_getmetatable(state, "Rectangle");
  1095. lua_setmetatable(state, -2);
  1096. }
  1097. else
  1098. {
  1099. lua_pushnil(state);
  1100. }
  1101. return 1;
  1102. }
  1103. else
  1104. {
  1105. lua_pushstring(state, "lua_Button_getClipBounds - Failed to match the given parameters to a valid function signature.");
  1106. lua_error(state);
  1107. }
  1108. break;
  1109. }
  1110. default:
  1111. {
  1112. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1113. lua_error(state);
  1114. break;
  1115. }
  1116. }
  1117. return 0;
  1118. }
  1119. int lua_Button_getConsumeInputEvents(lua_State* state)
  1120. {
  1121. // Get the number of parameters.
  1122. int paramCount = lua_gettop(state);
  1123. // Attempt to match the parameters to a valid binding.
  1124. switch (paramCount)
  1125. {
  1126. case 1:
  1127. {
  1128. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1129. {
  1130. Button* instance = getInstance(state);
  1131. bool result = instance->getConsumeInputEvents();
  1132. // Push the return value onto the stack.
  1133. lua_pushboolean(state, result);
  1134. return 1;
  1135. }
  1136. else
  1137. {
  1138. lua_pushstring(state, "lua_Button_getConsumeInputEvents - Failed to match the given parameters to a valid function signature.");
  1139. lua_error(state);
  1140. }
  1141. break;
  1142. }
  1143. default:
  1144. {
  1145. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1146. lua_error(state);
  1147. break;
  1148. }
  1149. }
  1150. return 0;
  1151. }
  1152. int lua_Button_getCursorColor(lua_State* state)
  1153. {
  1154. // Get the number of parameters.
  1155. int paramCount = lua_gettop(state);
  1156. // Attempt to match the parameters to a valid binding.
  1157. switch (paramCount)
  1158. {
  1159. case 2:
  1160. {
  1161. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1162. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  1163. {
  1164. // Get parameter 1 off the stack.
  1165. Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
  1166. Button* instance = getInstance(state);
  1167. void* returnPtr = (void*)&(instance->getCursorColor(param1));
  1168. if (returnPtr)
  1169. {
  1170. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  1171. object->instance = returnPtr;
  1172. object->owns = false;
  1173. luaL_getmetatable(state, "Vector4");
  1174. lua_setmetatable(state, -2);
  1175. }
  1176. else
  1177. {
  1178. lua_pushnil(state);
  1179. }
  1180. return 1;
  1181. }
  1182. else
  1183. {
  1184. lua_pushstring(state, "lua_Button_getCursorColor - Failed to match the given parameters to a valid function signature.");
  1185. lua_error(state);
  1186. }
  1187. break;
  1188. }
  1189. default:
  1190. {
  1191. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  1192. lua_error(state);
  1193. break;
  1194. }
  1195. }
  1196. return 0;
  1197. }
  1198. int lua_Button_getCursorRegion(lua_State* state)
  1199. {
  1200. // Get the number of parameters.
  1201. int paramCount = lua_gettop(state);
  1202. // Attempt to match the parameters to a valid binding.
  1203. switch (paramCount)
  1204. {
  1205. case 2:
  1206. {
  1207. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1208. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  1209. {
  1210. // Get parameter 1 off the stack.
  1211. Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
  1212. Button* instance = getInstance(state);
  1213. void* returnPtr = (void*)&(instance->getCursorRegion(param1));
  1214. if (returnPtr)
  1215. {
  1216. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  1217. object->instance = returnPtr;
  1218. object->owns = false;
  1219. luaL_getmetatable(state, "Rectangle");
  1220. lua_setmetatable(state, -2);
  1221. }
  1222. else
  1223. {
  1224. lua_pushnil(state);
  1225. }
  1226. return 1;
  1227. }
  1228. else
  1229. {
  1230. lua_pushstring(state, "lua_Button_getCursorRegion - Failed to match the given parameters to a valid function signature.");
  1231. lua_error(state);
  1232. }
  1233. break;
  1234. }
  1235. default:
  1236. {
  1237. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  1238. lua_error(state);
  1239. break;
  1240. }
  1241. }
  1242. return 0;
  1243. }
  1244. int lua_Button_getCursorUVs(lua_State* state)
  1245. {
  1246. // Get the number of parameters.
  1247. int paramCount = lua_gettop(state);
  1248. // Attempt to match the parameters to a valid binding.
  1249. switch (paramCount)
  1250. {
  1251. case 2:
  1252. {
  1253. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1254. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  1255. {
  1256. // Get parameter 1 off the stack.
  1257. Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
  1258. Button* instance = getInstance(state);
  1259. void* returnPtr = (void*)&(instance->getCursorUVs(param1));
  1260. if (returnPtr)
  1261. {
  1262. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  1263. object->instance = returnPtr;
  1264. object->owns = false;
  1265. luaL_getmetatable(state, "ThemeUVs");
  1266. lua_setmetatable(state, -2);
  1267. }
  1268. else
  1269. {
  1270. lua_pushnil(state);
  1271. }
  1272. return 1;
  1273. }
  1274. else
  1275. {
  1276. lua_pushstring(state, "lua_Button_getCursorUVs - Failed to match the given parameters to a valid function signature.");
  1277. lua_error(state);
  1278. }
  1279. break;
  1280. }
  1281. default:
  1282. {
  1283. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  1284. lua_error(state);
  1285. break;
  1286. }
  1287. }
  1288. return 0;
  1289. }
  1290. int lua_Button_getFocusIndex(lua_State* state)
  1291. {
  1292. // Get the number of parameters.
  1293. int paramCount = lua_gettop(state);
  1294. // Attempt to match the parameters to a valid binding.
  1295. switch (paramCount)
  1296. {
  1297. case 1:
  1298. {
  1299. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1300. {
  1301. Button* instance = getInstance(state);
  1302. int result = instance->getFocusIndex();
  1303. // Push the return value onto the stack.
  1304. lua_pushinteger(state, result);
  1305. return 1;
  1306. }
  1307. else
  1308. {
  1309. lua_pushstring(state, "lua_Button_getFocusIndex - Failed to match the given parameters to a valid function signature.");
  1310. lua_error(state);
  1311. }
  1312. break;
  1313. }
  1314. default:
  1315. {
  1316. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1317. lua_error(state);
  1318. break;
  1319. }
  1320. }
  1321. return 0;
  1322. }
  1323. int lua_Button_getFont(lua_State* state)
  1324. {
  1325. // Get the number of parameters.
  1326. int paramCount = lua_gettop(state);
  1327. // Attempt to match the parameters to a valid binding.
  1328. switch (paramCount)
  1329. {
  1330. case 1:
  1331. {
  1332. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1333. {
  1334. Button* instance = getInstance(state);
  1335. void* returnPtr = (void*)instance->getFont();
  1336. if (returnPtr)
  1337. {
  1338. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  1339. object->instance = returnPtr;
  1340. object->owns = false;
  1341. luaL_getmetatable(state, "Font");
  1342. lua_setmetatable(state, -2);
  1343. }
  1344. else
  1345. {
  1346. lua_pushnil(state);
  1347. }
  1348. return 1;
  1349. }
  1350. else
  1351. {
  1352. lua_pushstring(state, "lua_Button_getFont - Failed to match the given parameters to a valid function signature.");
  1353. lua_error(state);
  1354. }
  1355. break;
  1356. }
  1357. case 2:
  1358. {
  1359. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1360. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  1361. {
  1362. // Get parameter 1 off the stack.
  1363. Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
  1364. Button* instance = getInstance(state);
  1365. void* returnPtr = (void*)instance->getFont(param1);
  1366. if (returnPtr)
  1367. {
  1368. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  1369. object->instance = returnPtr;
  1370. object->owns = false;
  1371. luaL_getmetatable(state, "Font");
  1372. lua_setmetatable(state, -2);
  1373. }
  1374. else
  1375. {
  1376. lua_pushnil(state);
  1377. }
  1378. return 1;
  1379. }
  1380. else
  1381. {
  1382. lua_pushstring(state, "lua_Button_getFont - Failed to match the given parameters to a valid function signature.");
  1383. lua_error(state);
  1384. }
  1385. break;
  1386. }
  1387. default:
  1388. {
  1389. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  1390. lua_error(state);
  1391. break;
  1392. }
  1393. }
  1394. return 0;
  1395. }
  1396. int lua_Button_getFontSize(lua_State* state)
  1397. {
  1398. // Get the number of parameters.
  1399. int paramCount = lua_gettop(state);
  1400. // Attempt to match the parameters to a valid binding.
  1401. switch (paramCount)
  1402. {
  1403. case 1:
  1404. {
  1405. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1406. {
  1407. Button* instance = getInstance(state);
  1408. unsigned int result = instance->getFontSize();
  1409. // Push the return value onto the stack.
  1410. lua_pushunsigned(state, result);
  1411. return 1;
  1412. }
  1413. else
  1414. {
  1415. lua_pushstring(state, "lua_Button_getFontSize - Failed to match the given parameters to a valid function signature.");
  1416. lua_error(state);
  1417. }
  1418. break;
  1419. }
  1420. case 2:
  1421. {
  1422. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1423. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  1424. {
  1425. // Get parameter 1 off the stack.
  1426. Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
  1427. Button* instance = getInstance(state);
  1428. unsigned int result = instance->getFontSize(param1);
  1429. // Push the return value onto the stack.
  1430. lua_pushunsigned(state, result);
  1431. return 1;
  1432. }
  1433. else
  1434. {
  1435. lua_pushstring(state, "lua_Button_getFontSize - Failed to match the given parameters to a valid function signature.");
  1436. lua_error(state);
  1437. }
  1438. break;
  1439. }
  1440. default:
  1441. {
  1442. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  1443. lua_error(state);
  1444. break;
  1445. }
  1446. }
  1447. return 0;
  1448. }
  1449. int lua_Button_getHeight(lua_State* state)
  1450. {
  1451. // Get the number of parameters.
  1452. int paramCount = lua_gettop(state);
  1453. // Attempt to match the parameters to a valid binding.
  1454. switch (paramCount)
  1455. {
  1456. case 1:
  1457. {
  1458. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1459. {
  1460. Button* instance = getInstance(state);
  1461. float result = instance->getHeight();
  1462. // Push the return value onto the stack.
  1463. lua_pushnumber(state, result);
  1464. return 1;
  1465. }
  1466. else
  1467. {
  1468. lua_pushstring(state, "lua_Button_getHeight - Failed to match the given parameters to a valid function signature.");
  1469. lua_error(state);
  1470. }
  1471. break;
  1472. }
  1473. default:
  1474. {
  1475. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1476. lua_error(state);
  1477. break;
  1478. }
  1479. }
  1480. return 0;
  1481. }
  1482. int lua_Button_getId(lua_State* state)
  1483. {
  1484. // Get the number of parameters.
  1485. int paramCount = lua_gettop(state);
  1486. // Attempt to match the parameters to a valid binding.
  1487. switch (paramCount)
  1488. {
  1489. case 1:
  1490. {
  1491. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1492. {
  1493. Button* instance = getInstance(state);
  1494. const char* result = instance->getId();
  1495. // Push the return value onto the stack.
  1496. lua_pushstring(state, result);
  1497. return 1;
  1498. }
  1499. else
  1500. {
  1501. lua_pushstring(state, "lua_Button_getId - Failed to match the given parameters to a valid function signature.");
  1502. lua_error(state);
  1503. }
  1504. break;
  1505. }
  1506. default:
  1507. {
  1508. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1509. lua_error(state);
  1510. break;
  1511. }
  1512. }
  1513. return 0;
  1514. }
  1515. int lua_Button_getImageColor(lua_State* state)
  1516. {
  1517. // Get the number of parameters.
  1518. int paramCount = lua_gettop(state);
  1519. // Attempt to match the parameters to a valid binding.
  1520. switch (paramCount)
  1521. {
  1522. case 3:
  1523. {
  1524. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1525. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  1526. (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
  1527. {
  1528. // Get parameter 1 off the stack.
  1529. ScriptUtil::LuaArray<const char> param1 = ScriptUtil::getString(2, false);
  1530. // Get parameter 2 off the stack.
  1531. Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3));
  1532. Button* instance = getInstance(state);
  1533. void* returnPtr = (void*)&(instance->getImageColor(param1, param2));
  1534. if (returnPtr)
  1535. {
  1536. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  1537. object->instance = returnPtr;
  1538. object->owns = false;
  1539. luaL_getmetatable(state, "Vector4");
  1540. lua_setmetatable(state, -2);
  1541. }
  1542. else
  1543. {
  1544. lua_pushnil(state);
  1545. }
  1546. return 1;
  1547. }
  1548. else
  1549. {
  1550. lua_pushstring(state, "lua_Button_getImageColor - Failed to match the given parameters to a valid function signature.");
  1551. lua_error(state);
  1552. }
  1553. break;
  1554. }
  1555. default:
  1556. {
  1557. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  1558. lua_error(state);
  1559. break;
  1560. }
  1561. }
  1562. return 0;
  1563. }
  1564. int lua_Button_getImageRegion(lua_State* state)
  1565. {
  1566. // Get the number of parameters.
  1567. int paramCount = lua_gettop(state);
  1568. // Attempt to match the parameters to a valid binding.
  1569. switch (paramCount)
  1570. {
  1571. case 3:
  1572. {
  1573. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1574. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  1575. (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
  1576. {
  1577. // Get parameter 1 off the stack.
  1578. ScriptUtil::LuaArray<const char> param1 = ScriptUtil::getString(2, false);
  1579. // Get parameter 2 off the stack.
  1580. Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3));
  1581. Button* instance = getInstance(state);
  1582. void* returnPtr = (void*)&(instance->getImageRegion(param1, param2));
  1583. if (returnPtr)
  1584. {
  1585. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  1586. object->instance = returnPtr;
  1587. object->owns = false;
  1588. luaL_getmetatable(state, "Rectangle");
  1589. lua_setmetatable(state, -2);
  1590. }
  1591. else
  1592. {
  1593. lua_pushnil(state);
  1594. }
  1595. return 1;
  1596. }
  1597. else
  1598. {
  1599. lua_pushstring(state, "lua_Button_getImageRegion - Failed to match the given parameters to a valid function signature.");
  1600. lua_error(state);
  1601. }
  1602. break;
  1603. }
  1604. default:
  1605. {
  1606. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  1607. lua_error(state);
  1608. break;
  1609. }
  1610. }
  1611. return 0;
  1612. }
  1613. int lua_Button_getImageUVs(lua_State* state)
  1614. {
  1615. // Get the number of parameters.
  1616. int paramCount = lua_gettop(state);
  1617. // Attempt to match the parameters to a valid binding.
  1618. switch (paramCount)
  1619. {
  1620. case 3:
  1621. {
  1622. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1623. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  1624. (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
  1625. {
  1626. // Get parameter 1 off the stack.
  1627. ScriptUtil::LuaArray<const char> param1 = ScriptUtil::getString(2, false);
  1628. // Get parameter 2 off the stack.
  1629. Control::State param2 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 3));
  1630. Button* instance = getInstance(state);
  1631. void* returnPtr = (void*)&(instance->getImageUVs(param1, param2));
  1632. if (returnPtr)
  1633. {
  1634. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  1635. object->instance = returnPtr;
  1636. object->owns = false;
  1637. luaL_getmetatable(state, "ThemeUVs");
  1638. lua_setmetatable(state, -2);
  1639. }
  1640. else
  1641. {
  1642. lua_pushnil(state);
  1643. }
  1644. return 1;
  1645. }
  1646. else
  1647. {
  1648. lua_pushstring(state, "lua_Button_getImageUVs - Failed to match the given parameters to a valid function signature.");
  1649. lua_error(state);
  1650. }
  1651. break;
  1652. }
  1653. default:
  1654. {
  1655. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  1656. lua_error(state);
  1657. break;
  1658. }
  1659. }
  1660. return 0;
  1661. }
  1662. int lua_Button_getMargin(lua_State* state)
  1663. {
  1664. // Get the number of parameters.
  1665. int paramCount = lua_gettop(state);
  1666. // Attempt to match the parameters to a valid binding.
  1667. switch (paramCount)
  1668. {
  1669. case 1:
  1670. {
  1671. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1672. {
  1673. Button* instance = getInstance(state);
  1674. void* returnPtr = (void*)&(instance->getMargin());
  1675. if (returnPtr)
  1676. {
  1677. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  1678. object->instance = returnPtr;
  1679. object->owns = false;
  1680. luaL_getmetatable(state, "ThemeSideRegions");
  1681. lua_setmetatable(state, -2);
  1682. }
  1683. else
  1684. {
  1685. lua_pushnil(state);
  1686. }
  1687. return 1;
  1688. }
  1689. else
  1690. {
  1691. lua_pushstring(state, "lua_Button_getMargin - Failed to match the given parameters to a valid function signature.");
  1692. lua_error(state);
  1693. }
  1694. break;
  1695. }
  1696. default:
  1697. {
  1698. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1699. lua_error(state);
  1700. break;
  1701. }
  1702. }
  1703. return 0;
  1704. }
  1705. int lua_Button_getOpacity(lua_State* state)
  1706. {
  1707. // Get the number of parameters.
  1708. int paramCount = lua_gettop(state);
  1709. // Attempt to match the parameters to a valid binding.
  1710. switch (paramCount)
  1711. {
  1712. case 1:
  1713. {
  1714. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1715. {
  1716. Button* instance = getInstance(state);
  1717. float result = instance->getOpacity();
  1718. // Push the return value onto the stack.
  1719. lua_pushnumber(state, result);
  1720. return 1;
  1721. }
  1722. else
  1723. {
  1724. lua_pushstring(state, "lua_Button_getOpacity - Failed to match the given parameters to a valid function signature.");
  1725. lua_error(state);
  1726. }
  1727. break;
  1728. }
  1729. case 2:
  1730. {
  1731. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1732. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  1733. {
  1734. // Get parameter 1 off the stack.
  1735. Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
  1736. Button* instance = getInstance(state);
  1737. float result = instance->getOpacity(param1);
  1738. // Push the return value onto the stack.
  1739. lua_pushnumber(state, result);
  1740. return 1;
  1741. }
  1742. else
  1743. {
  1744. lua_pushstring(state, "lua_Button_getOpacity - Failed to match the given parameters to a valid function signature.");
  1745. lua_error(state);
  1746. }
  1747. break;
  1748. }
  1749. default:
  1750. {
  1751. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  1752. lua_error(state);
  1753. break;
  1754. }
  1755. }
  1756. return 0;
  1757. }
  1758. int lua_Button_getPadding(lua_State* state)
  1759. {
  1760. // Get the number of parameters.
  1761. int paramCount = lua_gettop(state);
  1762. // Attempt to match the parameters to a valid binding.
  1763. switch (paramCount)
  1764. {
  1765. case 1:
  1766. {
  1767. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1768. {
  1769. Button* instance = getInstance(state);
  1770. void* returnPtr = (void*)&(instance->getPadding());
  1771. if (returnPtr)
  1772. {
  1773. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  1774. object->instance = returnPtr;
  1775. object->owns = false;
  1776. luaL_getmetatable(state, "ThemeSideRegions");
  1777. lua_setmetatable(state, -2);
  1778. }
  1779. else
  1780. {
  1781. lua_pushnil(state);
  1782. }
  1783. return 1;
  1784. }
  1785. else
  1786. {
  1787. lua_pushstring(state, "lua_Button_getPadding - Failed to match the given parameters to a valid function signature.");
  1788. lua_error(state);
  1789. }
  1790. break;
  1791. }
  1792. default:
  1793. {
  1794. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1795. lua_error(state);
  1796. break;
  1797. }
  1798. }
  1799. return 0;
  1800. }
  1801. int lua_Button_getRefCount(lua_State* state)
  1802. {
  1803. // Get the number of parameters.
  1804. int paramCount = lua_gettop(state);
  1805. // Attempt to match the parameters to a valid binding.
  1806. switch (paramCount)
  1807. {
  1808. case 1:
  1809. {
  1810. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1811. {
  1812. Button* instance = getInstance(state);
  1813. unsigned int result = instance->getRefCount();
  1814. // Push the return value onto the stack.
  1815. lua_pushunsigned(state, result);
  1816. return 1;
  1817. }
  1818. else
  1819. {
  1820. lua_pushstring(state, "lua_Button_getRefCount - Failed to match the given parameters to a valid function signature.");
  1821. lua_error(state);
  1822. }
  1823. break;
  1824. }
  1825. default:
  1826. {
  1827. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  1828. lua_error(state);
  1829. break;
  1830. }
  1831. }
  1832. return 0;
  1833. }
  1834. int lua_Button_getSkinColor(lua_State* state)
  1835. {
  1836. // Get the number of parameters.
  1837. int paramCount = lua_gettop(state);
  1838. // Attempt to match the parameters to a valid binding.
  1839. switch (paramCount)
  1840. {
  1841. case 1:
  1842. {
  1843. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1844. {
  1845. Button* instance = getInstance(state);
  1846. void* returnPtr = (void*)&(instance->getSkinColor());
  1847. if (returnPtr)
  1848. {
  1849. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  1850. object->instance = returnPtr;
  1851. object->owns = false;
  1852. luaL_getmetatable(state, "Vector4");
  1853. lua_setmetatable(state, -2);
  1854. }
  1855. else
  1856. {
  1857. lua_pushnil(state);
  1858. }
  1859. return 1;
  1860. }
  1861. else
  1862. {
  1863. lua_pushstring(state, "lua_Button_getSkinColor - Failed to match the given parameters to a valid function signature.");
  1864. lua_error(state);
  1865. }
  1866. break;
  1867. }
  1868. case 2:
  1869. {
  1870. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1871. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  1872. {
  1873. // Get parameter 1 off the stack.
  1874. Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
  1875. Button* instance = getInstance(state);
  1876. void* returnPtr = (void*)&(instance->getSkinColor(param1));
  1877. if (returnPtr)
  1878. {
  1879. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  1880. object->instance = returnPtr;
  1881. object->owns = false;
  1882. luaL_getmetatable(state, "Vector4");
  1883. lua_setmetatable(state, -2);
  1884. }
  1885. else
  1886. {
  1887. lua_pushnil(state);
  1888. }
  1889. return 1;
  1890. }
  1891. else
  1892. {
  1893. lua_pushstring(state, "lua_Button_getSkinColor - Failed to match the given parameters to a valid function signature.");
  1894. lua_error(state);
  1895. }
  1896. break;
  1897. }
  1898. default:
  1899. {
  1900. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  1901. lua_error(state);
  1902. break;
  1903. }
  1904. }
  1905. return 0;
  1906. }
  1907. int lua_Button_getSkinRegion(lua_State* state)
  1908. {
  1909. // Get the number of parameters.
  1910. int paramCount = lua_gettop(state);
  1911. // Attempt to match the parameters to a valid binding.
  1912. switch (paramCount)
  1913. {
  1914. case 1:
  1915. {
  1916. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1917. {
  1918. Button* instance = getInstance(state);
  1919. void* returnPtr = (void*)&(instance->getSkinRegion());
  1920. if (returnPtr)
  1921. {
  1922. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  1923. object->instance = returnPtr;
  1924. object->owns = false;
  1925. luaL_getmetatable(state, "Rectangle");
  1926. lua_setmetatable(state, -2);
  1927. }
  1928. else
  1929. {
  1930. lua_pushnil(state);
  1931. }
  1932. return 1;
  1933. }
  1934. else
  1935. {
  1936. lua_pushstring(state, "lua_Button_getSkinRegion - Failed to match the given parameters to a valid function signature.");
  1937. lua_error(state);
  1938. }
  1939. break;
  1940. }
  1941. case 2:
  1942. {
  1943. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  1944. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  1945. {
  1946. // Get parameter 1 off the stack.
  1947. Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
  1948. Button* instance = getInstance(state);
  1949. void* returnPtr = (void*)&(instance->getSkinRegion(param1));
  1950. if (returnPtr)
  1951. {
  1952. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  1953. object->instance = returnPtr;
  1954. object->owns = false;
  1955. luaL_getmetatable(state, "Rectangle");
  1956. lua_setmetatable(state, -2);
  1957. }
  1958. else
  1959. {
  1960. lua_pushnil(state);
  1961. }
  1962. return 1;
  1963. }
  1964. else
  1965. {
  1966. lua_pushstring(state, "lua_Button_getSkinRegion - Failed to match the given parameters to a valid function signature.");
  1967. lua_error(state);
  1968. }
  1969. break;
  1970. }
  1971. default:
  1972. {
  1973. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  1974. lua_error(state);
  1975. break;
  1976. }
  1977. }
  1978. return 0;
  1979. }
  1980. int lua_Button_getState(lua_State* state)
  1981. {
  1982. // Get the number of parameters.
  1983. int paramCount = lua_gettop(state);
  1984. // Attempt to match the parameters to a valid binding.
  1985. switch (paramCount)
  1986. {
  1987. case 1:
  1988. {
  1989. if ((lua_type(state, 1) == LUA_TUSERDATA))
  1990. {
  1991. Button* instance = getInstance(state);
  1992. Control::State result = instance->getState();
  1993. // Push the return value onto the stack.
  1994. lua_pushstring(state, lua_stringFromEnum_ControlState(result));
  1995. return 1;
  1996. }
  1997. else
  1998. {
  1999. lua_pushstring(state, "lua_Button_getState - Failed to match the given parameters to a valid function signature.");
  2000. lua_error(state);
  2001. }
  2002. break;
  2003. }
  2004. default:
  2005. {
  2006. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2007. lua_error(state);
  2008. break;
  2009. }
  2010. }
  2011. return 0;
  2012. }
  2013. int lua_Button_getStyle(lua_State* state)
  2014. {
  2015. // Get the number of parameters.
  2016. int paramCount = lua_gettop(state);
  2017. // Attempt to match the parameters to a valid binding.
  2018. switch (paramCount)
  2019. {
  2020. case 1:
  2021. {
  2022. if ((lua_type(state, 1) == LUA_TUSERDATA))
  2023. {
  2024. Button* instance = getInstance(state);
  2025. void* returnPtr = (void*)instance->getStyle();
  2026. if (returnPtr)
  2027. {
  2028. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  2029. object->instance = returnPtr;
  2030. object->owns = false;
  2031. luaL_getmetatable(state, "ThemeStyle");
  2032. lua_setmetatable(state, -2);
  2033. }
  2034. else
  2035. {
  2036. lua_pushnil(state);
  2037. }
  2038. return 1;
  2039. }
  2040. else
  2041. {
  2042. lua_pushstring(state, "lua_Button_getStyle - Failed to match the given parameters to a valid function signature.");
  2043. lua_error(state);
  2044. }
  2045. break;
  2046. }
  2047. default:
  2048. {
  2049. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2050. lua_error(state);
  2051. break;
  2052. }
  2053. }
  2054. return 0;
  2055. }
  2056. int lua_Button_getText(lua_State* state)
  2057. {
  2058. // Get the number of parameters.
  2059. int paramCount = lua_gettop(state);
  2060. // Attempt to match the parameters to a valid binding.
  2061. switch (paramCount)
  2062. {
  2063. case 1:
  2064. {
  2065. if ((lua_type(state, 1) == LUA_TUSERDATA))
  2066. {
  2067. Button* instance = getInstance(state);
  2068. const char* result = instance->getText();
  2069. // Push the return value onto the stack.
  2070. lua_pushstring(state, result);
  2071. return 1;
  2072. }
  2073. else
  2074. {
  2075. lua_pushstring(state, "lua_Button_getText - Failed to match the given parameters to a valid function signature.");
  2076. lua_error(state);
  2077. }
  2078. break;
  2079. }
  2080. default:
  2081. {
  2082. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2083. lua_error(state);
  2084. break;
  2085. }
  2086. }
  2087. return 0;
  2088. }
  2089. int lua_Button_getTextAlignment(lua_State* state)
  2090. {
  2091. // Get the number of parameters.
  2092. int paramCount = lua_gettop(state);
  2093. // Attempt to match the parameters to a valid binding.
  2094. switch (paramCount)
  2095. {
  2096. case 1:
  2097. {
  2098. if ((lua_type(state, 1) == LUA_TUSERDATA))
  2099. {
  2100. Button* instance = getInstance(state);
  2101. Font::Justify result = instance->getTextAlignment();
  2102. // Push the return value onto the stack.
  2103. lua_pushstring(state, lua_stringFromEnum_FontJustify(result));
  2104. return 1;
  2105. }
  2106. else
  2107. {
  2108. lua_pushstring(state, "lua_Button_getTextAlignment - Failed to match the given parameters to a valid function signature.");
  2109. lua_error(state);
  2110. }
  2111. break;
  2112. }
  2113. case 2:
  2114. {
  2115. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2116. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  2117. {
  2118. // Get parameter 1 off the stack.
  2119. Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
  2120. Button* instance = getInstance(state);
  2121. Font::Justify result = instance->getTextAlignment(param1);
  2122. // Push the return value onto the stack.
  2123. lua_pushstring(state, lua_stringFromEnum_FontJustify(result));
  2124. return 1;
  2125. }
  2126. else
  2127. {
  2128. lua_pushstring(state, "lua_Button_getTextAlignment - Failed to match the given parameters to a valid function signature.");
  2129. lua_error(state);
  2130. }
  2131. break;
  2132. }
  2133. default:
  2134. {
  2135. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  2136. lua_error(state);
  2137. break;
  2138. }
  2139. }
  2140. return 0;
  2141. }
  2142. int lua_Button_getTextColor(lua_State* state)
  2143. {
  2144. // Get the number of parameters.
  2145. int paramCount = lua_gettop(state);
  2146. // Attempt to match the parameters to a valid binding.
  2147. switch (paramCount)
  2148. {
  2149. case 1:
  2150. {
  2151. if ((lua_type(state, 1) == LUA_TUSERDATA))
  2152. {
  2153. Button* instance = getInstance(state);
  2154. void* returnPtr = (void*)&(instance->getTextColor());
  2155. if (returnPtr)
  2156. {
  2157. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  2158. object->instance = returnPtr;
  2159. object->owns = false;
  2160. luaL_getmetatable(state, "Vector4");
  2161. lua_setmetatable(state, -2);
  2162. }
  2163. else
  2164. {
  2165. lua_pushnil(state);
  2166. }
  2167. return 1;
  2168. }
  2169. else
  2170. {
  2171. lua_pushstring(state, "lua_Button_getTextColor - Failed to match the given parameters to a valid function signature.");
  2172. lua_error(state);
  2173. }
  2174. break;
  2175. }
  2176. case 2:
  2177. {
  2178. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2179. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  2180. {
  2181. // Get parameter 1 off the stack.
  2182. Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
  2183. Button* instance = getInstance(state);
  2184. void* returnPtr = (void*)&(instance->getTextColor(param1));
  2185. if (returnPtr)
  2186. {
  2187. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  2188. object->instance = returnPtr;
  2189. object->owns = false;
  2190. luaL_getmetatable(state, "Vector4");
  2191. lua_setmetatable(state, -2);
  2192. }
  2193. else
  2194. {
  2195. lua_pushnil(state);
  2196. }
  2197. return 1;
  2198. }
  2199. else
  2200. {
  2201. lua_pushstring(state, "lua_Button_getTextColor - Failed to match the given parameters to a valid function signature.");
  2202. lua_error(state);
  2203. }
  2204. break;
  2205. }
  2206. default:
  2207. {
  2208. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  2209. lua_error(state);
  2210. break;
  2211. }
  2212. }
  2213. return 0;
  2214. }
  2215. int lua_Button_getTextRightToLeft(lua_State* state)
  2216. {
  2217. // Get the number of parameters.
  2218. int paramCount = lua_gettop(state);
  2219. // Attempt to match the parameters to a valid binding.
  2220. switch (paramCount)
  2221. {
  2222. case 1:
  2223. {
  2224. if ((lua_type(state, 1) == LUA_TUSERDATA))
  2225. {
  2226. Button* instance = getInstance(state);
  2227. bool result = instance->getTextRightToLeft();
  2228. // Push the return value onto the stack.
  2229. lua_pushboolean(state, result);
  2230. return 1;
  2231. }
  2232. else
  2233. {
  2234. lua_pushstring(state, "lua_Button_getTextRightToLeft - Failed to match the given parameters to a valid function signature.");
  2235. lua_error(state);
  2236. }
  2237. break;
  2238. }
  2239. case 2:
  2240. {
  2241. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2242. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  2243. {
  2244. // Get parameter 1 off the stack.
  2245. Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
  2246. Button* instance = getInstance(state);
  2247. bool result = instance->getTextRightToLeft(param1);
  2248. // Push the return value onto the stack.
  2249. lua_pushboolean(state, result);
  2250. return 1;
  2251. }
  2252. else
  2253. {
  2254. lua_pushstring(state, "lua_Button_getTextRightToLeft - Failed to match the given parameters to a valid function signature.");
  2255. lua_error(state);
  2256. }
  2257. break;
  2258. }
  2259. default:
  2260. {
  2261. lua_pushstring(state, "Invalid number of parameters (expected 1 or 2).");
  2262. lua_error(state);
  2263. break;
  2264. }
  2265. }
  2266. return 0;
  2267. }
  2268. int lua_Button_getWidth(lua_State* state)
  2269. {
  2270. // Get the number of parameters.
  2271. int paramCount = lua_gettop(state);
  2272. // Attempt to match the parameters to a valid binding.
  2273. switch (paramCount)
  2274. {
  2275. case 1:
  2276. {
  2277. if ((lua_type(state, 1) == LUA_TUSERDATA))
  2278. {
  2279. Button* instance = getInstance(state);
  2280. float result = instance->getWidth();
  2281. // Push the return value onto the stack.
  2282. lua_pushnumber(state, result);
  2283. return 1;
  2284. }
  2285. else
  2286. {
  2287. lua_pushstring(state, "lua_Button_getWidth - Failed to match the given parameters to a valid function signature.");
  2288. lua_error(state);
  2289. }
  2290. break;
  2291. }
  2292. default:
  2293. {
  2294. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2295. lua_error(state);
  2296. break;
  2297. }
  2298. }
  2299. return 0;
  2300. }
  2301. int lua_Button_getX(lua_State* state)
  2302. {
  2303. // Get the number of parameters.
  2304. int paramCount = lua_gettop(state);
  2305. // Attempt to match the parameters to a valid binding.
  2306. switch (paramCount)
  2307. {
  2308. case 1:
  2309. {
  2310. if ((lua_type(state, 1) == LUA_TUSERDATA))
  2311. {
  2312. Button* instance = getInstance(state);
  2313. float result = instance->getX();
  2314. // Push the return value onto the stack.
  2315. lua_pushnumber(state, result);
  2316. return 1;
  2317. }
  2318. else
  2319. {
  2320. lua_pushstring(state, "lua_Button_getX - Failed to match the given parameters to a valid function signature.");
  2321. lua_error(state);
  2322. }
  2323. break;
  2324. }
  2325. default:
  2326. {
  2327. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2328. lua_error(state);
  2329. break;
  2330. }
  2331. }
  2332. return 0;
  2333. }
  2334. int lua_Button_getY(lua_State* state)
  2335. {
  2336. // Get the number of parameters.
  2337. int paramCount = lua_gettop(state);
  2338. // Attempt to match the parameters to a valid binding.
  2339. switch (paramCount)
  2340. {
  2341. case 1:
  2342. {
  2343. if ((lua_type(state, 1) == LUA_TUSERDATA))
  2344. {
  2345. Button* instance = getInstance(state);
  2346. float result = instance->getY();
  2347. // Push the return value onto the stack.
  2348. lua_pushnumber(state, result);
  2349. return 1;
  2350. }
  2351. else
  2352. {
  2353. lua_pushstring(state, "lua_Button_getY - Failed to match the given parameters to a valid function signature.");
  2354. lua_error(state);
  2355. }
  2356. break;
  2357. }
  2358. default:
  2359. {
  2360. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2361. lua_error(state);
  2362. break;
  2363. }
  2364. }
  2365. return 0;
  2366. }
  2367. int lua_Button_getZIndex(lua_State* state)
  2368. {
  2369. // Get the number of parameters.
  2370. int paramCount = lua_gettop(state);
  2371. // Attempt to match the parameters to a valid binding.
  2372. switch (paramCount)
  2373. {
  2374. case 1:
  2375. {
  2376. if ((lua_type(state, 1) == LUA_TUSERDATA))
  2377. {
  2378. Button* instance = getInstance(state);
  2379. int result = instance->getZIndex();
  2380. // Push the return value onto the stack.
  2381. lua_pushinteger(state, result);
  2382. return 1;
  2383. }
  2384. else
  2385. {
  2386. lua_pushstring(state, "lua_Button_getZIndex - Failed to match the given parameters to a valid function signature.");
  2387. lua_error(state);
  2388. }
  2389. break;
  2390. }
  2391. default:
  2392. {
  2393. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2394. lua_error(state);
  2395. break;
  2396. }
  2397. }
  2398. return 0;
  2399. }
  2400. int lua_Button_isContainer(lua_State* state)
  2401. {
  2402. // Get the number of parameters.
  2403. int paramCount = lua_gettop(state);
  2404. // Attempt to match the parameters to a valid binding.
  2405. switch (paramCount)
  2406. {
  2407. case 1:
  2408. {
  2409. if ((lua_type(state, 1) == LUA_TUSERDATA))
  2410. {
  2411. Button* instance = getInstance(state);
  2412. bool result = instance->isContainer();
  2413. // Push the return value onto the stack.
  2414. lua_pushboolean(state, result);
  2415. return 1;
  2416. }
  2417. else
  2418. {
  2419. lua_pushstring(state, "lua_Button_isContainer - Failed to match the given parameters to a valid function signature.");
  2420. lua_error(state);
  2421. }
  2422. break;
  2423. }
  2424. default:
  2425. {
  2426. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2427. lua_error(state);
  2428. break;
  2429. }
  2430. }
  2431. return 0;
  2432. }
  2433. int lua_Button_isEnabled(lua_State* state)
  2434. {
  2435. // Get the number of parameters.
  2436. int paramCount = lua_gettop(state);
  2437. // Attempt to match the parameters to a valid binding.
  2438. switch (paramCount)
  2439. {
  2440. case 1:
  2441. {
  2442. if ((lua_type(state, 1) == LUA_TUSERDATA))
  2443. {
  2444. Button* instance = getInstance(state);
  2445. bool result = instance->isEnabled();
  2446. // Push the return value onto the stack.
  2447. lua_pushboolean(state, result);
  2448. return 1;
  2449. }
  2450. else
  2451. {
  2452. lua_pushstring(state, "lua_Button_isEnabled - Failed to match the given parameters to a valid function signature.");
  2453. lua_error(state);
  2454. }
  2455. break;
  2456. }
  2457. default:
  2458. {
  2459. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2460. lua_error(state);
  2461. break;
  2462. }
  2463. }
  2464. return 0;
  2465. }
  2466. int lua_Button_release(lua_State* state)
  2467. {
  2468. // Get the number of parameters.
  2469. int paramCount = lua_gettop(state);
  2470. // Attempt to match the parameters to a valid binding.
  2471. switch (paramCount)
  2472. {
  2473. case 1:
  2474. {
  2475. if ((lua_type(state, 1) == LUA_TUSERDATA))
  2476. {
  2477. Button* instance = getInstance(state);
  2478. instance->release();
  2479. return 0;
  2480. }
  2481. else
  2482. {
  2483. lua_pushstring(state, "lua_Button_release - Failed to match the given parameters to a valid function signature.");
  2484. lua_error(state);
  2485. }
  2486. break;
  2487. }
  2488. default:
  2489. {
  2490. lua_pushstring(state, "Invalid number of parameters (expected 1).");
  2491. lua_error(state);
  2492. break;
  2493. }
  2494. }
  2495. return 0;
  2496. }
  2497. int lua_Button_removeScriptCallback(lua_State* state)
  2498. {
  2499. // Get the number of parameters.
  2500. int paramCount = lua_gettop(state);
  2501. // Attempt to match the parameters to a valid binding.
  2502. switch (paramCount)
  2503. {
  2504. case 3:
  2505. {
  2506. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2507. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  2508. (lua_type(state, 3) == LUA_TSTRING || lua_type(state, 3) == LUA_TNIL))
  2509. {
  2510. // Get parameter 1 off the stack.
  2511. std::string param1 = ScriptUtil::getString(2, true);
  2512. // Get parameter 2 off the stack.
  2513. std::string param2 = ScriptUtil::getString(3, true);
  2514. Button* instance = getInstance(state);
  2515. instance->removeScriptCallback(param1, param2);
  2516. return 0;
  2517. }
  2518. else
  2519. {
  2520. lua_pushstring(state, "lua_Button_removeScriptCallback - Failed to match the given parameters to a valid function signature.");
  2521. lua_error(state);
  2522. }
  2523. break;
  2524. }
  2525. default:
  2526. {
  2527. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  2528. lua_error(state);
  2529. break;
  2530. }
  2531. }
  2532. return 0;
  2533. }
  2534. int lua_Button_setAlignment(lua_State* state)
  2535. {
  2536. // Get the number of parameters.
  2537. int paramCount = lua_gettop(state);
  2538. // Attempt to match the parameters to a valid binding.
  2539. switch (paramCount)
  2540. {
  2541. case 2:
  2542. {
  2543. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2544. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  2545. {
  2546. // Get parameter 1 off the stack.
  2547. Control::Alignment param1 = (Control::Alignment)lua_enumFromString_ControlAlignment(luaL_checkstring(state, 2));
  2548. Button* instance = getInstance(state);
  2549. instance->setAlignment(param1);
  2550. return 0;
  2551. }
  2552. else
  2553. {
  2554. lua_pushstring(state, "lua_Button_setAlignment - Failed to match the given parameters to a valid function signature.");
  2555. lua_error(state);
  2556. }
  2557. break;
  2558. }
  2559. default:
  2560. {
  2561. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  2562. lua_error(state);
  2563. break;
  2564. }
  2565. }
  2566. return 0;
  2567. }
  2568. int lua_Button_setAnimationPropertyValue(lua_State* state)
  2569. {
  2570. // Get the number of parameters.
  2571. int paramCount = lua_gettop(state);
  2572. // Attempt to match the parameters to a valid binding.
  2573. switch (paramCount)
  2574. {
  2575. case 3:
  2576. {
  2577. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2578. lua_type(state, 2) == LUA_TNUMBER &&
  2579. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL))
  2580. {
  2581. // Get parameter 1 off the stack.
  2582. int param1 = (int)luaL_checkint(state, 2);
  2583. // Get parameter 2 off the stack.
  2584. ScriptUtil::LuaArray<AnimationValue> param2 = ScriptUtil::getObjectPointer<AnimationValue>(3, "AnimationValue", false);
  2585. Button* instance = getInstance(state);
  2586. instance->setAnimationPropertyValue(param1, param2);
  2587. return 0;
  2588. }
  2589. else
  2590. {
  2591. lua_pushstring(state, "lua_Button_setAnimationPropertyValue - Failed to match the given parameters to a valid function signature.");
  2592. lua_error(state);
  2593. }
  2594. break;
  2595. }
  2596. case 4:
  2597. {
  2598. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2599. lua_type(state, 2) == LUA_TNUMBER &&
  2600. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TTABLE || lua_type(state, 3) == LUA_TNIL) &&
  2601. lua_type(state, 4) == LUA_TNUMBER)
  2602. {
  2603. // Get parameter 1 off the stack.
  2604. int param1 = (int)luaL_checkint(state, 2);
  2605. // Get parameter 2 off the stack.
  2606. ScriptUtil::LuaArray<AnimationValue> param2 = ScriptUtil::getObjectPointer<AnimationValue>(3, "AnimationValue", false);
  2607. // Get parameter 3 off the stack.
  2608. float param3 = (float)luaL_checknumber(state, 4);
  2609. Button* instance = getInstance(state);
  2610. instance->setAnimationPropertyValue(param1, param2, param3);
  2611. return 0;
  2612. }
  2613. else
  2614. {
  2615. lua_pushstring(state, "lua_Button_setAnimationPropertyValue - Failed to match the given parameters to a valid function signature.");
  2616. lua_error(state);
  2617. }
  2618. break;
  2619. }
  2620. default:
  2621. {
  2622. lua_pushstring(state, "Invalid number of parameters (expected 3 or 4).");
  2623. lua_error(state);
  2624. break;
  2625. }
  2626. }
  2627. return 0;
  2628. }
  2629. int lua_Button_setAutoHeight(lua_State* state)
  2630. {
  2631. // Get the number of parameters.
  2632. int paramCount = lua_gettop(state);
  2633. // Attempt to match the parameters to a valid binding.
  2634. switch (paramCount)
  2635. {
  2636. case 2:
  2637. {
  2638. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2639. lua_type(state, 2) == LUA_TBOOLEAN)
  2640. {
  2641. // Get parameter 1 off the stack.
  2642. bool param1 = ScriptUtil::luaCheckBool(state, 2);
  2643. Button* instance = getInstance(state);
  2644. instance->setAutoHeight(param1);
  2645. return 0;
  2646. }
  2647. else
  2648. {
  2649. lua_pushstring(state, "lua_Button_setAutoHeight - Failed to match the given parameters to a valid function signature.");
  2650. lua_error(state);
  2651. }
  2652. break;
  2653. }
  2654. default:
  2655. {
  2656. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  2657. lua_error(state);
  2658. break;
  2659. }
  2660. }
  2661. return 0;
  2662. }
  2663. int lua_Button_setAutoWidth(lua_State* state)
  2664. {
  2665. // Get the number of parameters.
  2666. int paramCount = lua_gettop(state);
  2667. // Attempt to match the parameters to a valid binding.
  2668. switch (paramCount)
  2669. {
  2670. case 2:
  2671. {
  2672. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2673. lua_type(state, 2) == LUA_TBOOLEAN)
  2674. {
  2675. // Get parameter 1 off the stack.
  2676. bool param1 = ScriptUtil::luaCheckBool(state, 2);
  2677. Button* instance = getInstance(state);
  2678. instance->setAutoWidth(param1);
  2679. return 0;
  2680. }
  2681. else
  2682. {
  2683. lua_pushstring(state, "lua_Button_setAutoWidth - Failed to match the given parameters to a valid function signature.");
  2684. lua_error(state);
  2685. }
  2686. break;
  2687. }
  2688. default:
  2689. {
  2690. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  2691. lua_error(state);
  2692. break;
  2693. }
  2694. }
  2695. return 0;
  2696. }
  2697. int lua_Button_setBorder(lua_State* state)
  2698. {
  2699. // Get the number of parameters.
  2700. int paramCount = lua_gettop(state);
  2701. // Attempt to match the parameters to a valid binding.
  2702. switch (paramCount)
  2703. {
  2704. case 5:
  2705. {
  2706. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2707. lua_type(state, 2) == LUA_TNUMBER &&
  2708. lua_type(state, 3) == LUA_TNUMBER &&
  2709. lua_type(state, 4) == LUA_TNUMBER &&
  2710. lua_type(state, 5) == LUA_TNUMBER)
  2711. {
  2712. // Get parameter 1 off the stack.
  2713. float param1 = (float)luaL_checknumber(state, 2);
  2714. // Get parameter 2 off the stack.
  2715. float param2 = (float)luaL_checknumber(state, 3);
  2716. // Get parameter 3 off the stack.
  2717. float param3 = (float)luaL_checknumber(state, 4);
  2718. // Get parameter 4 off the stack.
  2719. float param4 = (float)luaL_checknumber(state, 5);
  2720. Button* instance = getInstance(state);
  2721. instance->setBorder(param1, param2, param3, param4);
  2722. return 0;
  2723. }
  2724. else
  2725. {
  2726. lua_pushstring(state, "lua_Button_setBorder - Failed to match the given parameters to a valid function signature.");
  2727. lua_error(state);
  2728. }
  2729. break;
  2730. }
  2731. case 6:
  2732. {
  2733. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2734. lua_type(state, 2) == LUA_TNUMBER &&
  2735. lua_type(state, 3) == LUA_TNUMBER &&
  2736. lua_type(state, 4) == LUA_TNUMBER &&
  2737. lua_type(state, 5) == LUA_TNUMBER &&
  2738. lua_type(state, 6) == LUA_TNUMBER)
  2739. {
  2740. // Get parameter 1 off the stack.
  2741. float param1 = (float)luaL_checknumber(state, 2);
  2742. // Get parameter 2 off the stack.
  2743. float param2 = (float)luaL_checknumber(state, 3);
  2744. // Get parameter 3 off the stack.
  2745. float param3 = (float)luaL_checknumber(state, 4);
  2746. // Get parameter 4 off the stack.
  2747. float param4 = (float)luaL_checknumber(state, 5);
  2748. // Get parameter 5 off the stack.
  2749. unsigned char param5 = (unsigned char)luaL_checkunsigned(state, 6);
  2750. Button* instance = getInstance(state);
  2751. instance->setBorder(param1, param2, param3, param4, param5);
  2752. return 0;
  2753. }
  2754. else
  2755. {
  2756. lua_pushstring(state, "lua_Button_setBorder - Failed to match the given parameters to a valid function signature.");
  2757. lua_error(state);
  2758. }
  2759. break;
  2760. }
  2761. default:
  2762. {
  2763. lua_pushstring(state, "Invalid number of parameters (expected 5 or 6).");
  2764. lua_error(state);
  2765. break;
  2766. }
  2767. }
  2768. return 0;
  2769. }
  2770. int lua_Button_setBounds(lua_State* state)
  2771. {
  2772. // Get the number of parameters.
  2773. int paramCount = lua_gettop(state);
  2774. // Attempt to match the parameters to a valid binding.
  2775. switch (paramCount)
  2776. {
  2777. case 2:
  2778. {
  2779. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2780. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  2781. {
  2782. // Get parameter 1 off the stack.
  2783. ScriptUtil::LuaArray<Rectangle> param1 = ScriptUtil::getObjectPointer<Rectangle>(2, "Rectangle", true);
  2784. Button* instance = getInstance(state);
  2785. instance->setBounds(*param1);
  2786. return 0;
  2787. }
  2788. else
  2789. {
  2790. lua_pushstring(state, "lua_Button_setBounds - Failed to match the given parameters to a valid function signature.");
  2791. lua_error(state);
  2792. }
  2793. break;
  2794. }
  2795. default:
  2796. {
  2797. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  2798. lua_error(state);
  2799. break;
  2800. }
  2801. }
  2802. return 0;
  2803. }
  2804. int lua_Button_setConsumeInputEvents(lua_State* state)
  2805. {
  2806. // Get the number of parameters.
  2807. int paramCount = lua_gettop(state);
  2808. // Attempt to match the parameters to a valid binding.
  2809. switch (paramCount)
  2810. {
  2811. case 2:
  2812. {
  2813. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2814. lua_type(state, 2) == LUA_TBOOLEAN)
  2815. {
  2816. // Get parameter 1 off the stack.
  2817. bool param1 = ScriptUtil::luaCheckBool(state, 2);
  2818. Button* instance = getInstance(state);
  2819. instance->setConsumeInputEvents(param1);
  2820. return 0;
  2821. }
  2822. else
  2823. {
  2824. lua_pushstring(state, "lua_Button_setConsumeInputEvents - Failed to match the given parameters to a valid function signature.");
  2825. lua_error(state);
  2826. }
  2827. break;
  2828. }
  2829. default:
  2830. {
  2831. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  2832. lua_error(state);
  2833. break;
  2834. }
  2835. }
  2836. return 0;
  2837. }
  2838. int lua_Button_setCursorColor(lua_State* state)
  2839. {
  2840. // Get the number of parameters.
  2841. int paramCount = lua_gettop(state);
  2842. // Attempt to match the parameters to a valid binding.
  2843. switch (paramCount)
  2844. {
  2845. case 3:
  2846. {
  2847. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2848. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  2849. lua_type(state, 3) == LUA_TNUMBER)
  2850. {
  2851. // Get parameter 1 off the stack.
  2852. ScriptUtil::LuaArray<Vector4> param1 = ScriptUtil::getObjectPointer<Vector4>(2, "Vector4", true);
  2853. // Get parameter 2 off the stack.
  2854. unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);
  2855. Button* instance = getInstance(state);
  2856. instance->setCursorColor(*param1, param2);
  2857. return 0;
  2858. }
  2859. else
  2860. {
  2861. lua_pushstring(state, "lua_Button_setCursorColor - Failed to match the given parameters to a valid function signature.");
  2862. lua_error(state);
  2863. }
  2864. break;
  2865. }
  2866. default:
  2867. {
  2868. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  2869. lua_error(state);
  2870. break;
  2871. }
  2872. }
  2873. return 0;
  2874. }
  2875. int lua_Button_setCursorRegion(lua_State* state)
  2876. {
  2877. // Get the number of parameters.
  2878. int paramCount = lua_gettop(state);
  2879. // Attempt to match the parameters to a valid binding.
  2880. switch (paramCount)
  2881. {
  2882. case 3:
  2883. {
  2884. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2885. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  2886. lua_type(state, 3) == LUA_TNUMBER)
  2887. {
  2888. // Get parameter 1 off the stack.
  2889. ScriptUtil::LuaArray<Rectangle> param1 = ScriptUtil::getObjectPointer<Rectangle>(2, "Rectangle", true);
  2890. // Get parameter 2 off the stack.
  2891. unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);
  2892. Button* instance = getInstance(state);
  2893. instance->setCursorRegion(*param1, param2);
  2894. return 0;
  2895. }
  2896. else
  2897. {
  2898. lua_pushstring(state, "lua_Button_setCursorRegion - Failed to match the given parameters to a valid function signature.");
  2899. lua_error(state);
  2900. }
  2901. break;
  2902. }
  2903. default:
  2904. {
  2905. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  2906. lua_error(state);
  2907. break;
  2908. }
  2909. }
  2910. return 0;
  2911. }
  2912. int lua_Button_setFocusIndex(lua_State* state)
  2913. {
  2914. // Get the number of parameters.
  2915. int paramCount = lua_gettop(state);
  2916. // Attempt to match the parameters to a valid binding.
  2917. switch (paramCount)
  2918. {
  2919. case 2:
  2920. {
  2921. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2922. lua_type(state, 2) == LUA_TNUMBER)
  2923. {
  2924. // Get parameter 1 off the stack.
  2925. int param1 = (int)luaL_checkint(state, 2);
  2926. Button* instance = getInstance(state);
  2927. instance->setFocusIndex(param1);
  2928. return 0;
  2929. }
  2930. else
  2931. {
  2932. lua_pushstring(state, "lua_Button_setFocusIndex - Failed to match the given parameters to a valid function signature.");
  2933. lua_error(state);
  2934. }
  2935. break;
  2936. }
  2937. default:
  2938. {
  2939. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  2940. lua_error(state);
  2941. break;
  2942. }
  2943. }
  2944. return 0;
  2945. }
  2946. int lua_Button_setFont(lua_State* state)
  2947. {
  2948. // Get the number of parameters.
  2949. int paramCount = lua_gettop(state);
  2950. // Attempt to match the parameters to a valid binding.
  2951. switch (paramCount)
  2952. {
  2953. case 2:
  2954. {
  2955. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2956. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  2957. {
  2958. // Get parameter 1 off the stack.
  2959. ScriptUtil::LuaArray<Font> param1 = ScriptUtil::getObjectPointer<Font>(2, "Font", false);
  2960. Button* instance = getInstance(state);
  2961. instance->setFont(param1);
  2962. return 0;
  2963. }
  2964. else
  2965. {
  2966. lua_pushstring(state, "lua_Button_setFont - Failed to match the given parameters to a valid function signature.");
  2967. lua_error(state);
  2968. }
  2969. break;
  2970. }
  2971. case 3:
  2972. {
  2973. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  2974. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL) &&
  2975. lua_type(state, 3) == LUA_TNUMBER)
  2976. {
  2977. // Get parameter 1 off the stack.
  2978. ScriptUtil::LuaArray<Font> param1 = ScriptUtil::getObjectPointer<Font>(2, "Font", false);
  2979. // Get parameter 2 off the stack.
  2980. unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);
  2981. Button* instance = getInstance(state);
  2982. instance->setFont(param1, param2);
  2983. return 0;
  2984. }
  2985. else
  2986. {
  2987. lua_pushstring(state, "lua_Button_setFont - Failed to match the given parameters to a valid function signature.");
  2988. lua_error(state);
  2989. }
  2990. break;
  2991. }
  2992. default:
  2993. {
  2994. lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
  2995. lua_error(state);
  2996. break;
  2997. }
  2998. }
  2999. return 0;
  3000. }
  3001. int lua_Button_setFontSize(lua_State* state)
  3002. {
  3003. // Get the number of parameters.
  3004. int paramCount = lua_gettop(state);
  3005. // Attempt to match the parameters to a valid binding.
  3006. switch (paramCount)
  3007. {
  3008. case 2:
  3009. {
  3010. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3011. lua_type(state, 2) == LUA_TNUMBER)
  3012. {
  3013. // Get parameter 1 off the stack.
  3014. unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2);
  3015. Button* instance = getInstance(state);
  3016. instance->setFontSize(param1);
  3017. return 0;
  3018. }
  3019. else
  3020. {
  3021. lua_pushstring(state, "lua_Button_setFontSize - Failed to match the given parameters to a valid function signature.");
  3022. lua_error(state);
  3023. }
  3024. break;
  3025. }
  3026. case 3:
  3027. {
  3028. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3029. lua_type(state, 2) == LUA_TNUMBER &&
  3030. lua_type(state, 3) == LUA_TNUMBER)
  3031. {
  3032. // Get parameter 1 off the stack.
  3033. unsigned int param1 = (unsigned int)luaL_checkunsigned(state, 2);
  3034. // Get parameter 2 off the stack.
  3035. unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);
  3036. Button* instance = getInstance(state);
  3037. instance->setFontSize(param1, param2);
  3038. return 0;
  3039. }
  3040. else
  3041. {
  3042. lua_pushstring(state, "lua_Button_setFontSize - Failed to match the given parameters to a valid function signature.");
  3043. lua_error(state);
  3044. }
  3045. break;
  3046. }
  3047. default:
  3048. {
  3049. lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
  3050. lua_error(state);
  3051. break;
  3052. }
  3053. }
  3054. return 0;
  3055. }
  3056. int lua_Button_setImageColor(lua_State* state)
  3057. {
  3058. // Get the number of parameters.
  3059. int paramCount = lua_gettop(state);
  3060. // Attempt to match the parameters to a valid binding.
  3061. switch (paramCount)
  3062. {
  3063. case 3:
  3064. {
  3065. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3066. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  3067. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL))
  3068. {
  3069. // Get parameter 1 off the stack.
  3070. ScriptUtil::LuaArray<const char> param1 = ScriptUtil::getString(2, false);
  3071. // Get parameter 2 off the stack.
  3072. ScriptUtil::LuaArray<Vector4> param2 = ScriptUtil::getObjectPointer<Vector4>(3, "Vector4", true);
  3073. Button* instance = getInstance(state);
  3074. instance->setImageColor(param1, *param2);
  3075. return 0;
  3076. }
  3077. else
  3078. {
  3079. lua_pushstring(state, "lua_Button_setImageColor - Failed to match the given parameters to a valid function signature.");
  3080. lua_error(state);
  3081. }
  3082. break;
  3083. }
  3084. case 4:
  3085. {
  3086. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3087. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  3088. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  3089. lua_type(state, 4) == LUA_TNUMBER)
  3090. {
  3091. // Get parameter 1 off the stack.
  3092. ScriptUtil::LuaArray<const char> param1 = ScriptUtil::getString(2, false);
  3093. // Get parameter 2 off the stack.
  3094. ScriptUtil::LuaArray<Vector4> param2 = ScriptUtil::getObjectPointer<Vector4>(3, "Vector4", true);
  3095. // Get parameter 3 off the stack.
  3096. unsigned char param3 = (unsigned char)luaL_checkunsigned(state, 4);
  3097. Button* instance = getInstance(state);
  3098. instance->setImageColor(param1, *param2, param3);
  3099. return 0;
  3100. }
  3101. else
  3102. {
  3103. lua_pushstring(state, "lua_Button_setImageColor - Failed to match the given parameters to a valid function signature.");
  3104. lua_error(state);
  3105. }
  3106. break;
  3107. }
  3108. default:
  3109. {
  3110. lua_pushstring(state, "Invalid number of parameters (expected 3 or 4).");
  3111. lua_error(state);
  3112. break;
  3113. }
  3114. }
  3115. return 0;
  3116. }
  3117. int lua_Button_setImageRegion(lua_State* state)
  3118. {
  3119. // Get the number of parameters.
  3120. int paramCount = lua_gettop(state);
  3121. // Attempt to match the parameters to a valid binding.
  3122. switch (paramCount)
  3123. {
  3124. case 3:
  3125. {
  3126. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3127. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  3128. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL))
  3129. {
  3130. // Get parameter 1 off the stack.
  3131. ScriptUtil::LuaArray<const char> param1 = ScriptUtil::getString(2, false);
  3132. // Get parameter 2 off the stack.
  3133. ScriptUtil::LuaArray<Rectangle> param2 = ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true);
  3134. Button* instance = getInstance(state);
  3135. instance->setImageRegion(param1, *param2);
  3136. return 0;
  3137. }
  3138. else
  3139. {
  3140. lua_pushstring(state, "lua_Button_setImageRegion - Failed to match the given parameters to a valid function signature.");
  3141. lua_error(state);
  3142. }
  3143. break;
  3144. }
  3145. case 4:
  3146. {
  3147. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3148. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  3149. (lua_type(state, 3) == LUA_TUSERDATA || lua_type(state, 3) == LUA_TNIL) &&
  3150. lua_type(state, 4) == LUA_TNUMBER)
  3151. {
  3152. // Get parameter 1 off the stack.
  3153. ScriptUtil::LuaArray<const char> param1 = ScriptUtil::getString(2, false);
  3154. // Get parameter 2 off the stack.
  3155. ScriptUtil::LuaArray<Rectangle> param2 = ScriptUtil::getObjectPointer<Rectangle>(3, "Rectangle", true);
  3156. // Get parameter 3 off the stack.
  3157. unsigned char param3 = (unsigned char)luaL_checkunsigned(state, 4);
  3158. Button* instance = getInstance(state);
  3159. instance->setImageRegion(param1, *param2, param3);
  3160. return 0;
  3161. }
  3162. else
  3163. {
  3164. lua_pushstring(state, "lua_Button_setImageRegion - Failed to match the given parameters to a valid function signature.");
  3165. lua_error(state);
  3166. }
  3167. break;
  3168. }
  3169. default:
  3170. {
  3171. lua_pushstring(state, "Invalid number of parameters (expected 3 or 4).");
  3172. lua_error(state);
  3173. break;
  3174. }
  3175. }
  3176. return 0;
  3177. }
  3178. int lua_Button_setMargin(lua_State* state)
  3179. {
  3180. // Get the number of parameters.
  3181. int paramCount = lua_gettop(state);
  3182. // Attempt to match the parameters to a valid binding.
  3183. switch (paramCount)
  3184. {
  3185. case 5:
  3186. {
  3187. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3188. lua_type(state, 2) == LUA_TNUMBER &&
  3189. lua_type(state, 3) == LUA_TNUMBER &&
  3190. lua_type(state, 4) == LUA_TNUMBER &&
  3191. lua_type(state, 5) == LUA_TNUMBER)
  3192. {
  3193. // Get parameter 1 off the stack.
  3194. float param1 = (float)luaL_checknumber(state, 2);
  3195. // Get parameter 2 off the stack.
  3196. float param2 = (float)luaL_checknumber(state, 3);
  3197. // Get parameter 3 off the stack.
  3198. float param3 = (float)luaL_checknumber(state, 4);
  3199. // Get parameter 4 off the stack.
  3200. float param4 = (float)luaL_checknumber(state, 5);
  3201. Button* instance = getInstance(state);
  3202. instance->setMargin(param1, param2, param3, param4);
  3203. return 0;
  3204. }
  3205. else
  3206. {
  3207. lua_pushstring(state, "lua_Button_setMargin - Failed to match the given parameters to a valid function signature.");
  3208. lua_error(state);
  3209. }
  3210. break;
  3211. }
  3212. default:
  3213. {
  3214. lua_pushstring(state, "Invalid number of parameters (expected 5).");
  3215. lua_error(state);
  3216. break;
  3217. }
  3218. }
  3219. return 0;
  3220. }
  3221. int lua_Button_setOpacity(lua_State* state)
  3222. {
  3223. // Get the number of parameters.
  3224. int paramCount = lua_gettop(state);
  3225. // Attempt to match the parameters to a valid binding.
  3226. switch (paramCount)
  3227. {
  3228. case 2:
  3229. {
  3230. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3231. lua_type(state, 2) == LUA_TNUMBER)
  3232. {
  3233. // Get parameter 1 off the stack.
  3234. float param1 = (float)luaL_checknumber(state, 2);
  3235. Button* instance = getInstance(state);
  3236. instance->setOpacity(param1);
  3237. return 0;
  3238. }
  3239. else
  3240. {
  3241. lua_pushstring(state, "lua_Button_setOpacity - Failed to match the given parameters to a valid function signature.");
  3242. lua_error(state);
  3243. }
  3244. break;
  3245. }
  3246. case 3:
  3247. {
  3248. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3249. lua_type(state, 2) == LUA_TNUMBER &&
  3250. lua_type(state, 3) == LUA_TNUMBER)
  3251. {
  3252. // Get parameter 1 off the stack.
  3253. float param1 = (float)luaL_checknumber(state, 2);
  3254. // Get parameter 2 off the stack.
  3255. unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);
  3256. Button* instance = getInstance(state);
  3257. instance->setOpacity(param1, param2);
  3258. return 0;
  3259. }
  3260. else
  3261. {
  3262. lua_pushstring(state, "lua_Button_setOpacity - Failed to match the given parameters to a valid function signature.");
  3263. lua_error(state);
  3264. }
  3265. break;
  3266. }
  3267. default:
  3268. {
  3269. lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
  3270. lua_error(state);
  3271. break;
  3272. }
  3273. }
  3274. return 0;
  3275. }
  3276. int lua_Button_setPadding(lua_State* state)
  3277. {
  3278. // Get the number of parameters.
  3279. int paramCount = lua_gettop(state);
  3280. // Attempt to match the parameters to a valid binding.
  3281. switch (paramCount)
  3282. {
  3283. case 5:
  3284. {
  3285. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3286. lua_type(state, 2) == LUA_TNUMBER &&
  3287. lua_type(state, 3) == LUA_TNUMBER &&
  3288. lua_type(state, 4) == LUA_TNUMBER &&
  3289. lua_type(state, 5) == LUA_TNUMBER)
  3290. {
  3291. // Get parameter 1 off the stack.
  3292. float param1 = (float)luaL_checknumber(state, 2);
  3293. // Get parameter 2 off the stack.
  3294. float param2 = (float)luaL_checknumber(state, 3);
  3295. // Get parameter 3 off the stack.
  3296. float param3 = (float)luaL_checknumber(state, 4);
  3297. // Get parameter 4 off the stack.
  3298. float param4 = (float)luaL_checknumber(state, 5);
  3299. Button* instance = getInstance(state);
  3300. instance->setPadding(param1, param2, param3, param4);
  3301. return 0;
  3302. }
  3303. else
  3304. {
  3305. lua_pushstring(state, "lua_Button_setPadding - Failed to match the given parameters to a valid function signature.");
  3306. lua_error(state);
  3307. }
  3308. break;
  3309. }
  3310. default:
  3311. {
  3312. lua_pushstring(state, "Invalid number of parameters (expected 5).");
  3313. lua_error(state);
  3314. break;
  3315. }
  3316. }
  3317. return 0;
  3318. }
  3319. int lua_Button_setPosition(lua_State* state)
  3320. {
  3321. // Get the number of parameters.
  3322. int paramCount = lua_gettop(state);
  3323. // Attempt to match the parameters to a valid binding.
  3324. switch (paramCount)
  3325. {
  3326. case 3:
  3327. {
  3328. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3329. lua_type(state, 2) == LUA_TNUMBER &&
  3330. lua_type(state, 3) == LUA_TNUMBER)
  3331. {
  3332. // Get parameter 1 off the stack.
  3333. float param1 = (float)luaL_checknumber(state, 2);
  3334. // Get parameter 2 off the stack.
  3335. float param2 = (float)luaL_checknumber(state, 3);
  3336. Button* instance = getInstance(state);
  3337. instance->setPosition(param1, param2);
  3338. return 0;
  3339. }
  3340. else
  3341. {
  3342. lua_pushstring(state, "lua_Button_setPosition - Failed to match the given parameters to a valid function signature.");
  3343. lua_error(state);
  3344. }
  3345. break;
  3346. }
  3347. default:
  3348. {
  3349. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  3350. lua_error(state);
  3351. break;
  3352. }
  3353. }
  3354. return 0;
  3355. }
  3356. int lua_Button_setSize(lua_State* state)
  3357. {
  3358. // Get the number of parameters.
  3359. int paramCount = lua_gettop(state);
  3360. // Attempt to match the parameters to a valid binding.
  3361. switch (paramCount)
  3362. {
  3363. case 3:
  3364. {
  3365. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3366. lua_type(state, 2) == LUA_TNUMBER &&
  3367. lua_type(state, 3) == LUA_TNUMBER)
  3368. {
  3369. // Get parameter 1 off the stack.
  3370. float param1 = (float)luaL_checknumber(state, 2);
  3371. // Get parameter 2 off the stack.
  3372. float param2 = (float)luaL_checknumber(state, 3);
  3373. Button* instance = getInstance(state);
  3374. instance->setSize(param1, param2);
  3375. return 0;
  3376. }
  3377. else
  3378. {
  3379. lua_pushstring(state, "lua_Button_setSize - Failed to match the given parameters to a valid function signature.");
  3380. lua_error(state);
  3381. }
  3382. break;
  3383. }
  3384. default:
  3385. {
  3386. lua_pushstring(state, "Invalid number of parameters (expected 3).");
  3387. lua_error(state);
  3388. break;
  3389. }
  3390. }
  3391. return 0;
  3392. }
  3393. int lua_Button_setSkinColor(lua_State* state)
  3394. {
  3395. // Get the number of parameters.
  3396. int paramCount = lua_gettop(state);
  3397. // Attempt to match the parameters to a valid binding.
  3398. switch (paramCount)
  3399. {
  3400. case 2:
  3401. {
  3402. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3403. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  3404. {
  3405. // Get parameter 1 off the stack.
  3406. ScriptUtil::LuaArray<Vector4> param1 = ScriptUtil::getObjectPointer<Vector4>(2, "Vector4", true);
  3407. Button* instance = getInstance(state);
  3408. instance->setSkinColor(*param1);
  3409. return 0;
  3410. }
  3411. else
  3412. {
  3413. lua_pushstring(state, "lua_Button_setSkinColor - Failed to match the given parameters to a valid function signature.");
  3414. lua_error(state);
  3415. }
  3416. break;
  3417. }
  3418. case 3:
  3419. {
  3420. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3421. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  3422. lua_type(state, 3) == LUA_TNUMBER)
  3423. {
  3424. // Get parameter 1 off the stack.
  3425. ScriptUtil::LuaArray<Vector4> param1 = ScriptUtil::getObjectPointer<Vector4>(2, "Vector4", true);
  3426. // Get parameter 2 off the stack.
  3427. unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);
  3428. Button* instance = getInstance(state);
  3429. instance->setSkinColor(*param1, param2);
  3430. return 0;
  3431. }
  3432. else
  3433. {
  3434. lua_pushstring(state, "lua_Button_setSkinColor - Failed to match the given parameters to a valid function signature.");
  3435. lua_error(state);
  3436. }
  3437. break;
  3438. }
  3439. default:
  3440. {
  3441. lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
  3442. lua_error(state);
  3443. break;
  3444. }
  3445. }
  3446. return 0;
  3447. }
  3448. int lua_Button_setSkinRegion(lua_State* state)
  3449. {
  3450. // Get the number of parameters.
  3451. int paramCount = lua_gettop(state);
  3452. // Attempt to match the parameters to a valid binding.
  3453. switch (paramCount)
  3454. {
  3455. case 2:
  3456. {
  3457. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3458. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  3459. {
  3460. // Get parameter 1 off the stack.
  3461. ScriptUtil::LuaArray<Rectangle> param1 = ScriptUtil::getObjectPointer<Rectangle>(2, "Rectangle", true);
  3462. Button* instance = getInstance(state);
  3463. instance->setSkinRegion(*param1);
  3464. return 0;
  3465. }
  3466. else
  3467. {
  3468. lua_pushstring(state, "lua_Button_setSkinRegion - Failed to match the given parameters to a valid function signature.");
  3469. lua_error(state);
  3470. }
  3471. break;
  3472. }
  3473. case 3:
  3474. {
  3475. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3476. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  3477. lua_type(state, 3) == LUA_TNUMBER)
  3478. {
  3479. // Get parameter 1 off the stack.
  3480. ScriptUtil::LuaArray<Rectangle> param1 = ScriptUtil::getObjectPointer<Rectangle>(2, "Rectangle", true);
  3481. // Get parameter 2 off the stack.
  3482. unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);
  3483. Button* instance = getInstance(state);
  3484. instance->setSkinRegion(*param1, param2);
  3485. return 0;
  3486. }
  3487. else
  3488. {
  3489. lua_pushstring(state, "lua_Button_setSkinRegion - Failed to match the given parameters to a valid function signature.");
  3490. lua_error(state);
  3491. }
  3492. break;
  3493. }
  3494. default:
  3495. {
  3496. lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
  3497. lua_error(state);
  3498. break;
  3499. }
  3500. }
  3501. return 0;
  3502. }
  3503. int lua_Button_setState(lua_State* state)
  3504. {
  3505. // Get the number of parameters.
  3506. int paramCount = lua_gettop(state);
  3507. // Attempt to match the parameters to a valid binding.
  3508. switch (paramCount)
  3509. {
  3510. case 2:
  3511. {
  3512. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3513. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  3514. {
  3515. // Get parameter 1 off the stack.
  3516. Control::State param1 = (Control::State)lua_enumFromString_ControlState(luaL_checkstring(state, 2));
  3517. Button* instance = getInstance(state);
  3518. instance->setState(param1);
  3519. return 0;
  3520. }
  3521. else
  3522. {
  3523. lua_pushstring(state, "lua_Button_setState - Failed to match the given parameters to a valid function signature.");
  3524. lua_error(state);
  3525. }
  3526. break;
  3527. }
  3528. default:
  3529. {
  3530. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  3531. lua_error(state);
  3532. break;
  3533. }
  3534. }
  3535. return 0;
  3536. }
  3537. int lua_Button_setStyle(lua_State* state)
  3538. {
  3539. // Get the number of parameters.
  3540. int paramCount = lua_gettop(state);
  3541. // Attempt to match the parameters to a valid binding.
  3542. switch (paramCount)
  3543. {
  3544. case 2:
  3545. {
  3546. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3547. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  3548. {
  3549. // Get parameter 1 off the stack.
  3550. ScriptUtil::LuaArray<Theme::Style> param1 = ScriptUtil::getObjectPointer<Theme::Style>(2, "ThemeStyle", false);
  3551. Button* instance = getInstance(state);
  3552. instance->setStyle(param1);
  3553. return 0;
  3554. }
  3555. else
  3556. {
  3557. lua_pushstring(state, "lua_Button_setStyle - Failed to match the given parameters to a valid function signature.");
  3558. lua_error(state);
  3559. }
  3560. break;
  3561. }
  3562. default:
  3563. {
  3564. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  3565. lua_error(state);
  3566. break;
  3567. }
  3568. }
  3569. return 0;
  3570. }
  3571. int lua_Button_setText(lua_State* state)
  3572. {
  3573. // Get the number of parameters.
  3574. int paramCount = lua_gettop(state);
  3575. // Attempt to match the parameters to a valid binding.
  3576. switch (paramCount)
  3577. {
  3578. case 2:
  3579. {
  3580. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3581. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  3582. {
  3583. // Get parameter 1 off the stack.
  3584. ScriptUtil::LuaArray<const char> param1 = ScriptUtil::getString(2, false);
  3585. Button* instance = getInstance(state);
  3586. instance->setText(param1);
  3587. return 0;
  3588. }
  3589. else
  3590. {
  3591. lua_pushstring(state, "lua_Button_setText - Failed to match the given parameters to a valid function signature.");
  3592. lua_error(state);
  3593. }
  3594. break;
  3595. }
  3596. default:
  3597. {
  3598. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  3599. lua_error(state);
  3600. break;
  3601. }
  3602. }
  3603. return 0;
  3604. }
  3605. int lua_Button_setTextAlignment(lua_State* state)
  3606. {
  3607. // Get the number of parameters.
  3608. int paramCount = lua_gettop(state);
  3609. // Attempt to match the parameters to a valid binding.
  3610. switch (paramCount)
  3611. {
  3612. case 2:
  3613. {
  3614. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3615. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL))
  3616. {
  3617. // Get parameter 1 off the stack.
  3618. Font::Justify param1 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 2));
  3619. Button* instance = getInstance(state);
  3620. instance->setTextAlignment(param1);
  3621. return 0;
  3622. }
  3623. else
  3624. {
  3625. lua_pushstring(state, "lua_Button_setTextAlignment - Failed to match the given parameters to a valid function signature.");
  3626. lua_error(state);
  3627. }
  3628. break;
  3629. }
  3630. case 3:
  3631. {
  3632. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3633. (lua_type(state, 2) == LUA_TSTRING || lua_type(state, 2) == LUA_TNIL) &&
  3634. lua_type(state, 3) == LUA_TNUMBER)
  3635. {
  3636. // Get parameter 1 off the stack.
  3637. Font::Justify param1 = (Font::Justify)lua_enumFromString_FontJustify(luaL_checkstring(state, 2));
  3638. // Get parameter 2 off the stack.
  3639. unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);
  3640. Button* instance = getInstance(state);
  3641. instance->setTextAlignment(param1, param2);
  3642. return 0;
  3643. }
  3644. else
  3645. {
  3646. lua_pushstring(state, "lua_Button_setTextAlignment - Failed to match the given parameters to a valid function signature.");
  3647. lua_error(state);
  3648. }
  3649. break;
  3650. }
  3651. default:
  3652. {
  3653. lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
  3654. lua_error(state);
  3655. break;
  3656. }
  3657. }
  3658. return 0;
  3659. }
  3660. int lua_Button_setTextColor(lua_State* state)
  3661. {
  3662. // Get the number of parameters.
  3663. int paramCount = lua_gettop(state);
  3664. // Attempt to match the parameters to a valid binding.
  3665. switch (paramCount)
  3666. {
  3667. case 2:
  3668. {
  3669. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3670. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL))
  3671. {
  3672. // Get parameter 1 off the stack.
  3673. ScriptUtil::LuaArray<Vector4> param1 = ScriptUtil::getObjectPointer<Vector4>(2, "Vector4", true);
  3674. Button* instance = getInstance(state);
  3675. instance->setTextColor(*param1);
  3676. return 0;
  3677. }
  3678. else
  3679. {
  3680. lua_pushstring(state, "lua_Button_setTextColor - Failed to match the given parameters to a valid function signature.");
  3681. lua_error(state);
  3682. }
  3683. break;
  3684. }
  3685. case 3:
  3686. {
  3687. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3688. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TNIL) &&
  3689. lua_type(state, 3) == LUA_TNUMBER)
  3690. {
  3691. // Get parameter 1 off the stack.
  3692. ScriptUtil::LuaArray<Vector4> param1 = ScriptUtil::getObjectPointer<Vector4>(2, "Vector4", true);
  3693. // Get parameter 2 off the stack.
  3694. unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);
  3695. Button* instance = getInstance(state);
  3696. instance->setTextColor(*param1, param2);
  3697. return 0;
  3698. }
  3699. else
  3700. {
  3701. lua_pushstring(state, "lua_Button_setTextColor - Failed to match the given parameters to a valid function signature.");
  3702. lua_error(state);
  3703. }
  3704. break;
  3705. }
  3706. default:
  3707. {
  3708. lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
  3709. lua_error(state);
  3710. break;
  3711. }
  3712. }
  3713. return 0;
  3714. }
  3715. int lua_Button_setTextRightToLeft(lua_State* state)
  3716. {
  3717. // Get the number of parameters.
  3718. int paramCount = lua_gettop(state);
  3719. // Attempt to match the parameters to a valid binding.
  3720. switch (paramCount)
  3721. {
  3722. case 2:
  3723. {
  3724. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3725. lua_type(state, 2) == LUA_TBOOLEAN)
  3726. {
  3727. // Get parameter 1 off the stack.
  3728. bool param1 = ScriptUtil::luaCheckBool(state, 2);
  3729. Button* instance = getInstance(state);
  3730. instance->setTextRightToLeft(param1);
  3731. return 0;
  3732. }
  3733. else
  3734. {
  3735. lua_pushstring(state, "lua_Button_setTextRightToLeft - Failed to match the given parameters to a valid function signature.");
  3736. lua_error(state);
  3737. }
  3738. break;
  3739. }
  3740. case 3:
  3741. {
  3742. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3743. lua_type(state, 2) == LUA_TBOOLEAN &&
  3744. lua_type(state, 3) == LUA_TNUMBER)
  3745. {
  3746. // Get parameter 1 off the stack.
  3747. bool param1 = ScriptUtil::luaCheckBool(state, 2);
  3748. // Get parameter 2 off the stack.
  3749. unsigned char param2 = (unsigned char)luaL_checkunsigned(state, 3);
  3750. Button* instance = getInstance(state);
  3751. instance->setTextRightToLeft(param1, param2);
  3752. return 0;
  3753. }
  3754. else
  3755. {
  3756. lua_pushstring(state, "lua_Button_setTextRightToLeft - Failed to match the given parameters to a valid function signature.");
  3757. lua_error(state);
  3758. }
  3759. break;
  3760. }
  3761. default:
  3762. {
  3763. lua_pushstring(state, "Invalid number of parameters (expected 2 or 3).");
  3764. lua_error(state);
  3765. break;
  3766. }
  3767. }
  3768. return 0;
  3769. }
  3770. int lua_Button_setZIndex(lua_State* state)
  3771. {
  3772. // Get the number of parameters.
  3773. int paramCount = lua_gettop(state);
  3774. // Attempt to match the parameters to a valid binding.
  3775. switch (paramCount)
  3776. {
  3777. case 2:
  3778. {
  3779. if ((lua_type(state, 1) == LUA_TUSERDATA) &&
  3780. lua_type(state, 2) == LUA_TNUMBER)
  3781. {
  3782. // Get parameter 1 off the stack.
  3783. int param1 = (int)luaL_checkint(state, 2);
  3784. Button* instance = getInstance(state);
  3785. instance->setZIndex(param1);
  3786. return 0;
  3787. }
  3788. else
  3789. {
  3790. lua_pushstring(state, "lua_Button_setZIndex - Failed to match the given parameters to a valid function signature.");
  3791. lua_error(state);
  3792. }
  3793. break;
  3794. }
  3795. default:
  3796. {
  3797. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  3798. lua_error(state);
  3799. break;
  3800. }
  3801. }
  3802. return 0;
  3803. }
  3804. int lua_Button_static_ANIMATE_OPACITY(lua_State* state)
  3805. {
  3806. // Validate the number of parameters.
  3807. if (lua_gettop(state) > 0)
  3808. {
  3809. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  3810. lua_error(state);
  3811. }
  3812. int result = Button::ANIMATE_OPACITY;
  3813. // Push the return value onto the stack.
  3814. lua_pushinteger(state, result);
  3815. return 1;
  3816. }
  3817. int lua_Button_static_ANIMATE_POSITION(lua_State* state)
  3818. {
  3819. // Validate the number of parameters.
  3820. if (lua_gettop(state) > 0)
  3821. {
  3822. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  3823. lua_error(state);
  3824. }
  3825. int result = Button::ANIMATE_POSITION;
  3826. // Push the return value onto the stack.
  3827. lua_pushinteger(state, result);
  3828. return 1;
  3829. }
  3830. int lua_Button_static_ANIMATE_POSITION_X(lua_State* state)
  3831. {
  3832. // Validate the number of parameters.
  3833. if (lua_gettop(state) > 0)
  3834. {
  3835. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  3836. lua_error(state);
  3837. }
  3838. int result = Button::ANIMATE_POSITION_X;
  3839. // Push the return value onto the stack.
  3840. lua_pushinteger(state, result);
  3841. return 1;
  3842. }
  3843. int lua_Button_static_ANIMATE_POSITION_Y(lua_State* state)
  3844. {
  3845. // Validate the number of parameters.
  3846. if (lua_gettop(state) > 0)
  3847. {
  3848. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  3849. lua_error(state);
  3850. }
  3851. int result = Button::ANIMATE_POSITION_Y;
  3852. // Push the return value onto the stack.
  3853. lua_pushinteger(state, result);
  3854. return 1;
  3855. }
  3856. int lua_Button_static_ANIMATE_SIZE(lua_State* state)
  3857. {
  3858. // Validate the number of parameters.
  3859. if (lua_gettop(state) > 0)
  3860. {
  3861. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  3862. lua_error(state);
  3863. }
  3864. int result = Button::ANIMATE_SIZE;
  3865. // Push the return value onto the stack.
  3866. lua_pushinteger(state, result);
  3867. return 1;
  3868. }
  3869. int lua_Button_static_ANIMATE_SIZE_HEIGHT(lua_State* state)
  3870. {
  3871. // Validate the number of parameters.
  3872. if (lua_gettop(state) > 0)
  3873. {
  3874. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  3875. lua_error(state);
  3876. }
  3877. int result = Button::ANIMATE_SIZE_HEIGHT;
  3878. // Push the return value onto the stack.
  3879. lua_pushinteger(state, result);
  3880. return 1;
  3881. }
  3882. int lua_Button_static_ANIMATE_SIZE_WIDTH(lua_State* state)
  3883. {
  3884. // Validate the number of parameters.
  3885. if (lua_gettop(state) > 0)
  3886. {
  3887. lua_pushstring(state, "Invalid number of parameters (expected 0).");
  3888. lua_error(state);
  3889. }
  3890. int result = Button::ANIMATE_SIZE_WIDTH;
  3891. // Push the return value onto the stack.
  3892. lua_pushinteger(state, result);
  3893. return 1;
  3894. }
  3895. int lua_Button_static_create(lua_State* state)
  3896. {
  3897. // Get the number of parameters.
  3898. int paramCount = lua_gettop(state);
  3899. // Attempt to match the parameters to a valid binding.
  3900. switch (paramCount)
  3901. {
  3902. case 2:
  3903. {
  3904. if ((lua_type(state, 1) == LUA_TSTRING || lua_type(state, 1) == LUA_TNIL) &&
  3905. (lua_type(state, 2) == LUA_TUSERDATA || lua_type(state, 2) == LUA_TTABLE || lua_type(state, 2) == LUA_TNIL))
  3906. {
  3907. // Get parameter 1 off the stack.
  3908. ScriptUtil::LuaArray<const char> param1 = ScriptUtil::getString(1, false);
  3909. // Get parameter 2 off the stack.
  3910. ScriptUtil::LuaArray<Theme::Style> param2 = ScriptUtil::getObjectPointer<Theme::Style>(2, "ThemeStyle", false);
  3911. void* returnPtr = (void*)Button::create(param1, param2);
  3912. if (returnPtr)
  3913. {
  3914. ScriptUtil::LuaObject* object = (ScriptUtil::LuaObject*)lua_newuserdata(state, sizeof(ScriptUtil::LuaObject));
  3915. object->instance = returnPtr;
  3916. object->owns = true;
  3917. luaL_getmetatable(state, "Button");
  3918. lua_setmetatable(state, -2);
  3919. }
  3920. else
  3921. {
  3922. lua_pushnil(state);
  3923. }
  3924. return 1;
  3925. }
  3926. else
  3927. {
  3928. lua_pushstring(state, "lua_Button_static_create - Failed to match the given parameters to a valid function signature.");
  3929. lua_error(state);
  3930. }
  3931. break;
  3932. }
  3933. default:
  3934. {
  3935. lua_pushstring(state, "Invalid number of parameters (expected 2).");
  3936. lua_error(state);
  3937. break;
  3938. }
  3939. }
  3940. return 0;
  3941. }
  3942. }