Regions allow the application to install clipping rectangles into layers. A clipping rectangle is a rectangular area into which the graphics routines will draw. All drawing that would fall outside of that rectangular area is clipped (not rendered). User clipping regions are linked lists of clipping rectangles created by an application program through the graphics library routines described below. By combining together various clipping rectangles, any arbitrary clipping shape can be created. Once the region is set up, you use the layers library call installclipregion() to make the clipping region active in a layer. Regions are safe to use with layers created by Intuition (i.e., windows). The following table describes the routines available for the creation, manipulation and use of regions. Table 30-4: Functions Used with Regions ____________________________________________________________________ | | | Routine Library Description | |====================================================================| | installclipregion() layers add a clipping region to a layer. | |--------------------------------------------------------------------| | newregion() graphics create a new, empty region. | | disposeregion() graphics dispose of an existing region and | | its rectangles. | |--------------------------------------------------------------------| | andrectregion() graphics and a rectangle into a region. | | orrectregion() graphics or a rectangle into a region. | | xorrectregion() graphics exclusive-or a rectangle into a | | region. | | clearrectregion() graphics clear a rectangular portion of a | | region. | | andregionregion() graphics and two regions together. | | orregionregion() graphics or two regions together. | | xorregionregion() graphics exclusive-or two regions together. | |--------------------------------------------------------------------| | clearregion() graphics clear a region. | |____________________________________________________________________| With these functions, the application can selectively update a custom-shaped part of a layer without disturbing any of the other layers that might be present. Never Modify the DamageList of a Layer Directly. ------------------------------------------------ Use the routine installclipregion() to add clipping to the layer. The regions installed by InstallClipRegion() are independent of the layer's damagelist and use of user clipping regions will not interfere with optimized window refreshing. Do Not Modify A Region After It Has Been Added. ----------------------------------------------- After a region has been added with installclipregion(), the program may not modify it until the region has been removed with another call to InstallClipRegion(). creating and deleting regions changing a region installing regions regions example