*/}}

la_interface.h 84 KB

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