Check for SYS/GL during library init. Reason is that
[AROS.git] / rom / intuition / helpcontrol.c
blobf00202863b5dc22c94a274c853783cf2354be7c9
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 "intuition_intern.h"
9 /*****************************************************************************
11 NAME */
12 #include <proto/intuition.h>
14 AROS_LH2(void, HelpControl,
16 /* SYNOPSIS */
17 AROS_LHA(struct Window *, window, A0),
18 AROS_LHA(ULONG , flags, D0),
20 /* LOCATION */
21 struct IntuitionBase *, IntuitionBase, 138, Intuition)
23 /* FUNCTION
24 Turn on or off Gadget-Help for your window. Gadget-Help will also be
25 changed for all members of the same help-group to make
26 multiple-windows apps behave well.
28 INPUTS
29 window - The window to affect. All windows of the same help-group
30 will be affected as well.
31 flags - HC_GADGETHELP or zero for turning help on or off.
33 RESULT
34 None.
36 NOTES
37 The WA_HelpGroup and WA_HelpGroupWindow tags are relevant to this
38 function.
40 EXAMPLE
42 BUGS
44 SEE ALSO
45 OpenWindowTagList()
47 INTERNALS
49 *****************************************************************************/
51 AROS_LIBFUNC_INIT
53 ULONG ilock;
54 ULONG clearmask = 0;
55 ULONG setmask = 0;
57 ASSERT_VALID_PTR(window);
59 SANITY_CHECK(window)
61 ilock = LockIBase(0);
63 if (flags & HC_GADGETHELP)
65 setmask |= HELPF_GADGETHELP;
67 else
69 clearmask |= HELPF_GADGETHELP;
72 #define CHANGEHELPFLAGS(x) ( IW(x)->helpflags = (IW(x)->helpflags | setmask) & ~clearmask )
74 CHANGEHELPFLAGS(window);
76 if (IW(window)->helpflags & HELPF_ISHELPGROUP)
78 struct Screen *scr = IntuitionBase->FirstScreen;
80 for(; scr; scr = scr->NextScreen)
82 struct Window *win = scr->FirstWindow;
84 for(; win; win = win->NextWindow)
86 if ( (IW(win)->helpflags & HELPF_ISHELPGROUP) &&
87 (IW(win)->helpgroup == IW(window)->helpgroup) )
89 CHANGEHELPFLAGS(win);
95 UnlockIBase(ilock);
97 AROS_LIBFUNC_EXIT
98 } /* HelpControl */