*/}}

la_interface.h 87 KB

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