lua_Button.cpp 151 KB

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