*/}}

la_interface.h 72 KB

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