*/}}

la_operators.c 83 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004
  1. #include "../la_5.h"
  2. extern LA MAIN;
  3. extern struct _tnsMain *T;
  4. void la_PanelActiviatorParser(laStringSplitor *ss, uint32_t *IconID, char *DisplayString){
  5. char *StrArg;
  6. if (ss->parts.pFirst){
  7. if (StrArg = strGetArgumentString(ss, "text")){
  8. strCopyFull(DisplayString, StrArg);
  9. }else if (StrArg = strGetArgumentString(ss, "panel_id")){
  10. laUiTemplate* uit = laFindUiTemplate(StrArg);
  11. strCopyFull(DisplayString, transLate("Show "));
  12. strAppend(DisplayString, uit->Title->Ptr);
  13. }
  14. }else{
  15. strCopyFull(DisplayString, transLate("Activate A Panel"));
  16. }
  17. }
  18. void la_DefaultOperatorParser(laStringSplitor *ss, uint32_t *IconID, char *DisplayString){
  19. char *StrArg;
  20. laStringPart *sp;
  21. if (ss && ss->parts.pFirst){
  22. if (StrArg = strGetArgumentString(ss, "text")){
  23. strCopyFull(DisplayString, StrArg);
  24. }
  25. if (StrArg = strGetArgumentString(ss, "icon")){
  26. int adv=0; *IconID = laToUnicode(StrArg, &adv);
  27. }
  28. }
  29. }
  30. laProp *la_PropLookup(laListHandle *lst, char *ID);
  31. void la_EnsurePanelSnapping(laPanel *p, int CW, int CH);
  32. void la_RecalcBlockRecursive(laBlock *b, int X, int Y, int W, int H);
  33. void la_ConditionNodeFreeRecursive(laUiConditionNode *ucn);
  34. int OPMOD_FinishOnData(laOperator* a, laEvent* e){
  35. if(a->ConfirmData){
  36. return LA_FINISHED_PASS;
  37. }
  38. return LA_RUNNING;
  39. }
  40. int OPCHK_AlwaysTrue(laPropPack *pp, laStringSplitor *ss){
  41. return 1;
  42. }
  43. int OPINV_DoNothing(laOperator *a, laEvent *e){
  44. return LA_FINISHED;
  45. }
  46. int OPINV_PureYesNo(laOperator *a, laEvent *e){
  47. laEnableYesNoPanel(a, 0, "Please Consider:", "Are You Sure?", 80, 80, 250, e);
  48. return LA_FINISHED;
  49. }
  50. #define DEFINE_FORMAT(str, type) \
  51. if (!strcmp(format, str)) \
  52. return type;
  53. int la_DetectFileItemType(laFileItem *fi){
  54. char *format = strGetLastSegment(fi->Name, '.');
  55. DEFINE_FORMAT("udf", LA_FILETYPE_UDF);
  56. DEFINE_FORMAT("lasdexchange", LA_FILETYPE_LASDEXCHANGE);
  57. DEFINE_FORMAT("odt", LA_FILETYPE_DOCUMENT);
  58. DEFINE_FORMAT("ods", LA_FILETYPE_DOCUMENT);
  59. DEFINE_FORMAT("odp", LA_FILETYPE_DOCUMENT);
  60. DEFINE_FORMAT("txt", LA_FILETYPE_DOCUMENT);
  61. DEFINE_FORMAT("c", LA_FILETYPE_DOCUMENT);
  62. DEFINE_FORMAT("cpp", LA_FILETYPE_DOCUMENT);
  63. DEFINE_FORMAT("cxx", LA_FILETYPE_DOCUMENT);
  64. DEFINE_FORMAT("cs", LA_FILETYPE_DOCUMENT);
  65. DEFINE_FORMAT("pas", LA_FILETYPE_DOCUMENT);
  66. DEFINE_FORMAT("h", LA_FILETYPE_DOCUMENT);
  67. DEFINE_FORMAT("hpp", LA_FILETYPE_DOCUMENT);
  68. DEFINE_FORMAT("hxx", LA_FILETYPE_DOCUMENT);
  69. DEFINE_FORMAT("inl", LA_FILETYPE_DOCUMENT);
  70. DEFINE_FORMAT("doc", LA_FILETYPE_DOCUMENT);
  71. DEFINE_FORMAT("docx", LA_FILETYPE_DOCUMENT);
  72. DEFINE_FORMAT("xls", LA_FILETYPE_DOCUMENT);
  73. DEFINE_FORMAT("xlsx", LA_FILETYPE_DOCUMENT);
  74. DEFINE_FORMAT("ppt", LA_FILETYPE_DOCUMENT);
  75. DEFINE_FORMAT("pptx", LA_FILETYPE_DOCUMENT);
  76. DEFINE_FORMAT("rtf", LA_FILETYPE_DOCUMENT);
  77. DEFINE_FORMAT("md", LA_FILETYPE_DOCUMENT);
  78. DEFINE_FORMAT("jpg", LA_FILETYPE_IMAGE);
  79. DEFINE_FORMAT("jpeg", LA_FILETYPE_IMAGE);
  80. DEFINE_FORMAT("png", LA_FILETYPE_IMAGE);
  81. DEFINE_FORMAT("tga", LA_FILETYPE_IMAGE);
  82. DEFINE_FORMAT("bmp", LA_FILETYPE_IMAGE);
  83. DEFINE_FORMAT("exr", LA_FILETYPE_IMAGE);
  84. DEFINE_FORMAT("psd", LA_FILETYPE_IMAGE);
  85. DEFINE_FORMAT("kra", LA_FILETYPE_IMAGE);
  86. DEFINE_FORMAT("dng", LA_FILETYPE_IMAGE);
  87. DEFINE_FORMAT("cr2", LA_FILETYPE_IMAGE);
  88. DEFINE_FORMAT("dds", LA_FILETYPE_IMAGE);
  89. DEFINE_FORMAT("mp3", LA_FILETYPE_AUDIO);
  90. DEFINE_FORMAT("wav", LA_FILETYPE_AUDIO);
  91. DEFINE_FORMAT("ape", LA_FILETYPE_AUDIO);
  92. DEFINE_FORMAT("flac", LA_FILETYPE_AUDIO);
  93. DEFINE_FORMAT("cue", LA_FILETYPE_AUDIO);
  94. DEFINE_FORMAT("wma", LA_FILETYPE_AUDIO);
  95. DEFINE_FORMAT("aac", LA_FILETYPE_AUDIO);
  96. DEFINE_FORMAT("m4a", LA_FILETYPE_AUDIO);
  97. DEFINE_FORMAT("ogg", LA_FILETYPE_AUDIO);
  98. DEFINE_FORMAT("mp4", LA_FILETYPE_VIDEO);
  99. DEFINE_FORMAT("mov", LA_FILETYPE_VIDEO);
  100. DEFINE_FORMAT("avi", LA_FILETYPE_VIDEO);
  101. DEFINE_FORMAT("avchd", LA_FILETYPE_VIDEO);
  102. DEFINE_FORMAT("mkv", LA_FILETYPE_VIDEO);
  103. DEFINE_FORMAT("qt", LA_FILETYPE_VIDEO);
  104. DEFINE_FORMAT("flv", LA_FILETYPE_VIDEO);
  105. DEFINE_FORMAT("zip", LA_FILETYPE_COMPRESSED);
  106. DEFINE_FORMAT("rar", LA_FILETYPE_COMPRESSED);
  107. DEFINE_FORMAT("gz", LA_FILETYPE_COMPRESSED);
  108. DEFINE_FORMAT("bz", LA_FILETYPE_COMPRESSED);
  109. DEFINE_FORMAT("7z", LA_FILETYPE_COMPRESSED);
  110. DEFINE_FORMAT("iso", LA_FILETYPE_COMPRESSED);
  111. DEFINE_FORMAT("dmg", LA_FILETYPE_COMPRESSED);
  112. DEFINE_FORMAT("ttf", LA_FILETYPE_FONT);
  113. DEFINE_FORMAT("otf", LA_FILETYPE_FONT);
  114. DEFINE_FORMAT("woff", LA_FILETYPE_FONT);
  115. DEFINE_FORMAT("svg", LA_FILETYPE_VECTOR);
  116. DEFINE_FORMAT("dwg", LA_FILETYPE_VECTOR);
  117. DEFINE_FORMAT("dxf", LA_FILETYPE_VECTOR);
  118. DEFINE_FORMAT("cdr", LA_FILETYPE_VECTOR);
  119. DEFINE_FORMAT("htm", LA_FILETYPE_WEBPAGE);
  120. DEFINE_FORMAT("html", LA_FILETYPE_WEBPAGE);
  121. DEFINE_FORMAT("xhtml", LA_FILETYPE_WEBPAGE);
  122. DEFINE_FORMAT("xml", LA_FILETYPE_META);
  123. DEFINE_FORMAT("dat", LA_FILETYPE_META);
  124. DEFINE_FORMAT("json", LA_FILETYPE_META);
  125. DEFINE_FORMAT("blend", LA_FILETYPE_BLEND);
  126. DEFINE_FORMAT("pdf", LA_FILETYPE_PDF);
  127. DEFINE_FORMAT("exe", LA_FILETYPE_EXEC);
  128. DEFINE_FORMAT("dll", LA_FILETYPE_SYS);
  129. DEFINE_FORMAT("sys", LA_FILETYPE_SYS);
  130. return 0;
  131. }
  132. void la_FileBrowserRebuildList(laFileBrowser *fb){
  133. laFileItem *fi = 0;
  134. laDiskItem *dl = 0;
  135. laListHandle Files = {0};
  136. char Lookup[2048]={0};
  137. char Final[2048]={0};
  138. char DiskLabels[256] = {0};
  139. char *pd = DiskLabels;
  140. int len = strlen(fb->Path);
  141. int NumDisks = 0;
  142. long long FreeAvailable = 0;
  143. long long FreeSpace_UNUSED = 0;
  144. long long TotalSpace = 0;
  145. real Ratio = 0;
  146. if (fb->Path[len - 1] != L'/') strcat(fb->Path, "/");
  147. struct dirent **NameList=0;
  148. int NumFiles=scandir(fb->Path,&NameList,0,alphasort);
  149. while (fi = lstPopItem(&fb->FileList))
  150. memFree(fi);
  151. for(int i=0;i<NumFiles;i++){
  152. struct dirent* d = NameList[i];
  153. if(!strcmp(d->d_name, ".") || !strcmp(d->d_name, "..")){continue;}
  154. struct stat s;
  155. sprintf(Final, "%s%s",fb->Path,d->d_name);
  156. stat(Final, &s);
  157. if (S_ISDIR(s.st_mode)){
  158. fi = memAcquireSimple(sizeof(laFileItem));
  159. strcpy(fi->Name, d->d_name);
  160. fi->IsFolder = 1;
  161. fi->Type = LA_FILETYPE_FOLDER;
  162. lstAppendItem(&fb->FileList, fi);
  163. }elif (!fb->SelectFolder){
  164. fi = memAcquireSimple(sizeof(laFileItem));
  165. strcpy(fi->Name, d->d_name);
  166. fi->Size = s.st_size;
  167. fi->Type = la_DetectFileItemType(fi);
  168. struct tm *t = localtime(&s.st_ctime);
  169. fi->TimeModified.Year = t->tm_year+1900;
  170. fi->TimeModified.Month = t->tm_mon+1;;
  171. fi->TimeModified.Day = t->tm_mday;
  172. fi->TimeModified.Hour = t->tm_hour;
  173. fi->TimeModified.Minute = t->tm_min;
  174. fi->TimeModified.Second = t->tm_sec;
  175. lstAppendItem(&Files, fi);
  176. //lstAppendItem(&fb->FileList, fi);
  177. }
  178. }
  179. lstCombineLists(&fb->FileList, &Files);
  180. for (int i=0;i<NumFiles;i++){ free(NameList[i]); } free(NameList);
  181. while (dl = lstPopItem(&fb->Disks))
  182. memFree(dl);
  183. //NumDisks = GetLogicalDriveStrings(256, DiskLabels) / 4;
  184. //while (*pd)
  185. //{
  186. // char Name[3] = "*:";
  187. // Name[0] = *pd;
  188. // if (GetDiskFreeSpaceEx(Name, &FreeAvailable, &TotalSpace, &FreeSpace_UNUSED))
  189. // {
  190. // dl = memAcquireSimple(sizeof(laDiskItem));
  191. // dl->ID = *pd;
  192. // dl->Total_GB = (real)TotalSpace / 1073741824.0f; //B->GB
  193. // dl->Free_GB = (real)FreeAvailable / 1073741824.0f; //B->GB
  194. // if (Name[0] == fb->Path[0])
  195. // fb->RootDisk = dl;
  196. // lstAppendItem(&fb->Disks, dl);
  197. // }
  198. // pd += 4;
  199. //}
  200. fb->Active = 0;
  201. fb->FileName[0] = 0;
  202. }
  203. laFileBrowser *la_FileBrowserInit(laOperator *a){
  204. laFileBrowser *fb = memAcquireHyper(sizeof(laFileBrowser));
  205. strcpy(fb->Path, MAIN.WorkingDirectory->Ptr);
  206. if (strArgumentMatch(a->ExtraInstructionsP, "select", "folder")){
  207. fb->SelectFolder = LA_FILE_SELECT_FOLDER;
  208. }
  209. la_FileBrowserRebuildList(fb);
  210. return fb;
  211. }
  212. void laset_FileBrowserSelectFile(laFileBrowser *fb, laFileItem *fi, int State){
  213. int len;
  214. if (fb->Active == fi){
  215. if (fi->IsFolder){
  216. len = strlen(fb->Path);
  217. if (fb->Path[len - 1] != L'/') strcat(fb->Path, "/");
  218. strcat(fb->Path, fi->Name);
  219. la_FileBrowserRebuildList(fb);
  220. laRecalcCurrentPanelImmediate();
  221. }
  222. }else{
  223. if (!fi->IsFolder){
  224. strCopyFull(fb->FileName, fi->Name);
  225. }
  226. fb->Active = fi;
  227. }
  228. }
  229. int la_FileBrowserConfirm(laOperator *a, laFileBrowser *fb){
  230. char buf[2048] = {0};
  231. int plen;
  232. if (!fb->SelectFolder && fb->FileName[0] == L'\0') return 0;
  233. plen = strlen(fb->Path);
  234. if (fb->Path[plen - 1] != L'/') strcat(fb->Path, "/");
  235. strCopyFull(buf, fb->Path);
  236. strcat(buf, fb->FileName);
  237. laConfirmString(a, buf, LA_CONFIRM_OK);
  238. return 1;
  239. }
  240. void *laget_FileBrowserFirstFile(laFileBrowser *fb, void* unused){
  241. return fb->FileList.pFirst;
  242. }
  243. void *laget_FileBrowserActiveFile(laFileBrowser *fb){
  244. return fb->Active;
  245. }
  246. void laget_FileBrowserDiskID(laDiskItem *di, char *result){
  247. result[0] = di->ID;
  248. result[1] = L':';
  249. result[2] = L'/';
  250. result[3] = L'\0';
  251. }
  252. void *laset_FileBrowserActiveDisk(laFileBrowser *fb, laDiskItem *di, int UNUSED_State){
  253. fb->RootDisk = di;
  254. laget_FileBrowserDiskID(di, fb->Path);
  255. la_FileBrowserRebuildList(fb);
  256. }
  257. void laset_FileBrowserPath(laFileBrowser *fb, char *content){
  258. strCopyFull(fb->Path, content);
  259. la_FileBrowserRebuildList(fb);
  260. laRecalcCurrentPanel();
  261. }
  262. void la_FileBrowserUpLevel(laFileBrowser *fb){
  263. char *p = fb->Path;
  264. char *LastP = 0;
  265. int Count = 0;
  266. for (p; *p; p++){
  267. if (*p && *p == L'/' && p[1]!=0){
  268. LastP = p;
  269. Count++;
  270. }
  271. }
  272. if (Count > 1) *LastP = 0;
  273. else if(LastP) *(LastP + 1) = 0;
  274. la_FileBrowserRebuildList(fb);
  275. }
  276. int OPINV_FileBrowser(laOperator *a, laEvent *e){
  277. a->CustomData = la_FileBrowserInit(a);
  278. laEnableOperatorPanel(a, 0, LA_RH2, LA_RH2, 500, 500, 0, 0, 0, 0, LA_RH2, LA_RH2, LA_RH2, LA_RH2, e);
  279. return LA_RUNNING;
  280. }
  281. int OPEXT_FileBrowser(laOperator *a, int mark){
  282. memFree(a->CustomData);
  283. return 0;
  284. }
  285. int OPMOD_FileBrowser(laOperator *a, laEvent *e){
  286. laFileBrowser *fb = a->CustomData;
  287. if (a->ConfirmData){
  288. if (a->ConfirmData->Mode == LA_CONFIRM_CANCEL){
  289. laConfirmSameDataIfAny(a);
  290. return LA_FINISHED_PASS;
  291. }
  292. if (a->ConfirmData->Mode == LA_CONFIRM_OK){
  293. if (la_FileBrowserConfirm(a, fb)){
  294. //MessageBox(0, a->NextConfirmData->StrData, "!", 0);
  295. }
  296. return LA_FINISHED_PASS;
  297. }
  298. }
  299. if (e->Type == LA_ESCAPE_DOWN){
  300. laConfirmInt(a, 0, LA_CONFIRM_CANCEL);
  301. return LA_FINISHED;
  302. }
  303. return LA_RUNNING;
  304. }
  305. int OPCHK_IsFileBrowser(laPropPack *This, laStringSplitor *ss){
  306. if (This && This->LastPs->p->SubProp == _LA_PROP_FILE_BROWSER) return 1;
  307. return 0;
  308. }
  309. int OPINV_FileBrowserUpLevel(laOperator *a, laEvent *e){
  310. if (a->This){
  311. la_FileBrowserUpLevel(a->This->LastPs->UseInstance);
  312. laNotifyUsersPPPath(a->This, "path");
  313. laRecalcCurrentPanel();
  314. }
  315. return LA_FINISHED_PASS;
  316. }
  317. int OPEXT_UDFOperation(laOperator *a, laEvent *e){
  318. laUDFPreviewExtra *upe = a->CustomData;
  319. laUDFContentNode *ucni, *NextUCNI;
  320. for (ucni = upe->ContentNodes.pFirst; ucni; ucni = NextUCNI){
  321. NextUCNI = ucni->Item.pNext;
  322. la_FreePropStepCache(ucni->PP.Go);
  323. la_DestroyUDFContentNodeTreeRecursive(ucni, 1);
  324. }
  325. memFree(upe);
  326. }
  327. int OPINV_UDFAppend(laOperator *a, laEvent *e){
  328. laInvoke(a, "LA_file_dialog", e, 0, 0, 0);
  329. a->CustomData = memAcquireSimple(sizeof(laUDFPreviewExtra));
  330. return LA_RUNNING;
  331. }
  332. int OPMOD_UDFAppend(laOperator *a, laEvent *e){
  333. laUDFPreviewExtra *upe = a->CustomData;
  334. if (a->ConfirmData){
  335. if (a->ConfirmData->StrData){
  336. laManagedUDF* m;
  337. upe->UDF = laOpenUDF(a->ConfirmData->StrData, 1, 0, &m);
  338. if (upe->UDF){
  339. laExtractUDF(upe->UDF, m, LA_UDF_MODE_OVERWRITE, 0);
  340. laCloseUDF(upe->UDF);
  341. laRecordEverythingAndPush();
  342. return LA_FINISHED;
  343. }
  344. }
  345. return LA_FINISHED;
  346. }
  347. return LA_RUNNING;
  348. }
  349. void la_DestroyUDFContentNodeTreeRecursive(laUDFContentNode *ucn, int FreeRoot);
  350. int OPINV_UDFSaveInstance(laOperator *a, laEvent *e){
  351. laInvoke(a, "LA_file_dialog", e, 0, 0, 0);
  352. a->CustomData = memAcquireSimple(sizeof(laUDFPreviewExtra));
  353. return LA_RUNNING;
  354. }
  355. int OPMOD_UDFSaveInstance(laOperator *a, laEvent *e){
  356. laUDFPreviewExtra *upe = a->CustomData;
  357. laPropPack* pp=a->This; if(!pp||!pp->EndInstance) return LA_CANCELED;
  358. if (a->ConfirmData){
  359. if (a->ConfirmData->StrData){
  360. upe->UDF = laPrepareUDF(a->ConfirmData->StrData);
  361. if (upe->UDF){
  362. laWritePropP(upe->UDF, pp);
  363. laPackUDF(upe->UDF, 0);
  364. return LA_FINISHED;
  365. }
  366. }
  367. }
  368. return LA_FINISHED;
  369. }
  370. void* laget_FirstManagedUDF(void* unused, void* unused_pi){ return MAIN.ManagedUDFs.pFirst; }
  371. void laset_ManagedSavePage(laManagedSaveExtra* mse, int p){
  372. mse->ShowPage=p;
  373. laRegisterModifications(0,0,0,0);
  374. }
  375. int OPEXT_ManagedSave(laOperator *a, laEvent *e){
  376. laManagedSaveExtra *upe = a->CustomData;
  377. memFree(upe);
  378. }
  379. int OPINV_ManagedSave(laOperator *a, laEvent *e){
  380. int OnExit=0;
  381. if(a->ExtraInstructionsP){
  382. if(strSame(strGetArgumentString(a->ExtraInstructionsP, "quiet"),"true")){
  383. int empty=0; laRegisterModifications(0,1,&empty,0);
  384. if(strSame(strGetArgumentString(a->ExtraInstructionsP, "ignore_unassigned"),"true")) empty=0;
  385. if(!empty){ laSaveManagedUDF(); return LA_FINISHED; }
  386. }
  387. if(strSame(strGetArgumentString(a->ExtraInstructionsP, "on_exit"),"true")){ OnExit=1; }
  388. }
  389. if(laOperatorExistsT(a->Type)) return LA_CANCELED;
  390. a->CustomData = memAcquire(sizeof(laManagedSaveExtra));
  391. laManagedSaveExtra* mse=a->CustomData;
  392. mse->OnExit=OnExit;
  393. mse->ShowPage = MAIN.ManagerDefaultView;
  394. laEnableOperatorPanel(a, 0, LA_RH2,LA_RH2,400,400,0,0,0,0,LA_RH2,LA_RH2,LA_RH2,LA_RH2,e);
  395. return LA_RUNNING;
  396. }
  397. int OPMOD_ManagedSave(laOperator *a, laEvent *e){
  398. laUDFPreviewExtra *upe = a->CustomData;
  399. if (a->ConfirmData){
  400. if(a->ConfirmData->Mode==LA_CONFIRM_CUSTOM_STRING && strSame(a->ConfirmData->StrData,"DISCARD_AND_QUIT")){
  401. return LA_OPERATOR_CALLS_SHUTOFF;
  402. }
  403. if(a->ConfirmData->Mode==LA_CONFIRM_CANCEL||a->ConfirmData->Mode==LA_CONFIRM_OK) return LA_FINISHED;
  404. return LA_RUNNING;
  405. }
  406. return LA_RUNNING;
  407. }
  408. int OPINV_ManagedSaveNewFile(laOperator *a, laEvent *e){
  409. a->CustomData = memAcquireSimple(sizeof(laUDFPreviewExtra));
  410. laInvoke(a, "LA_file_dialog", e, 0, 0, 0);
  411. return LA_RUNNING;
  412. }
  413. int OPMOD_ManagedSaveNewFile(laOperator *a, laEvent *e){
  414. laUDFPreviewExtra *upe = a->CustomData;
  415. if (a->ConfirmData){
  416. if(a->ConfirmData->Mode==LA_CONFIRM_CANCEL){ return LA_FINISHED; }
  417. if(a->ConfirmData->Mode==LA_CONFIRM_OK){
  418. if(a->ConfirmData->StrData){
  419. char* path=a->ConfirmData->StrData;
  420. if(la_FindManagedUDF(path)){
  421. laEnableMessagePanel(a, 0, "Duplicated files", "The file you chose already exists in the managed file list.",e->x,e->y,0,e);
  422. return LA_FINISHED;
  423. }
  424. laManagedUDF* m=MAIN.DummyManageUDF;
  425. m->udf = laPrepareUDF(path); strSafeSet(&m->BaseName, strGetLastSegment(path,'/'));
  426. m->udf->Managed=1;
  427. la_MakeDummyManagedUDF();
  428. laNotifyUsers("la.managed_udfs"); laNotifyUsers("la.managed_props");
  429. }
  430. return LA_FINISHED;
  431. }
  432. return LA_RUNNING;
  433. }
  434. return LA_RUNNING;
  435. }
  436. int OPINV_UDFManager(laOperator *a, laEvent *e){
  437. laRegisterModifications(0,0,0,0);
  438. laActivatePanel("LAUI_data_manager", e->x, e->y);
  439. return LA_FINISHED;
  440. }
  441. int OPINV_AddResourceFolder(laOperator *a, laEvent *e){
  442. laAddResourceFolder(0);
  443. laNotifyUsers("la.user_preferences.resource_folders");
  444. return LA_FINISHED;
  445. }
  446. int OPINV_RemoveResourceFolder(laOperator *a, laEvent *e){
  447. if(!a->This || !a->This->LastPs->UseInstance) return LA_CANCELED;
  448. laResourceFolder* rf=a->This->LastPs->UseInstance;
  449. laRemoveResourceFolder(rf);
  450. laRefreshUDFRegistries();
  451. laNotifyUsers("la.user_preferences.resource_folders");
  452. return LA_FINISHED;
  453. }
  454. int OPINV_Undo(laOperator *a, laEvent *e){
  455. laUndo();
  456. laPrintDBInstInfo();
  457. return LA_FINISHED;
  458. }
  459. int OPINV_Redo(laOperator *a, laEvent *e){
  460. laRedo();
  461. laPrintDBInstInfo();
  462. return LA_FINISHED;
  463. }
  464. int OPINV_UDFPropagate(laOperator *a, laEvent *e){
  465. laProp* p=a->This?a->This->LastPs->p:0; if(!p||p->PropertyType!=LA_PROP_SUB) return LA_FINISHED;
  466. void* instance=a->This->EndInstance; if(!instance) return LA_FINISHED;
  467. laPropContainer* pc=la_EnsureSubTarget(p,instance);
  468. int force=0;
  469. if(strSame(strGetArgumentString(a->ExtraInstructionsP,"force"),"true")){ force=1; }
  470. laPropagateUDF(pc, instance, force);
  471. laNotifyUsers("la.managed_props");
  472. return LA_FINISHED;
  473. }
  474. int OPINV_SaveUserPreferences(laOperator *a, laEvent *e){
  475. laSaveUserPreferences(); return LA_FINISHED;
  476. }
  477. int OPCHK_TerminateProgram(laPropPack *This, laStringSplitor *Instructions){
  478. return 1;
  479. }
  480. int OPINV_TerminateProgram(laOperator *a, laEvent *e){
  481. int empty=0; int mod=laRegisterModifications(1,1,&empty,0);
  482. if(mod || empty){ laInvoke(0, "LA_managed_save", 0,0,"on_exit=true;",0); return LA_FINISHED; }
  483. return LA_OPERATOR_CALLS_SHUTOFF;
  484. }
  485. int OPCHK_IntSetValue(laPropPack *This, laStringSplitor *Instructions){
  486. if (This && (This->LastPs->p->PropertyType == LA_PROP_INT)) return 1;
  487. else
  488. return 0;
  489. }
  490. int OPCHK_FloatSetValue(laPropPack *This, laStringSplitor *Instructions){
  491. if (This && (This->LastPs->p->PropertyType == LA_PROP_FLOAT)) return 1;
  492. else
  493. return 0;
  494. }
  495. int OPCHK_IntArraySetValue(laPropPack *This, laStringSplitor *Instructions){
  496. if (This && (This->LastPs->p->PropertyType == LA_PROP_INT | LA_PROP_ARRAY)) return 1;
  497. else
  498. return 0;
  499. }
  500. int OPCHK_FloatArraySetValue(laPropPack *This, laStringSplitor *Instructions){
  501. if (This && (This->LastPs->p->PropertyType == LA_PROP_FLOAT | LA_PROP_ARRAY)) return 1;
  502. else
  503. return 0;
  504. }
  505. int OPCHK_EnumSetValue(laPropPack *This, laStringSplitor *Instructions){
  506. if (This && (This->LastPs->p->PropertyType == LA_PROP_ENUM)) return 1;
  507. else
  508. return 0;
  509. }
  510. int OPCHK_EnumArraySetValue(laPropPack *This, laStringSplitor *Instructions){
  511. if (This && (This->LastPs->p->PropertyType == LA_PROP_ENUM | LA_PROP_ARRAY)) return 1;
  512. else
  513. return 0;
  514. }
  515. int OPCHK_StringSetValue(laPropPack *This, laStringSplitor *Instructions){
  516. if (This && (This->LastPs->p->PropertyType == LA_PROP_STRING)) return 1;
  517. else
  518. return 0;
  519. }
  520. int OPINV_EnumSetDefault(laOperator *a, laEvent *e){
  521. if (a->This && (a->This->LastPs->p->PropertyType & LA_PROP_ENUM)){
  522. laEnumProp *ep = a->This->LastPs->p;
  523. laSetEnum(a->This, ep->DefVal);
  524. }
  525. return LA_FINISHED;
  526. }
  527. int OPINV_IntSetDefault(laOperator *a, laEvent *e){
  528. if (a->This && (a->This->LastPs->p->PropertyType & LA_PROP_INT)){
  529. laIntProp *ip = a->This->LastPs->p;
  530. laSetInt(a->This, ip->DefVal);
  531. }
  532. return LA_FINISHED;
  533. }
  534. int OPINV_FloatSetDefault(laOperator *a, laEvent *e){
  535. if (a->This && (a->This->LastPs->p->PropertyType & LA_PROP_FLOAT)){
  536. laFloatProp *ip = a->This->LastPs->p;
  537. laSetFloat(a->This, ip->DefVal);
  538. }
  539. return LA_FINISHED;
  540. }
  541. int OPINV_IntSetMax(laOperator *a, laEvent *e){
  542. if (a->This && (a->This->LastPs->p->PropertyType & LA_PROP_INT)){
  543. laIntProp *ip = a->This->LastPs->p;
  544. laSetInt(a->This, ip->Max);
  545. }
  546. return LA_FINISHED;
  547. }
  548. int OPINV_FloatSetMax(laOperator *a, laEvent *e){
  549. if (a->This && (a->This->LastPs->p->PropertyType & LA_PROP_FLOAT)){
  550. laFloatProp *ip = a->This->LastPs->p;
  551. laSetFloat(a->This, ip->Max);
  552. }
  553. return LA_FINISHED;
  554. }
  555. int OPINV_IntSetMin(laOperator *a, laEvent *e){
  556. if (a->This && (a->This->LastPs->p->PropertyType & LA_PROP_INT)){
  557. laIntProp *ip = a->This->LastPs->p;
  558. laSetInt(a->This, ip->Min);
  559. }
  560. return LA_FINISHED;
  561. }
  562. int OPINV_FloatSetMin(laOperator *a, laEvent *e){
  563. if (a->This && (a->This->LastPs->p->PropertyType & LA_PROP_FLOAT)){
  564. laFloatProp *ip = a->This->LastPs->p;
  565. laSetFloat(a->This, ip->Min);
  566. }
  567. return LA_FINISHED;
  568. }
  569. int OPINV_EnumArraySetDefault(laOperator *a, laEvent *e){
  570. if (a->This && (a->This->LastPs->p->PropertyType & LA_PROP_ENUM)){
  571. laEnumProp *ep = a->This->LastPs->p;
  572. laSetEnumArrayAll(a->This, ep->DefVal);
  573. }
  574. return LA_FINISHED;
  575. }
  576. int OPINV_IntArraySetDefault(laOperator *a, laEvent *e){
  577. if (a->This && (a->This->LastPs->p->PropertyType & LA_PROP_INT)){
  578. laIntProp *ip = a->This->LastPs->p;
  579. if (ip->DefArr) laSetIntArrayAllArray(a->This, ip->DefArr);
  580. else
  581. laSetIntArrayAll(a->This, ip->DefVal);
  582. }
  583. return LA_FINISHED;
  584. }
  585. int OPINV_FloatArraySetDefault(laOperator *a, laEvent *e){
  586. if (a->This && (a->This->LastPs->p->PropertyType & LA_PROP_FLOAT)){
  587. laFloatProp *ip = a->This->LastPs->p;
  588. if (ip->DefArr) laSetFloatArrayAllArray(a->This, ip->DefArr);
  589. else
  590. laSetFloatArrayAll(a->This, ip->DefVal);
  591. }
  592. return LA_FINISHED;
  593. }
  594. int OPINV_IntArraySetMax(laOperator *a, laEvent *e){
  595. if (a->This && (a->This->LastPs->p->PropertyType & LA_PROP_INT)){
  596. laIntProp *ip = a->This->LastPs->p;
  597. laSetIntArrayAll(a->This, ip->Max);
  598. }
  599. return LA_FINISHED;
  600. }
  601. int OPINV_FloatArraySetMax(laOperator *a, laEvent *e){
  602. if (a->This && (a->This->LastPs->p->PropertyType & LA_PROP_FLOAT)){
  603. laFloatProp *ip = a->This->LastPs->p;
  604. laSetFloatArrayAll(a->This, ip->Max);
  605. }
  606. return LA_FINISHED;
  607. }
  608. int OPINV_IntArraySetMin(laOperator *a, laEvent *e){
  609. if (a->This && (a->This->LastPs->p->PropertyType & LA_PROP_INT)){
  610. laIntProp *ip = a->This->LastPs->p;
  611. laSetIntArrayAll(a->This, ip->Min);
  612. }
  613. return LA_FINISHED;
  614. }
  615. int OPINV_FloatArraySetMin(laOperator *a, laEvent *e){
  616. if (a->This && (a->This->LastPs->p->PropertyType & LA_PROP_FLOAT)){
  617. laFloatProp *ip = a->This->LastPs->p;
  618. laSetFloatArrayAll(a->This, ip->Min);
  619. }
  620. return LA_FINISHED;
  621. }
  622. int OPINV_StringSetDefault(laOperator *a, laEvent *e){
  623. if (a->This && (a->This->LastPs->p->PropertyType & LA_PROP_STRING)){
  624. laStringProp *sp = a->This->LastPs->p;
  625. if (sp->DefStr) laSetString(a->This, sp->DefStr);
  626. else
  627. laSetString(a->This, "");
  628. }
  629. return LA_FINISHED;
  630. }
  631. int OPINV_StringGetFolderPath(laOperator *a, laEvent *e){
  632. if (a->This && (a->This->LastPs->p->PropertyType & LA_PROP_STRING)){
  633. laInvoke(a, "LA_file_dialog", e, 0, "select=folder;", 0);
  634. return LA_RUNNING;
  635. }
  636. return LA_FINISHED;
  637. }
  638. int OPINV_StringGetFilePath(laOperator *a, laEvent *e){
  639. if (a->This && (a->This->LastPs->p->PropertyType & LA_PROP_STRING)){
  640. laInvoke(a, "LA_file_dialog", e, 0, 0, 0);
  641. return LA_RUNNING;
  642. }
  643. return LA_FINISHED;
  644. }
  645. int OPMOD_StringGetFolderOrFilePath(laOperator *a, laEvent *e){
  646. if (a->ConfirmData){
  647. if (a->ConfirmData->StrData){
  648. laStringProp *sp = a->This->LastPs->p;
  649. laSetString(a->This, a->ConfirmData->StrData);
  650. return LA_FINISHED_PASS;
  651. }
  652. return LA_FINISHED_PASS;
  653. }
  654. return LA_RUNNING;
  655. }
  656. int OPINV_StringCopy(laOperator *a, laEvent *e){
  657. laPropPack* pp=a->This; if(!a->This) return LA_FINISHED;
  658. char _buf[256]={0}; char* buf=_buf;
  659. laGetString(pp,_buf,&buf);
  660. laCopyToClipboard(buf);
  661. return LA_FINISHED;
  662. }
  663. int OPINV_StringPaste(laOperator *a, laEvent *e){
  664. if (a->This && (a->This->LastPs->p->PropertyType & LA_PROP_STRING)){
  665. laStringProp *sp = a->This->LastPs->p;
  666. if (sp->DefStr) laSetString(a->This, sp->DefStr);
  667. else laSetString(a->This, "");
  668. }
  669. return LA_FINISHED;
  670. }
  671. int OPCHK_SubPutDataBlock(laPropPack *This, laStringSplitor *Instructions){
  672. //laListItem* Inst;
  673. //void* Actuall=0;
  674. //laProp* p;
  675. //if (!MAIN.RestoreInstance || !This || !Instructions) return 0;
  676. //p = la_PropLookup(&This->LastPs->p->SubProp->Props, strGetArgumentString(Instructions, "identifier"));
  677. //if (!p) return 0;
  678. //for (Inst = &p->SubProp->TrashBin.pFirst; Inst; Inst = Inst->pNext) {
  679. // if (Inst == MAIN.RestoreInstance) {
  680. // Actuall = Inst; break;
  681. // }
  682. //}
  683. //if(!Actuall)
  684. // for (Inst = &p->SubProp->FailedNodes.pFirst; Inst; Inst = Inst->pNext) {
  685. // if (Inst == MAIN.RestoreInstance) {
  686. // Actuall = Inst; break;
  687. // }
  688. // }
  689. //if (!Actuall) return 0;
  690. return 0;
  691. }
  692. int OPINV_SubPutDataBlock(laOperator *a, laEvent *e){
  693. //laProp* p = la_PropLookup(&a->This->LastPs->p->SubProp->Props, strGetArgumentString(a->ExtraInstructionsP, "identifier"));
  694. //lstRemoveItem(&p->SubProp->TrashBin, MAIN.RestoreInstance);
  695. //lstRemoveItem(&p->SubProp->FailedNodes, MAIN.RestoreInstance);
  696. ////laNotifySubPropUsers(p->SubProp, MAIN.RestoreInstance);
  697. //laAppendInstance(p, a->This->EndInstance, MAIN.RestoreInstance);
  698. //laNotifySubPropUsers(p, a->This->EndInstance);
  699. //laNotifySubPropUsers(_LA_PROP_TRASH_ITEM, p->SubProp);
  700. //laNotifySubPropUsers(_LA_PROP_FAILED_ITEM, p->SubProp);
  701. return LA_FINISHED;
  702. }
  703. int OPCHK_SubRestoreDataBlock(laPropPack *This, laStringSplitor *Instructions){
  704. if (This) return 1;
  705. return 0;
  706. }
  707. int OPINV_SubRestoreDataBlock(laOperator *a, laEvent *e){
  708. //if (a->This->EndInstance) {
  709. // MAIN.RestoreInstance = a->This->EndInstance;
  710. //}
  711. //laEnableOperatorPanel(a, 0, e->x, e->y, 600, 600, 2000, 1000, 100, 100, 0, 0, 0, 0, e);
  712. return LA_FINISHED; //will directly finish after actuator panel close or any feedback event and don't pass any feedback.
  713. }
  714. int OPEXT_SubRestoreDataBlock(laOperator *a, int unused){
  715. return 0;
  716. }
  717. int OPCHK_CombineChildBlocks(laPropPack *This, laStringSplitor *Instructions){
  718. laLayout *l = MAIN.CurrentWindow->CurrentLayout;
  719. laBlock *b = l->OnBlockSeperator;
  720. if (!(b)) return 0;
  721. }
  722. int OPINV_CombineChildBlocks(laOperator *a, laEvent *e){
  723. laLayout *l = MAIN.CurrentWindow->CurrentLayout;
  724. laBlock *b = l->OnBlockSeperator;
  725. if (!b) b = laDetectBlockRecursive(l->FirstBlock, e->x, e->y);
  726. if (b){
  727. laCombineChildBlocks(b);
  728. return LA_FINISHED;
  729. }
  730. return LA_CANCELED;
  731. }
  732. STRUCTURE(laNewPanelData){
  733. laUiTemplate* SelectedTemplate;
  734. laBlock* b;
  735. };
  736. void laui_TitleOnly(laUiList *uil, laPropPack *This, laPropPack *OP_UNUSED, laColumn *Extra, int context){
  737. laColumn *col = Extra, *c, *cl, *cr, *crl, *crr, *cll, *clr, *clrl, *clrr, *clrrl, *clrrr;
  738. laUiItem *ui;
  739. c = laFirstColumn(uil);
  740. laShowItemFull(uil, c, This, "title", LA_WIDGET_STRING_PLAIN, 0, 0, 0);
  741. }
  742. laUiTemplate* laget_FirstPanelTemplate(void* unused1, void* unused2){
  743. return MAIN.PanelTemplates.pFirst;
  744. }
  745. void laset_NewPanelSetTemplate(laNewPanelData *np, laUiTemplate *uit, int State){
  746. np->SelectedTemplate = uit;
  747. }
  748. int laget_NewPanelGetActiveTemplate(laNewPanelData* np, laUiTemplate* uit){
  749. return np->SelectedTemplate;
  750. }
  751. void laui_PanelTemplateSelect(laUiList *uil, laPropPack *This, laPropPack *OperatorProps, laColumn *UNUSED, int context){
  752. laColumn *c = laFirstColumn(uil);
  753. laUiItem* ui=laShowItem(uil, c, OperatorProps, "template");ui->SymbolID=2; ui->Flags|=LA_UI_FLAGS_NO_DECAL;
  754. }
  755. int OPINV_NewLayout(laOperator *a, laEvent *e){
  756. laWindow* w=MAIN.CurrentWindow;
  757. laDesignLayout(w, "New Layout");
  758. laRedrawCurrentWindow();
  759. return LA_FINISHED;
  760. }
  761. int OPINV_NewPanel(laOperator *a, laEvent *e){
  762. laNewPanelData* np= CreateNew(laNewPanelData);
  763. a->CustomData = np;
  764. laEnableOperatorPanel(a, 0, e->x-50,e->y-50,500,500,1000,0,0,0,0,0,0,0,e);
  765. return LA_RUNNING;
  766. }
  767. int OPMOD_NewPanel(laOperator *a, laEvent *e){
  768. laLayout *l = MAIN.CurrentWindow->CurrentLayout;
  769. laNewPanelData* np=a->CustomData;
  770. if(!a->ConfirmData) return LA_RUNNING;
  771. if(a->ConfirmData->Mode == LA_CONFIRM_CANCEL||a->ConfirmData->Mode == LA_CONFIRM_OK) return LA_CANCELED;
  772. if(a->ConfirmData->Mode == LA_CONFIRM_DATA){
  773. if (!np || !np->SelectedTemplate) return LA_CANCELED;
  774. laPanel *p = la_FindFreePanelByTemplate(MAIN.CurrentWindow, np->SelectedTemplate);
  775. if (!p){
  776. p = laCreateTopPanel(MAIN.CurrentWindow, np->SelectedTemplate->Identifier->Ptr, e->x, e->y,400,400,0,0,0,0,0,0,0,0);
  777. }
  778. laShowPanelWithExpandEffect(p); laPopPanel(p); free(np);
  779. return LA_FINISHED;
  780. }
  781. return LA_RUNNING;
  782. }
  783. int OPINV_BlockFoldTitle(laOperator *a, laEvent *e){
  784. laBlock* b=a->This?a->This->EndInstance:0;
  785. if(!b) return LA_CANCELED;
  786. if(strSame(strGetArgumentString(a->ExtraInstructionsP, "show"), "true")) laUnfoldBlockTitle(b);
  787. else laFoldBlockTitle(b);
  788. return LA_FINISHED;
  789. }
  790. int OPINV_BlockMaximize(laOperator *a, laEvent *e){
  791. laBlock* b=a->This?a->This->EndInstance:0;
  792. if(!b || strSame(strGetArgumentString(a->ExtraInstructionsP, "restore"), "true")) laRestoreToLayout();
  793. else laMaximizeBlock(b);
  794. return LA_FINISHED;
  795. }
  796. int OPINV_CanvasUiMaximize(laOperator *a, laEvent *e){
  797. laUiItem* ui=a->This?a->This->EndInstance:0;
  798. laPanel* p=MAIN.CurrentPanel;
  799. if(!ui || !p || (!ui->Type->Tag&LA_UI_TAG_IS_OFFSCREEN) || MAIN.CurrentWindow->MaximizedUi ||
  800. strSame(strGetArgumentString(a->ExtraInstructionsP, "restore"), "true")) laRestoreCanvasUI();
  801. else laMaximizeCanvasUI(ui,p);
  802. return LA_FINISHED;
  803. }
  804. int OPINV_HideMenuBar(laOperator *a, laEvent *e){
  805. if(!MAIN.CurrentWindow->MaximizedUi || strSame(strGetArgumentString(a->ExtraInstructionsP, "restore"), "true")) laShowMenuBar();
  806. else laHideMenuBar();
  807. return LA_FINISHED;
  808. }
  809. int OPINV_BlockTearOffPanel(laOperator *a, laEvent *e){
  810. laLayout *l = MAIN.CurrentWindow->CurrentLayout;
  811. laBlock* b = l->OperatingBlock;
  812. if (!b) b = laDetectBlockRecursive(l->FirstBlock, e->x, e->y);
  813. if(!b) return LA_CANCELED;
  814. laTearOffPanel(b,0);
  815. return LA_FINISHED;
  816. }
  817. int OPCHK_BlockHasMorePanels(laPropPack *This, laStringSplitor *Instructions){
  818. laPanel*p = This?This->LastPs->UseInstance:0;
  819. if(p && p->Mode == LA_PANEL_FLOATING_TOP) return 1;
  820. laLayout *l = MAIN.CurrentWindow->CurrentLayout;
  821. laBlock *b = l->OperatingBlock;
  822. if (b->Panels.pFirst == b->Panels.pLast) return 0;
  823. return 1;
  824. }
  825. int OPINV_BlockClosePanel(laOperator *a, laEvent *e){
  826. laPanel*p = a->This?a->This->LastPs->UseInstance:0;
  827. if(p && p->Mode == LA_PANEL_FLOATING_TOP){
  828. laDestroySinglePanel(p,0);
  829. return LA_FINISHED;
  830. }
  831. laLayout *l = MAIN.CurrentWindow->CurrentLayout;
  832. laBlock *b = l->OperatingBlock;
  833. int x = e->x, y = e->y;
  834. if (!b) b = laDetectBlockRecursive(l->FirstBlock, e->x, e->y);
  835. if (b){
  836. if (b->CurrentPanel){
  837. //laLocalToWindow(a, MAIN.CurrentPanel, &x, &y);
  838. laEnableYesNoPanel(a, 0, "Caution!", "Are you sure to destroy this panel?", e->x - 250, e->y, 250, e);
  839. return LA_RUNNING;
  840. }
  841. }
  842. return LA_CANCELED;
  843. }
  844. int OPMOD_BlockClosePanel(laOperator *a, laEvent *e){
  845. laLayout *l = MAIN.CurrentWindow->CurrentLayout;
  846. laBlock *b = l->OperatingBlock;
  847. if (e->Type == LA_ESCAPE_DOWN) return LA_FINISHED;
  848. if (a->ConfirmData){
  849. if (!b) b = laDetectBlockRecursive(l->FirstBlock, e->x, e->y);
  850. if (!b) return LA_CANCELED;
  851. if (a->ConfirmData->Mode == LA_CONFIRM_OK){
  852. laDestroySinglePanel(b->CurrentPanel,1);
  853. la_RecalcBlockRecursive(b, b->X, b->Y, b->W, b->H);
  854. }
  855. return LA_FINISHED;
  856. }else
  857. return LA_RUNNING;
  858. }
  859. int laui_BlockEdgeMenu(laOperator *WindowAct, laLayout *l, laBlock *b, laEvent *e){
  860. laPanel *p;
  861. laColumn *c, *cl, *cr;
  862. laUiList *uil;
  863. p = laDefineAndEnableMenuPanel(0, WindowAct, 0, e->x, e->y, 500, 200, e);
  864. uil = laPrepareUi(p);
  865. c = laFirstColumn(uil);
  866. laSplitColumn(uil, c, 0.5);
  867. cl = laLeftColumn(c, 0);
  868. cr = laRightColumn(c, 0);
  869. laShowItem(uil, c, 0, "LA_combine_child_blocks");
  870. laEnclosePanelContent(p,uil);
  871. }
  872. laBlock* la_MakeDropBlock(laBlock* DropToBlock, int DropLocation){
  873. switch (DropLocation){
  874. case 0: return DropToBlock;
  875. case LA_BLOCK_DROP_LOCATION_U:
  876. laSplitBlockVertical(DropToBlock, 0.5); laSwapSubBlocks(DropToBlock);
  877. return DropToBlock->B1;
  878. case LA_BLOCK_DROP_LOCATION_B:
  879. laSplitBlockVertical(DropToBlock, 0.5);
  880. return DropToBlock->B2;
  881. case LA_BLOCK_DROP_LOCATION_L:
  882. laSplitBlockHorizon(DropToBlock, 0.5); laSwapSubBlocks(DropToBlock);
  883. return DropToBlock->B1;
  884. case LA_BLOCK_DROP_LOCATION_R:
  885. laSplitBlockHorizon(DropToBlock, 0.5);
  886. return DropToBlock->B2;
  887. }
  888. }
  889. void la_StartDocking(laWindow* from, laPanel* p){
  890. for(laWindow* w=MAIN.Windows.pFirst;w;w=w->Item.pNext){ w->DockingFrom = from; w->IsDocking=1; } MAIN.DockingPanel=p;
  891. }
  892. void la_StopDocking(){
  893. for(laWindow* w=MAIN.Windows.pFirst;w;w=w->Item.pNext){ w->DockingFrom = 0; w->IsDocking=0; } MAIN.DockingPanel=0;
  894. }
  895. void la_ClearDockingTarget(){
  896. for(laWindow* w=MAIN.Windows.pFirst;w;w=w->Item.pNext){ w->CurrentLayout->DropToBlock=0; }
  897. }
  898. int OPINV_DockPanel(laOperator* a, laEvent* e){
  899. laPanel*p = a->This?a->This->LastPs->UseInstance:0;
  900. if(!p) return LA_CANCELED;
  901. la_StartDocking(MAIN.CurrentWindow, p);
  902. laRestoreToLayout();
  903. laRestoreCanvasUI();
  904. return LA_FINISHED;
  905. }
  906. int OPINV_NewWindow(laOperator* a, laEvent* e){
  907. laWindow* w = a->This?a->This->EndInstance:MAIN.CurrentWindow;
  908. laWindow* nw =laDesignWindow(w->X,w->Y,w->CW,w->CH);
  909. laLayout* l=(w->Layouts.pFirst!=w->Layouts.pLast)?w->CurrentLayout:0;
  910. if (l && !strSame(strGetArgumentString(a->ExtraInstructionsP, "clean"), "true")){
  911. laLayout* nextl=l->Item.pPrev?l->Item.pPrev:l->Item.pNext;
  912. w->CurrentLayout=nextl; lstRemoveItem(&w->Layouts, l); lstAppendItem(&nw->Layouts, l); nw->CurrentLayout=l;
  913. laRenameWindow(nw, l->ID->Ptr);
  914. laRenameWindow(w, w->CurrentLayout->ID->Ptr);
  915. }else{
  916. laDesignLayout(nw, "Empty Layout");
  917. }
  918. laRedrawAllWindows();
  919. return LA_FINISHED;
  920. }
  921. void *la_OnBlockSeperator(laBlock *b, laEvent *e){
  922. int at;
  923. laBlock *bb;
  924. if (!b->B1) return 0;
  925. if (b->Vertical){
  926. at = b->H * b->SplitRatio + b->Y;
  927. if (e->x>=b->X && e->x<=b->X+b->W && e->y >= at - LA_SEAM_W && e->y <= at + LA_SEAM_W){
  928. return b;
  929. }
  930. }else{
  931. at = b->X + b->W * b->SplitRatio;
  932. if (e->y>=b->Y && e->y<=b->Y+b->H && e->x >= at - LA_SEAM_W && e->x <= at + LA_SEAM_W){
  933. return b;
  934. }
  935. }
  936. if (bb = la_OnBlockSeperator(b->B1, e)) return bb;
  937. else
  938. return la_OnBlockSeperator(b->B2, e);
  939. }
  940. int la_DetectBlockDropLocation(laBlock *b, int X, int Y){
  941. laPanel *p = b->Panels.pFirst;
  942. if (!p) return 0;
  943. real L = tnsGetRatiod(p->X, p->X + p->W, X);
  944. real U = tnsGetRatiod(p->Y, p->Y + p->H, Y);
  945. if (L > U){
  946. if (U < 0.25){
  947. if (L < 0.75) return LA_BLOCK_DROP_LOCATION_U;
  948. else
  949. return LA_BLOCK_DROP_LOCATION_R;
  950. }else{
  951. if (L < 0.75) return 0;
  952. else
  953. return LA_BLOCK_DROP_LOCATION_R;
  954. }
  955. }else{
  956. if (U > 0.75){
  957. if (L < 0.25) return LA_BLOCK_DROP_LOCATION_L;
  958. else
  959. return LA_BLOCK_DROP_LOCATION_B;
  960. }else{
  961. if (L < 0.25) return LA_BLOCK_DROP_LOCATION_L;
  962. else
  963. return 0;
  964. }
  965. }
  966. }
  967. int laui_BlockMenu(laOperator *WindowAct, laWindow* w, laLayout *l, laBlock *b, laEvent *e){
  968. laPanel *p;
  969. laColumn *c;
  970. laUiList *uil;
  971. p = laDefineAndEnableMenuPanel(0, WindowAct, 0, b->X, b->Y + LA_RH + 1, 500, 500, e);
  972. uil = laPrepareUi(p);
  973. c = laFirstColumn(uil);
  974. laPanel* forp=b->CurrentPanel;
  975. laUiItem* b1=laBeginRow(uil,c,0,0);
  976. laShowItem(uil,c,&b->PP,"fold");
  977. laUiItem* b2=laOnConditionThat(uil,c,laPropExpression(&w->PP, "maximized_block"));{
  978. laShowItemFull(uil,c,&b->PP,"maximize",0,"restore=true;text=Restore;",0,0);
  979. }laElse(uil,b2);{
  980. laShowItem(uil,c,&b->PP,"maximize");
  981. }laEndCondition(uil,b2);
  982. laEndRow(uil,b1);
  983. laShowSeparator(uil,c);
  984. if(forp->PanelTemplate->Header){
  985. laShowLabel(uil, c, "Panel properties:", 0, 0);
  986. forp->PanelTemplate->Header(uil, &forp->PP, &forp->PropLinkPP, c, 0);
  987. }else{
  988. laShowLabel(uil, c, "Panel doesn't have configurable property.", 0, 0);
  989. }
  990. //laShowItem(uil, c, 0, "LA_new_panel");
  991. //laShowItem(uil, c, 0, "LA_block_close_panel");
  992. //laShowItem(uil, c, 0, "LA_block_tear_off_panel");
  993. laEnclosePanelContent(p,uil);
  994. }
  995. int la_ProcessBlockEvent(laOperator *a, laBlock *b, laEvent *e){
  996. int Executed = 0, Ret=1;
  997. int L = LA_RH+LA_SEAM_W, R, tw = 0;
  998. real ratio = 1.0f;
  999. laPanel *p = b->Panels.pFirst;
  1000. laGeneralUiExtraData *uid = a->CustomData;
  1001. laLayout *l;
  1002. if(!b->Panels.pFirst){return 0;}
  1003. if (laIsInBlockHeader(b, e->x, e->y) || MAIN.CurrentWindow->CurrentLayout->ClickedPanel){
  1004. MAIN.CurrentWindow->CurrentLayout->OperatingBlock = b;
  1005. if (b->CurrentPanel){
  1006. if (e->Type == LA_MOUSE_WHEEL_DOWN && b->CurrentPanel->Item.pNext){
  1007. b->CurrentPanel = b->CurrentPanel->Item.pNext;
  1008. Executed = 1;
  1009. }elif (e->Type == LA_MOUSE_WHEEL_UP && b->CurrentPanel->Item.pPrev){
  1010. b->CurrentPanel = b->CurrentPanel->Item.pPrev;
  1011. Executed = 1;
  1012. }
  1013. }
  1014. if(!b->Folded){
  1015. for (p = b->Panels.pFirst; p; p = p->Item.pNext){
  1016. tw += (p->TitleWidth + LA_SEAM_W*2);
  1017. }
  1018. if (tw > b->W - LA_SEAM_W*2 - LA_RH) ratio = (real)(b->W - LA_SEAM_W*2 - LA_RH) / tw;
  1019. if ((e->Type == LA_L_MOUSE_DOWN)){
  1020. uid->LastX = e->x;
  1021. uid->LastY = e->y;
  1022. int LT=0,RT=0;
  1023. for (p = b->Panels.pFirst; p; p = p->Item.pNext){
  1024. RT = LT + p->TitleWidth+LA_SEAM_W*2;
  1025. if (e->x >= b->X + L+LT * ratio && e->x < b->X + L+RT * ratio){
  1026. MAIN.CurrentWindow->CurrentLayout->ClickedPanel = p;
  1027. b->CurrentPanel = p;
  1028. Executed = 1;
  1029. }
  1030. LT = RT;
  1031. }
  1032. }elif (e->Type == LA_MOUSEMOVE){
  1033. if (abs(e->x - uid->LastX) > 30 || abs(e->y - uid->LastY) > 30){
  1034. if (MAIN.CurrentWindow->CurrentLayout->ClickedPanel){
  1035. l = MAIN.CurrentWindow->CurrentLayout;
  1036. l->DropToBlock = b;
  1037. l->DropLocation = la_DetectBlockDropLocation(b, e->x, e->y);
  1038. }
  1039. }
  1040. }elif (e->Type == LA_L_MOUSE_UP){
  1041. l = MAIN.CurrentWindow->CurrentLayout;
  1042. if (l->DropToBlock){
  1043. l->DropToBlock = la_MakeDropBlock(l->DropToBlock,l->DropLocation);
  1044. p = l->ClickedPanel;
  1045. if(p->Block == l->DropToBlock){
  1046. if(laTearOffPanel(p->Block, p)) Executed=1;
  1047. }else{
  1048. p->Block->CurrentPanel = p->Item.pPrev ? p->Item.pPrev : (p->Item.pNext ? p->Item.pNext : 0);
  1049. lstRemoveItem(&p->Block->Panels, p); laBlock* orig_block=p->Block->parent;
  1050. int clear=0; if(!lstHaveItemInList(&p->Block->Panels)){clear=1;}
  1051. lstPushItem(&l->DropToBlock->Panels, p);
  1052. p->Block = l->DropToBlock;
  1053. if(clear){
  1054. laCombineChildBlocks(orig_block);
  1055. if(!lstFindItem(orig_block->CurrentPanel,nutSameAddress,&orig_block->Panels)){
  1056. orig_block->CurrentPanel = orig_block->Panels.pFirst;
  1057. }
  1058. }
  1059. p->Block->CurrentPanel = p;
  1060. Executed = 1;
  1061. la_RecalcBlockRecursive(p->Block, p->Block->X, p->Block->Y, p->Block->W, p->Block->H);
  1062. if(orig_block!=p->Block){
  1063. la_RecalcBlockRecursive(orig_block, orig_block->X, orig_block->Y, orig_block->W, orig_block->H);
  1064. }
  1065. }
  1066. }
  1067. MAIN.CurrentWindow->CurrentLayout->DropToBlock = 0;
  1068. MAIN.CurrentWindow->CurrentLayout->ClickedPanel = 0;
  1069. return 0;
  1070. }
  1071. }else{
  1072. b->OnButton=1;Ret=0;
  1073. if(laIsInBlockBotton1(b, e->x, e->y)){ b->OnButton=2; if(e->Type==LA_L_MOUSE_DOWN){laUnfoldBlockTitle(b);Executed=1;Ret=1;} }
  1074. elif(laIsInBlockBotton2(b, e->x, e->y)){ b->OnButton=2; if(e->Type==LA_L_MOUSE_DOWN){laMaximizeBlock(b);Executed=1;Ret=1;} }
  1075. }
  1076. if (Executed){
  1077. b->CurrentPanel->Refresh |= LA_TAG_RECALC;
  1078. la_RecalcBlockRecursive(b, b->X, b->Y, b->W, b->H);
  1079. }
  1080. if (!Executed && e->Type == LA_L_MOUSE_DOWN && laIsInBlockBotton1(b, e->x, e->y)){
  1081. laui_BlockMenu(a, MAIN.CurrentWindow, MAIN.CurrentWindow->CurrentLayout, b, e);
  1082. }
  1083. return Ret;
  1084. }else{
  1085. b->OnButton=0;
  1086. }
  1087. return 0;
  1088. }
  1089. int la_ProcessBlockEdgeEvent(laOperator *WindowAct, laLayout *l, laBlock *b, laEvent *e){
  1090. laBlock *ob = l->MovingBlock;
  1091. laWindow *w = WindowAct->Instance;
  1092. if (e->Type == LA_MOUSEMOVE && ob && l->MovingBlock && l->IsMoving){
  1093. if (ob->Vertical) ob->SplitRatio = (real)(e->y - ob->Y) / (real)(ob->H);
  1094. else
  1095. ob->SplitRatio = (real)(e->x - ob->X) / (real)(ob->W);
  1096. la_RecalcBlockRecursive(ob, ob->X, ob->Y, ob->W, ob->H);
  1097. if (ob->B1->CurrentPanel) ob->B1->CurrentPanel->Refresh |= LA_TAG_RECALC;
  1098. if (ob->B2->CurrentPanel) ob->B2->CurrentPanel->Refresh |= LA_TAG_RECALC;
  1099. return 1;
  1100. }
  1101. if (ob = la_OnBlockSeperator(b, e)){
  1102. ob->B1->OnButton=ob->B2->OnButton=0;
  1103. l->MovingBlock = ob;
  1104. if (e->Type == LA_L_MOUSE_DOWN){
  1105. l->IsMoving = 1;
  1106. }elif (e->Type == LA_L_MOUSE_UP){
  1107. l->IsMoving = 0;
  1108. }elif (e->Type == LA_R_MOUSE_DOWN){
  1109. l->OnBlockSeperator = ob;
  1110. laui_BlockEdgeMenu(WindowAct, l, ob, e);
  1111. }
  1112. return 1;
  1113. }
  1114. l->MovingBlock = 0;
  1115. return 0;
  1116. }
  1117. real la_ScrollerVerticalPan(int MousePanY, laPanel *p, laUiList *suil, laUiItem *pui){
  1118. int DisplayH, TotalH;
  1119. if (!pui){ DisplayH = p->H-suil->U; }
  1120. else{ DisplayH = pui->Page?(pui->B-pui->Page->U):(pui->B - pui->U); }
  1121. TotalH = suil->B - suil->U;
  1122. return ((real)TotalH * (real)MousePanY / (real)DisplayH);
  1123. }
  1124. real la_ScrollerHorizontalPan(int MousePanX, laPanel *p, laUiList *suil, laUiItem *pui){
  1125. int DisplayW, TotalW;
  1126. DisplayW = pui->Page?(pui->R-pui->Page->L):(pui->R - pui->L);
  1127. TotalW = suil->R - suil->L;
  1128. return ((real)TotalW * (real)MousePanX / (real)DisplayW);
  1129. }
  1130. void laui_LayoutCycle(laUiList *uil, laPropPack *This, laPropPack *OperatorProps, laColumn *UNUSED, int context){
  1131. laColumn *c;
  1132. laProp *p, *gp;
  1133. c = laFirstColumn(uil);
  1134. laShowItemFull(uil, c, 0, "la.windows.layouts", 0, 0, laui_IdentifierOnly, 0);
  1135. laShowItem(uil, c, 0, "LA_new_layout");
  1136. }
  1137. int OPINV_SwitchLayout(laOperator *a, laEvent *e){
  1138. laWindow *w = MAIN.CurrentWindow; if (!w) return LA_FINISHED;
  1139. if (strSame(strGetArgumentString(a->ExtraInstructionsP, "show_list"), "true")){
  1140. laPanel* p =laEnableOperatorPanel(a, 0, e->x-LA_RH, e->y-LA_RH, 500, 500, 0,0,0,0,0,0,0,0,e);
  1141. return LA_RUNNING;
  1142. }
  1143. if (strSame(strGetArgumentString(a->ExtraInstructionsP, "reverse"), "true")) w->CurrentLayout = w->CurrentLayout->Item.pPrev ? w->CurrentLayout->Item.pPrev : w->Layouts.pLast;
  1144. else w->CurrentLayout = w->CurrentLayout->Item.pNext ? w->CurrentLayout->Item.pNext : w->Layouts.pFirst;
  1145. laRenameWindow(w, w->CurrentLayout->ID->Ptr);
  1146. la_StopAllOperators();
  1147. laRetriggerOperators();
  1148. laNotifyUsers("la.windows.layouts");
  1149. return LA_FINISHED;
  1150. }
  1151. int OPINV_DeleteTheme(laOperator *a, laEvent *e){
  1152. laTheme* t = a->This?a->This->EndInstance:MAIN.CurrentTheme;
  1153. if(!t || MAIN.Themes.pFirst == MAIN.Themes.pLast) return LA_CANCELED;
  1154. laBoxedTheme* NextBt;
  1155. for(laBoxedTheme* bt=t->BoxedThemes.pFirst; bt; bt=NextBt){
  1156. NextBt = bt->Item.pNext; lstRemoveItem(&t->BoxedThemes, bt); memFree(bt);
  1157. }
  1158. lstRemoveItem(&MAIN.Themes, t); memFree(t);
  1159. if(t==MAIN.CurrentTheme){MAIN.CurrentTheme = MAIN.Themes.pFirst;la_RefreshThemeColor(MAIN.CurrentTheme);}
  1160. laNotifyUsers("themes"); laRedrawCurrentWindow();
  1161. return LA_FINISHED;
  1162. }
  1163. int la_GenericTopPanelProcessing(laOperator* a, laEvent* e){
  1164. laPanel* p;
  1165. if (p = laDetectPanel(e->x, e->y)){
  1166. int x = e->x;
  1167. int y = e->y;
  1168. laWindowToLocal(0, p, &x, &y);
  1169. if (laIsInPanel(p, x, y) /*&& p->Show*/){
  1170. laSetOperatorLocalizer(p);
  1171. laInvokeUi(a, "LA_panel_operator", e, p, 0, 1);
  1172. return LA_RUNNING;
  1173. }
  1174. }
  1175. return 0;
  1176. }
  1177. int la_GeneratePasteEvent(laWindow* w){
  1178. XConvertSelection(MAIN.dpy, MAIN.bufid, MAIN.fmtid, MAIN.propid, w->win, CurrentTime);
  1179. }
  1180. int OPINV_SystemPaste(laOperator *a, laEvent *e){ la_GeneratePasteEvent(MAIN.CurrentWindow); return LA_FINISHED; }
  1181. int OPINV_Window(laOperator *a, laEvent *e){
  1182. laRetriggerOperators();
  1183. return LA_RUNNING;
  1184. }
  1185. int OPMOD_Window(laOperator *a, laEvent *e){
  1186. laPanel *p;
  1187. laBlock *b = 0;
  1188. laWindow *w = a->Instance;
  1189. laGeneralUiExtraData *uid = a->CustomData;
  1190. if (!uid) uid = memAcquireSimple(sizeof(laGeneralUiExtraData));
  1191. a->CustomData = uid;
  1192. if(laKeyMapExecuteEvent(a, &MAIN.KeyMap, e)) return LA_RUNNING_PASS;
  1193. if(w->IsDocking && MAIN.DockingPanel){
  1194. laRestoreToLayout();
  1195. laRestoreCanvasUI();
  1196. laLayout* l=MAIN.CurrentWindow->CurrentLayout;
  1197. laBlock *Recieve = laDetectBlockRecursive(l->FirstBlock, e->x, e->y);
  1198. if (Recieve){
  1199. la_ClearDockingTarget(); l->DropToBlock = Recieve;
  1200. l->DropLocation = la_DetectBlockDropLocation(Recieve, e->x, e->y);
  1201. }else{
  1202. MAIN.CurrentWindow->CurrentLayout->DropToBlock = 0;
  1203. }
  1204. if(e->Type==LA_L_MOUSE_UP && l->DropToBlock){
  1205. l->DropToBlock = la_MakeDropBlock(l->DropToBlock, l->DropLocation);
  1206. laDockPanel(w->DockingFrom, l->DropToBlock, MAIN.DockingPanel);
  1207. la_StopDocking();la_ClearDockingTarget(); return LA_RUNNING;
  1208. }
  1209. if(e->Type==LA_R_MOUSE_DOWN || (e->Type==LA_KEY_DOWN&&e->key==LA_KEY_ESCAPE)){
  1210. la_StopDocking();la_ClearDockingTarget(); return LA_RUNNING;
  1211. }
  1212. return LA_RUNNING;
  1213. }
  1214. if(w->MaximizedUi && w->MaximizedUiPanel){
  1215. if(((e->y<LA_RH && e->x<LA_RH)||e->y<LA_SEAM_W) && uid->Dragging){ laShowMenuBar(); uid->Dragging=0; }
  1216. if(!la_UiOperatorExists(w->MaximizedUi)){
  1217. laSetOperatorLocalizer(0);
  1218. laInvokeUi(a, w->MaximizedUi->Type->OperatorID, e, w->MaximizedUi, 0, 1);
  1219. return LA_RUNNING;
  1220. }
  1221. if(e->y>LA_2RH && e->x>LA_2RH){ if(!uid->Dragging)laRequestDelayEvent(0.5); uid->Dragging=1; }
  1222. if(e->Type==LA_TIME_DELAY){
  1223. laHideMenuBar(); }
  1224. }else{
  1225. laBlock* RootBlock=w->MaximizedBlock?w->MaximizedBlock:w->CurrentLayout->FirstBlock;
  1226. if (la_ProcessBlockEdgeEvent(a, w->CurrentLayout, RootBlock, e)) return LA_RUNNING;
  1227. b = w->MaximizedBlock?w->MaximizedBlock:laDetectBlockRecursive(w->CurrentLayout->FirstBlock, e->x, e->y);
  1228. if (b && la_ProcessBlockEvent(a, b, e)) return LA_RUNNING;
  1229. for (p = w->Panels.pFirst; p; p = p->Item.pNext){
  1230. int x = e->x;
  1231. int y = e->y;
  1232. laWindowToLocal(0, p, &x, &y);
  1233. if (laIsInPanel(p, x, y) && p->Show){
  1234. laSetOperatorLocalizer(p);
  1235. if (!p->LaterDestroy) laInvokeUi(a, "LA_panel_operator", e, p, 0, 1);
  1236. return LA_RUNNING;
  1237. }
  1238. }
  1239. }
  1240. if(la_GenericTopPanelProcessing(a,e)) return LA_RUNNING;
  1241. return LA_RUNNING;
  1242. }
  1243. int OPINV_Panel(laOperator *a, laEvent *e){
  1244. if (!((laPanel *)a->Instance)->Show) return LA_FINISHED;
  1245. a->CustomData = memAcquireSimple(sizeof(laGeneralUiExtraData));
  1246. laRetriggerOperators();
  1247. return LA_RUNNING;
  1248. }
  1249. int OPEXT_Panel(laOperator *a, int ExitCode){
  1250. memFree(a->CustomData);
  1251. return 0;
  1252. }
  1253. int la_ScrollPanel(laGeneralUiExtraData*ex, laPanel*p, laEvent* e){
  1254. int ret=0;
  1255. if(ex->TargetIndexVali==4 && e->Type==LA_MOUSEMOVE){
  1256. laUiList* uuil=ex->Ptr1; laUiItem* upui=ex->Ptr2;
  1257. if(upui){ laPanUiListFree(uuil, ex->LastX-e->x, ex->LastY-e->y);
  1258. //if(uuil->HeightCoeff){
  1259. if(uuil->B-upui->Page->PanY<upui->TB-(*p->BT)->BM-LA_SCROLL_W){
  1260. upui->Page->PanY = (uuil->B-upui->TB+(*p->BT)->BM+LA_SCROLL_W);
  1261. if(upui->Page->PanY<0){upui->Page->PanY=0;}
  1262. }
  1263. //}
  1264. }
  1265. ex->LastX=e->x; ex->LastY=e->y;
  1266. laRedrawCurrentPanel();
  1267. ret= 1;
  1268. }
  1269. if(ex->TargetIndexVali==5 && e->Type==LA_MOUSEMOVE){
  1270. laUiList* uuil=ex->Ptr1; laUiItem* upui=ex->Ptr2;
  1271. if(upui)laScaleUiList(uuil, -(ex->LastY-e->y)*0.005+1, upui->L, upui->R, upui->U, upui->B);
  1272. ex->LastX=e->x; ex->LastY=e->y;
  1273. laRecalcCurrentPanel();
  1274. ret= 1;
  1275. }
  1276. if(e->Type==LA_M_MOUSE_UP){ ex->TargetIndexVali=0; }
  1277. if (e->Type & LA_KEY_MOUSE_SCROLL || e->Type==LA_M_MOUSE_DOWN){
  1278. laUiItem *pui = 0; laListHandle levels={0}; int dir;
  1279. if (e->Type & LA_STATE_DOWN) dir=1;
  1280. elif (e->Type & LA_STATE_UP) dir=-1;
  1281. laUiList *duil = la_DetectUiListRecursiveDeep(p->MenuRefer?p->MenuRefer:&p->UI, e->x, e->y, 10000, &pui, 0, 0, 0, 0, &levels);
  1282. laUiListRecord* lip=levels.pLast; laUiList* uuil=lip->uil; laUiItem* upui=lip->Item.pPrev?((laUiListRecord*)lip->Item.pPrev)->pui:0; int ran=0;
  1283. if(e->SpecialKeyBit == LA_KEY_CTRL){
  1284. if(e->Type==LA_M_MOUSE_DOWN){
  1285. while (lip && upui && (!uuil->AllowScale)) { lip=lip->Item.pPrev; uuil=lip->uil; upui=lip->Item.pPrev?((laUiListRecord*)lip->Item.pPrev)->pui:0; }
  1286. if(uuil) { ex->TargetIndexVali=5; ex->Ptr1=uuil; ex->Ptr2=upui; ex->LastX=e->x; ex->LastY=e->y; ret= 1;}
  1287. }else{
  1288. }
  1289. }else{
  1290. if(e->Type==LA_M_MOUSE_DOWN){
  1291. while (lip && upui && (!uuil->AllowScale)) { lip=lip->Item.pPrev; uuil=lip->uil; upui=lip->Item.pPrev?((laUiListRecord*)lip->Item.pPrev)->pui:0; }
  1292. if(uuil) { ex->TargetIndexVali=4; ex->Ptr1=uuil; ex->Ptr2=upui; ex->LastX=e->x; ex->LastY=e->y; ret= 1;}
  1293. }else{
  1294. while (lip && upui){
  1295. if(uuil->AllowScale){ if((ran=laScaleUiList(uuil, 1.0f+dir*0.1, upui->L, upui->R, upui->U, upui->B))){ laRecalcCurrentPanel(); break;} }
  1296. else{ if((ran=laPanUiListAuto(uuil, 0, dir*MAIN.ScrollingSpeed*LA_RH,
  1297. uuil->L, upui->R-(uuil->ScrollerShownV?(LA_SCROLL_W+(*p->BT)->RM):0),
  1298. uuil->U, upui->B-(*upui->Type->Theme)->BM-(uuil->ScrollerShownH?(LA_SCROLL_W+(*p->BT)->BM):0)))) break; }
  1299. lip=lip->Item.pPrev; uuil=lip->uil; upui=lip->Item.pPrev?((laUiListRecord*)lip->Item.pPrev)->pui:0;
  1300. }
  1301. if(!ran) laPanUiListAuto(p->MenuRefer?p->MenuRefer:&p->UI, 0, dir*MAIN.ScrollingSpeed*LA_RH, 0, p->W, p->TitleBar.B, p->H-(*p->BT)->BM);
  1302. laRedrawCurrentPanel();
  1303. ret= 1;
  1304. }
  1305. }
  1306. while(duil=lstPopPointer(&levels));
  1307. }
  1308. return ret;
  1309. }
  1310. int OPMOD_Panel(laOperator *a, laEvent *e){
  1311. int x = e->x;
  1312. int y = e->y;
  1313. laPanel *p = a->Instance, *dp;
  1314. laUiItem *ui = 0;
  1315. laGeneralUiExtraData *uid = a->CustomData;
  1316. laListHandle Locals = {0};
  1317. int RET=LA_RUNNING|(p->IsMenuPanel?0:LA_PASS_ON);
  1318. if(MAIN.DockingPanel){return LA_FINISHED; }
  1319. if (!p->Show || (!laIsInPanel(p, x, y) && !uid->TargetIndexVali)){
  1320. return LA_FINISHED;
  1321. }
  1322. int NoPrimaryUI=(p==MAIN.CurrentWindow->MaximizedUiPanel);
  1323. if(p->PanelTemplate && laKeyMapExecuteEvent(a, &p->PanelTemplate->KeyMap, e)) return RET;
  1324. int IsTop=laIsTopPanel(p);
  1325. if (!IsTop && !uid->TargetIndexVali){
  1326. laLocalToWindow(0, p, &x, &y);
  1327. dp = laDetectPanel(x, y);
  1328. if (p->Mode && dp != p){
  1329. return LA_FINISHED;
  1330. }else if ((e->Type & LA_MOUSEDOWN) == LA_MOUSEDOWN){
  1331. laPopPanel(p); IsTop=1;
  1332. }else if(p->Mode) return LA_RUNNING;
  1333. laWindowToLocal(0, p, &x, &y);
  1334. }
  1335. if (e->Type == LA_L_MOUSE_DOWN && (!NoPrimaryUI) && e->x + e->y < p->W + p->H - LA_SCROLL_W*2){
  1336. laUiItem *pui = 0; laUiList *suil = 0;laListHandle levels={0};
  1337. laUiList *duil = la_DetectUiListRecursiveDeep(&p->UI, e->x, e->y, 10000, &pui, &suil, 0, 0, 0, &levels);
  1338. while(duil=lstPopPointer(&levels));
  1339. if (suil){
  1340. uid->Ptr1 = suil; uid->Ptr2 = pui;
  1341. uid->TargetIndexVali = 3;
  1342. uid->LastX = e->x; uid->LastY = e->y;
  1343. uid->On=(!pui || e->x>pui->R-LA_SCROLL_W-2*(*p->BT)->RM)?1:0;
  1344. return LA_RUNNING;
  1345. }
  1346. }
  1347. if(la_ScrollPanel(uid,p,e))return LA_RUNNING;
  1348. if (!p->Mode || (IsTop && !uid->TargetIndexVali)){
  1349. if(y<p->TitleBar.B){ ui = la_DetectUiItemRecursive(&p->TitleBar, x, y, 10000, &Locals, 0); }
  1350. elif (!ui && (!NoPrimaryUI)){
  1351. lstClearPointer(&Locals);
  1352. ui = la_DetectUiItemRecursive(&p->UI, x, y, 10000, &Locals, 0);
  1353. }
  1354. }
  1355. if (ui && !a->Child && ui->Type->OperatorType && !la_UiOperatorExists(ui)){
  1356. laSetOperatorLocalizer(p);
  1357. if (laInvokeUiP(a, ui->Type->OperatorType, e, ui, &Locals, 0) >= 0) laRetriggerOperators();
  1358. lstClearPointer(&Locals);
  1359. //return LA_RUNNING;
  1360. }
  1361. lstClearPointer(&Locals);
  1362. if (p->Mode && e->Type&LA_MOUSE_EVENT && !uid->TargetIndexVali){
  1363. if (!p->IsMenuPanel && e->x + e->y > p->W + p->H - LA_SCROLL_W*2){
  1364. if(e->Type==LA_L_MOUSE_DOWN){ uid->TargetIndexVali = 2; uid->LastX=e->x;uid->LastY=e->y;}
  1365. return LA_RUNNING;
  1366. }else{
  1367. if(e->Type==LA_L_MOUSE_DOWN){ uid->TargetIndexVali = 1; uid->LastX=e->x;uid->LastY=e->y; return LA_RUNNING; }
  1368. }
  1369. }
  1370. if (e->Type == LA_MOUSEMOVE){
  1371. if (uid->TargetIndexVali == 1){
  1372. if (!p->SL && !p->SR) p->TX = p->X + e->x - uid->LastX;
  1373. if (!p->ST && !p->SB) p->TY = p->Y + e->y - uid->LastY;
  1374. laNotifyUsersPPPath(&p->PP, "position");
  1375. la_EnsurePanelSnapping(p, MAIN.CurrentWindow->CW, MAIN.CurrentWindow->CH);
  1376. laRecalcCurrentPanel();
  1377. return LA_RUNNING;
  1378. }elif (uid->TargetIndexVali == 2){
  1379. p->TW += e->x - uid->LastX; p->TH += e->y - uid->LastY;
  1380. uid->LastX = e->x; uid->LastY = e->y;
  1381. p->BoundUi=0;
  1382. laNotifyUsersPPPath(&p->PP, "size");
  1383. la_EnsurePanelSnapping(p, MAIN.CurrentWindow->CW, MAIN.CurrentWindow->CH);
  1384. laRecalcCurrentPanel();
  1385. return LA_RUNNING;
  1386. }elif (uid->TargetIndexVali == 3){
  1387. laUiList *suil = uid->Ptr1; laUiItem *pui = uid->Ptr2;
  1388. int IsVertical=uid->On;
  1389. uid->TargetIndexValf+=IsVertical?la_ScrollerVerticalPan(e->y - uid->LastY, p, uid->Ptr1, uid->Ptr2):
  1390. (pui?la_ScrollerHorizontalPan(e->x - uid->LastX, p, uid->Ptr1, uid->Ptr2):0);
  1391. uid->Dragging = (int)uid->TargetIndexValf; uid->TargetIndexValf-=uid->Dragging;
  1392. int pV=uid->Dragging*IsVertical, pH=uid->Dragging*(!IsVertical);
  1393. if (!pui) laPanUiList(suil, pH, pV,0, p->W, suil->U, p->H-(*p->BT)->BM);
  1394. else laPanUiList(suil, pH, pV, suil->L, pui->R-(suil->ScrollerShownV?(LA_SCROLL_W+(*p->BT)->RM):0),
  1395. suil->U, pui->B-(*p->BT)->BM-(suil->ScrollerShownH?(LA_SCROLL_W+(*p->BT)->BM):0));
  1396. uid->LastX = e->x; uid->LastY = e->y;
  1397. laRedrawCurrentPanel();
  1398. return LA_RUNNING;
  1399. }
  1400. }
  1401. if (e->Type == LA_L_MOUSE_UP){
  1402. uid->TargetIndexVali = 0;
  1403. return LA_RUNNING;
  1404. }
  1405. if(p->Mode&&e->Type&LA_MOUSE_EVENT){ return LA_RUNNING; }
  1406. return RET;
  1407. }
  1408. int OPMOD_MenuPanel(laOperator *a, laEvent *e){
  1409. int x = e->x;
  1410. int y = e->y;
  1411. laPanel *p = a->Instance;
  1412. laUiItem *ui;
  1413. laListHandle Locals = {0};
  1414. laGeneralUiExtraData *uid = a->CustomData;
  1415. if(MAIN.DockingPanel){return LA_FINISHED; }
  1416. int IsClose=laIsCloseToPanel(p,x,y);
  1417. int IsIn=laIsInPanel(p, x, y);
  1418. if(p->CloseWhenMovedOut && (!IsClose || (!IsIn && e->Type==LA_TIME_IDLE) || e->Type==LA_L_MOUSE_DOWN||e->Type==LA_R_MOUSE_DOWN)){
  1419. la_StopUiOperatorService(p);
  1420. laDestroySinglePanel(p,0);
  1421. return LA_FINISHED_PASS;
  1422. }
  1423. if (e->Type == LA_ESCAPE_DOWN || (e->Type == LA_L_MOUSE_DOWN && !IsIn)){
  1424. laConfirmInt(a, 1, LA_CONFIRM_DATA);
  1425. la_StopUiOperatorService(p);
  1426. laDestroySinglePanel(p,0);
  1427. return LA_FINISHED_PASS;
  1428. }
  1429. if(p->PanelTemplate && laKeyMapExecuteEvent(a, &p->PanelTemplate->KeyMap, e)) return LA_RUNNING_PASS;
  1430. if (e->Type == LA_L_MOUSE_DOWN && e->y < p->H - LA_SCROLL_W){
  1431. laUiItem *pui = 0; laUiList *suil = 0;laListHandle levels={0};
  1432. laUiList *duil = la_DetectUiListRecursiveDeep(p->MenuRefer?p->MenuRefer:&p->UI, e->x, e->y, 10000, &pui, &suil, 0, 0, 0, &levels);
  1433. while(duil=lstPopPointer(&levels));
  1434. if (suil){
  1435. uid->Ptr1 = suil; uid->Ptr2 = pui;
  1436. uid->TargetIndexVali = 3;
  1437. uid->LastX = e->x; uid->LastY = e->y;
  1438. uid->On=(!pui || e->x>pui->R-LA_SCROLL_W-2*(*p->BT)->RM)?1:0;
  1439. return LA_RUNNING;
  1440. }
  1441. }
  1442. if (e->Type == LA_L_MOUSE_UP && uid->TargetIndexVali == 3){
  1443. uid->TargetIndexVali = 0;
  1444. return LA_RUNNING;
  1445. }
  1446. if(la_ScrollPanel(uid,p,e))return LA_RUNNING;
  1447. if (e->Type == LA_MOUSEMOVE){
  1448. if (uid->TargetIndexVali == 3){
  1449. laUiList *suil = uid->Ptr1; laUiItem *pui = uid->Ptr2;
  1450. int IsVertical=uid->On;
  1451. uid->TargetIndexValf+=IsVertical?la_ScrollerVerticalPan(e->y - uid->LastY, p, uid->Ptr1, uid->Ptr2):
  1452. (pui?la_ScrollerHorizontalPan(e->x - uid->LastX, p, uid->Ptr1, uid->Ptr2):0);
  1453. uid->Dragging = (int)uid->TargetIndexValf; uid->TargetIndexValf-=uid->Dragging;
  1454. int pV=uid->Dragging*IsVertical, pH=uid->Dragging*(!IsVertical);
  1455. if (!pui) laPanUiList(suil, pH, pV,0, p->W, suil->U, p->H-(*p->BT)->BM);
  1456. else laPanUiList(suil, pH, pV, suil->L, pui->R-(suil->ScrollerShownV?(LA_SCROLL_W+(*p->BT)->RM):0),
  1457. suil->U, pui->B-(*p->BT)->BM-(suil->ScrollerShownH?(LA_SCROLL_W+(*p->BT)->BM):0));
  1458. uid->LastX = e->x; uid->LastY = e->y;
  1459. laRedrawCurrentPanel();
  1460. return LA_RUNNING;
  1461. }
  1462. }
  1463. ui = la_DetectUiItemRecursive(&p->UI, x, y, 10000, &Locals, 0);
  1464. if (!ui){
  1465. lstClearPointer(&Locals);
  1466. ui = la_DetectUiItemRecursive(p->MenuRefer, x, y, 10000, &Locals, 0);
  1467. }
  1468. if (ui && !la_UiOperatorExists(ui)){
  1469. laSetOperatorLocalizer(p);
  1470. laInvokeUiP(a, ui->Type->OperatorType, e, ui, &Locals, 0);
  1471. }
  1472. lstClearPointer(&Locals);
  1473. if (a->ConfirmData){
  1474. laConfirmInt(a, a->ConfirmData->IData, a->ConfirmData->Mode);
  1475. la_StopUiOperatorService(p);
  1476. laDestroySinglePanel(p,0);
  1477. return LA_FINISHED_PASS;
  1478. }
  1479. return LA_RUNNING;
  1480. }
  1481. int OPMOD_ModalPanel(laOperator *a, laEvent *e){
  1482. int x = e->x;
  1483. int y = e->y;
  1484. laPanel *p = a->Instance;
  1485. laUiItem *ui = 0;
  1486. laListHandle Locals = {0};
  1487. laGeneralUiExtraData *uid = a->CustomData;
  1488. if(MAIN.DockingPanel){return LA_FINISHED; }
  1489. if (e->Type == LA_KEY_DOWN && e->key==LA_KEY_ESCAPE){
  1490. laConfirmInt(a, 0, LA_CONFIRM_CANCEL);
  1491. la_StopUiOperatorService(p);
  1492. laDestroySinglePanel(p,0);
  1493. return LA_FINISHED_PASS;
  1494. }
  1495. if (a->ConfirmData){
  1496. laConfirmSameDataIfAny(a);
  1497. if (a->ConfirmData->Mode == LA_CONFIRM_DATA||a->ConfirmData->Mode==LA_CONFIRM_CUSTOM_STRING){
  1498. return LA_RUNNING_PASS;
  1499. }
  1500. la_StopUiOperatorService(p);
  1501. laDestroySinglePanel(p,0);
  1502. return LA_FINISHED_PASS;
  1503. }
  1504. if (!laIsInPanel(p, e->x, e->y) && !uid->TargetIndexVali) return LA_RUNNING;
  1505. if(p->PanelTemplate && laKeyMapExecuteEvent(a, &p->PanelTemplate->KeyMap, e)) return LA_RUNNING_PASS;
  1506. if (e->Type == LA_L_MOUSE_DOWN && e->y < p->H - LA_SCROLL_W){
  1507. laUiItem *pui = 0; laUiList *suil = 0;laListHandle levels={0};
  1508. laUiList *duil = la_DetectUiListRecursiveDeep(&p->UI, e->x, e->y, 10000, &pui, &suil, 0, 0, 0, &levels);
  1509. while(duil=lstPopPointer(&levels));
  1510. if (suil){
  1511. uid->Ptr1 = suil; uid->Ptr2 = pui;
  1512. uid->TargetIndexVali = 3;
  1513. uid->LastX = e->x; uid->LastY = e->y;
  1514. uid->On=(!pui || e->x>pui->R-LA_SCROLL_W-2*(*p->BT)->RM)?1:0;
  1515. return LA_RUNNING;
  1516. }
  1517. }
  1518. if(la_ScrollPanel(uid,p,e))return LA_RUNNING;
  1519. if (!uid->TargetIndexVali){
  1520. ui = la_DetectUiItemRecursive(&p->TitleBar, x, y, 10000, &Locals, 0);
  1521. if (!ui){
  1522. lstClearPointer(&Locals);
  1523. ui = la_DetectUiItemRecursive(&p->UI, x, y, 10000, &Locals, 0);
  1524. }
  1525. }
  1526. if (ui && !a->Child && ui->Type->OperatorType && !la_UiOperatorExists(ui)){
  1527. laSetOperatorLocalizer(p);
  1528. laInvokeUiP(a, ui->Type->OperatorType, e, ui, &Locals, 0);
  1529. return LA_RUNNING;
  1530. }
  1531. lstClearPointer(&Locals);
  1532. if (e->Type == LA_L_MOUSE_DOWN){
  1533. uid->LastX = e->x;
  1534. uid->LastY = e->y;
  1535. if (e->x + e->y > p->W + p->H - LA_SCROLL_W*2) uid->TargetIndexVali = 2;
  1536. else
  1537. uid->TargetIndexVali = 1;
  1538. return LA_RUNNING;
  1539. }
  1540. if (e->Type == LA_MOUSEMOVE){
  1541. if (uid->TargetIndexVali == 1){
  1542. if (!p->SL && !p->SR) p->TX = p->X + e->x - uid->LastX;
  1543. if (!p->ST && !p->SB) p->TY = p->Y + e->y - uid->LastY;
  1544. laNotifyUsersPPPath(&p->PP, "position");
  1545. la_EnsurePanelSnapping(p, MAIN.CurrentWindow->CW, MAIN.CurrentWindow->CH);
  1546. laRecalcCurrentPanel();
  1547. return LA_RUNNING;
  1548. }elif (uid->TargetIndexVali == 2){
  1549. p->TW += e->x - uid->LastX; p->TH += e->y - uid->LastY;
  1550. uid->LastX = e->x; uid->LastY = e->y;
  1551. p->BoundUi=0;
  1552. laNotifyUsersPPPath(&p->PP, "size");
  1553. la_EnsurePanelSnapping(p, MAIN.CurrentWindow->CW, MAIN.CurrentWindow->CH);
  1554. laRecalcCurrentPanel();
  1555. return LA_RUNNING;
  1556. }elif (uid->TargetIndexVali == 3){
  1557. laUiList *suil = uid->Ptr1; laUiItem *pui = uid->Ptr2;
  1558. int IsVertical=uid->On;
  1559. uid->TargetIndexValf+=IsVertical?la_ScrollerVerticalPan(e->y - uid->LastY, p, uid->Ptr1, uid->Ptr2):
  1560. (pui?la_ScrollerHorizontalPan(e->x - uid->LastX, p, uid->Ptr1, uid->Ptr2):0);
  1561. uid->Dragging = (int)uid->TargetIndexValf; uid->TargetIndexValf-=uid->Dragging;
  1562. int pV=uid->Dragging*IsVertical, pH=uid->Dragging*(!IsVertical);
  1563. if (!pui) laPanUiList(suil, pH, pV,0, p->W, suil->U, p->H-(*p->BT)->BM);
  1564. else laPanUiList(suil, pH, pV, suil->L, pui->R-(suil->ScrollerShownV?(LA_SCROLL_W+(*p->BT)->RM):0),
  1565. suil->U, pui->B-(*p->BT)->BM-(suil->ScrollerShownH?(LA_SCROLL_W+(*p->BT)->BM):0));
  1566. uid->LastX = e->x; uid->LastY = e->y;
  1567. laRedrawCurrentPanel();
  1568. return LA_RUNNING;
  1569. }
  1570. }
  1571. if (e->Type == LA_L_MOUSE_UP){
  1572. uid->TargetIndexVali = 0;
  1573. return LA_RUNNING;
  1574. }
  1575. return LA_RUNNING;
  1576. }
  1577. int OPCHK_IsPanel(laPropPack *This, laStringSplitor *ss){
  1578. if (This && This->LastPs->p == _LA_PROP_PANEL) return 1;
  1579. else{
  1580. char *PanelInternalID = strGetArgumentString(ss, "panel_id");
  1581. if (!PanelInternalID) return 0;
  1582. else
  1583. return 1;
  1584. }
  1585. return 0;
  1586. }
  1587. int OPCHK_IsPanelNoInstructions(laPropPack *This, laStringSplitor *ss){
  1588. if (This && This->LastPs->p == _LA_PROP_PANEL) return 1;
  1589. return 0;
  1590. }
  1591. int OPINV_HidePanel(laOperator *a, laEvent *e){
  1592. laPanel *p = a->This->LastPs->UseInstance;
  1593. laHidePanelWithDissoveEffect(p);
  1594. return LA_FINISHED;
  1595. }
  1596. int OPINV_ActivatePanel(laOperator *a, laEvent *e){
  1597. laStringSplitor *ss = a->ExtraInstructionsP;
  1598. char *TemplateID = strGetArgumentString(ss, "panel_id");
  1599. if (!TemplateID) return LA_CANCELED;
  1600. laActivatePanel(TemplateID, e->x, e->y);
  1601. return LA_FINISHED;
  1602. }
  1603. int OPINV_PanPanel(laOperator *a, laEvent *e){
  1604. laPanel *p = a->This->LastPs->UseInstance;
  1605. //laHidePanel(p);
  1606. return LA_FINISHED;
  1607. }
  1608. int OPCHK_IsHyper(laPropPack *This, laStringSplitor *ss){
  1609. if (This && This->LastPs->p->Container->Hyper) return 1;
  1610. return 0;
  1611. }
  1612. int OPINV_ViewHyperData(laOperator *a, laEvent *e){
  1613. char buf[2048]={0};
  1614. memHyperInfo(a->This, buf);
  1615. printf("%s",buf);
  1616. return LA_FINISHED;
  1617. }
  1618. int OPINV_TranslationDumpMisMatch(laOperator *a, laEvent *e){
  1619. transDumpMissMatchRecord("TranslationDump.txt");
  1620. laEnableMessagePanel(a, 0, "OK", "Untranslated strings exported to TranslationDump.txt", e->x - 250, e->y - 10, 300, e);
  1621. return LA_FINISHED;
  1622. }
  1623. int OPINV_OpenInternetLink(laOperator *a, laEvent *e){
  1624. char *link = strGetArgumentString(a->ExtraInstructionsP, "link");
  1625. if (link) laOpenInternetLink(link);
  1626. return LA_FINISHED;
  1627. }
  1628. void laget_PanelTemplateCategory(void* rack_unused, laUiTemplate* uit, char* copy, char** ptr);
  1629. void la_RegisterBuiltinOperators(){
  1630. laPropContainer *pc; laProp *p;
  1631. laOperatorType *at;
  1632. laEnumProp *ep;
  1633. laCreateOperatorType("LA_terminate_program", "Quit", "Terminate Program Immediately",
  1634. OPCHK_TerminateProgram, 0, 0, OPINV_TerminateProgram, 0, L'⏻', LA_ACTUATOR_SYSTEM);
  1635. laCreateOperatorType("LA_undo", "Undo", "Undo from recorded data state", 0, 0, 0, OPINV_Undo, 0, L'⮌', LA_ACTUATOR_SYSTEM);
  1636. laCreateOperatorType("LA_redo", "Redo", "Redo using recorded data state", 0, 0, 0, OPINV_Redo, 0, L'⮎', LA_ACTUATOR_SYSTEM);
  1637. laCreateOperatorType("LA_translation_dump", "Dump Untranslated Text", "Dump Untranslated Text To File", 0, 0, 0, OPINV_TranslationDumpMisMatch, 0, L'📥', LA_ACTUATOR_SYSTEM);
  1638. laCreateOperatorType("LA_open_internet_link", "Goto", "Open Internet Link", 0, 0, 0, OPINV_OpenInternetLink, 0, L'🌐', LA_ACTUATOR_SYSTEM);
  1639. laCreateOperatorType("LA_system_paste", "Window Paste", "Generate a syetem paste event", 0, 0, 0, OPINV_SystemPaste, 0, L'📋', LA_ACTUATOR_SYSTEM | LA_ACTUATOR_HIDDEN);
  1640. laCreateOperatorType("LA_string_copy", "Copy", "Copy string to clip board", 0, 0, 0, OPINV_StringCopy, 0, L'🗍', LA_ACTUATOR_SYSTEM | LA_ACTUATOR_HIDDEN);
  1641. laCreateOperatorType("LA_window_operator", "Window Operator", "Handle All Unhandled Events", 0, 0, 0, OPINV_Window, OPMOD_Window, L'🖦', LA_ACTUATOR_SYSTEM | LA_ACTUATOR_HIDDEN);
  1642. at = laCreateOperatorType("LA_switch_layout", "Switch Layout", "Cycle All Layouts In Current Window", 0, 0, 0, OPINV_SwitchLayout, OPMOD_FinishOnData, L'↔', LA_ACTUATOR_SYSTEM);
  1643. at->UiDefine=laui_LayoutCycle;
  1644. at = laCreateOperatorType("LA_new_window", "New Window", "Create a new window", 0, 0, 0, OPINV_NewWindow, 0, L'🗗', LA_ACTUATOR_SYSTEM);
  1645. laCreateOperatorType("LA_combine_child_blocks", "Combine Child Block", "If Child Blocks Are Two Panel Blocks, Then Combine Them.",
  1646. OPCHK_CombineChildBlocks, 0, 0, OPINV_CombineChildBlocks, 0, L'□' , LA_ACTUATOR_SYSTEM);
  1647. at = laCreateOperatorType("LA_new_panel", "New Panel", "Create a new panel",
  1648. 0, 0, 0, OPINV_NewPanel, OPMOD_NewPanel, L'🞆', LA_ACTUATOR_SYSTEM);
  1649. pc = laDefineOperatorProps(at, 0);
  1650. p = laAddSubGroup(pc, "template", "Template", "Template selection used to create the new panel", "panel_template", 0, 0, laui_TitleOnly, -1, laget_FirstPanelTemplate, laget_NewPanelGetActiveTemplate, laget_ListNext, 0, 0, laset_NewPanelSetTemplate,0,0);
  1651. laSubGroupExtraFunctions(p,0,0,0,laget_PanelTemplateCategory);
  1652. at->UiDefine=laui_PanelTemplateSelect;
  1653. laCreateOperatorType("LA_block_fold_title", "Fold Title", "Fold the tile bar of the block", 0, 0, 0, OPINV_BlockFoldTitle, 0, L'⯅', LA_ACTUATOR_SYSTEM);
  1654. laCreateOperatorType("LA_block_maximize", "Maximize", "Maximize this block", 0, 0, 0, OPINV_BlockMaximize, 0, L'⮼', LA_ACTUATOR_SYSTEM);
  1655. laCreateOperatorType("LA_block_tear_off_panel", "Tear Off", "Tear off current panel in the block",
  1656. OPCHK_BlockHasMorePanels, 0, 0, OPINV_BlockTearOffPanel, 0, L'🗗', LA_ACTUATOR_SYSTEM);
  1657. laCreateOperatorType("LA_block_close_panel", "Close Panel", "Close current panel in the block",
  1658. OPCHK_BlockHasMorePanels, 0, 0, OPINV_BlockClosePanel, OPMOD_BlockClosePanel, L'❌', LA_ACTUATOR_SYSTEM);
  1659. laCreateOperatorType("LA_canvas_ui_maximize", "Maximize", "Maximize this UI item", 0, 0, 0, OPINV_CanvasUiMaximize, 0, L'⮼', LA_ACTUATOR_SYSTEM);
  1660. laCreateOperatorType("LA_hide_menu_bar", "Hide Menu Bar", "Hide menu bar of the window", 0, 0, 0, OPINV_HideMenuBar, 0, L'⯅', LA_ACTUATOR_SYSTEM);
  1661. laCreateOperatorType("LA_new_layout", "New Layout", "Create a new layout in the window",
  1662. 0, 0, 0, OPINV_NewLayout, 0, L'🞦', LA_ACTUATOR_SYSTEM | LA_ACTUATOR_HIDDEN);
  1663. laCreateOperatorType("LA_panel_operator", "Panel Operator", "Handle Events On The Panel Level",
  1664. 0, 0, OPEXT_Panel, OPINV_Panel, OPMOD_Panel, L'🖦', LA_EXTRA_TO_PANEL | LA_ACTUATOR_SYSTEM | LA_ACTUATOR_HIDDEN);
  1665. laCreateOperatorType("LA_modal_panel_operator", "Modal Panel Operator", "Handle Events On Modal Panels Like Yes-No Boxes",
  1666. 0, 0, OPEXT_Panel, OPINV_Panel, OPMOD_ModalPanel, L'🖦', LA_EXTRA_TO_PANEL | LA_ACTUATOR_SYSTEM | LA_ACTUATOR_HIDDEN);
  1667. laCreateOperatorType("LA_menu_panel_operator", "Menu Panel Operator", "Handle Events On Menu Panel,Recieve And Dispatch Confirm Messages,Then Self-destroy.",
  1668. 0, 0, OPEXT_Panel, OPINV_Panel, OPMOD_MenuPanel, L'🖦', LA_EXTRA_TO_PANEL | LA_ACTUATOR_SYSTEM | LA_ACTUATOR_HIDDEN);
  1669. laCreateOperatorType("LA_panel_activator", "Panel Activator", "Show A Panel When Invoked.Need An Extra Argument[panel_id]",
  1670. OPCHK_IsPanel, 0, 0, OPINV_ActivatePanel, 0, 0, LA_ACTUATOR_SYSTEM)
  1671. ->ParseArgs = la_PanelActiviatorParser;
  1672. laCreateOperatorType("LA_hide_panel", "Hide Panel", "Hide a panel",
  1673. OPCHK_IsPanel, 0, 0, OPINV_HidePanel, 0, 0, LA_ACTUATOR_SYSTEM);
  1674. laCreateOperatorType("LA_dock_panel", "Dock Panel", "Dock a panel",
  1675. OPCHK_IsPanel, 0, 0, OPINV_DockPanel, 0, 0, LA_ACTUATOR_SYSTEM);
  1676. laCreateOperatorType("LA_int_restore_default", "Restore Default Value", "Restore Int Value To Default", OPCHK_IntSetValue, 0, 0, OPINV_IntSetDefault, 0, L'⭯', LA_ACTUATOR_SYSTEM);
  1677. laCreateOperatorType("LA_real_restore_default", "Restore Default Value", "Restore Float Value To Default", OPCHK_FloatSetValue, 0, 0, OPINV_FloatSetDefault, 0, L'⭯', LA_ACTUATOR_SYSTEM);
  1678. laCreateOperatorType("LA_int_set_max", "Set Max Value", "Set Int Value To Max", OPCHK_IntSetValue, 0, 0, OPINV_IntSetMax, 0, 0, LA_ACTUATOR_SYSTEM);
  1679. laCreateOperatorType("LA_real_set_max", "Set Max Value", "Set Float Value To Max", OPCHK_FloatSetValue, 0, 0, OPINV_FloatSetMax, 0, 0, LA_ACTUATOR_SYSTEM);
  1680. laCreateOperatorType("LA_int_set_min", "Set Min Value", "Set Int Value To Min", OPCHK_IntSetValue, 0, 0, OPINV_IntSetMin, 0, 0, LA_ACTUATOR_SYSTEM);
  1681. laCreateOperatorType("LA_real_set_min", "Set Min Value", "Set Float Value To Min", OPCHK_FloatSetValue, 0, 0, OPINV_FloatSetMin, 0, 0, LA_ACTUATOR_SYSTEM);
  1682. laCreateOperatorType("LA_int_array_restore_default", "Restore Default Array/Value", "Restore Int Values To Default", OPCHK_IntArraySetValue, 0, 0, OPINV_IntArraySetDefault, 0, L'⭯', LA_ACTUATOR_SYSTEM);
  1683. laCreateOperatorType("LA_real_array_restore_default", "Restore Default Array/Value", "Restore Float Values To Default", OPCHK_FloatArraySetValue, 0, 0, OPINV_FloatArraySetDefault, 0, L'⭯', LA_ACTUATOR_SYSTEM);
  1684. laCreateOperatorType("LA_int_array_set_max", "Set Max Values", "Set Int Values To Max", OPCHK_IntArraySetValue, 0, 0, OPINV_IntArraySetMax, 0, 0, LA_ACTUATOR_SYSTEM);
  1685. laCreateOperatorType("LA_real_array_set_max", "Set Max Values", "Set Float Values To Max", OPCHK_FloatArraySetValue, 0, 0, OPINV_FloatArraySetMax, 0, 0, LA_ACTUATOR_SYSTEM);
  1686. laCreateOperatorType("LA_int_array_set_min", "Set Min Values", "Set Int Values To Min", OPCHK_IntArraySetValue, 0, 0, OPINV_IntArraySetMin, 0, 0, LA_ACTUATOR_SYSTEM);
  1687. laCreateOperatorType("LA_real_array_set_min", "Set Min Values", "Set Float Values To Min", OPCHK_FloatArraySetValue, 0, 0, OPINV_FloatArraySetMin, 0, 0, LA_ACTUATOR_SYSTEM);
  1688. laCreateOperatorType("LA_enum_restore_default", "Restore Default Value", "Restore enum value to default", OPCHK_EnumSetValue, 0, 0, OPINV_EnumSetDefault, 0, L'⭯', LA_ACTUATOR_SYSTEM);
  1689. laCreateOperatorType("LA_enum_array_restore_default", "Restore Default Array", "Restore enum array values to default", OPCHK_EnumArraySetValue, 0, 0, OPINV_EnumArraySetDefault, 0, L'⭯', LA_ACTUATOR_SYSTEM);
  1690. laCreateOperatorType("LA_string_set_default", "Set Default Value", "Set default string", OPCHK_StringSetValue, 0, 0, OPINV_StringSetDefault, 0, L'⭯', LA_ACTUATOR_SYSTEM);
  1691. laCreateOperatorType("LA_string_get_folder_path", "Get folder Path", "get folder path", OPCHK_StringSetValue, 0, 0, OPINV_StringGetFolderPath, OPMOD_StringGetFolderOrFilePath, L'📁', LA_ACTUATOR_SYSTEM);
  1692. laCreateOperatorType("LA_string_get_file_path", "Get folder Path", "get file path", OPCHK_StringSetValue, 0, 0, OPINV_StringGetFilePath, OPMOD_StringGetFolderOrFilePath, L'🖹', LA_ACTUATOR_SYSTEM);
  1693. laCreateOperatorType("LA_sub_put_data_block", "Put Data Block", "Put Pending Data Block Here",
  1694. OPCHK_SubPutDataBlock, 0, 0, OPINV_SubPutDataBlock, 0, L'🡮', LA_ACTUATOR_SYSTEM | LA_ACTUATOR_HIDDEN);
  1695. at = laCreateOperatorType("LA_sub_restore_data_block", "Put Data Block", "Put Pending Data Block Here",
  1696. OPCHK_SubRestoreDataBlock, 0, OPEXT_SubRestoreDataBlock, OPINV_SubRestoreDataBlock, 0, L'🔗', LA_ACTUATOR_SYSTEM);
  1697. at->UiDefine = laui_DataRestorePage;
  1698. laCreateOperatorType("LA_view_hyper_data", "View Hyper Data", "Show Properties Of Specific Data Block", OPCHK_IsHyper, 0, 0, OPINV_ViewHyperData, 0, L'🛈', LA_ACTUATOR_SYSTEM);
  1699. laCreateOperatorType("LA_file_dialog_up", "Up", "Select Upper Folder Level", OPCHK_IsFileBrowser, 0, 0, OPINV_FileBrowserUpLevel, 0, L'🢰', LA_ACTUATOR_SYSTEM | LA_ACTUATOR_HIDDEN);
  1700. at = laCreateOperatorType("LA_file_dialog", "File Dialog", "Do File Operations", 0, 0, OPEXT_FileBrowser, OPINV_FileBrowser, OPMOD_FileBrowser, L'🗐', LA_ACTUATOR_SYSTEM);
  1701. pc = laDefineOperatorProps(at, 2);
  1702. at->UiDefine = laui_FileBrowserFileList;
  1703. _LA_PROP_FILE_BROWSER = pc;
  1704. laAddStringProperty(pc, "path", "Path", "Directort Path", 0, 0, 0, "/", 0, offsetof(laFileBrowser, Path), 0, 0, laset_FileBrowserPath, 0, LA_UDF_LOCAL);
  1705. laAddStringProperty(pc, "file_name", "File Name", "File Name", 0, 0, 0, 0, 0, offsetof(laFileBrowser, FileName), 0, 0, 0, 0, LA_UDF_LOCAL);
  1706. laAddSubGroup(pc, "file_list", "File List", "List Of Files And Directories Under A Specific Path", "file_item",0,0,laui_FileBrowserFileItem, -1, 0, laget_FileBrowserActiveFile, 0, 0, 0, laset_FileBrowserSelectFile, offsetof(laFileBrowser, FileList), 0);
  1707. laAddSubGroup(pc, "disk_list", "Disk List", "List Of All Logical Drives (In Windows)", "disk_item",0, 0, 0, -offsetof(laFileBrowser, RootDisk), 0, 0, 0, 0, 0, laset_FileBrowserActiveDisk, offsetof(laFileBrowser, Disks), 0);
  1708. ep = laAddEnumProperty(pc, "select_what", "Select What", "Select folder or file", 0, 0, 0, 0, 0, offsetof(laFileBrowser, SelectFolder), 0, 0, 0, 0, 0, 0, 0, 0, 0,LA_READ_ONLY);{
  1709. laAddEnumItemAs(ep, "file", "File", "File", LA_FILE_SELECT_FILE, L'📁');
  1710. laAddEnumItemAs(ep, "folder", "Folder", "Folder", LA_FILE_SELECT_FOLDER, L'🖹');
  1711. }
  1712. laAddOperatorProperty(pc, "folder_up", "Up", "Select Upper Folder Level In File Browsers", "LA_file_dialog_up", L'🢰', 0);
  1713. p = laAddPropertyContainer("disk_item", "Disk Item", "A Logical Drive (In Windows)", 0, laui_FileBrowserDiskItem, 0, 0, 0, 0);{
  1714. laAddStringProperty(p, "id", "ID", "Disk Identifier", 0, 0, 0, 0, 0, 0, 0, laget_FileBrowserDiskID, 0, 0, 0);
  1715. laAddFloatProperty(p, "total_gb", "Total", "Disk Total Compacity In Gigabytes", 0, 0, "GB", 0, 0, 0, 0, 0, offsetof(laDiskItem, Total_GB), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,LA_READ_ONLY);
  1716. laAddFloatProperty(p, "free_gb", "Free", "Disk Free Space Size In Gigabytes", 0, 0, "GB", 0, 0, 0, 0, 0, offsetof(laDiskItem, Free_GB), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,LA_READ_ONLY);
  1717. }
  1718. p = laAddPropertyContainer("file_item", "File Item", "A File Item In A List", L'🖹', 0, 0, 0, 0, 0);{
  1719. laAddStringProperty(p, "name", "Name", "The Name Of The File (With Extension)", 0, 0, 0, 0, 0, offsetof(laFileItem, Name), 0, 0, 0, 0, LA_UDF_LOCAL);
  1720. laAddIntProperty(p, "is_folder", "Is Folder", "File Is A Folder Or Actual File", 0, 0, 0, 1, 0, 0, 0, 0, offsetof(laFileItem, IsFolder), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,LA_READ_ONLY);
  1721. laAddSubGroup(p, "time_modified", "Time Last Modified", "The Time When The File Was Last Modified", "time_info",0, 0, 0, offsetof(laFileItem, TimeModified), 0, 0, 0, 0, 0, 0, 0, LA_UDF_LOCAL);
  1722. laAddIntProperty(p, "size", "Size", "File Size In Bytes", 0, 0, "Bytes", 0, 0, 0, 0, 0, offsetof(laFileItem, Size), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,LA_READ_ONLY);
  1723. ep = laAddEnumProperty(p, "type", "Type", "General Type Of The File", 0, 0, 0, 0, 0, offsetof(laFileItem, Type), 0, 0, 0, 0, 0, 0, 0, 0, 0,LA_READ_ONLY);{
  1724. laAddEnumItemAs(ep, "unknown", "Unknown", "Unknown/Uncategorized File Type", LA_FILETYPE_UNKNOWN, L'🖹');
  1725. laAddEnumItemAs(ep, "udf", "UDF", "Uniform Data Format", LA_FILETYPE_UDF, L'📦');
  1726. laAddEnumItemAs(ep, "document", "Document", "Document File", LA_FILETYPE_DOCUMENT, L'🖹');
  1727. laAddEnumItemAs(ep, "image", "Image", "Image File", LA_FILETYPE_IMAGE, L'🖻');
  1728. laAddEnumItemAs(ep, "audio", "Audio", "Audio File", LA_FILETYPE_AUDIO, L'𝄞');
  1729. laAddEnumItemAs(ep, "video", "Video", "Video File", LA_FILETYPE_VIDEO, L'🎞');
  1730. laAddEnumItemAs(ep, "compressed", "Compressed", "Compressed File", LA_FILETYPE_COMPRESSED, L'🗜');
  1731. laAddEnumItemAs(ep, "font", "Font", "Font File", LA_FILETYPE_FONT, L'🗚');
  1732. laAddEnumItemAs(ep, "vector", "Vector", "Vector File", LA_FILETYPE_VECTOR, L'🞎');
  1733. laAddEnumItemAs(ep, "webpage", "Webpage", "Webpage", LA_FILETYPE_WEBPAGE, L'🌐');
  1734. laAddEnumItemAs(ep, "meta", "Meta Data", "Meta Data Package", LA_FILETYPE_META, L'🖹');
  1735. laAddEnumItemAs(ep, "blend", "Blend", "Blend File", LA_FILETYPE_BLEND, L'🖹');
  1736. laAddEnumItemAs(ep, "pdf", "PDF", "PDF File", LA_FILETYPE_PDF, L'🖹');
  1737. laAddEnumItemAs(ep, "exe", "Executable", "Window Executable", LA_FILETYPE_EXEC, L'🖦');
  1738. laAddEnumItemAs(ep, "sys", "System", "System Files", LA_FILETYPE_SYS, L'🖹');
  1739. laAddEnumItemAs(ep, "folder", "Folder", "Folder", LA_FILETYPE_FOLDER, L'📁');
  1740. laAddEnumItemAs(ep, "lasdexchange", "LaSDExchange", "LA Scene Descriptive Exchange File", LA_FILETYPE_LASDEXCHANGE, 0);
  1741. }
  1742. }
  1743. at = laCreateOperatorType("LA_udf_read", "Read", "Read a UDF file", 0, 0, OPEXT_UDFOperation, OPINV_UDFAppend, OPMOD_UDFAppend, L'📑', LA_ACTUATOR_SYSTEM);
  1744. pc = laDefineOperatorProps(at, 0);
  1745. at->UiDefine = laui_LinkerPanel;
  1746. laAddSubGroup(pc, "root_nodes", "UDF Nodes", "List Of All Linkable/Appendable Nodes In The File", "udf_content_node",0, 0, laui_LinkerSelectionProp, -1, 0, 0, 0, 0, 0, 0, offsetof(laUDFPreviewExtra, ContentNodes), 0);
  1747. at = laCreateOperatorType("LA_udf_save_instance", "Save Instance", "Save a instance as a UDF block", 0, 0, OPEXT_UDFOperation, OPINV_UDFSaveInstance, OPMOD_UDFSaveInstance, L'📑', LA_ACTUATOR_SYSTEM);
  1748. at = laCreateOperatorType("LA_managed_save", "Managed Save", "Save managed data blocks", 0, 0, OPEXT_ManagedSave, OPINV_ManagedSave, OPMOD_ManagedSave, L'🖫', LA_ACTUATOR_SYSTEM);
  1749. pc = laDefineOperatorProps(at, 1);
  1750. ep=laAddEnumProperty(pc, "show_page", "Show Page", "Show whether data blocks or UDF files", 0,0,0,0,0,offsetof(laManagedSaveExtra, ShowPage),0,laset_ManagedSavePage,0,0,0,0,0,0,0,0);
  1751. laAddEnumItemAs(ep, "DATA_BLOCKS", "Data Blocks", "All data blocks", 0, 0);
  1752. laAddEnumItemAs(ep, "FILES", "Files", "All Files", 1, 0);
  1753. at->UiDefine = laui_ManagedSavePanel;
  1754. laCreateOperatorType("LA_udf_propagate", "Propagate", "Propagate this file to all unassigned child nodes", 0, 0, 0, OPINV_UDFPropagate, 0, 0, LA_ACTUATOR_SYSTEM);
  1755. laCreateOperatorType("LA_managed_save_new_file", "New File", "New managed UDF file", 0, 0, OPEXT_ManagedSave, OPINV_ManagedSaveNewFile, OPMOD_ManagedSaveNewFile, L'+', LA_ACTUATOR_SYSTEM);
  1756. laCreateOperatorType("LA_manage_udf", "UDF Manager", "Operations on all managed UDF files", 0, 0, 0, OPINV_UDFManager, 0, L'🔍', LA_ACTUATOR_SYSTEM);
  1757. laCreateOperatorType("LA_add_resource_folder", "Add Resource Folder", "Add a resource folder entry for searching UDF references",
  1758. 0, 0, 0, OPINV_AddResourceFolder, 0, L'🞧', LA_ACTUATOR_SYSTEM);
  1759. laCreateOperatorType("LA_remove_resource_folder", "Remove Resource Folder", "Remove a resource folder entry",
  1760. 0, 0, 0, OPINV_RemoveResourceFolder, 0, L'❌', LA_ACTUATOR_SYSTEM);
  1761. laCreateOperatorType("LA_save_user_preferences", "Save Preferences", "Save user preferences", 0, 0, 0, OPINV_SaveUserPreferences, 0, 0, LA_ACTUATOR_SYSTEM);
  1762. laCreateOperatorType("LA_confirm", "Confirm", "Confirm The Statement", 0, 0, 0, OPINV_DoNothing, 0, L'✔', LA_ACTUATOR_SYSTEM)
  1763. ->ExtraInstructions = "feedback=CONFIRM;";
  1764. laCreateOperatorType("LA_cancel", "Cancel", "Ignore The Statement", 0, 0, 0, OPINV_DoNothing, 0, L'❌', LA_ACTUATOR_SYSTEM)
  1765. ->ExtraInstructions = "feedback=CANCEL;";
  1766. laCreateOperatorType("LA_pure_yes_no", "Yes Or No", "Show Yes Or No Box", 0, 0, 0, OPINV_PureYesNo, 0, L'❓', LA_ACTUATOR_SYSTEM);
  1767. laCreateOperatorType("LA_delete_theme", "Delete Theme", "Delete a theme",
  1768. 0, 0, 0, OPINV_DeleteTheme, 0, L'❌', LA_ACTUATOR_SYSTEM);
  1769. }