*/}}

la_interface.h 74 KB

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