Updated PCI IDs to latest snapshot.
[tangerine.git] / rom / intuition / newmodifyprop.c
blob8aa439a1d9a13374919152d1a1215bc9a0688083
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"
9 #include "inputhandler.h"
10 #include "inputhandler_actions.h"
11 #include "propgadgets.h"
12 #include <intuition/intuition.h>
14 /******************************************************************** *********
16 NAME */
17 #include <proto/intuition.h>
19 AROS_LH9(void, NewModifyProp,
21 /* SYNOPSIS */
22 AROS_LHA(struct Gadget *, gadget, A0),
23 AROS_LHA(struct Window *, window, A1),
24 AROS_LHA(struct Requester *, requester, A2),
25 AROS_LHA(ULONG , flags, D0),
26 AROS_LHA(ULONG , horizPot, D1),
27 AROS_LHA(ULONG , vertPot, D2),
28 AROS_LHA(ULONG , horizBody, D3),
29 AROS_LHA(ULONG , vertBody, D4),
30 AROS_LHA(LONG , numGad, D5),
32 /* LOCATION */
33 struct IntuitionBase *, IntuitionBase, 78, Intuition)
35 /* FUNCTION
36 Changes the values in the PropInfo-structure of a proportional
37 gadget and refreshes the specified number of gadgets beginning
38 at the proportional gadget. If numGad is 0 (zero), then no
39 refreshing is done.
41 INPUTS
42 gadget - Must be a PROPGADGET
43 window - The window which contains the gadget
44 requester - If the gadget has GTYP_REQGADGET set, this must be
45 non-NULL.
46 flags - New flags
47 horizPot - New value for the HorizPot field of the PropInfo
48 vertPot - New value for the VertPot field of the PropInfo
49 horizBody - New value for the HorizBody field of the PropInfo
50 vertBody - New value for the VertBody field of the PropInfo
51 numGad - How many gadgets to refresh. 0 means none (not even
52 the current gadget) and -1 means all of them.
54 RESULT
55 None.
57 NOTES
59 EXAMPLE
61 BUGS
63 SEE ALSO
64 ModifyProp(), RefreshGadgets(), RefreshGList()
66 INTERNALS
68 HISTORY
69 29-10-95 digulla automatically created from
70 intuition_lib.fd and clib/intuition_protos.h
72 *****************************************************************************/
74 AROS_LIBFUNC_INIT
76 struct PropInfo *pi;
77 struct BBox old, new;
78 BOOL knobok1, knobok2;
80 if ((gadget->GadgetType & GTYP_GTYPEMASK) != GTYP_PROPGADGET
81 || !gadget->SpecialInfo || !window)
82 return;
84 EXTENDUWORD(horizPot);
85 EXTENDUWORD(vertPot);
86 EXTENDUWORD(horizBody);
87 EXTENDUWORD(vertBody);
88 EXTENDUWORD(flags);
89 EXTENDWORD(numGad);
91 #ifdef USEGADGETLOCK
92 ObtainSemaphore(&GetPrivIBase(IntuitionBase)->InputHandlerLock);
93 #else
94 LOCKWINDOWLAYERS(window);
95 #endif
96 pi = gadget->SpecialInfo;
98 CalcBBox (window, requester, gadget, &old);
100 new = old;
101 #if PROP_RENDER_OPTIMIZATION
102 knobok1 = CalcKnobSize (gadget, &old);
103 #else
104 knobok1 = TRUE;
105 #endif
106 /* We don't want the inputhandler to redraw the knob with values
107 * partially changed, so use some protection.
109 pi->Flags = flags;
110 pi->HorizPot = horizPot;
111 pi->VertPot = vertPot;
112 pi->HorizBody = horizBody;
113 pi->VertBody = vertBody;
115 #ifdef PROPHACK
116 Forbid();
117 if ((gadget == ((struct IIHData *)GetPrivIBase(IntuitionBase)->InputHandler->is_Data)->ActiveGadget) && (FindTask(0) == ((struct IIHData *)GetPrivIBase(IntuitionBase)->InputHandler->is_Data)->InputDeviceTask) && ((struct IIHData *)GetPrivIBase(IntuitionBase)->InputHandler->is_Data)->PropTask)
119 Signal(((struct IIHData *)GetPrivIBase(IntuitionBase)->InputHandler->is_Data)->PropTask,PSIG_REFRESHALL);
121 else
124 // Permit(); stegerg: CHECKME, commented out!
125 #endif
126 knobok2 = CalcKnobSize (gadget, &new);
128 if (knobok2)
130 RefreshPropGadgetKnob (gadget, knobok1 ? &old : 0, &new, window, requester, IntuitionBase);
133 #ifdef PROPHACK
136 Permit();
137 #endif
139 if (numGad > 1 && gadget->NextGadget)
140 RefreshGList (gadget->NextGadget, window, requester, numGad - 1);
142 #ifdef USEGADGETLOCK
143 ReleaseSemaphore(&GetPrivIBase(IntuitionBase)->InputHandlerLock);
144 #else
145 UNLOCKWINDOWLAYERS(window);
146 #endif
147 AROS_LIBFUNC_EXIT