Minor fixes to comments.
[AROS.git] / rom / intuition / modifyprop.c
blobbeb0bd944bd830455d79bd2815401d1f1ab6ae98
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 <proto/layers.h>
8 #include "intuition_intern.h"
10 /*****************************************************************************
12 NAME */
13 #include <intuition/intuition.h>
14 #include <proto/intuition.h>
16 AROS_LH8(void, ModifyProp,
18 /* SYNOPSIS */
19 AROS_LHA(struct Gadget *, gadget, A0),
20 AROS_LHA(struct Window *, window, A1),
21 AROS_LHA(struct Requester *, requester, A2),
22 AROS_LHA(ULONG , flags, D0),
23 AROS_LHA(ULONG , horizPot, D1),
24 AROS_LHA(ULONG , vertPot, D2),
25 AROS_LHA(ULONG , horizBody, D3),
26 AROS_LHA(ULONG , vertBody, D4),
28 /* LOCATION */
29 struct IntuitionBase *, IntuitionBase, 26, Intuition)
31 /* FUNCTION
32 Changes the values in the PropInfo-structure of a proportional
33 gadget and refreshes the display.
35 INPUTS
36 gadget - Must be a PROPGADGET
37 window - The window which contains the gadget
38 requester - If the gadget has GTYP_REQGADGET set, this must be
39 non-NULL.
40 flags - New flags
41 horizPot - New value for the HorizPot field of the PropInfo
42 vertPot - New value for the VertPot field of the PropInfo
43 horizBody - New value for the HorizBody field of the PropInfo
44 vertBody - New value for the VertBody field of the PropInfo
46 RESULT
47 None.
49 NOTES
50 This function causes all gadgets from this gadget to the end of
51 the gadget list to be refreshed. If you want a better behaviour,
52 use NewModifProp().
54 EXAMPLE
56 BUGS
58 SEE ALSO
59 NewModifyProp()
61 INTERNALS
63 HISTORY
64 29-10-95 digulla automatically created from
65 intuition_lib.fd and clib/intuition_protos.h
67 *****************************************************************************/
69 AROS_LIBFUNC_INIT
71 struct PropInfo * pi;
73 if ((gadget->GadgetType & GTYP_GTYPEMASK) != GTYP_PROPGADGET
74 || !gadget->SpecialInfo || !window)
76 return;
79 EXTENDUWORD(horizPot);
80 EXTENDUWORD(vertPot);
81 EXTENDUWORD(horizBody);
82 EXTENDUWORD(vertBody);
83 EXTENDUWORD(flags);
85 pi = gadget->SpecialInfo;
87 /* We don't want the inputhandler to redraw the knob with values
88 * partially changed, so use some protection.
90 #ifdef USEGADGETLOCK
91 ObtainSemaphore(&GetPrivIBase(IntuitionBase)->InputHandlerLock);
92 #else
93 LOCKWINDOWLAYERS(window);
94 #endif
95 pi->Flags = flags;
96 pi->HorizPot = horizPot;
97 pi->VertPot = vertPot;
98 pi->HorizBody = horizBody;
99 pi->VertBody = vertBody;
101 RefreshGadgets (gadget, window, requester);
103 #ifdef USEGADGETLOCK
104 ReleaseSemaphore(&GetPrivIBase(IntuitionBase)->InputHandlerLock);
105 #else
106 UNLOCKWINDOWLAYERS(window);
107 #endif
109 AROS_LIBFUNC_EXIT
110 } /* ModifyProp */