Hint added.
[AROS.git] / workbench / prefs / appearance / appearanceeditor.c
blob17a1da49266619dfe67e13317dd37919621b37cd
1 /*
2 Copyright © 2013, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #define DEBUG 0
7 #include <aros/debug.h>
9 #define MUIMASTER_YES_INLINE_STDARG
11 #include <zune/customclasses.h>
12 #include <zune/prefseditor.h>
14 #include <proto/exec.h>
15 #include <proto/dos.h>
16 #include <proto/intuition.h>
17 #include <proto/muimaster.h>
19 #include <proto/alib.h>
21 #include <libraries/mui.h>
23 #include <stdlib.h>
24 #include <stdio.h>
26 #include "locale.h"
27 #include "appearanceeditor.h"
28 #include "themepreview.h"
30 /*** Instance Data **********************************************************/
32 struct AppearanceEditor_DATA
34 Object *ae_ThemePreview;
35 Object *ae_ThemeEnable;
36 Object *ae_ThemeChoice;
37 Object *ae_OptionZune;
38 #if (0)
39 Object *ae_OptionWand;
40 #endif
42 Object *ae_CompEnable;
43 Object *ae_CompBelow;
44 Object *ae_CompLeft;
45 Object *ae_CompRight;
46 Object *ae_CompAlpha;
48 IPTR *ae_ThemeArray;
49 struct Hook ae_PreviewHook;
52 static STRPTR THEMES_DEFAULT;
53 static STRPTR THEMES_AMIGAOS = "AmigaOS3.x";
54 static CONST_STRPTR THEMES_BASE = "THEMES:";
55 static CONST_STRPTR THEMES_ENVPATH = "SYS/theme.var";
56 static CONST_STRPTR COMPOSITE_ENVPATH = "SYS/compositor.prefs";
57 static CONST_STRPTR THEMES_DEFPATH = "SYS:Prefs/Presets/theme.default";
58 static CONST_STRPTR THEMES_OPTZUNEPATH = "Zune/usethemeprefs";
60 #define COMPOSITE_PEFSTEMPLATE "ABOVE/S,BELOW/S,LEFT/S,RIGHT/S,ALPHA/S"
62 enum
64 ARG_ABOVE = 0,
65 ARG_BELOW,
66 ARG_LEFT,
67 ARG_RIGHT,
68 ARG_ALPHA,
69 NOOFARGS
72 /*** Macros *****************************************************************/
73 #define SETUP_INST_DATA struct AppearanceEditor_DATA *data = INST_DATA(CLASS, self)
75 static IPTR AppearanceEditor__ListToArray(struct List *ThemeList)
77 int ThemeCount = 0, i = 0;
78 IPTR *ThemeArray = NULL;
79 struct Node *ThemeEntry, *TmpNode;
81 D(bug("[AppearanceEditor] %s()\n", __PRETTY_FUNCTION__));
83 ForeachNode(ThemeList, ThemeEntry)
85 ThemeCount++;
88 ThemeArray = AllocVec(sizeof(IPTR) * (ThemeCount + 1), MEMF_CLEAR);
89 D(bug("[AppearanceEditor] %s: Array for %d Entries @ 0x%p\n", __PRETTY_FUNCTION__, ThemeCount, ThemeArray));
91 ForeachNodeSafe(ThemeList, ThemeEntry, TmpNode)
93 Remove(ThemeEntry);
94 D(bug("[AppearanceEditor] %s: %02d: %s\n", __PRETTY_FUNCTION__, i, ThemeEntry->ln_Name));
95 ThemeArray[i++] = (IPTR)ThemeEntry->ln_Name;
96 FreeVec(ThemeEntry);
99 return (IPTR)ThemeArray;
102 AROS_UFH3(static void, AppearanceEditor__PreviewHookFunc,
103 AROS_UFHA(struct Hook *, h, A0),
104 AROS_UFHA(Object *, self, A2),
105 AROS_UFHA(APTR, msg, A1))
107 AROS_USERFUNC_INIT
108 struct AppearanceEditor_DATA *data = h->h_Data;
109 BOOL themeEnable, compEnable;
110 D(bug("[AppearanceEditor] %s()\n", __PRETTY_FUNCTION__));
112 themeEnable = (BOOL)XGET(data->ae_ThemeEnable, MUIA_Selected);
113 SET(data->ae_ThemeChoice, MUIA_Disabled, !(themeEnable));
114 SET(data->ae_OptionZune, MUIA_Disabled, !(themeEnable));
115 #if (0)
116 SET(data->ae_OptionWand, MUIA_Disabled, !(themeEnable));
117 #endif
119 compEnable = (BOOL)XGET(data->ae_CompEnable, MUIA_Selected);
120 SET(data->ae_CompBelow, MUIA_Disabled, !(compEnable));
121 SET(data->ae_CompLeft, MUIA_Disabled, !(compEnable));
122 SET(data->ae_CompRight, MUIA_Disabled, !(compEnable));
123 SET(data->ae_CompAlpha, MUIA_Disabled, !(compEnable));
125 SET(self, MUIA_PrefsEditor_Changed, TRUE);
127 AROS_USERFUNC_EXIT
130 Object *AppearanceEditor__Checkmark(BOOL selected)
132 Object *obj = MUI_MakeObject(MUIO_Checkmark, (IPTR)NULL);
134 if (obj)
136 SET(obj, MUIA_CycleChain, 1);
137 SET(obj, MUIA_Selected, selected);
139 return obj;
142 #define kExallBufSize (4096)
144 /*** Methods ****************************************************************/
145 Object *AppearanceEditor__OM_NEW(Class *CLASS, Object *self, struct opSet *message)
147 CONST_STRPTR tab_labels[3];
148 UBYTE *ExAllBuffer = NULL;
149 BOOL ExAllMore;
151 Object *_ThemePreviewObj;
152 Object *_ThemeEnable;
153 Object *_ThemeSelectionObj;
154 #if (0)
155 Object *_ThemeWandPrefsObj;
156 #endif
157 Object *_ThemeZunePrefsObj;
158 Object *_CompEnable;
159 Object *_CompBelow;
160 Object *_CompLeft;
161 Object *_CompRight;
162 Object *_CompAlpha;
164 struct List _ThemesAvailable;
165 struct Node *_ThemeEntry;
166 IPTR _ThemeArray = (IPTR)NULL;
168 BPTR _ThemeLock = BNULL;
170 D(bug("[AppearanceEditor] %s()\n", __PRETTY_FUNCTION__));
172 NewList(&_ThemesAvailable);
174 tab_labels[0] = "Theme'ing";
175 tab_labels[1] = "Compositing";
176 tab_labels[2] = NULL;
178 // Find Available Themes ...
179 if ((ExAllBuffer = AllocVec(kExallBufSize, MEMF_CLEAR|MEMF_PUBLIC)) != NULL)
181 if (GetVar(THEMES_DEFPATH, ExAllBuffer, kExallBufSize, GVF_GLOBAL_ONLY) == -1)
182 THEMES_DEFAULT = THEMES_AMIGAOS;
183 else
185 THEMES_DEFAULT = AllocVec(strlen(ExAllBuffer) + 1, MEMF_CLEAR);
186 CopyMem(ExAllBuffer, (APTR)THEMES_DEFAULT, strlen(ExAllBuffer));
189 if ((_ThemeLock = Lock(THEMES_BASE, SHARED_LOCK)) != BNULL)
191 struct ExAllControl *eac;
192 if ((eac = AllocDosObject(DOS_EXALLCONTROL,NULL)) != NULL)
194 struct ExAllData *ead = (struct ExAllData*)ExAllBuffer;
195 eac->eac_LastKey = 0;
196 do {
197 ExAllMore = ExAll(_ThemeLock, ead, kExallBufSize, ED_COMMENT, eac);
198 if ((!ExAllMore) && (IoErr() != ERROR_NO_MORE_ENTRIES)) {
199 break;
201 if (eac->eac_Entries == 0) {
202 continue;
204 ead = (struct ExAllData *)ExAllBuffer;
205 do {
206 if (ead->ed_Type == ST_USERDIR)
208 _ThemeEntry = AllocVec(sizeof(struct Node), MEMF_CLEAR);
209 _ThemeEntry->ln_Name = StrDup(ead->ed_Name);
210 AddTail(&_ThemesAvailable, _ThemeEntry);
212 ead = ead->ed_Next;
213 } while (ead);
214 } while (ExAllMore);
215 FreeDosObject(DOS_EXALLCONTROL, eac);
217 FreeVec(ExAllBuffer);
218 UnLock(_ThemeLock);
220 else
222 //TODO: Display a warning about missing themes: assign
225 else
227 // Catastrophic failure - not enough memory to allocate exall buffer =S
228 return (Object *)NULL;
231 _ThemeArray = AppearanceEditor__ListToArray(&_ThemesAvailable);
233 self = (Object *) DoSuperNewTags
235 CLASS, self, NULL,
236 MUIA_PrefsEditor_Name, (IPTR)_(MSG_WINTITLE),
237 MUIA_PrefsEditor_Path, (IPTR) THEMES_ENVPATH,
238 MUIA_PrefsEditor_IconTool, (IPTR) "SYS:Prefs/Theme",
240 Child, (IPTR)VGroup,
241 Child, (IPTR)(_ThemePreviewObj = ThemePreviewObject,
242 End),
243 Child, (IPTR)RegisterGroup(tab_labels),
244 MUIA_Register_Frame, TRUE,
245 Child, (IPTR)VGroup,
246 Child, (IPTR)HGroup,
247 Child, (IPTR)HVSpace,
248 Child, (IPTR)ColGroup(2),
249 MUIA_Group_SameWidth, FALSE,
250 Child, (IPTR)Label1(_(MSG_ENABLETHEMES)),
251 Child, (IPTR)HGroup,
252 Child, (IPTR)(_ThemeEnable = (Object *)AppearanceEditor__Checkmark(TRUE)),
253 Child, (IPTR)HVSpace,
254 End,
255 Child, (IPTR)HVSpace,
256 Child, (IPTR)RectangleObject,
257 MUIA_Background, MUII_FILL,
258 MUIA_FixHeight, 2,
259 End,
260 Child, (IPTR)Label1(_(MSG_SELECTEDTHEME)),
261 Child, (IPTR)(_ThemeSelectionObj = (Object *)CycleObject,
262 MUIA_CycleChain, 1,
263 MUIA_Cycle_Entries, (IPTR)_ThemeArray,
264 End),
265 Child, (IPTR)Label1(_(MSG_ENABLEZUNEPREFS)),
266 Child, (IPTR)HGroup,
267 Child, (IPTR)(_ThemeZunePrefsObj = (Object *)AppearanceEditor__Checkmark(TRUE)),
268 Child, (IPTR)HVSpace,
269 End,
270 #if (0)
271 Child, (IPTR)Label1(_(MSG_ENABLEWANDPREFS)),
272 Child, (IPTR)HGroup,
273 Child, (IPTR)(_ThemeWandPrefsObj = (Object *)AppearanceEditor__Checkmark(TRUE)),
274 Child, (IPTR)HVSpace,
275 End,
276 #endif
277 End,
278 Child, (IPTR)HVSpace,
279 End,
280 End,
281 Child, (IPTR)VGroup,
282 Child, (IPTR)HGroup,
283 Child, (IPTR)HVSpace,
284 Child, (IPTR)ColGroup(2),
285 MUIA_Group_SameWidth, FALSE,
286 Child, (IPTR)Label1("Enable Screen Composition"),
287 Child, (IPTR)HGroup,
288 Child, (IPTR)(_CompEnable = (Object *)AppearanceEditor__Checkmark(TRUE)),
289 Child, (IPTR)HVSpace,
290 End,
291 Child, (IPTR)Label1("Composite Below"),
292 Child, (IPTR)HGroup,
293 Child, (IPTR)(_CompBelow = (Object *)AppearanceEditor__Checkmark(FALSE)),
294 Child, (IPTR)HVSpace,
295 End,
296 Child, (IPTR)Label1("Composite Left"),
297 Child, (IPTR)HGroup,
298 Child, (IPTR)(_CompLeft = (Object *)AppearanceEditor__Checkmark(FALSE)),
299 Child, (IPTR)HVSpace,
300 End,
301 Child, (IPTR)Label1("Composite Right"),
302 Child, (IPTR)HGroup,
303 Child, (IPTR)(_CompRight = (Object *)AppearanceEditor__Checkmark(FALSE)),
304 Child, (IPTR)HVSpace,
305 End,
306 Child, (IPTR)HVSpace,
307 Child, (IPTR)RectangleObject,
308 MUIA_Background, MUII_FILL,
309 MUIA_FixHeight, 2,
310 End,
311 Child, (IPTR)Label1("Enable Compositing with Alpha"),
312 Child, (IPTR)HGroup,
313 Child, (IPTR)(_CompAlpha = (Object *)AppearanceEditor__Checkmark(FALSE)),
314 Child, (IPTR)HVSpace,
315 End,
316 End,
317 Child, (IPTR)HVSpace,
318 End,
319 Child, (IPTR)HVSpace,
320 End,
321 End,
322 End,
324 TAG_DONE
327 if (self)
329 SETUP_INST_DATA;
331 data->ae_ThemePreview = _ThemePreviewObj;
332 data->ae_ThemeEnable = _ThemeEnable;
333 data->ae_ThemeChoice = _ThemeSelectionObj;
334 data->ae_OptionZune = _ThemeZunePrefsObj;
335 #if (0)
336 data->ae_OptionWand = _ThemeWandPrefsObj;
337 #endif
339 data->ae_CompEnable = _CompEnable;
340 data->ae_CompBelow = _CompBelow;
341 data->ae_CompLeft = _CompLeft;
342 data->ae_CompRight = _CompRight;
343 data->ae_CompAlpha = _CompAlpha;
345 data->ae_ThemeArray = (IPTR *)_ThemeArray;
347 data->ae_PreviewHook.h_Entry = (HOOKFUNC)AppearanceEditor__PreviewHookFunc;
348 data->ae_PreviewHook.h_Data = data;
350 DoMethod
352 data->ae_ThemeEnable, MUIM_Notify, MUIA_Selected, MUIV_EveryTime,
353 (IPTR) self, 3, MUIM_CallHook, (IPTR)&data->ae_PreviewHook, (IPTR)NULL
356 DoMethod
358 data->ae_ThemeChoice, MUIM_Notify, MUIA_Cycle_Active, MUIV_EveryTime,
359 (IPTR) self, 3, MUIM_CallHook, (IPTR)&data->ae_PreviewHook, (IPTR)NULL
362 DoMethod
364 data->ae_OptionZune, MUIM_Notify, MUIA_Selected, MUIV_EveryTime,
365 (IPTR) self, 3, MUIM_CallHook, (IPTR)&data->ae_PreviewHook, (IPTR)NULL
367 #if (0)
368 DoMethod
370 data->ae_OptionWand, MUIM_Notify, MUIA_Selected, MUIV_EveryTime,
371 (IPTR) self, 3, MUIM_CallHook, (IPTR)&data->ae_PreviewHook, (IPTR)NULL
373 #endif
375 DoMethod
377 data->ae_CompEnable, MUIM_Notify, MUIA_Selected, MUIV_EveryTime,
378 (IPTR) self, 3, MUIM_CallHook, (IPTR)&data->ae_PreviewHook, (IPTR)NULL
381 DoMethod
383 data->ae_CompBelow, MUIM_Notify, MUIA_Selected, MUIV_EveryTime,
384 (IPTR) self, 3, MUIM_CallHook, (IPTR)&data->ae_PreviewHook, (IPTR)NULL
387 DoMethod
389 data->ae_CompLeft, MUIM_Notify, MUIA_Selected, MUIV_EveryTime,
390 (IPTR) self, 3, MUIM_CallHook, (IPTR)&data->ae_PreviewHook, (IPTR)NULL
393 DoMethod
395 data->ae_CompRight, MUIM_Notify, MUIA_Selected, MUIV_EveryTime,
396 (IPTR) self, 3, MUIM_CallHook, (IPTR)&data->ae_PreviewHook, (IPTR)NULL
399 DoMethod
401 data->ae_CompAlpha, MUIM_Notify, MUIA_Selected, MUIV_EveryTime,
402 (IPTR) self, 3, MUIM_CallHook, (IPTR)&data->ae_PreviewHook, (IPTR)NULL
406 return self;
409 IPTR AppearanceEditor__OM_DISPOSE(Class *CLASS, Object *self, struct opSet *message)
411 SETUP_INST_DATA;
412 int index = 0;
414 D(bug("[AppearanceEditor] %s()\n", __PRETTY_FUNCTION__));
416 while (data->ae_ThemeArray[index] != (IPTR)NULL)
418 D(bug("[AppearanceEditor] %s: Freeing %02d: %s\n", __PRETTY_FUNCTION__, index, data->ae_ThemeArray[index]));
419 FreeVec((APTR)data->ae_ThemeArray[index]);
420 index++;
422 FreeVec((APTR)data->ae_ThemeArray);
424 if (THEMES_DEFAULT != THEMES_AMIGAOS)
425 FreeVec(THEMES_DEFAULT);
427 return DoSuperMethodA(CLASS, self, message);
430 IPTR AppearanceEditor__MUIM_PrefsEditor_Import
432 Class *CLASS, Object *self,
433 struct MUIP_PrefsEditor_Import *message
436 SETUP_INST_DATA;
437 BOOL success = TRUE;
438 BPTR fh;
440 D(bug("[AppearanceEditor] %s()\n", __PRETTY_FUNCTION__));
442 if ((fh = Open(message->filename, MODE_OLDFILE)) != BNULL)
444 NNSET(data->ae_ThemeEnable, MUIA_Selected, TRUE);
445 SET(data->ae_ThemeChoice, MUIA_Disabled, FALSE);
446 SET(data->ae_OptionZune, MUIA_Disabled, FALSE);
447 #if (0)
448 SET(data->ae_OptionWand, MUIA_Disabled, FALSE);
449 #endif
450 success = DoMethod(self, MUIM_PrefsEditor_ImportFH, (IPTR) fh);
451 Close(fh);
453 else
455 NNSET(data->ae_ThemeEnable, MUIA_Selected, FALSE);
456 SET(data->ae_ThemeChoice, MUIA_Disabled, TRUE);
457 SET(data->ae_OptionZune, MUIA_Disabled, TRUE);
458 #if (0)
459 SET(data->ae_OptionWand, MUIA_Disabled, TRUE);
460 #endif
461 success = DoMethod(self, MUIM_PrefsEditor_ImportFH, NULL);
464 return success;
467 IPTR AppearanceEditor__MUIM_PrefsEditor_ImportFH (
468 Class *CLASS, Object *self,
469 struct MUIP_PrefsEditor_ImportFH *message
472 SETUP_INST_DATA;
473 BOOL success = TRUE, optzune = TRUE;
474 TEXT importBuffer[1024];
475 int index = 0;
477 D(bug("[AppearanceEditor] %s(FH@ 0x%p)\n", __PRETTY_FUNCTION__, message->fh));
479 if (message->fh)
481 if (FGets(message->fh, importBuffer, 1024))
483 char *tmpThemeFile = FilePart(importBuffer);
485 D(bug("[AppearanceEditor] %s: Prefs Theme = '%s'\n", __PRETTY_FUNCTION__, tmpThemeFile));
487 while (data->ae_ThemeArray[index] != (IPTR)NULL)
489 if (strncmp((char *)data->ae_ThemeArray[index], tmpThemeFile, strlen((char *)data->ae_ThemeArray[index])) == 0)
491 NNSET(data->ae_ThemeChoice, MUIA_Cycle_Active, index);
492 break;
494 index++;
497 if (GetVar(THEMES_OPTZUNEPATH, importBuffer, 1, GVF_GLOBAL_ONLY) == -1)
498 optzune = FALSE;
500 NNSET(data->ae_OptionZune, MUIA_Selected, optzune);
503 if (GetVar(COMPOSITE_ENVPATH, importBuffer, 1024, GVF_GLOBAL_ONLY) != -1)
505 struct RDArgs *rdargs;
506 IPTR CompArgs[NOOFARGS] = { 0 };
508 if ((rdargs = AllocDosObjectTags(DOS_RDARGS, TAG_END)) != NULL)
510 rdargs->RDA_Source.CS_Buffer = importBuffer;
511 rdargs->RDA_Source.CS_Length = strlen(rdargs->RDA_Source.CS_Buffer);
512 rdargs->RDA_DAList = (IPTR)NULL;
513 rdargs->RDA_Buffer = NULL;
514 rdargs->RDA_BufSiz = 0;
515 rdargs->RDA_ExtHelp = NULL;
516 rdargs->RDA_Flags = 0;
518 if (ReadArgs(COMPOSITE_PEFSTEMPLATE, CompArgs, rdargs) != NULL)
520 NNSET(data->ae_CompEnable, MUIA_Selected, (BOOL)CompArgs[ARG_ABOVE]);
521 NNSET(data->ae_CompBelow, MUIA_Selected, (BOOL)CompArgs[ARG_BELOW]);
522 NNSET(data->ae_CompLeft, MUIA_Selected, (BOOL)CompArgs[ARG_LEFT]);
523 NNSET(data->ae_CompRight, MUIA_Selected, (BOOL)CompArgs[ARG_RIGHT]);
524 NNSET(data->ae_CompAlpha, MUIA_Selected, (BOOL)CompArgs[ARG_ALPHA]);
525 FreeArgs(rdargs);
527 FreeDosObject(DOS_RDARGS, rdargs);
530 return success;
533 IPTR AppearanceEditor__MUIM_PrefsEditor_Export
535 Class *CLASS, Object *self,
536 struct MUIP_PrefsEditor_Export *message
539 SETUP_INST_DATA;
540 BOOL success = TRUE;
542 D(bug("[AppearanceEditor] %s()\n", __PRETTY_FUNCTION__));
544 if (XGET(data->ae_ThemeEnable, MUIA_Selected))
546 success = DoSuperMethodA(CLASS, self, message);
548 else
550 DeleteVar(THEMES_ENVPATH, GVF_GLOBAL_ONLY);
551 success = DoMethod(self, MUIM_PrefsEditor_ExportFH, NULL);
554 return success;
557 IPTR AppearanceEditor__MUIM_PrefsEditor_ExportFH
559 Class *CLASS, Object *self,
560 struct MUIP_PrefsEditor_ExportFH *message
563 SETUP_INST_DATA;
564 BOOL success = TRUE;
565 char *exportBuffer;
566 IPTR active = 0;
568 D(bug("[AppearanceEditor] %s(FH@ 0x%p)\n", __PRETTY_FUNCTION__, message->fh));
570 if ((exportBuffer = AllocVec(1024, MEMF_CLEAR)) != NULL)
572 if (message->fh)
574 GET(data->ae_ThemeChoice, MUIA_Cycle_Active, &active);
575 D(bug("[AppearanceEditor] %s: Selected Theme = [%02d] '%s'\n", __PRETTY_FUNCTION__, active, data->ae_ThemeArray[active]));
577 sprintf(exportBuffer, "%s%s", THEMES_BASE, (char *)data->ae_ThemeArray[active]);
579 if (FPuts(message->fh, exportBuffer))
580 success = FALSE;
582 if (XGET(data->ae_OptionZune, MUIA_Selected))
584 sprintf(exportBuffer, "True");
585 SetVar(THEMES_OPTZUNEPATH, exportBuffer, 4,GVF_GLOBAL_ONLY);
587 else
589 DeleteVar(THEMES_OPTZUNEPATH, GVF_GLOBAL_ONLY);
591 // TODO: Signal Decoration to relaod the theme
593 if (XGET(data->ae_CompEnable, MUIA_Selected))
595 int ebPos;
597 sprintf(exportBuffer, "ABOVE");
598 ebPos = strlen(exportBuffer);
599 if (XGET(data->ae_CompBelow, MUIA_Selected))
601 sprintf(exportBuffer + ebPos, " BELOW");
602 ebPos = strlen(exportBuffer);
604 if (XGET(data->ae_CompLeft, MUIA_Selected))
606 sprintf(exportBuffer + ebPos, " LEFT");
607 ebPos = strlen(exportBuffer);
609 if (XGET(data->ae_CompRight, MUIA_Selected))
611 sprintf(exportBuffer + ebPos, " RIGHT");
612 ebPos = strlen(exportBuffer);
614 if (XGET(data->ae_CompAlpha, MUIA_Selected))
616 sprintf(exportBuffer + ebPos, " ALPHA");
617 ebPos = strlen(exportBuffer);
619 SetVar(COMPOSITE_ENVPATH, exportBuffer, ebPos,GVF_GLOBAL_ONLY);
621 else
623 DeleteVar(COMPOSITE_ENVPATH, GVF_GLOBAL_ONLY);
626 FreeVec(exportBuffer);
627 return success;
630 IPTR AppearanceEditor__MUIM_PrefsEditor_SetDefaults
632 Class *CLASS, Object *self, Msg message
635 SETUP_INST_DATA;
636 int index = 0;
638 D(bug("[AppearanceEditor] %s()\n", __PRETTY_FUNCTION__));
640 // Theme options
641 while (data->ae_ThemeArray[index] != (IPTR)NULL)
643 if (!strcmp((char *)data->ae_ThemeArray[index], THEMES_DEFAULT))
645 SET(data->ae_ThemeChoice, MUIA_Cycle_Active, index);
646 break;
648 index++;
650 SET(data->ae_OptionZune, MUIA_Selected, TRUE);
651 #if (0)
652 SET(data->ae_OptionWand, MUIA_Selected, TRUE);
653 #endif
655 // Compositor options
656 SET(data->ae_CompEnable, MUIA_Selected, TRUE);
657 SET(data->ae_CompBelow, MUIA_Selected, FALSE);
658 SET(data->ae_CompLeft, MUIA_Selected, FALSE);
659 SET(data->ae_CompRight, MUIA_Selected, FALSE);
660 SET(data->ae_CompAlpha, MUIA_Selected, TRUE);
662 return TRUE;
665 /*** Setup ******************************************************************/
666 ZUNE_CUSTOMCLASS_7
668 AppearanceEditor, NULL, MUIC_PrefsEditor, NULL,
669 OM_NEW, struct opSet *,
670 OM_DISPOSE, struct opSet *,
671 MUIM_PrefsEditor_Import, struct MUIP_PrefsEditor_Import *,
672 MUIM_PrefsEditor_ImportFH, struct MUIP_PrefsEditor_ImportFH *,
673 MUIM_PrefsEditor_Export, struct MUIP_PrefsEditor_Export *,
674 MUIM_PrefsEditor_ExportFH, struct MUIP_PrefsEditor_ExportFH *,
675 MUIM_PrefsEditor_SetDefaults, Msg