revert between 56095 -> 55830 in arch
[AROS.git] / workbench / libs / icon / newdiskobject.c
blobcda3449852edbc152b8522f2323a6b1e15699524
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <exec/types.h>
7 #include <workbench/icon.h>
8 #include <proto/icon.h>
10 #include "icon_intern.h"
12 # include <aros/debug.h>
14 /*****************************************************************************
16 NAME */
18 AROS_LH1(struct DiskObject *, NewDiskObject,
20 /* SYNOPSIS */
21 AROS_LHA(ULONG, type, D0),
23 /* LOCATION */
24 struct IconBase *, IconBase, 29, Icon)
26 /* FUNCTION
27 Creates an empty DiskObject structure.
29 INPUTS
30 type - WBDISK, WBDRAWER, WBTOOL, WBPROJECT,
31 WBGARBAGE, WBDEVICE or WBKICK
33 RESULT
35 NOTES
37 EXAMPLE
39 BUGS
41 SEE ALSO
43 INTERNALS
45 *****************************************************************************/
47 AROS_LIBFUNC_INIT
49 APTR result = NULL;
50 struct NativeIcon *ni;
51 UWORD i;
53 ni = (struct NativeIcon *)AllocMem(sizeof(struct NativeIcon), MEMF_CLEAR);
54 if (ni == NULL)
55 return NULL;
57 ni->ni_DiskObject.do_Type = type;
59 NEWLIST(&ni->ni_FreeList.fl_MemList);
60 for (i = 0; i < 2; i++)
61 ni->ni_Image[i].TransparentColor = -1;
63 AddIconToList(ni, IconBase);
64 result = &ni->ni_DiskObject;
66 return result;
68 AROS_LIBFUNC_EXIT