12.07.2015 Views

Xlib − C Language X Interface

Xlib − C Language X Interface

Xlib − C Language X Interface

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Xlib</strong> − C LibraryX11, Release 6.7 DRAFT• Compute with regions• Determine if regions are empty or equal• Locate a point or rectangle in a region16.5.1. Creating, Copying, or Destroying RegionsTo create a new empty region, use XCreateRegion.Region XCreateRegion ()To generate a region from a polygon, use XPolygonRegion.Region XPolygonRegion (points, n, fill_rule)XPoint points[];int n;int fill_rule;pointsnfill_ruleSpecifies an array of points.Specifies the number of points in the polygon.Specifies the fill-rule you want to set for the specified GC. Youcan pass Even-OddRule or WindingRule.The XPolygonRegion function returns a region for the polygon defined by the points array. Foran explanation of fill_rule, see XCreateGC.To set the clip-mask of a GC to a region, use XSetRegion.XSetRegion (display, gc, r)Display *display;GC gc;Region r;displaygcrSpecifies the connection to the X server.Specifies the GC.Specifies the region.The XSetRegion function sets the clip-mask in the GC to the specified region. The region isspecified relative to the drawable’s origin. The resulting GC clip origin is implementation-dependent.Once it is set in the GC, the region can be destroyed.To deallocate the storage associated with a specified region, use XDestroyRegion.408

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!