*/}}

la_interface.h 86 KB

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