Autodocs updated.
[cake.git] / workbench / libs / icon / geticonrectangle.c
blob77d9f2a5713c6aec8dee67d389d336a8f82a6797
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include "icon_intern.h"
8 /*****************************************************************************
10 NAME */
11 #include <proto/icon.h>
13 AROS_LH5(BOOL, GetIconRectangleA,
15 /* SYNOPSIS */
16 AROS_LHA(struct RastPort *, rp, A0),
17 AROS_LHA(struct DiskObject *, icon, A1),
18 AROS_LHA(STRPTR, label, A2),
19 AROS_LHA(struct Rectangle *, rectangle, A3),
20 AROS_LHA(struct TagItem *, tags, A4),
21 /* LOCATION */
22 struct Library *, IconBase, 28, Icon)
24 /* FUNCTION
25 Query size of icon.
27 INPUTS
28 rp - reference RastPort (for font)
29 icon - icon to be queried
30 label - label string
31 rectangle - resulting size
33 RESULT
34 TRUE success
36 NOTES
37 Only very limited implemented.
39 EXAMPLE
41 BUGS
43 SEE ALSO
45 INTERNALS
47 HISTORY
49 *****************************************************************************/
51 AROS_LIBFUNC_INIT
53 struct NativeIcon *nativeicon;
55 nativeicon = GetNativeIcon(icon, LB(IconBase));
56 if (nativeicon && nativeicon->icon35.img1.imagedata)
58 rectangle->MinX = 0;
59 rectangle->MinY = 0;
60 rectangle->MaxX = nativeicon->icon35.width - 1;
61 rectangle->MaxY = nativeicon->icon35.height - 1;
62 } else
64 rectangle->MinX = 0;
65 rectangle->MinY = 0;
66 rectangle->MaxX = icon->do_Gadget.Width - 1;
67 rectangle->MaxY = icon->do_Gadget.Height - 1;
70 #warning GetIconRectangleA() is only very limited implemented
72 return TRUE;
74 AROS_LIBFUNC_EXIT
75 } /* GetIconRectangle */