try to make sure compiler/include/mmakefile is always refreshed correctly.
[AROS.git] / rom / intuition / setgadgetattrsa.c
blob7dcf46a9972006ad36f0f6fa9f53da0b79628346
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
4 $Id$
5 */
7 #include <exec/memory.h>
8 #include <intuition/cghooks.h>
9 #include <intuition/classusr.h>
10 #include <intuition/classes.h>
11 #include <proto/alib.h>
12 #include <proto/exec.h>
13 #include <proto/utility.h>
14 #include "intuition_intern.h"
16 /*****************************************************************************
18 NAME */
19 #include <exec/types.h>
20 #include <intuition/intuition.h>
21 #include <proto/intuition.h>
22 #include <utility/tagitem.h>
24 AROS_LH4(IPTR, SetGadgetAttrsA,
26 /* SYNOPSIS */
27 AROS_LHA(struct Gadget *, gadget, A0),
28 AROS_LHA(struct Window *, window, A1),
29 AROS_LHA(struct Requester *, requester, A2),
30 AROS_LHA(struct TagItem *, tagList, A3),
32 /* LOCATION */
33 struct IntuitionBase *, IntuitionBase, 110, Intuition)
35 /* FUNCTION
36 Sets some tags and provides gadget specific data. Prefer this to
37 SetAttrsA(), if you are manipulating gadgets.
39 INPUTS
40 gadget - Change the attributes of this gadget
41 window - The window of the gadget
42 requester - The requester of the gadget (or NULL)
43 tagList - This is a list of attribute/value-pairs
45 RESULT
46 Depends in the class. For gadgets, this value is non-zero if
47 they need redrawing after the values have changed. Other classes
48 will define other return values.
50 NOTES
51 This function sends OM_SET to the gadget object.
53 EXAMPLE
55 BUGS
57 SEE ALSO
58 NewObjectA(), SetAttrsA(), GetAttr(), DoGadgetMethodA(),
59 "Basic Object-Oriented Programming System for Intuition" and
60 "Boopsi Class Reference" Document.
62 INTERNALS
63 SetGadgetAttrsA(gad, win, req, tags) is just a replacement for
64 DoGadgetMethod(gad, win, req, OM_SET, tags, NULL).
66 *****************************************************************************/
68 AROS_LIBFUNC_INIT
70 struct opSet ops;
71 IPTR result;
73 DEBUG_SETGADGETATTRS(dprintf("SetGadgetAttrs[%x]: Gadget 0x%lx Window 0x%lx Requester 0x%lx Tags 0x%lx\n",
74 &ops, gadget, window, requester, tagList));
76 SANITY_CHECKR(gadget,FALSE)
77 SANITY_CHECKR(tagList,FALSE)
79 #if 0
80 if (tagList)
82 struct TagItem *state = tagList;
83 struct TagItem *tag;
85 while (tag = NextTagItem(&state))
87 dprintf("\t%08lx %08lx\n", tag->ti_Tag, tag->ti_Data);
90 #endif
92 ops.MethodID = OM_SET;
93 ops.ops_AttrList = tagList;
94 ops.ops_GInfo = 0; /* Not really necessary as it will be filled in by DoGadgetMethodA */
96 if (window || requester)
98 result = DoGadgetMethodA(gadget, window, requester, (Msg)&ops);
100 else
102 result = DoMethodA((Object *)gadget, (Msg)&ops);
105 DEBUG_SETGADGETATTRS(dprintf("SetGadgetAttrs[%x]: Return 0x%lx\n", &ops, result));
107 return result;
109 AROS_LIBFUNC_EXIT
111 } /* SetGadgetAttrsA */