*/}}

la_interface.h 88 KB

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