Region (X11)
Xlib's data type for an arbitrary area expressed as a set of non-overlapping rectangles — the thing you clip against, collect Expose events into and use to work out what needs repainting.
A region starts empty with XCreateRegion or from a polygon, and is then built up with XUnionRectWithRegion, intersection, difference and XOR against other regions. Internally it is a list of rectangles sorted into horizontal bands, so that the union of a thousand overlapping boxes becomes one compact, unambiguous shape with nothing counted twice. The classic use is Expose handling: the server sends one event per visible piece of a window that has been uncovered, the client adds each rectangle to a region until the counter reaches zero, installs the region as the clip mask of its graphics context with XSetRegion and repaints exactly once. Everything outside the mask the server throws away.
The server keeps the same structure on its side, miRegion, and that is what the Shape, Damage and XFIXES extensions speak in: a window shape is a region, a damaged area is a region, and XFIXES let clients send regions over the wire instead of lists of rectangles. The code proved durable enough that pixman, the rasteriser under Cairo, carries the server's region code onward with DEC's 1987 copyright line still at the top of the file.