1XDrawRectangle(3) XLIB FUNCTIONS XDrawRectangle(3)
2
3
4
6 XDrawRectangle, XDrawRectangles, XRectangle - draw rectangles and rec‐
7 tangles structure
8
10 int XDrawRectangle(Display *display, Drawable d, GC gc, int x, int y,
11 unsigned int width, unsigned int height);
12
13 int XDrawRectangles(Display *display, Drawable d, GC gc, XRectangle
14 rectangles[], int nrectangles);
15
17 d Specifies the drawable.
18
19 display Specifies the connection to the X server.
20
21 gc Specifies the GC.
22
23 nrectangles
24 Specifies the number of rectangles in the array.
25
26 rectangles
27 Specifies an array of rectangles.
28
29 width
30 height Specify the width and height, which specify the dimensions of
31 the rectangle.
32
33 x
34 y Specify the x and y coordinates, which specify the upper-left
35 corner of the rectangle.
36
38 The XDrawRectangle and XDrawRectangles functions draw the outlines of
39 the specified rectangle or rectangles as if a five-point PolyLine pro‐
40 tocol request were specified for each rectangle:
41
42 [x,y] [x+width,y] [x+width,y+height] [x,y+height] [x,y]
43
44 For the specified rectangle or rectangles, these functions do not draw
45 a pixel more than once. XDrawRectangles draws the rectangles in the
46 order listed in the array. If rectangles intersect, the intersecting
47 pixels are drawn multiple times.
48
49 Both functions use these GC components: function, plane-mask, line-
50 width, line-style, cap-style, join-style, fill-style, subwindow-mode,
51 clip-x-origin, clip-y-origin, and clip-mask. They also use these GC
52 mode-dependent components: foreground, background, tile, stipple, tile-
53 stipple-x-origin, tile-stipple-y-origin, dash-offset, and dash-list.
54
55 XDrawRectangle and XDrawRectangles can generate BadDrawable, BadGC, and
56 BadMatch errors.
57
59 The XRectangle structure contains:
60
61 typedef struct {
62 short x, y;
63 unsigned short width, height;
64 } XRectangle;
65
66 All x and y members are signed integers. The width and height members
67 are 16-bit unsigned integers. You should be careful not to generate
68 coordinates and sizes out of the 16-bit ranges, because the protocol
69 only has 16-bit fields for these values.
70
72 BadDrawable
73 A value for a Drawable argument does not name a defined Win‐
74 dow or Pixmap.
75
76 BadGC A value for a GContext argument does not name a defined GCon‐
77 text.
78
79 BadMatch An InputOnly window is used as a Drawable.
80
81 BadMatch Some argument or pair of arguments has the correct type and
82 range but fails to match in some other way required by the
83 request.
84
86 XDrawArc(3), XDrawLine(3), XDrawPoint(3)
87 Xlib - C Language X Interface
88
89
90
91X Version 11 libX11 1.8.7 XDrawRectangle(3)