1/*
2 * xdraw.c --
3 *
4 *	This file contains generic procedures related to X drawing primitives.
5 *
6 * Copyright (c) 1995 Sun Microsystems, Inc.
7 *
8 * See the file "license.terms" for information on usage and redistribution of
9 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
10 *
11 * RCS: @(#) $Id$
12 */
13
14#include "tk.h"
15
16/*
17 *----------------------------------------------------------------------
18 *
19 * XDrawLine --
20 *
21 *	Draw a single line between two points in a given drawable.
22 *
23 * Results:
24 *	None.
25 *
26 * Side effects:
27 *	Draws a single line segment.
28 *
29 *----------------------------------------------------------------------
30 */
31
32void
33XDrawLine(
34    Display *display,
35    Drawable d,
36    GC gc,
37    int x1, int y1,
38    int x2, int y2)		/* Coordinates of line segment. */
39{
40    XPoint points[2];
41
42    points[0].x = x1;
43    points[0].y = y1;
44    points[1].x = x2;
45    points[1].y = y2;
46    XDrawLines(display, d, gc, points, 2, CoordModeOrigin);
47}
48
49/*
50 *----------------------------------------------------------------------
51 *
52 * XFillRectangle --
53 *
54 *	Fills a rectangular area in the given drawable. This procedure is
55 *	implemented as a call to XFillRectangles.
56 *
57 * Results:
58 *	None
59 *
60 * Side effects:
61 *	Fills the specified rectangle.
62 *
63 *----------------------------------------------------------------------
64 */
65
66void
67XFillRectangle(
68    Display *display,
69    Drawable d,
70    GC gc,
71    int x,
72    int y,
73    unsigned int width,
74    unsigned int height)
75{
76    XRectangle rectangle;
77    rectangle.x = x;
78    rectangle.y = y;
79    rectangle.width = width;
80    rectangle.height = height;
81    XFillRectangles(display, d, gc, &rectangle, 1);
82}
83
84/*
85 * Local Variables:
86 * mode: c
87 * c-basic-offset: 4
88 * fill-column: 78
89 * End:
90 */
91