next up previous
Next: xarcs Up: simxlib Previous: xfontmetrics

x_drawable


     NAME
	  x_drawable - part of Simula to Xlib interface

     DESCRIPTION
	     Xlib_Drawable class X_Drawable(Display_);
	     ref(Xlib_Display) Display_;
	  Generalization of window and	pixmap.	 This  class  contains
	  operations  to  draw	elementary geometric figures and text.
	  Some of the operations  are  depending  on  data-clasess  to
	  carry	  complex  parameters  (xarcs,	xpoints,  xrectangles,
	  xsegments, xtextitems). 2-byte (16-bit) texts	 are  not  yet
	  supported.

	  The drawing procedures use a XGrapicalContext	 installed  by
	  the  Drawable	 to draw. The 'GC' can be exchanged by calling
	  the UseGC operation. The GC must be set before  any  drawing
	  can take place.

	  SUPERS: Xlib_Drawable, Xlib_object ;
	  KIND:	Abstract, only subclasses are X_Window and X_Pixmap
	  INIT:	-
	  Sequencing: UseGC
	  (UseGC/Display/getScreen/<DrawOP>/<GeomOP>)* Free
	  : DrawOP= CopyArea/CopyPlane /
	  :	 Draw/Fill)Arc(s) / (Draw/Fill)Rectangle(s) /
	  :	 DrawPoint(s)/DrawLine(s)//DrawSegments) / FillPolygon
	  :	 DrawString/DrawText/DrawImageString
	  : GeomOP= GetGeometry/GetRootWindow/GetPos/GetSize/
	  :	GetBorderWidth/GetDepth

     OPERATIONS
     getScreen
	     ref (Xlib_Screen) procedure getScreen;;
	  Return a reference to	the  XScreen  on  which	 this  XWindow
	  object is shown.

     UseGC
	     procedure UseGC(newGC);
	     ref(Xlib_graphicalcontext)	newGC;
	  Make this drawable use another graphical context (newGC) for
	  future drawing operations.

     Display
	     ref(Xlib_Display) procedure Display;
	  Returns the display this drawable is connected to

     DRAW OPERATIONS
     CopyArea
	     procedure
	     CopyArea(src,src_x,src_y,width,height,dest_x,dest_y);
	     ref (X_Drawable) src;
	     integer src_x,src_y,width,height,dest_x,dest_y;

	  Copy an area from the	drawable "src" to this drawable

     CopyPlane
	     procedure
	     CopyPlane(src,src_x,src_y,width,height,dest_x,dest_y,plane);
	     ref (X_Drawable) src;
	     integer src_x,src_y,width,height,dest_x,dest_y,plane;
	  Copy a single	plane of the drawable src into	this  drawable
	  with depth, applying pixel values

     DrawArc
	     procedure DrawArc(x,y,width,height,angle1,angle2);
	     integer x,y,width,height,angle1,angle2;
	  Draw an arc fitting inside a rectangle

     DrawArcs
	     procedure DrawArcs(arcs);
	     ref(XArcs)	arcs;
	  Draw multiple	arcs

     DrawImageString
	     procedure DrawImageString(x,y,string);
	     integer x,y;
	     text    string;
	  Draw the text	 "string".  Use	 (x,y)	as  baseline  starting
	  position

     DrawLine
	     procedure DrawLine(x1,y1,x2,y2);
	     integer x1,y1,x2,y2;
	  Draw a line from point (x1,y1) to (x2, y2)

     DrawLines
	     procedure DrawLines(Points,Mode);
	     ref(xpoints) Points;
	     integer Mode; ! CoordModeOrigin or	CoordModePrevious;
	  Draw	multiple  connected   lines.   Mode   determines   how
	  coordniates	should	 be   interpreted.   Possible  values:
	  CoordModeOrigin   -	relative   to	 the	origin,	   and
	  CoordModePrevious - relative to previous point.

     DrawPoint
	     procedure DrawPoint(x,y);
	     integer x,y;
	  Draw the single point	(x,y)

     DrawPoints
	     procedure DrawPoints(Points,Mode);
	     ref(XPoints) Points;
	     integer Mode; ! CoordModeOrigin or	CoordModePrevious;
	  Draw multiple	points.	Mode determines	how coordniates	should
	  be interpreted. Possible values:  CoordModeOrigin - relative
	  to the origin, and CoordModePrevious - relative to  previous
	  point.

     DrawRectangle
	     procedure DrawRectangle(x,y,width,height);
	     integer x,y,width,height;
	  Draw an outline of a rectangle with upper left corner	(x,y)

     DrawRectangles
	     procedure DrawRectangles(rectangles);
	     ref(XRectangles) rectangles;
	  Draw the outlines of multiple	rectangles

     DrawSegments
	     procedure DrawSegments(segments);
	     ref(XSegments) segments;
	  Draw multiple	disjoint lines

     DrawString
	     procedure DrawString(x,y,string);
	     Integer x,y;
	     Text string;
	  Draw the text	"string", foreground only

     DrawText
	     procedure DrawText(x,y,items);
	     integer x,y;
	     ref(XTextItems) items;
	  Draw polytext	strings

     FillArc
	     procedure FillArc(x,y,width,height,angle1,angle2);
	     integer x,y,width,height,angle1,angle2;
	  Fill an arc with upper-left corner (x,y)

     FillArcs
	     procedure FillArcs(arcs);
	     ref(XArcs)	arcs;
	  Fill multiple	arcs

     FillPolygon
	     procedure FillPolygon(Points,Shape,Mode);
	     ref(XPoints) Points;
	     integer Shape; ! Complex/Nonconvex/Convex.;
	     integer Mode; !CoordModeOrigin/CoordModePrevious.;
	  Fill a polygon. The parameter	Shape  can  take  one  of  the
	  possible values:  Complex - paths may	intersect, Nonconvex -
	  no paths intersect (but not  convex),	 and  Convex  -	 wholy
	  convex.

	  The  parameter  Mode,	 can   take   one   of	 the   values:
	  CoordModeOrigin    -	  relative    to   the	 origin,   and
	  CoordModePrevious - relative to previous point.

     FillRectangle
	     procedure FillRectangle(x,y,width,height);
	     integer x,y,width,height;
	  Fill a rectangular area with upper-left corner (x,y)

     FillRectangles
	     procedure FillRectangles(rectangles);
	     ref(XRectangles) rectangles;
	  Fill multiple	rectangular areas

     GEOMETRY ENQUIERIES
     GetGeometry
	     Procedure GetGeometry
	     (root_return,x_return,y_return,width_return,
	     height_return,border_width_return,depth_return);
	     Name    root_return,x_return,y_return,width_return,
	     height_return,border_width_return,depth_return;
	     ref (Xlib_drawable) root_return;
	     Integer x_return,y_return,
	     width_return,height_return,
	     border_width_return,depth_return;
	  Obtain the current geometry of this drawable

	  --- Not yet fully implemented	---

     GetRootWindow
	     ref (Xlib_drawable) procedure GetRootWindow;
	  Return the root window of this drawable

	  --- Not yet implemented ---

     GetPos
	     procedure GetPos(x_return,	y_return);
	     name x_return, y_return;
	     integer  x_return,	y_return;
	  Returns the coordinates of  the  upper-left  pixel  of  this
	  window's  border,  relative to the parent's origin.  Returns
	  (0,0)	if this	drawable is a pixmap.

     GetSize
	     procedure GetSize(width_return, height_return);
	     name  width_return, height_return;
	     integer width_return, height_return;
	  Returns the  size  (width  and  height)  of  this  drawable,
	  excluding the	border

     GetBorderWidth
	     integer procedure GetBorderWidth;
	  Returns the borderwidth of this window.  Returns 0  if  this
	  drawable is a	pixmap.
     GetDepth
	     integer procedure GetDepth;
	  Returns the depth (the number	of bits	per  pixel)  for  this
	  drawable.