revert between 56095 -> 55830 in arch
[AROS.git] / workbench / tools / SysExplorer / Modules / AHCI / ahcibus_window_cl.c
blobfa1d64fe346da4fd80d99f433e556953eefd97d1
1 /*
2 Copyright (C) 2018-2019, The AROS Development Team.
3 $Id$
4 */
6 #include <aros/debug.h>
8 #define MUIMASTER_YES_INLINE_STDARG
10 #include <proto/sysexp.h>
12 #include <proto/alib.h>
13 #include <proto/exec.h>
14 #include <proto/muimaster.h>
15 #include <proto/utility.h>
16 #include <proto/intuition.h>
18 #include <exec/memory.h>
19 #include <libraries/mui.h>
20 #include <zune/customclasses.h>
21 #include <mui/NFloattext_mcc.h>
22 #include <utility/tagitem.h>
23 #include <utility/hooks.h>
24 #include <oop/oop.h>
26 #include <hidd/ahci.h>
28 #include "locale.h"
30 #include "ahci_classes.h"
31 #include "ahci_intern.h"
33 #include <ctype.h>
34 #include <stdio.h>
35 #include <stdlib.h>
37 extern OOP_AttrBase HiddAHCIBusAB;
39 /*** Instance Data **********************************************************/
40 struct AHCIBusWindow_DATA
42 /* Nothing to add */
45 static Object *AHCIBusWindow__OM_NEW(Class *cl, Object *self, struct opSet *msg)
47 struct SysexpAHCIBase *AhciBase = (struct SysexpAHCIBase *)cl->cl_UserData;
49 D(bug("[ahci.sysexp] %s: cl @ %p\n", __func__, cl));
51 if (!AhciBase)
52 return NULL;
54 return (Object *) DoSuperNewTags
56 cl, self, NULL,
57 Child, (IPTR)(ColGroup(3),
58 MUIA_Group_SameSize, TRUE,
59 MUIA_FrameTitle, (IPTR)"AHCI",
60 GroupFrame,
61 MUIA_Background, MUII_GroupBack,
62 Child, (IPTR)HSpace(0),
63 Child, (IPTR)HSpace(0),
64 Child, (IPTR)HSpace(0),
65 End),
66 TAG_MORE, (IPTR) msg->ops_AttrList,
67 TAG_DONE
71 /*** Setup ******************************************************************/
72 BOOPSI_DISPATCHER_PROTO(IPTR, AHCIBusWindow_Dispatcher, cl, self, msg);
73 BOOPSI_DISPATCHER(IPTR, AHCIBusWindow_Dispatcher, cl, self, msg)
75 switch (msg->MethodID)
77 case OM_NEW:
78 return (IPTR) AHCIBusWindow__OM_NEW(cl, self, (struct opSet *)msg);
80 default:
81 return DoSuperMethodA(cl, self, msg);
84 return (IPTR) NULL;
86 BOOPSI_DISPATCHER_END
88 int AHCIBusWindow_Initialize(struct SysexpBase *SysexpBase)
90 struct SysexpAHCIBase *AhciBase = GetBase("AHCI.Module");
91 struct MUI_CustomClass *SBWClass;
93 D(bug("[ahci.sysexp] %s: AhciBase @ %p\n", __func__, AhciBase));
95 if (AhciBase)
97 SBWClass = GetBase("StorageBusWindow.Class");
98 D(bug("[ahci.sysexp] %s: StorageBusWindow.Class @ %p\n", __func__, SBWClass));
99 AhciBase->seab_AHCIBusWindowCLASS = MUI_CreateCustomClass
101 NULL, NULL, SBWClass,
102 sizeof(struct AHCIBusWindow_DATA), (APTR) AHCIBusWindow_Dispatcher
104 if (AhciBase->seab_AHCIBusWindowCLASS)
106 D(bug("[ahci.sysexp] %s: AHCIBusWindowCLASS @ %p\n", __func__, AhciBase->seab_AHCIBusWindowCLASS));
107 AhciBase->seab_AHCIBusWindowCLASS->mcc_Class->cl_UserData = (IPTR)AhciBase;
110 if (!AhciBase || !AhciBase->seab_AHCIBusWindowCLASS)
112 __showerror
113 ( (char *)
114 "Failed to create `AHCIBusWindow' custom class.", NULL
117 return 0;
120 return 1;
123 void AHCIBusWindow_Deinitialize(struct SysexpBase *SysexpBase)
125 struct SysexpAHCIBase *AhciBase = GetBase("AHCI.Module");
126 MUI_DeleteCustomClass(AhciBase->seab_AHCIBusWindowCLASS);