lua_Button.cpp 150 KB

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