*/}}

la_interface.h 90 KB

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