*/}}

la_interface.h 84 KB

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