*/}}

la_interface.h 84 KB

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