*/}}

la_interface.h 86 KB

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