7 GetDictObject(WMPropList
* dictKey
, WMPropList
* valKey
)
9 WMPropList
* dict
= NULL
;
10 WMPropList
* val
= NULL
;
12 if(dictKey
&& WMIsPLString(dictKey
))
14 dict
= WMGetFromPLDictionary(filesDB
, dictKey
);
15 if(dict
&& WMIsPLDictionary(dict
))
17 if(valKey
&& WMIsPLString(valKey
))
19 val
= WMGetFromPLDictionary(dict
, valKey
);
32 GetCmdForExtn(char *extn
, char *cmd
)
34 WMPropList
* dictKey
= WMCreatePLString(extn
);
35 WMPropList
* cmdKey
= WMCreatePLString(cmd
);
36 WMPropList
* val
= NULL
;
39 val
= GetDictObject(dictKey
, cmdKey
);
42 WMReleasePropList(dictKey
);
44 WMReleasePropList(cmdKey
);
50 GetExecStringForExtn(char *extn
)
52 WMPropList
* val
= NULL
;
54 val
= GetCmdForExtn(extn
, "exec");
57 return WMGetFromPLString(val
);
63 GetViewerStringForExtn(char *extn
)
65 WMPropList
* val
= NULL
;
67 val
= GetCmdForExtn(extn
, "viewer");
70 return WMGetFromPLString(val
);
76 GetEditorStringForExtn(char *extn
)
78 WMPropList
* val
= NULL
;
80 val
= GetCmdForExtn(extn
, "editor");
83 return WMGetFromPLString(val
);
89 GetIconStringForExtn(char *extn
)
91 WMPropList
* val
= NULL
;
93 val
= GetCmdForExtn(extn
, "icon");
96 return WMGetFromPLString(val
);
102 FSRemoveArrayElement(WMPropList
* array
, WMPropList
* val
)
105 Bool notFound
= True
;
107 if (array
&& WMIsPLArray(array
))
109 for(i
= 0; i
< WMGetPropListItemCount(array
); i
++)
111 if(WMIsPropListEqualTo(val
, WMGetFromPLArray(array
, i
)))
113 WMDeleteFromPLArray(array
, i
);
114 WMReleasePropList(val
);
124 FSGetIntegerForName(char *name
)
126 return WMGetUDIntegerForKey(defaultsDB
, name
);
130 FSSetIntegerForName(char *name
, int val
)
132 WMSetUDIntegerForKey(defaultsDB
, val
, name
);
136 FSSetStringForName(char *name
, char *str
)
138 WMSetUDStringForKey(defaultsDB
, str
, name
);
142 FSGetStringForName(char *name
)
146 str
= WMGetUDStringForKey(defaultsDB
, name
);
155 FSGetStringForNameKey(char *name
, char *key
)
157 WMPropList
* val
= NULL
;
158 WMPropList
* dict
= NULL
;
160 dict
= FSGetUDObjectForKey(defaultsDB
, name
);
161 val
= FSGetDBObjectForKey(dict
, key
);
166 if (!WMIsPLString(val
))
169 return wstrdup(WMGetFromPLString(val
));
173 FSGetDBObjectForKey(WMPropList
* dict
, char *key
)
175 WMPropList
* val
= NULL
;
176 WMPropList
* valKey
= WMCreatePLString(key
);
178 if(dict
&& WMIsPLDictionary(dict
))
180 val
= WMGetFromPLDictionary(dict
, valKey
);
182 WMReleasePropList(valKey
);
188 FSSetStringForNameKey(char *name
, char *dictKey
, char *str
)
190 WMPropList
* val
= NULL
;
191 WMPropList
* key
= NULL
;
192 WMPropList
* dict
= NULL
;
194 val
= WMCreatePLString(str
);
195 key
= WMCreatePLString(dictKey
);
197 dict
= FSGetUDObjectForKey(defaultsDB
, name
);
199 WMPutInPLDictionary(dict
, key
, val
);
201 dict
= WMCreatePLDictionary(key
, val
, NULL
);
203 WMSetUDObjectForKey(defaultsDB
, dict
, name
);
207 FSGetArrayForNameKey(char *name
, char *key
)
209 WMPropList
* val
= NULL
;
210 WMPropList
* dict
= NULL
;
212 dict
= FSGetUDObjectForKey(defaultsDB
, name
);
213 val
= FSGetDBObjectForKey(dict
, key
);
218 if (!WMIsPLArray(val
))
225 InsertArrayElement(WMPropList
* array
, WMPropList
* val
)
228 Bool notFound
= True
;
230 if (array
&& WMIsPLArray(array
))
232 for(i
= 0; i
< WMGetPropListItemCount(array
); i
++)
234 if(WMIsPropListEqualTo(val
, WMGetFromPLArray(array
, i
)))
241 WMAddToPLArray(array
, val
);
244 array
= WMCreatePLArray(val
, NULL
);
250 FSGetUDObjectForKey(WMUserDefaults
*database
, char *defaultName
)
252 WMPropList
* origObj
= NULL
;
253 WMPropList
* copyObj
= NULL
;
255 origObj
= WMGetUDObjectForKey(database
, defaultName
);
257 copyObj
= WMDeepCopyPropList(origObj
);
263 InitFilesDB(FSViewer
*fsViewer
)
265 WMPropList
* key
= NULL
;
266 WMPropList
* val
= NULL
;
267 WMPropList
* dict
= NULL
;
268 WMPropList
* array
= NULL
;
271 WMSetUDStringForKey(defaultsDB
, "FSViewer", "App");
273 key
= WMCreatePLString("icon");
274 val
= WMCreatePLString("mycomputer");
275 dict
= WMCreatePLDictionary(key
, val
, NULL
);
276 WMSetUDObjectForKey(defaultsDB
, dict
, "ROOT");
278 WMReleasePropList(key
);
279 WMReleasePropList(val
);
280 WMReleasePropList(dict
);
282 /* Default Folder setting */
283 WMSetUDStringForKey(defaultsDB
, "folder", "DIRECTORY");
285 Default Icon Directory
286 This is one of the place where the app looks for
287 icons. Check config.h for value.
289 WMSetUDStringForKey(defaultsDB
, ICONDIR
, "ICONDIR");
290 /* Default File setting */
291 WMSetUDStringForKey(defaultsDB
, "file-plain", "DEFAULT_IMG");
293 WMSetUDStringForKey(defaultsDB
, "home", "HOME");
296 array
= WMCreatePLArray(WMCreatePLString(wgethomedir()),
298 WMSetUDObjectForKey(defaultsDB
, array
, "SHELF");
300 WMReleasePropList(array
);
302 /* CONSOLE setting */
303 key
= WMCreatePLString("exec");
304 val
= WMCreatePLString("xterm");
305 dict
= WMCreatePLDictionary(key
, val
, NULL
);
306 WMSetUDObjectForKey(defaultsDB
, dict
, "CONSOLE");
308 WMReleasePropList(key
);
309 WMReleasePropList(val
);
310 WMReleasePropList(dict
);
312 /* PROCRESS setting */
313 key
= WMCreatePLString("exec");
314 val
= WMCreatePLString("xterm -exec top");
315 dict
= WMCreatePLDictionary(key
, val
, NULL
);
316 WMSetUDObjectForKey(defaultsDB
, dict
, "PROCESS");
318 WMReleasePropList(key
);
319 WMReleasePropList(val
);
320 WMReleasePropList(dict
);
323 /* key = WMCreatePLString("devices"); */
324 val
= WMCreatePLArray( WMCreatePLString("CDROM"),
325 WMCreatePLString("/cdrom"),
326 WMCreatePLString("/dev/hdc"),
327 WMCreatePLString("mount %s"),
328 WMCreatePLString("umount %s"),
329 WMCreatePLString("eject %s"),
330 WMCreatePLString("close %s"),
332 array
= WMCreatePLArray( val
, NULL
);
333 WMSetUDObjectForKey(defaultsDB
, array
, "DISCS");
335 WMReleasePropList(array
);
336 WMReleasePropList(val
);
338 /* Magic File file */
339 WMSetUDStringForKey(defaultsDB
, "MagicFiles", "MAGICFILE");
342 key
= WMCreatePLString("exec");
343 val
= WMCreatePLString("xedit %s");
344 dict
= WMCreatePLDictionary(key
, val
, NULL
);
345 WMSetUDObjectForKey(defaultsDB
, dict
, "MAGICASCII");
347 WMReleasePropList(key
);
348 WMReleasePropList(val
);
349 WMReleasePropList(dict
);
351 /* Default Image Viewer */
352 key
= WMCreatePLString("exec");
353 val
= WMCreatePLString("xv %s");
354 dict
= WMCreatePLDictionary(key
, val
, NULL
);
355 WMSetUDObjectForKey(defaultsDB
, dict
, "MAGICIMAGE");
357 WMReleasePropList(key
);
358 WMReleasePropList(val
);
359 WMReleasePropList(dict
);
361 /* Default Postscript Viewer */
362 key
= WMCreatePLString("exec");
363 val
= WMCreatePLString("ghostview %s");
364 dict
= WMCreatePLDictionary(key
, val
, NULL
);
365 WMSetUDObjectForKey(defaultsDB
, dict
, "MAGICPS");
367 WMReleasePropList(key
);
368 WMReleasePropList(val
);
369 WMReleasePropList(dict
);
371 WMSetUDIntegerForKey(defaultsDB
, 0, "DisplayDotFiles");
372 WMSetUDIntegerForKey(defaultsDB
, 0, "DisplayMCListPixmap");
373 WMSetUDIntegerForKey(defaultsDB
, 1, "DisplaySVBG");
374 WMSetUDIntegerForKey(defaultsDB
, 0, "SortOrder");
375 WMSetUDIntegerForKey(defaultsDB
, 0, "SortDisplay");
376 WMSetUDIntegerForKey(defaultsDB
, 169, "ColumnWidth");
377 WMSetUDIntegerForKey(defaultsDB
, 164, "XPOS");
378 WMSetUDIntegerForKey(defaultsDB
, 164, "YPOS");
379 WMSetUDIntegerForKey(defaultsDB
, 520, "WSIZE");
380 WMSetUDIntegerForKey(defaultsDB
, 390, "HSIZE");
384 array
= WMCreatePLArray( WMCreatePLString("xemacs"),
385 WMCreatePLString("netscape"),
386 WMCreatePLString("xv"),
387 WMCreatePLString("gimp"),
388 WMCreatePLString("xedit"),
390 WMSetUDObjectForKey(defaultsDB
, array
, "EXE");
391 WMReleasePropList(array
);
394 array
= WMCreatePLArray( WMCreatePLString(".bmp"),
395 WMCreatePLString(".bz2"),
396 WMCreatePLString(".c"),
397 WMCreatePLString(".cgi"),
398 WMCreatePLString(".class"),
399 WMCreatePLString(".core"),
400 WMCreatePLString(".csh"),
401 WMCreatePLString(".dat"),
402 WMCreatePLString(".gif"),
403 WMCreatePLString(".gz"),
404 WMCreatePLString(".h"),
405 WMCreatePLString(".java"),
406 WMCreatePLString(".jpg"),
407 WMCreatePLString(".mp3"),
408 WMCreatePLString(".o"),
409 WMCreatePLString(".phtml"),
410 WMCreatePLString(".pl"),
411 WMCreatePLString(".png"),
412 WMCreatePLString(".rpm"),
413 WMCreatePLString(".sh"),
414 WMCreatePLString(".shtml"),
415 WMCreatePLString(".tgz"),
416 WMCreatePLString(".tif"),
417 WMCreatePLString(".txt"),
418 WMCreatePLString(".xbm"),
419 WMCreatePLString(".xcf"),
420 WMCreatePLString(".xpm"),
421 WMCreatePLString(".zip"),
422 WMCreatePLString(".html"),
424 WMSetUDObjectForKey(defaultsDB
, array
, "EXTN");
425 WMReleasePropList(array
);
427 /* Netscape Settings */
428 key
= WMCreatePLString("exec");
429 val
= WMCreatePLString("netscape %s");
430 dict
= WMCreatePLDictionary(key
, val
, NULL
);
432 WMReleasePropList(key
);
433 WMReleasePropList(val
);
435 key
= WMCreatePLString("extn");
436 array
= WMCreatePLArray( WMCreatePLString(".html"),
437 WMCreatePLString(".shtml"),
438 WMCreatePLString(".phtml"),
440 WMPutInPLDictionary(dict
, key
, array
);
442 WMReleasePropList(key
);
443 WMReleasePropList(array
);
445 key
= WMCreatePLString("icon");
446 val
= WMCreatePLString("netscape");
447 WMPutInPLDictionary(dict
, key
, val
);
449 WMSetUDObjectForKey(defaultsDB
, dict
, "netscape");
451 WMReleasePropList(key
);
452 WMReleasePropList(val
);
453 WMReleasePropList(dict
);
456 key
= WMCreatePLString("viewer");
457 val
= WMCreatePLString("netscape %s");
458 dict
= WMCreatePLDictionary(key
, val
, NULL
);
460 WMReleasePropList(key
);
461 WMReleasePropList(val
);
463 key
= WMCreatePLString("editor");
464 val
= WMCreatePLString("xemacs %s");
465 WMPutInPLDictionary(dict
, key
, val
);
467 WMReleasePropList(key
);
468 WMReleasePropList(val
);
470 key
= WMCreatePLString("icon");
471 val
= WMCreatePLString("file-dot-html");
472 WMPutInPLDictionary(dict
, key
, val
);
473 WMSetUDObjectForKey(defaultsDB
, dict
, ".html");
475 WMReleasePropList(key
);
476 WMReleasePropList(val
);
477 WMReleasePropList(dict
);
479 /* .shtml settings */
480 key
= WMCreatePLString("viewer");
481 val
= WMCreatePLString("netscape %s");
482 dict
= WMCreatePLDictionary(key
, val
, NULL
);
484 WMReleasePropList(key
);
485 WMReleasePropList(val
);
487 key
= WMCreatePLString("editor");
488 val
= WMCreatePLString("xemacs %s");
489 WMPutInPLDictionary(dict
, key
, val
);
491 WMReleasePropList(key
);
492 WMReleasePropList(val
);
494 key
= WMCreatePLString("icon");
495 val
= WMCreatePLString("file-dot-html");
496 WMPutInPLDictionary(dict
, key
, val
);
497 WMSetUDObjectForKey(defaultsDB
, dict
, ".shtml");
499 WMReleasePropList(key
);
500 WMReleasePropList(val
);
501 WMReleasePropList(dict
);
503 /* .phtml settings */
504 key
= WMCreatePLString("viewer");
505 val
= WMCreatePLString("netscape %s");
506 dict
= WMCreatePLDictionary(key
, val
, NULL
);
508 WMReleasePropList(key
);
509 WMReleasePropList(val
);
511 key
= WMCreatePLString("editor");
512 val
= WMCreatePLString("xemacs %s");
513 WMPutInPLDictionary(dict
, key
, val
);
515 WMReleasePropList(key
);
516 WMReleasePropList(val
);
518 key
= WMCreatePLString("icon");
519 val
= WMCreatePLString("file-dot-html");
520 WMPutInPLDictionary(dict
, key
, val
);
521 WMSetUDObjectForKey(defaultsDB
, dict
, ".phtml");
523 WMReleasePropList(key
);
524 WMReleasePropList(val
);
525 WMReleasePropList(dict
);
528 key
= WMCreatePLString("viewer");
529 val
= WMCreatePLString("netscape %s");
530 dict
= WMCreatePLDictionary(key
, val
, NULL
);
532 WMReleasePropList(key
);
533 WMReleasePropList(val
);
535 key
= WMCreatePLString("editor");
536 val
= WMCreatePLString("xemacs %s");
537 WMPutInPLDictionary(dict
, key
, val
);
539 WMReleasePropList(key
);
540 WMReleasePropList(val
);
542 key
= WMCreatePLString("icon");
543 val
= WMCreatePLString("file-dot-html");
544 WMPutInPLDictionary(dict
, key
, val
);
545 WMSetUDObjectForKey(defaultsDB
, dict
, ".htm");
547 WMReleasePropList(key
);
548 WMReleasePropList(val
);
549 WMReleasePropList(dict
);
551 /* XEmacs Settings */
552 key
= WMCreatePLString("exec");
553 val
= WMCreatePLString("xemacs %s");
554 dict
= WMCreatePLDictionary(key
, val
, NULL
);
556 WMReleasePropList(key
);
557 WMReleasePropList(val
);
559 key
= WMCreatePLString("extn");
560 array
= WMCreatePLArray( WMCreatePLString(".html"),
561 WMCreatePLString(".shtml"),
562 WMCreatePLString(".phtml"),
563 WMCreatePLString(".pl"),
564 WMCreatePLString(".txt"),
565 WMCreatePLString(".java"),
566 WMCreatePLString(".cgi"),
567 WMCreatePLString(".sh"),
568 WMCreatePLString(".csh"),
569 WMCreatePLString(".dat"),
570 WMCreatePLString(".c"),
571 WMCreatePLString(".h"),
573 WMPutInPLDictionary(dict
, key
, array
);
575 WMReleasePropList(key
);
576 WMReleasePropList(array
);
578 key
= WMCreatePLString("icon");
579 val
= WMCreatePLString("xemacs");
580 WMPutInPLDictionary(dict
, key
, val
);
582 WMSetUDObjectForKey(defaultsDB
, dict
, "xemacs");
584 WMReleasePropList(key
);
585 WMReleasePropList(val
);
586 WMReleasePropList(dict
);
589 key
= WMCreatePLString("viewer");
590 val
= WMCreatePLString("xedit %s");
591 dict
= WMCreatePLDictionary(key
, val
, NULL
);
593 WMReleasePropList(key
);
594 WMReleasePropList(val
);
596 key
= WMCreatePLString("editor");
597 val
= WMCreatePLString("xedit %s");
598 WMPutInPLDictionary(dict
, key
, val
);
600 WMReleasePropList(key
);
601 WMReleasePropList(val
);
603 key
= WMCreatePLString("icon");
604 val
= WMCreatePLString("file-dot-txt");
605 WMPutInPLDictionary(dict
, key
, val
);
606 WMSetUDObjectForKey(defaultsDB
, dict
, ".txt");
608 WMReleasePropList(key
);
609 WMReleasePropList(val
);
610 WMReleasePropList(dict
);
613 key
= WMCreatePLString("viewer");
614 val
= WMCreatePLString("xedit %s");
615 dict
= WMCreatePLDictionary(key
, val
, NULL
);
617 WMReleasePropList(key
);
618 WMReleasePropList(val
);
620 key
= WMCreatePLString("editor");
621 val
= WMCreatePLString("xemacs %s");
622 WMPutInPLDictionary(dict
, key
, val
);
624 WMReleasePropList(key
);
625 WMReleasePropList(val
);
627 key
= WMCreatePLString("icon");
628 val
= WMCreatePLString("file-executable");
629 WMPutInPLDictionary(dict
, key
, val
);
630 WMSetUDObjectForKey(defaultsDB
, dict
, ".cgi");
632 WMReleasePropList(key
);
633 WMReleasePropList(val
);
634 WMReleasePropList(dict
);
637 key
= WMCreatePLString("viewer");
638 val
= WMCreatePLString("xemacs %s");
639 dict
= WMCreatePLDictionary(key
, val
, NULL
);
641 WMReleasePropList(key
);
642 WMReleasePropList(val
);
644 key
= WMCreatePLString("editor");
645 val
= WMCreatePLString("xemacs %s");
646 WMPutInPLDictionary(dict
, key
, val
);
648 WMReleasePropList(key
);
649 WMReleasePropList(val
);
651 key
= WMCreatePLString("icon");
652 val
= WMCreatePLString("file-dot-h");
653 WMPutInPLDictionary(dict
, key
, val
);
654 WMSetUDObjectForKey(defaultsDB
, dict
, ".h");
656 WMReleasePropList(key
);
657 WMReleasePropList(val
);
658 WMReleasePropList(dict
);
661 key
= WMCreatePLString("icon");
662 val
= WMCreatePLString("file-dot-o");
663 dict
= WMCreatePLDictionary(key
, val
, NULL
);
664 WMSetUDObjectForKey(defaultsDB
, dict
, ".o");
666 WMReleasePropList(key
);
667 WMReleasePropList(val
);
668 WMReleasePropList(dict
);
671 key
= WMCreatePLString("icon");
672 val
= WMCreatePLString("file-dot-java");
673 dict
= WMCreatePLDictionary(key
, val
, NULL
);
675 WMReleasePropList(key
);
676 WMReleasePropList(val
);
678 key
= WMCreatePLString("editor");
679 val
= WMCreatePLString("xemacs %s");
680 WMPutInPLDictionary(dict
, key
, val
);
682 WMReleasePropList(key
);
683 WMReleasePropList(val
);
685 key
= WMCreatePLString("viewer");
686 val
= WMCreatePLString("xemacs %s");
687 WMPutInPLDictionary(dict
, key
, val
);
688 WMSetUDObjectForKey(defaultsDB
, dict
, ".java");
690 WMReleasePropList(key
);
691 WMReleasePropList(val
);
692 WMReleasePropList(dict
);
694 /* .class settings */
695 key
= WMCreatePLString("icon");
696 val
= WMCreatePLString("file-dot-class");
697 dict
= WMCreatePLDictionary(key
, val
, NULL
);
698 WMSetUDObjectForKey(defaultsDB
, dict
, ".class");
700 WMReleasePropList(key
);
701 WMReleasePropList(val
);
702 WMReleasePropList(dict
);
705 key
= WMCreatePLString("icon");
706 val
= WMCreatePLString("file-dot-gz");
707 dict
= WMCreatePLDictionary(key
, val
, NULL
);
708 WMSetUDObjectForKey(defaultsDB
, dict
, ".gz");
710 WMReleasePropList(key
);
711 WMReleasePropList(val
);
712 WMReleasePropList(dict
);
715 key
= WMCreatePLString("icon");
716 val
= WMCreatePLString("file-dot-gz");
717 dict
= WMCreatePLDictionary(key
, val
, NULL
);
718 WMSetUDObjectForKey(defaultsDB
, dict
, ".tgz");
720 WMReleasePropList(key
);
721 WMReleasePropList(val
);
722 WMReleasePropList(dict
);
724 /* .tar.gz settings */
725 key
= WMCreatePLString("icon");
726 val
= WMCreatePLString("file-dot-gz");
727 dict
= WMCreatePLDictionary(key
, val
, NULL
);
728 WMSetUDObjectForKey(defaultsDB
, dict
, ".tar.gz");
730 WMReleasePropList(key
);
731 WMReleasePropList(val
);
732 WMReleasePropList(dict
);
735 key
= WMCreatePLString("icon");
736 val
= WMCreatePLString("file-dot-bz2");
737 dict
= WMCreatePLDictionary(key
, val
, NULL
);
738 WMSetUDObjectForKey(defaultsDB
, dict
, ".bz2");
740 WMReleasePropList(key
);
741 WMReleasePropList(val
);
742 WMReleasePropList(dict
);
745 key
= WMCreatePLString("icon");
746 val
= WMCreatePLString("file-dot-rpm");
747 dict
= WMCreatePLDictionary(key
, val
, NULL
);
748 WMSetUDObjectForKey(defaultsDB
, dict
, ".rpm");
750 WMReleasePropList(key
);
751 WMReleasePropList(val
);
752 WMReleasePropList(dict
);
755 key
= WMCreatePLString("icon");
756 val
= WMCreatePLString("file-dot-png");
757 dict
= WMCreatePLDictionary(key
, val
, NULL
);
758 WMSetUDObjectForKey(defaultsDB
, dict
, ".png");
760 WMReleasePropList(key
);
761 WMReleasePropList(val
);
762 WMReleasePropList(dict
);
765 /* Phew, 'z' at last! */
766 key
= WMCreatePLString("icon");
767 val
= WMCreatePLString("file-dot-zip");
768 dict
= WMCreatePLDictionary(key
, val
, NULL
);
769 WMSetUDObjectForKey(defaultsDB
, dict
, ".zip");
771 WMReleasePropList(key
);
772 WMReleasePropList(val
);
773 WMReleasePropList(dict
);
776 /* When did 't' start coming after 'z'??? */
777 key
= WMCreatePLString("icon");
778 val
= WMCreatePLString("file-dot-tif");
779 dict
= WMCreatePLDictionary(key
, val
, NULL
);
781 WMReleasePropList(key
);
782 WMReleasePropList(val
);
784 key
= WMCreatePLString("editor");
785 val
= WMCreatePLString("gimp %s");
786 WMPutInPLDictionary(dict
, key
, val
);
788 WMReleasePropList(key
);
789 WMReleasePropList(val
);
791 key
= WMCreatePLString("viewer");
792 val
= WMCreatePLString("xv %s");
793 WMPutInPLDictionary(dict
, key
, val
);
794 WMSetUDObjectForKey(defaultsDB
, dict
, ".tif");
796 WMReleasePropList(key
);
797 WMReleasePropList(val
);
798 WMReleasePropList(dict
);
801 key
= WMCreatePLString("icon");
802 val
= WMCreatePLString("file-dot-xpm");
803 dict
= WMCreatePLDictionary(key
, val
, NULL
);
805 WMReleasePropList(key
);
806 WMReleasePropList(val
);
808 key
= WMCreatePLString("editor");
809 val
= WMCreatePLString("gimp %s");
810 WMPutInPLDictionary(dict
, key
, val
);
812 WMReleasePropList(key
);
813 WMReleasePropList(val
);
815 key
= WMCreatePLString("viewer");
816 val
= WMCreatePLString("xv %s");
817 WMPutInPLDictionary(dict
, key
, val
);
818 WMSetUDObjectForKey(defaultsDB
, dict
, ".xpm");
820 WMReleasePropList(key
);
821 WMReleasePropList(val
);
822 WMReleasePropList(dict
);
825 key
= WMCreatePLString("icon");
826 val
= WMCreatePLString("file-dot-jpg");
827 dict
= WMCreatePLDictionary(key
, val
, NULL
);
829 WMReleasePropList(key
);
830 WMReleasePropList(val
);
832 key
= WMCreatePLString("editor");
833 val
= WMCreatePLString("gimp %s");
834 WMPutInPLDictionary(dict
, key
, val
);
836 WMReleasePropList(key
);
837 WMReleasePropList(val
);
839 key
= WMCreatePLString("viewer");
840 val
= WMCreatePLString("xv %s");
841 WMPutInPLDictionary(dict
, key
, val
);
842 WMSetUDObjectForKey(defaultsDB
, dict
, ".jpg");
844 WMReleasePropList(key
);
845 WMReleasePropList(val
);
846 WMReleasePropList(dict
);
849 key
= WMCreatePLString("icon");
850 val
= WMCreatePLString("file-dot-gif");
851 dict
= WMCreatePLDictionary(key
, val
, NULL
);
853 WMReleasePropList(key
);
854 WMReleasePropList(val
);
856 key
= WMCreatePLString("editor");
857 val
= WMCreatePLString("gimp %s");
858 WMPutInPLDictionary(dict
, key
, val
);
860 WMReleasePropList(key
);
861 WMReleasePropList(val
);
863 key
= WMCreatePLString("viewer");
864 val
= WMCreatePLString("xv %s");
865 WMPutInPLDictionary(dict
, key
, val
);
866 WMSetUDObjectForKey(defaultsDB
, dict
, ".gif");
868 WMReleasePropList(key
);
869 WMReleasePropList(val
);
870 WMReleasePropList(dict
);
873 key
= WMCreatePLString("icon");
874 val
= WMCreatePLString("file-dot-bmp");
875 dict
= WMCreatePLDictionary(key
, val
, NULL
);
877 WMReleasePropList(key
);
878 WMReleasePropList(val
);
880 key
= WMCreatePLString("editor");
881 val
= WMCreatePLString("gimp %s");
882 WMPutInPLDictionary(dict
, key
, val
);
884 WMReleasePropList(key
);
885 WMReleasePropList(val
);
887 key
= WMCreatePLString("viewer");
888 val
= WMCreatePLString("xv %s");
889 WMPutInPLDictionary(dict
, key
, val
);
890 WMSetUDObjectForKey(defaultsDB
, dict
, ".bmp");
892 WMReleasePropList(key
);
893 WMReleasePropList(val
);
894 WMReleasePropList(dict
);
897 key
= WMCreatePLString("icon");
898 val
= WMCreatePLString("file-dot-xbm");
899 dict
= WMCreatePLDictionary(key
, val
, NULL
);
901 WMReleasePropList(key
);
902 WMReleasePropList(val
);
904 key
= WMCreatePLString("editor");
905 val
= WMCreatePLString("gimp %s");
906 WMPutInPLDictionary(dict
, key
, val
);
908 WMReleasePropList(key
);
909 WMReleasePropList(val
);
911 key
= WMCreatePLString("viewer");
912 val
= WMCreatePLString("xv %s");
913 WMPutInPLDictionary(dict
, key
, val
);
914 WMSetUDObjectForKey(defaultsDB
, dict
, ".xbm");
916 WMReleasePropList(key
);
917 WMReleasePropList(val
);
918 WMReleasePropList(dict
);
921 key
= WMCreatePLString("icon");
922 val
= WMCreatePLString("file-dot-xpm");
923 dict
= WMCreatePLDictionary(key
, val
, NULL
);
925 WMReleasePropList(key
);
926 WMReleasePropList(val
);
928 key
= WMCreatePLString("editor");
929 val
= WMCreatePLString("gimp %s");
930 WMPutInPLDictionary(dict
, key
, val
);
932 WMReleasePropList(key
);
933 WMReleasePropList(val
);
935 key
= WMCreatePLString("viewer");
936 val
= WMCreatePLString("xv %s");
937 WMPutInPLDictionary(dict
, key
, val
);
938 WMSetUDObjectForKey(defaultsDB
, dict
, ".xpm");
940 WMReleasePropList(key
);
941 WMReleasePropList(val
);
942 WMReleasePropList(dict
);
945 key
= WMCreatePLString("icon");
946 val
= WMCreatePLString("file-dot-xcf");
947 dict
= WMCreatePLDictionary(key
, val
, NULL
);
949 WMReleasePropList(key
);
950 WMReleasePropList(val
);
952 key
= WMCreatePLString("editor");
953 val
= WMCreatePLString("gimp %s");
954 WMPutInPLDictionary(dict
, key
, val
);
956 WMReleasePropList(key
);
957 WMReleasePropList(val
);
959 key
= WMCreatePLString("viewer");
960 val
= WMCreatePLString("gimp %s");
961 WMPutInPLDictionary(dict
, key
, val
);
962 WMSetUDObjectForKey(defaultsDB
, dict
, ".xcf");
964 WMReleasePropList(key
);
965 WMReleasePropList(val
);
966 WMReleasePropList(dict
);
969 key
= WMCreatePLString("exec");
970 val
= WMCreatePLString("gimp %s");
971 dict
= WMCreatePLDictionary(key
, val
, NULL
);
973 WMReleasePropList(key
);
974 WMReleasePropList(val
);
976 key
= WMCreatePLString("extn");
977 array
= WMCreatePLArray( WMCreatePLString(".jpg"),
978 WMCreatePLString(".gif"),
979 WMCreatePLString(".bmp"),
980 WMCreatePLString(".xcf"),
981 WMCreatePLString(".xpm"),
982 WMCreatePLString(".xbm"),
983 WMCreatePLString(".png"),
985 WMPutInPLDictionary(dict
, key
, array
);
987 WMReleasePropList(key
);
988 WMReleasePropList(array
);
990 key
= WMCreatePLString("icon");
991 val
= WMCreatePLString("wilber");
992 WMPutInPLDictionary(dict
, key
, val
);
994 WMSetUDObjectForKey(defaultsDB
, dict
, "gimp");
996 WMReleasePropList(key
);
997 WMReleasePropList(val
);
998 WMReleasePropList(dict
);
1000 /* xedit Settings */
1001 key
= WMCreatePLString("exec");
1002 val
= WMCreatePLString("xedit %s");
1003 dict
= WMCreatePLDictionary(key
, val
, NULL
);
1005 WMReleasePropList(key
);
1006 WMReleasePropList(val
);
1008 key
= WMCreatePLString("extn");
1009 array
= WMCreatePLArray( WMCreatePLString(".txt"),
1010 WMCreatePLString(".dat"),
1012 WMPutInPLDictionary(dict
, key
, array
);
1014 WMReleasePropList(key
);
1015 WMReleasePropList(array
);
1017 key
= WMCreatePLString("icon");
1018 val
= WMCreatePLString("file-dot-txt");
1019 WMPutInPLDictionary(dict
, key
, val
);
1021 WMSetUDObjectForKey(defaultsDB
, dict
, "xedit");
1023 WMReleasePropList(key
);
1024 WMReleasePropList(val
);
1025 WMReleasePropList(dict
);
1028 key
= WMCreatePLString("icon");
1029 val
= WMCreatePLString("file-dot-dat");
1030 dict
= WMCreatePLDictionary(key
, val
, NULL
);
1032 WMReleasePropList(key
);
1033 WMReleasePropList(val
);
1035 key
= WMCreatePLString("editor");
1036 val
= WMCreatePLString("xemacs %s");
1037 WMPutInPLDictionary(dict
, key
, val
);
1039 WMReleasePropList(key
);
1040 WMReleasePropList(val
);
1042 key
= WMCreatePLString("viewer");
1043 val
= WMCreatePLString("xedit %s");
1044 WMPutInPLDictionary(dict
, key
, val
);
1045 WMSetUDObjectForKey(defaultsDB
, dict
, ".dat");
1047 WMReleasePropList(key
);
1048 WMReleasePropList(val
);
1049 WMReleasePropList(dict
);
1052 key
= WMCreatePLString("exec");
1053 val
= WMCreatePLString("xv %s");
1054 dict
= WMCreatePLDictionary(key
, val
, NULL
);
1056 WMReleasePropList(key
);
1057 WMReleasePropList(val
);
1059 key
= WMCreatePLString("extn");
1060 array
= WMCreatePLArray( WMCreatePLString(".jpg"),
1061 WMCreatePLString(".gif"),
1062 WMCreatePLString(".bmp"),
1063 WMCreatePLString(".xpm"),
1064 WMCreatePLString(".xbm"),
1066 WMPutInPLDictionary(dict
, key
, array
);
1068 WMReleasePropList(key
);
1069 WMReleasePropList(array
);
1071 key
= WMCreatePLString("icon");
1072 val
= WMCreatePLString("xv");
1073 WMPutInPLDictionary(dict
, key
, val
);
1075 WMSetUDObjectForKey(defaultsDB
, dict
, "xv");
1077 WMReleasePropList(key
);
1078 WMReleasePropList(val
);
1079 WMReleasePropList(dict
);
1082 key
= WMCreatePLString("icon");
1083 val
= WMCreatePLString("file-dot-mp3");
1084 dict
= WMCreatePLDictionary(key
, val
, NULL
);
1086 WMReleasePropList(key
);
1087 WMReleasePropList(val
);
1089 key
= WMCreatePLString("viewer");
1090 val
= WMCreatePLString("mpg123 %s");
1091 WMPutInPLDictionary(dict
, key
, val
);
1092 WMSetUDObjectForKey(defaultsDB
, dict
, ".mp3");
1094 WMReleasePropList(key
);
1095 WMReleasePropList(val
);
1096 WMReleasePropList(dict
);
1098 /* mpg123 Settings */
1099 key
= WMCreatePLString("exec");
1100 val
= WMCreatePLString("mpg123 %s");
1101 dict
= WMCreatePLDictionary(key
, val
, NULL
);
1103 WMReleasePropList(key
);
1104 WMReleasePropList(val
);
1106 key
= WMCreatePLString("extn");
1107 array
= WMCreatePLArray( WMCreatePLString(".mp3"),
1109 WMPutInPLDictionary(dict
, key
, array
);
1111 WMReleasePropList(key
);
1112 WMReleasePropList(array
);
1114 key
= WMCreatePLString("icon");
1115 val
= WMCreatePLString("file-dot-mp3");
1116 WMPutInPLDictionary(dict
, key
, val
);
1118 WMSetUDObjectForKey(defaultsDB
, dict
, "mp3");
1120 WMReleasePropList(key
);
1121 WMReleasePropList(val
);
1122 WMReleasePropList(dict
);
1125 key
= WMCreatePLString("icon");
1126 val
= WMCreatePLString("file-dot-sh");
1127 dict
= WMCreatePLDictionary(key
, val
, NULL
);
1128 WMSetUDObjectForKey(defaultsDB
, dict
, ".sh");
1130 WMReleasePropList(key
);
1131 WMReleasePropList(val
);
1132 WMReleasePropList(dict
);
1135 key
= WMCreatePLString("icon");
1136 val
= WMCreatePLString("file-dot-csh");
1137 dict
= WMCreatePLDictionary(key
, val
, NULL
);
1138 WMSetUDObjectForKey(defaultsDB
, dict
, ".csh");
1140 WMReleasePropList(key
);
1141 WMReleasePropList(val
);
1142 WMReleasePropList(dict
);
1144 /* .core settings */
1145 key
= WMCreatePLString("icon");
1146 val
= WMCreatePLString("file-dot-core");
1147 dict
= WMCreatePLDictionary(key
, val
, NULL
);
1148 WMSetUDObjectForKey(defaultsDB
, dict
, ".core");
1150 WMReleasePropList(key
);
1151 WMReleasePropList(val
);
1152 WMReleasePropList(dict
);
1155 key
= WMCreatePLString("icon");
1156 val
= WMCreatePLString("file-dot-c");
1157 dict
= WMCreatePLDictionary(key
, val
, NULL
);
1159 WMReleasePropList(key
);
1160 WMReleasePropList(val
);
1162 key
= WMCreatePLString("editor");
1163 val
= WMCreatePLString("xemacs %s");
1164 WMPutInPLDictionary(dict
, key
, val
);
1166 WMReleasePropList(key
);
1167 WMReleasePropList(val
);
1169 key
= WMCreatePLString("viewer");
1170 val
= WMCreatePLString("xemacs %s");
1171 WMPutInPLDictionary(dict
, key
, val
);
1172 WMSetUDObjectForKey(defaultsDB
, dict
, ".c");
1174 WMReleasePropList(key
);
1175 WMReleasePropList(val
);
1176 WMReleasePropList(dict
);
1178 /* ChangeLog settings */
1179 key
= WMCreatePLString("icon");
1180 val
= WMCreatePLString("file-dot-txt");
1181 dict
= WMCreatePLDictionary(key
, val
, NULL
);
1183 WMReleasePropList(key
);
1184 WMReleasePropList(val
);
1186 key
= WMCreatePLString("editor");
1187 val
= WMCreatePLString("xemacs %s");
1188 WMPutInPLDictionary(dict
, key
, val
);
1190 WMReleasePropList(key
);
1191 WMReleasePropList(val
);
1193 key
= WMCreatePLString("viewer");
1194 val
= WMCreatePLString("xemacs %s");
1195 WMPutInPLDictionary(dict
, key
, val
);
1196 WMSetUDObjectForKey(defaultsDB
, dict
, "ChangeLog");
1198 WMReleasePropList(key
);
1199 WMReleasePropList(val
);
1200 WMReleasePropList(dict
);
1203 key
= WMCreatePLString("icon");
1204 val
= WMCreatePLString("file-dot-pl");
1205 dict
= WMCreatePLDictionary(key
, val
, NULL
);
1207 WMReleasePropList(key
);
1208 WMReleasePropList(val
);
1210 key
= WMCreatePLString("editor");
1211 val
= WMCreatePLString("xemacs %s");
1212 WMPutInPLDictionary(dict
, key
, val
);
1214 WMReleasePropList(key
);
1215 WMReleasePropList(val
);
1217 key
= WMCreatePLString("viewer");
1218 val
= WMCreatePLString("xemacs %s");
1219 WMPutInPLDictionary(dict
, key
, val
);
1220 WMSetUDObjectForKey(defaultsDB
, dict
, ".pl");
1222 WMReleasePropList(key
);
1223 WMReleasePropList(val
);
1224 WMReleasePropList(dict
);
1226 WMSynchronizeUserDefaults(defaultsDB
);