Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XDraw(3x) — HP-UX 9.10

Media Vault

Software Library

Restoration Projects

Artifacts Sought

 

NAME

XDraw − draw a polyline or curve between vertex list (from X10). 

Synopsis

Status XDraw(display, drawable, gc, vlist, vcount)
Display *display;
Drawable drawable;
GC gc;
Vertex *vlist;
int vcount;

Arguments

displaySpecifies a connection to an X server; returned from XOpenDisplay(). 

drawableSpecifies the drawable. 

gcSpecifies the graphics context. 

vlistSpecifies a pointer to the list of vertices that indicates what to draw. 

vcountSpecifies how many vertices are in vlist. 

Description

This function is provided for compatibility with X Version 10.  To use it you must include the file <X11/X10.h> and link with the library -loldX.  Its performance is likely to be low.  XDraw draws an arbitrary polygon or curve.  The figure drawn is defined by the specified list of vertices (vlist).  The points are connected by lines as specified in the flags member of each of the Vertex structures.  The Vertex structure contains an x,y coordinate and a bitmask called flags that specifies the drawing parameters.  The x and y elements of Vertex are the coordinates of the vertex that are relative to either the previous vertex (if VertexRelative is 1) or the upper-left inside corner of the drawable (if VertexRelative is 0).  If VertexRelative is 0 the coordinates are said to be absolute.  The first vertex must be an absolute vertex.  If the VertexDontDraw bit is 1, no line or curve is drawn from the previous vertex to this one.  This is analogous to picking up the pen and moving to another place before drawing another line.  If the VertexCurved bit is 1, a spline algorithm is used to draw a smooth curve from the previous vertex, through this one, to the next vertex.  Otherwise, a straight line is drawn from the previous vertex to this one.  It makes sense to set VertexCurved to 1 only if a previous and next vertex are both defined (either explicitly in the array, or through the definition of a closed curve--see below.)  It is permissible for VertexDontDraw bits and VertexCurved bits to both be 1.  This is useful if you want to define the previous point for the smooth curve, but you do not want an actual curve drawing to start until this point.  If VertexStartClosed bit is 1, then this point marks the beginning of a closed curve.  This vertex must be followed later in the array by another vertex whose absolute coordinates are identical and which has VertexEndClosed bit of 1.  The points in between form a cycle for the purpose of determining predecessor and successor vertices for the spline algorithm.  XDraw achieves the effects of the X10 XDraw, XDrawDashed, and XDrawPatterned functions.  XDraw uses the following graphics context components: function, plane_mask, line_width, line_style, cap_style, join_style, fill_style, subwindow_ mode, clip_x_origin, clip_y_origin, and clip_mask.  This function also uses these graphics context mode-dependent components: foreground, background, tile, stipple, ts_x_origin, ts_y_origin, dash_offset, and dashes.  A Status of zero is returned on failure, and nonzero on success.  For more information, see Volume One, Appendix B, X10 Compatibility. 

Structures

typedef struct _Vertex {
short x,y;
unsigned short flags;
} Vertex;
 /* defined constants for use as flags */

#define VertexRelative        0x0001     /* else absolute */
#define VertexDontDraw        0x0002     /* else draw */
#define VertexCurved          0x0004     /* else straight */
#define VertexStartClosed     0x0008     /* else not */
#define VertexEndClosed       0x0010     /* else not */

See Also

XClearArea(), XClearWindow(), XCopyArea(), XCopyPlane(), XDrawArc(), XDrawArcs(), XDrawFilled(), XDrawLine(), XDrawLines(), XDrawPoint(), XDrawPoints(), XDrawRectangle(), XDrawRectangles(), XDrawSegments(), XFillArc(), XFillArcs(), XFillPolygon(), XFillRectangle(), XFillRectangles(). 

Copyright O’Reilly & Assoc.  —  

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026