lua_Button.cpp 153 KB

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