Updated PCI IDs to latest snapshot.
[tangerine.git] / workbench / libs / gadtools / gt_setgadgetattrsa.c
blob9fbe9ccff34f28a2ec68c677b87e8d1d6be33557
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
8 #include <proto/intuition.h>
9 #include <proto/utility.h>
10 #include "gadtools_intern.h"
12 /*********************************************************************
14 NAME */
15 #include <proto/gadtools.h>
16 #include <proto/intuition.h>
17 #include <intuition/intuition.h>
18 #include <utility/tagitem.h>
20 AROS_LH4(void, GT_SetGadgetAttrsA,
22 /* SYNOPSIS */
23 AROS_LHA(struct Gadget *, gad, A0),
24 AROS_LHA(struct Window *, win, A1),
25 AROS_LHA(struct Requester *, req, A2),
26 AROS_LHA(struct TagItem *, tagList, A3),
28 /* LOCATION */
29 struct Library *, GadToolsBase, 7, GadTools)
31 /* FUNCTION
32 Change the attribute of the given gadget according to the
33 attributes chosen in the tag list. If an attribute is not
34 provided in the tag list, its value remains unchanged.
36 INPUTS
37 gad - Gadget, for which the specified attributes should be set for.
38 May be be NULL. If so this functions does nothing.
39 win - Window, in which the gadget is.
40 req - Not used. Specify NULL for now.
41 tagList - List of attributes to set.
43 RESULT
44 The gadget may be set to the specified attributes.
46 NOTES
48 EXAMPLE
50 BUGS
52 SEE ALSO
53 GT_GetGadgetAttrsA(), intuition.library/SetGadgetAttrsA()
55 INTERNALS
57 HISTORY
59 ***************************************************************************/
61 AROS_LIBFUNC_INIT
63 if (!gad) return; /* Since V39 gad pointer may be NULL */
65 if ((gad->GadgetType & GTYP_GTYPEMASK) == GTYP_CUSTOMGADGET)
67 if (win || req)
69 SetGadgetAttrsA(gad, win, req, tagList);
71 else
73 SetAttrsA((Object *)gad, tagList);
76 else
78 /* must be GENERIC_KIND gadget */
80 struct TagItem *tag;
81 const struct TagItem *tstate = tagList;
82 BOOL redraw = FALSE;
84 while((tag = NextTagItem(&tstate)))
86 switch(tag->ti_Tag)
88 case GA_Disabled:
89 if (tag->ti_Data)
91 gad->Flags |= GFLG_DISABLED;
93 else
95 gad->Flags &= ~GFLG_DISABLED;
97 redraw = TRUE;
98 break;
103 if (redraw && (win || req)) RefreshGList(gad, win, req, 1);
107 AROS_LIBFUNC_EXIT
109 } /* GT_SetGadgetAttrsA */