Check for SYS/GL during library init. Reason is that
[AROS.git] / workbench / libs / gadtools / drawbevelboxa.c
blobee3cad11aa3f43dc81ebf925e7a7a44a58fa8862
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Draw a bevelled box.
6 */
7 #include <proto/exec.h>
8 #include <proto/graphics.h>
9 #include <intuition/classusr.h>
10 #include <intuition/imageclass.h>
11 #include <intuition/screens.h>
12 #include "gadtools_intern.h"
14 /*********************************************************************
16 NAME */
17 #include <proto/gadtools.h>
18 #include <libraries/gadtools.h>
19 #include <graphics/rastport.h>
20 #include <utility/tagitem.h>
22 AROS_LH6(void, DrawBevelBoxA,
24 /* SYNOPSIS */
25 AROS_LHA(struct RastPort *, rport, A0),
26 AROS_LHA(WORD, left, D0),
27 AROS_LHA(WORD, top, D1),
28 AROS_LHA(WORD, width, D2),
29 AROS_LHA(WORD, height, D3),
30 AROS_LHA(struct TagItem *, taglist, A1),
32 /* LOCATION */
33 struct Library *, GadToolsBase, 20, GadTools)
35 /* FUNCTION
36 DrawBevelBoxA() does just that. It draws a bevelled box.
38 INPUTS
39 rport - rastport, in which the box should be drawn
40 left - left edge of the box
41 top - top edge of the box
42 width - width of the box
43 height - height og the box
44 taglist - additional tags
46 RESULT
48 NOTES
49 Boxes drawn with DrawBevelBox() aren't refreshed automatically.
50 You have to refresh them yourself.
51 DrawBevelBoxA() might modify the rastport to guarantee fast drawing.
53 EXAMPLE
55 BUGS
57 SEE ALSO
59 INTERNALS
61 HISTORY
63 ***************************************************************************/
65 AROS_LIBFUNC_INIT
67 struct VisualInfo *vi;
68 struct TagItem tags[5];
70 vi = (struct VisualInfo *) GetTagData(GT_VisualInfo, (IPTR) NULL, taglist);
71 if (vi == NULL)
72 return;
74 tags[0].ti_Tag = IA_Width;
75 tags[0].ti_Data = width;
76 tags[1].ti_Tag = IA_Height;
77 tags[1].ti_Data = height;
78 tags[2].ti_Tag = IA_Recessed;
79 tags[2].ti_Data = GetTagData(GTBB_Recessed, FALSE, taglist);
80 tags[3].ti_Tag = IA_FrameType;
81 tags[3].ti_Data = GetTagData(GTBB_FrameType, BBFT_BUTTON, taglist);
82 tags[4].ti_Tag = TAG_DONE;
84 if (rport->Layer) LockLayerRom(rport->Layer);
85 ObtainSemaphore(&GTB(GadToolsBase)->bevelsema);
86 SetAttrsA(GTB(GadToolsBase)->bevel, tags);
87 DrawImageState(rport, GTB(GadToolsBase)->bevel,
88 left, top,
89 IDS_NORMAL, vi->vi_dri);
90 ReleaseSemaphore(&GTB(GadToolsBase)->bevelsema);
91 if (rport->Layer) UnlockLayerRom(rport->Layer);
93 AROS_LIBFUNC_EXIT
95 } /* DrawBevelBoxA */