5 Copyright © 1995-2006, The AROS Development Team. All rights reserved.
9 #include <exec/memory.h>
10 #include <exec/libraries.h>
11 #include <aros/asmcall.h>
13 #include <libraries/iffparse.h>
14 #include <cybergraphx/cybergraphics.h>
15 #include <workbench/workbench.h>
16 #include <workbench/icon.h>
17 #include <graphics/view.h>
19 #include <proto/alib.h>
20 #include <proto/exec.h>
21 #include <proto/intuition.h>
22 #include <proto/graphics.h>
23 #include <proto/icon.h>
24 #include <proto/iffparse.h>
25 #include <proto/utility.h>
26 #include <proto/cybergraphics.h>
27 #include <proto/dos.h>
32 #include <aros/libcall.h>
33 #include <aros/asmcall.h>
35 /****************************************************************************************/
38 #define MAX_DEFICON_FILEPATH 256
40 /* Number of entries in the mementrys in the freelists */
41 #define FREELIST_MEMLISTENTRIES 10
43 #define ICONDUPA_JustLoadedFromDisk ICONA_Reserved1
45 #define ICONLIST_HASHSIZE 256
47 /****************************************************************************************/
50 To get right alignment we make our very own memlist structure.
51 Look at the original struct MemList in <exec/memory.h> to see why.
54 struct IconInternalMemList
56 struct Node iiml_Node
;
57 UWORD iiml_NumEntries
;
58 struct MemEntry iiml_ME
[FREELIST_MEMLISTENTRIES
];
69 UBYTE transparentcolor
;
73 #define IMAGE35F_HASTRANSPARENTCOLOR 1
74 #define IMAGE35F_HASPALETTE 2
86 #define ICON35F_FRAMELESS 1
104 struct DiskObject dobj
;
105 ULONG readstruct_state
;
106 struct Icon35 icon35
;
107 struct IconPNG iconPNG
;
109 struct BitMap
*iconbm1
;
110 struct BitMap
*iconbm2
;
111 struct Screen
*iconscr
;
112 struct ViewPort
*iconvp
;
113 struct ColorMap
*iconcm
;
119 #define RSS_OLDDRAWERDATA_READ (1 << 0)
120 #define RSS_GADGETIMAGE_READ (1 << 1)
121 #define RSS_SELECTIMAGE_READ (1 << 2)
122 #define RSS_DEFAULTTOOL_READ (1 << 3)
123 #define RSS_TOOLWINDOW_READ (1 << 4)
124 #define RSS_TOOLTYPES_READ (1 << 5)
126 #define NATIVEICON(icon) ((struct NativeIcon *)((UBYTE *)(icon) - offsetof(struct NativeIcon, dobj)))
130 struct Library ib_Lib
;
132 struct Library
*pngbase
;
134 struct SignalSemaphore iconlistlock
;
135 struct MinList iconlists
[ICONLIST_HASHSIZE
];
138 ULONG ib_CRCTable
[256];
139 BOOL ib_CRCTableComputed
;
141 /* Global settings -----------------------------------------------------*/
142 struct Screen
*ib_Screen
;
144 struct Rectangle ib_EmbossRectangle
;
146 struct Hook
*ib_IdentifyHook
;
147 LONG ib_MaxNameLength
;
148 BOOL ib_NewIconsSupport
;
149 BOOL ib_ColorIconSupport
;
152 typedef struct IconBase IconBase_T
;
154 #define PNGBase IconBase->pngbase
156 /****************************************************************************************/
158 extern struct ExecBase
* SysBase
;
159 extern struct DosLibrary
* DOSBase
;
161 /****************************************************************************************/
163 /* Internal prototypes */
164 AROS_UFP3(LONG
, dosstreamhook
,
165 AROS_UFPA(struct Hook
*, hook
, A0
),
166 AROS_UFPA(BPTR
, file
, A2
),
167 AROS_UFPA(ULONG
*, msg
, A1
)
172 UBYTE
* WriteValue (LONG
, UBYTE
*);
174 BOOL
ReadIcon35(struct NativeIcon
*icon
, struct Hook
*streamhook
, void *stream
, struct IconBase
*IconBase
);
175 BOOL
WriteIcon35(struct NativeIcon
*icon
, struct Hook
*streamhook
, void *stream
, struct IconBase
*IconBase
);
176 VOID
FreeIcon35(struct NativeIcon
*icon
, struct IconBase
*IconBase
);
177 VOID
MakeMask35(UBYTE
*imgdata
, UBYTE
*imgmask
, UBYTE transpcolor
, LONG imagew
, LONG imageh
);
179 BOOL
ReadIconNI(struct NativeIcon
*icon
, struct Hook
*streamhook
, void *stream
, struct IconBase
*IconBase
);
180 BOOL
WriteIconNI(struct NativeIcon
*icon
, struct Hook
*streamhook
, void *stream
, struct IconBase
*IconBase
);
181 VOID
FreeIconNI(struct NativeIcon
*icon
, struct IconBase
*IconBase
);
183 BOOL
ReadIconPNG(struct DiskObject
**ret
, BPTR file
, struct IconBase
*IconBase
);
184 BOOL
WriteIconPNG(BPTR file
, struct DiskObject
*dobj
, struct IconBase
*IconBase
);
185 VOID
FreeIconPNG(struct DiskObject
*dobj
, struct IconBase
*IconBase
);
188 #define LB(ib) ((struct IconBase *) (ib))
190 #define POOL (((struct IconBase *) IconBase)->ib_MemoryPool)
192 #endif /* ICON_INTERN_H */