lua_Button.cpp 139 KB

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