TkGS defines a set of lines and shapes drawing primitives that can be invoked on any drawable, thus providing device independence. These primitives use the current drawing state held by the TkGS_Drawable on which they are invoked, in a state-based manner (like on Windows and contrary to X-Window where one must pass a valid GC to each drawing primitive).
void TkGS_DrawPoint(
TkGS_Drawable d,
int x,
int y
);
d: the TkGS_Drawable
on which to
draw the primitive.
x, y: x and y coordinates of point.
d.
void TkGS_DrawArc(
TkGS_Drawable d,
int filled,
int x,
int y,
int width,
int height,
int start,
int extent
);
d: the TkGS_Drawable
on which to
draw the primitive.
filled: whether the primitive should be filled or not.
x, y: x and y coordinates of top-left
corner of bounding box.
width, height: width and height of
bounding box.
start, extent: starting angle and extent
in trigonometric (counter-clockwise) order, in 1/64th degrees.
d.
void TkGS_DrawLine(
TkGS_Drawable d,
int x1,
int y1,
int x2,
int y2
);
d: the TkGS_Drawable
on which to
draw the primitive.
x1, y1: x and y coordinates of start
point.
x2, y2: x and y coordinates of end point.
d.
void TkGS_DrawEllipse(
TkGS_Drawable d,
int filled,
int x,
int y,
unsigned int width,
unsigned int height
);
d: the TkGS_Drawable
on which to
draw the primitive.
filled: whether the primitive should be filled or not.
x, y: x and y coordinates of top-left
corner of bounding box.
width, height: width and height of
bounding box.
d.
void TkGS_DrawEllipses(
TkGS_Drawable d,
int filled,
int nbEllipses,
TkGS_Rectangle* ellipses
);
d: the TkGS_Drawable
on which to
draw the primitive.
filled: whether the primitive should be filled or not.
nbEllipses: number of ellipses to draw.
ellipses: array of
TkGS_Rectangle
A>s
containing the coordinates of nbEllipses ellipses
(actually, the
coordinates of their bounding boxes).
d.
void TkGS_DrawPolygon(
TkGS_Drawable d,
int filled,
TkGS_Point* points,
int nbPoints
);
d: the TkGS_Drawable
on which to
draw the primitive.
filled: whether the primitive should be filled or not.
points: array of TkGS_Points defining the polygon
vertices.
nbPoints: number of points in the above array.
d.
void TkGS_DrawPolyline(
TkGS_Drawable d,
TkGS_Point* points
int nbPoints
);
d: the TkGS_Drawable
on which to
draw the primitive.
points: array of TkGS_Points defining the
polyline vertices.
nbPoints: number of points in the above array.
d.
void TkGS_DrawRectangle(
TkGS_Drawable d,
int filled,
int x,
int y,
unsigned int width,
unsigned int height
);
d: the TkGS_Drawable
on which to
draw the primitive.
filled: whether the primitive should be filled or not.
x, y: x and y coordinates of top-left
corner of bounding box.
width, height: width and height of
bounding box.
d.
void TkGS_DrawRectangles(
TkGS_Drawable d,
int filled,
int nbRectangles,
TkGS_Rectangle* rectangles
);
d: the TkGS_Drawable
on which to
draw the primitive.
filled: whether the primitive should be filled or not.
nbRectangles: number of rectangles to draw.
rectangles: array of
TkGS_Rectangle
A>s
containing the coordinates of nbRectangles rectangles.
d.
void TkGS_DrawRoundedRectangle(
TkGS_Drawable d,
int filled,
int x,
int y,
unsigned int width,
unsigned int height,
int rx,
int ry
);
d: the TkGS_Drawable
on which to
draw the primitive.
filled: whether the primitive should be filled or not.
x, y: x and y coordinates of top-left
corner of bounding box.
width, height: width and height of
bounding box.
rx, ry: x and y radii of the ellipse used
to draw the rounded corners.
d.