*/}}

la_interface.h 87 KB

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