To generate a region from a polygon, use XPolygonRegion().
To set the clip-mask of a GC to a region, use XSetRegion().
To deallocate the storage associated with a specified region, use XDestroyRegion().