Minor fixes to comments.
[AROS.git] / rom / intuition / offgadget.c
blob5f7f6d1ddb19e0e239b2e06e567a72438cd6e94a
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 "intuition_intern.h"
8 #include <intuition/gadgetclass.h>
10 /*****************************************************************************
12 NAME */
13 #include <intuition/intuition.h>
14 #include <proto/intuition.h>
16 AROS_LH3(void, OffGadget,
18 /* SYNOPSIS */
19 AROS_LHA(struct Gadget *, gadget, A0),
20 AROS_LHA(struct Window *, window, A1),
21 AROS_LHA(struct Requester *, requester, A2),
23 /* LOCATION */
24 struct IntuitionBase *, IntuitionBase, 29, Intuition)
26 /* FUNCTION
27 Disable a gadget. It will appear ghosted.
29 INPUTS
30 gadget - The gadget to deactivate
31 window - The window, the gadget is in
32 requester - The requester, the gadget is in or NULL if the
33 gadget is in no requester
35 RESULT
36 None.
38 NOTES
39 This function will update the gadget (unlike the original function
40 which would update all gadgets in the window).
42 EXAMPLE
44 BUGS
46 SEE ALSO
47 AddGadget(), RefreshGadgets()
49 INTERNALS
51 HISTORY
53 *****************************************************************************/
55 AROS_LIBFUNC_INIT
57 DEBUG_OFFGADGET(dprintf("OffGadget: gadget 0x%lx window 0x%lx req 0x%lx\n",
58 gadget, window, requester));
60 SANITY_CHECK(window)
61 SANITY_CHECK(gadget)
63 if ((gadget->GadgetType & GTYP_GTYPEMASK) == GTYP_CUSTOMGADGET)
65 struct TagItem set_tags[] =
67 {GA_Disabled, TRUE },
68 {TAG_END }
71 SetGadgetAttrsA(gadget, window, requester, set_tags);
73 else
75 AROS_ATOMIC_OR(gadget->Flags, GFLG_DISABLED);
78 RefreshGList (gadget, window, requester, 1);
80 AROS_LIBFUNC_EXIT
81 } /* OffGadget */