[Contents] [Index] [Help] [Retrace] [Browse <] [Browse >]

The layers library provides three function calls for reordering layers:

    LONG BehindLayer ( long dummy, struct Layer *layer );
    LONG UpfrontLayer( long dummy, struct Layer *layer );
    LONG MoveLayerInFrontOf( struct Layer *layer_to_move,
                             struct Layer *other_layer );

BehindLayer() moves a layer behind all other layers.  This function
considers any backdrop layers, moving a current layer behind all others
except backdrop layers.  UpfrontLayer() moves a layer in front of all
other layers.  MoveLayerInFrontOf() is used to place a layer at a specific
depth, just in front of a given layer.

As areas of simple refresh layers become exposed, due to layer movement or
sizing for example, the newly exposed areas have not been drawn into, and
need refreshing.  The system keeps track of these areas by using a
DamageList.  To update only those areas that need it, the BeginUpdate()
EndUpdate() functions are called.

    LONG BeginUpdate( struct Layer *l );
    void EndUpdate  ( struct Layer *layer, unsigned long flag );

BeginUpdate() saves the pointer to the current clipping rectangles and
installs a pointer to a set of ClipRects generated from the DamageList in
the layer structure.  To repair the layer, use the graphics rendering
routines as if to redraw the entire layer, and the routines will
automatically use the new clipping rectangle list.  So, only the damaged
areas are actually rendered into, saving time.

    Never Modify the DamageList.
    ----------------------------
    The system generates and maintains the DamageList region.  All
    application clipping should be done through the InstallClipRegion()
    function.

To complete the update process call EndUpdate() which will restore the
original ClipRect list.