lua_Joystick.cpp 152 KB

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