2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
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 /*****************************************************************************
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
,
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
),
33 struct IntuitionBase
*, IntuitionBase
, 110, Intuition
)
36 Sets some tags and provides gadget specific data. Prefer this to
37 SetAttrsA(), if you are manipulating gadgets.
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
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.
51 This function sends OM_SET to the gadget object.
58 NewObjectA(), SetAttrsA(), GetAttr(), DoGadgetMethodA(),
59 "Basic Object-Oriented Programming System for Intuition" and
60 "Boopsi Class Reference" Document.
63 SetGadgetAttrsA(gad, win, req, tags) is just a replacement for
64 DoGadgetMethod(gad, win, req, OM_SET, tags, NULL).
66 *****************************************************************************/
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
)
82 struct TagItem
*state
= tagList
;
85 while (tag
= NextTagItem(&state
))
87 dprintf("\t%08lx %08lx\n", tag
->ti_Tag
, tag
->ti_Data
);
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
);
102 result
= DoMethodA((Object
*)gadget
, (Msg
)&ops
);
105 DEBUG_SETGADGETATTRS(dprintf("SetGadgetAttrs[%x]: Return 0x%lx\n", &ops
, result
));
111 } /* SetGadgetAttrsA */