*/}}

la_interface.h 87 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778
  1. /*
  2. * LaGUI: A graphical application framework.
  3. * Copyright (C) 2022-2023 Wu Yiming
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #pragma once
  19. #ifdef LAGUI_ANDROID
  20. #include <GLES3/gl32.h>
  21. #include <EGL/egl.h>
  22. #include <android/input.h>
  23. #include <android/keycodes.h>
  24. #else
  25. #ifdef LA_USE_GLES
  26. #include <EGL/egl.h>
  27. #include <GL/gl.h>
  28. #else
  29. #include <GL/glew.h>
  30. #include <GL/gl.h>
  31. #endif
  32. #endif
  33. #ifdef __linux__
  34. #ifndef LAGUI_ANDROID
  35. #include <X11/Xlib.h>
  36. #include <X11/Xutil.h>
  37. #include <X11/Xresource.h>
  38. #include <X11/Xlocale.h>
  39. #include <X11/XKBlib.h>
  40. #include <X11/Xatom.h>
  41. #include <GL/glx.h>
  42. #include <GL/glext.h>
  43. #endif
  44. #endif
  45. #ifdef _WIN32
  46. #include <GL/wglew.h>
  47. #endif
  48. #include "la_5.h"
  49. #include "la_data.h"
  50. //#include "llvm-c/Analysis.h"
  51. //#include "llvm-c/BitWriter.h"
  52. //#include "llvm-c/Core.h"
  53. //#include "llvm-c/ExecutionEngine.h"
  54. //#include "llvm-c/Target.h"
  55. //#include <Windows.h>
  56. #define LA_VERSION_MAIN 5
  57. #define LA_VERSION_SUB 3
  58. #define LA_ACTUATOR_CAPABILITY_MAIN 5
  59. #define LA_ACTUATOR_CAPABILITY_SUB 0
  60. #define LA_NODE_MAIN_MODULE_NAME "LA_NODE_MAIN_MODULE"
  61. #define LA_GUI_WNDCLASS_NAME "LA_WINDOW_CLASS"
  62. #define LA_ARROW 0
  63. #define LA_CROSS 1
  64. #define LA_LEFT_AND_RIGHT 2
  65. #define LA_UP_AND_DOWN 3
  66. #define LA_HAND 4
  67. #define LA_MOVE 5
  68. #define LA_CORNER 6
  69. #define EVT_WND_MOVE -1
  70. #define EVT_WND_SIZE_BEGIN -2
  71. #define EVT_WND_SIZE_FINISH -3
  72. #define EVT_WND_SIZE -4
  73. #define EVT_WND_SHOW -5
  74. #define EVT_FEEDBACK 8192
  75. #define LA_KEYBOARD_EVENT (1<<0)
  76. #define LA_MOUSE_EVENT (1<<1)
  77. #define LA_STATE_MOVE (1<<2)
  78. #define LA_STATE_DOWN (1<<3)
  79. #define LA_STATE_UP (1<<4)
  80. #define LA_TIME_EVENT (1<<5)
  81. #define LA_TIME_IDLE (LA_TIME_EVENT|(1<<6))
  82. #define LA_TIME_DELAY (LA_TIME_EVENT|(1<<7))
  83. #define LA_KEY_MOUSE_LEFT (1<<8)
  84. #define LA_KEY_MOUSE_MIDDLE (1<<9)
  85. #define LA_KEY_MOUSE_RIGHT (1<<10)
  86. #define LA_KEY_MOUSE_SCROLL (1<<11)
  87. #define LA_KEY_BACKSPACE (1<<12)
  88. #define LA_KEY_ESCAPE (1<<13)
  89. #define LA_KEY_ENTER (1<<14)
  90. #define LA_INPUT (1<<15)
  91. #define LA_KEY_ARRLEFT (1<<16)
  92. #define LA_KEY_ARRRIGHT (1<<17)
  93. #define LA_KEY_ARRUP (1<<18)
  94. #define LA_KEY_ARRDOWN (1<<19)
  95. #define LA_KEY_SHIFT (1<<20)
  96. #define LA_KEY_CTRL (1<<21)
  97. #define LA_KEY_ALT (1<<22)
  98. #define LA_KEY_DELETE (1<<23)
  99. #define LA_KEY_TAB (1<<24)
  100. #define LA_KEY_EXTRA (1<<25)
  101. #define LA_KEY_NUM1 (LA_KEY_EXTRA+1)
  102. #define LA_KEY_NUM2 (LA_KEY_EXTRA+2)
  103. #define LA_KEY_NUM3 (LA_KEY_EXTRA+3)
  104. #define LA_KEY_NUM4 (LA_KEY_EXTRA+4)
  105. #define LA_KEY_NUM5 (LA_KEY_EXTRA+5)
  106. #define LA_KEY_NUM6 (LA_KEY_EXTRA+6)
  107. #define LA_KEY_NUM7 (LA_KEY_EXTRA+7)
  108. #define LA_KEY_NUM8 (LA_KEY_EXTRA+8)
  109. #define LA_KEY_NUM9 (LA_KEY_EXTRA+9)
  110. #define LA_KEY_NUM0 (LA_KEY_EXTRA+10)
  111. #define LA_KEY_NUMPLUS (LA_KEY_EXTRA+11)
  112. #define LA_KEY_NUMMINUS (LA_KEY_EXTRA+12)
  113. #define LA_KEY_NUMMULT (LA_KEY_EXTRA+13)
  114. #define LA_KEY_NUMDIVIDE (LA_KEY_EXTRA+14)
  115. #define LA_KEY_NUMDOT (LA_KEY_EXTRA+15)
  116. #define LA_KEY_NUMENTER (LA_KEY_EXTRA+16)
  117. #define LA_KEY_PANNING (1<<26)
  118. #define LA_SIGNAL_EVENT (1<<31)
  119. #ifdef _WIN32
  120. #define XK_F1 1
  121. #define XK_F2 2
  122. #define XK_F3 3
  123. #define XK_F4 4
  124. #define XK_F5 5
  125. #define XK_F6 6
  126. #define XK_F7 7
  127. #define XK_F8 8
  128. #define XK_F9 9
  129. #define XK_F10 10
  130. #define XK_F11 11
  131. #define XK_F12 12
  132. #endif
  133. #if defined(LA_LINUX) || defined(_WIN32)
  134. #define LA_KEY_F1 XK_F1
  135. #define LA_KEY_F2 XK_F2
  136. #define LA_KEY_F3 XK_F3
  137. #define LA_KEY_F4 XK_F4
  138. #define LA_KEY_F5 XK_F5
  139. #define LA_KEY_F6 XK_F6
  140. #define LA_KEY_F7 XK_F7
  141. #define LA_KEY_F8 XK_F8
  142. #define LA_KEY_F9 XK_F9
  143. #define LA_KEY_F10 XK_F10
  144. #define LA_KEY_F11 XK_F11
  145. #define LA_KEY_F12 XK_F12
  146. #endif
  147. #ifdef LAGUI_ANDROID
  148. #define LA_KEY_F1 AKEYCODE_F1
  149. #define LA_KEY_F2 AKEYCODE_F2
  150. #define LA_KEY_F3 AKEYCODE_F3
  151. #define LA_KEY_F4 AKEYCODE_F4
  152. #define LA_KEY_F5 AKEYCODE_F5
  153. #define LA_KEY_F6 AKEYCODE_F6
  154. #define LA_KEY_F7 AKEYCODE_F7
  155. #define LA_KEY_F8 AKEYCODE_F8
  156. #define LA_KEY_F9 AKEYCODE_F9
  157. #define LA_KEY_F10 AKEYCODE_F10
  158. #define LA_KEY_F11 AKEYCODE_F11
  159. #define LA_KEY_F12 AKEYCODE_F12
  160. #endif
  161. #define LA_KEY_SPECIALS (LA_KEY_CTRL|LA_KEY_SHIFT|LA_KEY_ALT)
  162. #define LA_MOUSEMOVE (LA_MOUSE_EVENT | LA_STATE_MOVE)
  163. #define LA_EMPTY LA_MOUSEMOVE
  164. #define LA_MOUSEDOWN (LA_MOUSE_EVENT | LA_STATE_DOWN)
  165. #define LA_MOUSEUP (LA_MOUSE_EVENT | LA_STATE_UP)
  166. #define LA_WHEEL (LA_MOUSE_EVENT | LA_KEY_MOUSE_SCROLL)
  167. #define LA_L_MOUSE_DOWN (LA_MOUSE_EVENT | LA_STATE_DOWN | LA_KEY_MOUSE_LEFT)
  168. #define LA_L_MOUSE_UP (LA_MOUSE_EVENT | LA_STATE_UP | LA_KEY_MOUSE_LEFT)
  169. #define LA_M_MOUSE_DOWN (LA_MOUSE_EVENT | LA_STATE_DOWN | LA_KEY_MOUSE_MIDDLE)
  170. #define LA_M_MOUSE_UP (LA_MOUSE_EVENT | LA_STATE_UP | LA_KEY_MOUSE_MIDDLE)
  171. #define LA_R_MOUSE_DOWN (LA_MOUSE_EVENT | LA_STATE_DOWN | LA_KEY_MOUSE_RIGHT)
  172. #define LA_R_MOUSE_UP (LA_MOUSE_EVENT | LA_STATE_UP | LA_KEY_MOUSE_RIGHT)
  173. #define LA_MOUSE_WHEEL_DOWN (LA_MOUSE_EVENT | LA_STATE_DOWN | LA_KEY_MOUSE_SCROLL)
  174. #define LA_MOUSE_WHEEL_UP (LA_MOUSE_EVENT | LA_STATE_UP | LA_KEY_MOUSE_SCROLL)
  175. #define LA_KEY_DOWN (LA_KEYBOARD_EVENT | LA_STATE_DOWN)
  176. #define LA_KEY_UP (LA_KEYBOARD_EVENT | LA_STATE_UP)
  177. #define LA_PANNING_LEFT (LA_KEYBOARD_EVENT | LA_KEY_PANNING | LA_KEY_ARRLEFT)
  178. #define LA_PANNING_RIGHT (LA_KEYBOARD_EVENT | LA_KEY_PANNING | LA_KEY_ARRRIGHT)
  179. #define LA_PANNING_UP (LA_KEYBOARD_EVENT | LA_KEY_PANNING | LA_KEY_ARRUP)
  180. #define LA_PANNING_DOWN (LA_KEYBOARD_EVENT | LA_KEY_PANNING | LA_KEY_ARRDOWN)
  181. #define LA_LEFT_DOWN (LA_KEYBOARD_EVENT | LA_KEY_ARRLEFT | LA_STATE_DOWN)
  182. #define LA_RIGHT_DOWN (LA_KEYBOARD_EVENT | LA_KEY_ARRRIGHT | LA_STATE_DOWN)
  183. #define LA_UP_DOWN (LA_KEYBOARD_EVENT | LA_KEY_ARRUP | LA_STATE_DOWN)
  184. #define LA_DOWN_DOWN (LA_KEYBOARD_EVENT | LA_KEY_ARRDOWN | LA_STATE_DOWN)
  185. #define LA_LEFT_UP (LA_KEYBOARD_EVENT | LA_KEY_ARRLEFT | LA_STATE_UP)
  186. #define LA_RIGHT_UP (LA_KEYBOARD_EVENT | LA_KEY_ARRRIGHT | LA_STATE_UP)
  187. #define LA_UP_UP (LA_KEYBOARD_EVENT | LA_KEY_ARRUP | LA_STATE_UP)
  188. #define LA_DOWN_UP (LA_KEYBOARD_EVENT | LA_KEY_ARRDOWN | LA_STATE_UP)
  189. #define LA_BACKSPACE_DOWN (LA_KEYBOARD_EVENT | LA_KEY_BACKSPACE | LA_STATE_DOWN)
  190. #define LA_BACKSPACE_UP (LA_KEYBOARD_EVENT | LA_KEY_BACKSPACE | LA_STATE_UP)
  191. #define LA_ESCAPE_DOWN (LA_KEYBOARD_EVENT | LA_KEY_ESCAPE | LA_STATE_DOWN)
  192. #define LA_ESCAPE_UP (LA_KEYBOARD_EVENT | LA_KEY_ESCAPE | LA_STATE_UP)
  193. #define LA_ENTER_DOWN (LA_KEYBOARD_EVENT | LA_KEY_ENTER | LA_STATE_DOWN)
  194. #define LA_ENTER_UP (LA_KEYBOARD_EVENT | LA_KEY_ENTER | LA_STATE_UP)
  195. #define LA_ONLY_BITS_AND(orig, yours) \
  196. ((orig & yours) == yours)
  197. NEED_STRUCTURE(laUiList);
  198. NEED_STRUCTURE(laUiItem);
  199. NEED_STRUCTURE(laColumn);
  200. typedef void (*laUiDrawFunc)(void *, int); //Instance,Theme
  201. typedef void (*laPanelDrawFunc)(void *, void *, void *); //SYSWINDOW,Instance,Theme
  202. //typedef void(*laUiDefineFunc)(laUiList*,laPropPack*,laPropPack*,laColumn*);//uil,collection inst+"This" inst,actuator inst,Extra column list.
  203. typedef void (*laOperatorArgumentParserFunc)(laStringSplitor *, uint32_t *, char *); //icon id,display string buf
  204. typedef int (*laUiGetHeightFunc)(laUiItem *);
  205. typedef int (*laUiGetMinWidthFunc)(laUiItem *);
  206. typedef int (*laUiConditionFunc)(laPropPack *); //maybe inst+actuator,replaceInst
  207. typedef void (*laUiDestroyFunc)(laUiItem *);
  208. typedef void (*laUiInitFunc)(laUiItem *);
  209. typedef void (*laUiRefreshFunc)(laUiItem *);
  210. typedef void (*laLayoutBkgDrawFunc)(void *, void *l);
  211. typedef void (*laPreFrameF)();
  212. typedef void (*laPreDrawF)();
  213. typedef void (*laPostFrameF)();
  214. typedef void (*laCleanupF)();
  215. STRUCTURE(laEvent){
  216. laListItem Item;
  217. laWindow* window;
  218. int type;
  219. int state;
  220. int x, y;
  221. int key;
  222. int SpecialKeyBit;
  223. int p1, p2;
  224. uint32_t Input;
  225. int GoodPressure,IsEraser,HasTwist;
  226. real Pressure,Orientation,Deviation,Twist,Hover;
  227. void *Localized;
  228. };
  229. typedef int (*laInputProcessF)(laEvent* e);
  230. NEED_STRUCTURE(laWindow)
  231. NEED_STRUCTURE(laRoot)
  232. NEED_STRUCTURE(laPanel)
  233. NEED_STRUCTURE(laUiItem)
  234. NEED_STRUCTURE(laUiList)
  235. NEED_STRUCTURE(laAnimationAction)
  236. NEED_STRUCTURE(laUiDescriptor)
  237. NEED_STRUCTURE(laUiConditionNode)
  238. STRUCTURE(laSharedTypeItem){
  239. laListItem Item;
  240. char ID[64];
  241. void *Pointer;
  242. };
  243. NEED_STRUCTURE(laTranslation);
  244. NEED_STRUCTURE(laTheme);
  245. STRUCTURE(laKeyMapper){
  246. laListItem Item;//unused;
  247. laListHandle Items;
  248. };
  249. STRUCTURE(laLogEntry){
  250. laListItem Item;
  251. laSafeString* Content;
  252. int Type;
  253. };
  254. NEED_STRUCTURE(laManagedUDF);
  255. STRUCTURE(laNodeOutSocket){
  256. void* Data;
  257. void* Parent;
  258. laSafeString* Label;
  259. int DataType, ArrLen;
  260. int RuntimeX, RuntimeY, RuntimePX, RuntimePY;
  261. void* Duplicated;
  262. };
  263. STRUCTURE(laNodeInSocket){
  264. laNodeOutSocket* Source;
  265. laSafeString* Label;
  266. int DataType, ArrLen; int ColorId;
  267. int RuntimeX, RuntimeY, RuntimePX, RuntimePY;
  268. };
  269. NEED_STRUCTURE(laBaseNodeType);
  270. NEED_STRUCTURE(laRackPage);
  271. NEED_STRUCTURE(laNodeCategory);
  272. STRUCTURE(laRackPageCollection){
  273. laRackPage* CurrentPage;
  274. laListHandle Pages;
  275. };
  276. typedef laBaseNodeType* (*laGetBaseNodeTypeF)(char* str);
  277. NEED_STRUCTURE(laConfirmData);
  278. STRUCTURE(laExtraPreferencePage){
  279. laListItem Item;
  280. const char* Name;
  281. laUiDefineFunc Func;
  282. };
  283. STRUCTURE(laProgressDisplay){
  284. char String[256];
  285. SYSWINDOW w;
  286. #ifdef LA_LINUX
  287. GC gc;
  288. XGCValues gc_values;
  289. #endif
  290. #ifdef _WIN32
  291. HBRUSH brush_bg;
  292. HBRUSH brush_fg;
  293. HPEN pen_fg;
  294. HDC hdc;
  295. #endif
  296. laTimeRecorder TimeCalled;
  297. real p1,p2;
  298. int Called,Shown;
  299. };
  300. STRUCTURE(laInitArguments){
  301. int GLMajor,GLMinor,BufferSamples;
  302. int GLESMajor,GLESMinor;
  303. int UseColorManagement;
  304. int HasWorldObjects;
  305. int HasAction;
  306. int HasTextureInspector;
  307. int HasHistories;
  308. int HasTerminal;
  309. int HasAudio;
  310. int GLDebug;
  311. int EnableLogStdOut;
  312. };
  313. NEED_STRUCTURE(laAnimation);
  314. NEED_STRUCTURE(laAudio);
  315. NEED_STRUCTURE(laInputMappingBundle);
  316. STRUCTURE(LA){
  317. laListItem Hyper;
  318. laListHandle Logs;
  319. real PerfCounter[32][32];
  320. laSafeString* PerfLogs[32];
  321. int NextPerfCounter,NextPerfGroup,ShowPerf;
  322. laTimeRecorder FrameStartTime, FrameEndTime;
  323. char* TerminalInput[512];
  324. laListHandle TerminalHistories;
  325. int TerminalIncomplete;
  326. int IsTerminalEnter;
  327. #ifdef LA_WITH_LUAJIT
  328. lua_State *L;
  329. #endif
  330. laListHandle Controllers; int NextControllerID;
  331. u8bit LastControllerKey, LastControllerKeyDevice, ControllerHasNewKey;
  332. u8bit LastControllerAxis, LastControllerAxisDevice, ControllerHasNewAxis;
  333. laEvent* CurrentInputEvent;
  334. laInputProcessF InputProcess;
  335. laListHandle Windows;
  336. laListHandle WastedPanels;
  337. laListHandle Screens;
  338. int AutoSwitchColorSpace;
  339. laConfirmData *InvokeConfirmData;
  340. laPreFrameF PreFrame;
  341. laPreDrawF PreDraw;
  342. laPostFrameF PostFrame;
  343. laCleanupF Cleanup;
  344. real IdleStart, DelayStart;
  345. int DelayTriggered;
  346. int IdleTriggered;
  347. int ReTriggerOperators;
  348. laPanel* DockingPanel;
  349. char SysFontDir[512];
  350. laInitArguments InitArgs;
  351. char *InputBuf; int InputBufNext, InputBufMax;
  352. int32_t *InputBufU; int InputBufUNext, InputBufUMax;
  353. #ifdef LA_LINUX
  354. Atom MsgDelWindow;
  355. Atom bufid;
  356. Atom fmtid;
  357. Atom propid;
  358. Atom incrid;
  359. Atom targets_atom;
  360. Atom text_atom;
  361. Atom UTF8;
  362. Atom selection;
  363. Atom wmstate,wmfullscr,wmfullscroff;
  364. #endif
  365. laSafeString* CopyPending;
  366. int GLMajor,GLMinor,GLESMajor,GLESMinor,BufferSamples;
  367. GLuint TempVAO;
  368. SYSTEMDISPLAY* dpy;
  369. SYSGLCONTEXT glc;
  370. #ifdef _WIN32
  371. HINSTANCE hinstance;
  372. HDC hdc;
  373. int WinTabAvailable, WinTabOpened, WinTabMaxPenPressure, WinTabMaxEraserPressure, WinTabMaxHover;
  374. #endif
  375. #ifdef LA_LINUX
  376. Window* win;
  377. XVisualInfo* xvi;
  378. #ifdef LA_USE_GLES
  379. EGLConfig BestFBC;
  380. EGLDisplay egl_dpy;
  381. #else
  382. GLXFBConfig BestFBC;
  383. #endif
  384. Colormap cmap;
  385. XIM im;
  386. XIC ic;
  387. int xi_opcode;
  388. #endif
  389. #ifdef LAGUI_ANDROID
  390. SYSWINDOW* win;
  391. EGLConfig BestFBC;
  392. EGLDisplay egl_dpy;
  393. EGLSurface egl_surf;
  394. struct android_app* app;
  395. struct android_poll_source *event_source;
  396. int AppWidth,AppHeight;
  397. int AppReady,AppEnabled;
  398. int ContextRebindRequired;
  399. AAssetManager *AssetManager;
  400. char *InternalDataPath;
  401. char *ExternalDataPath;
  402. #endif
  403. int InkOrWinTab;
  404. int WacomDeviceStylus; real StylusPressure, StylusOrientation, StylusDeviation, StylusMaxPressure;
  405. int WacomDeviceEraser; real EraserPressure, EraserOrientation, EraserDeviation, EraserMaxPressure;
  406. int StylusHasTwist; real StylusTwist; real StylusHover;
  407. int PointerIsEraser,IsPen;
  408. int evLastX,evLastY;
  409. int EnableColorManagement;
  410. int EnableLogStdOut;
  411. int EnableGLDebug;
  412. int GLDebugSync;
  413. int GLDebugLevel;
  414. int GLDebugNeedsUpdate;
  415. int CurrentCursor;
  416. laWindow *CurrentWindow;
  417. laPanel *CurrentPanel;
  418. laListHandle DeferredRedrawList;
  419. laProgressDisplay Progress;
  420. laAudio* Audio;
  421. int InitDone;
  422. int IsReadingUDF;
  423. int SavePreferenceOnExit;
  424. laKeyMapper KeyMap;
  425. laHash256 OperatorTypeHash;
  426. //laHash256 CustomCommandHash;
  427. laSafeString* SignalFilter;
  428. laListHandle CustomSignals;
  429. laSafeString* ThumbnailProp;
  430. laListHandle ExtraExtensions;
  431. laListHandle ExtraPreferencePaths;
  432. laListHandle ExtraPreferencePages;
  433. laUiDefineFunc PreferencePageDisplay;
  434. laUiDefineFunc PreferencePageInput;
  435. laUiDefineFunc PreferencePageResource;
  436. laUiDefineFunc PreferencePageTheme;
  437. laPropContainer *GeneralIntSub;
  438. laPropContainer *GeneralFloatSub;
  439. laPropContainer *GeneralEnumSub;
  440. laPropContainer *GeneralIntArraySub;
  441. laPropContainer *GeneralFloatArraySub;
  442. laPropContainer *GeneralEnumArraySub;
  443. laPropContainer *GeneralStringSub;
  444. laPropContainer *GeneralOperatorSub;
  445. laPropContainer *GeneralCollectionSub;
  446. laPropContainer *GeneralRawSub;
  447. laPropContainer *ContainerInt;
  448. laPropContainer *ContainerFloat;
  449. laPropContainer *ContainerEnum;
  450. laPropContainer *ContainerString;
  451. laPropContainer *ContainerOperator;
  452. laPropContainer *ContainerCollection;
  453. laPropContainer *_CONTAINER_SETTING;
  454. laProp *_PROP_SETTING;
  455. laPropContainer *_CONTAINER_SETTING_PROPAGATE_TO;
  456. void *_CONTAINER_SETTING_INSTANCE;
  457. laListHandle PropContainers;
  458. laRoot DataRoot;
  459. laPanel *PropMatcherContextP;
  460. laPanel* PendingSplash;
  461. laTheme* CurrentTheme;
  462. laListHandle Themes;
  463. laListHandle UiTypes;
  464. laListHandle InitPanelTemplates;
  465. laListHandle PanelTemplates;
  466. laListHandle View2DTemplates;
  467. laUiDefineFunc MenuButtons;
  468. laUiDefineFunc MenuExtras;
  469. laUiDefineFunc AboutContent;
  470. laUiDefineFunc AboutVersion;
  471. laUiDefineFunc AboutAuthor;
  472. const char* MenuProgramName;
  473. SYSLOCK MemLock;
  474. SYSLOCK OpsLock;
  475. laHash256 GlobalMemPool;
  476. int ByteCount;
  477. int TotalByteCount;
  478. laHash65536* DBInstMemLeft;// list item pointers
  479. laHash65536 DBInst2;
  480. laHash65536 DBInst1;
  481. laHash65536 PtrSync;
  482. laListHandle PtrSyncAddressCommands;
  483. laListHandle PtrSyncHyper2Commands;
  484. laListHandle PostReadNodes;
  485. laListHandle RenewHyper2s;
  486. laListHandle SharedTypePointerSync;
  487. laListHandle PendingResourceRequests;
  488. laListHandle ResourceFolders;
  489. laListHandle ResourceRegistries;
  490. laListHandle UDFResources;
  491. laListHandle ManagedUDFs;
  492. laListHandle ManagedSaveProps;
  493. laManagedUDF* DummyManageUDF;
  494. laManagedUDF* DummyManageUDFSingle;
  495. laManagedUDF* DummyManageUDFSingleForce;
  496. int ManagerDefaultView;
  497. int SetUDFPending;
  498. int ManagerFilterInstances;
  499. laPropContainer* SaverDummyContainer;
  500. laListHandle DBInstPendingAcquireDBP;
  501. laListHandle DBInstPendingAcquireDiffCMD;
  502. laListHandle DiffTouched;
  503. laListHandle Differences;
  504. laDiff* HeadDifference;
  505. laDBInst RootDBInst;
  506. laListHandle DBRecordedProps;
  507. laHash65536* DBInstLink;
  508. laDiffPushEverythingF PushEverything;
  509. laPreSaveF PreSave;
  510. laPostSaveF PostSave;
  511. laAnimation* Animation;
  512. real FontSize;
  513. real MarginSize;
  514. int UiRowHeight;
  515. int ScaledUiRowHeight;
  516. real UiScale;
  517. void *ToPanel;
  518. int NextX, NextY, NextW, NextH;
  519. laNodeInSocket* tNodeIn;
  520. laNodeOutSocket* tNodeOut;
  521. laAuthorInfo Author;
  522. laListHandle ExternalAuthors;
  523. laSafeString *WorkingDirectory;
  524. //SYSLOCK csNotifier;
  525. laListHandle ThreadNotifiers;
  526. //preference:
  527. laInputMappingBundle* InputMapping;
  528. //color
  529. real ColorPickerGamma;
  530. real ViewportHalftoneFactor;
  531. real ViewportHalftoneSize;
  532. int NextWireColor, WireColorSlices;
  533. real WireThickness;
  534. real WireSaggyness;
  535. real* WireColorCache;
  536. //user interactions:
  537. int TopFramerate;
  538. int ValuatorThreshold;
  539. int ScrollingSpeed;
  540. int TooltipCloseDistance;
  541. real ZoomSpeed2D;
  542. real IdleTime;
  543. real DelayTime;
  544. //translations:
  545. laTranslation Translation;
  546. //display:
  547. real FloatingAlpha;
  548. int SolidShadowLength;
  549. int EnableAnimation;
  550. real AnimationSpeed;
  551. real PanelAnimationSpeed;
  552. int PanelMultisample;
  553. real LastFrameTime;
  554. real TimeAccum;
  555. //animation:
  556. int DefaultKeyFrameMode;
  557. //laThemeColor *ConditionStackColors[6];
  558. laListHandle MediaFiles;
  559. int GraphNeedsRebuild; // current mechanism only allows global.
  560. int InputNeedsEval;
  561. laListHandle NodeCategories;
  562. laNodeCategory* CurrentNodeCategory;
  563. int FilterNodeCategory;
  564. laBaseNodeType** NodeTypes; int NodeTypeNext, NodeTypeMax;
  565. laUiDefineFunc ExtraAddInputNodes;
  566. laUiDefineFunc ExtraAddDriverNodes;
  567. laGetBaseNodeTypeF ExtraGetInputNodeType;
  568. laGetBaseNodeTypeF ExtraGetDriverNodeType;
  569. //laHash256 RootNodes;
  570. //LLVMContextRef llvmContext;
  571. //LLVMModuleRef llvmModule;
  572. //SYSLOCK csMediaPlay;
  573. int DetachedViewSwitch;
  574. int example_int;
  575. laSafeString* example_string;
  576. };
  577. #define LA_KM_SEL_UI_EXTRA 1
  578. #define LA_KM_SEL_PANEL 2
  579. STRUCTURE(laKeyMapItem){
  580. laListItem Item;
  581. int SpecialKeyBits;
  582. int EventType;
  583. int Key;
  584. char SelectBase;
  585. laPropPack Base;
  586. laPropPack Action;
  587. laSafeString *Operation;
  588. laSafeString *Instructions;
  589. };
  590. STRUCTURE(laScreen){
  591. laListItem Item;
  592. laSafeString* Name;
  593. laSafeString* Description;
  594. int RoughDPI;
  595. int ColorSpace;
  596. int x,y,w,h;
  597. };
  598. NEED_STRUCTURE(laLayout);
  599. NEED_STRUCTURE(laBlock);
  600. NEED_STRUCTURE(laPanel);
  601. NEED_STRUCTURE(laUiItem);
  602. STRUCTURE(laWindow){
  603. laListItem Item;
  604. SYSWINDOW* win;
  605. SYSGLCONTEXT glc;
  606. #if defined(LA_USE_GLES) && !defined(LAGUI_ANDROID)
  607. EGLSurface egl_surf;
  608. #endif
  609. int GLDebugNeedsUpdate;
  610. GLuint vao;
  611. struct NVGcontext* nvg;
  612. #ifdef _WIN32
  613. HDC hdc;
  614. #endif
  615. int X,Y,W,H;
  616. int CW,CH;
  617. int Activated;
  618. int Shown;
  619. int IsDocking;
  620. int OutputColorSpace;
  621. int OutputShowStripes;
  622. int UseComposing; real ComposingGamma,ComposingBlackpoint;
  623. int IsFullScreen;
  624. int Redraw;
  625. int RedrawTouched;
  626. laPropPack PP;
  627. laPropStep FakePS;
  628. laSafeString *Title;
  629. laWindow* DockingFrom;
  630. laListHandle EventList;
  631. laSafeString *OperatorHints;
  632. laListHandle Layouts;
  633. laLayout *CurrentLayout;
  634. laBlock *MaximizedBlock;
  635. laPanel *MaximizedUiPanel;
  636. laUiItem *MaximizedUi;
  637. laListHandle Panels;
  638. laListHandle FadingPanels;
  639. laListHandle Operators;
  640. laListHandle PendingOperators;
  641. laUiDrawFunc Draw;
  642. };
  643. STRUCTURE(laBlock){
  644. int X, Y, W, H;
  645. laBlock *B1;
  646. laBlock *B2;
  647. laBlock *parent;
  648. laPanel *CurrentPanel;
  649. laListHandle Panels;
  650. int Vertical;
  651. int Folded;
  652. real SplitRatio; // From Left/Top;
  653. laPropPack PP;
  654. laPropPack FakePS;
  655. int OnButton;
  656. };
  657. #define LA_BLOCK_DROP_LOCATION_L 1
  658. #define LA_BLOCK_DROP_LOCATION_R 2
  659. #define LA_BLOCK_DROP_LOCATION_U 3
  660. #define LA_BLOCK_DROP_LOCATION_B 4
  661. STRUCTURE(laLayout){
  662. laListItem Item;
  663. laBlock *OperatingBlock;
  664. laBlock *FirstBlock;
  665. laBlock *MovingBlock;
  666. int IsMoving;
  667. laPanel *ClickedPanel;
  668. laBlock *DropToBlock;
  669. laBlock *OnBlockSeperator;
  670. char DropLocation;
  671. laSafeString *ID;
  672. laLayoutBkgDrawFunc Draw;
  673. };
  674. STRUCTURE(laUiList){
  675. laListItem Item;
  676. int L, R, U, B;
  677. int TL, TR, TU, TB;
  678. real PanX, PanY; //Pan Up/Left Is Positive
  679. laListHandle UiItems;
  680. laListHandle Columns;
  681. laListHandle *ShareColumns;
  682. laSafeString *TabName;
  683. char *Instance;
  684. short HeightCoeff;
  685. char ScrollerShownV;
  686. char ScrollerShownH;
  687. uint32_t Flags;
  688. int AllowScale;
  689. real Scale; real SaveScale;
  690. };
  691. STRUCTURE(laUiListRecord){
  692. laListItem Item;
  693. laUiList* uil;
  694. laUiItem* pui;
  695. };
  696. STRUCTURE(laColumn){
  697. laListItem Item;
  698. real PreWidth;
  699. real SP;
  700. int IL, IR;
  701. laColumn *Top;
  702. int MaxW;
  703. int B;
  704. laColumn *LS, *RS;
  705. laColumn *CopyRef;
  706. };
  707. STRUCTURE(laUiListDraw){
  708. laListHandle Items;
  709. laListHandle SocketRecord;
  710. laUiList* WiresContainer;
  711. };
  712. STRUCTURE(laUiListDrawItem){
  713. laListItem Item;
  714. laUiList *Target;
  715. int L, R, U, B, XP, YP, DifX, DifY;
  716. int ExtraPanX;
  717. real Scale;
  718. };
  719. STRUCTURE(laBoxedTheme){
  720. laListItem Item;
  721. laSafeString *Name;
  722. real NormalY, Normal[4], Inactive[4];
  723. real ActiveY, Active[4];
  724. real BorderY, Border[4];
  725. real TextY, Text[4];
  726. real TextActiveY, TextActive[4], TextInactive[4];
  727. real Alpha;
  728. int TextAlign;
  729. int Margins[4];
  730. int Paddings[4];
  731. //Don't change order
  732. int LM, RM, TM, BM;
  733. int LP, RP, TP, BP;
  734. laBoxedTheme **BackRef;
  735. laTheme* Parent;
  736. };
  737. STRUCTURE(laSocketRecord){
  738. laListItem Item;
  739. laNodeInSocket* In;
  740. laNodeOutSocket* Out;
  741. };
  742. extern laPropContainer* LA_PC_SOCKET_IN;
  743. extern laPropContainer* LA_PC_SOCKET_OUT;
  744. extern laPropContainer* LA_PC_MAPPER;
  745. extern laPropContainer* LA_PROP_SOCKET_SOURCE;
  746. extern laPropContainer* LA_PROP_SOCKET_OUT;
  747. extern laPropContainer* LA_PC_RACK_PAGE;
  748. extern laProp* LA_PROP_CONTROLLER;
  749. #define LA_UI_NORMAL 0
  750. #define LA_UI_ACTIVE (1<<0)
  751. #define LA_UI_EDITING (1<<1)
  752. #define LA_UI_DISABLED (1<<30)
  753. #define LA_BT_NORMAL LA_UI_NORMAL
  754. #define LA_BT_ACTIVE LA_UI_ACTIVE
  755. #define LA_BT_BORDER (1<<6)
  756. #define LA_BT_TEXT (1<<7)
  757. #define LA_BT_TEXT_NORMAL (LA_BT_TEXT|LA_UI_NORMAL)
  758. #define LA_BT_TEXT_ACTIVE (LA_BT_TEXT|LA_UI_ACTIVE)
  759. #define LA_BT_DISABLED LA_UI_DISABLED
  760. #define LA_BT_VERTEX (1<<8)
  761. #define LA_BT_EDGE (1<<9)
  762. #define LA_BT_FACE (1<<10)
  763. #define LA_BT_SELECTED (1<<11)
  764. #define LA_BT_SVERTEX (LA_BT_VERTEX|LA_BT_SELECTED)
  765. #define LA_BT_SEDGE (LA_BT_EDGE|LA_BT_SELECTED)
  766. #define LA_BT_SFACE (LA_BT_FACE|LA_BT_SELECTED)
  767. #define LA_BT_WARNING (1<<12)
  768. #define LA_UI_WARNING LA_BT_WARNING
  769. #define LA_BT_SHADOW (1<<13)
  770. #define LA_UI_TAG_IS_OFFSCREEN (1<<0)
  771. #define LA_UI_TAG_CAVANS_SCALED (1<<1)
  772. #define LA_UI_TAG_NEED_REBUILD (LA_UI_TAG_IS_OFFSCREEN | LA_UI_TAG_CAVANS_SCALED)
  773. #define LA_UI_TAG_SCISSOR (1<<2)
  774. STRUCTURE(laTheme){
  775. laListItem Item;
  776. laSafeString *Name;
  777. laSafeString *Author;
  778. laListHandle Colors;
  779. laListHandle BoxedThemes;
  780. int abc;
  781. //
  782. real ColorBkg[4];
  783. real Color[4];
  784. real AccentColor[4];
  785. real WarningColor[4];
  786. real SelectionColor[4];
  787. real CursorColor[4];
  788. real InactiveMix;
  789. real InactiveSaturation;
  790. real CursorAlpha;
  791. real SelectionAlpha;
  792. real WireSaturation;
  793. real WireTransparency;
  794. real WireBrightness;
  795. real VertexColor[4];
  796. real EdgeColor[4];
  797. real SVertexColor[4];
  798. real SEdgeColor[4];
  799. real SFaceColor[4];
  800. real ShadowColor[4];
  801. real EdgeBrightness, EdgeTransparency;
  802. real VertexBrightness, VertexTransparency;
  803. real SelectedVertexTransparency;
  804. real SelectedEdgeTransparency;
  805. real SelectedFaceTransparency;
  806. };
  807. NEED_STRUCTURE(laOperatorType);
  808. STRUCTURE(laUiType){
  809. laListItem Item;
  810. const char *Identifier;
  811. int ForType;
  812. const char *TargetSub;
  813. //laPropStep FakePs;
  814. laSubProp* FakeProp;
  815. laPropContainer* ExtraProps;
  816. laBoxedTheme **Theme;
  817. laUiDrawFunc Draw;
  818. const char *OperatorID;
  819. laOperatorType *OperatorType;
  820. laUiGetMinWidthFunc GetMinWidth;
  821. laUiGetHeightFunc GetHeight;
  822. laUiDestroyFunc Destroy;
  823. laUiInitFunc Init;
  824. laKeyMapper KeyMapper;
  825. int Tag;
  826. };
  827. NEED_STRUCTURE(laUiItem);
  828. STRUCTURE(laGeneralUiExtraData){
  829. int LastX, LastY;
  830. int TargetIndexVali;
  831. real TargetIndexValf;
  832. int On; //On:Modifying
  833. int Dragging;
  834. laStringEdit *Edit;
  835. void *Ptr1;
  836. void *Ptr2;
  837. int HeightCoeff;
  838. laUiItem* ui;
  839. };
  840. STRUCTURE(laMultiStringExtra){
  841. laGeneralUiExtraData* general;
  842. int PanX, PanY;
  843. };
  844. NEED_STRUCTURE(laCanvasExtra);
  845. STRUCTURE(la3DObjectDrawExtra){
  846. int DisplayMode;
  847. int MeshEditType;
  848. tnsMatrix44d mViewProj;
  849. int W,H,Is3D;
  850. real PointScale;
  851. };
  852. typedef void(*laCanvasDrawFunc)(laBoxedTheme* bt, void* DataInstance, laCanvasExtra* Extra);
  853. typedef int (*laModalFunc)(laOperator *, laEvent *);
  854. STRUCTURE(laCanvasTemplate){
  855. laListItem Item;
  856. laSafeString *Identifier;
  857. laCanvasDrawFunc Draw;
  858. laUiDrawFunc SecondDraw;
  859. laKeyMapper KeyMapper;
  860. char *TargetContainerID;
  861. laPropContainer *TargetContainer;
  862. laPropContainer *ExtraProps;
  863. laSubProp *FakeProp;
  864. laModalFunc ExtraModal;
  865. //float LimitYScale;
  866. laUiInitFunc Init;
  867. laUiDestroyFunc Destroy;
  868. };
  869. #define LA_CANVAS_CURSOR_CROSS 1
  870. #define LA_CANVAS_CURSOR_BOX 2
  871. #define LA_CANVAS_CURSOR_ARROW 3
  872. #define LA_CANVAS_CURSOR_X 4
  873. #define LA_CANVAS_CURSOR_Y 5
  874. #define LA_CANVAS_SELECT_MODE_VERTS 0
  875. #define LA_CANVAS_SELECT_MODE_EDGES 1
  876. //#define LA_CANVAS_SELECT_MODE_FACES 2
  877. #define LA_CANVAS_SELECT_MODE_KNIFE 3
  878. #define LA_CANVAS_SELECT_THROUGH_OFF 0
  879. #define LA_CANVAS_SELECT_THROUGH_ON 1
  880. #define LA_CANVAS_DISPLAY_SOLID 0
  881. #define LA_CANVAS_DISPLAY_MATERIAL 1
  882. #ifdef LAGUI_ANDROID
  883. #define LA_PANEL_DEFAULT_GL_FORMAT GL_RGBA4
  884. #else
  885. #define LA_PANEL_DEFAULT_GL_FORMAT GL_RGBA
  886. #endif
  887. void la_CanvasDefaultOverlay(laUiItem* ui, int h);
  888. void la_CanvasDrawOverlay(laUiItem *ui, int h);
  889. void la_CanvasInit(laUiItem *ui);
  890. void la_CanvasDestroy(laUiItem *ui);
  891. STRUCTURE(laCanvasExtra){
  892. laListItem Item;
  893. tnsOffscreen *OffScr;
  894. tnsOffscreen *DeferredOffScr;
  895. laUiItem *ParentUi;
  896. real ZoomX,ZoomY;
  897. real PanX,PanY;
  898. int DrawCursor;
  899. real OnX, TargetX;
  900. real OnY, TargetY;
  901. real ClickedX,ClickedY;
  902. int LW,ShowLegend,UiMode;
  903. int HeightCoeff;
  904. int ShowDetails;
  905. int ImageDrawAlpha;
  906. int ImageDrawBorder;
  907. int AdaptiveLineWidth;
  908. int LineWidthWarning;
  909. int ClearBackground;
  910. int SelectMode;
  911. int SelectThrough;
  912. int EditCenter;
  913. int DeltaMode;
  914. real BL, BR, BU, BB;
  915. int Dragging;
  916. int TargetIndexVali;
  917. //3d==========
  918. tnsOffscreen *OffScrShadow;
  919. tnsCamera *ViewingCamera; //Always create this one;
  920. tnsCamera *UsingCamera;
  921. int Layers[20];
  922. int AsPlayer;
  923. int ShowFloorGrid;
  924. int ShowAxis[3];
  925. int DisplayMode;
  926. };
  927. NEED_STRUCTURE(laUiConditionNode);
  928. STRUCTURE(laConditionUiExtraData){
  929. int a;
  930. laUiItem *EndUi;
  931. laUiItem *ElseUi;
  932. laUiConditionNode *Expression;
  933. //char Remove;
  934. char IsTrue;
  935. };
  936. STRUCTURE(laUiTemplate){
  937. laListItem Item;
  938. laSafeString *Title;
  939. laSafeString *Identifier;
  940. laSafeString *CategoryName;
  941. laUiDefineFunc Define;
  942. laUiDefineFunc Header;
  943. laPanelDetachedPropFunc PropFunc;
  944. int DefaultGLFormat;
  945. int DefaultW_RH,DefaultH_RH;
  946. laKeyMapper KeyMap;
  947. };
  948. #define LA_SLOT_MARKER_1 0
  949. #define LA_SLOT_MARKER_2 1
  950. #define LA_SLOT_MARKER_3 2
  951. #define LA_SLOT_MARKER_4 3
  952. STRUCTURE(laCompoundPP){
  953. laListItem Item;
  954. int Slot;
  955. laPropPack PP;
  956. };
  957. STRUCTURE(laUiItem){
  958. laListItem Item;
  959. laColumn *C;
  960. int L, R, U, B;
  961. int TL, TR, TU, TB;
  962. int AnimationDistinguish;
  963. int State; int Flags; // expand and even (in row control ui)
  964. laPropPack ExtraPP;
  965. laPropStep FakePs;
  966. laGeneralUiExtraData *Extra;
  967. short Expand;
  968. short SymbolID;
  969. laPropPack PP;
  970. laListHandle CompoundPPs;
  971. laSafeString *Display;
  972. laSafeString *ExtraInstructions;
  973. laUiType *Type;
  974. laCanvasTemplate *CanvasTemplate;
  975. laUiList *Page; // reuse as row begin ref
  976. laOperatorType *AT; //Probably share in the future;
  977. laStringSplitor *Instructions;
  978. laListHandle Subs;
  979. laUiDefineFunc Template;
  980. int TemplateContext;
  981. laListHandle SubPanels;
  982. };
  983. STRUCTURE(laWidget){
  984. laUiType* Type;
  985. int Flags;
  986. };
  987. #define LA_UI_FLAGS_TRANSPOSE (1<<0)
  988. #define LA_UI_FLAGS_EXPAND (1<<1)
  989. #define LA_UI_FLAGS_ICON (1<<2)
  990. #define LA_UI_FLAGS_CYCLE (1<<3)
  991. #define LA_UI_FLAGS_NO_DECAL (1<<4)
  992. #define LA_UI_FLAGS_NO_EVENT (1<<5)
  993. #define LA_UI_FLAGS_NO_CONFIRM (1<<6)
  994. #define LA_TEXT_ALIGN_LEFT (1<<7)
  995. #define LA_TEXT_ALIGN_RIGHT (1<<8)
  996. #define LA_TEXT_ALIGN_CENTER (1<<9)
  997. #define LA_TEXT_ALIGN_AUTO (1<<10)
  998. #define LA_TEXT_USE_NEWLINE (1<<11)
  999. #define LA_TEXT_LINE_WRAP (1<<12)
  1000. #define LA_TEXT_REVERT_Y (1<<13)
  1001. #define LA_TEXT_MONO (1<<14)
  1002. #define LA_UI_FLAGS_PREFER_BOTTOM (1<<15)
  1003. #define LA_UI_FLAGS_NO_GAP (1<<16)
  1004. #define LA_UI_FLAGS_UNDERNEATH (1<<17)
  1005. #define LA_UI_FLAGS_NO_HEIGHT (LA_UI_FLAGS_NO_GAP|LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_UNDERNEATH)
  1006. #define LA_UI_FLAGS_NO_OVERLAY (1<<18)
  1007. #define LA_TEXT_OVERFLOW_ARROW (1<<19)
  1008. #define LA_UI_FLAGS_DISABLED (1<<20)
  1009. #define LA_UI_FLAGS_HIGHLIGHT (1<<21)
  1010. #define LA_UI_FLAGS_NODE_CONTAINER (1<<22)
  1011. #define LA_UI_COLLECTION_NO_HIGHLIGHT LA_TEXT_ALIGN_LEFT
  1012. #define LA_TEXT_ONE_LINE (1<<23)
  1013. #define LA_UI_FLAGS_NO_SCROLL_INACTIVE (1<<24)
  1014. #define LA_UI_FLAGS_COLOR_SPACE_CLAY (1<<25)
  1015. #define LA_UI_FLAGS_COLOR_SPACE_D65_P3 LA_UI_FLAGS_NO_SCROLL_INACTIVE
  1016. #define LA_UI_FLAGS_EXIT_WHEN_TRIGGERED LA_UI_FLAGS_COLOR_SPACE_CLAY
  1017. #define LA_TEXT_LCD_16 (1<<27)
  1018. #define LA_TEXT_LCD_7 (1<<28)
  1019. #define LA_UI_FLAGS_NO_TOOLTIP LA_UI_FLAGS_PREFER_BOTTOM
  1020. #define LA_UI_IMAGE_FULL_W LA_TEXT_MONO
  1021. #define LA_UI_MIN_WIDTH LA_UI_FLAGS_COLOR_SPACE_CLAY
  1022. #define LA_UI_FLAGS_NO_LABEL (1<<29)
  1023. #define LA_UI_COLLECTION_SIMPLE_SELECTOR LA_UI_FLAGS_CYCLE
  1024. #define LA_UI_FLAGS_WARNING (LA_UI_FLAGS_CYCLE)
  1025. #define LA_TEXT_SHADOW LA_UI_FLAGS_NO_OVERLAY
  1026. #define LA_UI_FLAGS_MENU_FLOAT16 LA_UI_FLAGS_NO_SCROLL_INACTIVE
  1027. #define LA_UI_FLAGS_INT_ICON (LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_EVENT|LA_UI_FLAGS_ICON)
  1028. #define LA_UI_FLAGS_PLAIN (LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_EVENT)
  1029. #define LA_TEXT_ALIGN (LA_TEXT_ALIGN_LEFT|LA_TEXT_ALIGN_CENTER|LA_TEXT_ALIGN_RIGHT|LA_TEXT_ALIGN_AUTO)
  1030. #define LA_UI_FLAGS_COLORFUL LA_UI_FLAGS_ICON
  1031. #define LA_UI_FLAGS_TERMINAL_INPUT LA_UI_FLAGS_COLOR_SPACE_CLAY
  1032. #define LA_UI_FLAGS_IMMEDIATE_INPUT LA_UI_FLAGS_CYCLE
  1033. #define LA_UI_FLAGS_MOMENTARY (LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_NODE_CONTAINER)
  1034. #define LA_UI_FLAGS_KNOB LA_UI_FLAGS_NODE_CONTAINER
  1035. #define LA_UI_FLAGS_VALUE_METER LA_UI_FLAGS_CYCLE
  1036. #define LA_UI_SOCKET_LABEL_N LA_TEXT_ALIGN_LEFT
  1037. #define LA_UI_SOCKET_LABEL_S LA_TEXT_ALIGN_RIGHT
  1038. #define LA_UI_SOCKET_LABEL_W LA_TEXT_ALIGN_CENTER
  1039. #define LA_UI_SOCKET_LABEL_E LA_TEXT_ALIGN_AUTO
  1040. #define LA_UI_COLLECTION_MANAGER_FILTER LA_TEXT_ONE_LINE
  1041. extern laWidget* LA_WIDGET_FIXED_GROUP;
  1042. extern laWidget* LA_WIDGET_TAB;
  1043. extern laWidget* LA_WIDGET_COLLECTION;
  1044. extern laWidget* LA_WIDGET_COLLECTION_ITEM;
  1045. extern laWidget* LA_WIDGET_COLLECTION_SELECTOR;
  1046. extern laWidget* LA_WIDGET_COLLECTION_SINGLE;
  1047. extern laWidget* LA_WIDGET_CONDITION_TOGGLE;
  1048. extern laWidget* LA_WIDGET_COLUMN_ADJUSTER;
  1049. extern laWidget* LA_WIDGET_COLUMN_VIEWER;
  1050. extern laWidget* LA_WIDGET_BUTTON;
  1051. extern laWidget* LA_WIDGET_BUTTON_NO_CONFIRM;
  1052. extern laWidget* LA_WIDGET_LABEL;
  1053. extern laWidget* LA_WIDGET_INT;
  1054. extern laWidget* LA_WIDGET_INT_PLAIN;
  1055. extern laWidget* LA_WIDGET_INT_PLAIN_ICON;
  1056. extern laWidget* LA_WIDGET_METER_TYPE1;
  1057. extern laWidget* LA_WIDGET_METER_TYPE2;
  1058. extern laWidget* LA_WIDGET_VALUE_METER_2D;
  1059. extern laWidget* LA_WIDGET_FLOAT;
  1060. extern laWidget* LA_WIDGET_FLOAT_PLAIN;
  1061. extern laWidget* LA_WIDGET_FLOAT_COLOR;
  1062. extern laWidget* LA_WIDGET_FLOAT_COLOR_HCY;
  1063. extern laWidget* LA_WIDGET_ENUM_SELECTOR;
  1064. extern laWidget* LA_WIDGET_ENUM_SELECTOR_ICON;
  1065. extern laWidget* LA_WIDGET_ENUM_CYCLE;
  1066. extern laWidget* LA_WIDGET_ENUM_CYCLE_ICON;
  1067. extern laWidget* LA_WIDGET_ENUM_ICON_PLAIN;
  1068. extern laWidget *LA_WIDGET_ENUM_HIGHLIGHT;
  1069. extern laWidget* LA_WIDGET_STRING;
  1070. extern laWidget* LA_WIDGET_STRING_PLAIN;
  1071. extern laWidget* LA_WIDGET_STRING_MULTI;
  1072. extern laWidget *LA_WIDGET_STRING_MONO_PLAIN;
  1073. extern laWidget* LA_WIDGET_MENU_ROOT;
  1074. extern laWidget* LA_WIDGET_ALIGN;
  1075. extern laWidget* LA_WIDGET_3D_VIEW;
  1076. extern laWidget* LA_WIDGET_2D_VIEW;
  1077. extern laWidget* LA_WIDGET_SYMBOL;
  1078. extern laWidget *LA_WIDGET_NODE_SOCKET;
  1079. extern laWidget *LA_WIDGET_HEIGHT_ADJUSTER;
  1080. extern laWidget *LA_WIDGET_RAW;
  1081. extern laWidget *LA_WIDGET_MAPPER;
  1082. extern laWidget *LA_WIDGET_IMAGE;
  1083. extern laWidget *LA_WIDGET_SCOPE;
  1084. extern laWidget *LA_WIDGET_KNOB;
  1085. #define LA_CONDITION_TRUE 1
  1086. #define LA_CONDITION_FALSE 2
  1087. #define LA_CONDITION_GE 3
  1088. #define LA_CONDITION_GT 4
  1089. #define LA_CONDITION_EQ 5
  1090. #define LA_CONDITION_LT 6
  1091. #define LA_CONDITION_LE 7
  1092. #define LA_CONDITION_AND 8
  1093. #define LA_CONDITION_OR 9
  1094. #define LA_CONDITION_NOT 10
  1095. #define LA_CONDITION_INT 11
  1096. #define LA_CONDITION_FLOAT 12
  1097. #define LA_CONDITION_STRING 13
  1098. #define LA_CONDITION_PROP 14
  1099. STRUCTURE(laUiConditionNode){
  1100. char a;
  1101. int Type;
  1102. laUiConditionNode *Expression1; // As Int Value
  1103. laUiConditionNode *Expression2;
  1104. laUiDescriptor *Base;
  1105. char IsExtra;
  1106. int IntValue;
  1107. real FloatValue;
  1108. laSafeString *String; //used as prop path in template
  1109. laPropPack PP;
  1110. };
  1111. #define LA_PANEL_NORMAL 0
  1112. #define LA_PANEL_FLOATING_PASSIVE 2
  1113. #define LA_PANEL_FLOATING_TOP 3
  1114. #define LA_PANEL_NO_PARENT_MENU 4
  1115. #define LA_TAG_REDRAW 1
  1116. #define LA_TAG_RECALC 2
  1117. #define LA_TAG_ANIMATION 4
  1118. #define LA_TAG_RECALC_SCROLLER 8
  1119. #define LA_PANEL_ANIMATION_DROP_DOWN 1
  1120. #define LA_PANEL_ANIMATION_EXPAND 2
  1121. #define LA_PANEL_ANIMATION_DISSOVE 3
  1122. #define LA_PANEL_ANIMATION_COLLAPSE 4
  1123. #define LA_PANEL_ANIMATION_MINIMIZE 5
  1124. #define LA_PANEL_ANIMATION_FLASH 126
  1125. #define LA_PANEL_ANIMATION_DESTROY 127
  1126. NEED_STRUCTURE(laOperator);
  1127. NEED_STRUCTURE(laOperator);
  1128. STRUCTURE(laPanel){
  1129. laListItem Item;
  1130. int __SAFE__;
  1131. int X, Y, W, H;
  1132. int MaxW, MaxH, MinW, MinH;
  1133. int TX, TY, TW, TH;
  1134. int TitleWidth;
  1135. char AnimationMode;
  1136. real AnimationRatio;
  1137. //int PanX, PanY;
  1138. int Show;
  1139. short Refresh;
  1140. short ShowCorner;
  1141. unsigned int FrameDistinguish;
  1142. char BoundUi;
  1143. char IsMenuPanel;
  1144. char LaterDestroy;
  1145. char CloseWhenMovedOut;
  1146. int Mode;
  1147. int NoConfirm;
  1148. int LiveEditing;
  1149. laUiItem *EditingUi;
  1150. laUiItem *FocusingUi;
  1151. void *SFPNode;
  1152. int SL, SR, ST, SB; //Snap To Edge
  1153. laSafeString *Title;
  1154. laUiTemplate *PanelTemplate;
  1155. laPropPack PP;
  1156. laPropStep FakePS;
  1157. laPropContainer* PropLinkContainer;
  1158. laSubProp* PropLinkFakeProp;
  1159. laPropPack PropLinkPP;
  1160. laPropStep PropLinkFakePS;
  1161. laKeyMapper KeyMap;
  1162. laPanelDrawFunc Draw;
  1163. laBoxedTheme **BT;
  1164. tnsOffscreen *OffScr;
  1165. laUiList UI;
  1166. laUiList TitleBar;
  1167. laUiList *MenuRefer;
  1168. laUiDefineFunc UiDefine;
  1169. laListHandle SubPanels;
  1170. laPanel *Parent;
  1171. laBlock *Block;
  1172. laOperator *ParentOperator;
  1173. u64bit Tag;
  1174. //64 Main Types are useable,with 31 subtypes avainable each.
  1175. //Main Type 0~63(some are occupied by LA internal)
  1176. //Sub Type 0~31
  1177. //Main (Low) 0| 1| 2| 3|...
  1178. //[---32bits---][---32bits---][---32bits---][---32bits---]...
  1179. };
  1180. STRUCTURE(laPanelMessage){
  1181. laListItem Item;
  1182. laSafeString *Message;
  1183. };
  1184. STRUCTURE(laPanelMessageList){
  1185. laListHandle Msg;
  1186. };
  1187. NEED_STRUCTURE(laOperator);
  1188. typedef int (*laInitFunc)(laOperator *);
  1189. typedef int (*laRefreshFunc)(laOperator *);
  1190. typedef int (*laCheckFunc)(laPropPack *, laStringSplitor *); //this, ui->instructions amd ap->instructions
  1191. typedef void (*laExitFunc)(laOperator *, int); //true means Quit, false means Cancel
  1192. typedef int (*laInvokeFunc)(laOperator *, laEvent *);
  1193. typedef int (*laModalFunc)(laOperator *, laEvent *);
  1194. typedef int (*laSystemFunc)(laOperator *, laEvent *);
  1195. #define LA_CANCEL 0
  1196. #define LA_PASS_ON (1<<10)
  1197. #define LA_BLOCK (1<<11)
  1198. #define LA_FINISH (1<<12)
  1199. #define LA_CONFIRM (1<<13)
  1200. #define LA_CANCELED 0
  1201. //#define LA_PRE_INVOKE 16384
  1202. #define LA_FINISHED (LA_FINISH | LA_BLOCK)
  1203. #define LA_FINISHED_PASS (LA_FINISH | LA_PASS_ON)
  1204. #define LA_RUNNING LA_BLOCK
  1205. #define LA_RUNNING_PASS (LA_BLOCK | LA_PASS_ON)
  1206. #define LA_OPERATOR_CALLS_SHUTOFF (LA_FINISHED|(1<<5))
  1207. #define LA_EXTRA_TO_PANEL 1
  1208. #define LA_EXTRA_CONFIRM 2
  1209. #define LA_ACTUATOR_SYSTEM 4
  1210. #define LA_ACTUATOR_HIDDEN 8
  1211. #define LA_CONFIRM_OK (1<<10)
  1212. #define LA_CONFIRM_CANCEL (1<<11)
  1213. #define LA_CONFIRM_IGNORE (1<<12)
  1214. #define LA_CONFIRM_DATA (1<<13)
  1215. #define LA_CONFIRM_CUSTOM_STRING (1<<14)
  1216. STRUCTURE(laOperatorType){
  1217. laListItem Item;
  1218. const char *Identifier;
  1219. const char *Name;
  1220. const char *Description;
  1221. const char *ExtraInstructions;
  1222. laInitFunc Init;
  1223. laExitFunc Exit;
  1224. laInvokeFunc Invoke;
  1225. laModalFunc Modal;
  1226. laCheckFunc Check;
  1227. uint32_t IconID;
  1228. laPropContainer* PC;
  1229. laUiDefineFunc UiDefine;
  1230. laOperatorArgumentParserFunc ParseArgs;
  1231. laListHandle Properties;
  1232. int ExtraMark;
  1233. };
  1234. typedef void (*laConfirmDataDestroyFunc)(void *);
  1235. STRUCTURE(laConfirmData){
  1236. int Mode;
  1237. int IData;
  1238. real FData;
  1239. void *CustomData;
  1240. char *StrData;
  1241. void* PointerData;
  1242. laPropContainer* PointerType;
  1243. laConfirmDataDestroyFunc Destroy;
  1244. };
  1245. STRUCTURE(laOperator){
  1246. laListItem Item;
  1247. int State;
  1248. void *Instance;
  1249. void *CustomData;
  1250. const char *ExtraInstructions;
  1251. laStringSplitor *ExtraInstructionsP;
  1252. laPropPack PP;
  1253. laPropPack *This;
  1254. laConfirmData *ConfirmData;
  1255. laConfirmData *NextConfirmData;
  1256. laOperator *Child;
  1257. laListHandle PropertyStorage;
  1258. laOperatorType *Type;
  1259. laPropPack *CreatedThis;
  1260. int Using;
  1261. int StopNow;
  1262. int ModalOver;
  1263. laPanel *ToPanel;
  1264. laPanel *OperatorPanel;
  1265. laListHandle LocalUiLists;
  1266. laSafeString* RuntimeHint;
  1267. };
  1268. #define LA_INPUT_DEVICE_KEYBOARD 0
  1269. #define LA_INPUT_DEVICE_JOYSTICK 1
  1270. STRUCTURE(laInputMapping){
  1271. laListItem Item;
  1272. laSafeString* Name;
  1273. laListHandle Entries;
  1274. };
  1275. STRUCTURE(laInputMappingEntry){
  1276. laListItem Item;
  1277. laInputMapping* Parent;
  1278. int DeviceType;
  1279. int JoystickDevice; int Axis, Button;
  1280. laSafeString* Key; int KeyValue;
  1281. int SpecialKeyBits;
  1282. laSafeString* Signal; int SignalValue;
  1283. };
  1284. STRUCTURE(laInputMappingBundle){
  1285. void* _pad;
  1286. laListHandle InputMappings;
  1287. laInputMapping* CurrentInputMapping;
  1288. };
  1289. #define LA_SIGNAL_NEW 10000
  1290. #define LA_SIGNAL_DELETE 10001
  1291. #define LA_SIGNAL_CONFIRM 10002
  1292. #define LA_SIGNAL_UNDO 10003
  1293. #define LA_SIGNAL_REDO 10004
  1294. #define LA_SIGNAL_OPEN 10005
  1295. #define LA_SIGNAL_SAVE 10006
  1296. #define LA_SIGNAL_SAVE_AS 10007
  1297. #define LA_SIGNAL_LAYOUT_NEXT 10008
  1298. #define LA_SIGNAL_LAYOUT_PREV 10009
  1299. #define LA_SIGNAL_FULLSCREEN 10010
  1300. STRUCTURE(laCustomSignal){
  1301. laListItem Item;
  1302. //laListItem Item2;
  1303. laSafeString* Name;
  1304. int Signal;
  1305. };
  1306. #define LA_JS_MAX_AXES 64
  1307. #define LA_JS_MAX_BUTTONS 128
  1308. STRUCTURE(laController){
  1309. laListItem Item;
  1310. laSafeString* Name;
  1311. laSafeString* Path;
  1312. int fd; //device;
  1313. int NumButtons; int NumAxes; int UserAssignedID; int Error;
  1314. int InternalType; // used to identify models and use specific props.
  1315. int16_t AxisValues[LA_JS_MAX_AXES],SaveAxisValues[LA_JS_MAX_AXES];
  1316. int AxisMaxes[LA_JS_MAX_AXES];
  1317. int AxisMins[LA_JS_MAX_AXES];
  1318. int16_t AxisLimitMaxes[LA_JS_MAX_AXES]; // calibrated max;
  1319. int16_t AxisLimitMins[LA_JS_MAX_AXES];
  1320. int16_t AxisCenterMaxes[LA_JS_MAX_AXES]; // calibrated center;
  1321. int16_t AxisCenterMins[LA_JS_MAX_AXES];
  1322. char ButtonValues[LA_JS_MAX_BUTTONS];
  1323. u8bit ButtonsMap[LA_JS_MAX_BUTTONS];
  1324. u8bit AxisMap[LA_JS_MAX_AXES];
  1325. laSafeString* ButtonNames[LA_JS_MAX_BUTTONS];
  1326. laSafeString* AxisNames[LA_JS_MAX_AXES];
  1327. };
  1328. void la_RefreshControllers();
  1329. void la_InitControllers();
  1330. void la_RemoveDuplicatedControllers();
  1331. void la_UpdateControllerStatus();
  1332. void la_RegisterControllerProps();
  1333. laPropContainer* laget_ControllerType(laController* c);
  1334. laController* la_FindControllerWithID(int id);
  1335. char* laControllerIDGetAxisName(int id, int axis);
  1336. char* laControllerIDGetButtonName(int id, int button);
  1337. int laControllerIDGetAxis(int id, char* name);
  1338. int laControllerIDGetButton(int id, char* name);
  1339. void la_RegisterBasicNodes();
  1340. #define LA_DAG_FLAG_ERR 0
  1341. #define LA_DAG_FLAG_TEMP 1
  1342. #define LA_DAG_FLAG_PERM 2
  1343. int laRebuildPageEval(laRackPage* rp);
  1344. int laRunPage(laRackPage* rp, uint64_t mask);
  1345. void laGraphRequestRebuild();
  1346. int la_RunDrivers();
  1347. void lapost_Node(laBaseNode *bn);
  1348. laBaseNode* la_CreateDriverNode(laNodeRack* ir, laBaseNodeType* NodeType);
  1349. void* laget_InstanceSelf(void* instace);
  1350. laPropContainer* laget_BaseNodeType(laBaseNode* bn);
  1351. void laRegisterNode(laBaseNodeType* type, laPropContainer* pc,
  1352. laBaseNodeInitF init, laBaseNodeDestroyF destroy, laBaseNodeVisitF visit, laBaseNodeEvalF eval, laBaseNodeCopyF copy,
  1353. int nodesize, char* udf_string, char* type_string, char* UiText, int icon);
  1354. void latouched_NodeInSocket(void* unused, int hint);
  1355. #define LA_BASE_NODE_HEADER(uil,c,This) \
  1356. {laSplitColumn(uil,c,0.2);laColumn*c1=laLeftColumn(c,1);c=laRightColumn(c,0);\
  1357. laShowHeightAdjuster(uil,c1,This,"base.__gap",0);}
  1358. #define LA_IDN_REGISTER(uitext,icon,a,pc,funcname,type) \
  1359. laRegisterNode(&a,pc,funcname##Init,funcname##Destroy,funcname##Visit,funcname##Eval,funcname##Copy,sizeof(type),"UDFRES_" #type, #type, uitext,icon);
  1360. #define LA_SRC_AND_PARENT(socket) \
  1361. ((socket)->Source && (socket)->Source->Parent)
  1362. #define LA_VISIT_NODE(node,vi) \
  1363. {if(node){int result=node->Type->Visit(node,vi); if(result!=LA_DAG_FLAG_PERM) return LA_DAG_FLAG_ERR;} }
  1364. #define LA_GUARD_THIS_NODE(n,vi) \
  1365. {uint64_t br=vi->Branch; if((n->Base.Branch&br)==br) return LA_DAG_FLAG_PERM; if((n->Base.BranchTemp&br)==br) return LA_DAG_FLAG_ERR; n->Base.BranchTemp|=br; }
  1366. #define LA_ADD_THIS_NODE(n,vi) \
  1367. {uint64_t br=vi->Branch; if(!n->Base.Branch){ lstAppendPointer(vi->l,n); } n->Base.Branch|=br; n->Base.BranchTemp&=(~br); }
  1368. #define LA_GET_SRC_AS_VALUE(var, socket) \
  1369. {if(socket->Source&&socket->Source->DataType&LA_PROP_FLOAT) var=*((real*)socket->Source->Data);\
  1370. if(socket->Source&&socket->Source->DataType&(LA_PROP_INT|LA_PROP_ENUM)) var=*((int*)socket->Source->Data);}
  1371. #define LA_IDN_OLD_DUPL(socket) \
  1372. old->socket->Duplicated=new->socket;
  1373. #define LA_IDN_NEW_LINK(socket) \
  1374. { memAssignRef(new->socket,&new->socket->Source,old->socket->Source?old->socket->Source->Duplicated:0); new->socket->ColorId=old->socket->ColorId; }
  1375. extern laBaseNodeType LA_IDN_KEYBOARD;
  1376. extern laBaseNodeType LA_IDN_MOUSE;
  1377. extern laBaseNodeType LA_IDN_CONTROLLER;
  1378. extern laBaseNodeType LA_IDN_VISUALIZER;
  1379. extern laBaseNodeType LA_IDN_SPLIT;
  1380. extern laBaseNodeType LA_IDN_SWITCH;
  1381. extern laBaseNodeType LA_IDN_COMBINE;
  1382. extern laBaseNodeType LA_IDN_VALUES;
  1383. extern laBaseNodeType LA_IDN_MATRIX;
  1384. extern laBaseNodeType LA_IDN_MATH;
  1385. extern laBaseNodeType TNS_IDN_TRANSFORM;
  1386. extern laBaseNodeType TNS_IDN_MAKE_TRANSFORM;
  1387. extern laNodeCategory* LA_NODE_CATEGORY_INPUT;
  1388. extern laNodeCategory* LA_NODE_CATEGORY_MATH;
  1389. extern laNodeCategory* LA_NODE_CATEGORY_ROUTE;
  1390. extern laNodeCategory* LA_NODE_CATEGORY_DRIVER;
  1391. extern laNodeCategory* LA_NODE_CATEGORY_AUX;
  1392. extern laNodeCategory* LA_NODE_CATEGORY_COLOR;
  1393. #define LA_VALUES_NODE_FLOAT 0
  1394. #define LA_VALUES_NODE_INT 1
  1395. #define LA_VALUES_NODE_ENUM 2
  1396. #define LA_MATRIX_NODE_OP_MUL 0
  1397. #define LA_MATRIX_NODE_OP_INV 1
  1398. #define LA_MATH_NODE_OP_ADD 0
  1399. #define LA_MATH_NODE_OP_SUB 1
  1400. #define LA_MATH_NODE_OP_MUL 2
  1401. #define LA_MATH_NODE_OP_DIV 3
  1402. #define LA_MATH_NODE_OP_POW 4
  1403. #define LA_MATH_NODE_OP_LOG 5
  1404. #define LA_MATH_NODE_OP_SIN 6
  1405. #define LA_MATH_NODE_OP_COS 7
  1406. #define LA_MATH_NODE_OP_TAN 8
  1407. #define LA_MATH_NODE_OP_ASIN 9
  1408. #define LA_MATH_NODE_OP_ACOS 10
  1409. #define LA_MATH_NODE_OP_ATAN 11
  1410. #define LA_MATH_NODE_OP_ATAN2 12
  1411. #define LA_MATH_NODE_OP_MOD 13
  1412. #define LA_VECTOR_MATH_OP_ADD 0
  1413. #define LA_VECTOR_MATH_OP_SUB 1
  1414. #define LA_VECTOR_MATH_OP_MUL 2
  1415. #define LA_VECTOR_MATH_OP_DIV 3
  1416. #define LA_VECTOR_MATH_OP_POW 4
  1417. #define LA_VECTOR_MATH_OP_LOG 5
  1418. #define LA_VECTOR_MATH_OP_DOT 6
  1419. #define LA_VECTOR_MATH_OP_CROSS 7
  1420. #define LA_VECTOR_MATH_OP_LEN 8
  1421. #define LA_VECTOR_MATH_OP_NORMALIZE 9
  1422. NEED_STRUCTURE(tnsObject)
  1423. STRUCTURE(laRackPage){
  1424. laListItem Item;
  1425. laSafeString* Name;
  1426. laListHandle Racks;
  1427. laListHandle Eval;
  1428. laListHandle AlwaysBranchers;
  1429. laSafeString* Script;
  1430. tnsObject* ParentObject;
  1431. int RackType;
  1432. int TriggerMode;
  1433. int UseScript;
  1434. };
  1435. #define LA_RACK_TYPE_INPUT (1<<0)
  1436. #define LA_RACK_TYPE_DRIVER (1<<1)
  1437. #define LA_RACK_TYPE_ALL 0xfffffff
  1438. STRUCTURE(laNodeRack){
  1439. laListItem Item;
  1440. laSafeString* Name;
  1441. laListHandle Nodes;
  1442. laRackPage* ParentPage;
  1443. int RackType;
  1444. laNodeRack* Duplicated;
  1445. };
  1446. STRUCTURE(laKeyboardNode){
  1447. laBaseNode Base;
  1448. laNodeOutSocket* IsKey; int iIsKey;
  1449. laNodeOutSocket* KeyDown; int iKeyDown;
  1450. laNodeOutSocket* Key; int iKey;
  1451. };
  1452. NEED_STRUCTURE(laInputControllerNode);
  1453. STRUCTURE(laInputControllerNodeSocket){
  1454. laInputControllerNode* Parent;
  1455. laSafeString* Which;
  1456. laNodeOutSocket* Out;
  1457. int Offset;
  1458. int IntVal[8]; real RealVal[8];
  1459. };
  1460. STRUCTURE(laInputControllerNode){
  1461. laBaseNode Base;
  1462. laInputControllerNodeSocket Sockets[8];
  1463. int UserID;
  1464. int Mode;// btn/axis;
  1465. };
  1466. STRUCTURE(laInputVisualizerNode){
  1467. laBaseNode Base;
  1468. laNodeInSocket* In;
  1469. int IntVal[8]; real RealVal[8];
  1470. };
  1471. STRUCTURE(laSplitNodeOutSocket){
  1472. laNodeOutSocket* Out;
  1473. };
  1474. STRUCTURE(laSplitNode){
  1475. laBaseNode Base;
  1476. laNodeInSocket* In;
  1477. laSplitNodeOutSocket Out[8];
  1478. int IntVal[8]; real RealVal[8];
  1479. int ArrLen;
  1480. };
  1481. STRUCTURE(laSwitchNodeInSocket){
  1482. laNodeInSocket* In;
  1483. };
  1484. STRUCTURE(laSwitchNode){
  1485. laBaseNode Base;
  1486. laSwitchNodeInSocket In[8];
  1487. laNodeOutSocket* Out;
  1488. laNodeInSocket* SwitchIn;
  1489. real TempVal;
  1490. int Switch;
  1491. int MaxUsed;
  1492. laRackPage* Page;
  1493. uint64_t BranchSW;
  1494. };
  1495. STRUCTURE(laCombineNode){
  1496. laBaseNode Base;
  1497. laSwitchNodeInSocket In[8];
  1498. laNodeOutSocket* Out;
  1499. laNodeOutSocket* OutInt;
  1500. laNodeOutSocket* OutEnum;
  1501. real Values[8]; int ValuesI[8];
  1502. };
  1503. STRUCTURE(laValuesNode){
  1504. laBaseNode Base;
  1505. laSplitNodeOutSocket Out[8];
  1506. real Values[8]; int ValuesI[8], ValuesE[8];
  1507. int Modes[8];
  1508. };
  1509. STRUCTURE(laMatrixNode){
  1510. laBaseNode Base;
  1511. laNodeInSocket *InL,*InR;
  1512. laNodeOutSocket* Out;
  1513. tnsMatrix44d Mat;
  1514. int Operation;
  1515. };
  1516. STRUCTURE(laMathNode){
  1517. laBaseNode Base;
  1518. laNodeInSocket *InL,*InR;
  1519. laNodeOutSocket* Out,*OutInt;
  1520. real Value; int ValueI;
  1521. real ValueL, ValueR;
  1522. int Operation;
  1523. };
  1524. STRUCTURE(laValueMapperPoint){
  1525. laListItem Item;
  1526. real x,y;
  1527. };
  1528. STRUCTURE(laValueMapper){
  1529. real pad;
  1530. laListHandle Points;
  1531. real InRange[2],OutRange[2];
  1532. };
  1533. STRUCTURE(laMapperNode){
  1534. laBaseNode Base;
  1535. laNodeInSocket *In, *InMin, *InMax, *OutMin, *OutMax;
  1536. laNodeOutSocket* Out;
  1537. real rIn,rOut;
  1538. laValueMapper* Mapper;
  1539. int ClampInput, ClampOutput;
  1540. };
  1541. STRUCTURE(laRandomNode){
  1542. laBaseNode Base;
  1543. laNodeOutSocket* Out; real rOut;
  1544. laNodeInSocket *InMin, *InMax;
  1545. real Min,Max;
  1546. };
  1547. STRUCTURE(laVectorMathNode){
  1548. laBaseNode Base;
  1549. laNodeInSocket *InL,*InR;
  1550. laNodeOutSocket* Out;
  1551. real rOut[4];
  1552. int Operation;
  1553. };
  1554. STRUCTURE(laCommentNode){
  1555. laBaseNode Base;
  1556. laSafeString* Content;
  1557. };
  1558. STRUCTURE(laRGB2OKHSLNode){
  1559. laBaseNode Base;
  1560. laNodeInSocket *In;
  1561. laNodeOutSocket* OutH;
  1562. laNodeOutSocket* OutS;
  1563. laNodeOutSocket* OutL;
  1564. real RGB[3];
  1565. real rOut[3];
  1566. };
  1567. STRUCTURE(laOKHSL2RGBNode){
  1568. laBaseNode Base;
  1569. laNodeInSocket *InH;
  1570. laNodeInSocket *InS;
  1571. laNodeInSocket *InL;
  1572. laNodeOutSocket* Out;
  1573. real rOut[3];
  1574. };
  1575. STRUCTURE(laLoopNode){
  1576. laBaseNode Base;
  1577. laNodeInSocket *InIndex;
  1578. laNodeInSocket *InIterations;
  1579. laNodeInSocket *Branch;
  1580. laNodeInSocket *Prev;
  1581. laNodeOutSocket* Next;
  1582. int Iterations;
  1583. laRackPage* Page;
  1584. uint64_t BranchControl;
  1585. };
  1586. STRUCTURE(laLoopIndexNode){
  1587. laBaseNode Base;
  1588. laNodeOutSocket* Out;
  1589. int Iteration;
  1590. };
  1591. STRUCTURE(laNodeCategory){
  1592. laListItem Item;
  1593. laSafeString* Name;
  1594. laListHandle NodeTypes;//lip
  1595. laUiDefineFunc Ui;
  1596. int For;
  1597. };
  1598. #define LA_RACK_TYPE_AUDIO (1<<2)
  1599. #define LA_SYNTH_PLEN 512
  1600. extern laPropContainer* LA_PC_SYNTH;
  1601. STRUCTURE(laSynth){
  1602. laListItem Item;
  1603. laSafeString* Name;
  1604. laRackPage* Page;
  1605. real Length;
  1606. u16bit Poly,MaxPoly;
  1607. SYSLOCK Lock;
  1608. int Playing;
  1609. real EvalTime;
  1610. int EvalSamples;
  1611. int PolyCount;
  1612. laListHandle PolyphonicInstances;
  1613. };
  1614. STRUCTURE(laSynthNodeInput){
  1615. laBaseNode Base;
  1616. laNodeOutSocket* OutTime;
  1617. laNodeOutSocket* OutTrigger;
  1618. laNodeOutSocket* OutL;
  1619. laNodeOutSocket* OutR;
  1620. real* rTime;
  1621. real* rTrigger;
  1622. real* rSamplesL;
  1623. real* rSamplesR;
  1624. };
  1625. STRUCTURE(laSynthNodePulse){
  1626. laBaseNode Base;
  1627. laNodeInSocket* InTrigger; int iTrigger;
  1628. laNodeInSocket* InWidth; real rWidth,rInfluence;
  1629. laNodeInSocket* InGate; real rGate;
  1630. laNodeOutSocket* Out; real *rOut;
  1631. int Triggered; real EvalSamples;
  1632. };
  1633. STRUCTURE(laSynthNodeFM){
  1634. laBaseNode Base;
  1635. int Slow;
  1636. real Frequency,rInfluence;
  1637. laNodeInSocket* InFrequency;
  1638. laNodeOutSocket* Out;
  1639. //runtime
  1640. real Phase;
  1641. real* OutSamples;
  1642. };
  1643. STRUCTURE(laSynthNodeNoise){
  1644. laBaseNode Base;
  1645. laNodeOutSocket* OutWhite;
  1646. laNodeOutSocket* OutPink;
  1647. real* OutWhiteSamples;
  1648. real* OutPinkSamples;
  1649. //runtime
  1650. real PinkStates[3];
  1651. real PinkA[3],PinkP[3];
  1652. };
  1653. STRUCTURE(laSynthNodeVCA){
  1654. laBaseNode Base;
  1655. real Amp, rInfluence;
  1656. laNodeInSocket* In;
  1657. laNodeInSocket* InAmp;
  1658. laNodeOutSocket* Out;
  1659. real* OutSamples;
  1660. };
  1661. STRUCTURE(laSynthNodeScope){
  1662. laBaseNode Base;
  1663. int Time;
  1664. int Gain1,Gain2;
  1665. real Offset1,Offset2;
  1666. real Brightness1,Brightness2;
  1667. laNodeInSocket* In1;
  1668. laNodeInSocket* In2;
  1669. real *Display1,*Display2; // each PLEN*2, upper/lower bounds.
  1670. int NextSample;
  1671. SYSLOCK Lock;
  1672. laSynth* FromSynth;
  1673. };
  1674. NEED_STRUCTURE(laAudioChannel);
  1675. STRUCTURE(laSynthNodeOutput){
  1676. laBaseNode Base;
  1677. laNodeInSocket* InL,*InR; int IsMono;
  1678. laSafeString* SendName;
  1679. /* Runtime */
  1680. laAudioChannel* Send;
  1681. };
  1682. STRUCTURE(laSynthNodeEnvelope){
  1683. laBaseNode Base;
  1684. laNodeInSocket* Trigger,*Gate; real rGate; int bTrigger; int Triggered;
  1685. laNodeInSocket* Restart;
  1686. laNodeInSocket* Attack; real rAttack,iAttack;
  1687. laNodeInSocket* Delay; real rDelay,iDelay;
  1688. laNodeInSocket* Sustain; real rSustain,iSustain;
  1689. laNodeInSocket* Release; real rRelease,iRelease;
  1690. laNodeOutSocket* Out; real* OutSamples;
  1691. real Time,ReleaseTime,AtLevel;
  1692. };
  1693. STRUCTURE(laSynthNodeQuantize){
  1694. laBaseNode Base;
  1695. laNodeInSocket* In;
  1696. laNodeOutSocket* Out;
  1697. real* OutSamples;
  1698. int EnabledBits[12];
  1699. };
  1700. STRUCTURE(laSynthNodeDriver){
  1701. laBaseNode Base;
  1702. laNodeInSocket* Prev; laNodeOutSocket* Next;
  1703. laNodeInSocket* InTransport; int iTransport;
  1704. laNodeInSocket* InReset; int iReset,AlreadyReset; // on rising edge
  1705. laSynth* Target;
  1706. };
  1707. STRUCTURE(laSynthNodeTrigger){
  1708. laBaseNode Base;
  1709. laNodeInSocket* Prev; laNodeOutSocket* Next;
  1710. laNodeInSocket* InTrigger; int Triggered,TriggerEdge,iTrigger;
  1711. laSynth* Target;
  1712. };
  1713. #include "miniaudio.h"
  1714. STRUCTURE(laAudioChannel){
  1715. laListItem Item;
  1716. laSafeString* Name;
  1717. real Volume;
  1718. laSafeString* OutputChannel;
  1719. real SamplesL[LA_SYNTH_PLEN];
  1720. real SamplesR[LA_SYNTH_PLEN];
  1721. int IsMono;
  1722. };
  1723. STRUCTURE(laAudioDevice){
  1724. laListItem Item;
  1725. int MiniAudioID;
  1726. laSafeString Name;
  1727. };
  1728. typedef int (*laAudioCallbackF)(int Paused, float* input, float* output, uint32_t framecount);
  1729. STRUCTURE(laAudio){
  1730. int Paused;
  1731. laListHandle Synths;
  1732. laSynth* CurrentSynth;
  1733. laListHandle Channels;
  1734. laListHandle PolyLaterTrigger;
  1735. SYSLOCK AudioStatusLock;
  1736. ma_backend MiniAudioBackend;
  1737. ma_context MiniAudioContext;
  1738. ma_device AudioDevice;
  1739. laAudioDevice* UsingDevice;
  1740. laListHandle AudioDevices;
  1741. laSynth* AudioEvalSynth;
  1742. real AudioFrameInterval;
  1743. real* InputSamplesL,*InputSamplesR;
  1744. real *OutputSamplesL,*OutputSamplesR;
  1745. int NextAudioSample,AudioSampleRate;//,NextInputSample;
  1746. laAudioCallbackF Callback;
  1747. };
  1748. void laSetAudioCallback(laAudioCallbackF Callback);
  1749. int laget_SynthPlaying(laSynth* ss);
  1750. void* laget_FirstAudioDevice(void* unused1,void* unused2);
  1751. void* laget_FirstSynth(void* unused1,void* unused2);
  1752. void laset_CurrentSynth(laAudio* a,laSynth* s);
  1753. void laset_CurrentAudioDevice(laAudio* a,laAudioDevice* ad);
  1754. void laRemoveAudioChannel(laAudioChannel* ac);
  1755. laAudioChannel* laNewAudioChannel(char* Name);
  1756. laAudioChannel* laGetAudioChannel(char* Name);
  1757. void la_AudioPreFrame();
  1758. void laset_MiniAudioBackend(void* unused, int backend);
  1759. void laRebuildSynthGraphs(int current_only);
  1760. void laInitAudio();
  1761. void laDeinitAudio();
  1762. void laStartAudio();
  1763. void laPauseAudio();
  1764. void laStopAudio();
  1765. void laResetAudio();
  1766. laSynth* laFindSynth(const char* Name);
  1767. void la_SynthAddPolyInstance(laSynth* s);
  1768. void la_SynthRemovePolyInstance(laSynth* s, laSynth* inst);
  1769. void laSynthTriggerNew(laSynth* s);
  1770. void laSynthTriggerLater(laSynth* s);
  1771. #define LA_INPUT_CONTROLLER_NODE_MODE_BTN 0
  1772. #define LA_INPUT_CONTROLLER_NODE_MODE_AXIS 1
  1773. laValueMapper* laValueMapperInit();
  1774. laValueMapper* laValueMapperDestroy(laValueMapper* vm);
  1775. laValueMapper* laValueMapperCopy(laValueMapper* new_optional, laValueMapper* vm);
  1776. real laValueMapperEvaluate(laValueMapper* vm, real x, real* force_InMin, real* force_InMax, real* force_OutMin, real* force_OutMax, int ClampIn, int ClampOut);
  1777. void laShowProgress(real p1, real p2);
  1778. void laHideProgress();
  1779. void logPrintT(int Type, char* format, ...);
  1780. void logPrint(char* format, ...);
  1781. void logPrintNew(char* format, ...);
  1782. void logClear();
  1783. void laPerfRecordV(char* format, va_list v);
  1784. void laPerfRecord(char* format, ...);
  1785. #ifdef _WIN32
  1786. LRESULT CALLBACK LA_WindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
  1787. LRESULT CALLBACK LA_ProgressWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
  1788. #endif
  1789. void la_RegisterMainOperators();
  1790. void la_RegisterUiOperatorsBasic();
  1791. void la_RegisterViewerOperators();
  1792. void la_RegisterBuiltinOperators();
  1793. void la_RegisterModellingOperators();
  1794. void la_RegisterUiTypesBasic();
  1795. void la_RegisterUiTypesViewerWidgets();
  1796. void la_RegisterBuiltinTemplates();
  1797. void la_RegisterWindowKeys();
  1798. void la_RegisterGeneralProps();
  1799. void la_RegisterInternalProps();
  1800. void la_RegisterDefaultSignals();
  1801. void la_RegisterAnimationResources();
  1802. void la_RegenerateWireColors();
  1803. void laui_IntPropInfo(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *ExtraColumns, int context);
  1804. void laui_FloatPropInfo(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *ExtraColumns, int context);
  1805. void laui_RackPage(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context);
  1806. void laui_DefaultPropDetails(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context);
  1807. void laui_DefaultNodeOperationsPropUiDefine(laUiList *uil, laPropPack *This, laPropPack *OperatorProps, laColumn *UNUSED, int context);
  1808. void laui_DefaultPropUiDefine(laUiList *uil, laPropPack *This, laPropPack *OperatorProps, laColumn *UNUSED, int context);
  1809. void laui_StringPropUiDefine(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context);
  1810. void laui_IdentifierOnly(laUiList *uil, laPropPack *This, laPropPack *OP_UNUSED, laColumn *Extra, int context);
  1811. void laui_SubPropInfoDefault(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1812. void laui_SubPropSelection(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1813. void laui_LinkerSelectionProp(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1814. void laui_LinkerSelectionInstance(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1815. void laui_DefaultOperatorPanelTitleBar(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1816. void laui_ColumnItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context);
  1817. void laui_DefaultMenuButtonsFileEntries(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context);
  1818. void laui_DefaultMenuButtonsEditEntries(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context);
  1819. void laui_DefaultMenuButtonsOptionEntries(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context);
  1820. void laui_DefaultMenuButtons(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context);
  1821. void laui_DefaultMenuExtras(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context);
  1822. void laui_DefaultMenuBarActual(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context);
  1823. void laui_DefaultSubWindowMenuBarActual(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context);
  1824. void laui_ThemeListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context);
  1825. void laui_Theme(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context);
  1826. void laui_BoxedThemeItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context);
  1827. void laui_PropertyContainerList(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context);
  1828. void laui_WindowListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context);
  1829. void laui_LayoutListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context);
  1830. void laui_PanelListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context);
  1831. void laui_InputSocketItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context);
  1832. void laui_OutputSocketItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context);
  1833. void laui_FileBrowserFileItem(laUiList *uil, laPropPack *This, laPropPack *OP_UNUSED, laColumn *Extra, int context);
  1834. void laui_FileBrowserDiskItem(laUiList *uil, laPropPack *This, laPropPack *OP_UNUSED, laColumn *Extra, int context);
  1835. void laui_LinkerPanel(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1836. void laui_ManagedUDFItem(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1837. void laui_ManagedUDFOps(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1838. void laui_ManagedProp(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1839. void laui_ManagedSavePanel(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1840. void laui_ManagedUDFPanel(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1841. void laui_FileBrowserFileList(laUiList *uil, laPropPack *THIS_UNUSED, laPropPack *Operator, laColumn *UNUSED, int context);
  1842. void laui_DataRestorePage(laUiList *uil, laPropPack *THIS_UNUSED, laPropPack *Operator, laColumn *UNUSED, int context);
  1843. void laui_ResourceFolderItem(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1844. void laui_LogItem(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1845. void laui_NodeCategory(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context);
  1846. void tnsui_CameraObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context);
  1847. void tnsui_LightObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context);
  1848. void tnsui_MeshObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context);
  1849. void tnsui_ShapeObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context);
  1850. void tnsui_InstancerObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context);
  1851. void tnsui_BaseObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context);
  1852. void tnsui_RootObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context);
  1853. void tnsui_RootObjectMenuUi(laUiList *uil, laPropPack *This, laPropPack *OperatorProps, laColumn *UNUSED, int context);
  1854. int OPINV_UiItem(laOperator *a, laEvent *e);
  1855. int OPEXT_UiItem(laOperator *a, int ExitCode);
  1856. int la_ArrayGetHeight(laUiItem *ui);
  1857. int la_ValueGetHeight(laUiItem*ui);
  1858. int la_3DViewGetHeight(laUiItem *ui);
  1859. int la_CanvasGetHeight(laUiItem *ui);
  1860. int la_EnumGetHeight(laUiItem *ui);
  1861. int la_ColorPickerGetHeight(laUiItem *ui);
  1862. int la_SymbolGetHeight(laUiItem *ui);
  1863. int la_GroupGetHeight(laUiItem *ui);
  1864. laPanel *la_FindFreePanelByTemplate(laWindow *w, const laUiTemplate *uit);
  1865. laUiItem *la_FindUiWithMark(laUiList *uil, char *mark);
  1866. laUiList *la_FindSubListWithInstance(laUiItem *ui, void *Instance);
  1867. void* laget_CurrentRackPage(laRackPageCollection* c);
  1868. void laset_CurrentRackPage(laRackPageCollection* c,laRackPage* rp);
  1869. void la_BeginNVG(struct NVGcontext* vg,laCanvasExtra* e,int W,int H, int Is2D);
  1870. void la_SetCanvasOrtho(laCanvasExtra* e,int W, int H);
  1871. #define LA_FILETYPE_UNKNOWN 0
  1872. #define LA_FILETYPE_UDF 1
  1873. #define LA_FILETYPE_DOCUMENT 2
  1874. #define LA_FILETYPE_IMAGE 3
  1875. #define LA_FILETYPE_AUDIO 4
  1876. #define LA_FILETYPE_VIDEO 5
  1877. #define LA_FILETYPE_COMPRESSED 6
  1878. #define LA_FILETYPE_FONT 7
  1879. #define LA_FILETYPE_VECTOR 8
  1880. #define LA_FILETYPE_WEBPAGE 9
  1881. #define LA_FILETYPE_META 10
  1882. #define LA_FILETYPE_BLEND 11
  1883. #define LA_FILETYPE_PDF 13
  1884. #define LA_FILETYPE_EXEC 14
  1885. #define LA_FILETYPE_SYS 15
  1886. #define LA_FILETYPE_FOLDER 16
  1887. #define LA_FILETYPE_LASDEXCHANGE 17
  1888. #define LA_FILE_SELECT_FILE 0
  1889. #define LA_FILE_SELECT_FOLDER 1
  1890. STRUCTURE(laExtensionType){
  1891. laListItem Item;
  1892. int FileType;
  1893. const char* Extension;
  1894. };
  1895. STRUCTURE(laFileItem){
  1896. laListItem Hyper;
  1897. int IsFolder;
  1898. char Name[1024];
  1899. int Size;
  1900. uint64_t Timestamp;
  1901. laTimeInfo TimeModified;
  1902. int Type;
  1903. };
  1904. STRUCTURE(laDiskItem){
  1905. laListItem Hyper;
  1906. char ID;
  1907. real Total_GB;
  1908. real Free_GB;
  1909. };
  1910. STRUCTURE(laBookmarkedFolder){
  1911. laListItem Item;
  1912. char Name[128];
  1913. char Path[1024];
  1914. };
  1915. #define LA_FILE_SORT_NAME 0
  1916. #define LA_FILE_SORT_NAME_REV 1
  1917. #define LA_FILE_SORT_TIME 2
  1918. #define LA_FILE_SORT_TIME_REV 3
  1919. #define LA_FILE_SORT_SIZE 4
  1920. #define LA_FILE_SORT_SIZE_REV 5
  1921. STRUCTURE(laFileBrowser){
  1922. laListItem Hyper;
  1923. char Path[2048];
  1924. char FileName[512];
  1925. char TempStr[512];
  1926. char MD5[128];
  1927. char FilterName[512];
  1928. tnsImage* Thumbnail;
  1929. laDiskItem *RootDisk;
  1930. laFileItem *Active;
  1931. laListHandle FileList;
  1932. laListHandle Bookmarks;
  1933. laListHandle Disks;
  1934. int SelectFolder;
  1935. int WarnFileExists;
  1936. int StatusWaitingWarning;
  1937. char UseExtension[64];
  1938. int UseType;
  1939. int FilterType;
  1940. int ShowBackups;
  1941. int ShowThumbnail;
  1942. int SortBy;
  1943. laStringSplitor* ss_filter_extensions;
  1944. };
  1945. STRUCTURE(laUDFPreviewExtra){
  1946. laUDF *UDF;
  1947. int Opened;
  1948. int Append;
  1949. };
  1950. STRUCTURE(laManagedSaveExtra){
  1951. int ShowPage;
  1952. int OnExit;
  1953. };
  1954. #define LA_UDF_SHARE_POINTER(id) \
  1955. la_UDFAppendSharedTypePointer("" #id, id)
  1956. void la_MakeTranslations_zh_hans();
  1957. void la_MakeTranslations_es_ES();
  1958. laCanvasTemplate *la_GetCanvasTemplate(char *TargetContainerID, char* TemplateID);
  1959. laPropContainer* laUiHasExtraProps(laUiType *ut, int size, int Hyper);
  1960. laPropContainer* laCanvasHasExtraProps(laCanvasTemplate *ct, int size, int Hyper);
  1961. laUiType *la_RegisterUiType(const char *Identifer, int ForType, const char *UseOperator, laBoxedTheme **bt, laUiDrawFunc *Draw, laUiGetHeightFunc GetHeight, laUiInitFunc Init, laUiDestroyFunc Destroy);
  1962. void la_NotifyGLDebugChanges();
  1963. void laSetWindowCursor(int id);
  1964. void laRenameWindow(laWindow* wnd, char* name);
  1965. #ifdef LA_LINUX
  1966. int la_GetDPI(Window* root_win);
  1967. void la_ScanWacomDevices(SYSTEMDISPLAY *display, int deviceid);
  1968. #endif
  1969. #ifdef _WIN32
  1970. int la_GetDPI(HWND win);
  1971. void la_OpenWacomWinTab(HWND hwnd);
  1972. #endif
  1973. void laSetFontFolderPath(char* absolute);
  1974. void laSetDefaultInitArguments(laInitArguments* ia);
  1975. void laSetCompleteInitArguments(laInitArguments* ia);
  1976. void laProcessInitArguments(int argc, char* argv[],laInitArguments* ia);
  1977. int laGetReady();
  1978. int laGetReadyWith(laInitArguments* ia);
  1979. void laShutoff(int SavePreferences);
  1980. int laRestoreFactorySettings();
  1981. void laSaveUserPreferences();
  1982. void laEnsureUserPreferences();
  1983. void laAddExtraExtension(int FileType, ...);
  1984. void laAddExtraPreferencePath(const char* path);
  1985. void laAddExtraPreferencePage(const char* name, laUiDefineFunc Func);
  1986. void laSetFrameCallbacks(laPreFrameF PreFrame, laPreDrawF PreDraw, laPostFrameF PostFrame);
  1987. void laSetCleanupCallback(laCleanupF Cleanup);
  1988. void laSetInputProcessCallback(laInputProcessF InputProcess);
  1989. void laSetMenuBarTemplates(laUiDefineFunc MenuButtons, laUiDefineFunc MenuExtras, const char* ProgramName);
  1990. void laSetAboutTemplates(laUiDefineFunc AboutContent, laUiDefineFunc AboutVersion, laUiDefineFunc AboutAuthor);
  1991. void laSetPreferenceTemplates(laUiDefineFunc PreferencePageDisplay, laUiDefineFunc PreferencePageInput, laUiDefineFunc PreferencePageResource, laUiDefineFunc PreferencePageTheme);
  1992. void la_InputMappingGetKeyName(int key, int special, char* name);
  1993. int la_InputMappingGetKeyFromName(char* name, int* special);
  1994. laCustomSignal* laFindSignal(char* Name);
  1995. laCustomSignal* laFindSignalByID(int ID);
  1996. void laInputMappingUpdateSignal(laInputMappingEntry* ime);
  1997. laInputMapping* laNewInputMapping(char* Name);
  1998. laInputMappingEntry* laNewInputMappingEntry(laInputMapping* im, int DeviceType, int JoystickDevice, char* Key, int SpecialKeyBit, char* Signal);
  1999. laInputMappingEntry* laNewInputMappingEntryP(laInputMapping* im, int DeviceType, int JoystickDevice, char* Key, int SpecialKeyBit, int Signal);
  2000. void laRemoveInputMappingEntry(laInputMapping* im, laInputMappingEntry* e);
  2001. void laRemoveInputMapping(laInputMapping* im);
  2002. laCustomSignal* laNewCustomSignal(char* Name, int Signal);
  2003. void laRemoveCustomSignal(laCustomSignal* cs);
  2004. void la_RemoveScreen(laScreen*s);
  2005. laScreen* laGetWindowScreen(laWindow* w);
  2006. laWindow *laDesignWindow(int X, int Y, int W, int H);
  2007. laLayout *laDesignLayout(laWindow *w, char *Title);
  2008. void laDestroyLayout(laWindow *w, laLayout* l);
  2009. void laFoldBlockTitle(laBlock* b);
  2010. void laUnfoldBlockTitle(laBlock* b);
  2011. void laMaximizeBlock(laBlock* b);
  2012. void laRestoreToLayout();
  2013. void laMaximizeCanvasUI(laUiItem* ui, laPanel* UiParentPanel);
  2014. void laRestoreCanvasUI();
  2015. void laHideMenuBar();
  2016. void laShowMenuBar();
  2017. void laSplitBlockHorizon(laBlock *b, real Percentage);
  2018. void laSplitBlockVertical(laBlock *b, real Percentage);
  2019. void laCombineChildBlocks(laBlock *b);
  2020. laBlock *laBlock1(laBlock *b);
  2021. laBlock *laBlock2(laBlock *b);
  2022. laBlock *laSwapSubBlocks(laBlock *b);
  2023. void laDestroyBlocksRecursive(laBlock *Root);
  2024. laPanel* laTearOffPanel(laBlock* b, laPanel* p_if_set);
  2025. void laDockPanel(laWindow* from, laBlock* b, laPanel* p);
  2026. laPanel *laCreatePanel(laBlock *b, char *template_id);
  2027. laPanel *laCreateTopPanel(laWindow *w, char *template_id, int X, int Y, int W, int H, int MaxW, int MaxH, int MinW, int MinH, int SnapL, int SnapR, int SnapT, int SnapB);
  2028. void laShowPanel(laPanel *p);
  2029. void laShowPanelWithDropDownEffect(laPanel *p);
  2030. void laShowPanelWithExpandEffect(laPanel *p);
  2031. void laHidePanel(laPanel *p);
  2032. void laHidePanelWithDissoveEffect(laPanel *p);
  2033. void laActivatePanel(char* TemplateID, int x, int y);
  2034. void laPanPanel(laPanel *p, int DeltaX, int DeltaY);
  2035. int laPanUiListFree(laUiList *uil, int X, int Y);
  2036. int laPanUiList(laUiList *uil, int X, int Y, int L, int R, int U, int B);
  2037. int laPanUiListAuto(laUiList *uil, int X, int Y, int L, int R, int U, int B);
  2038. int laScaleUiList(laUiList *uil, real factor, int L, int R, int U, int B);
  2039. laPanel *laDesignPropPanel(char *Title, int X, int Y, int W, int H,
  2040. laUiDefineFunc Define, laPropPack *This, laPropPack *OperatorProps);
  2041. laPanel *laDesignOperatorPanel(char *Title, int X, int Y, int W, int H, int MaxW, int MaxH, int MinW, int MinH, int SnapL, int SnapR, int SnapT, int SnapB,
  2042. laUiDefineFunc Define, laPropPack *This, laPropPack *OperatorProps);
  2043. void laDeferedDestroyPanel(laPanel *p);
  2044. void laDestroySinglePanel(laPanel *p, int immediate);
  2045. void laEnsurePanelInBound(laPanel *p,laUiList* uil);
  2046. int laEnclosePanelContent(laPanel *p, laUiList *uil);
  2047. laPanel *laEnableIdlePanel(laPanel *Attachment, laOperator *a, laPropPack *OperatorProps, laUiDefineFunc ReplaceUiDefine, laPropPack *This,
  2048. int L, int R, int B, int MaxGH, int MaxW, laEvent *e);
  2049. laPanel *laEnableSplashPanel(laUiDefineFunc ReplaceUiDefine, int L, int R, int B, int MaxGH, int MaxW, laEvent* e);
  2050. laPanel *laEnablePropertyPanel(laPanel *Attachment, laOperator *a, laPropPack *OperatorProps, laUiDefineFunc ReplaceUiDefine, laUiDefineFunc FallBackUiDefine, laPropPack *This,
  2051. int L, int R, int B, int MaxGH, int MaxW, laEvent *e);
  2052. laPanel *laEnableEmptyPropertyPanel(laPanel *Attachment, laOperator *a, int L, int R, int U, int MaxGH, laEvent *e);
  2053. laPanel *laEnableMenuPanel(laPanel *Attachment, laOperator *a, laUiList *MenuRefer, laPropPack *This,
  2054. int L, int R, int B, int MaxGH, int MaxW, laEvent *e);
  2055. laPanel *laDefineAndEnableMenuPanel(laPanel *Attachment, laOperator *a, laPropPack *This,
  2056. int L, int B, int MaxGH, int MaxW, laEvent *e);
  2057. laPanel *laEnableOperatorPanel(laOperator *For, laPropPack *This, int X, int Y, int W, int H, int MaxW, int MaxH, int MinW, int MinH, int SnapL, int SnapR, int SnapT, int SnapB, laEvent *e);
  2058. laPanel *laEnableYesNoPanel(laOperator *a, laPanel *Attachment, char *Title, char *Message, int X, int Y, int W, laEvent *e);
  2059. laPanel *laEnableMessagePanel(laOperator *a, laPanel *Attachment, char *Title, char *Message, int X, int Y, int W, laEvent *e);
  2060. void laOperatorModalOver(laOperator* For);
  2061. void la_PropPanelUserRemover(void* This, laItemUserLinker* iul);
  2062. void la_EnsurePanelExtras(laPanel *p);
  2063. void laDeferredRedraw(laPanel* p);
  2064. void laRedrawAllWindows();
  2065. void laRefreshWindow();
  2066. void laRedrawCurrentWindow();
  2067. void laRedrawPanel(laPanel* p);
  2068. void laRecalcPanel(laPanel* p);
  2069. void laRedrawCurrentPanel();
  2070. void laRecalcCurrentPanel();
  2071. void laRecalcPanelImmediate(laPanel *p);
  2072. void laRecalcCurrentPanelImmediate();
  2073. int laNonFixedPanelExists(laPanel *p);
  2074. int laIsInPanel(laPanel *p, int PanelX, int PanelY);
  2075. int laIsCloseToPanel(laPanel *p, int PanelX, int PanelY);
  2076. void laPopPanel(laPanel *p);
  2077. int laPanelOverlappingEachOther(laPanel *p1, laPanel *p2);
  2078. void laUnlinkSharedPanel(laPanel *p);
  2079. int laIsPanelCovered(laPanel *p);
  2080. int laIsTopPanel(laPanel *p);
  2081. laPanel *laDetectPanel(int X, int Y);
  2082. void laWindowToLocal(laOperator *a, laPanel *p, int *x, int *y);
  2083. void laPanelToLocal(laOperator *a, int *x, int *y);
  2084. void laLocalToWindow(laOperator *a, laPanel *p, int *x, int *y);
  2085. void laLocalToPanel(laOperator *a, int *x, int *y);
  2086. void laSetNextMenuPos(int X, int Y, int W, int H);
  2087. int laIsInBlock(laBlock *b, int X, int Y);
  2088. int laIsInBlockHeader(laBlock *b, int X, int Y);
  2089. int laIsInBlockBotton1(laBlock *b, int X, int Y);
  2090. int laIsInBlockBotton2(laBlock *b, int X, int Y);
  2091. laBlock *laClearBlockButtonRecursive(laBlock *b, laBlock *except);
  2092. laBlock *laDetectBlockRecursive(laBlock *b, int X, int Y);
  2093. void la_DoUiScissor(laUiItem* ui, int* savex, int* savey, int* savew, int* saveh,
  2094. int* savel, int* saver, int* saveu, int* saveb);
  2095. laUiList *laPrepareUi(laPanel *p);
  2096. laColumn *laFirstColumn(laUiList *uil);
  2097. laColumn *laSplitColumn(laUiList *uil, laColumn *c, real Percent);
  2098. laColumn *laSplitColumnDescriptor(laUiDescriptor *ud, laColumn *c, real Percent);
  2099. laColumn *laLeftColumn(laColumn *c, int MaxWidth);
  2100. laColumn *laRightColumn(laColumn *c, int MaxWidth);
  2101. int laCheckAndMergeSubColumnsUiList(laUiList *TopUil, laColumn *c, int DoMerge);
  2102. int laCheckAndMergeSubColumnsDescriptor(laUiDescriptor *TopDescriptor, laColumn *c, int DoMerge);
  2103. laUiConditionNode *laTrue();
  2104. laUiConditionNode *laFalse();
  2105. laUiConditionNode *laPropExpression(laPropPack *Base, char *Prop);
  2106. laUiConditionNode *laIntExpression(int Value);
  2107. laUiConditionNode *laFloatExpression(real Value);
  2108. laUiConditionNode *laStringExpression(char *Content);
  2109. laUiConditionNode *laAnd(laUiConditionNode *Expression1, laUiConditionNode *Expression2);
  2110. laUiConditionNode *laOr(laUiConditionNode *Expression1, laUiConditionNode *Expression2);
  2111. laUiConditionNode *laNot(laUiConditionNode *Expression1);
  2112. laUiConditionNode *laEqual(laUiConditionNode *Expression1, laUiConditionNode *Expression2);
  2113. laUiConditionNode *laGreaterThan(laUiConditionNode *Expression1, laUiConditionNode *Expression2);
  2114. laUiConditionNode *laLessThan(laUiConditionNode *Expression1, laUiConditionNode *Expression2);
  2115. laUiConditionNode *laGreaterEqual(laUiConditionNode *Expression1, laUiConditionNode *Expression2);
  2116. laUiConditionNode *laLessEqual(laUiConditionNode *Expression1, laUiConditionNode *Expression2);
  2117. laUiItem *laShowLabel(laUiList *uil, laColumn *c, const char *Content, laUiDefineFunc Template, laWidget* Widget);
  2118. laUiItem *laShowLabelDynamic(laUiList *uil, laColumn *c, const char *Content, laUiDefineFunc Template, laWidget* Widget);
  2119. laUiItem *laShowIcon(laUiList *uil, laColumn *c, laPropPack *Base, const char *Path, laWidget* Widget);
  2120. laUiItem *laShowInvisibleItem(laUiList *uil, laColumn *c, laPropPack *Base, const char *Path);
  2121. laUiItem *laShowItem(laUiList *uil, laColumn *c, laPropPack *Base, const char *Path);
  2122. laUiItem *laShowItemFull(laUiList *uil, laColumn *c, laPropPack *Base, const char *Path, laWidget* Widget, char* instructions, laUiDefineFunc Template, int TemplateContext);
  2123. laUiItem *laShowImage(laUiList *uil, laColumn *c, tnsImage* Image, int Height);
  2124. laUiItem *laShowNodeSocket(laUiList *uil, laColumn *c, laPropPack *Base, const char *Path, char* instructions);
  2125. laUiItem *laShowHeightAdjuster(laUiList *uil, laColumn *c, laPropPack *Base, const char *Path, char* instructions);
  2126. laUiItem *laShowDetachedItem(laPanel *p, laUiList *uil, laColumn *c, laPropPack *Base, const char *Path, const char *Rename, laUiDefineFunc Template, laWidget* Widget);
  2127. laUiItem *laShowCanvas(laUiList *uil, laColumn *c, laPropPack *Base, const char *Path, const char *id2DTemplate, int Height);
  2128. laUiItem *laShow3DCanvasCombo(laUiList *uil, laColumn *c, laPropPack *Base, const char *Path, int Height, laPropPack* Detached);
  2129. laUiItem *laShow2DContainerItem(laUiList *uil, laColumn *c, laPropPack *Base, const char *Path, int Height);
  2130. void laDefault3DViewOverlay(laUiItem *ui);
  2131. void laDefault2DViewOverlayRight(laUiItem *ui);
  2132. laUiItem *laShowColumnAdjuster(laUiList *uil, laColumn *c);
  2133. laUiItem *laShowSymbol(laUiList *uil, laColumn *c, int SymbolID, int Height);
  2134. laPropPack* laShowCompoundValue(laUiItem* ui, int slot, laPropPack *Base, const char *Path);
  2135. laUiItem *laBeginRow(laUiList *uil, laColumn *c, int Expand, int Even);
  2136. laUiItem *laEndRow(laUiList *uil, laUiItem* Begin);
  2137. laUiItem *laMakeGroup(laUiList *uil, laColumn *c, const char *Name, laWidget* Widget);
  2138. laUiItem *laMakeFoldableGroup(laUiList *uil, laColumn *c, const char *Name, laWidget* Widget, int DefaultFolded, int ButtonFlags);
  2139. laUiItem *laMakeEmptyGroup(laUiList *uil, laColumn *c, const char *Name, laWidget* Widget);
  2140. void laEndFoldableGroup(laUiList *sub, laUiItem *group);
  2141. laUiItem *laMakeTab(laUiList *uil, laColumn *c, laWidget* Widget);
  2142. laUiList *laAddTabPage(laUiItem *ui, const char *Name);
  2143. laUiItem *laOnConditionThat(laUiList *uil, laColumn *c, laUiConditionNode *Expression);
  2144. laUiItem *laOnConditionToggle(laUiList *uil, laColumn *col, laUiDefineFunc define, int Remove, laPropPack *ExtraBase, laPropPack *ExtraThis, laWidget* Widget);
  2145. laUiItem *laEndCondition(laUiList *uil, laUiItem *Beginner);
  2146. laUiItem *laElse(laUiList *uil, laUiItem *Beginner);
  2147. laUiList* laMakeMenuPageEx(laUiList* uil, laColumn* c, const char* Title, int flags);
  2148. laUiList *laMakeMenuPage(laUiList *uil, laColumn *c, const char *Title);
  2149. laUiItem *laShowSeparator(laUiList *uil, laColumn *widest);
  2150. void laFixHeight(laUiList *uil, short Rows);
  2151. void la_ConditionerInit(laUiItem *ui, laUiConditionNode *Expression);
  2152. void laMakeExtraColumns(laUiItem *ui, u8bit HowMany, ...);
  2153. int la_UiInBoundEx(laUiItem *ui, laUiListDraw *uild);
  2154. void la_DestroyUiRange(laUiList *uil, laUiItem *Begin, laUiItem *End);
  2155. void la_ClearUiSpecificData(laUiItem *ui);
  2156. laUiItem *la_UpdatePropDisplay(laUiItem *ui, laPropPack *Base, const char *Path, laUiDefineFunc Template, laWidget* Widget, char* instructions);
  2157. laUiItem *la_UpdateLabelDisplay(laUiItem *ui, laUiDefineFunc Template, char *Content);
  2158. laUiItem *la_ShowGeneralPropItem(laUiList *uil, laColumn *c, laPropPack *Base, laProp *GeneralProp, laProp *p, laUiDefineFunc Template, laWidget* Widget);
  2159. void laFinalizeUiTemplates();
  2160. laUiTemplate *laFindUiTemplate(char *Identifier);
  2161. void la_DestroyUiTemplate(laUiTemplate* uit);
  2162. void la_DestroyCanvasTemplate(laCanvasTemplate* uit);
  2163. laUiTemplate *laRegisterUiTemplate(char *Identifier, char* Title, laUiDefineFunc func,laPanelDetachedPropFunc PropFunc, laUiDefineFunc header, char* NewCategory, int DefaultGLFormat, int DefaultW_RH, int DefaultH_RH);
  2164. laCanvasTemplate *laRegisterCanvasTemplate(char *Identifier, char *ForContainer, laModalFunc ExtraModal, laCanvasDrawFunc Func, laUiDrawFunc SecondDraw, laUiInitFunc CustomInit, laUiDestroyFunc CustomDestroy);
  2165. void la_DestroyTheme(laTheme* t);
  2166. laTheme *laDesignTheme(const char *Name, const char *AuthorName);
  2167. laBoxedTheme *laDesignBoxedTheme(laTheme *t, const char *Name, laBoxedTheme** BackRef,
  2168. real NormalY,real ActiveY,real BorderY,real TextY,real TextActiveY, real Alpha,
  2169. real TopMargin, real LeftMargin, real RightMargin, real BottomMargin,
  2170. real TopPadding, real LeftPadding, real RightPadding, real BottomPadding);
  2171. laTheme *laGetTheme(const char *ThemeName);
  2172. laBoxedTheme *laGetBoxedTheme(const char *ThemeName, const char *BoxName);
  2173. real* laThemeColor(laBoxedTheme* bt, int which);
  2174. real* laAccentColor(int which);
  2175. void la_RefreshBoxedThemeColor(laBoxedTheme* bt);
  2176. void la_RefreshThemeColorSelf(laTheme* th);
  2177. void la_RefreshThemeColor(laTheme* th);
  2178. #define LA_COLOR4(c) (c)[0], (c)[1], (c)[2], (c)[3]
  2179. #define LA_COLOR3(c) (c)[0], (c)[1], (c)[2]
  2180. #define LA_VEC2(c) (c)[0], (c)[1]
  2181. #define LA_SET3(c, a1,a2,a3) { (c)[0]=a1; (c)[1]=a2; (c)[2]=a3; }
  2182. #define LA_COLOR3_TO_HEX(c) (((int)((c)[0]*255)<<16)|((int)((c)[1]*255)<<8)|((int)((c)[2]*255)<<0))
  2183. #define LA_COLOR3_TO_RGB(c) (RGB((int)((c)[0]*255),(int)((c)[1]*255),(int)((c)[2]*255)))
  2184. int laIsInUiItem(laUiItem *ui, int x, int y);
  2185. int laIsInBound(int x, int y, int l, int r, int u, int b);
  2186. laUiItem *la_DetectUiItemRecursive(laUiList *uil, int x, int y, int LimB, laListHandle *LocalBuf, int Deep);
  2187. laUiItem *la_DetectSocketRecursive(laUiList* uil, int x, int y, int LimB, laPropContainer* PCInOrOut);
  2188. laUiList *la_DetectUiListRecursive(laUiList *uil, int x, int y, int LimH,
  2189. laUiItem **ParentUi, laUiList **ScrollUil, laUiList **ContainerParent, int InToContainerUI, laUiItem *Exception);
  2190. laUiList *la_DetectUiListRecursiveDeep(laUiList *uil, int x, int y, int LimH, laUiItem **ParentUi, laUiList **ScrollUil,
  2191. laUiList **ContainerParent, int InToContainerUI, laUiItem *Exception, laListHandle* levels);
  2192. int laStartWindow(laWindow *w);
  2193. void laMainLoop();
  2194. void la_DestroyOperatorType(laOperatorType* at);
  2195. laOperatorType *laCreateOperatorType(const char *ID, const char *Name, const char *Description,
  2196. laCheckFunc Check, laInitFunc Init, laExitFunc Exit, laInvokeFunc Invoke, laModalFunc Modal,
  2197. uint32_t IconID, int ExtraMark);
  2198. laPropContainer* laDefineOperatorProps(laOperatorType* ot, int HyperLevel);
  2199. #define LA_VERIFY_THIS_TYPE(this,pc,pc_identifier) \
  2200. ((this)&&(this)->EndInstance&& \
  2201. (this)->LastPs->p->PropertyType==LA_PROP_SUB&& \
  2202. ((pc)=la_EnsureSubTarget((this)->LastPs->p,(this)->EndInstance))&&strSame((pc)->Identifier,pc_identifier))
  2203. laNodeOutSocket* laCreateOutSocket(void* NodeParentOptional, char* label, int DataType);
  2204. laNodeInSocket* laCreateInSocket(char* label, int DataType);
  2205. void laDestroyInSocket(laNodeInSocket* s);
  2206. void laDestroyOutSocket(laNodeOutSocket* s);
  2207. laNodeCategory* laEnsureNodeCategory(char* Name,laUiDefineFunc* Ui,int ForRackTypes);
  2208. void laNodeCategoryAddNodeTypes(laNodeCategory* nc, ...);
  2209. void laDestroyRack(laNodeRack* rr);
  2210. laRackPage* laDuplicateRackPage(laRackPage* new_optional, laRackPage* from);
  2211. void laFreeKeyMapItem(laKeyMapItem* kmi);
  2212. laKeyMapItem *laAssignNewKey(laKeyMapper *km, char *Path, char *Operation, char SelectBase, int SpecialKeyBits, int EventType, int Key, char *ExtraInstructions);
  2213. int laKeyMapExecuteEvent(laOperator *from, laKeyMapper *km, laEvent *e);
  2214. int laKeyMapExecuteEventEx(laOperator *from, laPropPack *UiExtra, laKeyMapper *km, laEvent *e);
  2215. laOperatorType *laGetOperatorType(const char *ID);
  2216. void laSetOperatorLocalizer(void *ToPanel);
  2217. int laOperatorAvailable(char *ID, laPropPack *This, laStringSplitor *Instructions);
  2218. int laOperatorAvailableP(laOperatorType *at, laPropPack *This, laStringSplitor *Instructions);
  2219. int laOperatorAvailableSafe(char *ID, laPropPack *This, void *Real_FromInstance, laStringSplitor *Instructions);
  2220. int laOperatorAvailablePSafe(laOperatorType *at, laPropPack *This, void *Real_FromInstance, laStringSplitor *Instructions);
  2221. void laSendOperatorTriggerEvent();
  2222. void laRetriggerOperators();
  2223. int la_GenericTopPanelProcessing(laOperator* a, laEvent* e);
  2224. int OPMOD_FinishOnData(laOperator* a, laEvent* e);
  2225. void OPEXT_FreeUserData(laOperator* a, int mark_unused);
  2226. void laHideCursor();
  2227. void laShowCursor();
  2228. int la_UiOperatorExists(void *inst);
  2229. int laOperatorExistsT(laOperatorType* at);
  2230. int laOperatorExists(const char* ID);
  2231. int laInvokeUi(laOperator *From, char *ID, laEvent *e, void *inst, laListHandle *Locals, int IgnoreLocals);
  2232. int laInvokeUiP(laOperator *From, laOperatorType *at, laEvent *e, void *inst, laListHandle *Locals, int IgnoreLocals);
  2233. int laInvoke(laOperator *From, char *ID, laEvent *e, laPropPack *This, char *args, char *args2);
  2234. int laInvokeP(laOperator *From, laOperatorType *at, laEvent *e, laPropPack *This, char *args, char *args2);
  2235. int laInvokePCreateThis(laOperator *From, laOperatorType *at, laEvent *e, laPropPack *OrigionalThis, void *FromInstance, char *args, char *args2);
  2236. void laRequestDelayEvent(real Seconds);
  2237. int la_UiStillInService(void *UiInstance);
  2238. void la_StopUiOperatorService(void *UiInstance);
  2239. void la_StopAllOperators();
  2240. int la_ProcessTextEdit(laEvent *e, laStringEdit *se, laUiItem* ui);
  2241. void laConfirmPointer(laOperator *a, void* Data,laPropContainer* PointerType, int mode);
  2242. void laConfirmInt(laOperator *a, int Data, int mode);
  2243. void laConfirmFloat(laOperator *a, real Data, int mode);
  2244. void laConfirmString(laOperator *a, char *Str, int mode);
  2245. int laConfirmSameDataIfAny(laOperator *a);
  2246. void laConfirmUserData(laOperator *a, void *UserData, laConfirmDataDestroyFunc Destroy, int mode);
  2247. int laGetConfirmInt(laOperator *a);
  2248. real laGetConfirmFloat(laOperator *a);
  2249. void laGetConfirmString(laOperator *a, char *buf);
  2250. void *laGetConfirmUserData(laOperator *a);
  2251. //int laInvokeSub(laProp* From, char * ID, laEvent* e, void* inst);
  2252. void la_DisplayKeyboard(bool pShow);
  2253. void la_HideNavBar();
  2254. void laFinalizeOperators();
  2255. int laWaitFor(laOperator *Who, int State);
  2256. void la_PrintOperatorStack();
  2257. void laui_DefaultPanelTitleBar(laUiList *uil, laPropPack *Base, laPropPack *Extra, laUiDefineFunc header);
  2258. void laui_DefaultOperatorPanelTitleBar(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);;
  2259. void laui_DefaultSubWindowMenuBarActual(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context);;
  2260. void laui_DefaultMenuBarActual(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context);;
  2261. void laui_DefaultMenuBar(laWindow *w);
  2262. void laui_DefaultSubWindowMenuBar(laWindow *w);
  2263. void laui_DefaultPropUiDefine(laUiList *uil, laPropPack *This, laPropPack *OperatorProps, laColumn *UNUSED, int context);;
  2264. void laui_PropOperatorUiDefine(laUiList *uil, laPropPack *This, laPropPack *Unused, laColumn *UNUSED, int context);
  2265. int laCopyToClipboard(unsigned char * text);
  2266. #ifdef LAGUI_ANDROID
  2267. bool la_check_permission(const char* permission);
  2268. void la_request_permission(const char* permission);
  2269. #endif
  2270. extern laUiType *_LA_UI_FIXED_GROUP;
  2271. extern laUiType *_LA_UI_TAB;
  2272. extern laUiType _LA_UI_CONDITION; //NO PTR
  2273. extern laUiType _LA_UI_CONDITION_END; //NO PTR
  2274. extern laUiType _LA_UI_CONDITION_ELSE; //NO PTR
  2275. extern laUiType _LA_UI_ROW_BEGIN; //NO PTR
  2276. extern laUiType _LA_UI_ROW_END; //NO PTR
  2277. extern laUiType _LA_UI_INVISIBLE; //NO PTR
  2278. extern laUiType *_LA_UI_COLLECTION;
  2279. extern laUiType *_LA_UI_COLLECTION_ITEM;
  2280. extern laUiType *_LA_UI_COLLECTION_SELECTOR;
  2281. extern laUiType *_LA_UI_COLLECTION_SINGLE;
  2282. extern laUiType *_LA_UI_BUTTON;
  2283. extern laUiType *_LA_UI_LABEL;
  2284. extern laUiType *_LA_UI_INT;
  2285. extern laUiType *_LA_UI_METER_TYPE1;
  2286. extern laUiType *_LA_UI_METER_TYPE2;
  2287. extern laUiType *_LA_UI_VALUE_METER_2D;
  2288. extern laUiType *_LA_UI_FLOAT;
  2289. extern laUiType *_LA_UI_FLOAT_COLOR;
  2290. extern laUiType *_LA_UI_FLOAT_COLOR_HCY;
  2291. extern laUiType *_LA_UI_ENUM_SELECTOR;
  2292. extern laUiType *_LA_UI_MENU_ROOT;
  2293. extern laUiType *_LA_UI_CONDITION_TOGGLE;
  2294. extern laUiType *_LA_UI_STRING;
  2295. extern laUiType *_LA_UI_STRING_MULTI;
  2296. extern laUiType *_LA_UI_ALIGN;
  2297. extern laUiType *_LA_UI_CANVAS;
  2298. extern laUiType *_LA_UI_COLUMN_ADJUSTER;
  2299. extern laUiType *_LA_UI_SYMBOL;
  2300. extern laUiType *_LA_UI_COLUMN_VIEWER;
  2301. extern laUiType *_LA_UI_NODE_SOCKET;
  2302. extern laUiType *_LA_UI_HEIGHT_ADJUSTER;
  2303. extern laUiType *_LA_UI_RAW;
  2304. extern laUiType *_LA_UI_MAPPER;
  2305. extern laUiType *_LA_UI_IMAGE;
  2306. extern laUiType *_LA_UI_SCOPE;
  2307. extern laUiDescriptor _LA_UI_DESCRIPTOR_REF_UI;
  2308. extern laUiDescriptor _LA_UI_DESCRIPTOR_REF_UIE;
  2309. extern laUiDescriptor _LA_UI_DESCRIPTOR_REF_P;
  2310. extern laUiDescriptor _LA_UI_DESCRIPTOR_REF_PE;
  2311. extern laUiDescriptor _LA_UI_DESCRIPTOR_REF_BASE;
  2312. extern laUiDescriptor _LA_UI_DESCRIPTOR_REF_ACT;
  2313. extern laUiDefineFunc _LA_SUBPROP_DONT_CARE;
  2314. extern laBoxedTheme *_LA_THEME_PANEL;
  2315. extern laBoxedTheme *_LA_THEME_VALUATOR;
  2316. extern laBoxedTheme *_LA_THEME_BUTTON;
  2317. extern laBoxedTheme *_LA_THEME_STRING;
  2318. extern laBoxedTheme *_LA_THEME_SELECTOR;
  2319. extern laBoxedTheme *_LA_THEME_COLLECTION_SELECTOR;
  2320. extern laBoxedTheme *_LA_THEME_LABEL;
  2321. extern laBoxedTheme *_LA_THEME_TAB;
  2322. extern laBoxedTheme *_LA_THEME_COLLECTION_GROUP;
  2323. extern laBoxedTheme *_LA_THEME_COLLECTION_ITEM;
  2324. extern laBoxedTheme *_LA_THEME_FLOATING_PANEL;
  2325. extern laBoxedTheme *_LA_THEME_3D_VIEW;
  2326. extern laBoxedTheme *_LA_THEME_2D_VIEW;
  2327. extern laBoxedTheme *_LA_THEME_SOCKET;
  2328. extern laProp *_LA_PROP_PANEL;
  2329. extern laProp *_LA_PROP_BLOCK;
  2330. extern laProp *_LA_PROP_WINDOW;
  2331. extern laProp *_LA_PROP_UI_ITEM;
  2332. extern laProp *_LA_PROP_FAILED_ITEM;
  2333. extern laProp *_LA_PROP_TRASH_ITEM;
  2334. extern laProp *_LA_PROP_NODE_GRAPH;
  2335. extern laPropContainer *_LA_PROP_3D_EXTRA;
  2336. extern laPropContainer *_LA_PROP_2D_EXTRA;
  2337. extern laPropContainer *_LA_PROP_FILE_BROWSER;
  2338. extern laProp _P_LA_USE_INSTANCE_ONLY;
  2339. #define _LA_USE_INSTANCE_ONLY (&_P_LA_USE_INSTANCE_ONLY)
  2340. #define LA_RH0 (MAIN.UiRowHeight)
  2341. #define LA_RH (MAIN.ScaledUiRowHeight)
  2342. #define LA_2RH (MAIN.ScaledUiRowHeight*2)
  2343. #define LA_RH2 ((int)(MAIN.ScaledUiRowHeight/2))
  2344. #define LA_SCROLL_W ((int)(MAIN.ScaledUiRowHeight * 0.67))
  2345. #define LA_SEAM_W ((int)(MAIN.ScaledUiRowHeight * 0.15))