Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / network / stacks / AROSTCP / MUI.MiamiPanel / Classes / muimiamipanel_class_app.c
blobb10aacc228dbffc26c74e799e72efd534c9d586e
2 #include <proto/intuition.h>
3 #include <proto/muimaster.h>
4 #include <proto/utility.h>
5 #include <proto/icon.h>
7 #include <libraries/mui.h>
8 #include <libraries/gadtools.h>
10 #include "muimiamipanel_intern.h"
11 #include "muimiamipanel_locale.h"
12 #include "muimiamipanel_misc.h"
13 #include "muimiamipanel_iffprefs.h"
14 #include "muimiamipanel_commands.h"
16 #include <mui/BWin_mcc.h>
17 #include <mui/TheBar_mcc.h>
19 #include "Classes/muimiamipanel_classes.h"
21 /***********************************************************************/
23 struct MiamiPanelAppClass_DATA
25 Object *win;
26 Object *root;
27 Object *about;
28 Object *wprefs;
29 Object *aboutMUI;
31 struct DiskObject *icon;
33 struct MPS_Prefs prefs;
36 /***********************************************************************/
38 static ULONG AppMenuIDs[] =
40 MSG_Menu_Project,
41 MSG_Menu_About,
42 MSG_Menu_AboutMUI,
44 MSG_Menu_Hide,
46 MSG_Menu_Quit,
48 MSG_Menu_Miami,
49 MSG_Menu_Miami_Show,
50 MSG_Menu_Miami_Hide,
52 MSG_Menu_Miami_Quit,
54 MSG_Menu_Prefs,
55 MSG_Menu_Edit,
56 MSG_Menu_Save,
57 MSG_Menu_Use,
58 MSG_Menu_Restore,
59 MSG_Menu_LastSaved,
61 MSG_Menu_MUI
64 static struct NewMenu appMenu[] =
66 MTITLE(MSG_Menu_Project),
67 MITEM(MSG_Menu_About),
68 MITEM(MSG_Menu_AboutMUI),
69 MBAR,
70 MITEM(MSG_Menu_Hide),
71 MBAR,
72 MITEM(MSG_Menu_Quit),
74 MTITLE(MSG_Menu_Miami),
75 MITEM(MSG_Menu_Miami_Show),
76 MITEM(MSG_Menu_Miami_Hide),
77 MBAR,
78 MITEM(MSG_Menu_Miami_Quit),
80 MTITLE(MSG_Menu_Prefs),
81 MITEM(MSG_Menu_Edit),
82 MITEM(MSG_Menu_Save),
83 MITEM(MSG_Menu_Use),
84 MITEM(MSG_Menu_Restore),
85 MITEM(MSG_Menu_LastSaved),
86 MBAR,
87 MITEM(MSG_Menu_MUI),
89 MEND
92 static UBYTE *usedClasses[] =
94 "Busy.mcc",
95 "Bwin.mcc",
96 "Lamp.mcc",
97 "TheBar.mcc",
98 "Urltext.mcc",
99 NULL
102 static struct MiamiPanelBase_intern *MiamiPanelBaseIntern;
104 IPTR MUIPC_App__OM_NEW
106 Class *CLASS, Object *self, struct opSet *message
109 struct MiamiPanelAppClass_DATA temp;
110 struct TagItem *attrs = message->ops_AttrList;
111 Object *strip;
113 memset(&temp,0,sizeof(temp));
115 if (!loadIFFPrefs(MPV_LoadPrefs_Env|MPV_LoadPrefs_FallBack, &temp.prefs, MiamiPanelBaseIntern))
117 temp.prefs.layout = DEF_Layout;
118 temp.prefs.flags = DEF_Flags;
119 temp.prefs.barLayout = DEF_TBLayout;
120 temp.prefs.viewMode = DEF_TBVMode;
121 temp.prefs.labelPos = DEF_TBLPos;
122 temp.prefs.btflags = DEF_TBFlags;
125 if (self = (Object *)DoSuperNewTags
127 CLASS, self, NULL,
129 MUIA_Application_Title, DEF_Base,
130 MUIA_Application_Author, DEF_Author,
131 /* MUIA_Application_Version, lib_vers, */
132 MUIA_Application_Copyright, __(MSG_Copyright),
133 MUIA_Application_Description, __(MSG_Description),
134 MUIA_Application_Base, DEF_Base,
135 MUIA_Application_HelpFile, DEF_Guide,
136 MUIA_Application_UseCommodities, FALSE,
137 MUIA_Application_SingleTask, TRUE,
138 MUIA_Application_Menustrip, strip = MUI_MakeObject(MUIO_MenustripNM, (ULONG)appMenu, MUIO_MenustripNM_CommandKeyCheck),
139 MUIA_Application_UsedClasses, usedClasses,
141 SubWindow, temp.win = (temp.prefs.flags & MPV_Flags_BWin) ?
142 (BWinObject,
143 MUIA_ObjectID, MAKE_ID('M','A','I','N'),
144 MUIA_Window_ID, MAKE_ID('M','A','I','N'),
145 MUIA_Window_Title, __(MSG_Window_Title),
146 MUIA_HelpNode, "GUI",
147 MUIA_BWin_Save, MUIV_BWin_Save_All,
148 MUIA_BWin_Borders, temp.prefs.flags & MPV_Flags_BWinBorders,
149 WindowContents, temp.root = VGroup,
150 InnerSpacing(0,0),
151 Child, (IPTR)NewObject(MiamiPanelBaseIntern->mpb_mgroupClass->mcc_Class, NULL ,
152 MPA_Prefs, &temp.prefs,
153 MPA_Show, GetTagData(MPA_Show, 0, message->ops_AttrList),
154 TAG_DONE),
155 End,
156 End) :
157 (WindowObject,
158 MUIA_ObjectID, MAKE_ID('M','A','I','N'),
159 MUIA_Window_ID, MAKE_ID('M','A','I','N'),
160 MUIA_HelpNode, "GUI",
161 MUIA_Window_Title, __(MSG_Window_Title),
162 MUIA_Window_UseRightBorderScroller, TRUE,
163 MUIA_Window_SizeRight, TRUE,
164 //MUIA_Window_Backdrop, TRUE,
166 WindowContents, temp.root = VGroup,
167 InnerSpacing(0,0),
168 Child, (IPTR)NewObject(MiamiPanelBaseIntern->mpb_mgroupClass->mcc_Class, NULL,
169 MPA_Prefs, &temp.prefs,
170 MPA_Show, GetTagData(MPA_Show, 0, message->ops_AttrList),
171 TAG_DONE),
172 End,
173 End),
174 TAG_MORE,attrs))
176 struct MiamiPanelAppClass_DATA *data = INST_DATA(CLASS,self);
178 /* Setup istance */
179 CopyMem(&temp,data,sizeof(struct MiamiPanelAppClass_DATA));
181 NEWLIST(&data->prefs.iflist);
182 moveMinList(&data->prefs.iflist, &temp.prefs.iflist, MiamiPanelBaseIntern);
184 if (data->icon = GetDiskObject(DEF_Icon))
185 SetSuperAttrs(CLASS, self, MUIA_Application_DiskObject,data->icon,TAG_DONE);
186 /* Load MUI preferences */
187 DoSuperMethod(CLASS,self,MUIM_Application_Load,(ULONG)MUIV_Application_Load_ENV);
189 /* Win notifies */
190 DoMethod(temp.win,MUIM_Notify,MUIA_Window_CloseRequest,MUIV_EveryTime,(ULONG)self,1,MPM_Quit);
192 /* Menus notifies */
193 DoMethod((Object *)DoMethod(strip,MUIM_FindUData,MSG_Menu_About),MUIM_Notify,
194 MUIA_Menuitem_Trigger,MUIV_EveryTime,(ULONG)self,1,MPM_About);
196 DoMethod((Object *)DoMethod(strip,MUIM_FindUData,MSG_Menu_AboutMUI),MUIM_Notify,
197 MUIA_Menuitem_Trigger,MUIV_EveryTime,(ULONG)self,2,MUIM_Application_AboutMUI,(ULONG)temp.win);
199 DoMethod((Object *)DoMethod(strip,MUIM_FindUData,MSG_Menu_Hide),MUIM_Notify,
200 MUIA_Menuitem_Trigger,MUIV_EveryTime,(ULONG)self,3,MUIM_Set,MUIA_Application_Iconified,TRUE);
202 DoMethod((Object *)DoMethod(strip,MUIM_FindUData,MSG_Menu_Quit),MUIM_Notify,
203 MUIA_Menuitem_Trigger,MUIV_EveryTime,(ULONG)self,1,MPM_Quit);
205 DoMethod((Object *)DoMethod(strip,MUIM_FindUData,MSG_Menu_Edit),MUIM_Notify,
206 MUIA_Menuitem_Trigger,MUIV_EveryTime,(ULONG)self,1,MPM_Prefs);
208 DoMethod((Object *)DoMethod(strip,MUIM_FindUData,MSG_Menu_MUI),MUIM_Notify,
209 MUIA_Menuitem_Trigger,MUIV_EveryTime,(ULONG)self,2,MUIM_Application_OpenConfigWindow,0);
211 DoMethod((Object *)DoMethod(strip,MUIM_FindUData,MSG_Menu_Save),MUIM_Notify,
212 MUIA_Menuitem_Trigger,MUIV_EveryTime,(ULONG)self,2,MPM_Save,TRUE);
214 DoMethod((Object *)DoMethod(strip,MUIM_FindUData,MSG_Menu_Use),MUIM_Notify,
215 MUIA_Menuitem_Trigger,MUIV_EveryTime,(ULONG)self,2,MPM_Save,FALSE);
217 DoMethod((Object *)DoMethod(strip,MUIM_FindUData,MSG_Menu_Restore),MUIM_Notify,
218 MUIA_Menuitem_Trigger,MUIV_EveryTime,(ULONG)self,2,MPM_Load,FALSE);
220 DoMethod((Object *)DoMethod(strip,MUIM_FindUData,MSG_Menu_LastSaved),MUIM_Notify,
221 MUIA_Menuitem_Trigger,MUIV_EveryTime,(ULONG)self,2,MPM_Load,TRUE);
223 DoMethod((Object *)DoMethod(strip,MUIM_FindUData,MSG_Menu_Miami_Show),MUIM_Notify,
224 MUIA_Menuitem_Trigger,MUIV_EveryTime,(ULONG)self,2,MPM_Miami,MPV_Miami_Show);
226 DoMethod((Object *)DoMethod(strip,MUIM_FindUData,MSG_Menu_Miami_Hide),MUIM_Notify,
227 MUIA_Menuitem_Trigger,MUIV_EveryTime,(ULONG)self,2,MPM_Miami,MPV_Miami_Hide);
229 DoMethod((Object *)DoMethod(strip,MUIM_FindUData,MSG_Menu_Miami_Quit),MUIM_Notify,
230 MUIA_Menuitem_Trigger,MUIV_EveryTime,(ULONG)self,2,MPM_Miami,MPV_Miami_Quit);
232 DoSuperMethod(CLASS,self,MUIM_Notify,MUIA_Application_MenuHelp,MUIV_EveryTime,MUIV_Notify_Self,
233 5,MUIM_Application_ShowHelp,(ULONG)temp.win,(ULONG)DEF_Guide,(ULONG)"Menus",0);
235 /* Set root preferences */
236 set(data->root,MPA_Prefs,&temp.prefs);
238 /* Try to open win */
239 if (!openWindow(self, temp.win, MiamiPanelBaseIntern))
241 CoerceMethod(CLASS, self, OM_DISPOSE);
242 self = NULL;
246 return (ULONG)self;
249 /***********************************************************************/
251 ULONG MUIPC_App__OM_DISPOSE
253 Class *CLASS, Object *self, Msg message
256 struct MiamiPanelAppClass_DATA *data = INST_DATA(CLASS,self);
258 freeIFList(&data->prefs, MiamiPanelBaseIntern);
259 if (data->icon) FreeDiskObject(data->icon);
261 return DoSuperMethodA(CLASS,self,message);
264 /***********************************************************************/
266 static ULONG MUIPC_App__OM_GET
268 Class *CLASS, Object *self, struct opGet *message
271 struct MiamiPanelAppClass_DATA *data = INST_DATA(CLASS,self);
273 switch (message->opg_AttrID)
275 case MPA_Prefs: *message->opg_Storage = (ULONG)&data->prefs; return TRUE;
276 default: return DoSuperMethodA(CLASS,self,(Msg)message);
280 /***********************************************************************/
282 static ULONG MUIPC_App__OM_SET
284 Class *CLASS, Object *self, struct opSet *message
287 struct MiamiPanelAppClass_DATA *data = INST_DATA(CLASS,self);
288 struct MPS_Prefs *prefs = NULL;
289 struct TagItem *tag, *ticonify = NULL; // gcc
290 struct TagItem *tstate;
291 ULONG close = FALSE, oneWay = FALSE, noIfList = FALSE;
293 for (tstate = message->ops_AttrList; tag = NextTagItem(&tstate); )
295 ULONG tidata = tag->ti_Data;
297 switch(tag->ti_Tag)
299 case MPA_OneWay:
300 oneWay = TRUE;
301 break;
303 case MPA_NoIfList:
304 noIfList = TRUE;
305 break;
307 case MPA_Prefs:
308 prefs = PREFS(tidata);
309 break;
311 case MUIA_Application_Iconified:
312 ticonify = tag;
313 close = tidata;
314 break;
316 case MPA_Bar:
317 set(data->root,MPA_Bar,tidata);
318 break;
322 if (prefs)
324 struct List *l;
325 Object *win;
326 Object *mstate;
327 ULONG bwin, bwinBorders;
329 bwin = prefs->flags & MPV_Flags_BWin;
330 bwinBorders = prefs->flags & MPV_Flags_BWinBorders;
332 if (!BOOLSAME(bwin,data->prefs.flags & MPV_Flags_BWin) || !BOOLSAME(bwinBorders,data->prefs.flags & MPV_Flags_BWinBorders))
334 set(data->win,MUIA_Window_Open,FALSE);
335 DoSuperMethod(CLASS,self,MUIM_Application_PushMethod,(ULONG)self,1,MPM_Rebuild);
338 freeIFList(&data->prefs, MiamiPanelBaseIntern);
339 CopyMem(prefs,&data->prefs,sizeof(data->prefs));
340 NEWLIST(&data->prefs.iflist);
341 if (noIfList) DoMethod(data->root,MPM_MGroup_GrabIFList);
342 else moveMinList(&data->prefs.iflist,&prefs->iflist, MiamiPanelBaseIntern);
344 for (get(self,MUIA_Application_WindowList,&l), mstate = (Object *)l->lh_Head; win = NextObject(&mstate); )
345 if (!oneWay || (win!=data->wprefs)) set(win,MPA_Prefs,&data->prefs);
347 set(data->root,MPA_Prefs,&data->prefs);
350 if (close && !(data->prefs.flags & MPV_Flags_Iconify))
352 ticonify->ti_Tag = TAG_IGNORE;
353 DoSuperMethod(CLASS,self,MUIM_Application_PushMethod,(ULONG)self,1,MPM_Quit);
356 return DoSuperMethodA(CLASS,self,(Msg)message);
359 /***********************************************************************/
361 static ULONG MUIPC_App__MUIM_Application_AboutMUI
363 Class *CLASS, Object *self, Msg message
366 struct MiamiPanelAppClass_DATA *data = INST_DATA(CLASS,self);
368 SetSuperAttrs(CLASS, self, MUIA_Application_Sleep, TRUE, TAG_DONE);
370 if (!data->aboutMUI)
372 if (data->aboutMUI = AboutmuiObject,
373 MUIA_Aboutmui_Application, self,
374 MUIA_Window_RefWindow, data->win,
375 MUIA_HelpNode, "MUI",
376 End)
377 DoMethod(data->aboutMUI,MUIM_Notify,MUIA_Window_CloseRequest,TRUE,(ULONG)self,5,
378 MUIM_Application_PushMethod,(ULONG)self,2,MPM_DisposeWin,(ULONG)data->aboutMUI);
381 openWindow(self, data->aboutMUI, MiamiPanelBaseIntern);
383 SetSuperAttrs(CLASS, self, MUIA_Application_Sleep, FALSE, TAG_DONE);
385 return 0;
388 /***********************************************************************/
390 static ULONG MUIPC_App__MUIM_Application_OpenConfigWindow
392 Class *CLASS, Object *self, Msg message
395 ULONG res;
397 SetSuperAttrs(CLASS, self, MUIA_Application_Sleep, TRUE, TAG_DONE);
398 res = DoSuperMethodA(CLASS,self,message);
399 SetSuperAttrs(CLASS, self, MUIA_Application_Sleep, FALSE, TAG_DONE);
401 return res;
404 /***********************************************************************/
406 static ULONG MUIPC_App__MPM_Rebuild
408 Class *CLASS, Object *self, Msg message
411 struct MiamiPanelAppClass_DATA *data = INST_DATA(CLASS,self);
412 Object *owin = data->win, *nwin, *sp = NULL; // gcc
413 ULONG bwin = data->prefs.flags & MPV_Flags_BWin;
414 ULONG res;
416 SetSuperAttrs(CLASS, self, MUIA_Application_Sleep, TRUE, TAG_DONE);
418 set(owin,MUIA_Window_Open,FALSE);
419 set(owin,WindowContents,NULL);
421 if (bwin)
422 nwin = BWinObject,
423 MUIA_ObjectID, MAKE_ID('M','A','I','N'),
424 MUIA_Window_ID, MAKE_ID('M','A','I','N'),
425 MUIA_Window_Title, __(MSG_Window_Title),
426 MUIA_HelpNode, "GUI",
427 MUIA_BWin_Save, MUIV_BWin_Save_All,
428 MUIA_BWin_Borders, data->prefs.flags & MPV_Flags_BWinBorders,
429 End;
430 else
431 nwin = WindowObject,
432 MUIA_ObjectID, MAKE_ID('M','A','I','N'),
433 MUIA_Window_ID, MAKE_ID('M','A','I','N'),
434 MUIA_HelpNode, "GUI",
435 MUIA_Window_Title, __(MSG_Window_Title),
436 MUIA_Window_UseRightBorderScroller, TRUE,
437 MUIA_Window_SizeRight, TRUE,
438 WindowContents, sp = HSpace(0),
439 End;
441 if (nwin)
443 DoSuperMethod(CLASS,self,OM_REMMEMBER,(ULONG)owin);
444 MUI_DisposeObject(owin);
445 DoSuperMethod(CLASS,self,OM_ADDMEMBER,(ULONG)(data->win = nwin));
446 DoMethod(nwin,MUIM_Notify,MUIA_Window_CloseRequest,MUIV_EveryTime,(ULONG)self,1,MPM_Quit);
447 res = TRUE;
448 if (!bwin)
450 set(nwin,WindowContents,NULL);
451 MUI_DisposeObject(sp);
454 else
456 if (bwin) data->prefs.flags &= ~MPV_Flags_BWin;
457 else data->prefs.flags |= MPV_Flags_BWin;
458 if (data->wprefs) set(data->wprefs,MPA_Prefs,&data->prefs);
459 res = FALSE;
463 set(data->win,WindowContents,data->root);
465 if (!openWindow(self, data->win, MiamiPanelBaseIntern)) DoSuperMethod(CLASS,self,MUIM_Application_PushMethod,(ULONG)self,1,MPM_Quit);
466 SetSuperAttrs(CLASS, self, MUIA_Application_Sleep, FALSE, TAG_DONE);
468 return res;
471 /***********************************************************************/
473 static ULONG MUIPC_App__MPM_Quit
475 Class *CLASS, Object *self, Msg message
478 struct MiamiPanelAppClass_DATA *data = INST_DATA(CLASS,self);
480 set(data->win,MUIA_Window_Open,FALSE);
481 if (data->about) set(data->about,MUIA_Window_Open,FALSE);
482 if (data->wprefs) set(data->wprefs,MUIA_Window_Open,FALSE);
484 MiamiPanelFun(MiamiPanelBaseIntern, MIAMIPANELV_CallBack_Code_ClosePanel);
486 return 0;
489 /***********************************************************************/
491 static ULONG
492 MUIPC_App__MPM_DisposeWin(struct IClass *CLASS,Object *self,struct MPP_DisposeWin *message)
494 struct MiamiPanelAppClass_DATA *data = INST_DATA(CLASS,self);
495 Object *win = message->win;
497 set(win,MUIA_Window_Open,FALSE);
498 DoSuperMethod(CLASS,self,OM_REMMEMBER,(ULONG)win);
499 MUI_DisposeObject(win);
501 if (win==data->about) data->about = NULL;
502 else if (win==data->wprefs) data->wprefs = NULL;
503 else if (win==data->aboutMUI) data->aboutMUI = NULL;
505 return 0;
508 /***********************************************************************/
510 static ULONG MUIPC_App__MPM_About
512 Class *CLASS, Object *self, Msg message
515 struct MiamiPanelAppClass_DATA *data = INST_DATA(CLASS,self);
517 SetSuperAttrs(CLASS, self, MUIA_Application_Sleep, TRUE, TAG_DONE);
519 if (!data->about)
521 ObtainSemaphore(&MiamiPanelBaseIntern->mpb_libSem);
523 if (MiamiPanelBaseIntern->mpb_aboutClass || MUIPC_About_ClassInit(MiamiPanelBaseIntern))
525 if (data->about = NewObject(MiamiPanelBaseIntern->mpb_aboutClass->mcc_Class,
526 NULL,
527 MPA_Application, self,
528 MUIA_Window_RefWindow, data->win,
529 TAG_DONE))
531 DoSuperMethod(CLASS,self,OM_ADDMEMBER,(ULONG)data->about);
533 DoMethod(data->about,MUIM_Notify,MUIA_Window_CloseRequest,TRUE,(ULONG)self,5,
534 MUIM_Application_PushMethod,(ULONG)self,2,MPM_DisposeWin,(ULONG)data->about);
538 ReleaseSemaphore(&MiamiPanelBaseIntern->mpb_libSem);
541 openWindow(self, data->about, MiamiPanelBaseIntern);
543 SetSuperAttrs(CLASS, self, MUIA_Application_Sleep, FALSE, TAG_DONE);
545 return 0;
548 /***********************************************************************/
550 static ULONG MUIPC_App__MPM_Prefs
552 Class *CLASS, Object *self, Msg message
555 struct MiamiPanelAppClass_DATA *data = INST_DATA(CLASS,self);
557 SetSuperAttrs(CLASS, self, MUIA_Application_Sleep, TRUE, TAG_DONE);
559 if (!data->wprefs)
561 ObtainSemaphore(&MiamiPanelBaseIntern->mpb_libSem);
563 if (MiamiPanelBaseIntern->mpb_prefsClass || MUIPC_Prefs_ClassInit(MiamiPanelBaseIntern))
565 if (data->wprefs = NewObject(MiamiPanelBaseIntern->mpb_prefsClass->mcc_Class,
566 NULL,
567 MPA_Prefs, &data->prefs,
568 TAG_DONE))
569 DoSuperMethod(CLASS,self,OM_ADDMEMBER,(ULONG)data->wprefs);
572 ReleaseSemaphore(&MiamiPanelBaseIntern->mpb_libSem);
575 openWindow(self, data->wprefs, MiamiPanelBaseIntern);
577 SetSuperAttrs(CLASS, self, MUIA_Application_Sleep, FALSE, TAG_DONE);
579 return 0;
582 /***********************************************************************/
584 static ULONG
585 MUIPC_App__MPM_Save(struct IClass *CLASS,Object *self,struct MPP_Save *message)
587 struct MiamiPanelAppClass_DATA *data = INST_DATA(CLASS,self);
589 DoMethod(data->root,MPM_MGroup_GrabIFList);
591 if (message->save)
593 saveIFFPrefs(DEF_ENVARCFILE, &data->prefs, MiamiPanelBaseIntern);
594 DoSuperMethod(CLASS,self,MUIM_Application_Save,(ULONG)MUIV_Application_Save_ENVARC);
597 saveIFFPrefs(DEF_ENVFILE, &data->prefs, MiamiPanelBaseIntern);
598 DoSuperMethod(CLASS,self,MUIM_Application_Save,(ULONG)MUIV_Application_Save_ENV);
600 DoMethod(data->win,MUIM_Window_Snapshot,1);
602 return 0;
605 /***********************************************************************/
607 static ULONG
608 MUIPC_App__MPM_Load(struct IClass *CLASS, Object *self,struct MPP_Load *message)
610 struct MPS_Prefs prefs;
611 ULONG pres, res;
613 if (message->envarc) pres = loadIFFPrefs(MPV_LoadPrefs_EnvArc, &prefs, MiamiPanelBaseIntern);
614 else pres = loadIFFPrefs(MPV_LoadPrefs_Env, &prefs, MiamiPanelBaseIntern);
616 res = DoSuperMethod(CLASS,self,MUIM_Application_Load,(ULONG)(message->envarc ? MUIV_Application_Load_ENVARC : MUIV_Application_Load_ENV));
618 if (pres) set(self,MPA_Prefs,&prefs);
619 else DisplayBeep(0);
621 return res;
624 /***********************************************************************/
626 static ULONG
627 MUIPC_App__MPM_Miami(struct IClass *CLASS,Object *self,struct MPP_Miami *message)
629 ULONG cmd = 0; // gcc
631 switch(message->cmd)
633 case MPV_Miami_Show: cmd = MIAMIPANELV_CallBack_Code_ShowMainGUI; break;
634 case MPV_Miami_Hide: cmd = MIAMIPANELV_CallBack_Code_HideMainGUI; break;
635 case MPV_Miami_Quit: cmd = MIAMIPANELV_CallBack_Code_QuitMiami; break;
638 MiamiPanelFun(MiamiPanelBaseIntern, cmd);
640 return 0;
643 /***********************************************************************/
645 BOOPSI_DISPATCHER(IPTR, MUIPC_App_Dispatcher, CLASS, self, message)
647 switch(message->MethodID)
649 case OM_NEW: return MUIPC_App__OM_NEW(CLASS,self,(APTR)message);
650 case OM_GET: return MUIPC_App__OM_GET(CLASS,self,(APTR)message);
651 case OM_SET: return MUIPC_App__OM_SET(CLASS,self,(APTR)message);
652 case OM_DISPOSE: return MUIPC_App__OM_DISPOSE(CLASS,self,(APTR)message);
654 case MUIM_Application_AboutMUI: return MUIPC_App__MUIM_Application_AboutMUI(CLASS,self,(APTR)message);
655 case MUIM_Application_OpenConfigWindow: return MUIPC_App__MUIM_Application_OpenConfigWindow(CLASS,self,(APTR)message);
657 case MPM_Rebuild: return MUIPC_App__MPM_Rebuild(CLASS,self,(APTR)message);
658 case MPM_Quit: return MUIPC_App__MPM_Quit(CLASS,self,(APTR)message);
659 case MPM_DisposeWin: return MUIPC_App__MPM_DisposeWin(CLASS,self,(APTR)message);
660 case MPM_About: return MUIPC_App__MPM_About(CLASS,self,(APTR)message);
661 case MPM_Prefs: return MUIPC_App__MPM_Prefs(CLASS,self,(APTR)message);
662 case MPM_Save: return MUIPC_App__MPM_Save(CLASS,self,(APTR)message);
663 case MPM_Load: return MUIPC_App__MPM_Load(CLASS,self,(APTR)message);
664 case MPM_Miami: return MUIPC_App__MPM_Miami(CLASS,self,(APTR)message);
666 default: return DoSuperMethodA(CLASS,self,message);
668 return 0;
670 BOOPSI_DISPATCHER_END
672 /***********************************************************************/
674 ULONG
675 MUIPC_App_ClassInit(struct MiamiPanelBase_intern *MiamiPanelBase)
677 MiamiPanelBaseIntern = MiamiPanelBase;
678 if ((MiamiPanelBaseIntern->mpb_appClass = MUI_CreateCustomClass(NULL, MUIC_Application, NULL, sizeof(struct MiamiPanelAppClass_DATA), MUIPC_App_Dispatcher)))
680 localizeMenus(appMenu,AppMenuIDs);
682 return TRUE;
685 return FALSE;
688 /***********************************************************************/