XDraw

Syntax

#include <X11/X10.h>

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

Arguments

display Specifies the connection to the X server.
d Specifies the drawable.
gc Specifies the GC.
vlist Specifies a pointer to the list of vertices that indicate what to draw.
vcount Specifies how many vertices are in vlist.

Description

The XDraw() function 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 in the vertex structure.

Each Vertex, as defined in X11/X10.h, is a structure with the following members:

typedef struct _Vertex {
	short x,y;
	unsigned short flags;
} Vertex;

The x and y members are the coordinates of the vertex that are relative to either the upper-left inside corner of the drawable (if VertexRelative is zero) or the previous vertex (if VertexRelative is one).

The flags, as defined in X11/X10.h , are as follows:

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

This function uses these GC 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. It also uses these GC mode-dependent components: foreground, background, tile, stipple, tile-stipple-x-origin, tile-stipple-y-origin, dash-offset, and dash-list.

See also

XDrawFilled(), "Compatibility Functions".
Christophe Tronche, ch@tronche.com