2 Copyright © 2005-2013, The AROS Development Team. All rights reserved.
6 #define MUIMASTER_YES_INLINE_STDARG
9 #include <aros/debug.h>
11 #include <exec/types.h>
12 #include <utility/tagitem.h>
13 #include <libraries/mui.h>
14 #include <libraries/asl.h>
15 #include <dos/filehandler.h>
17 #include <proto/alib.h>
18 #include <proto/exec.h>
19 #include <proto/dos.h>
20 #include <proto/intuition.h>
21 #include <proto/utility.h>
22 #include <proto/icon.h>
23 #include <proto/muimaster.h>
24 #include <proto/workbench.h>
28 #include <zune/iconimage.h>
34 #define ID_FAT12_DISK (0x46415400L)
35 #define ID_FAT16_DISK (0x46415401L)
36 #define ID_FAT32_DISK (0x46415402L)
39 #define ID_CDFS_DISK (0x43444653L)
42 #define ID_NTFS_DISK (0x4E544653L)
45 static LONG dt
[]={ID_NO_DISK_PRESENT
, ID_UNREADABLE_DISK
,
46 ID_DOS_DISK
, ID_FFS_DISK
, ID_INTER_DOS_DISK
, ID_INTER_FFS_DISK
,
47 ID_FASTDIR_DOS_DISK
, ID_FASTDIR_FFS_DISK
, ID_NOT_REALLY_DOS
,
48 ID_KICKSTART_DISK
, ID_MSDOS_DISK
, ID_SFS_BE_DISK
, ID_SFS_LE_DISK
,
49 ID_FAT12_DISK
, ID_FAT16_DISK
, ID_FAT32_DISK
, ID_CDFS_DISK
, ID_NTFS_DISK
};
51 /*** Instance data **********************************************************/
55 Object
*dki_VolumeIcon
;
56 Object
*dki_VolumeName
;
57 Object
*dki_VolumeUseGauge
;
58 Object
*dki_VolumeUsed
;
59 Object
*dki_VolumeFree
;
61 STRPTR dki_DOSDevInfo
;
63 struct MsgPort
*dki_NotifyPort
;
66 struct MUI_InputHandlerNode dki_NotifyIHN
;
67 struct NotifyRequest dki_FSNotifyRequest
;
70 /*** Methods ****************************************************************/
71 Object
*DiskInfo__OM_NEW
73 Class
*CLASS
, Object
*self
, struct opSet
*message
77 struct DiskInfo_DATA
*data
= NULL
;
78 struct TagItem
*tstate
= message
->ops_AttrList
;
79 struct TagItem
*tag
= NULL
;
82 *volnameobj
, *voliconobj
, *volusegaugeobj
,
83 *volusedobj
, *volfreeobj
,
86 LONG disktype
= ID_NO_DISK_PRESENT
;
94 STRPTR dosdevname
= NULL
;
95 STRPTR deviceinfo
= NULL
;
97 STRPTR filesystem
= NULL
;
98 STRPTR volicon
= NULL
;
99 STRPTR handlertype
= "";
101 static struct InfoData id
;
103 static STRPTR disktypelist
[] =
125 /* Parse initial taglist -----------------------------------------------*/
126 D(bug("[DiskInfo] %s()\n", __PRETTY_FUNCTION__
));
128 while ((tag
= NextTagItem(&tstate
)) != NULL
)
132 case MUIA_DiskInfo_Initial
:
133 initial
= (BPTR
) tag
->ti_Data
;
134 D(bug("[DiskInfo] %s: initial lock @ 0x%p\n", __PRETTY_FUNCTION__
, initial
));
136 /* TODO: Remove MUIA_DiskInfo_Aspect */
137 case MUIA_DiskInfo_Aspect
:
138 aspect
= tag
->ti_Data
;
139 D(bug("[DiskInfo] %s: aspect: %d\n", __PRETTY_FUNCTION__
, aspect
));
144 /* Initial lock is required */
145 if (initial
== BNULL
)
150 /* obtain volume's name from the lock */
151 if (!NameFromLock(initial
, volname
, sizeof(volname
))) {
152 SetIoErr(ERROR_DEVICE_NOT_MOUNTED
);
155 int volname_len
= strlen(volname
);
156 if ((volicon
= AllocVec(volname_len
+ 5, MEMF_CLEAR
)) == NULL
)
158 SetIoErr(ERROR_DEVICE_NOT_MOUNTED
);
161 strcpy(volicon
, volname
);
162 strcat(volicon
, "disk");
163 volname
[strlen(volname
)-1] = '\0';
164 D(bug("[DiskInfo] %s: Volume '%s'\n", __PRETTY_FUNCTION__
, volname
));
166 /* find the volumes doslist information .. */
167 filesystem
= _(MSG_UNKNOWN
);
169 volname
[strlen(volname
)] = ':';
171 /* Extract volume info from InfoData */
172 if (Info(initial
, &id
) == DOSTRUE
)
175 disktype
= id
.id_DiskType
;
177 for (i
= 0; i
< sizeof(dt
) / sizeof(LONG
); ++i
)
179 if (disktype
== dt
[i
])
181 filesystem
= AllocVec(strlen(disktypelist
[i
]) + 1, MEMF_ANY
|MEMF_CLEAR
);
182 CopyMem(disktypelist
[i
], filesystem
, strlen(disktypelist
[i
]));
188 filesystem
= AllocVec(strlen(_(MSG_UNKNOWN
)) + 1, MEMF_ANY
|MEMF_CLEAR
);
189 CopyMem(_(MSG_UNKNOWN
), filesystem
, strlen(_(MSG_UNKNOWN
)));
192 FormatSize(size
, id
.id_NumBlocks
, id
.id_NumBlocks
, id
.id_BytesPerBlock
, FALSE
);
193 percent
= FormatSize(used
, id
.id_NumBlocksUsed
, id
.id_NumBlocks
, id
.id_BytesPerBlock
, TRUE
);
194 FormatSize(free
, id
.id_NumBlocks
- id
.id_NumBlocksUsed
, id
.id_NumBlocks
, id
.id_BytesPerBlock
, TRUE
);
195 sprintf(blocksize
, "%d %s", (int)id
.id_BytesPerBlock
, _(MSG_BYTES
));
197 switch (id
.id_DiskState
)
199 case (ID_WRITE_PROTECTED
):
200 status
= _(MSG_READABLE
);
202 case (ID_VALIDATING
):
203 status
= _(MSG_VALIDATING
);
206 status
= _(MSG_READABLE_WRITABLE
);
209 status
= _(MSG_UNKNOWN
);
212 dl
= LockDosList(LDF_VOLUMES
| LDF_READ
);
213 dl
= FindDosEntry(dl
, volname
, LDF_VOLUMES
| LDF_READ
);
214 UnLockDosList(LDF_VOLUMES
| LDF_READ
);
218 APTR voltask
= dl
->dol_Task
;
219 dl
= LockDosList(LDF_DEVICES
|LDF_READ
);
221 while((dl
= NextDosEntry(dl
, LDF_DEVICES
)))
223 if (dl
->dol_Task
== voltask
)
225 struct FileSysStartupMsg
*fsstartup
= (struct FileSysStartupMsg
*)BADDR(dl
->dol_misc
.dol_handler
.dol_Startup
);
226 dosdevname
= (UBYTE
*)AROS_BSTR_ADDR(dl
->dol_Name
);
227 if (dl
->dol_misc
.dol_handler
.dol_Handler
)
229 char *fscur
= filesystem
;
230 filesystem
= AllocVec(strlen(fscur
) + AROS_BSTR_strlen(dl
->dol_misc
.dol_handler
.dol_Handler
) + 4, MEMF_ANY
);
231 sprintf(filesystem
,"%s (%s)", fscur
, AROS_BSTR_ADDR(dl
->dol_misc
.dol_handler
.dol_Handler
));
233 if (fsstartup
!= NULL
)
235 deviceinfo
= AllocVec(strlen((UBYTE
*)AROS_BSTR_ADDR(fsstartup
->fssm_Device
)) + (fsstartup
->fssm_Unit
/10 + 1) + 7, MEMF_CLEAR
);
236 sprintf(deviceinfo
,"%s %s %d", (UBYTE
*)AROS_BSTR_ADDR(fsstartup
->fssm_Device
), _(MSG_UNIT
), (int)fsstartup
->fssm_Unit
);
241 UnLockDosList(LDF_VOLUMES
|LDF_READ
);
247 filesystem
= AllocVec(strlen(_(MSG_UNKNOWN
)) + 1, MEMF_ANY
);
248 CopyMem(_(MSG_UNKNOWN
), filesystem
, strlen(_(MSG_UNKNOWN
)));
251 /* Create application and window objects -------------------------------*/
252 self
= (Object
*) DoSuperNewTags
256 MUIA_Application_Title
, __(MSG_TITLE
),
257 MUIA_Application_Version
, (IPTR
) "$VER: DiskInfo 0.5 ("ADATE
") ©2006-2009 AROS Dev Team",
258 MUIA_Application_Copyright
, __(MSG_COPYRIGHT
),
259 MUIA_Application_Author
, __(MSG_AUTHOR
),
260 MUIA_Application_Description
, __(MSG_DESCRIPTION
),
261 MUIA_Application_Base
, (IPTR
) "DISKINFO",
262 SubWindow
, (IPTR
) (window
= (Object
*)WindowObject
,
263 MUIA_Window_Title
, (IPTR
) volname
,
264 MUIA_Window_Activate
, TRUE
,
265 MUIA_Window_NoMenus
, TRUE
,
266 MUIA_Window_CloseGadget
, TRUE
,
268 WindowContents
, (IPTR
) VGroup
,
269 Child
, (IPTR
) HGroup
,
270 Child
, (IPTR
) VGroup
,
271 Child
, (IPTR
) HVSpace
,
272 Child
, (IPTR
) HGroup
,
273 Child
, (IPTR
) HVSpace
,
274 Child
, (IPTR
)(voliconobj
= (Object
*)IconImageObject
,
275 MUIA_InputMode
, MUIV_InputMode_Toggle
,
276 MUIA_IconImage_File
, (IPTR
) volicon
,
278 Child
, (IPTR
) HVSpace
,
280 Child
, (IPTR
) HVSpace
,
282 Child
, (IPTR
) (grp
= (Object
*)VGroup
,
283 Child
, (IPTR
) HVSpace
,
284 Child
, (IPTR
) ColGroup(2),
285 /* TODO: Build this list only when data is realy available, and localise */
286 (dosdevname
) ? Child
: TAG_IGNORE
, (IPTR
) TextObject
,
287 MUIA_Text_PreParse
, (IPTR
) "\33r",
288 MUIA_Text_Contents
, (IPTR
) __(MSG_DOSDEVICE
),
290 (dosdevname
) ? Child
: TAG_IGNORE
, (IPTR
) TextObject
,
291 MUIA_Text_PreParse
, (IPTR
) "\33l",
292 MUIA_Text_Contents
, (IPTR
) dosdevname
,
294 (deviceinfo
) ? Child
: TAG_IGNORE
, (IPTR
) TextObject
,
295 MUIA_Text_PreParse
, (IPTR
) "\33r",
296 MUIA_Text_Contents
, (IPTR
) __(MSG_DEVICEINFO
),
298 (deviceinfo
) ? Child
: TAG_IGNORE
, (IPTR
) TextObject
,
299 MUIA_Text_PreParse
, (IPTR
) "\33l",
300 MUIA_Text_Contents
, (IPTR
) deviceinfo
,
302 Child
, (IPTR
) TextObject
,
303 MUIA_Text_PreParse
, (IPTR
) "\33r",
304 MUIA_Text_Contents
, (IPTR
) __(MSG_FILESYSTEM
),
306 Child
, (IPTR
) TextObject
,
307 MUIA_Text_PreParse
, (IPTR
) "\33I[6:24] \33l",
308 MUIA_Text_Contents
, (IPTR
) filesystem
,
310 Child
, (IPTR
) HVSpace
,
311 Child
, (IPTR
) TextObject
,
312 MUIA_Text_PreParse
, (IPTR
) "\33l",
313 MUIA_Text_Contents
, (IPTR
) handlertype
,
316 Child
, (IPTR
) HVSpace
,
318 Child
, (IPTR
) HVSpace
,
320 Child
, (IPTR
) VGroup
,
321 Child
, (IPTR
) HGroup
,
324 Child
, (IPTR
) HVSpace
,
325 Child
, (IPTR
) ColGroup(2),
326 Child
, (IPTR
) TextObject
,
327 MUIA_Text_PreParse
, (IPTR
) "\33r",
328 MUIA_Text_Contents
, __(MSG_NAME
),
330 Child
, (IPTR
)(volnameobj
= (Object
*)TextObject
,
332 MUIA_Background
, MUII_TextBack
,
333 MUIA_Text_PreParse
, (IPTR
) "\33b\33l",
334 MUIA_Text_Contents
, (IPTR
) volname
,
336 Child
, (IPTR
) VGroup
,
337 Child
, (IPTR
) TextObject
,
339 MUIA_FramePhantomHoriz
, (IPTR
)TRUE
,
340 MUIA_Text_PreParse
, (IPTR
) "\33r",
341 MUIA_Text_Contents
, __(MSG_SIZE
),
343 Child
, (IPTR
) TextObject
,
345 MUIA_FramePhantomHoriz
, (IPTR
)TRUE
,
346 MUIA_Text_PreParse
, (IPTR
) "\33r",
347 MUIA_Text_Contents
, __(MSG_USED
),
349 Child
, (IPTR
) TextObject
,
351 MUIA_FramePhantomHoriz
, (IPTR
)TRUE
,
352 MUIA_Text_PreParse
, (IPTR
) "\33r",
353 MUIA_Text_Contents
, __(MSG_FREE
),
356 Child
, (IPTR
) HGroup
,
357 Child
, (IPTR
) VGroup
,
358 Child
, (IPTR
) TextObject
,
360 MUIA_Background
, MUII_TextBack
,
361 MUIA_Text_PreParse
, (IPTR
) "\33l",
362 MUIA_Text_Contents
, (IPTR
) size
,
364 Child
, (IPTR
)(volusedobj
= (Object
*)TextObject
,
366 MUIA_Background
, MUII_TextBack
,
367 MUIA_Text_PreParse
, (IPTR
) "\33l",
368 MUIA_Text_Contents
, (IPTR
) used
,
370 Child
, (IPTR
)(volfreeobj
= (Object
*)TextObject
,
372 MUIA_Background
, MUII_TextBack
,
373 MUIA_Text_PreParse
, (IPTR
) "\33l",
374 MUIA_Text_Contents
, (IPTR
) free
,
377 Child
, (IPTR
)(volusegaugeobj
= (Object
*)GaugeObject
,
379 MUIA_Gauge_InfoText
, (IPTR
) "",
380 MUIA_Gauge_Horiz
, FALSE
,
381 MUIA_Gauge_Current
, percent
,
384 Child
, (IPTR
) TextObject
,
385 MUIA_Text_PreParse
, (IPTR
) "\33r",
386 MUIA_Text_Contents
, __(MSG_BLOCK_SIZE
),
388 Child
, (IPTR
) TextObject
,
390 MUIA_Background
, MUII_TextBack
,
391 MUIA_Text_PreParse
, (IPTR
) "\33l",
392 MUIA_Text_Contents
, (IPTR
) blocksize
,
394 Child
, (IPTR
) TextObject
,
395 MUIA_Text_PreParse
, (IPTR
) "\33r",
396 MUIA_Text_Contents
, __(MSG_STATUS
),
398 Child
, (IPTR
) TextObject
,
400 MUIA_Background
, MUII_TextBack
,
401 MUIA_Text_PreParse
, (IPTR
) "\33l",
402 MUIA_Text_Contents
, (IPTR
) status
,
404 Child
, (IPTR
) HVSpace
,
405 Child
, (IPTR
) HVSpace
,
407 Child
, (IPTR
) HVSpace
,
409 Child
, (IPTR
) (grpformat
= (Object
*)HGroup
,
410 // grpformat object userlevel sensitive
411 Child
, (IPTR
) HVSpace
,
413 Child
, (IPTR
) HVSpace
,
419 /* Check if object creation succeeded */
423 /* Store instance data -------------------------------------------------*/
424 data
= INST_DATA(CLASS
, self
);
426 data
->dki_NotifyPort
= CreateMsgPort();
428 data
->dki_Window
= window
;
430 data
->dki_VolumeName
= volnameobj
;
431 data
->dki_VolumeIcon
= voliconobj
;
432 data
->dki_VolumeUseGauge
= volusegaugeobj
;
433 data
->dki_VolumeUsed
= volusedobj
;
434 data
->dki_VolumeFree
= volfreeobj
;
436 data
->dki_DOSDev
= AllocVec(strlen(dosdevname
) +2, MEMF_CLEAR
);
437 sprintf(data
->dki_DOSDev
, "%s:", dosdevname
);
439 data
->dki_DOSDevInfo
= deviceinfo
;
440 data
->dki_FileSys
= filesystem
;
441 data
->dki_Aspect
= aspect
;
443 /* Setup notifications -------------------------------------------------*/
444 DoMethod( window
, MUIM_Notify
, MUIA_Window_CloseRequest
, TRUE
,
445 (IPTR
) self
, 2, MUIM_Application_ReturnID
, MUIV_Application_ReturnID_Quit
);
447 if (data
->dki_NotifyPort
)
449 /* Setup filesystem notification handler ---------------------------*/
450 data
->dki_NotifyIHN
.ihn_Signals
= 1UL << data
->dki_NotifyPort
->mp_SigBit
;
451 data
->dki_NotifyIHN
.ihn_Object
= self
;
452 data
->dki_NotifyIHN
.ihn_Method
= MUIM_DiskInfo_HandleNotify
;
454 DoMethod(self
, MUIM_Application_AddInputHandler
, (IPTR
)&data
->dki_NotifyIHN
);
456 data
->dki_FSNotifyRequest
.nr_Name
= volname
;
457 data
->dki_FSNotifyRequest
.nr_Flags
= NRF_SEND_MESSAGE
;
458 data
->dki_FSNotifyRequest
.nr_stuff
.nr_Msg
.nr_Port
= data
->dki_NotifyPort
;
459 if (StartNotify(&data
->dki_FSNotifyRequest
))
461 D(bug("[DiskInfo] %s: FileSystem-Notification setup for '%s'\n", __PRETTY_FUNCTION__
, data
->dki_FSNotifyRequest
.nr_Name
));
465 D(bug("[DiskInfo] %s: FAILED to setup FileSystem-Notification for '%s'\n", __PRETTY_FUNCTION__
, data
->dki_FSNotifyRequest
.nr_Name
));
466 DoMethod(self
, MUIM_Application_RemInputHandler
, (IPTR
)&data
->dki_NotifyIHN
);
467 DeleteMsgPort(data
->dki_NotifyPort
);
468 data
->dki_NotifyPort
= NULL
;
474 IPTR
DiskInfo__OM_DISPOSE(Class
*CLASS
, Object
*self
, Msg message
)
476 struct DiskInfo_DATA
*data
= INST_DATA(CLASS
, self
);
478 D(bug("[DiskInfo] %s()\n", __PRETTY_FUNCTION__
));
480 if (data
->dki_NotifyPort
)
482 DoMethod(self
, MUIM_Application_RemInputHandler
, (IPTR
) &data
->dki_NotifyIHN
);
484 EndNotify(&data
->dki_FSNotifyRequest
);
486 DeleteMsgPort(data
->dki_NotifyPort
);
489 FreeVec(data
->dki_DOSDev
);
490 FreeVec(data
->dki_DOSDevInfo
);
491 FreeVec(data
->dki_FileSys
);
493 return DoSuperMethodA(CLASS
, self
, message
);
496 IPTR
DiskInfo__MUIM_Application_Execute(Class
*CLASS
, Object
*self
, Msg message
)
498 struct DiskInfo_DATA
*data
= INST_DATA(CLASS
, self
);
500 D(bug("[DiskInfo] %s()\n", __PRETTY_FUNCTION__
));
502 SET(data
->dki_Window
, MUIA_Window_Open
, TRUE
);
504 DoSuperMethodA(CLASS
, self
, message
);
506 SET(data
->dki_Window
, MUIA_Window_Open
, FALSE
);
511 IPTR DiskInfo__MUIM_DiskInfo_HandleNotify
513 Class
*CLASS
, Object
*self
, Msg message
516 struct DiskInfo_DATA
*data
= INST_DATA(CLASS
, self
);
517 struct NotifyMessage
*npMessage
= NULL
;
518 static struct InfoData id
;
519 BPTR fsdevlock
= BNULL
;
520 BOOL di_Quit
= FALSE
;
522 D(bug("[DiskInfo] %s()\n", __PRETTY_FUNCTION__
));
524 if (data
->dki_NotifyPort
)
526 while ((npMessage
= (struct NotifyMessage
*)GetMsg(data
->dki_NotifyPort
)) != NULL
)
528 D(bug("[DiskInfo] %s: FS notification received\n", __PRETTY_FUNCTION__
));
530 if ((fsdevlock
= Lock((STRPTR
)XGET(data
->dki_VolumeName
, MUIA_Text_Contents
), SHARED_LOCK
)) != BNULL
)
532 /* Extract volume info from InfoData */
533 if (Info(fsdevlock
, &id
) == DOSTRUE
)
535 if (id
.id_DiskType
!= ID_NO_DISK_PRESENT
)
541 D(bug("[DiskInfo] %s: Updating Window from DOS Device '%s'\n", __PRETTY_FUNCTION__
, (STRPTR
)XGET(data
->dki_VolumeName
, MUIA_Text_Contents
)));
543 //FormatSize(size, id.id_NumBlocks, id.id_NumBlocks, id.id_BytesPerBlock, FALSE);
544 percent
= FormatSize(used
, id
.id_NumBlocksUsed
, id
.id_NumBlocks
, id
.id_BytesPerBlock
, TRUE
);
545 FormatSize(free
, id
.id_NumBlocks
- id
.id_NumBlocksUsed
, id
.id_NumBlocks
, id
.id_BytesPerBlock
, TRUE
);
546 //sprintf(blocksize, "%d %s", id.id_BytesPerBlock, _(MSG_BYTES));
548 //data->dki_VolumeName = volnameobj;
549 SET(data
->dki_VolumeUsed
, MUIA_Text_Contents
, used
);
550 SET(data
->dki_VolumeFree
, MUIA_Text_Contents
, free
);
551 SET(data
->dki_VolumeUseGauge
, MUIA_Gauge_Current
, percent
);
555 D(bug("[DiskInfo] %s: Volume no longer available on DOS Device '%s'\n", __PRETTY_FUNCTION__
, data
->dki_DOSDev
));
561 D(bug("[DiskInfo] %s: Failed to obtain Info for DOS Device '%s'\n", __PRETTY_FUNCTION__
, data
->dki_DOSDev
));
569 D(bug("[DiskInfo] %s: Failed to lock DOS Device '%s'\n", __PRETTY_FUNCTION__
, data
->dki_DOSDev
));
572 ReplyMsg((struct Message
*)npMessage
);
577 /* TODO: set MUIV_Application_ReturnID_Quit */
582 IPTR
DiskInfo__OM_GET(Class
*CLASS
, Object
*self
, struct opGet
*msg
)
584 struct DiskInfo_DATA
*data
= INST_DATA(CLASS
, self
);
587 D(bug("[DiskInfo] %s()\n", __PRETTY_FUNCTION__
));
589 switch(msg
->opg_AttrID
)
591 case MUIA_DiskInfo_Volname
:
592 retval
= (IPTR
)XGET(data
->dki_VolumeName
, MUIA_Text_Contents
);
594 case MUIA_DiskInfo_Percent
:
595 retval
= (ULONG
)XGET(data
->dki_VolumeUseGauge
, MUIA_Gauge_Current
);
597 case MUIA_DiskInfo_Aspect
:
598 retval
= (ULONG
) data
->dki_Aspect
;
601 retval
= DoSuperMethodA(CLASS
, self
, (Msg
)msg
);
607 IPTR
DiskInfo__OM_SET(Class
*CLASS
, Object
*self
, struct opSet
*msg
)
609 struct DiskInfo_DATA
*data
= INST_DATA(CLASS
, self
);
610 struct TagItem
*tags
= msg
->ops_AttrList
;
613 D(bug("[DiskInfo] %s()\n", __PRETTY_FUNCTION__
));
615 while ((tag
= NextTagItem(&tags
)) != NULL
)
619 case MUIA_DiskInfo_Aspect
:
620 data
->dki_Aspect
= tag
->ti_Data
;
624 return DoSuperMethodA(CLASS
, self
, (Msg
)msg
);
627 /*** Dispatcher *************************************************************/
628 BOOPSI_DISPATCHER(IPTR
, DiskInfo_Dispatcher
, CLASS
, self
, message
)
630 switch (message
->MethodID
)
632 case OM_NEW
: return (IPTR
) DiskInfo__OM_NEW(CLASS
, self
, (struct opSet
*) message
);
633 case OM_DISPOSE
: return DiskInfo__OM_DISPOSE(CLASS
, self
, message
);
634 case OM_GET
: return (IPTR
) DiskInfo__OM_GET(CLASS
, self
, (struct opGet
*)message
);
635 case OM_SET
: return (IPTR
) DiskInfo__OM_SET(CLASS
, self
, (struct opSet
*)message
);
636 case MUIM_DiskInfo_HandleNotify
: return DiskInfo__MUIM_DiskInfo_HandleNotify(CLASS
, self
, message
);
637 case MUIM_Application_Execute
: return DiskInfo__MUIM_Application_Execute(CLASS
, self
, message
);
638 default: return DoSuperMethodA(CLASS
, self
, message
);
642 BOOPSI_DISPATCHER_END
644 /*** Setup ******************************************************************/
645 struct MUI_CustomClass
*DiskInfo_CLASS
;
647 BOOL
DiskInfo_Initialize()
649 D(bug("[DiskInfo] %s()\n", __PRETTY_FUNCTION__
));
651 DiskInfo_CLASS
= MUI_CreateCustomClass(
652 NULL
, MUIC_Application
, NULL
,
653 sizeof(struct DiskInfo_DATA
), DiskInfo_Dispatcher
);
655 return DiskInfo_CLASS
? TRUE
: FALSE
;
658 VOID
DiskInfo_Deinitialize()
660 D(bug("[DiskInfo] %s()\n", __PRETTY_FUNCTION__
));
662 if (DiskInfo_CLASS
!= NULL
)
664 MUI_DeleteCustomClass(DiskInfo_CLASS
);