*/}}
1
0

la_interface.h 75 KB

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