*/}}

la_interface.h 71 KB

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