*/}}

la_interface.h 86 KB

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