next up previous
Next: xregion Up: simxlib Previous: xgraphicalcontext

x_region


     NAME
	  x_region - part of Simula to Xlib interface

     DESCRIPTION
	     Xlib_region class X_Region;
	  Used	 as   parameter	  to	operation    'SetRegion'    in
	  X_GraphicalContext in	order to define	clipping bounds. After
	  a call to 'Free' no other operation of the  X_Region	object
	  can be called.

	  KIND:	Instantiable,Subclassable
	  SUPERS: Xlib_region,Xlib_object
	  INIT:	Initializes itself.
	  Sequencing: (<Initialize> / <Modify> / <Query>)* Free
	  :	  Initialize=PolygonRegion
	  :
	  Modify=SubtractRegion/UnionRectWithRegion/UnionRegion/
	  :		 CopyRegion/XorRegion/ShrinkRegion
	  :	  Query=ClipBox/PointInRegion/RectInRegion

     INITIALIZE	OPERATIONS
     PolygonRegion
	     Procedure PolygonRegion(points,fill_rule);
	     ref (XPoints) points;
	     integer fill_rule;
	  Creates a region consisting of a polygon. Disregard previous
	  definition.

     QUERY OPERATIONS
     ClipBox
	     Procedure ClipBox(x,y,width,height);
	     name x,y,width,height;
	     integer x,y,width,height; ! Returned values ;
	  Returns four coordinates, defining  the  smallest  rectangle
	  that encloses	the region.

     PointInRegion
	     Boolean Procedure PointInRegion(x,y);
	     integer x,y;
	  Checks if the	region contains	a given	point.

     RectInRegion
	     Integer Procedure RectInRegion(x,y,width,height);
	     integer x,y,width,height;
	  Checks if the	region contains	a  given  rectangle.   Returns
	  one of the pre-defined constants:

	     RectangleIn RectangleOut RectanglePart;

     MODIFY OPERATIONS
     ShrinkRegion
	     Procedure ShrinkRegion(dx,dy);
	     integer dx,dy;
	  Shrinks or expands this region.

     SubtractRegion
	     Procedure SubtractRegion(r);
	     ref (X_Region) r;
	  Subtracts r from this	region.

     UnionRectWithRegion
	     procedure UnionRectWithRegion (rectangle);
	     ref (Xrectangles) rectangle;
	  Adds a rectangle to this region.

     UnionRegion
	     Procedure UnionRegion(r);
	     ref (X_Region) r;
	  Makes	this region be the union between the two regions.

     CopyRegion
	     Procedure CopyRegion(r);
	     ref (X_Region) r;
	  Makes	r a copy of this region.

     XorRegion
	     Procedure XorRegion(r);
	     ref (X_Region) r;
	  Makes	this(x_region) be the region consisting	 of  the  area
	  that is covered by exactly one of the	regions.

     Free
	     Procedure Free;
	  Destroys the region.