lua_Button.cpp 148 KB

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