*/}}

la_interface.h 72 KB

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