lua_Control.cpp 139 KB

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