1 #ifndef WORKBENCH_ICON_H
2 #define WORKBENCH_ICON_H
5 Copyright © 1995-2008, The AROS Development Team. All rights reserved.
9 #ifndef GRAPHICS_VIEW_H
10 # include <graphics/view.h>
13 #ifndef INTUITION_IMAGECLASS_H
14 # include <intuition/imageclass.h>
17 #ifndef UTILITY_TAGITEM_H
18 # include <utility/tagitem.h>
21 #ifndef DATATYPES_PICTURECLASS_H
22 # include <datatypes/pictureclass.h>
29 /*** Icon library name ******************************************************/
30 #define ICONNAME "icon.library"
32 /*** Start of icon.library tags *********************************************/
33 #define ICONA_BASE (TAG_USER+0x9000)
35 /*** Error reporting ********************************************************/
36 /* Errorcode (LONG *) */
37 #define ICONA_ErrorCode (ICONA_BASE+1)
39 /* Points to the tag item that caused the error (struct TagItem **). */
40 #define ICONA_ErrorTagItem (ICONA_BASE+75)
42 /*** Global options for IconControlA() **************************************/
43 /* Screen to use for remapping icons to (struct Screen *) */
44 #define ICONCTRLA_SetGlobalScreen (ICONA_BASE+2)
45 #define ICONCTRLA_GetGlobalScreen (ICONA_BASE+3)
47 /* Icon color remapping precision, default is PRECISION_ICON (LONG) */
48 #define ICONCTRLA_SetGlobalPrecision (ICONA_BASE+4)
49 #define ICONCTRLA_GetGlobalPrecision (ICONA_BASE+5)
51 /* Icon frame size dimensions (struct Rectangle *) */
52 #define ICONCTRLA_SetGlobalEmbossRect (ICONA_BASE+6)
53 #define ICONCTRLA_GetGlobalEmbossRect (ICONA_BASE+7)
55 /* Render image without frame (BOOL) */
56 #define ICONCTRLA_SetGlobalFrameless (ICONA_BASE+8)
57 #define ICONCTRLA_GetGlobalFrameless (ICONA_BASE+9)
59 /* Enable NewIcons support (BOOL) */
60 #define ICONCTRLA_SetGlobalNewIconsSupport (ICONA_BASE+10)
61 #define ICONCTRLA_GetGlobalNewIconsSupport (ICONA_BASE+11)
63 /* Enable color icon support (BOOL) */
64 #define ICONCTRLA_SetGlobalColorIconSupport (ICONA_BASE+77)
65 #define ICONCTRLA_GetGlobalColorIconSupport (ICONA_BASE+78)
67 /* Set/Get the hook to be called when identifying a file (struct Hook *) */
68 #define ICONCTRLA_SetGlobalIdentifyHook (ICONA_BASE+12)
69 #define ICONCTRLA_GetGlobalIdentifyHook (ICONA_BASE+13)
71 /* Maximum length of a file/drawer name supported by icon.library (LONG) */
72 #define ICONCTRLA_SetGlobalMaxNameLength (ICONA_BASE+67)
73 #define ICONCTRLA_GetGlobalMaxNameLength (ICONA_BASE+68)
75 /*** Per icon local options for IconControlA() ******************************/
76 /* Get the icon rendering masks (PLANEPTR) */
77 #define ICONCTRLA_GetImageMask1 (ICONA_BASE+14)
78 #define ICONCTRLA_GetImageMask2 (ICONA_BASE+15)
80 /* Transparent image color, set to -1 if opaque */
81 #define ICONCTRLA_SetTransparentColor1 (ICONA_BASE+16)
82 #define ICONCTRLA_GetTransparentColor1 (ICONA_BASE+17)
83 #define ICONCTRLA_SetTransparentColor2 (ICONA_BASE+18)
84 #define ICONCTRLA_GetTransparentColor2 (ICONA_BASE+19)
86 /* Image color palette (struct ColorRegister *) */
87 #define ICONCTRLA_SetPalette1 (ICONA_BASE+20)
88 #define ICONCTRLA_GetPalette1 (ICONA_BASE+21)
89 #define ICONCTRLA_SetPalette2 (ICONA_BASE+22)
90 #define ICONCTRLA_GetPalette2 (ICONA_BASE+23)
92 /* Size of image color palette (LONG) */
93 #define ICONCTRLA_SetPaletteSize1 (ICONA_BASE+24)
94 #define ICONCTRLA_GetPaletteSize1 (ICONA_BASE+25)
95 #define ICONCTRLA_SetPaletteSize2 (ICONA_BASE+26)
96 #define ICONCTRLA_GetPaletteSize2 (ICONA_BASE+27)
98 /* Image data; one by per pixel (UBYTE *) */
99 #define ICONCTRLA_SetImageData1 (ICONA_BASE+28)
100 #define ICONCTRLA_GetImageData1 (ICONA_BASE+29)
101 #define ICONCTRLA_SetImageData2 (ICONA_BASE+30)
102 #define ICONCTRLA_GetImageData2 (ICONA_BASE+31)
104 /* Render image without frame (BOOL) */
105 #define ICONCTRLA_SetFrameless (ICONA_BASE+32)
106 #define ICONCTRLA_GetFrameless (ICONA_BASE+33)
108 /* Enable NewIcons support (BOOL) */
109 #define ICONCTRLA_SetNewIconsSupport (ICONA_BASE+34)
110 #define ICONCTRLA_GetNewIconsSupport (ICONA_BASE+35)
112 /* Icon aspect ratio (UBYTE *) */
113 #define ICONCTRLA_SetAspectRatio (ICONA_BASE+36)
114 #define ICONCTRLA_GetAspectRatio (ICONA_BASE+37)
116 /* Icon dimensions, valid only for palette mapped icon images (LONG) */
117 #define ICONCTRLA_SetWidth (ICONA_BASE+38)
118 #define ICONCTRLA_GetWidth (ICONA_BASE+39)
119 #define ICONCTRLA_SetHeight (ICONA_BASE+40)
120 #define ICONCTRLA_GetHeight (ICONA_BASE+41)
122 /* Check whether the icon is palette mapped (LONG *) */
123 #define ICONCTRLA_IsPaletteMapped (ICONA_BASE+42)
125 /* Get the screen the icon is attached to (struct Screen **) */
126 #define ICONCTRLA_GetScreen (ICONA_BASE+43)
128 /* Check whether the icon has a real select image (LONG *) */
129 #define ICONCTRLA_HasRealImage2 (ICONA_BASE+44)
131 /* Check whether the icon is of the NewIcon type (LONG *) */
132 #define ICONCTRLA_IsNewIcon (ICONA_BASE+79)
134 /* Image data: In RECTFMT_ARGB32 format (ULONG **) */
135 #define ICONCTRLA_GetARGBImageData1 (ICONA_BASE+301)
136 #define ICONCTRLA_GetARGBImageData2 (ICONA_BASE+303)
139 Check if this icon was allocated by icon.library or if it consists
140 solely of a statically allocated DiskObject. (LONG *)
142 #define ICONCTRLA_IsNativeIcon (ICONA_BASE+80)
144 /*** Icon aspect handling ***************************************************/
145 /* Icon aspect ratio is not known */
146 #define ICON_ASPECT_RATIO_UNKNOWN (0)
148 /* Pack the aspect ratio into a single byte */
149 #define PACK_ICON_ASPECT_RATIO(num,den) (((num) << 4) | (den))
151 /* Unpack the aspect ratio stored in a single byte */
152 #define UNPACK_ICON_ASPECT_RATIO(v,num,den) \
154 num = (((v) >> 4) & 15); \
158 /*** Tags for use with GetIconTagList() *************************************/
159 /* Default icon type to retrieve (LONG) */
160 #define ICONGETA_GetDefaultType (ICONA_BASE+45)
162 /* Retrieve default icon for the given name (STRPTR) */
163 #define ICONGETA_GetDefaultName (ICONA_BASE+46)
165 /* Return default icon if the requested icon file cannot be found (BOOL) */
166 #define ICONGETA_FailIfUnavailable (ICONA_BASE+47)
168 /* If possible, retrieve a palette mapped icon (BOOL) */
169 #define ICONGETA_GetPaletteMappedIcon (ICONA_BASE+48)
171 /* Set if the icon returned is a default icon (LONG *) */
172 #define ICONGETA_IsDefaultIcon (ICONA_BASE+49)
174 /* Remap the icon to the default screen, if possible (BOOL) */
175 #define ICONGETA_RemapIcon (ICONA_BASE+50)
177 /* Generate icon image masks (BOOL) */
178 #define ICONGETA_GenerateImageMasks (ICONA_BASE+51)
180 /* Label text to be assigned to the icon (STRPTR) */
181 #define ICONGETA_Label (ICONA_BASE+52)
183 /* Screen to remap the icon to (struct Screen *) */
184 #define ICONGETA_Screen (ICONA_BASE+69)
186 /*** Tags for use with PutIconTagList() *************************************/
187 /* Notify Workbench of the icon being written (BOOL) */
188 #define ICONPUTA_NotifyWorkbench (ICONA_BASE+53)
190 /* Store icon as the default for this type (LONG) */
191 #define ICONPUTA_PutDefaultType (ICONA_BASE+54)
193 /* Store icon as a default for the given name (STRPTR) */
194 #define ICONPUTA_PutDefaultName (ICONA_BASE+55)
197 Don't save the the original planar image with the file if writing a
198 palette mapped icon. Replace it with a tiny replacement image.
200 #define ICONPUTA_DropPlanarIconImage (ICONA_BASE+56)
202 /* Don't write the chunky icon image data to disk */
203 #define ICONPUTA_DropChunkyIconImage (ICONA_BASE+57)
205 /* Don't write the NewIcons tool types to disk */
206 #define ICONPUTA_DropNewIconToolTypes (ICONA_BASE+58)
208 /* Try to compress the image data more efficiently. */
209 #define ICONPUTA_OptimizeImageSpace (ICONA_BASE+59)
212 Don't write the entire icon file back to disk, only change
213 do->do_CurrentX / do->do_CurrentY.
215 #define ICONPUTA_OnlyUpdatePosition (ICONA_BASE+72)
218 Preserve the original planar image data when writing a pelette mapped
221 #define ICONPUTA_PreserveOldIconImages (ICONA_BASE+84)
223 /*** For use with the file identification hook ******************************/
224 struct IconIdentifyMsg
226 /* Libraries that are already opened. */
227 struct Library
* iim_SysBase
;
228 struct Library
* iim_DOSBase
;
229 struct Library
* iim_UtilityBase
;
230 struct Library
* iim_IconBase
;
232 /* File context information. */
233 BPTR iim_FileLock
; /* Lock on the object to return an icon for. */
234 BPTR iim_ParentLock
; /* Lock on the object's parent directory, if available. */
235 struct FileInfoBlock
* iim_FIB
; /* Already initialized. */
236 BPTR iim_FileHandle
; /* Pointer to the file to examine,
237 * positioned right at the first byte.
240 const struct TagItem
* iim_Tags
; /* Tags passed to GetIconTagList(). */
243 /*** Tags for use with DupDiskObjectA() *************************************/
244 /* Duplicate do_DrawerData */
245 #define ICONDUPA_DuplicateDrawerData (ICONA_BASE+60)
247 /* Duplicate the Image structures. */
248 #define ICONDUPA_DuplicateImages (ICONA_BASE+61)
250 /* Duplicate the image data (Image->ImageData) itself. */
251 #define ICONDUPA_DuplicateImageData (ICONA_BASE+62)
253 /* Duplicate the default tool. */
254 #define ICONDUPA_DuplicateDefaultTool (ICONA_BASE+63)
256 /* Duplicate the tool types list. */
257 #define ICONDUPA_DuplicateToolTypes (ICONA_BASE+64)
259 /* Duplicate the tool window. */
260 #define ICONDUPA_DuplicateToolWindow (ICONA_BASE+65)
263 If the icon to be duplicated is in fact a palette mapped icon which has
264 never been set up to be displayed on the screen, turn the duplicate into
265 that palette mapped icon.
267 #define ICONDUPA_ActivateImageData (ICONA_BASE+82)
269 /*** Tags for use with DrawIconStateA() and GetIconRectangleA() *************/
270 /* Drawing information to use (struct DrawInfo *) */
271 #define ICONDRAWA_DrawInfo (ICONA_BASE+66)
273 /* Draw the icon without the surrounding frame (BOOL) */
274 #define ICONDRAWA_Frameless (ICONA_BASE+70)
276 /* Erase the background before drawing a frameless icon (BOOL) */
277 #define ICONDRAWA_EraseBackground (ICONA_BASE+71)
279 /* Draw the icon without the surrounding border and frame (BOOL) */
280 #define ICONDRAWA_Borderless (ICONA_BASE+83)
282 /*** Reserved tags **********************************************************/
283 #define ICONA_Reserved1 (ICONA_BASE+73)
284 #define ICONA_Reserved2 (ICONA_BASE+74)
285 #define ICONA_Reserved3 (ICONA_BASE+76)
286 #define ICONA_Reserved4 (ICONA_BASE+81)
287 #define ICONA_Reserved5 (ICONA_BASE+85)
288 #define ICONA_Reserved6 (ICONA_BASE+86)
289 #define ICONA_Reserved7 (ICONA_BASE+87)
290 #define ICONA_Reserved8 (ICONA_BASE+88)
292 /*** Last tag ***************************************************************/
293 #define ICONA_LAST_TAG (ICONA_BASE+88)
295 #endif /* WORKBENCH_ICON_H */