*/}}

la_interface.h 85 KB

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