*/}}

la_interface.h 88 KB

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