*/}}

la_data.h 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922
  1. #pragma once
  2. #include "la_5.h"
  3. #include "la_tns.h"
  4. /* | given to | given to | array | */
  5. /* | user | user calls | setting| */
  6. /* | callback | and is used | needs | */
  7. /* | callback | to recieve | offset | */
  8. /* | callback | array config| hint | */
  9. /* +----------+-------------+--------+ */
  10. /* | The | | | */
  11. /* | DataBlock| The | The | */
  12. /* return value | Name | Instance | Actual Data | Offset | */
  13. /*\ / \_ \ / _/ */
  14. /* \ / \_ \ / _/ */
  15. /* \ / \_ \ / _/ */
  16. /* \ / \_ \ / _/ */
  17. /* \ / \ \ / _/ */
  18. typedef int (*laArrayGetLenF)(void *);
  19. typedef int (*laIntGetF)(void *);
  20. typedef void (*laIntSetF)(void *, int);
  21. typedef void (*laIntReadF)(void *, int);
  22. typedef void (*laIntArrayGetAllF)(void *, int *);
  23. typedef void (*laIntArraySetF)(void *, int, int); //idx,n
  24. typedef void (*laIntArraySetAllF)(void *, int);
  25. typedef void (*laIntArraySetAllArrayF)(void *, int *);
  26. typedef void (*laIntArrayReadAllF)(void *, int *);
  27. typedef real (*laFloatGetF)(void *);
  28. typedef void (*laFloatSetF)(void *, real);
  29. typedef void (*laFloatReadF)(void *, real);
  30. typedef void (*laFloatArrayGetAllF)(void *, real *);
  31. typedef void (*laFloatArraySetF)(void *, int, real); //idx,n
  32. typedef void (*laFloatArraySetAllF)(void *, real);
  33. typedef void (*laFloatArraySetAllArrayF)(void *, real *);
  34. typedef void (*laFloatArrayReadAllF)(void *, real *);
  35. typedef int (*laEnumGetF)(void *);
  36. typedef int (*laEnumGetLengthF)(void *);
  37. typedef void (*laEnumSetF)(void *, int);
  38. typedef void (*laEnumReadF)(void *, int);
  39. typedef void (*laEnumArraySetF)(void *, int, int); //idx,n
  40. typedef void (*laEnumArraySetAllF)(void *, int *);
  41. typedef void (*laEnumArrayReadAllF)(void *, int *);
  42. typedef void (*laEnumArrayGetAllF)(void *, int *);
  43. typedef void (*laStringSetF)(void *, char *);
  44. typedef void (*laStringGetF)(void *, char *copy_result, char** direct_result);
  45. typedef void (*laStringReadF)(void *, char *);
  46. typedef int (*laStringGetLenF)(void *);
  47. typedef void (*laSubReadF)(void *, void *); //from,set
  48. typedef void *(*laSubGetInstanceF)(void *, void *); //from,iterator
  49. typedef void (*laSubSetInstanceF)(void *, void *);
  50. typedef void *(*laSubGetNextF)(void *, void *); //this,iterator
  51. typedef int (*laSubGetAmountF)(void *);
  52. typedef int (*laSubGetStateF)(void *);
  53. typedef int (*laSubSetStateF)(void *, void *, int);
  54. typedef void *(*laSubTypeDetachedGet)(void *, void *);
  55. typedef void *(*laSubTypeDetachedGetNext)(void *, void *);
  56. typedef void *(*laSubGetTypeF)(void *);// inst, returns type ref.
  57. typedef int (*laSubUIFilterF)(void* parent, void* inst); // 1 show, 0 discard.
  58. typedef void *(*laSubUIThemeF)(void* parent, void* inst); // return a theme, MAIN.CurrentTheme can always be referenced to produce invert.
  59. typedef int (*laSubUIGapF)(void* parent, void* inst);
  60. typedef void (*laSubUICategoryF)(void* parent, void* inst, char *copy_result, char** direct_result);
  61. typedef void* (*laRawGetF)(void *, int* r_size, int* return_is_a_copy);
  62. typedef int (*laRawGetSizeF)(void *);
  63. typedef void (*laRawSetF)(void *, void* data, int copy_size);
  64. typedef void (*laContainerPostReadFunc)(void *);
  65. typedef laPropContainer* (*laGetNodeTypeFunc)(void *);
  66. typedef void (*laContainerBeforeFreeF)(void *);
  67. typedef void (*laContainerResetF)(void *);
  68. typedef void (*laContainerUndoTouchedF)(void *, u64bit hint);
  69. typedef void (*laContainerpUDFPropagateF)(void *, void* udf, int Force);
  70. #define LA_PROP_GENERAL_ROOT (1<<7)
  71. #define LA_PROP_SUB (1<<8)
  72. #define LA_PROP_INT (1<<9)
  73. #define LA_PROP_FLOAT (1<<10)
  74. #define LA_PROP_STRING (1<<11)
  75. #define LA_PROP_ENUM (1<<12)
  76. #define LA_PROP_STRING (1<<13)
  77. #define LA_PROP_ARRAY (1<<14)
  78. #define LA_PROP_PANEL (1<<15)
  79. #define LA_PROP_UI (1<<16)
  80. #define LA_PROP_OPERATOR (1<<17)
  81. #define LA_PROP_MENU (1<<18)
  82. #define LA_PROP_SELF_CONDITION (1<<19)
  83. #define LA_PROP_BIN (1<<20)
  84. #define LA_PROP_REF_LIST (1<<21)
  85. #define LA_PROP_GENERIC_BITS (~LA_PROP_ARRAY)
  86. #define LA_PROP_IS_FOLDER (1<<22)
  87. #define LA_PROP_IS_FILE (1<<23)
  88. #define LA_PROP_RAW (1<<24)
  89. #define LA_PROP_IS_LINEAR_SRGB (1<<24)
  90. #define LA_PROP_OTHER_ALLOC (1<<3)
  91. #define LA_PROP_HYPER_BITS (1|2)
  92. #define LA_RAW_CSTR_MAX_LEN 4096
  93. typedef void (*laUiDefineFunc)(void *uil, void *collection_inst, void *this_inst, void *extra_col, int temlpate_context);
  94. typedef void (*laPanelDetachedPropFunc)(void *panel);
  95. //typedef void(*laUnlinkFunc)(void*, void*);//this instance,target instance
  96. NEED_STRUCTURE(laCanvasTemplate);
  97. NEED_STRUCTURE(laKeyMapper);
  98. STRUCTURE(laSaverDummy){
  99. laListItem Item;
  100. real pad;
  101. };
  102. STRUCTURE(laPropContainer){
  103. laListItem Item;
  104. const char *Identifier;
  105. const char *Name;
  106. const char *Description;
  107. uint32_t IconID;
  108. int NodeSize;
  109. laContainerBeforeFreeF BeforeFree;
  110. laContainerUndoTouchedF UndoTouched;
  111. laContainerResetF Reset;
  112. laContainerpUDFPropagateF UDFPropagate;
  113. laContainerPostReadFunc PostRead;
  114. laContainerPostReadFunc PostReadIm;
  115. int Hyper;
  116. int OtherAlloc;
  117. laCanvasTemplate *Template2D;
  118. laListHandle Props;
  119. laUiDefineFunc UiDefine;
  120. laUiDefineFunc MenuUiDefine;
  121. laListHandle FailedNodes;
  122. laListHandle TrashBin;
  123. laListHandle LocalUsers;
  124. int validated;
  125. laProp* SaverDummy;
  126. };
  127. NEED_STRUCTURE(laUiType);
  128. NEED_STRUCTURE(laPanel);
  129. NEED_STRUCTURE(laPropStep);
  130. STRUCTURE(laPropPack){
  131. laPropStep *Go;
  132. void *EndInstance;
  133. laPropStep *LastPs;
  134. laPropPack *RawThis;
  135. char LastIndex;
  136. void *CopyRef; //Also template creation
  137. };
  138. STRUCTURE(laProp){
  139. laListItem Item;
  140. laPropContainer *Container;
  141. int PropertyType;
  142. int ReadOnly;
  143. //laProp* Detached;
  144. laPropPack DetachedPP;
  145. int Len;
  146. char ElementBytes;
  147. uint32_t IconID;
  148. const char *Identifier;
  149. const char *Name;
  150. const char *Description;
  151. const char *Prefix;
  152. const char *Unit;
  153. const char *ExtraInstructions;
  154. laArrayGetLenF GetLen;
  155. laPropContainer *SubExtra; //?
  156. laPropContainer *SubProp;
  157. laUiDefineFunc UiDefine;
  158. laUiType *DefaultUiType;
  159. int DefaultFlags;
  160. int Offset;
  161. char OffsetIsPointer;
  162. char UDFIsRefer;
  163. char UDFNoCreate;
  164. char UDFIgnore;
  165. char UDFOnly;
  166. char UDFIsSingle;
  167. char UDFSingleManageable;
  168. char IsRadAngle;
  169. //int SignalThrow;
  170. //int SignalCatch;
  171. u64bit Tag;
  172. laListHandle UserPanels;
  173. };
  174. STRUCTURE(laPropUserPanel){
  175. laListItem Item;
  176. laPanel *Panel;
  177. laListHandle UserPacks;
  178. };
  179. STRUCTURE(laPropUser){
  180. laListItem Item;
  181. laPropStep *User;
  182. unsigned int FrameDistinguish;
  183. };
  184. STRUCTURE(laPropStep){
  185. laPropStep *pNext;
  186. laProp *p;
  187. char Type;
  188. void *UseInstance;
  189. };
  190. STRUCTURE(laPropLink){
  191. laListItem Item;
  192. laPropPack Recieve;
  193. laSafeString *Identifier;
  194. laProp *Prop;
  195. laPropStep FakePS;
  196. laPropPack PP;
  197. void *DataStowage;
  198. };
  199. STRUCTURE(laIntProp){
  200. laProp Base;
  201. laIntGetF Get;
  202. laIntSetF Set;
  203. laIntArraySetF SetArr;
  204. laIntArraySetAllF SetAll;
  205. laIntArraySetAllArrayF SetAllArr;
  206. laIntArrayGetAllF GetAll;
  207. laIntReadF Read;
  208. laIntArrayReadAllF ReadAll;
  209. int Step;
  210. int Min, Max;
  211. int DefVal;
  212. const int *DefArr;
  213. int *Detached;
  214. };
  215. STRUCTURE(laFloatProp){
  216. laProp Base;
  217. laFloatGetF Get;
  218. laFloatSetF Set;
  219. laFloatArraySetF SetArr;
  220. laFloatArraySetAllF SetAll;
  221. laFloatArraySetAllArrayF SetAllArr;
  222. laFloatArrayGetAllF GetAll;
  223. laFloatReadF Read;
  224. laFloatArrayReadAllF ReadAll;
  225. real Step;
  226. real Min, Max;
  227. real DefVal;
  228. const real *DefArr;
  229. real *Detached;
  230. };
  231. STRUCTURE(laEnumItem){
  232. laListItem Item;
  233. const char *Identifier;
  234. const char *Name;
  235. const char *Description;
  236. int Index;
  237. uint32_t IconID;
  238. };
  239. STRUCTURE(laEnumProp){
  240. laProp Base;
  241. laEnumGetF Get;
  242. laEnumGetLengthF GetLen;
  243. laEnumSetF Set;
  244. laEnumArraySetF SetArr;
  245. laEnumArraySetAllF SetAll;
  246. laEnumArrayGetAllF GetAll;
  247. laEnumReadF Read;
  248. laEnumArrayReadAllF ReadAll;
  249. laListHandle Items; //id start from 1.
  250. int DefVal;
  251. const int *DefArr;
  252. int *Detached;
  253. };
  254. STRUCTURE(laStringProp){
  255. laProp Base;
  256. laStringGetF Get;
  257. laStringSetF Set;
  258. laStringGetLenF Getstrlen;
  259. laStringReadF Read;
  260. char IsSafeString;
  261. const char *DefStr;
  262. char *Detached;
  263. };
  264. NEED_STRUCTURE(laOperatorType)
  265. STRUCTURE(laOperatorProp){
  266. laProp Base;
  267. const char *OperatorID;
  268. laOperatorType *OperatorType;
  269. };
  270. STRUCTURE(laRawProp){
  271. laProp Base;
  272. laRawGetF RawGet;
  273. laRawSetF RawSet;
  274. laRawGetSizeF RawGetSize;
  275. };
  276. STRUCTURE(laSubProp){
  277. laProp Base;
  278. laSubGetInstanceF Get;
  279. laSubGetInstanceF GetActive;
  280. laSubSetInstanceF Set;
  281. laSubGetNextF GetNext;
  282. laSubGetStateF GetState;
  283. laSubSetStateF SetState;
  284. laSubGetAmountF GetAmount;
  285. laSubUIFilterF UiFilter;
  286. laSubUIThemeF GetTheme;
  287. laSubUIGapF GetGap;
  288. laSubUICategoryF GetCategory;
  289. int ListHandleOffset;
  290. laSubTypeDetachedGet DetachedGet;
  291. laSubTypeDetachedGetNext DetachedGetNext;
  292. const char *TargetID;
  293. laGetNodeTypeFunc GetType;
  294. void *Detached;
  295. int IsRefList;
  296. };
  297. STRUCTURE(laPropIterator){
  298. laListItemPointer *Linker;
  299. void *Parent;
  300. void *Handle;
  301. };
  302. //STRUCTURE(laPropGroup) {
  303. // laListItem Item;
  304. // const char * Identifier;
  305. // const char * Name;
  306. // const char * Description;
  307. // //const char * Prefix;
  308. // //const char * Unit;
  309. //
  310. // laListHandle Properties;
  311. //};
  312. STRUCTURE(laResourceFolder){
  313. laListItem Item;
  314. laSafeString* Path;
  315. };
  316. STRUCTURE(laRoot){
  317. laPropContainer *Root;
  318. void *RootInstance;
  319. };
  320. STRUCTURE(laUDFPostRead){
  321. laListItem Item;
  322. void *Instance;
  323. laContainerPostReadFunc Func;
  324. };
  325. //STRUCTURE(laUDFPointerSync) {
  326. // laListItem Item;
  327. // void* ReadPointer;
  328. // void* ActualPointer;
  329. // char * NUID;
  330. //};
  331. //STRUCTURE(laUDFPointerRecord) {
  332. // laListItem Item;
  333. // void* UseInstance;
  334. // laSubProp* SubProp;
  335. // void** PendingReference;
  336. // void* ReadInstance;
  337. // char * NUID;
  338. //};
  339. STRUCTURE(laPtrSync){
  340. laListItem Item; //hash
  341. void *RefDB;
  342. //void* ReadRef;
  343. void *Parent; //key
  344. laSubProp *Prop; //must be sub
  345. };
  346. STRUCTURE(laPtrSyncCommand){
  347. laListItem Item;
  348. laPtrSync *Target;
  349. void *ReadInstance;
  350. laUID ReadNUID;
  351. };
  352. STRUCTURE(laUDFPropSegment){
  353. laListItem Item;
  354. laPropPack *PPP;
  355. laPropPack PP;
  356. laSafeString *Path;
  357. };
  358. STRUCTURE(laUDFH2Instance){
  359. laListItem Item;
  360. laPropContainer* pc;
  361. void* Instance;
  362. };
  363. STRUCTURE(laUDF){
  364. int Opened;
  365. FILE *DiskFile;
  366. laSafeString *FileName;
  367. laListHandle H2Instances;
  368. laUDFH2Instance* CurrentH2Instance;
  369. laListHandle PropsToOperate;
  370. //laListHandle PointerSync;
  371. //laListHandle PointerRecording;
  372. short NumSegmets;
  373. short Modified;
  374. short HasInstances;
  375. short Managed;
  376. u8bit *FileContent;
  377. u64bit Seek;
  378. long TotalRefs;
  379. laListHandle HyperRecords; //writing
  380. //laListHandle LinkedFiles; //writing and reading
  381. laListHandle OwnHyperItems; //reading
  382. };
  383. STRUCTURE(laUDFHyperRecordItem){
  384. laListItem Item;
  385. void* HyperUserMem;
  386. laPropContainer* pc;
  387. u64bit Seek;
  388. };
  389. STRUCTURE(laUDFRegistry){
  390. laListItem Item;
  391. laSafeString* Path;
  392. };
  393. STRUCTURE(laUDFOwnHyperItem){
  394. laListItem Item;
  395. laUID NUID;
  396. laUDFRegistry* Registry;
  397. u64bit Seek;
  398. };
  399. STRUCTURE(laTrashRestoreExtra){
  400. void *Instance;
  401. laListHandle Instances;
  402. };
  403. STRUCTURE(laManagedUDF){
  404. laListItem Item;
  405. laUDF* udf;
  406. laSafeString *BaseName; // update together
  407. laListHandle PropSegments;
  408. };
  409. STRUCTURE(laManagedSaveProp){
  410. laListItem Item;
  411. laSafeString* Path;
  412. };
  413. NEED_STRUCTURE(laUDFContentInstance);
  414. STRUCTURE(laUDFContentNode){
  415. laListItem Item;
  416. laListHandle Instances;
  417. laSafeString *Identifier;
  418. laSafeString *FullPath;
  419. unsigned long FileSeek;
  420. laPropPack PP;
  421. laPropStep FakePS;
  422. laUDFContentInstance *Parent;
  423. };
  424. STRUCTURE(laUDFContentInstance){
  425. laListItem Item;
  426. laSafeString *Identifier;
  427. u64bit FileSeek;
  428. laUDFContentNode *Parent;
  429. laListHandle Children;
  430. };
  431. STRUCTURE(laDiff){
  432. laListItem Item;
  433. laListHandle Commands;
  434. laListHandle ExtraTouched;
  435. laSafeString* Description;
  436. u64bit Hint;
  437. };
  438. STRUCTURE(laDiffExtraTouched){
  439. laListItem Item;
  440. laDBInst* dbi;//ref, not owner
  441. };
  442. STRUCTURE(laDiffCommand){
  443. laListItem Item;
  444. laDBInst* Instance;
  445. laProp* p;
  446. void* Data; //for sub, this is dbinst.
  447. };
  448. STRUCTURE(laDiffCommandRaw){
  449. laListItem Item;
  450. laDBInst* Instance;
  451. laProp* p;
  452. void* Data; int DataSize;
  453. };
  454. STRUCTURE(laDiffCommandInst){
  455. laListItem Item;
  456. laDBInst* OriginalPrev;
  457. laDBInst* OriginalNext;
  458. laDBInst* BeforePrev;
  459. laDBInst* BeforeNext;
  460. laDBInst* DBInst;
  461. };
  462. STRUCTURE(laDiffCommandSub){
  463. laDiffCommand Base;
  464. laListHandle AddedInst;
  465. laListHandle RemovedInst;
  466. laListHandle MovedInst;
  467. };
  468. STRUCTURE(laDiffTemp){
  469. laListItem Item;
  470. void* p;
  471. void* tPrev;
  472. void* tNext;
  473. void* nPrev;
  474. void* nNext;
  475. };
  476. STRUCTURE(laDBRecordedProp){
  477. laListItem Item;
  478. laSafeString* OriginalPath;
  479. };
  480. STRUCTURE(laDBInstPendingRelink){
  481. laListItem Item;
  482. laDBInst* dbi; void* from; void* to;
  483. };
  484. STRUCTURE(laDBInst){
  485. laListItem Item;
  486. laListItem Item2;//DBInstLink
  487. void* OriginalInstance;
  488. laPropContainer* pc;
  489. laListHandle Props;
  490. };
  491. STRUCTURE(laDBProp){
  492. laListItem Item;
  493. laProp* p;
  494. void* Data;
  495. //---------------
  496. };
  497. ;
  498. STRUCTURE(laDBRawProp){
  499. laListItem Item;
  500. laProp* p;
  501. void* Data;
  502. //---------------
  503. int DataSize;
  504. };
  505. STRUCTURE(laDBSubProp){
  506. laListItem Item;
  507. laProp* p;
  508. void* Data;
  509. //---------------
  510. laListHandle Instances;
  511. };
  512. STRUCTURE(laDiffPtrSync){
  513. laListItem Item;
  514. void* instance;
  515. laDBProp* dbp;
  516. laDiffCommand* dc;
  517. };
  518. STRUCTURE(laDiffPost){
  519. laListItem Item;
  520. void* instance;
  521. laContainerUndoTouchedF Touched;
  522. };
  523. //STRUCTURE(laUDFFailNode) {
  524. // laListItemPointer Item;
  525. // laPropContainer* pc;
  526. //};
  527. /* Only little endian are supported right now */
  528. #define LA_UDF_IDENTIFIER "UDF_LE"
  529. #define LA_UDF_EXTENSION_FLOAT32 (1<<0)
  530. #define LA_UDF_EXTENSION_RAW (1<<1)
  531. #define LA_UDF_EXTENSION_BITS 0
  532. #define LA_UDF_MARK_TIMESTAMP 3
  533. #define LA_UDF_MODE_APPEND 0
  534. #define LA_UDF_MODE_OVERWRITE 1
  535. #define LA_UDF_SINGLE (1<<0)
  536. #define LA_UDF_COLLECTION (1<<1)
  537. #define LA_UDF_REFER (1<<2)
  538. #define LA_UDF_ITEM (1<<3) //ItemType
  539. #define LA_UDF_ACTIVE (1<<4)
  540. #define LA_UDF_STATE (1<<5)
  541. #define LA_UDF_REGULAR_MARK_64 (1<<6)
  542. #define LA_UDF_ARRAY_MARK_64 (1<<7)
  543. #define LA_UDF_HYPER_ITEM (1<<8) //ItemType
  544. #define LA_UDF_SHARE_RESOURCE (1<<9)
  545. #define LA_UDF_USE_VERSION (1<<10) //Use History
  546. #define LA_UDF_REGULAR_MARK_32 (1<<10)
  547. #define LA_UDF_ARRAY_MARK_32 (1<<11)
  548. #define LA_UDF_STRING_MARK (1<<12)
  549. #define LA_UDF_HYPER_MARK (1<<13)
  550. #define LA_UDF_ONLY (1<<14)
  551. #define LA_UDF_RAW_MARK (1<<14)
  552. //#define LA_UDF_LINKED_ITEM (1<<15) //ItemType
  553. #define LA_UDF_IGNORE (1<<16)
  554. #define LA_DETACHABLE (1<<17)
  555. #define LA_UDF_VARIABLE_NODE_SIZE (1<<18)
  556. #define LA_UDF_FIXED_NODE_SIZE (1<<19)
  557. #define LA_UDF_LOCAL (1<<20)
  558. #define LA_RAD_ANGLE (1<<21)
  559. #define LA_UDF_PRINT_STATICS (1<<22)
  560. #define LA_UDF_NUID_SEEK (1<<23)
  561. #define LA_UDF_NUID_LINK_FILES (1<<24)
  562. #define LA_AS_IDENTIFIER (1<<25)
  563. #define LA_UDF_USE_LINK_NODE (1<<26)
  564. #define LA_READ_ONLY (1<<27)
  565. STRUCTURE(laThreadNotifier){
  566. laListItem Item;
  567. char Path[256];
  568. };
  569. laPropContainer *laDefineRoot();
  570. NEED_STRUCTURE(laOperatorType)
  571. NEED_STRUCTURE(laOperator)
  572. NEED_STRUCTURE(laEvent)
  573. void *laget_ListNext(laListItem *Item, void *UNUSED);
  574. void *laget_ListPrev(laListItem *Item, void *UNUSED);
  575. void *laget_List2Next(laListItem2 *Item, void *UNUSED);
  576. void *laget_List2Prev(laListItem2 *Item, void *UNUSED);
  577. void la_DEBUG_VerifyThisContainer(laPanel *pa, laPropContainer *pc);
  578. void la_DEBUG_VerifyPanelPropsDestroyed(laPanel *p);
  579. void la_CopyPropPack(laPropPack *From, laPropPack *To);
  580. void laPropPackToLocal(laPropPack* ToPP, laPropPack* pp);
  581. laPropContainer* la_EnsureSubTarget(laSubProp* sp, void* optional_instance);
  582. laPropContainer *la_ContainerLookup(char *ID);
  583. laProp *la_PropLookup(laListHandle *lst, char *ID);
  584. void la_UsePropPack(laPropPack *pp, int ForceRecalc);
  585. void la_StopUsingPropPack(laPropPack *pp);
  586. void la_SetPropMathcerContext(laPanel *p);
  587. void laNotifyUsersPP(laPropPack *pp);
  588. void laNotifyUsersPPPath(laPropPack *pp, char *path);
  589. void laNotifySubPropUsers(laProp *p, void *Instance);
  590. void laNotifyUsers(char *Path);
  591. void laNotifyInstanceUsers(void *Instance);
  592. void laThreadNotifyUsers(char *Path);
  593. int laIsPropertyReadOnly(laPropPack *pp);
  594. int laGetPrefixP(laPropPack *p, char buf[8][64]);
  595. int laGetPrefix(laProp *p, char buf[8][64]);
  596. laPropContainer* laGetInstanceType(laPropPack* pp, void* instance);
  597. laUiDefineFunc* laGetPropertyUiDefine(laPropPack* pp, void* instance);
  598. int laSetInt(laPropPack *pp, int n);
  599. int laGetInt(laPropPack *pp);
  600. int laSetFloat(laPropPack *pp, real n);
  601. real laGetFloat(laPropPack *pp);
  602. int laGetArrayLength(laPropPack *pp);
  603. int laSetIntArraySingle(laPropPack *pp, int index, int n);
  604. int laSetIntArrayAll(laPropPack *pp, int n);
  605. int laSetIntArrayAllArray(laPropPack *pp, int *arr);
  606. int laGetIntArray(laPropPack *pp, int *result);
  607. int laSetFloatArraySingle(laPropPack *pp, int index, real n);
  608. int laSetFloatArrayAll(laPropPack *pp, real n);
  609. int laSetFloatArrayAllArray(laPropPack *pp, real *arr);
  610. int laGetFloatArray(laPropPack *pp, real *result);
  611. laEnumItem *laGetEnum(laPropPack *pp);
  612. laEnumItem *laGetEnumEntryLen(laPropPack *pp);
  613. laEnumItem *laGetEnumArrayIndexed(laPropPack *pp, int index);
  614. int laGetEnumArray(laPropPack *pp, laEnumItem **result);
  615. laEnumItem *laGetEnumFromIdentifier(laEnumProp *p, char *Identifier);
  616. int laEnumHasIcon(laPropPack *pp);
  617. int laSetEnumExternal(laPropPack *pp, int n);
  618. int laSetEnum(laPropPack *pp, int n);
  619. int laSetEnumArrayIndexedExternal(laPropPack *pp, int index, int n);
  620. int laSetEnumArrayIndexed(laPropPack *pp, int index, int n);
  621. int laSetEnumArrayAllArray(laPropPack* pp, laEnumItem** ei);
  622. int laSetEnumArrayAll(laPropPack* pp, int EnumN);
  623. int laSetString(laPropPack *pp, char *str);
  624. int laGetString(laPropPack *pp, char *result, char** direct_result);
  625. int laActuateProp(laPropPack *This, laPropPack *RunPP, laOperator *OptionalFrom, laEvent *e);
  626. int laGetIntRange(laPropPack *pp, int *min, int *max);
  627. int laGetFloatRange(laPropPack *pp, real *min, real *max);
  628. void* laGetRaw(laPropPack *pp, int* r_size, int* return_is_a_copy);
  629. int laSetRaw(laPropPack *pp, void* data, int _size);
  630. void laMarkPropChanged(laPropPack* pp);
  631. void laMarkMemChanged(void* memuser);
  632. void *la_FindMatchingInstance(void *From, laProp *Sub, laProp *p, laPropStep *Value);
  633. void la_FreePropStepCache(laPropStep *GoTarget);
  634. void la_StepPropPack(laPropPack *pp);
  635. void la_GetPropPackFullPath(laPropPack *pp, char *result);
  636. void la_GetPropPackPath(laPropPack *pp, char *result);
  637. laItemUserLinker *laUseDataBlock(void* HyperUserMem, laProp *Which, unsigned int FrameDistinguish, void *User, laUserRemoveFunc Remover, int ForceRecalc);
  638. void laStopUsingDataBlock(void* HyperUserMem, laProp *prop, laPanel *p);
  639. void laDataBlockNoLongerExists(void *HyperUserMem, laListHandle* UserList);
  640. void laThrowToTrashBin(void* Data, char *ContainerString);
  641. void la_FreeProperty(laProp* p);
  642. void la_FreePropertyContainer(laPropContainer* pc);
  643. laSaverDummy* laGetSaverDummy(void* instance, laSubProp* p);
  644. void laPurgeSaverDummy(void* instance, laSubProp* p);
  645. laPropContainer *laAddPropertyContainer(const char *Identifier, const char *Name, const char *Description, uint32_t IconID, laUiDefineFunc DefaultUiDefine,
  646. int NodeSize, laContainerPostReadFunc PostRead, laContainerPostReadFunc PostReadIm, int IsHyper);
  647. laProp* laPropContainerManageable(laPropContainer* pc, int offset_of_dummy_list);
  648. void laPropContainerExtraFunctions(laPropContainer* pc, laContainerBeforeFreeF BeforeFree, laContainerResetF Reset, laContainerUndoTouchedF Touched, laContainerpUDFPropagateF UDFPropagate, laUiDefineFunc MenuUi);
  649. const char *la_GetPropertyTypeString(int Type);
  650. NEED_STRUCTURE(laWidget);
  651. laProp *la_CreateProperty(laPropContainer *Container, int Type, const char *Identifier, const char *Name, const char *Description,
  652. const char *Prefix, const char *Unit, laWidget* DefaultWidget, u64bit Tag);
  653. void la_ClearDetachedProp(laPanel* p);
  654. laProp *la_MakeDetachedProp(laPanel* p, const char *From, const char *Rename);
  655. laProp *laAddIntProperty(laPropContainer *Container, const char *Identifier, const char *Name, const char *Description, laWidget* DefaultWidget,
  656. const char *Prefix, const char *Unit, int Max, int Min, int Step, int DefVal, const int *DefArr,
  657. int OffsetSize, laIntGetF Get, laIntSetF Set, int ArrayLength, laArrayGetLenF GetLen,
  658. laIntArraySetF SetArr, laIntArrayGetAllF GetAll, laIntArraySetAllF SetAll, laIntArraySetAllArrayF SetAllArr,
  659. laIntReadF Read, laIntArrayReadAllF ReadAll,
  660. u64bit Tag);
  661. laProp *laAddFloatProperty(laPropContainer *Container, const char *Identifier, const char *Name, const char *Description, laWidget* DefaultWidget,
  662. const char *Prefix, const char *Unit, real Max, real Min, real Step, real DefVal, const real *DefArr,
  663. int OffsetSize, laFloatGetF Get, laFloatSetF Set, int ArrayLength, laArrayGetLenF GetLen,
  664. laFloatArraySetF SetArr, laFloatArrayGetAllF GetAll, laFloatArraySetAllF SetAll, laFloatArraySetAllArrayF SetAllArr,
  665. laFloatReadF Read, laFloatArrayReadAllF ReadAll,
  666. u64bit Tag);
  667. laProp *laAddEnumProperty(laPropContainer *Container, const char *Identifier, const char *Name, const char *Description, laWidget* DefaultWidget,
  668. const char *Prefix, const char *Unit, int DefVal, const int *DefArr,
  669. int OffsetSize, laEnumGetF Get, laEnumSetF Set, int ArrayLength, laArrayGetLenF GetLen,
  670. laEnumArraySetF SetArr, laEnumArrayGetAllF GetAll, laEnumArraySetAllF SetAll,
  671. laEnumReadF Read, laEnumArrayReadAllF ReadAll,
  672. u64bit Tag);
  673. int laAddEnumItem(laProp *p, const char *Identifier, const char *Name, const char *Description, uint32_t IconID);
  674. int laAddEnumItemAs(laProp *p, const char *Identifier, const char *Name, const char *Description, int Index, uint32_t IconID);
  675. laProp *laAddStringProperty(laPropContainer *Container, const char *Identifier, const char *Name, const char *Description, laWidget* DefaultWidget,
  676. const char *Prefix, const char *Unit, const char *DefStr,
  677. int IsSafeString, int OffsetSize, laStringGetLenF GetLen, laStringGetF Get, laStringSetF Set,
  678. laStringReadF Read,
  679. u64bit Tag);
  680. laProp *laAddSubGroup(laPropContainer *Container, const char *Identifier, const char *Name, const char *Description,
  681. const char *TargetId, laGetNodeTypeFunc GetType, laWidget* DefaultWidget, laUiDefineFunc DefaultUiDef,
  682. int OffsetSize, laSubGetInstanceF Get, laSubGetInstanceF GetActive, laSubGetNextF GetNext, laSubSetInstanceF Set,
  683. laSubGetStateF GetState, laSubSetStateF SetState, int ListHandleOffset, u64bit Tag);
  684. void laSubGroupExtraFunctions(laProp* p, laSubUIFilterF* UiFilter, laSubUIThemeF* GetTheme, laSubUIGapF GetGap, laSubUICategoryF GetCategory);
  685. void laSubGroupDetachable(laProp *SubProp, laSubTypeDetachedGet DetachedGet, laSubTypeDetachedGetNext DetachedGetNext);
  686. laProp *laAddOperatorProperty(laPropContainer *Container, const char *Identifier, const char *Name, const char *Description,
  687. const char *OperatorID, uint32_t IconID, laWidget* DefaultWidget);
  688. laProp *laAddRawProperty(laPropContainer *Container, const char *Identifier, const char *Name, const char *Description, int OffsetSize, laRawGetSizeF GetSize, laRawGetF RawGet, laRawSetF RawSet, u64bit Tag);
  689. //void laPropertySignal(laProp* p, int Throw, int Catch);
  690. NEED_STRUCTURE(laBoxedTheme);
  691. void *laGetInstance(laProp *sub, void *ThisInstance, laPropIterator *pi);
  692. void *laGetNextInstance(laProp *sub, void *FromInstance, laPropIterator *pi);
  693. void *laGetActiveInstanceStrict(laProp *sub, void *FromInstance);
  694. void *laGetActiveInstance(laProp *sub, void *FromInstance, laPropIterator *pi);
  695. void laSetActiveInstance(laProp *sub, void *FromInstance, void *Instance);
  696. void laAppendInstance(laSubProp *sub, void *FromInstance, void *Instance);
  697. int laGetUiState(laProp *sub, void *Instance);
  698. laBoxedTheme* laGetUiTheme(laProp *sub, void* parent, void *Instance);
  699. int laGetUiGap(laProp *sub, void* parent, void *Instance);
  700. void laGetCategory(laProp *sub, void* parent, void *Instance, char* buf, char** buf_ptr);
  701. int laCanGetState(laProp *sub);
  702. int laCanGetTheme(laProp *sub);
  703. int laCanGetGap(laProp *sub);
  704. int laCanGetCategory(laProp *sub);
  705. int laSetState(laProp *sub, void *FromInstance, void *Instance, int State);
  706. laPropContainer *la_SetGeneralRoot(laPropContainer **GeneralRoot, const char *Identifier, const char *Name, const char *Description);
  707. int la_GetPropFromPath(laPropPack *Self, laPropPack *Base, const char *Path, void **SpecifiedInstance);
  708. laProp *la_GetGeneralPropFromPath(laProp *General, const char *Path);
  709. int laValidateProperties();
  710. void laSetRootInstance(void *root);
  711. void la_RegisterMainUiTypes();
  712. void la_RegisterMainThemes();
  713. void la_RegisterInternalProps();
  714. void la_PrintPropStructure();
  715. laProp *la_GetGeneralProp(laProp *p);
  716. void* laget_InstanceActiveUDF(void* instance);
  717. void laset_InstanceUDF(void* instance, void* set);
  718. void la_UDFAppendSharedTypePointer(char *ID, void *Pointer);
  719. void la_AppendLinkedFile(laUDF *File);
  720. void la_GetWorkingDirectoryInternal();
  721. int laGetRelativeDirectory(char *FullFrom, char *FullTo, char *Result);
  722. void laGetUDFRelativeDirectory(laUDF *From, laUDF *To, char *Result);
  723. void laGetFullPath(char *FullFrom, char *Relative, char *Result);
  724. laUDF *laPrepareUDF(char *FileName);
  725. int laWriteProp(laUDF *udf, char *Path);
  726. int laWritePropP(laUDF *udf, laPropPack *pp);
  727. int laPackUDF(laUDF *udf, int UseInstanceList);
  728. void laSaveProp(char* path);
  729. void laClearSaveProp();
  730. int laRegisterModifications(int ReturnIfAnyMod, int ReturnIfAnyEmpty, int* rempty, int RegisterToUDF);
  731. laUDF *laOpenUDF(char *FileName, int ReadToMemory, laUDFRegistry* ReadRegistryRef, laManagedUDF** UseManaged);
  732. void laCloseUDF(laUDF *udf);
  733. int laExtractUDF(laUDF *udf, laManagedUDF* mUDF, int Mode, laListHandle *Parent);
  734. laUDFOwnHyperItem* laFindHyperItem(laPropContainer* pc, char* uid);
  735. laUDFRegistry* laFindUDFRegistry(char* Path);
  736. laUDFRegistry* laCreateUDFRegistry(char* Path);
  737. void laClearUDFRegistries();
  738. void laRefreshUDFRegistries();
  739. laManagedUDF* la_FindManagedUDF(char* FileName);
  740. laManagedUDF* la_EnsureManagedUDF(char* FileName, int PutAtTop);
  741. void la_MakeDummyManagedUDF();
  742. void laStopManageUDF(laManagedUDF* m);
  743. void laClearManagedUDF();
  744. void laSaveManagedUDF();
  745. void laPropagateUDF(laPropContainer* pc, void* inst, int force);
  746. //================== manifest
  747. void laAddResourceFolder(char* Path);
  748. void laRemoveResourceFolder(laResourceFolder* rf);
  749. void la_ClearUDFRegistryAndFolders();
  750. //================== undo
  751. void laPrintDBInstInfo();
  752. void la_NoLongerRecordUndo();
  753. void laAddRootDBInst(char* path);
  754. void laPushDifferences(char* Description, u64bit hint);
  755. int laRecordDifferences(laPropPack* base, char* path);
  756. int laRecordInstanceDifferences(void* instance, const char* container);
  757. void laRecordAndPush(laPropPack* base, char* path, char* description, uint64_t hint);
  758. void laRecordAndPushProp(laPropPack* base, char* path);
  759. void laRecordEverythingAndPush();
  760. void laUndo();
  761. void laRedo();