*/}}
1
0

la_interface.h 75 KB

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