fix off-by-1 screen title fill
[AROS.git] / rom / intuition / setgadgetattrsa.c
blob9498abc2d2148bd8ef6caf7a7eb10ab7d741395c
1 /*
2 Copyright © 1995-2007, 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" Dokument.
62 INTERNALS
63 SetGadgetAttrsA(gad, win, req, tags) ist just a replacement for
64 DoGadgetMethod(gad, win, req, OM_SET, tags, NULL).
66 HISTORY
68 *****************************************************************************/
70 AROS_LIBFUNC_INIT
72 struct opSet ops;
73 IPTR result;
75 DEBUG_SETGADGETATTRS(dprintf("SetGadgetAttrs[%x]: Gadget 0x%lx Window 0x%lx Requester 0x%lx Tags 0x%lx\n",
76 &ops, gadget, window, requester, tagList));
78 SANITY_CHECKR(gadget,FALSE)
79 SANITY_CHECKR(tagList,FALSE)
81 #if 0
82 if (tagList)
84 struct TagItem *state = tagList;
85 struct TagItem *tag;
87 while (tag = NextTagItem(&state))
89 dprintf("\t%08lx %08lx\n", tag->ti_Tag, tag->ti_Data);
92 #endif
94 ops.MethodID = OM_SET;
95 ops.ops_AttrList = tagList;
96 ops.ops_GInfo = 0; /* Not really necessary as it will be filled in by DoGadgetMethodA */
98 if (window || requester)
100 result = DoGadgetMethodA(gadget, window, requester, (Msg)&ops);
102 else
104 result = DoMethodA((Object *)gadget, (Msg)&ops);
107 DEBUG_SETGADGETATTRS(dprintf("SetGadgetAttrs[%x]: Return 0x%lx\n", &ops, result));
109 return result;
111 AROS_LIBFUNC_EXIT
113 } /* SetGadgetAttrsA */