lua_Joystick.cpp 135 KB

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