*/}}

la_interface.h 84 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681
  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. #ifdef LA_USE_GLES
  20. #include <EGL/egl.h>
  21. #include <GL/gl.h>
  22. #else
  23. #include <GL/glew.h>
  24. #include <GL/gl.h>
  25. #endif
  26. #ifdef __linux__
  27. #include <X11/Xlib.h>
  28. #include <X11/Xutil.h>
  29. #include <X11/Xresource.h>
  30. #include <X11/Xlocale.h>
  31. #include <X11/XKBlib.h>
  32. #include <X11/Xatom.h>
  33. #include <GL/glx.h>
  34. #include <GL/glext.h>
  35. #endif
  36. #ifdef _WIN32
  37. #include <GL/wglew.h>
  38. #endif
  39. #include "la_5.h"
  40. #include "la_data.h"
  41. //#include "llvm-c/Analysis.h"
  42. //#include "llvm-c/BitWriter.h"
  43. //#include "llvm-c/Core.h"
  44. //#include "llvm-c/ExecutionEngine.h"
  45. //#include "llvm-c/Target.h"
  46. //#include <Windows.h>
  47. #define LA_VERSION_MAIN 5
  48. #define LA_VERSION_SUB 3
  49. #define LA_ACTUATOR_CAPABILITY_MAIN 5
  50. #define LA_ACTUATOR_CAPABILITY_SUB 0
  51. #define LA_NODE_MAIN_MODULE_NAME "LA_NODE_MAIN_MODULE"
  52. #define LA_GUI_WNDCLASS_NAME "LA_WINDOW_CLASS"
  53. #define LA_ARROW 0
  54. #define LA_CROSS 1
  55. #define LA_LEFT_AND_RIGHT 2
  56. #define LA_UP_AND_DOWN 3
  57. #define LA_HAND 4
  58. #define LA_MOVE 5
  59. #define LA_CORNER 6
  60. #define EVT_WND_MOVE -1
  61. #define EVT_WND_SIZE_BEGIN -2
  62. #define EVT_WND_SIZE_FINISH -3
  63. #define EVT_WND_SIZE -4
  64. #define EVT_WND_SHOW -5
  65. #define EVT_FEEDBACK 8192
  66. #define LA_KEYBOARD_EVENT (1<<0)
  67. #define LA_MOUSE_EVENT (1<<1)
  68. #define LA_STATE_MOVE (1<<2)
  69. #define LA_STATE_DOWN (1<<3)
  70. #define LA_STATE_UP (1<<4)
  71. #define LA_TIME_EVENT (1<<5)
  72. #define LA_TIME_IDLE (LA_TIME_EVENT|(1<<6))
  73. #define LA_TIME_DELAY (LA_TIME_EVENT|(1<<7))
  74. #define LA_KEY_MOUSE_LEFT (1<<8)
  75. #define LA_KEY_MOUSE_MIDDLE (1<<9)
  76. #define LA_KEY_MOUSE_RIGHT (1<<10)
  77. #define LA_KEY_MOUSE_SCROLL (1<<11)
  78. #define LA_KEY_BACKSPACE (1<<12)
  79. #define LA_KEY_ESCAPE (1<<13)
  80. #define LA_KEY_ENTER (1<<14)
  81. #define LA_INPUT (1<<15)
  82. #define LA_KEY_ARRLEFT (1<<16)
  83. #define LA_KEY_ARRRIGHT (1<<17)
  84. #define LA_KEY_ARRUP (1<<18)
  85. #define LA_KEY_ARRDOWN (1<<19)
  86. #define LA_KEY_SHIFT (1<<20)
  87. #define LA_KEY_CTRL (1<<21)
  88. #define LA_KEY_ALT (1<<22)
  89. #define LA_KEY_DELETE (1<<23)
  90. #define LA_KEY_TAB (1<<24)
  91. #define LA_KEY_EXTRA (1<<25)
  92. #define LA_KEY_NUM1 (LA_KEY_EXTRA+1)
  93. #define LA_KEY_NUM2 (LA_KEY_EXTRA+2)
  94. #define LA_KEY_NUM3 (LA_KEY_EXTRA+3)
  95. #define LA_KEY_NUM4 (LA_KEY_EXTRA+4)
  96. #define LA_KEY_NUM5 (LA_KEY_EXTRA+5)
  97. #define LA_KEY_NUM6 (LA_KEY_EXTRA+6)
  98. #define LA_KEY_NUM7 (LA_KEY_EXTRA+7)
  99. #define LA_KEY_NUM8 (LA_KEY_EXTRA+8)
  100. #define LA_KEY_NUM9 (LA_KEY_EXTRA+9)
  101. #define LA_KEY_NUM0 (LA_KEY_EXTRA+10)
  102. #define LA_KEY_NUMPLUS (LA_KEY_EXTRA+11)
  103. #define LA_KEY_NUMMINUS (LA_KEY_EXTRA+12)
  104. #define LA_KEY_NUMMULT (LA_KEY_EXTRA+13)
  105. #define LA_KEY_NUMDIVIDE (LA_KEY_EXTRA+14)
  106. #define LA_KEY_NUMDOT (LA_KEY_EXTRA+15)
  107. #define LA_KEY_NUMENTER (LA_KEY_EXTRA+16)
  108. #define LA_SIGNAL_EVENT (1<<31)
  109. #ifdef _WIN32
  110. #define XK_F1 1
  111. #define XK_F2 2
  112. #define XK_F3 3
  113. #define XK_F4 4
  114. #define XK_F5 5
  115. #define XK_F6 6
  116. #define XK_F7 7
  117. #define XK_F8 8
  118. #define XK_F9 9
  119. #define XK_F10 10
  120. #define XK_F11 11
  121. #define XK_F12 12
  122. #endif
  123. #define LA_KEY_F1 XK_F1
  124. #define LA_KEY_F2 XK_F2
  125. #define LA_KEY_F3 XK_F3
  126. #define LA_KEY_F4 XK_F4
  127. #define LA_KEY_F5 XK_F5
  128. #define LA_KEY_F6 XK_F6
  129. #define LA_KEY_F7 XK_F7
  130. #define LA_KEY_F8 XK_F8
  131. #define LA_KEY_F9 XK_F9
  132. #define LA_KEY_F10 XK_F10
  133. #define LA_KEY_F11 XK_F11
  134. #define LA_KEY_F12 XK_F12
  135. #define LA_KEY_SPECIALS (LA_KEY_CTRL|LA_KEY_SHIFT|LA_KEY_ALT)
  136. #define LA_MOUSEMOVE (LA_MOUSE_EVENT | LA_STATE_MOVE)
  137. #define LA_EMPTY LA_MOUSEMOVE
  138. #define LA_MOUSEDOWN (LA_MOUSE_EVENT | LA_STATE_DOWN)
  139. #define LA_MOUSEUP (LA_MOUSE_EVENT | LA_STATE_UP)
  140. #define LA_WHEEL (LA_MOUSE_EVENT | LA_KEY_MOUSE_SCROLL)
  141. #define LA_L_MOUSE_DOWN (LA_MOUSE_EVENT | LA_STATE_DOWN | LA_KEY_MOUSE_LEFT)
  142. #define LA_L_MOUSE_UP (LA_MOUSE_EVENT | LA_STATE_UP | LA_KEY_MOUSE_LEFT)
  143. #define LA_M_MOUSE_DOWN (LA_MOUSE_EVENT | LA_STATE_DOWN | LA_KEY_MOUSE_MIDDLE)
  144. #define LA_M_MOUSE_UP (LA_MOUSE_EVENT | LA_STATE_UP | LA_KEY_MOUSE_MIDDLE)
  145. #define LA_R_MOUSE_DOWN (LA_MOUSE_EVENT | LA_STATE_DOWN | LA_KEY_MOUSE_RIGHT)
  146. #define LA_R_MOUSE_UP (LA_MOUSE_EVENT | LA_STATE_UP | LA_KEY_MOUSE_RIGHT)
  147. #define LA_MOUSE_WHEEL_DOWN (LA_MOUSE_EVENT | LA_STATE_DOWN | LA_KEY_MOUSE_SCROLL)
  148. #define LA_MOUSE_WHEEL_UP (LA_MOUSE_EVENT | LA_STATE_UP | LA_KEY_MOUSE_SCROLL)
  149. #define LA_KEY_DOWN (LA_KEYBOARD_EVENT | LA_STATE_DOWN)
  150. #define LA_KEY_UP (LA_KEYBOARD_EVENT | LA_STATE_UP)
  151. #define LA_LEFT_DOWN (LA_KEYBOARD_EVENT | LA_KEY_ARRLEFT | LA_STATE_DOWN)
  152. #define LA_RIGHT_DOWN (LA_KEYBOARD_EVENT | LA_KEY_ARRRIGHT | LA_STATE_DOWN)
  153. #define LA_UP_DOWN (LA_KEYBOARD_EVENT | LA_KEY_ARRUP | LA_STATE_DOWN)
  154. #define LA_DOWN_DOWN (LA_KEYBOARD_EVENT | LA_KEY_ARRDOWN | LA_STATE_DOWN)
  155. #define LA_LEFT_UP (LA_KEYBOARD_EVENT | LA_KEY_ARRLEFT | LA_STATE_UP)
  156. #define LA_RIGHT_UP (LA_KEYBOARD_EVENT | LA_KEY_ARRRIGHT | LA_STATE_UP)
  157. #define LA_UP_UP (LA_KEYBOARD_EVENT | LA_KEY_ARRUP | LA_STATE_UP)
  158. #define LA_DOWN_UP (LA_KEYBOARD_EVENT | LA_KEY_ARRDOWN | LA_STATE_UP)
  159. #define LA_BACKSPACE_DOWN (LA_KEYBOARD_EVENT | LA_KEY_BACKSPACE | LA_STATE_DOWN)
  160. #define LA_BACKSPACE_UP (LA_KEYBOARD_EVENT | LA_KEY_BACKSPACE | LA_STATE_UP)
  161. #define LA_ESCAPE_DOWN (LA_KEYBOARD_EVENT | LA_KEY_ESCAPE | LA_STATE_DOWN)
  162. #define LA_ESCAPE_UP (LA_KEYBOARD_EVENT | LA_KEY_ESCAPE | LA_STATE_UP)
  163. #define LA_ENTER_DOWN (LA_KEYBOARD_EVENT | LA_KEY_ENTER | LA_STATE_DOWN)
  164. #define LA_ENTER_UP (LA_KEYBOARD_EVENT | LA_KEY_ENTER | LA_STATE_UP)
  165. #define LA_ONLY_BITS_AND(orig, yours) \
  166. ((orig & yours) == yours)
  167. NEED_STRUCTURE(laUiList);
  168. NEED_STRUCTURE(laUiItem);
  169. NEED_STRUCTURE(laColumn);
  170. typedef void (*laUiDrawFunc)(void *, int); //Instance,Theme
  171. typedef void (*laPanelDrawFunc)(void *, void *, void *); //SYSWINDOW,Instance,Theme
  172. //typedef void(*laUiDefineFunc)(laUiList*,laPropPack*,laPropPack*,laColumn*);//uil,collection inst+"This" inst,actuator inst,Extra column list.
  173. typedef void (*laOperatorArgumentParserFunc)(laStringSplitor *, uint32_t *, char *); //icon id,display string buf
  174. typedef int (*laUiGetHeightFunc)(laUiItem *);
  175. typedef int (*laUiGetMinWidthFunc)(laUiItem *);
  176. typedef int (*laUiConditionFunc)(laPropPack *); //maybe inst+actuator,replaceInst
  177. typedef void (*laUiDestroyFunc)(laUiItem *);
  178. typedef void (*laUiInitFunc)(laUiItem *);
  179. typedef void (*laUiRefreshFunc)(laUiItem *);
  180. typedef void (*laLayoutBkgDrawFunc)(void *, void *l);
  181. typedef void (*laPreFrameF)();
  182. typedef void (*laPreDrawF)();
  183. typedef void (*laPostFrameF)();
  184. typedef void (*laCleanupF)();
  185. STRUCTURE(laEvent){
  186. laListItem Item;
  187. laWindow* window;
  188. int type;
  189. int state;
  190. int x, y;
  191. int key;
  192. int SpecialKeyBit;
  193. int p1, p2;
  194. uint32_t Input;
  195. int GoodPressure,IsEraser,HasTwist;
  196. real Pressure,Orientation,Deviation,Twist,Hover;
  197. void *Localized;
  198. };
  199. typedef int (*laInputProcessF)(laEvent* e);
  200. NEED_STRUCTURE(laWindow)
  201. NEED_STRUCTURE(laRoot)
  202. NEED_STRUCTURE(laPanel)
  203. NEED_STRUCTURE(laUiItem)
  204. NEED_STRUCTURE(laUiList)
  205. NEED_STRUCTURE(laAnimationAction)
  206. NEED_STRUCTURE(laUiDescriptor)
  207. NEED_STRUCTURE(laUiConditionNode)
  208. STRUCTURE(laSharedTypeItem){
  209. laListItem Item;
  210. char ID[64];
  211. void *Pointer;
  212. };
  213. NEED_STRUCTURE(laTranslation);
  214. NEED_STRUCTURE(laTheme);
  215. STRUCTURE(laKeyMapper){
  216. laListItem Item;//unused;
  217. laListHandle Items;
  218. };
  219. STRUCTURE(laLogEntry){
  220. laListItem Item;
  221. laSafeString* Content;
  222. int Type;
  223. };
  224. NEED_STRUCTURE(laManagedUDF);
  225. STRUCTURE(laNodeOutSocket){
  226. void* Data;
  227. void* Parent;
  228. laSafeString* Label;
  229. int DataType, ArrLen;
  230. int RuntimeX, RuntimeY, RuntimePX, RuntimePY;
  231. void* Duplicated;
  232. };
  233. STRUCTURE(laNodeInSocket){
  234. laNodeOutSocket* Source;
  235. laSafeString* Label;
  236. int DataType, ArrLen; int ColorId;
  237. int RuntimeX, RuntimeY, RuntimePX, RuntimePY;
  238. };
  239. NEED_STRUCTURE(laBaseNodeType);
  240. NEED_STRUCTURE(laRackPage);
  241. NEED_STRUCTURE(laNodeCategory);
  242. STRUCTURE(laRackPageCollection){
  243. laRackPage* CurrentPage;
  244. laListHandle Pages;
  245. };
  246. typedef laBaseNodeType* (*laGetBaseNodeTypeF)(char* str);
  247. NEED_STRUCTURE(laConfirmData);
  248. STRUCTURE(laExtraPreferencePage){
  249. laListItem Item;
  250. const char* Name;
  251. laUiDefineFunc Func;
  252. };
  253. STRUCTURE(laProgressDisplay){
  254. char String[256];
  255. SYSWINDOW w;
  256. #ifdef __linux__
  257. GC gc;
  258. XGCValues gc_values;
  259. #endif
  260. #ifdef _WIN32
  261. HBRUSH brush_bg;
  262. HBRUSH brush_fg;
  263. HPEN pen_fg;
  264. HDC hdc;
  265. #endif
  266. laTimeRecorder TimeCalled;
  267. real p1,p2;
  268. int Called,Shown;
  269. };
  270. STRUCTURE(laInitArguments){
  271. int GLMajor,GLMinor,BufferSamples;
  272. int UseColorManagement;
  273. int HasWorldObjects;
  274. int HasAction;
  275. int HasTextureInspector;
  276. int HasHistories;
  277. int HasTerminal;
  278. int HasAudio;
  279. int GLDebug;
  280. int EnableLogStdOut;
  281. };
  282. NEED_STRUCTURE(laAnimation);
  283. NEED_STRUCTURE(laAudio);
  284. NEED_STRUCTURE(laInputMappingBundle);
  285. STRUCTURE(LA){
  286. laListItem Hyper;
  287. laListHandle Logs;
  288. char* TerminalInput[512];
  289. laListHandle TerminalHistories;
  290. int TerminalIncomplete;
  291. int IsTerminalEnter;
  292. #ifdef LA_WITH_LUAJIT
  293. lua_State *L;
  294. #endif
  295. laListHandle Controllers; int NextControllerID;
  296. u8bit LastControllerKey, LastControllerKeyDevice, ControllerHasNewKey;
  297. u8bit LastControllerAxis, LastControllerAxisDevice, ControllerHasNewAxis;
  298. laEvent* CurrentInputEvent;
  299. laInputProcessF InputProcess;
  300. laListHandle Windows;
  301. laListHandle WastedPanels;
  302. laListHandle Screens;
  303. int AutoSwitchColorSpace;
  304. laConfirmData *InvokeConfirmData;
  305. laPreFrameF PreFrame;
  306. laPreDrawF PreDraw;
  307. laPostFrameF PostFrame;
  308. laCleanupF Cleanup;
  309. real IdleStart, DelayStart;
  310. int DelayTriggered;
  311. int IdleTriggered;
  312. int ReTriggerOperators;
  313. laPanel* DockingPanel;
  314. char SysFontDir[512];
  315. laInitArguments InitArgs;
  316. char *InputBuf; int InputBufNext, InputBufMax;
  317. int32_t *InputBufU; int InputBufUNext, InputBufUMax;
  318. #ifdef __linux__
  319. Atom MsgDelWindow;
  320. Atom bufid;
  321. Atom fmtid;
  322. Atom propid;
  323. Atom incrid;
  324. Atom targets_atom;
  325. Atom text_atom;
  326. Atom UTF8;
  327. Atom selection;
  328. Atom wmstate,wmfullscr,wmfullscroff;
  329. #endif
  330. laSafeString* CopyPending;
  331. int GLMajor,GLMinor,BufferSamples;
  332. GLuint TempVAO;
  333. SYSTEMDISPLAY* dpy;
  334. SYSGLCONTEXT glc;
  335. #ifdef _WIN32
  336. HINSTANCE hinstance;
  337. HDC hdc;
  338. int WinTabAvailable, WinTabOpened, WinTabMaxPenPressure, WinTabMaxEraserPressure, WinTabMaxHover;
  339. #endif
  340. #ifdef __linux__
  341. Window* win;
  342. XVisualInfo* xvi;
  343. #ifdef LA_USE_GLES
  344. EGLConfig BestFBC;
  345. EGLDisplay egl_dpy;
  346. #else
  347. GLXFBConfig BestFBC;
  348. #endif
  349. Colormap cmap;
  350. XIM im;
  351. XIC ic;
  352. int xi_opcode;
  353. #endif
  354. int InkOrWinTab;
  355. int WacomDeviceStylus; real StylusPressure, StylusOrientation, StylusDeviation, StylusMaxPressure;
  356. int WacomDeviceEraser; real EraserPressure, EraserOrientation, EraserDeviation, EraserMaxPressure;
  357. int StylusHasTwist; real StylusTwist; real StylusHover;
  358. int PointerIsEraser,IsPen;
  359. int evLastX,evLastY;
  360. int EnableColorManagement;
  361. int EnableLogStdOut;
  362. int EnableGLDebug;
  363. int GLDebugSync;
  364. int GLDebugLevel;
  365. int GLDebugNeedsUpdate;
  366. int CurrentCursor;
  367. laWindow *CurrentWindow;
  368. laPanel *CurrentPanel;
  369. laListHandle DeferredRedrawList;
  370. laProgressDisplay Progress;
  371. laAudio* Audio;
  372. int InitDone;
  373. int IsReadingUDF;
  374. int SavePreferenceOnExit;
  375. laKeyMapper KeyMap;
  376. laHash256 OperatorTypeHash;
  377. //laHash256 CustomCommandHash;
  378. laSafeString* SignalFilter;
  379. laListHandle CustomSignals;
  380. laSafeString* ThumbnailProp;
  381. laListHandle ExtraExtensions;
  382. laListHandle ExtraPreferencePaths;
  383. laListHandle ExtraPreferencePages;
  384. laUiDefineFunc PreferencePageDisplay;
  385. laUiDefineFunc PreferencePageInput;
  386. laUiDefineFunc PreferencePageResource;
  387. laUiDefineFunc PreferencePageTheme;
  388. laPropContainer *GeneralIntSub;
  389. laPropContainer *GeneralFloatSub;
  390. laPropContainer *GeneralEnumSub;
  391. laPropContainer *GeneralIntArraySub;
  392. laPropContainer *GeneralFloatArraySub;
  393. laPropContainer *GeneralEnumArraySub;
  394. laPropContainer *GeneralStringSub;
  395. laPropContainer *GeneralOperatorSub;
  396. laPropContainer *GeneralCollectionSub;
  397. laPropContainer *GeneralRawSub;
  398. laPropContainer *ContainerInt;
  399. laPropContainer *ContainerFloat;
  400. laPropContainer *ContainerEnum;
  401. laPropContainer *ContainerString;
  402. laPropContainer *ContainerOperator;
  403. laPropContainer *ContainerCollection;
  404. laPropContainer *_CONTAINER_SETTING;
  405. laProp *_PROP_SETTING;
  406. laPropContainer *_CONTAINER_SETTING_PROPAGATE_TO;
  407. void *_CONTAINER_SETTING_INSTANCE;
  408. laListHandle PropContainers;
  409. laRoot DataRoot;
  410. laPanel *PropMatcherContextP;
  411. laPanel* PendingSplash;
  412. laTheme* CurrentTheme;
  413. laListHandle Themes;
  414. laListHandle UiTypes;
  415. laListHandle InitPanelTemplates;
  416. laListHandle PanelTemplates;
  417. laListHandle View2DTemplates;
  418. laUiDefineFunc MenuButtons;
  419. laUiDefineFunc MenuExtras;
  420. laUiDefineFunc AboutContent;
  421. laUiDefineFunc AboutVersion;
  422. laUiDefineFunc AboutAuthor;
  423. const char* MenuProgramName;
  424. SYSLOCK MemLock;
  425. SYSLOCK OpsLock;
  426. laHash256 GlobalMemPool;
  427. int ByteCount;
  428. int TotalByteCount;
  429. laHash65536* DBInstMemLeft;// list item pointers
  430. laHash65536 DBInst2;
  431. laHash65536 DBInst1;
  432. laHash65536 PtrSync;
  433. laListHandle PtrSyncAddressCommands;
  434. laListHandle PtrSyncHyper2Commands;
  435. laListHandle PostReadNodes;
  436. laListHandle RenewHyper2s;
  437. laListHandle SharedTypePointerSync;
  438. laListHandle PendingResourceRequests;
  439. laListHandle ResourceFolders;
  440. laListHandle ResourceRegistries;
  441. laListHandle UDFResources;
  442. laListHandle ManagedUDFs;
  443. laListHandle ManagedSaveProps;
  444. laManagedUDF* DummyManageUDF;
  445. laManagedUDF* DummyManageUDFSingle;
  446. laManagedUDF* DummyManageUDFSingleForce;
  447. int ManagerDefaultView;
  448. int SetUDFPending;
  449. laPropContainer* SaverDummyContainer;
  450. laListHandle DBInstPendingAcquireDBP;
  451. laListHandle DBInstPendingAcquireDiffCMD;
  452. laListHandle DiffTouched;
  453. laListHandle Differences;
  454. laDiff* HeadDifference;
  455. laDBInst RootDBInst;
  456. laListHandle DBRecordedProps;
  457. laHash65536* DBInstLink;
  458. laDiffPushEverythingF PushEverything;
  459. laPreSaveF PreSave;
  460. laPostSaveF PostSave;
  461. laAnimation* Animation;
  462. real FontSize;
  463. real MarginSize;
  464. int UiRowHeight;
  465. int ScaledUiRowHeight;
  466. real UiScale;
  467. void *ToPanel;
  468. int NextX, NextY, NextW, NextH;
  469. laNodeInSocket* tNodeIn;
  470. laNodeOutSocket* tNodeOut;
  471. laAuthorInfo Author;
  472. laListHandle ExternalAuthors;
  473. laSafeString *WorkingDirectory;
  474. //SYSLOCK csNotifier;
  475. laListHandle ThreadNotifiers;
  476. //preference:
  477. laInputMappingBundle* InputMapping;
  478. //color
  479. real ColorPickerGamma;
  480. real ViewportHalftoneFactor;
  481. real ViewportHalftoneSize;
  482. int NextWireColor, WireColorSlices;
  483. real WireThickness;
  484. real WireSaggyness;
  485. real* WireColorCache;
  486. //user interactions:
  487. int TopFramerate;
  488. int ValuatorThreshold;
  489. int ScrollingSpeed;
  490. int TooltipCloseDistance;
  491. real ZoomSpeed2D;
  492. real IdleTime;
  493. real DelayTime;
  494. //translations:
  495. laTranslation Translation;
  496. //display:
  497. real FloatingAlpha;
  498. int SolidShadowLength;
  499. int EnableAnimation;
  500. real AnimationSpeed;
  501. real PanelAnimationSpeed;
  502. int PanelMultisample;
  503. real LastFrameTime;
  504. real TimeAccum;
  505. //animation:
  506. int DefaultKeyFrameMode;
  507. //laThemeColor *ConditionStackColors[6];
  508. laListHandle MediaFiles;
  509. int GraphNeedsRebuild; // current mechanism only allows global.
  510. int InputNeedsEval;
  511. laListHandle NodeCategories;
  512. laNodeCategory* CurrentNodeCategory;
  513. int FilterNodeCategory;
  514. laBaseNodeType** NodeTypes; int NodeTypeNext, NodeTypeMax;
  515. laUiDefineFunc ExtraAddInputNodes;
  516. laUiDefineFunc ExtraAddDriverNodes;
  517. laGetBaseNodeTypeF ExtraGetInputNodeType;
  518. laGetBaseNodeTypeF ExtraGetDriverNodeType;
  519. //laHash256 RootNodes;
  520. //LLVMContextRef llvmContext;
  521. //LLVMModuleRef llvmModule;
  522. //SYSLOCK csMediaPlay;
  523. int DetachedViewSwitch;
  524. int example_int;
  525. laSafeString* example_string;
  526. };
  527. #define LA_KM_SEL_UI_EXTRA 1
  528. #define LA_KM_SEL_PANEL 2
  529. STRUCTURE(laKeyMapItem){
  530. laListItem Item;
  531. int SpecialKeyBits;
  532. int EventType;
  533. int Key;
  534. char SelectBase;
  535. laPropPack Base;
  536. laPropPack Action;
  537. laSafeString *Operation;
  538. laSafeString *Instructions;
  539. };
  540. STRUCTURE(laScreen){
  541. laListItem Item;
  542. laSafeString* Name;
  543. laSafeString* Description;
  544. int RoughDPI;
  545. int ColorSpace;
  546. int x,y,w,h;
  547. };
  548. NEED_STRUCTURE(laLayout);
  549. NEED_STRUCTURE(laBlock);
  550. NEED_STRUCTURE(laPanel);
  551. NEED_STRUCTURE(laUiItem);
  552. STRUCTURE(laWindow){
  553. laListItem Item;
  554. SYSWINDOW* win;
  555. SYSGLCONTEXT glc;
  556. #ifdef LA_USE_GLES
  557. EGLSurface egl_surf;
  558. #endif
  559. int GLDebugNeedsUpdate;
  560. GLuint vao;
  561. struct NVGcontext* nvg;
  562. #ifdef _WIN32
  563. HDC hdc;
  564. #endif
  565. int X,Y,W,H;
  566. int CW,CH;
  567. int Activated;
  568. int Shown;
  569. int IsDocking;
  570. int OutputColorSpace;
  571. int OutputShowStripes;
  572. int UseComposing; real ComposingGamma,ComposingBlackpoint;
  573. int IsFullScreen;
  574. int Redraw;
  575. int RedrawTouched;
  576. laPropPack PP;
  577. laPropStep FakePS;
  578. laSafeString *Title;
  579. laWindow* DockingFrom;
  580. laListHandle EventList;
  581. laSafeString *OperatorHints;
  582. laListHandle Layouts;
  583. laLayout *CurrentLayout;
  584. laBlock *MaximizedBlock;
  585. laPanel *MaximizedUiPanel;
  586. laUiItem *MaximizedUi;
  587. laListHandle Panels;
  588. laListHandle FadingPanels;
  589. laListHandle Operators;
  590. laListHandle PendingOperators;
  591. laUiDrawFunc Draw;
  592. };
  593. STRUCTURE(laBlock){
  594. int X, Y, W, H;
  595. laBlock *B1;
  596. laBlock *B2;
  597. laBlock *parent;
  598. laPanel *CurrentPanel;
  599. laListHandle Panels;
  600. int Vertical;
  601. int Folded;
  602. real SplitRatio; // From Left/Top;
  603. laPropPack PP;
  604. laPropPack FakePS;
  605. int OnButton;
  606. };
  607. #define LA_BLOCK_DROP_LOCATION_L 1
  608. #define LA_BLOCK_DROP_LOCATION_R 2
  609. #define LA_BLOCK_DROP_LOCATION_U 3
  610. #define LA_BLOCK_DROP_LOCATION_B 4
  611. STRUCTURE(laLayout){
  612. laListItem Item;
  613. laBlock *OperatingBlock;
  614. laBlock *FirstBlock;
  615. laBlock *MovingBlock;
  616. int IsMoving;
  617. laPanel *ClickedPanel;
  618. laBlock *DropToBlock;
  619. laBlock *OnBlockSeperator;
  620. char DropLocation;
  621. laSafeString *ID;
  622. laLayoutBkgDrawFunc Draw;
  623. };
  624. STRUCTURE(laUiList){
  625. laListItem Item;
  626. int L, R, U, B;
  627. int TL, TR, TU, TB;
  628. real PanX, PanY; //Pan Up/Left Is Positive
  629. laListHandle UiItems;
  630. laListHandle Columns;
  631. laListHandle *ShareColumns;
  632. laSafeString *TabName;
  633. char *Instance;
  634. short HeightCoeff;
  635. char ScrollerShownV;
  636. char ScrollerShownH;
  637. uint32_t IconID;
  638. int AllowScale;
  639. real Scale; real SaveScale;
  640. };
  641. STRUCTURE(laUiListRecord){
  642. laListItem Item;
  643. laUiList* uil;
  644. laUiItem* pui;
  645. };
  646. STRUCTURE(laColumn){
  647. laListItem Item;
  648. real PreWidth;
  649. real SP;
  650. int IL, IR;
  651. laColumn *Top;
  652. int MaxW;
  653. int B;
  654. laColumn *LS, *RS;
  655. laColumn *CopyRef;
  656. };
  657. STRUCTURE(laUiListDraw){
  658. laListHandle Items;
  659. laListHandle SocketRecord;
  660. laUiList* WiresContainer;
  661. };
  662. STRUCTURE(laUiListDrawItem){
  663. laListItem Item;
  664. laUiList *Target;
  665. int L, R, U, B, XP, YP, DifX, DifY;
  666. int ExtraPanX;
  667. real Scale;
  668. };
  669. STRUCTURE(laBoxedTheme){
  670. laListItem Item;
  671. laSafeString *Name;
  672. real NormalY, Normal[4], Inactive[4];
  673. real ActiveY, Active[4];
  674. real BorderY, Border[4];
  675. real TextY, Text[4];
  676. real TextActiveY, TextActive[4], TextInactive[4];
  677. real Alpha;
  678. int TextAlign;
  679. int Margins[4];
  680. int Paddings[4];
  681. //Don't change order
  682. int LM, RM, TM, BM;
  683. int LP, RP, TP, BP;
  684. laBoxedTheme **BackRef;
  685. laTheme* Parent;
  686. };
  687. STRUCTURE(laSocketRecord){
  688. laListItem Item;
  689. laNodeInSocket* In;
  690. laNodeOutSocket* Out;
  691. };
  692. extern laPropContainer* LA_PC_SOCKET_IN;
  693. extern laPropContainer* LA_PC_SOCKET_OUT;
  694. extern laPropContainer* LA_PC_MAPPER;
  695. extern laPropContainer* LA_PROP_SOCKET_SOURCE;
  696. extern laPropContainer* LA_PROP_SOCKET_OUT;
  697. extern laPropContainer* LA_PC_RACK_PAGE;
  698. extern laProp* LA_PROP_CONTROLLER;
  699. #define LA_UI_NORMAL 0
  700. #define LA_UI_ACTIVE (1<<0)
  701. #define LA_UI_EDITING (1<<1)
  702. #define LA_UI_DISABLED (1<<30)
  703. #define LA_BT_NORMAL LA_UI_NORMAL
  704. #define LA_BT_ACTIVE LA_UI_ACTIVE
  705. #define LA_BT_BORDER (1<<6)
  706. #define LA_BT_TEXT (1<<7)
  707. #define LA_BT_TEXT_NORMAL (LA_BT_TEXT|LA_UI_NORMAL)
  708. #define LA_BT_TEXT_ACTIVE (LA_BT_TEXT|LA_UI_ACTIVE)
  709. #define LA_BT_DISABLED LA_UI_DISABLED
  710. #define LA_BT_VERTEX (1<<8)
  711. #define LA_BT_EDGE (1<<9)
  712. #define LA_BT_FACE (1<<10)
  713. #define LA_BT_SELECTED (1<<11)
  714. #define LA_BT_SVERTEX (LA_BT_VERTEX|LA_BT_SELECTED)
  715. #define LA_BT_SEDGE (LA_BT_EDGE|LA_BT_SELECTED)
  716. #define LA_BT_SFACE (LA_BT_FACE|LA_BT_SELECTED)
  717. #define LA_BT_WARNING (1<<12)
  718. #define LA_UI_WARNING LA_BT_WARNING
  719. #define LA_UI_TAG_IS_OFFSCREEN (1<<0)
  720. #define LA_UI_TAG_CAVANS_SCALED (1<<1)
  721. #define LA_UI_TAG_NEED_REBUILD (LA_UI_TAG_IS_OFFSCREEN | LA_UI_TAG_CAVANS_SCALED)
  722. #define LA_UI_TAG_SCISSOR (1<<2)
  723. STRUCTURE(laTheme){
  724. laListItem Item;
  725. laSafeString *Name;
  726. laSafeString *Author;
  727. laListHandle Colors;
  728. laListHandle BoxedThemes;
  729. int abc;
  730. //
  731. real ColorBkg[4];
  732. real Color[4];
  733. real AccentColor[4];
  734. real WarningColor[4];
  735. real SelectionColor[4];
  736. real CursorColor[4];
  737. real InactiveMix;
  738. real InactiveSaturation;
  739. real CursorAlpha;
  740. real SelectionAlpha;
  741. real WireSaturation;
  742. real WireTransparency;
  743. real WireBrightness;
  744. real VertexColor[4];
  745. real EdgeColor[4];
  746. real SVertexColor[4];
  747. real SEdgeColor[4];
  748. real SFaceColor[4];
  749. real EdgeBrightness, EdgeTransparency;
  750. real VertexBrightness, VertexTransparency;
  751. real SelectedVertexTransparency;
  752. real SelectedEdgeTransparency;
  753. real SelectedFaceTransparency;
  754. };
  755. NEED_STRUCTURE(laOperatorType);
  756. STRUCTURE(laUiType){
  757. laListItem Item;
  758. const char *Identifier;
  759. int ForType;
  760. const char *TargetSub;
  761. //laPropStep FakePs;
  762. laSubProp* FakeProp;
  763. laPropContainer* ExtraProps;
  764. laBoxedTheme **Theme;
  765. laUiDrawFunc Draw;
  766. const char *OperatorID;
  767. laOperatorType *OperatorType;
  768. laUiGetMinWidthFunc GetMinWidth;
  769. laUiGetHeightFunc GetHeight;
  770. laUiDestroyFunc Destroy;
  771. laUiInitFunc Init;
  772. laKeyMapper KeyMapper;
  773. int Tag;
  774. };
  775. NEED_STRUCTURE(laUiItem);
  776. STRUCTURE(laGeneralUiExtraData){
  777. int LastX, LastY;
  778. int TargetIndexVali;
  779. real TargetIndexValf;
  780. int On; //On:Modifying
  781. int Dragging;
  782. laStringEdit *Edit;
  783. void *Ptr1;
  784. void *Ptr2;
  785. int HeightCoeff;
  786. laUiItem* ui;
  787. };
  788. STRUCTURE(laMultiStringExtra){
  789. laGeneralUiExtraData* general;
  790. int PanX, PanY;
  791. };
  792. NEED_STRUCTURE(laCanvasExtra);
  793. STRUCTURE(la3DObjectDrawExtra){
  794. int DisplayMode;
  795. int MeshEditType;
  796. tnsMatrix44d mViewProj;
  797. int W,H,Is3D;
  798. real PointScale;
  799. };
  800. typedef void(*laCanvasDrawFunc)(laBoxedTheme* bt, void* DataInstance, laCanvasExtra* Extra);
  801. typedef int (*laModalFunc)(laOperator *, laEvent *);
  802. STRUCTURE(laCanvasTemplate){
  803. laListItem Item;
  804. laSafeString *Identifier;
  805. laCanvasDrawFunc Draw;
  806. laUiDrawFunc SecondDraw;
  807. laKeyMapper KeyMapper;
  808. char *TargetContainerID;
  809. laPropContainer *TargetContainer;
  810. laPropContainer *ExtraProps;
  811. laSubProp *FakeProp;
  812. laModalFunc ExtraModal;
  813. //float LimitYScale;
  814. laUiInitFunc Init;
  815. laUiDestroyFunc Destroy;
  816. };
  817. #define LA_CANVAS_CURSOR_CROSS 1
  818. #define LA_CANVAS_CURSOR_BOX 2
  819. #define LA_CANVAS_CURSOR_ARROW 3
  820. #define LA_CANVAS_CURSOR_X 4
  821. #define LA_CANVAS_CURSOR_Y 5
  822. #define LA_CANVAS_SELECT_MODE_VERTS 0
  823. #define LA_CANVAS_SELECT_MODE_EDGES 1
  824. //#define LA_CANVAS_SELECT_MODE_FACES 2
  825. #define LA_CANVAS_SELECT_MODE_KNIFE 3
  826. #define LA_CANVAS_SELECT_THROUGH_OFF 0
  827. #define LA_CANVAS_SELECT_THROUGH_ON 1
  828. #define LA_CANVAS_DISPLAY_SOLID 0
  829. #define LA_CANVAS_DISPLAY_MATERIAL 1
  830. void la_CanvasDefaultOverlay(laUiItem* ui, int h);
  831. void la_CanvasDrawOverlay(laUiItem *ui, int h);
  832. void la_CanvasInit(laUiItem *ui);
  833. void la_CanvasDestroy(laUiItem *ui);
  834. STRUCTURE(laCanvasExtra){
  835. laListItem Item;
  836. tnsOffscreen *OffScr;
  837. tnsOffscreen *DeferredOffScr;
  838. laUiItem *ParentUi;
  839. real ZoomX,ZoomY;
  840. real PanX,PanY;
  841. int DrawCursor;
  842. real OnX, TargetX;
  843. real OnY, TargetY;
  844. real ClickedX,ClickedY;
  845. int LW,ShowLegend,UiMode;
  846. int HeightCoeff;
  847. int ShowDetails;
  848. int ImageDrawAlpha;
  849. int ImageDrawBorder;
  850. int AdaptiveLineWidth;
  851. int LineWidthWarning;
  852. int ClearBackground;
  853. int SelectMode;
  854. int SelectThrough;
  855. int EditCenter;
  856. int DeltaMode;
  857. real BL, BR, BU, BB;
  858. int Dragging;
  859. int TargetIndexVali;
  860. //3d==========
  861. tnsOffscreen *OffScrShadow;
  862. tnsCamera *ViewingCamera; //Always create this one;
  863. tnsCamera *UsingCamera;
  864. int Layers[20];
  865. int AsPlayer;
  866. int ShowFloorGrid;
  867. int ShowAxis[3];
  868. int DisplayMode;
  869. };
  870. NEED_STRUCTURE(laUiConditionNode);
  871. STRUCTURE(laConditionUiExtraData){
  872. int a;
  873. laUiItem *EndUi;
  874. laUiItem *ElseUi;
  875. laUiConditionNode *Expression;
  876. //char Remove;
  877. char IsTrue;
  878. };
  879. STRUCTURE(laUiTemplate){
  880. laListItem Item;
  881. laSafeString *Title;
  882. laSafeString *Identifier;
  883. laSafeString *CategoryName;
  884. laUiDefineFunc Define;
  885. laUiDefineFunc Header;
  886. laPanelDetachedPropFunc PropFunc;
  887. int DefaultGLFormat;
  888. int DefaultW_RH,DefaultH_RH;
  889. laKeyMapper KeyMap;
  890. };
  891. #define LA_SLOT_MARKER_1 0
  892. #define LA_SLOT_MARKER_2 1
  893. #define LA_SLOT_MARKER_3 2
  894. #define LA_SLOT_MARKER_4 3
  895. STRUCTURE(laCompoundPP){
  896. laListItem Item;
  897. int Slot;
  898. laPropPack PP;
  899. };
  900. STRUCTURE(laUiItem){
  901. laListItem Item;
  902. laColumn *C;
  903. int L, R, U, B;
  904. int TL, TR, TU, TB;
  905. int AnimationDistinguish;
  906. int State; int Flags; // expand and even (in row control ui)
  907. laPropPack ExtraPP;
  908. laPropStep FakePs;
  909. laGeneralUiExtraData *Extra;
  910. short Expand;
  911. short SymbolID;
  912. laPropPack PP;
  913. laListHandle CompoundPPs;
  914. laSafeString *Display;
  915. laSafeString *ExtraInstructions;
  916. laUiType *Type;
  917. laCanvasTemplate *CanvasTemplate;
  918. laUiList *Page; // reuse as row begin ref
  919. laOperatorType *AT; //Probably share in the future;
  920. laStringSplitor *Instructions;
  921. laListHandle Subs;
  922. laUiDefineFunc Template;
  923. int TemplateContext;
  924. laListHandle SubPanels;
  925. };
  926. STRUCTURE(laWidget){
  927. laUiType* Type;
  928. int Flags;
  929. };
  930. #define LA_UI_FLAGS_TRANSPOSE (1<<0)
  931. #define LA_UI_FLAGS_EXPAND (1<<1)
  932. #define LA_UI_FLAGS_ICON (1<<2)
  933. #define LA_UI_FLAGS_CYCLE (1<<3)
  934. #define LA_UI_FLAGS_NO_DECAL (1<<4)
  935. #define LA_UI_FLAGS_NO_EVENT (1<<5)
  936. #define LA_UI_FLAGS_NO_CONFIRM (1<<6)
  937. #define LA_TEXT_ALIGN_LEFT (1<<7)
  938. #define LA_TEXT_ALIGN_RIGHT (1<<8)
  939. #define LA_TEXT_ALIGN_CENTER (1<<9)
  940. #define LA_TEXT_ALIGN_AUTO (1<<10)
  941. #define LA_TEXT_USE_NEWLINE (1<<11)
  942. #define LA_TEXT_LINE_WRAP (1<<12)
  943. #define LA_TEXT_REVERT_Y (1<<13)
  944. #define LA_TEXT_MONO (1<<14)
  945. #define LA_UI_FLAGS_PREFER_BOTTOM (1<<15)
  946. #define LA_UI_FLAGS_NO_GAP (1<<16)
  947. #define LA_UI_FLAGS_UNDERNEATH (1<<17)
  948. #define LA_UI_FLAGS_NO_HEIGHT (LA_UI_FLAGS_NO_GAP|LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_UNDERNEATH)
  949. #define LA_UI_FLAGS_NO_OVERLAY (1<<18)
  950. #define LA_TEXT_OVERFLOW_ARROW (1<<19)
  951. #define LA_UI_FLAGS_DISABLED (1<<20)
  952. #define LA_UI_FLAGS_HIGHLIGHT (1<<21)
  953. #define LA_UI_FLAGS_NODE_CONTAINER (1<<22)
  954. #define LA_UI_COLLECTION_NO_HIGHLIGHT LA_TEXT_ALIGN_LEFT
  955. #define LA_TEXT_ONE_LINE (1<<23)
  956. #define LA_UI_FLAGS_NO_SCROLL_INACTIVE (1<<24)
  957. #define LA_UI_FLAGS_COLOR_SPACE_CLAY (1<<25)
  958. #define LA_UI_FLAGS_EXIT_WHEN_TRIGGERED LA_UI_FLAGS_COLOR_SPACE_CLAY
  959. #define LA_TEXT_LCD_16 (1<<27)
  960. #define LA_TEXT_LCD_7 (1<<28)
  961. #define LA_UI_FLAGS_NO_TOOLTIP LA_UI_FLAGS_PREFER_BOTTOM
  962. #define LA_UI_IMAGE_FULL_W LA_TEXT_MONO
  963. #define LA_UI_MIN_WIDTH LA_UI_FLAGS_COLOR_SPACE_CLAY
  964. #define LA_UI_FLAGS_NO_LABEL (1<<29)
  965. #define LA_UI_COLLECTION_SIMPLE_SELECTOR LA_UI_FLAGS_CYCLE
  966. #define LA_UI_FLAGS_WARNING (LA_UI_FLAGS_CYCLE)
  967. #define LA_UI_FLAGS_INT_ICON (LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_EVENT|LA_UI_FLAGS_ICON)
  968. #define LA_UI_FLAGS_PLAIN (LA_UI_FLAGS_NO_DECAL|LA_UI_FLAGS_NO_EVENT)
  969. #define LA_TEXT_ALIGN (LA_TEXT_ALIGN_LEFT|LA_TEXT_ALIGN_CENTER|LA_TEXT_ALIGN_RIGHT|LA_TEXT_ALIGN_AUTO)
  970. #define LA_UI_FLAGS_COLORFUL LA_UI_FLAGS_ICON
  971. #define LA_UI_FLAGS_TERMINAL_INPUT LA_UI_FLAGS_COLOR_SPACE_CLAY
  972. #define LA_UI_FLAGS_IMMEDIATE_INPUT LA_UI_FLAGS_CYCLE
  973. #define LA_UI_FLAGS_MOMENTARY (LA_UI_FLAGS_CYCLE|LA_UI_FLAGS_NODE_CONTAINER)
  974. #define LA_UI_FLAGS_KNOB LA_UI_FLAGS_NODE_CONTAINER
  975. #define LA_UI_SOCKET_LABEL_N LA_TEXT_ALIGN_LEFT
  976. #define LA_UI_SOCKET_LABEL_S LA_TEXT_ALIGN_RIGHT
  977. #define LA_UI_SOCKET_LABEL_W LA_TEXT_ALIGN_CENTER
  978. #define LA_UI_SOCKET_LABEL_E LA_TEXT_ALIGN_AUTO
  979. extern laWidget* LA_WIDGET_FIXED_GROUP;
  980. extern laWidget* LA_WIDGET_TAB;
  981. extern laWidget* LA_WIDGET_COLLECTION;
  982. extern laWidget* LA_WIDGET_COLLECTION_ITEM;
  983. extern laWidget* LA_WIDGET_COLLECTION_SELECTOR;
  984. extern laWidget* LA_WIDGET_COLLECTION_SINGLE;
  985. extern laWidget* LA_WIDGET_CONDITION_TOGGLE;
  986. extern laWidget* LA_WIDGET_COLUMN_ADJUSTER;
  987. extern laWidget* LA_WIDGET_COLUMN_VIEWER;
  988. extern laWidget* LA_WIDGET_BUTTON;
  989. extern laWidget* LA_WIDGET_BUTTON_NO_CONFIRM;
  990. extern laWidget* LA_WIDGET_LABEL;
  991. extern laWidget* LA_WIDGET_INT;
  992. extern laWidget* LA_WIDGET_INT_PLAIN;
  993. extern laWidget* LA_WIDGET_INT_PLAIN_ICON;
  994. extern laWidget* LA_WIDGET_METER_TYPE1;
  995. extern laWidget* LA_WIDGET_METER_TYPE2;
  996. extern laWidget* LA_WIDGET_VALUE_METER_2D;
  997. extern laWidget* LA_WIDGET_FLOAT;
  998. extern laWidget* LA_WIDGET_FLOAT_PLAIN;
  999. extern laWidget* LA_WIDGET_FLOAT_COLOR;
  1000. extern laWidget* LA_WIDGET_FLOAT_COLOR_HCY;
  1001. extern laWidget* LA_WIDGET_ENUM_SELECTOR;
  1002. extern laWidget* LA_WIDGET_ENUM_SELECTOR_ICON;
  1003. extern laWidget* LA_WIDGET_ENUM_CYCLE;
  1004. extern laWidget* LA_WIDGET_ENUM_CYCLE_ICON;
  1005. extern laWidget* LA_WIDGET_ENUM_ICON_PLAIN;
  1006. extern laWidget *LA_WIDGET_ENUM_HIGHLIGHT;
  1007. extern laWidget* LA_WIDGET_STRING;
  1008. extern laWidget* LA_WIDGET_STRING_PLAIN;
  1009. extern laWidget* LA_WIDGET_STRING_MULTI;
  1010. extern laWidget *LA_WIDGET_STRING_MONO_PLAIN;
  1011. extern laWidget* LA_WIDGET_MENU_ROOT;
  1012. extern laWidget* LA_WIDGET_ALIGN;
  1013. extern laWidget* LA_WIDGET_3D_VIEW;
  1014. extern laWidget* LA_WIDGET_2D_VIEW;
  1015. extern laWidget* LA_WIDGET_SYMBOL;
  1016. extern laWidget *LA_WIDGET_NODE_SOCKET;
  1017. extern laWidget *LA_WIDGET_HEIGHT_ADJUSTER;
  1018. extern laWidget *LA_WIDGET_RAW;
  1019. extern laWidget *LA_WIDGET_MAPPER;
  1020. extern laWidget *LA_WIDGET_IMAGE;
  1021. extern laWidget *LA_WIDGET_SCOPE;
  1022. extern laWidget *LA_WIDGET_KNOB;
  1023. #define LA_CONDITION_TRUE 1
  1024. #define LA_CONDITION_FALSE 2
  1025. #define LA_CONDITION_GE 3
  1026. #define LA_CONDITION_GT 4
  1027. #define LA_CONDITION_EQ 5
  1028. #define LA_CONDITION_LT 6
  1029. #define LA_CONDITION_LE 7
  1030. #define LA_CONDITION_AND 8
  1031. #define LA_CONDITION_OR 9
  1032. #define LA_CONDITION_NOT 10
  1033. #define LA_CONDITION_INT 11
  1034. #define LA_CONDITION_FLOAT 12
  1035. #define LA_CONDITION_STRING 13
  1036. #define LA_CONDITION_PROP 14
  1037. STRUCTURE(laUiConditionNode){
  1038. char a;
  1039. int Type;
  1040. laUiConditionNode *Expression1; // As Int Value
  1041. laUiConditionNode *Expression2;
  1042. laUiDescriptor *Base;
  1043. char IsExtra;
  1044. int IntValue;
  1045. real FloatValue;
  1046. laSafeString *String; //used as prop path in template
  1047. laPropPack PP;
  1048. };
  1049. #define LA_PANEL_NORMAL 0
  1050. #define LA_PANEL_FLOATING_PASSIVE 2
  1051. #define LA_PANEL_FLOATING_TOP 3
  1052. #define LA_PANEL_NO_PARENT_MENU 4
  1053. #define LA_TAG_REDRAW 1
  1054. #define LA_TAG_RECALC 2
  1055. #define LA_TAG_ANIMATION 4
  1056. #define LA_TAG_RECALC_SCROLLER 8
  1057. #define LA_PANEL_ANIMATION_DROP_DOWN 1
  1058. #define LA_PANEL_ANIMATION_EXPAND 2
  1059. #define LA_PANEL_ANIMATION_DISSOVE 3
  1060. #define LA_PANEL_ANIMATION_COLLAPSE 4
  1061. #define LA_PANEL_ANIMATION_MINIMIZE 5
  1062. #define LA_PANEL_ANIMATION_FLASH 126
  1063. #define LA_PANEL_ANIMATION_DESTROY 127
  1064. NEED_STRUCTURE(laOperator);
  1065. NEED_STRUCTURE(laOperator);
  1066. STRUCTURE(laPanel){
  1067. laListItem Item;
  1068. int __SAFE__;
  1069. int X, Y, W, H;
  1070. int MaxW, MaxH, MinW, MinH;
  1071. int TX, TY, TW, TH;
  1072. int TitleWidth;
  1073. char AnimationMode;
  1074. real AnimationRatio;
  1075. //int PanX, PanY;
  1076. int Show;
  1077. short Refresh;
  1078. short ShowCorner;
  1079. unsigned int FrameDistinguish;
  1080. char BoundUi;
  1081. char IsMenuPanel;
  1082. char LaterDestroy;
  1083. char CloseWhenMovedOut;
  1084. int Mode;
  1085. int LiveEditing;
  1086. laUiItem *EditingUi;
  1087. laUiItem *FocusingUi;
  1088. void *SFPNode;
  1089. int SL, SR, ST, SB; //Snap To Edge
  1090. laSafeString *Title;
  1091. laUiTemplate *PanelTemplate;
  1092. laPropPack PP;
  1093. laPropStep FakePS;
  1094. laPropContainer* PropLinkContainer;
  1095. laSubProp* PropLinkFakeProp;
  1096. laPropPack PropLinkPP;
  1097. laPropStep PropLinkFakePS;
  1098. laKeyMapper KeyMap;
  1099. laPanelDrawFunc Draw;
  1100. laBoxedTheme **BT;
  1101. tnsOffscreen *OffScr;
  1102. laUiList UI;
  1103. laUiList TitleBar;
  1104. laUiList *MenuRefer;
  1105. laUiDefineFunc UiDefine;
  1106. laListHandle SubPanels;
  1107. laPanel *Parent;
  1108. laBlock *Block;
  1109. laOperator *ParentOperator;
  1110. u64bit Tag;
  1111. //64 Main Types are useable,with 31 subtypes avainable each.
  1112. //Main Type 0~63(some are occupied by LA internal)
  1113. //Sub Type 0~31
  1114. //Main (Low) 0| 1| 2| 3|...
  1115. //[---32bits---][---32bits---][---32bits---][---32bits---]...
  1116. };
  1117. STRUCTURE(laPanelMessage){
  1118. laListItem Item;
  1119. laSafeString *Message;
  1120. };
  1121. STRUCTURE(laPanelMessageList){
  1122. laListHandle Msg;
  1123. };
  1124. NEED_STRUCTURE(laOperator);
  1125. typedef int (*laInitFunc)(laOperator *);
  1126. typedef int (*laRefreshFunc)(laOperator *);
  1127. typedef int (*laCheckFunc)(laPropPack *, laStringSplitor *); //this, ui->instructions amd ap->instructions
  1128. typedef void (*laExitFunc)(laOperator *, int); //true means Quit, false means Cancel
  1129. typedef int (*laInvokeFunc)(laOperator *, laEvent *);
  1130. typedef int (*laModalFunc)(laOperator *, laEvent *);
  1131. typedef int (*laSystemFunc)(laOperator *, laEvent *);
  1132. #define LA_CANCEL 0
  1133. #define LA_PASS_ON (1<<10)
  1134. #define LA_BLOCK (1<<11)
  1135. #define LA_FINISH (1<<12)
  1136. #define LA_CONFIRM (1<<13)
  1137. #define LA_CANCELED 0
  1138. //#define LA_PRE_INVOKE 16384
  1139. #define LA_FINISHED (LA_FINISH | LA_BLOCK)
  1140. #define LA_FINISHED_PASS (LA_FINISH | LA_PASS_ON)
  1141. #define LA_RUNNING LA_BLOCK
  1142. #define LA_RUNNING_PASS (LA_BLOCK | LA_PASS_ON)
  1143. #define LA_OPERATOR_CALLS_SHUTOFF (LA_FINISHED|(1<<5))
  1144. #define LA_EXTRA_TO_PANEL 1
  1145. #define LA_EXTRA_CONFIRM 2
  1146. #define LA_ACTUATOR_SYSTEM 4
  1147. #define LA_ACTUATOR_HIDDEN 8
  1148. #define LA_CONFIRM_OK (1<<10)
  1149. #define LA_CONFIRM_CANCEL (1<<11)
  1150. #define LA_CONFIRM_IGNORE (1<<12)
  1151. #define LA_CONFIRM_DATA (1<<13)
  1152. #define LA_CONFIRM_CUSTOM_STRING (1<<14)
  1153. STRUCTURE(laOperatorType){
  1154. laListItem Item;
  1155. const char *Identifier;
  1156. const char *Name;
  1157. const char *Description;
  1158. const char *ExtraInstructions;
  1159. laInitFunc Init;
  1160. laExitFunc Exit;
  1161. laInvokeFunc Invoke;
  1162. laModalFunc Modal;
  1163. laCheckFunc Check;
  1164. uint32_t IconID;
  1165. laPropContainer* PC;
  1166. laUiDefineFunc UiDefine;
  1167. laOperatorArgumentParserFunc ParseArgs;
  1168. laListHandle Properties;
  1169. int ExtraMark;
  1170. };
  1171. typedef void (*laConfirmDataDestroyFunc)(void *);
  1172. STRUCTURE(laConfirmData){
  1173. int Mode;
  1174. int IData;
  1175. real FData;
  1176. void *CustomData;
  1177. char *StrData;
  1178. void* PointerData;
  1179. laPropContainer* PointerType;
  1180. laConfirmDataDestroyFunc Destroy;
  1181. };
  1182. STRUCTURE(laOperator){
  1183. laListItem Item;
  1184. int State;
  1185. void *Instance;
  1186. void *CustomData;
  1187. const char *ExtraInstructions;
  1188. laStringSplitor *ExtraInstructionsP;
  1189. laPropPack PP;
  1190. laPropPack *This;
  1191. laConfirmData *ConfirmData;
  1192. laConfirmData *NextConfirmData;
  1193. laOperator *Child;
  1194. laListHandle PropertyStorage;
  1195. laOperatorType *Type;
  1196. laPropPack *CreatedThis;
  1197. int Using;
  1198. int StopNow;
  1199. int ModalOver;
  1200. laPanel *ToPanel;
  1201. laPanel *OperatorPanel;
  1202. laListHandle LocalUiLists;
  1203. laSafeString* RuntimeHint;
  1204. };
  1205. #define LA_INPUT_DEVICE_KEYBOARD 0
  1206. #define LA_INPUT_DEVICE_JOYSTICK 1
  1207. STRUCTURE(laInputMapping){
  1208. laListItem Item;
  1209. laSafeString* Name;
  1210. laListHandle Entries;
  1211. };
  1212. STRUCTURE(laInputMappingEntry){
  1213. laListItem Item;
  1214. laInputMapping* Parent;
  1215. int DeviceType;
  1216. int JoystickDevice; int Axis, Button;
  1217. laSafeString* Key; int KeyValue;
  1218. int SpecialKeyBits;
  1219. laSafeString* Signal; int SignalValue;
  1220. };
  1221. STRUCTURE(laInputMappingBundle){
  1222. void* _pad;
  1223. laListHandle InputMappings;
  1224. laInputMapping* CurrentInputMapping;
  1225. };
  1226. #define LA_SIGNAL_NEW 10000
  1227. #define LA_SIGNAL_DELETE 10001
  1228. #define LA_SIGNAL_CONFIRM 10002
  1229. #define LA_SIGNAL_UNDO 10003
  1230. #define LA_SIGNAL_REDO 10004
  1231. #define LA_SIGNAL_OPEN 10005
  1232. #define LA_SIGNAL_SAVE 10006
  1233. #define LA_SIGNAL_SAVE_AS 10007
  1234. #define LA_SIGNAL_LAYOUT_NEXT 10008
  1235. #define LA_SIGNAL_LAYOUT_PREV 10009
  1236. #define LA_SIGNAL_FULLSCREEN 10010
  1237. STRUCTURE(laCustomSignal){
  1238. laListItem Item;
  1239. //laListItem Item2;
  1240. laSafeString* Name;
  1241. int Signal;
  1242. };
  1243. #define LA_JS_MAX_AXES 64
  1244. #define LA_JS_MAX_BUTTONS 128
  1245. STRUCTURE(laController){
  1246. laListItem Item;
  1247. laSafeString* Name;
  1248. laSafeString* Path;
  1249. int fd; //device;
  1250. int NumButtons; int NumAxes; int UserAssignedID; int Error;
  1251. int InternalType; // used to identify models and use specific props.
  1252. int16_t AxisValues[LA_JS_MAX_AXES],SaveAxisValues[LA_JS_MAX_AXES];
  1253. int AxisMaxes[LA_JS_MAX_AXES];
  1254. int AxisMins[LA_JS_MAX_AXES];
  1255. int16_t AxisLimitMaxes[LA_JS_MAX_AXES]; // calibrated max;
  1256. int16_t AxisLimitMins[LA_JS_MAX_AXES];
  1257. int16_t AxisCenterMaxes[LA_JS_MAX_AXES]; // calibrated center;
  1258. int16_t AxisCenterMins[LA_JS_MAX_AXES];
  1259. char ButtonValues[LA_JS_MAX_BUTTONS];
  1260. u8bit ButtonsMap[LA_JS_MAX_BUTTONS];
  1261. u8bit AxisMap[LA_JS_MAX_AXES];
  1262. laSafeString* ButtonNames[LA_JS_MAX_BUTTONS];
  1263. laSafeString* AxisNames[LA_JS_MAX_AXES];
  1264. };
  1265. void la_RefreshControllers();
  1266. void la_InitControllers();
  1267. void la_RemoveDuplicatedControllers();
  1268. void la_UpdateControllerStatus();
  1269. void la_RegisterControllerProps();
  1270. laPropContainer* laget_ControllerType(laController* c);
  1271. laController* la_FindControllerWithID(int id);
  1272. char* laControllerIDGetAxisName(int id, int axis);
  1273. char* laControllerIDGetButtonName(int id, int button);
  1274. int laControllerIDGetAxis(int id, char* name);
  1275. int laControllerIDGetButton(int id, char* name);
  1276. void la_RegisterBasicNodes();
  1277. #define LA_DAG_FLAG_ERR 0
  1278. #define LA_DAG_FLAG_TEMP 1
  1279. #define LA_DAG_FLAG_PERM 2
  1280. int laRebuildPageEval(laRackPage* rp);
  1281. int laRunPage(laRackPage* rp, uint64_t mask);
  1282. void laGraphRequestRebuild();
  1283. int la_RunDrivers();
  1284. void lapost_Node(laBaseNode *bn);
  1285. laBaseNode* la_CreateDriverNode(laNodeRack* ir, laBaseNodeType* NodeType);
  1286. void* laget_InstanceSelf(void* instace);
  1287. laPropContainer* laget_BaseNodeType(laBaseNode* bn);
  1288. void laRegisterNode(laBaseNodeType* type, laPropContainer* pc,
  1289. laBaseNodeInitF init, laBaseNodeDestroyF destroy, laBaseNodeVisitF visit, laBaseNodeEvalF eval, laBaseNodeCopyF copy,
  1290. int nodesize, char* udf_string, char* type_string, char* UiText, int icon);
  1291. void latouched_NodeInSocket(void* unused, int hint);
  1292. #define LA_BASE_NODE_HEADER(uil,c,This) \
  1293. {laSplitColumn(uil,c,0.2);laColumn*c1=laLeftColumn(c,1);c=laRightColumn(c,0);\
  1294. laShowHeightAdjuster(uil,c1,This,"base.__gap",0);}
  1295. #define LA_IDN_REGISTER(uitext,icon,a,pc,funcname,type) \
  1296. laRegisterNode(&a,pc,funcname##Init,funcname##Destroy,funcname##Visit,funcname##Eval,funcname##Copy,sizeof(type),"UDFRES_" #type, #type, uitext,icon);
  1297. #define LA_SRC_AND_PARENT(socket) \
  1298. ((socket)->Source && (socket)->Source->Parent)
  1299. #define LA_VISIT_NODE(node,vi) \
  1300. {if(node){int result=node->Type->Visit(node,vi); if(result!=LA_DAG_FLAG_PERM) return LA_DAG_FLAG_ERR;} }
  1301. #define LA_GUARD_THIS_NODE(n,vi) \
  1302. {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; }
  1303. #define LA_ADD_THIS_NODE(n,vi) \
  1304. {uint64_t br=vi->Branch; if(!n->Base.Branch){ lstAppendPointer(vi->l,n); } n->Base.Branch|=br; n->Base.BranchTemp&=(~br); }
  1305. #define LA_GET_SRC_AS_VALUE(var, socket) \
  1306. {if(socket->Source&&socket->Source->DataType&LA_PROP_FLOAT) var=*((real*)socket->Source->Data);\
  1307. if(socket->Source&&socket->Source->DataType&(LA_PROP_INT|LA_PROP_ENUM)) var=*((int*)socket->Source->Data);}
  1308. #define LA_IDN_OLD_DUPL(socket) \
  1309. old->socket->Duplicated=new->socket;
  1310. #define LA_IDN_NEW_LINK(socket) \
  1311. { memAssignRef(new->socket,&new->socket->Source,old->socket->Source?old->socket->Source->Duplicated:0); new->socket->ColorId=old->socket->ColorId; }
  1312. extern laBaseNodeType LA_IDN_KEYBOARD;
  1313. extern laBaseNodeType LA_IDN_MOUSE;
  1314. extern laBaseNodeType LA_IDN_CONTROLLER;
  1315. extern laBaseNodeType LA_IDN_VISUALIZER;
  1316. extern laBaseNodeType LA_IDN_SPLIT;
  1317. extern laBaseNodeType LA_IDN_SWITCH;
  1318. extern laBaseNodeType LA_IDN_COMBINE;
  1319. extern laBaseNodeType LA_IDN_VALUES;
  1320. extern laBaseNodeType LA_IDN_MATRIX;
  1321. extern laBaseNodeType LA_IDN_MATH;
  1322. extern laBaseNodeType TNS_IDN_TRANSFORM;
  1323. extern laBaseNodeType TNS_IDN_MAKE_TRANSFORM;
  1324. extern laNodeCategory* LA_NODE_CATEGORY_INPUT;
  1325. extern laNodeCategory* LA_NODE_CATEGORY_MATH;
  1326. extern laNodeCategory* LA_NODE_CATEGORY_ROUTE;
  1327. extern laNodeCategory* LA_NODE_CATEGORY_DRIVER;
  1328. extern laNodeCategory* LA_NODE_CATEGORY_AUX;
  1329. extern laNodeCategory* LA_NODE_CATEGORY_COLOR;
  1330. #define LA_VALUES_NODE_FLOAT 0
  1331. #define LA_VALUES_NODE_INT 1
  1332. #define LA_VALUES_NODE_ENUM 2
  1333. #define LA_MATRIX_NODE_OP_MUL 0
  1334. #define LA_MATRIX_NODE_OP_INV 1
  1335. #define LA_MATH_NODE_OP_ADD 0
  1336. #define LA_MATH_NODE_OP_SUB 1
  1337. #define LA_MATH_NODE_OP_MUL 2
  1338. #define LA_MATH_NODE_OP_DIV 3
  1339. #define LA_MATH_NODE_OP_POW 4
  1340. #define LA_MATH_NODE_OP_LOG 5
  1341. #define LA_MATH_NODE_OP_SIN 6
  1342. #define LA_MATH_NODE_OP_COS 7
  1343. #define LA_MATH_NODE_OP_TAN 8
  1344. #define LA_MATH_NODE_OP_ASIN 9
  1345. #define LA_MATH_NODE_OP_ACOS 10
  1346. #define LA_MATH_NODE_OP_ATAN 11
  1347. #define LA_MATH_NODE_OP_ATAN2 12
  1348. #define LA_MATH_NODE_OP_MOD 13
  1349. #define LA_VECTOR_MATH_OP_ADD 0
  1350. #define LA_VECTOR_MATH_OP_SUB 1
  1351. #define LA_VECTOR_MATH_OP_MUL 2
  1352. #define LA_VECTOR_MATH_OP_DIV 3
  1353. #define LA_VECTOR_MATH_OP_POW 4
  1354. #define LA_VECTOR_MATH_OP_LOG 5
  1355. #define LA_VECTOR_MATH_OP_DOT 6
  1356. #define LA_VECTOR_MATH_OP_CROSS 7
  1357. #define LA_VECTOR_MATH_OP_LEN 8
  1358. #define LA_VECTOR_MATH_OP_NORMALIZE 9
  1359. NEED_STRUCTURE(tnsObject)
  1360. STRUCTURE(laRackPage){
  1361. laListItem Item;
  1362. laSafeString* Name;
  1363. laListHandle Racks;
  1364. laListHandle Eval;
  1365. laListHandle AlwaysBranchers;
  1366. laSafeString* Script;
  1367. tnsObject* ParentObject;
  1368. int RackType;
  1369. int TriggerMode;
  1370. int UseScript;
  1371. };
  1372. #define LA_RACK_TYPE_INPUT (1<<0)
  1373. #define LA_RACK_TYPE_DRIVER (1<<1)
  1374. #define LA_RACK_TYPE_ALL 0xfffffff
  1375. STRUCTURE(laNodeRack){
  1376. laListItem Item;
  1377. laSafeString* Name;
  1378. laListHandle Nodes;
  1379. laRackPage* ParentPage;
  1380. int RackType;
  1381. laNodeRack* Duplicated;
  1382. };
  1383. STRUCTURE(laKeyboardNode){
  1384. laBaseNode Base;
  1385. laNodeOutSocket* IsKey; int iIsKey;
  1386. laNodeOutSocket* KeyDown; int iKeyDown;
  1387. laNodeOutSocket* Key; int iKey;
  1388. };
  1389. NEED_STRUCTURE(laInputControllerNode);
  1390. STRUCTURE(laInputControllerNodeSocket){
  1391. laInputControllerNode* Parent;
  1392. laSafeString* Which;
  1393. laNodeOutSocket* Out;
  1394. int Offset;
  1395. int IntVal[8]; real RealVal[8];
  1396. };
  1397. STRUCTURE(laInputControllerNode){
  1398. laBaseNode Base;
  1399. laInputControllerNodeSocket Sockets[8];
  1400. int UserID;
  1401. int Mode;// btn/axis;
  1402. };
  1403. STRUCTURE(laInputVisualizerNode){
  1404. laBaseNode Base;
  1405. laNodeInSocket* In;
  1406. int IntVal[8]; real RealVal[8];
  1407. };
  1408. STRUCTURE(laSplitNodeOutSocket){
  1409. laNodeOutSocket* Out;
  1410. };
  1411. STRUCTURE(laSplitNode){
  1412. laBaseNode Base;
  1413. laNodeInSocket* In;
  1414. laSplitNodeOutSocket Out[8];
  1415. int IntVal[8]; real RealVal[8];
  1416. int ArrLen;
  1417. };
  1418. STRUCTURE(laSwitchNodeInSocket){
  1419. laNodeInSocket* In;
  1420. };
  1421. STRUCTURE(laSwitchNode){
  1422. laBaseNode Base;
  1423. laSwitchNodeInSocket In[8];
  1424. laNodeOutSocket* Out;
  1425. laNodeInSocket* SwitchIn;
  1426. real TempVal;
  1427. int Switch;
  1428. int MaxUsed;
  1429. laRackPage* Page;
  1430. uint64_t BranchSW;
  1431. };
  1432. STRUCTURE(laCombineNode){
  1433. laBaseNode Base;
  1434. laSwitchNodeInSocket In[8];
  1435. laNodeOutSocket* Out;
  1436. laNodeOutSocket* OutInt;
  1437. laNodeOutSocket* OutEnum;
  1438. real Values[8]; int ValuesI[8];
  1439. };
  1440. STRUCTURE(laValuesNode){
  1441. laBaseNode Base;
  1442. laSplitNodeOutSocket Out[8];
  1443. real Values[8]; int ValuesI[8], ValuesE[8];
  1444. int Modes[8];
  1445. };
  1446. STRUCTURE(laMatrixNode){
  1447. laBaseNode Base;
  1448. laNodeInSocket *InL,*InR;
  1449. laNodeOutSocket* Out;
  1450. tnsMatrix44d Mat;
  1451. int Operation;
  1452. };
  1453. STRUCTURE(laMathNode){
  1454. laBaseNode Base;
  1455. laNodeInSocket *InL,*InR;
  1456. laNodeOutSocket* Out,*OutInt;
  1457. real Value; int ValueI;
  1458. real ValueL, ValueR;
  1459. int Operation;
  1460. };
  1461. STRUCTURE(laValueMapperPoint){
  1462. laListItem Item;
  1463. real x,y;
  1464. };
  1465. STRUCTURE(laValueMapper){
  1466. real pad;
  1467. laListHandle Points;
  1468. real InRange[2],OutRange[2];
  1469. };
  1470. STRUCTURE(laMapperNode){
  1471. laBaseNode Base;
  1472. laNodeInSocket *In, *InMin, *InMax, *OutMin, *OutMax;
  1473. laNodeOutSocket* Out;
  1474. real rIn,rOut;
  1475. laValueMapper* Mapper;
  1476. int ClampInput, ClampOutput;
  1477. };
  1478. STRUCTURE(laRandomNode){
  1479. laBaseNode Base;
  1480. laNodeOutSocket* Out; real rOut;
  1481. laNodeInSocket *InMin, *InMax;
  1482. real Min,Max;
  1483. };
  1484. STRUCTURE(laVectorMathNode){
  1485. laBaseNode Base;
  1486. laNodeInSocket *InL,*InR;
  1487. laNodeOutSocket* Out;
  1488. real rOut[4];
  1489. int Operation;
  1490. };
  1491. STRUCTURE(laCommentNode){
  1492. laBaseNode Base;
  1493. laSafeString* Content;
  1494. };
  1495. STRUCTURE(laRGB2OKHSLNode){
  1496. laBaseNode Base;
  1497. laNodeInSocket *In;
  1498. laNodeOutSocket* OutH;
  1499. laNodeOutSocket* OutS;
  1500. laNodeOutSocket* OutL;
  1501. real RGB[3];
  1502. real rOut[3];
  1503. };
  1504. STRUCTURE(laOKHSL2RGBNode){
  1505. laBaseNode Base;
  1506. laNodeInSocket *InH;
  1507. laNodeInSocket *InS;
  1508. laNodeInSocket *InL;
  1509. laNodeOutSocket* Out;
  1510. real rOut[3];
  1511. };
  1512. STRUCTURE(laLoopNode){
  1513. laBaseNode Base;
  1514. laNodeInSocket *InIndex;
  1515. laNodeInSocket *InIterations;
  1516. laNodeInSocket *Branch;
  1517. laNodeInSocket *Prev;
  1518. laNodeOutSocket* Next;
  1519. int Iterations;
  1520. laRackPage* Page;
  1521. uint64_t BranchControl;
  1522. };
  1523. STRUCTURE(laLoopIndexNode){
  1524. laBaseNode Base;
  1525. laNodeOutSocket* Out;
  1526. int Iteration;
  1527. };
  1528. STRUCTURE(laNodeCategory){
  1529. laListItem Item;
  1530. laSafeString* Name;
  1531. laListHandle NodeTypes;//lip
  1532. laUiDefineFunc Ui;
  1533. int For;
  1534. };
  1535. #define LA_RACK_TYPE_AUDIO (1<<2)
  1536. #define LA_SYNTH_PLEN 512
  1537. extern laPropContainer* LA_PC_SYNTH;
  1538. STRUCTURE(laSynth){
  1539. laListItem Item;
  1540. laSafeString* Name;
  1541. laRackPage* Page;
  1542. real Length;
  1543. u16bit Poly,MaxPoly;
  1544. SYSLOCK Lock;
  1545. int Playing;
  1546. real EvalTime;
  1547. int EvalSamples;
  1548. int PolyCount;
  1549. laListHandle PolyphonicInstances;
  1550. };
  1551. STRUCTURE(laSynthNodeInput){
  1552. laBaseNode Base;
  1553. laNodeOutSocket* OutTime;
  1554. laNodeOutSocket* OutTrigger;
  1555. real* rTime;
  1556. real* rTrigger;
  1557. };
  1558. STRUCTURE(laSynthNodePulse){
  1559. laBaseNode Base;
  1560. laNodeInSocket* InTrigger; int iTrigger;
  1561. laNodeInSocket* InWidth; real rWidth,rInfluence;
  1562. laNodeInSocket* InGate; real rGate;
  1563. laNodeOutSocket* Out; real *rOut;
  1564. int Triggered; real EvalSamples;
  1565. };
  1566. STRUCTURE(laSynthNodeFM){
  1567. laBaseNode Base;
  1568. int Slow;
  1569. real Frequency,rInfluence;
  1570. laNodeInSocket* InFrequency;
  1571. laNodeOutSocket* Out;
  1572. //runtime
  1573. real Phase;
  1574. real* OutSamples;
  1575. };
  1576. STRUCTURE(laSynthNodeNoise){
  1577. laBaseNode Base;
  1578. laNodeOutSocket* OutWhite;
  1579. laNodeOutSocket* OutPink;
  1580. real* OutWhiteSamples;
  1581. real* OutPinkSamples;
  1582. //runtime
  1583. real PinkStates[3];
  1584. real PinkA[3],PinkP[3];
  1585. };
  1586. STRUCTURE(laSynthNodeVCA){
  1587. laBaseNode Base;
  1588. real Amp, rInfluence;
  1589. laNodeInSocket* In;
  1590. laNodeInSocket* InAmp;
  1591. laNodeOutSocket* Out;
  1592. real* OutSamples;
  1593. };
  1594. STRUCTURE(laSynthNodeScope){
  1595. laBaseNode Base;
  1596. int Time;
  1597. int Gain1,Gain2;
  1598. real Offset1,Offset2;
  1599. real Brightness1,Brightness2;
  1600. laNodeInSocket* In1;
  1601. laNodeInSocket* In2;
  1602. real *Display1,*Display2; // each PLEN*2, upper/lower bounds.
  1603. int NextSample;
  1604. SYSLOCK Lock;
  1605. laSynth* FromSynth;
  1606. };
  1607. NEED_STRUCTURE(laAudioChannel);
  1608. STRUCTURE(laSynthNodeOutput){
  1609. laBaseNode Base;
  1610. laNodeInSocket* In;
  1611. laSafeString* SendName;
  1612. /* Runtime */
  1613. laAudioChannel* Send;
  1614. };
  1615. STRUCTURE(laSynthNodeEnvelope){
  1616. laBaseNode Base;
  1617. laNodeInSocket* Trigger,*Gate; real rGate; int bTrigger; int Triggered;
  1618. laNodeInSocket* Restart;
  1619. laNodeInSocket* Attack; real rAttack,iAttack;
  1620. laNodeInSocket* Delay; real rDelay,iDelay;
  1621. laNodeInSocket* Sustain; real rSustain,iSustain;
  1622. laNodeInSocket* Release; real rRelease,iRelease;
  1623. laNodeOutSocket* Out; real* OutSamples;
  1624. real Time,ReleaseTime,AtLevel;
  1625. };
  1626. STRUCTURE(laSynthNodeQuantize){
  1627. laBaseNode Base;
  1628. laNodeInSocket* In;
  1629. laNodeOutSocket* Out;
  1630. real* OutSamples;
  1631. int EnabledBits[12];
  1632. };
  1633. STRUCTURE(laSynthNodeDriver){
  1634. laBaseNode Base;
  1635. laNodeInSocket* Prev; laNodeOutSocket* Next;
  1636. laNodeInSocket* InTransport; int iTransport;
  1637. laNodeInSocket* InReset; int iReset,AlreadyReset; // on rising edge
  1638. laSynth* Target;
  1639. };
  1640. STRUCTURE(laSynthNodeTrigger){
  1641. laBaseNode Base;
  1642. laNodeInSocket* Prev; laNodeOutSocket* Next;
  1643. laNodeInSocket* InTrigger; int Triggered,TriggerEdge,iTrigger;
  1644. laSynth* Target;
  1645. };
  1646. #include "miniaudio.h"
  1647. STRUCTURE(laAudioChannel){
  1648. laListItem Item;
  1649. laSafeString* Name;
  1650. real Volume;
  1651. laSafeString* OutputChannel;
  1652. real Samples[LA_SYNTH_PLEN];
  1653. };
  1654. STRUCTURE(laAudioDevice){
  1655. laListItem Item;
  1656. int MiniAudioID;
  1657. laSafeString Name;
  1658. };
  1659. STRUCTURE(laAudio){
  1660. int Paused;
  1661. laListHandle Synths;
  1662. laSynth* CurrentSynth;
  1663. laListHandle Channels;
  1664. laListHandle PolyLaterTrigger;
  1665. SYSLOCK AudioStatusLock;
  1666. ma_context MiniAudioContext;
  1667. ma_device AudioDevice;
  1668. laAudioDevice* UsingDevice;
  1669. laListHandle AudioDevices;
  1670. laSynth* AudioEvalSynth;
  1671. real AudioFrameInterval;
  1672. real* AudioSamples; int NextAudioSample,AudioSampleRate;
  1673. };
  1674. int laget_SynthPlaying(laSynth* ss);
  1675. void* laget_FirstAudioDevice(void* unused1,void* unused2);
  1676. void* laget_FirstSynth(void* unused1,void* unused2);
  1677. void laset_CurrentSynth(laAudio* a,laSynth* s);
  1678. void laset_CurrentAudioDevice(laAudio* a,laAudioDevice* ad);
  1679. void laRemoveAudioChannel(laAudioChannel* ac);
  1680. laAudioChannel* laNewAudioChannel(char* Name);
  1681. laAudioChannel* laGetAudioChannel(char* Name);
  1682. void la_AudioPreFrame();
  1683. void laRebuildSynthGraphs(int current_only);
  1684. void laInitAudio();
  1685. void laDeinitAudio();
  1686. void laStartAudio();
  1687. void laPauseAudio();
  1688. void laStopAudio();
  1689. void laResetAudio();
  1690. laSynth* laFindSynth(const char* Name);
  1691. void la_SynthAddPolyInstance(laSynth* s);
  1692. void la_SynthRemovePolyInstance(laSynth* s, laSynth* inst);
  1693. void laSynthTriggerNew(laSynth* s);
  1694. void laSynthTriggerLater(laSynth* s);
  1695. #define LA_INPUT_CONTROLLER_NODE_MODE_BTN 0
  1696. #define LA_INPUT_CONTROLLER_NODE_MODE_AXIS 1
  1697. laValueMapper* laValueMapperInit();
  1698. laValueMapper* laValueMapperDestroy(laValueMapper* vm);
  1699. laValueMapper* laValueMapperCopy(laValueMapper* new_optional, laValueMapper* vm);
  1700. real laValueMapperEvaluate(laValueMapper* vm, real x, real* force_InMin, real* force_InMax, real* force_OutMin, real* force_OutMax, int ClampIn, int ClampOut);
  1701. void laShowProgress(real p1, real p2);
  1702. void laHideProgress();
  1703. void logPrintT(int Type, char* format, ...);
  1704. void logPrint(char* format, ...);
  1705. void logPrintNew(char* format, ...);
  1706. #ifdef _WIN32
  1707. LRESULT CALLBACK LA_WindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
  1708. LRESULT CALLBACK LA_ProgressWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
  1709. #endif
  1710. void la_RegisterMainOperators();
  1711. void la_RegisterUiOperatorsBasic();
  1712. void la_RegisterBuiltinOperators();
  1713. void la_RegisterModellingOperators();
  1714. void la_RegisterUiTypesBasic();
  1715. void la_RegisterUiTypesViewerWidgets();
  1716. void la_RegisterBuiltinTemplates();
  1717. void la_RegisterWindowKeys();
  1718. void la_RegisterGeneralProps();
  1719. void la_RegisterInternalProps();
  1720. void la_RegisterDefaultSignals();
  1721. void la_RegisterAnimationResources();
  1722. void la_RegenerateWireColors();
  1723. void laui_IntPropInfo(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *ExtraColumns, int context);
  1724. void laui_FloatPropInfo(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *ExtraColumns, int context);
  1725. void laui_RackPage(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context);
  1726. void laui_DefaultPropDetails(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context);
  1727. void laui_DefaultNodeOperationsPropUiDefine(laUiList *uil, laPropPack *This, laPropPack *OperatorProps, laColumn *UNUSED, int context);
  1728. void laui_DefaultPropUiDefine(laUiList *uil, laPropPack *This, laPropPack *OperatorProps, laColumn *UNUSED, int context);
  1729. void laui_StringPropUiDefine(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context);
  1730. void laui_IdentifierOnly(laUiList *uil, laPropPack *This, laPropPack *OP_UNUSED, laColumn *Extra, int context);
  1731. void laui_SubPropInfoDefault(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1732. void laui_SubPropSelection(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1733. void laui_LinkerSelectionProp(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1734. void laui_LinkerSelectionInstance(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1735. void laui_DefaultOperatorPanelTitleBar(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1736. void laui_ColumnItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context);
  1737. void laui_DefaultMenuButtonsFileEntries(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context);
  1738. void laui_DefaultMenuButtonsOptionEntries(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context);
  1739. void laui_DefaultMenuButtons(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context);
  1740. void laui_DefaultMenuExtras(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context);
  1741. void laui_DefaultMenuBarActual(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context);
  1742. void laui_DefaultSubWindowMenuBarActual(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context);
  1743. void laui_ThemeListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context);
  1744. void laui_Theme(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context);
  1745. void laui_BoxedThemeItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context);
  1746. void laui_PropertyContainerList(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context);
  1747. void laui_WindowListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context);
  1748. void laui_LayoutListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context);
  1749. void laui_PanelListItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context);
  1750. void laui_InputSocketItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context);
  1751. void laui_OutputSocketItem(laUiList *uil, laPropPack *Base, laPropPack *UNUSED_This, laColumn *UNUSED_Colums, int context);
  1752. void laui_FileBrowserFileItem(laUiList *uil, laPropPack *This, laPropPack *OP_UNUSED, laColumn *Extra, int context);
  1753. void laui_FileBrowserDiskItem(laUiList *uil, laPropPack *This, laPropPack *OP_UNUSED, laColumn *Extra, int context);
  1754. void laui_LinkerPanel(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1755. void laui_ManagedUDFItem(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1756. void laui_ManagedUDFOps(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1757. void laui_ManagedProp(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1758. void laui_ManagedSavePanel(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1759. void laui_ManagedUDFPanel(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1760. void laui_FileBrowserFileList(laUiList *uil, laPropPack *THIS_UNUSED, laPropPack *Operator, laColumn *UNUSED, int context);
  1761. void laui_DataRestorePage(laUiList *uil, laPropPack *THIS_UNUSED, laPropPack *Operator, laColumn *UNUSED, int context);
  1762. void laui_ResourceFolderItem(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1763. void laui_LogItem(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);
  1764. void laui_NodeCategory(laUiList *uil, laPropPack *This, laPropPack *Extra, laColumn *UNUSED, int context);
  1765. void tnsui_CameraObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context);
  1766. void tnsui_LightObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context);
  1767. void tnsui_MeshObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context);
  1768. void tnsui_ShapeObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context);
  1769. void tnsui_InstancerObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context);
  1770. void tnsui_BaseObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context);
  1771. void tnsui_RootObjectProperties(laUiList *uil, laPropPack *This, laPropPack *UNUSED_Extra, laColumn *UNUSED_Colums, int context);
  1772. void tnsui_RootObjectMenuUi(laUiList *uil, laPropPack *This, laPropPack *OperatorProps, laColumn *UNUSED, int context);
  1773. int OPINV_UiItem(laOperator *a, laEvent *e);
  1774. int OPEXT_UiItem(laOperator *a, int ExitCode);
  1775. int la_ArrayGetHeight(laUiItem *ui);
  1776. int la_ValueGetHeight(laUiItem*ui);
  1777. int la_3DViewGetHeight(laUiItem *ui);
  1778. int la_CanvasGetHeight(laUiItem *ui);
  1779. int la_EnumGetHeight(laUiItem *ui);
  1780. int la_ColorPickerGetHeight(laUiItem *ui);
  1781. int la_SymbolGetHeight(laUiItem *ui);
  1782. int la_GroupGetHeight(laUiItem *ui);
  1783. laPanel *la_FindFreePanelByTemplate(laWindow *w, const laUiTemplate *uit);
  1784. laUiItem *la_FindUiWithMark(laUiList *uil, char *mark);
  1785. laUiList *la_FindSubListWithInstance(laUiItem *ui, void *Instance);
  1786. void* laget_CurrentRackPage(laRackPageCollection* c);
  1787. void laset_CurrentRackPage(laRackPageCollection* c,laRackPage* rp);
  1788. void la_BeginNVG(struct NVGcontext* vg,laCanvasExtra* e,int W,int H, int Is2D);
  1789. void la_SetCanvasOrtho(laCanvasExtra* e,int W, int H);
  1790. #define LA_FILETYPE_UNKNOWN 0
  1791. #define LA_FILETYPE_UDF 1
  1792. #define LA_FILETYPE_DOCUMENT 2
  1793. #define LA_FILETYPE_IMAGE 3
  1794. #define LA_FILETYPE_AUDIO 4
  1795. #define LA_FILETYPE_VIDEO 5
  1796. #define LA_FILETYPE_COMPRESSED 6
  1797. #define LA_FILETYPE_FONT 7
  1798. #define LA_FILETYPE_VECTOR 8
  1799. #define LA_FILETYPE_WEBPAGE 9
  1800. #define LA_FILETYPE_META 10
  1801. #define LA_FILETYPE_BLEND 11
  1802. #define LA_FILETYPE_PDF 13
  1803. #define LA_FILETYPE_EXEC 14
  1804. #define LA_FILETYPE_SYS 15
  1805. #define LA_FILETYPE_FOLDER 16
  1806. #define LA_FILETYPE_LASDEXCHANGE 17
  1807. #define LA_FILE_SELECT_FILE 0
  1808. #define LA_FILE_SELECT_FOLDER 1
  1809. STRUCTURE(laExtensionType){
  1810. laListItem Item;
  1811. int FileType;
  1812. const char* Extension;
  1813. };
  1814. STRUCTURE(laFileItem){
  1815. laListItem Hyper;
  1816. int IsFolder;
  1817. char Name[1024];
  1818. int Size;
  1819. uint64_t Timestamp;
  1820. laTimeInfo TimeModified;
  1821. int Type;
  1822. };
  1823. STRUCTURE(laDiskItem){
  1824. laListItem Hyper;
  1825. char ID;
  1826. real Total_GB;
  1827. real Free_GB;
  1828. };
  1829. STRUCTURE(laBookmarkedFolder){
  1830. laListItem Item;
  1831. char Name[128];
  1832. char Path[1024];
  1833. };
  1834. #define LA_FILE_SORT_NAME 0
  1835. #define LA_FILE_SORT_NAME_REV 1
  1836. #define LA_FILE_SORT_TIME 2
  1837. #define LA_FILE_SORT_TIME_REV 3
  1838. #define LA_FILE_SORT_SIZE 4
  1839. #define LA_FILE_SORT_SIZE_REV 5
  1840. STRUCTURE(laFileBrowser){
  1841. laListItem Hyper;
  1842. char Path[2048];
  1843. char FileName[512];
  1844. char TempStr[512];
  1845. char MD5[128];
  1846. char FilterName[512];
  1847. tnsImage* Thumbnail;
  1848. laDiskItem *RootDisk;
  1849. laFileItem *Active;
  1850. laListHandle FileList;
  1851. laListHandle Bookmarks;
  1852. laListHandle Disks;
  1853. int SelectFolder;
  1854. int WarnFileExists;
  1855. int StatusWaitingWarning;
  1856. char UseExtension[64];
  1857. int UseType;
  1858. int FilterType;
  1859. int ShowBackups;
  1860. int ShowThumbnail;
  1861. int SortBy;
  1862. laStringSplitor* ss_filter_extensions;
  1863. };
  1864. STRUCTURE(laUDFPreviewExtra){
  1865. laUDF *UDF;
  1866. int Opened;
  1867. int Append;
  1868. };
  1869. STRUCTURE(laManagedSaveExtra){
  1870. int ShowPage;
  1871. int OnExit;
  1872. };
  1873. #define LA_UDF_SHARE_POINTER(id) \
  1874. la_UDFAppendSharedTypePointer("" #id, id)
  1875. void la_MakeTranslations();
  1876. laCanvasTemplate *la_GetCanvasTemplate(char *TargetContainerID, char* TemplateID);
  1877. laPropContainer* laUiHasExtraProps(laUiType *ut, int size, int Hyper);
  1878. laPropContainer* laCanvasHasExtraProps(laCanvasTemplate *ct, int size, int Hyper);
  1879. laUiType *la_RegisterUiType(const char *Identifer, int ForType, const char *UseOperator, laBoxedTheme **bt, laUiDrawFunc *Draw, laUiGetHeightFunc GetHeight, laUiInitFunc Init, laUiDestroyFunc Destroy);
  1880. void la_NotifyGLDebugChanges();
  1881. void laSetWindowCursor(int id);
  1882. void laRenameWindow(laWindow* wnd, char* name);
  1883. #ifdef __linux__
  1884. int la_GetDPI(Window* root_win);
  1885. void la_ScanWacomDevices(SYSTEMDISPLAY *display, int deviceid);
  1886. #endif
  1887. #ifdef _WIN32
  1888. int la_GetDPI(HWND win);
  1889. void la_OpenWacomWinTab(HWND hwnd);
  1890. #endif
  1891. void laSetFontFolderPath(char* absolute);
  1892. void laSetDefaultInitArguments(laInitArguments* ia);
  1893. void laSetCompleteInitArguments(laInitArguments* ia);
  1894. void laProcessInitArguments(int argc, char* argv[],laInitArguments* ia);
  1895. int laGetReady();
  1896. int laGetReadyWith(laInitArguments* ia);
  1897. void laShutoff(int SavePreferences);
  1898. int laRestoreFactorySettings();
  1899. void laSaveUserPreferences();
  1900. void laEnsureUserPreferences();
  1901. void laAddExtraExtension(int FileType, ...);
  1902. void laAddExtraPreferencePath(const char* path);
  1903. void laAddExtraPreferencePage(const char* name, laUiDefineFunc Func);
  1904. void laSetFrameCallbacks(laPreFrameF PreFrame, laPreDrawF PreDraw, laPostFrameF PostFrame);
  1905. void laSetCleanupCallback(laCleanupF Cleanup);
  1906. void laSetInputProcessCallback(laInputProcessF InputProcess);
  1907. void laSetMenuBarTemplates(laUiDefineFunc MenuButtons, laUiDefineFunc MenuExtras, const char* ProgramName);
  1908. void laSetAboutTemplates(laUiDefineFunc AboutContent, laUiDefineFunc AboutVersion, laUiDefineFunc AboutAuthor);
  1909. void laSetPreferenceTemplates(laUiDefineFunc PreferencePageDisplay, laUiDefineFunc PreferencePageInput, laUiDefineFunc PreferencePageResource, laUiDefineFunc PreferencePageTheme);
  1910. void la_InputMappingGetKeyName(int key, int special, char* name);
  1911. int la_InputMappingGetKeyFromName(char* name, int* special);
  1912. laCustomSignal* laFindSignal(char* Name);
  1913. laCustomSignal* laFindSignalByID(int ID);
  1914. void laInputMappingUpdateSignal(laInputMappingEntry* ime);
  1915. laInputMapping* laNewInputMapping(char* Name);
  1916. laInputMappingEntry* laNewInputMappingEntry(laInputMapping* im, int DeviceType, int JoystickDevice, char* Key, int SpecialKeyBit, char* Signal);
  1917. laInputMappingEntry* laNewInputMappingEntryP(laInputMapping* im, int DeviceType, int JoystickDevice, char* Key, int SpecialKeyBit, int Signal);
  1918. void laRemoveInputMappingEntry(laInputMapping* im, laInputMappingEntry* e);
  1919. void laRemoveInputMapping(laInputMapping* im);
  1920. laCustomSignal* laNewCustomSignal(char* Name, int Signal);
  1921. void laRemoveCustomSignal(laCustomSignal* cs);
  1922. void la_RemoveScreen(laScreen*s);
  1923. laScreen* laGetWindowScreen(laWindow* w);
  1924. laWindow *laDesignWindow(int X, int Y, int W, int H);
  1925. laLayout *laDesignLayout(laWindow *w, char *Title);
  1926. void laDestroyLayout(laWindow *w, laLayout* l);
  1927. void laFoldBlockTitle(laBlock* b);
  1928. void laUnfoldBlockTitle(laBlock* b);
  1929. void laMaximizeBlock(laBlock* b);
  1930. void laRestoreToLayout();
  1931. void laMaximizeCanvasUI(laUiItem* ui, laPanel* UiParentPanel);
  1932. void laRestoreCanvasUI();
  1933. void laHideMenuBar();
  1934. void laShowMenuBar();
  1935. void laSplitBlockHorizon(laBlock *b, real Percentage);
  1936. void laSplitBlockVertical(laBlock *b, real Percentage);
  1937. void laCombineChildBlocks(laBlock *b);
  1938. laBlock *laBlock1(laBlock *b);
  1939. laBlock *laBlock2(laBlock *b);
  1940. laBlock *laSwapSubBlocks(laBlock *b);
  1941. void laDestroyBlocksRecursive(laBlock *Root);
  1942. laPanel* laTearOffPanel(laBlock* b, laPanel* p_if_set);
  1943. void laDockPanel(laWindow* from, laBlock* b, laPanel* p);
  1944. laPanel *laCreatePanel(laBlock *b, char *template_id);
  1945. 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);
  1946. void laShowPanel(laPanel *p);
  1947. void laShowPanelWithDropDownEffect(laPanel *p);
  1948. void laShowPanelWithExpandEffect(laPanel *p);
  1949. void laHidePanel(laPanel *p);
  1950. void laHidePanelWithDissoveEffect(laPanel *p);
  1951. void laActivatePanel(char* TemplateID, int x, int y);
  1952. void laPanPanel(laPanel *p, int DeltaX, int DeltaY);
  1953. int laPanUiListFree(laUiList *uil, int X, int Y);
  1954. int laPanUiList(laUiList *uil, int X, int Y, int L, int R, int U, int B);
  1955. int laPanUiListAuto(laUiList *uil, int X, int Y, int L, int R, int U, int B);
  1956. int laScaleUiList(laUiList *uil, real factor, int L, int R, int U, int B);
  1957. laPanel *laDesignPropPanel(char *Title, int X, int Y, int W, int H,
  1958. laUiDefineFunc Define, laPropPack *This, laPropPack *OperatorProps);
  1959. 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,
  1960. laUiDefineFunc Define, laPropPack *This, laPropPack *OperatorProps);
  1961. void laDeferedDestroyPanel(laPanel *p);
  1962. void laDestroySinglePanel(laPanel *p, int immediate);
  1963. void laEnsurePanelInBound(laPanel *p,laUiList* uil);
  1964. int laEnclosePanelContent(laPanel *p, laUiList *uil);
  1965. laPanel *laEnableIdlePanel(laPanel *Attachment, laOperator *a, laPropPack *OperatorProps, laUiDefineFunc ReplaceUiDefine, laPropPack *This,
  1966. int L, int R, int B, int MaxGH, int MaxW, laEvent *e);
  1967. laPanel *laEnableSplashPanel(laUiDefineFunc ReplaceUiDefine, int L, int R, int B, int MaxGH, int MaxW, laEvent* e);
  1968. laPanel *laEnablePropertyPanel(laPanel *Attachment, laOperator *a, laPropPack *OperatorProps, laUiDefineFunc ReplaceUiDefine, laUiDefineFunc FallBackUiDefine, laPropPack *This,
  1969. int L, int R, int B, int MaxGH, int MaxW, laEvent *e);
  1970. laPanel *laEnableEmptyPropertyPanel(laPanel *Attachment, laOperator *a, int L, int R, int U, int MaxGH, laEvent *e);
  1971. laPanel *laEnableMenuPanel(laPanel *Attachment, laOperator *a, laUiList *MenuRefer, laPropPack *This,
  1972. int L, int R, int B, int MaxGH, int MaxW, laEvent *e);
  1973. laPanel *laDefineAndEnableMenuPanel(laPanel *Attachment, laOperator *a, laPropPack *This,
  1974. int L, int B, int MaxGH, int MaxW, laEvent *e);
  1975. 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);
  1976. laPanel *laEnableYesNoPanel(laOperator *a, laPanel *Attachment, char *Title, char *Message, int X, int Y, int W, laEvent *e);
  1977. laPanel *laEnableMessagePanel(laOperator *a, laPanel *Attachment, char *Title, char *Message, int X, int Y, int W, laEvent *e);
  1978. void laOperatorModalOver(laOperator* For);
  1979. void la_PropPanelUserRemover(void* This, laItemUserLinker* iul);
  1980. void la_EnsurePanelExtras(laPanel *p);
  1981. void laDeferredRedraw(laPanel* p);
  1982. void laRedrawAllWindows();
  1983. void laRefreshWindow();
  1984. void laRedrawCurrentWindow();
  1985. void laRedrawPanel(laPanel* p);
  1986. void laRecalcPanel(laPanel* p);
  1987. void laRedrawCurrentPanel();
  1988. void laRecalcCurrentPanel();
  1989. void laRecalcPanelImmediate(laPanel *p);
  1990. void laRecalcCurrentPanelImmediate();
  1991. int laNonFixedPanelExists(laPanel *p);
  1992. int laIsInPanel(laPanel *p, int PanelX, int PanelY);
  1993. int laIsCloseToPanel(laPanel *p, int PanelX, int PanelY);
  1994. void laPopPanel(laPanel *p);
  1995. int laPanelOverlappingEachOther(laPanel *p1, laPanel *p2);
  1996. void laUnlinkSharedPanel(laPanel *p);
  1997. int laIsPanelCovered(laPanel *p);
  1998. int laIsTopPanel(laPanel *p);
  1999. laPanel *laDetectPanel(int X, int Y);
  2000. void laWindowToLocal(laOperator *a, laPanel *p, int *x, int *y);
  2001. void laPanelToLocal(laOperator *a, int *x, int *y);
  2002. void laLocalToWindow(laOperator *a, laPanel *p, int *x, int *y);
  2003. void laLocalToPanel(laOperator *a, int *x, int *y);
  2004. void laSetNextMenuPos(int X, int Y, int W, int H);
  2005. int laIsInBlock(laBlock *b, int X, int Y);
  2006. int laIsInBlockHeader(laBlock *b, int X, int Y);
  2007. int laIsInBlockBotton1(laBlock *b, int X, int Y);
  2008. int laIsInBlockBotton2(laBlock *b, int X, int Y);
  2009. laBlock *laClearBlockButtonRecursive(laBlock *b, laBlock *except);
  2010. laBlock *laDetectBlockRecursive(laBlock *b, int X, int Y);
  2011. void la_DoUiScissor(laUiItem* ui, int* savex, int* savey, int* savew, int* saveh,
  2012. int* savel, int* saver, int* saveu, int* saveb);
  2013. laUiList *laPrepareUi(laPanel *p);
  2014. laColumn *laFirstColumn(laUiList *uil);
  2015. laColumn *laSplitColumn(laUiList *uil, laColumn *c, real Percent);
  2016. laColumn *laSplitColumnDescriptor(laUiDescriptor *ud, laColumn *c, real Percent);
  2017. laColumn *laLeftColumn(laColumn *c, int MaxWidth);
  2018. laColumn *laRightColumn(laColumn *c, int MaxWidth);
  2019. int laCheckAndMergeSubColumnsUiList(laUiList *TopUil, laColumn *c, int DoMerge);
  2020. int laCheckAndMergeSubColumnsDescriptor(laUiDescriptor *TopDescriptor, laColumn *c, int DoMerge);
  2021. laUiConditionNode *laTrue();
  2022. laUiConditionNode *laFalse();
  2023. laUiConditionNode *laPropExpression(laPropPack *Base, char *Prop);
  2024. laUiConditionNode *laIntExpression(int Value);
  2025. laUiConditionNode *laFloatExpression(real Value);
  2026. laUiConditionNode *laStringExpression(char *Content);
  2027. laUiConditionNode *laAnd(laUiConditionNode *Expression1, laUiConditionNode *Expression2);
  2028. laUiConditionNode *laOr(laUiConditionNode *Expression1, laUiConditionNode *Expression2);
  2029. laUiConditionNode *laNot(laUiConditionNode *Expression1);
  2030. laUiConditionNode *laEqual(laUiConditionNode *Expression1, laUiConditionNode *Expression2);
  2031. laUiConditionNode *laGreaterThan(laUiConditionNode *Expression1, laUiConditionNode *Expression2);
  2032. laUiConditionNode *laLessThan(laUiConditionNode *Expression1, laUiConditionNode *Expression2);
  2033. laUiConditionNode *laGreaterEqual(laUiConditionNode *Expression1, laUiConditionNode *Expression2);
  2034. laUiConditionNode *laLessEqual(laUiConditionNode *Expression1, laUiConditionNode *Expression2);
  2035. laUiItem *laShowLabel(laUiList *uil, laColumn *c, const char *Content, laUiDefineFunc Template, laWidget* Widget);
  2036. laUiItem *laShowLabelDynamic(laUiList *uil, laColumn *c, const char *Content, laUiDefineFunc Template, laWidget* Widget);
  2037. laUiItem *laShowIcon(laUiList *uil, laColumn *c, laPropPack *Base, const char *Path, laWidget* Widget);
  2038. laUiItem *laShowInvisibleItem(laUiList *uil, laColumn *c, laPropPack *Base, const char *Path);
  2039. laUiItem *laShowItem(laUiList *uil, laColumn *c, laPropPack *Base, const char *Path);
  2040. laUiItem *laShowItemFull(laUiList *uil, laColumn *c, laPropPack *Base, const char *Path, laWidget* Widget, char* instructions, laUiDefineFunc Template, int TemplateContext);
  2041. laUiItem *laShowImage(laUiList *uil, laColumn *c, tnsImage* Image, int Height);
  2042. laUiItem *laShowNodeSocket(laUiList *uil, laColumn *c, laPropPack *Base, const char *Path, char* instructions);
  2043. laUiItem *laShowHeightAdjuster(laUiList *uil, laColumn *c, laPropPack *Base, const char *Path, char* instructions);
  2044. laUiItem *laShowDetachedItem(laPanel *p, laUiList *uil, laColumn *c, laPropPack *Base, const char *Path, const char *Rename, laUiDefineFunc Template, laWidget* Widget);
  2045. laUiItem *laShowCanvas(laUiList *uil, laColumn *c, laPropPack *Base, const char *Path, const char *id2DTemplate, int Height);
  2046. laUiItem *laShow3DCanvasCombo(laUiList *uil, laColumn *c, laPropPack *Base, const char *Path, int Height, laPropPack* Detached);
  2047. laUiItem *laShow2DContainerItem(laUiList *uil, laColumn *c, laPropPack *Base, const char *Path, int Height);
  2048. void laDefault3DViewOverlay(laUiItem *ui);
  2049. void laDefault2DViewOverlayRight(laUiItem *ui);
  2050. laUiItem *laShowColumnAdjuster(laUiList *uil, laColumn *c);
  2051. laUiItem *laShowSymbol(laUiList *uil, laColumn *c, int SymbolID, int Height);
  2052. laPropPack* laShowCompoundValue(laUiItem* ui, int slot, laPropPack *Base, const char *Path);
  2053. laUiItem *laBeginRow(laUiList *uil, laColumn *c, int Expand, int Even);
  2054. laUiItem *laEndRow(laUiList *uil, laUiItem* Begin);
  2055. laUiItem *laMakeGroup(laUiList *uil, laColumn *c, const char *Name, laWidget* Widget);
  2056. laUiItem *laMakeFoldableGroup(laUiList *uil, laColumn *c, const char *Name, laWidget* Widget, int DefaultFolded, int ButtonFlags);
  2057. laUiItem *laMakeEmptyGroup(laUiList *uil, laColumn *c, const char *Name, laWidget* Widget);
  2058. void laEndFoldableGroup(laUiList *sub, laUiItem *group);
  2059. laUiItem *laMakeTab(laUiList *uil, laColumn *c, laWidget* Widget);
  2060. laUiList *laAddTabPage(laUiItem *ui, const char *Name);
  2061. laUiItem *laOnConditionThat(laUiList *uil, laColumn *c, laUiConditionNode *Expression);
  2062. laUiItem *laOnConditionToggle(laUiList *uil, laColumn *col, laUiDefineFunc define, int Remove, laPropPack *ExtraBase, laPropPack *ExtraThis, laWidget* Widget);
  2063. laUiItem *laEndCondition(laUiList *uil, laUiItem *Beginner);
  2064. laUiItem *laElse(laUiList *uil, laUiItem *Beginner);
  2065. laUiList *laMakeMenuPage(laUiList *uil, laColumn *c, const char *Title);
  2066. laUiItem *laShowSeparator(laUiList *uil, laColumn *widest);
  2067. void laFixHeight(laUiList *uil, short Rows);
  2068. void la_ConditionerInit(laUiItem *ui, laUiConditionNode *Expression);
  2069. void laMakeExtraColumns(laUiItem *ui, u8bit HowMany, ...);
  2070. int la_UiInBoundEx(laUiItem *ui, laUiListDraw *uild);
  2071. void la_DestroyUiRange(laUiList *uil, laUiItem *Begin, laUiItem *End);
  2072. void la_ClearUiSpecificData(laUiItem *ui);
  2073. laUiItem *la_UpdatePropDisplay(laUiItem *ui, laPropPack *Base, const char *Path, laUiDefineFunc Template, laWidget* Widget, char* instructions);
  2074. laUiItem *la_UpdateLabelDisplay(laUiItem *ui, laUiDefineFunc Template, char *Content);
  2075. laUiItem *la_ShowGeneralPropItem(laUiList *uil, laColumn *c, laPropPack *Base, laProp *GeneralProp, laProp *p, laUiDefineFunc Template, laWidget* Widget);
  2076. void laFinalizeUiTemplates();
  2077. laUiTemplate *laFindUiTemplate(char *Identifier);
  2078. void la_DestroyUiTemplate(laUiTemplate* uit);
  2079. void la_DestroyCanvasTemplate(laCanvasTemplate* uit);
  2080. laUiTemplate *laRegisterUiTemplate(char *Identifier, char* Title, laUiDefineFunc func,laPanelDetachedPropFunc PropFunc, laUiDefineFunc header, char* NewCategory, int DefaultGLFormat, int DefaultW_RH, int DefaultH_RH);
  2081. laCanvasTemplate *laRegisterCanvasTemplate(char *Identifier, char *ForContainer, laModalFunc ExtraModal, laCanvasDrawFunc Func, laUiDrawFunc SecondDraw, laUiInitFunc CustomInit, laUiDestroyFunc CustomDestroy);
  2082. void la_DestroyTheme(laTheme* t);
  2083. laTheme *laDesignTheme(const char *Name, const char *AuthorName);
  2084. laBoxedTheme *laDesignBoxedTheme(laTheme *t, const char *Name, laBoxedTheme** BackRef,
  2085. real NormalY,real ActiveY,real BorderY,real TextY,real TextActiveY, real Alpha,
  2086. real TopMargin, real LeftMargin, real RightMargin, real BottomMargin,
  2087. real TopPadding, real LeftPadding, real RightPadding, real BottomPadding);
  2088. laTheme *laGetTheme(const char *ThemeName);
  2089. laBoxedTheme *laGetBoxedTheme(const char *ThemeName, const char *BoxName);
  2090. real* laThemeColor(laBoxedTheme* bt, int which);
  2091. real* laAccentColor(int which);
  2092. void la_RefreshBoxedThemeColor(laBoxedTheme* bt);
  2093. void la_RefreshThemeColorSelf(laTheme* th);
  2094. void la_RefreshThemeColor(laTheme* th);
  2095. #define LA_COLOR4(c) (c)[0], (c)[1], (c)[2], (c)[3]
  2096. #define LA_COLOR3(c) (c)[0], (c)[1], (c)[2]
  2097. #define LA_VEC2(c) (c)[0], (c)[1]
  2098. #define LA_SET3(c, a1,a2,a3) { (c)[0]=a1; (c)[1]=a2; (c)[2]=a3; }
  2099. #define LA_COLOR3_TO_HEX(c) (((int)((c)[0]*255)<<16)|((int)((c)[1]*255)<<8)|((int)((c)[2]*255)<<0))
  2100. #define LA_COLOR3_TO_RGB(c) (RGB((int)((c)[0]*255),(int)((c)[1]*255),(int)((c)[2]*255)))
  2101. int laIsInUiItem(laUiItem *ui, int x, int y);
  2102. int laIsInBound(int x, int y, int l, int r, int u, int b);
  2103. laUiItem *la_DetectUiItemRecursive(laUiList *uil, int x, int y, int LimB, laListHandle *LocalBuf, int Deep);
  2104. laUiItem *la_DetectSocketRecursive(laUiList* uil, int x, int y, int LimB, laPropContainer* PCInOrOut);
  2105. laUiList *la_DetectUiListRecursive(laUiList *uil, int x, int y, int LimH,
  2106. laUiItem **ParentUi, laUiList **ScrollUil, laUiList **ContainerParent, int InToContainerUI, laUiItem *Exception);
  2107. laUiList *la_DetectUiListRecursiveDeep(laUiList *uil, int x, int y, int LimH, laUiItem **ParentUi, laUiList **ScrollUil,
  2108. laUiList **ContainerParent, int InToContainerUI, laUiItem *Exception, laListHandle* levels);
  2109. int laStartWindow(laWindow *w);
  2110. void laMainLoop();
  2111. void la_DestroyOperatorType(laOperatorType* at);
  2112. laOperatorType *laCreateOperatorType(const char *ID, const char *Name, const char *Description,
  2113. laCheckFunc Check, laInitFunc Init, laExitFunc Exit, laInvokeFunc Invoke, laModalFunc Modal,
  2114. uint32_t IconID, int ExtraMark);
  2115. laPropContainer* laDefineOperatorProps(laOperatorType* ot, int HyperLevel);
  2116. #define LA_VERIFY_THIS_TYPE(this,pc,pc_identifier) \
  2117. ((this)&&(this)->EndInstance&& \
  2118. (this)->LastPs->p->PropertyType==LA_PROP_SUB&& \
  2119. ((pc)=la_EnsureSubTarget((this)->LastPs->p,(this)->EndInstance))&&strSame((pc)->Identifier,pc_identifier))
  2120. laNodeOutSocket* laCreateOutSocket(void* NodeParentOptional, char* label, int DataType);
  2121. laNodeInSocket* laCreateInSocket(char* label, int DataType);
  2122. void laDestroyInSocket(laNodeInSocket* s);
  2123. void laDestroyOutSocket(laNodeOutSocket* s);
  2124. laNodeCategory* laEnsureNodeCategory(char* Name,laUiDefineFunc* Ui,int ForRackTypes);
  2125. void laNodeCategoryAddNodeTypes(laNodeCategory* nc, ...);
  2126. void laDestroyRack(laNodeRack* rr);
  2127. laRackPage* laDuplicateRackPage(laRackPage* new_optional, laRackPage* from);
  2128. void laFreeKeyMapItem(laKeyMapItem* kmi);
  2129. laKeyMapItem *laAssignNewKey(laKeyMapper *km, char *Path, char *Operation, char SelectBase, int SpecialKeyBits, int EventType, int Key, char *ExtraInstructions);
  2130. int laKeyMapExecuteEvent(laOperator *from, laKeyMapper *km, laEvent *e);
  2131. int laKeyMapExecuteEventEx(laOperator *from, laPropPack *UiExtra, laKeyMapper *km, laEvent *e);
  2132. laOperatorType *laGetOperatorType(const char *ID);
  2133. void laSetOperatorLocalizer(void *ToPanel);
  2134. int laOperatorAvailable(char *ID, laPropPack *This, laStringSplitor *Instructions);
  2135. int laOperatorAvailableP(laOperatorType *at, laPropPack *This, laStringSplitor *Instructions);
  2136. int laOperatorAvailableSafe(char *ID, laPropPack *This, void *Real_FromInstance, laStringSplitor *Instructions);
  2137. int laOperatorAvailablePSafe(laOperatorType *at, laPropPack *This, void *Real_FromInstance, laStringSplitor *Instructions);
  2138. void laSendOperatorTriggerEvent();
  2139. void laRetriggerOperators();
  2140. int la_GenericTopPanelProcessing(laOperator* a, laEvent* e);
  2141. int OPMOD_FinishOnData(laOperator* a, laEvent* e);
  2142. void OPEXT_FreeUserData(laOperator* a, int mark_unused);
  2143. void laHideCursor();
  2144. void laShowCursor();
  2145. int la_UiOperatorExists(void *inst);
  2146. int laOperatorExistsT(laOperatorType* at);
  2147. int laOperatorExists(const char* ID);
  2148. int laInvokeUi(laOperator *From, char *ID, laEvent *e, void *inst, laListHandle *Locals, int IgnoreLocals);
  2149. int laInvokeUiP(laOperator *From, laOperatorType *at, laEvent *e, void *inst, laListHandle *Locals, int IgnoreLocals);
  2150. int laInvoke(laOperator *From, char *ID, laEvent *e, laPropPack *This, char *args, char *args2);
  2151. int laInvokeP(laOperator *From, laOperatorType *at, laEvent *e, laPropPack *This, char *args, char *args2);
  2152. int laInvokePCreateThis(laOperator *From, laOperatorType *at, laEvent *e, laPropPack *OrigionalThis, void *FromInstance, char *args, char *args2);
  2153. void laRequestDelayEvent(real Seconds);
  2154. int la_UiStillInService(void *UiInstance);
  2155. void la_StopUiOperatorService(void *UiInstance);
  2156. void la_StopAllOperators();
  2157. int la_ProcessTextEdit(laEvent *e, laStringEdit *se, laUiItem* ui);
  2158. void laConfirmPointer(laOperator *a, void* Data,laPropContainer* PointerType, int mode);
  2159. void laConfirmInt(laOperator *a, int Data, int mode);
  2160. void laConfirmFloat(laOperator *a, real Data, int mode);
  2161. void laConfirmString(laOperator *a, char *Str, int mode);
  2162. int laConfirmSameDataIfAny(laOperator *a);
  2163. void laConfirmUserData(laOperator *a, void *UserData, laConfirmDataDestroyFunc Destroy, int mode);
  2164. int laGetConfirmInt(laOperator *a);
  2165. real laGetConfirmFloat(laOperator *a);
  2166. void laGetConfirmString(laOperator *a, char *buf);
  2167. void *laGetConfirmUserData(laOperator *a);
  2168. //int laInvokeSub(laProp* From, char * ID, laEvent* e, void* inst);
  2169. void laFinalizeOperators();
  2170. int laWaitFor(laOperator *Who, int State);
  2171. void la_PrintOperatorStack();
  2172. void laui_DefaultPanelTitleBar(laUiList *uil, laPropPack *Base, laPropPack *Extra, laUiDefineFunc header);
  2173. void laui_DefaultOperatorPanelTitleBar(laUiList *uil, laPropPack *Base, laPropPack *OperatorInst, laColumn *ExtraColumns, int context);;
  2174. void laui_DefaultSubWindowMenuBarActual(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context);;
  2175. void laui_DefaultMenuBarActual(laUiList *uil, laPropPack *pp, laPropPack *actinst, laColumn *extracol, int context);;
  2176. void laui_DefaultMenuBar(laWindow *w);
  2177. void laui_DefaultSubWindowMenuBar(laWindow *w);
  2178. void laui_DefaultPropUiDefine(laUiList *uil, laPropPack *This, laPropPack *OperatorProps, laColumn *UNUSED, int context);;
  2179. void laui_PropOperatorUiDefine(laUiList *uil, laPropPack *This, laPropPack *Unused, laColumn *UNUSED, int context);
  2180. int laCopyToClipboard(unsigned char * text);
  2181. extern laUiType *_LA_UI_FIXED_GROUP;
  2182. extern laUiType *_LA_UI_TAB;
  2183. extern laUiType _LA_UI_CONDITION; //NO PTR
  2184. extern laUiType _LA_UI_CONDITION_END; //NO PTR
  2185. extern laUiType _LA_UI_CONDITION_ELSE; //NO PTR
  2186. extern laUiType _LA_UI_ROW_BEGIN; //NO PTR
  2187. extern laUiType _LA_UI_ROW_END; //NO PTR
  2188. extern laUiType _LA_UI_INVISIBLE; //NO PTR
  2189. extern laUiType *_LA_UI_COLLECTION;
  2190. extern laUiType *_LA_UI_COLLECTION_ITEM;
  2191. extern laUiType *_LA_UI_COLLECTION_SELECTOR;
  2192. extern laUiType *_LA_UI_COLLECTION_SINGLE;
  2193. extern laUiType *_LA_UI_BUTTON;
  2194. extern laUiType *_LA_UI_LABEL;
  2195. extern laUiType *_LA_UI_INT;
  2196. extern laUiType *_LA_UI_METER_TYPE1;
  2197. extern laUiType *_LA_UI_METER_TYPE2;
  2198. extern laUiType *_LA_UI_VALUE_METER_2D;
  2199. extern laUiType *_LA_UI_FLOAT;
  2200. extern laUiType *_LA_UI_FLOAT_COLOR;
  2201. extern laUiType *_LA_UI_FLOAT_COLOR_HCY;
  2202. extern laUiType *_LA_UI_ENUM_SELECTOR;
  2203. extern laUiType *_LA_UI_MENU_ROOT;
  2204. extern laUiType *_LA_UI_CONDITION_TOGGLE;
  2205. extern laUiType *_LA_UI_STRING;
  2206. extern laUiType *_LA_UI_STRING_MULTI;
  2207. extern laUiType *_LA_UI_ALIGN;
  2208. extern laUiType *_LA_UI_CANVAS;
  2209. extern laUiType *_LA_UI_COLUMN_ADJUSTER;
  2210. extern laUiType *_LA_UI_SYMBOL;
  2211. extern laUiType *_LA_UI_COLUMN_VIEWER;
  2212. extern laUiType *_LA_UI_NODE_SOCKET;
  2213. extern laUiType *_LA_UI_HEIGHT_ADJUSTER;
  2214. extern laUiType *_LA_UI_RAW;
  2215. extern laUiType *_LA_UI_MAPPER;
  2216. extern laUiType *_LA_UI_IMAGE;
  2217. extern laUiType *_LA_UI_SCOPE;
  2218. extern laUiDescriptor _LA_UI_DESCRIPTOR_REF_UI;
  2219. extern laUiDescriptor _LA_UI_DESCRIPTOR_REF_UIE;
  2220. extern laUiDescriptor _LA_UI_DESCRIPTOR_REF_P;
  2221. extern laUiDescriptor _LA_UI_DESCRIPTOR_REF_PE;
  2222. extern laUiDescriptor _LA_UI_DESCRIPTOR_REF_BASE;
  2223. extern laUiDescriptor _LA_UI_DESCRIPTOR_REF_ACT;
  2224. extern laUiDefineFunc _LA_SUBPROP_DONT_CARE;
  2225. extern laBoxedTheme *_LA_THEME_PANEL;
  2226. extern laBoxedTheme *_LA_THEME_VALUATOR;
  2227. extern laBoxedTheme *_LA_THEME_BUTTON;
  2228. extern laBoxedTheme *_LA_THEME_STRING;
  2229. extern laBoxedTheme *_LA_THEME_SELECTOR;
  2230. extern laBoxedTheme *_LA_THEME_COLLECTION_SELECTOR;
  2231. extern laBoxedTheme *_LA_THEME_LABEL;
  2232. extern laBoxedTheme *_LA_THEME_TAB;
  2233. extern laBoxedTheme *_LA_THEME_COLLECTION_GROUP;
  2234. extern laBoxedTheme *_LA_THEME_COLLECTION_ITEM;
  2235. extern laBoxedTheme *_LA_THEME_FLOATING_PANEL;
  2236. extern laBoxedTheme *_LA_THEME_3D_VIEW;
  2237. extern laBoxedTheme *_LA_THEME_2D_VIEW;
  2238. extern laBoxedTheme *_LA_THEME_SOCKET;
  2239. extern laProp *_LA_PROP_PANEL;
  2240. extern laProp *_LA_PROP_BLOCK;
  2241. extern laProp *_LA_PROP_WINDOW;
  2242. extern laProp *_LA_PROP_UI_ITEM;
  2243. extern laProp *_LA_PROP_FAILED_ITEM;
  2244. extern laProp *_LA_PROP_TRASH_ITEM;
  2245. extern laProp *_LA_PROP_NODE_GRAPH;
  2246. extern laPropContainer *_LA_PROP_3D_EXTRA;
  2247. extern laPropContainer *_LA_PROP_2D_EXTRA;
  2248. extern laPropContainer *_LA_PROP_FILE_BROWSER;
  2249. extern laProp _P_LA_USE_INSTANCE_ONLY;
  2250. #define _LA_USE_INSTANCE_ONLY (&_P_LA_USE_INSTANCE_ONLY)
  2251. #define LA_RH0 (MAIN.UiRowHeight)
  2252. #define LA_RH (MAIN.ScaledUiRowHeight)
  2253. #define LA_2RH (MAIN.ScaledUiRowHeight*2)
  2254. #define LA_RH2 ((int)(MAIN.ScaledUiRowHeight/2))
  2255. #define LA_SCROLL_W ((int)(MAIN.ScaledUiRowHeight * 0.67))
  2256. #define LA_SEAM_W ((int)(MAIN.ScaledUiRowHeight * 0.15))