mesa: simplify dependencies in mmakefiles
[AROS.git] / compiler / include / workbench / icon.h
blob3bb0a3257ad716015967479ca23e6d37c2592ed0
1 #ifndef WORKBENCH_ICON_H
2 #define WORKBENCH_ICON_H
4 /*
5 Copyright © 1995-2008, The AROS Development Team. All rights reserved.
6 $Id$
7 */
9 #ifndef GRAPHICS_VIEW_H
10 # include <graphics/view.h>
11 #endif
13 #ifndef INTUITION_IMAGECLASS_H
14 # include <intuition/imageclass.h>
15 #endif
17 #ifndef UTILITY_TAGITEM_H
18 # include <utility/tagitem.h>
19 #endif
21 #ifndef DATATYPES_PICTURECLASS_H
22 # include <datatypes/pictureclass.h>
23 #endif
25 #ifndef DOS_DOS_H
26 # include <dos/dos.h>
27 #endif
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 (SIPTR *) */
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 /*** AROS Specific ******************************/
77 Scale all icons to a bounding box.
78 width is the upper 16 bits, height is the lower 16.
80 If set to -1.-1, icons which have source resolution
81 information are dynamically rescaled. All others
82 are left unchanged.
84 If set to 0.0, icons are shown pixel-for-pixel.
86 #define ICONCTRLA_GetGlobalScaleBox (ICONA_BASE+401)
87 #define ICONCTRLA_SetGlobalScaleBox (ICONA_BASE+402)
89 /*** Per icon local options for IconControlA() ******************************/
90 /* Get the icon rendering masks (PLANEPTR) */
91 #define ICONCTRLA_GetImageMask1 (ICONA_BASE+14)
92 #define ICONCTRLA_GetImageMask2 (ICONA_BASE+15)
94 /* Transparent image color, set to -1 if opaque */
95 #define ICONCTRLA_SetTransparentColor1 (ICONA_BASE+16)
96 #define ICONCTRLA_GetTransparentColor1 (ICONA_BASE+17)
97 #define ICONCTRLA_SetTransparentColor2 (ICONA_BASE+18)
98 #define ICONCTRLA_GetTransparentColor2 (ICONA_BASE+19)
100 /* Image color palette (struct ColorRegister *) */
101 #define ICONCTRLA_SetPalette1 (ICONA_BASE+20)
102 #define ICONCTRLA_GetPalette1 (ICONA_BASE+21)
103 #define ICONCTRLA_SetPalette2 (ICONA_BASE+22)
104 #define ICONCTRLA_GetPalette2 (ICONA_BASE+23)
106 /* Size of image color palette (LONG) */
107 #define ICONCTRLA_SetPaletteSize1 (ICONA_BASE+24)
108 #define ICONCTRLA_GetPaletteSize1 (ICONA_BASE+25)
109 #define ICONCTRLA_SetPaletteSize2 (ICONA_BASE+26)
110 #define ICONCTRLA_GetPaletteSize2 (ICONA_BASE+27)
112 /* Image data; one by per pixel (UBYTE *) */
113 #define ICONCTRLA_SetImageData1 (ICONA_BASE+28)
114 #define ICONCTRLA_GetImageData1 (ICONA_BASE+29)
115 #define ICONCTRLA_SetImageData2 (ICONA_BASE+30)
116 #define ICONCTRLA_GetImageData2 (ICONA_BASE+31)
118 /* Render image without frame (BOOL) */
119 #define ICONCTRLA_SetFrameless (ICONA_BASE+32)
120 #define ICONCTRLA_GetFrameless (ICONA_BASE+33)
122 /* Enable NewIcons support (BOOL) */
123 #define ICONCTRLA_SetNewIconsSupport (ICONA_BASE+34)
124 #define ICONCTRLA_GetNewIconsSupport (ICONA_BASE+35)
126 /* Icon aspect ratio (UBYTE *) */
127 #define ICONCTRLA_SetAspectRatio (ICONA_BASE+36)
128 #define ICONCTRLA_GetAspectRatio (ICONA_BASE+37)
130 /* Icon dimensions, valid only for palette mapped icon images (LONG) */
131 #define ICONCTRLA_SetWidth (ICONA_BASE+38)
132 #define ICONCTRLA_GetWidth (ICONA_BASE+39)
133 #define ICONCTRLA_SetHeight (ICONA_BASE+40)
134 #define ICONCTRLA_GetHeight (ICONA_BASE+41)
136 /* Check whether the icon is palette mapped (LONG *) */
137 #define ICONCTRLA_IsPaletteMapped (ICONA_BASE+42)
139 /* Get the screen the icon is attached to (struct Screen **) */
140 #define ICONCTRLA_GetScreen (ICONA_BASE+43)
142 /* Check whether the icon has a real select image (LONG *) */
143 #define ICONCTRLA_HasRealImage2 (ICONA_BASE+44)
145 /* Check whether the icon is of the NewIcon type (LONG *) */
146 #define ICONCTRLA_IsNewIcon (ICONA_BASE+79)
148 /* Image data: In RECTFMT_ARGB32 format (ULONG **) */
149 #define ICONCTRLA_GetARGBImageData1 (ICONA_BASE+301)
150 #define ICONCTRLA_SetARGBImageData1 (ICONA_BASE+302)
151 #define ICONCTRLA_GetARGBImageData2 (ICONA_BASE+303)
152 #define ICONCTRLA_SetARGBImageData2 (ICONA_BASE+304)
155 Check if this icon was allocated by icon.library or if it consists
156 solely of a statically allocated DiskObject. (LONG *)
158 #define ICONCTRLA_IsNativeIcon (ICONA_BASE+80)
160 /*** AROS Specific ******************************/
162 Scale all icons to a bounding box.
163 width is the upper 16 bits, height is the lower 16.
165 If set to 0.0, the global defaults are used.
167 If set to -1.-1, the icon is shown pixel-for-pixel
169 #define ICONCTRLA_GetScaleBox (ICONA_BASE+403)
170 #define ICONCTRLA_SetScaleBox (ICONA_BASE+404)
172 #define ICON_SCALEBOX_DEFAULT (0)
173 #define ICON_SCALEBOX_AUTOSCALE (0xffffffff)
174 #define PACK_ICON_SCALEBOX(maxw, maxh) ((((ULONG)maxw)<<16) | (UWORD)(maxh))
175 #define UNPACK_ICON_SCALEBOX(v, maxw, maxh) \
176 do { \
177 maxw = (WORD)(((v) >> 16) & 0xffff); \
178 maxh = (WORD)(((v) >> 0) & 0xffff); \
179 } while (0)
182 /*** Icon aspect handling ***************************************************/
183 /* Icon aspect ratio is not known */
184 #define ICON_ASPECT_RATIO_UNKNOWN (0)
186 /* Pack the aspect ratio into a single byte */
187 #define PACK_ICON_ASPECT_RATIO(num,den) (((num) << 4) | (den))
189 /* Unpack the aspect ratio stored in a single byte */
190 #define UNPACK_ICON_ASPECT_RATIO(v,num,den) \
191 do { \
192 num = (((v) >> 4) & 15); \
193 den = ( (v) & 15); \
194 } while(0)
196 /*** Tags for use with GetIconTagList() *************************************/
197 /* Default icon type to retrieve (LONG) */
198 #define ICONGETA_GetDefaultType (ICONA_BASE+45)
200 /* Retrieve default icon for the given name (STRPTR) */
201 #define ICONGETA_GetDefaultName (ICONA_BASE+46)
203 /* Return default icon if the requested icon file cannot be found (BOOL) */
204 #define ICONGETA_FailIfUnavailable (ICONA_BASE+47)
206 /* If possible, retrieve a palette mapped icon (BOOL) */
207 #define ICONGETA_GetPaletteMappedIcon (ICONA_BASE+48)
209 /* Set if the icon returned is a default icon (LONG *) */
210 #define ICONGETA_IsDefaultIcon (ICONA_BASE+49)
212 /* Remap the icon to the default screen, if possible (BOOL) */
213 #define ICONGETA_RemapIcon (ICONA_BASE+50)
215 /* Generate icon image masks (BOOL) */
216 #define ICONGETA_GenerateImageMasks (ICONA_BASE+51)
218 /* Label text to be assigned to the icon (STRPTR) */
219 #define ICONGETA_Label (ICONA_BASE+52)
221 /* Screen to remap the icon to (struct Screen *) */
222 #define ICONGETA_Screen (ICONA_BASE+69)
224 /*** Tags for use with PutIconTagList() *************************************/
225 /* Notify Workbench of the icon being written (BOOL) */
226 #define ICONPUTA_NotifyWorkbench (ICONA_BASE+53)
228 /* Store icon as the default for this type (LONG) */
229 #define ICONPUTA_PutDefaultType (ICONA_BASE+54)
231 /* Store icon as a default for the given name (STRPTR) */
232 #define ICONPUTA_PutDefaultName (ICONA_BASE+55)
235 Don't save the the original planar image with the file if writing a
236 palette mapped icon. Replace it with a tiny replacement image.
238 #define ICONPUTA_DropPlanarIconImage (ICONA_BASE+56)
240 /* Don't write the chunky icon image data to disk */
241 #define ICONPUTA_DropChunkyIconImage (ICONA_BASE+57)
243 /* Don't write the NewIcons tool types to disk */
244 #define ICONPUTA_DropNewIconToolTypes (ICONA_BASE+58)
246 /* Try to compress the image data more efficiently. */
247 #define ICONPUTA_OptimizeImageSpace (ICONA_BASE+59)
250 Don't write the entire icon file back to disk, only change
251 do->do_CurrentX / do->do_CurrentY.
253 #define ICONPUTA_OnlyUpdatePosition (ICONA_BASE+72)
256 Preserve the original planar image data when writing a pelette mapped
257 icon to disk (BOOL).
259 #define ICONPUTA_PreserveOldIconImages (ICONA_BASE+84)
261 /*** For use with the file identification hook ******************************/
262 struct IconIdentifyMsg
264 /* Libraries that are already opened. */
265 struct Library * iim_SysBase;
266 struct Library * iim_DOSBase;
267 struct Library * iim_UtilityBase;
268 struct Library * iim_IconBase;
270 /* File context information. */
271 BPTR iim_FileLock; /* Lock on the object to return an icon for. */
272 BPTR iim_ParentLock; /* Lock on the object's parent directory, if available. */
273 struct FileInfoBlock * iim_FIB; /* Already initialized. */
274 BPTR iim_FileHandle; /* Pointer to the file to examine,
275 * positioned right at the first byte.
276 * May be NULL.
278 const struct TagItem * iim_Tags; /* Tags passed to GetIconTagList(). */
281 /*** Tags for use with DupDiskObjectA() *************************************/
282 /* Duplicate do_DrawerData */
283 #define ICONDUPA_DuplicateDrawerData (ICONA_BASE+60)
285 /* Duplicate the Image structures. */
286 #define ICONDUPA_DuplicateImages (ICONA_BASE+61)
288 /* Duplicate the image data (Image->ImageData) itself. */
289 #define ICONDUPA_DuplicateImageData (ICONA_BASE+62)
291 /* Duplicate the default tool. */
292 #define ICONDUPA_DuplicateDefaultTool (ICONA_BASE+63)
294 /* Duplicate the tool types list. */
295 #define ICONDUPA_DuplicateToolTypes (ICONA_BASE+64)
297 /* Duplicate the tool window. */
298 #define ICONDUPA_DuplicateToolWindow (ICONA_BASE+65)
301 If the icon to be duplicated is in fact a palette mapped icon which has
302 never been set up to be displayed on the screen, turn the duplicate into
303 that palette mapped icon.
305 #define ICONDUPA_ActivateImageData (ICONA_BASE+82)
307 /*** Tags for use with DrawIconStateA() and GetIconRectangleA() *************/
308 /* Drawing information to use (struct DrawInfo *) */
309 #define ICONDRAWA_DrawInfo (ICONA_BASE+66)
311 /* Draw the icon without the surrounding frame (BOOL) */
312 #define ICONDRAWA_Frameless (ICONA_BASE+70)
314 /* Erase the background before drawing a frameless icon (BOOL) */
315 #define ICONDRAWA_EraseBackground (ICONA_BASE+71)
317 /* Draw the icon without the surrounding border and frame (BOOL) */
318 #define ICONDRAWA_Borderless (ICONA_BASE+83)
320 /*** Reserved tags **********************************************************/
321 #define ICONA_Reserved1 (ICONA_BASE+73)
322 #define ICONA_Reserved2 (ICONA_BASE+74)
323 #define ICONA_Reserved3 (ICONA_BASE+76)
324 #define ICONA_Reserved4 (ICONA_BASE+81)
325 #define ICONA_Reserved5 (ICONA_BASE+85)
326 #define ICONA_Reserved6 (ICONA_BASE+86)
327 #define ICONA_Reserved7 (ICONA_BASE+87)
328 #define ICONA_Reserved8 (ICONA_BASE+88)
330 /*** Last tag ***************************************************************/
331 #define ICONA_LAST_TAG (ICONA_BASE+88)
333 #endif /* WORKBENCH_ICON_H */