revert between 56095 -> 55830 in arch
[AROS.git] / rom / intuition / endrefresh.c
blob8a11da16a4ab8a5f8f2a2b7da21dda7aaa145b23
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 <proto/layers.h>
8 #include <proto/graphics.h>
9 #include "intuition_intern.h"
11 /*****************************************************************************
13 NAME */
14 #include <proto/intuition.h>
16 AROS_LH2(void, EndRefresh,
18 /* SYNOPSIS */
19 AROS_LHA(struct Window *, window, A0),
20 AROS_LHA(BOOL , complete, D0),
22 /* LOCATION */
23 struct IntuitionBase *, IntuitionBase, 61, Intuition)
25 /* FUNCTION
26 Finishes refreshing which was initialized with BeginRefresh().
27 The argument |complete| is usually TRUE. It can be useful to
28 set it to FALSE when refreshing is split into several tasks.
30 INPUTS
31 window - the window to be refreshed
32 complete - BOOL which states if all refreshing is done
34 RESULT
36 NOTES
38 EXAMPLE
40 BUGS
42 SEE ALSO
43 BeginRefresh()
45 INTERNALS
47 *****************************************************************************/
49 AROS_LIBFUNC_INIT
51 struct LayersBase *LayersBase = GetPrivIBase(IntuitionBase)->LayersBase;
52 DEBUG_REFRESH(dprintf("EndRefresh: Window 0x%lx Complete %d\n", window, complete));
54 SANITY_CHECK(window)
56 /* Check whether the BeginRefresh was aborted due to a FALSE=BeginUpdate()*/
57 if (window->Flags & WFLG_WINDOWREFRESH)
58 EndUpdate(WLAYER(window), complete);
60 /* reset all bits indicating a necessary or ongoing refresh */
61 AROS_ATOMIC_AND(window->Flags, ~WFLG_WINDOWREFRESH);
63 /* I reset this one only if Complete is TRUE!?! */
64 if (complete)
65 WLAYER(window)->Flags &= ~LAYERREFRESH;
67 /* Unlock the layers. */
68 UnlockLayer(WLAYER(window));
70 if (BLAYER(window))
71 UnlockLayer(BLAYER(window));
73 UnlockLayerInfo(&window->WScreen->LayerInfo);
75 AROS_LIBFUNC_EXIT
76 } /* EndRefresh */