*/}}

la_data.h 30 KB

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