1xcb_change_gc(3) XCB Requests xcb_change_gc(3)
2
3
4
6 xcb_change_gc - change graphics context components
7
9 #include <xcb/xproto.h>
10
11 Request function
12 xcb_void_cookie_t xcb_change_gc(xcb_connection_t *conn,
13 xcb_gcontext_t gc, uint32_t value_mask, const void *value_list);
14
16 conn The XCB connection to X11.
17
18 gc The graphics context to change.
19
20 value_mask
21 One of the following values:
22
23 XCB_GC_FUNCTION
24 TODO: Refer to GX
25
26 XCB_GC_PLANE_MASK
27 In graphics operations, given a source and destina‐
28 tion pixel, the result is computed bitwise on cor‐
29 responding bits of the pixels; that is, a Boolean
30 operation is performed in each bit plane. The
31 plane-mask restricts the operation to a subset of
32 planes, so the result is:
33
34 ((src FUNC dst) AND plane-mask) OR (dst AND
35 (NOT plane-mask))
36
37 XCB_GC_FOREGROUND
38 Foreground colorpixel.
39
40 XCB_GC_BACKGROUND
41 Background colorpixel.
42
43 XCB_GC_LINE_WIDTH
44 The line-width is measured in pixels and can be
45 greater than or equal to one, a wide line, or the
46 special value zero, a thin line.
47
48 XCB_GC_LINE_STYLE
49 The line-style defines which sections of a line are
50 drawn: Solid The full path of the
51 line is drawn. DoubleDash The full path
52 of the line is drawn, but the even dashes are
53 filled differently
54 than the odd dashes (see fill-
55 style), with Butt cap-style used where even and
56 odd dashes meet. OnOffDash
57 Only the even dashes are drawn, and cap-style ap‐
58 plies to all internal ends of
59 the individual dashes (except
60 NotLast is treated as Butt).
61
62 XCB_GC_CAP_STYLE
63 The cap-style defines how the endpoints of a path
64 are drawn: NotLast The result is equivalent to
65 Butt, except that for a line-width of zero the fi‐
66 nal
67 endpoint is not drawn. Butt The
68 result is square at the endpoint (perpendicular to
69 the slope of the line)
70 with no projection beyond. Round
71 The result is a circular arc with its diameter
72 equal to the line-width, centered
73 on the endpoint; it is equivalent to
74 Butt for line-width zero. Projecting The result is
75 square at the end, but the path continues beyond
76 the endpoint for
77 a distance equal to half the line-width;
78 it is equivalent to Butt for line-width
79 zero.
80
81 XCB_GC_JOIN_STYLE
82 The join-style defines how corners are drawn for
83 wide lines: Miter The outer edges of
84 the two lines extend to meet at an angle. However,
85 if the
86 angle is less than 11 degrees,
87 a Bevel join-style is used instead. Round
88 The result is a circular arc with a diameter equal
89 to the line-width, centered
90 on the joinpoint. Bevel
91 The result is Butt endpoint styles, and then the
92 triangular notch is filled.
93
94 XCB_GC_FILL_STYLE
95 The fill-style defines the contents of the source
96 for line, text, and fill requests. For all text and
97 fill requests (for example, PolyText8, PolyText16,
98 PolyFillRectangle, FillPoly, and PolyFillArc) as
99 well as for line requests with line-style Solid,
100 (for example, PolyLine, PolySegment, PolyRectangle,
101 PolyArc) and for the even dashes for line requests
102 with line-style OnOffDash or DoubleDash: Solid
103 Foreground Tiled Tile Opaque‐
104 Stippled A tile with the same width and
105 height as stipple but with background
106 everywhere stipple has a
107 zero and with foreground everywhere stipple
108 has a one Stippled
109 Foreground masked by stipple For the odd dashes for
110 line requests with line-style DoubleDash: Solid
111 Background Tiled Same as for
112 even dashes OpaqueStippled Same as for
113 even dashes Stippled Background
114 masked by stipple
115
116 XCB_GC_FILL_RULE
117
118
119 XCB_GC_TILE
120 The tile/stipple represents an infinite two-dimen‐
121 sional plane with the tile/stipple replicated in
122 all dimensions. When that plane is superimposed on
123 the drawable for use in a graphics operation, the
124 upper-left corner of some instance of the
125 tile/stipple is at the coordinates within the draw‐
126 able specified by the tile/stipple origin. The
127 tile/stipple and clip origins are interpreted rela‐
128 tive to the origin of whatever destination drawable
129 is specified in a graphics request. The tile
130 pixmap must have the same root and depth as the
131 gcontext (or a Match error results). The stipple
132 pixmap must have depth one and must have the same
133 root as the gcontext (or a Match error results).
134 For fill-style Stippled (but not fill-style Opaque‐
135 Stippled), the stipple pattern is tiled in a single
136 plane and acts as an additional clip mask to be
137 ANDed with the clip-mask. Any size pixmap can be
138 used for tiling or stippling, although some sizes
139 may be faster to use than others.
140
141 XCB_GC_STIPPLE
142 The tile/stipple represents an infinite two-dimen‐
143 sional plane with the tile/stipple replicated in
144 all dimensions. When that plane is superimposed on
145 the drawable for use in a graphics operation, the
146 upper-left corner of some instance of the
147 tile/stipple is at the coordinates within the draw‐
148 able specified by the tile/stipple origin. The
149 tile/stipple and clip origins are interpreted rela‐
150 tive to the origin of whatever destination drawable
151 is specified in a graphics request. The tile
152 pixmap must have the same root and depth as the
153 gcontext (or a Match error results). The stipple
154 pixmap must have depth one and must have the same
155 root as the gcontext (or a Match error results).
156 For fill-style Stippled (but not fill-style Opaque‐
157 Stippled), the stipple pattern is tiled in a single
158 plane and acts as an additional clip mask to be
159 ANDed with the clip-mask. Any size pixmap can be
160 used for tiling or stippling, although some sizes
161 may be faster to use than others.
162
163 XCB_GC_TILE_STIPPLE_ORIGIN_X
164 TODO
165
166 XCB_GC_TILE_STIPPLE_ORIGIN_Y
167 TODO
168
169 XCB_GC_FONT
170 Which font to use for the ImageText8 and Image‐
171 Text16 requests.
172
173 XCB_GC_SUBWINDOW_MODE
174 For ClipByChildren, both source and destination
175 windows are additionally clipped by all viewable
176 InputOutput children. For IncludeInferiors, neither
177 source nor destination window is clipped by inferi‐
178 ors. This will result in including subwindow con‐
179 tents in the source and drawing through subwindow
180 boundaries of the destination. The use of Include‐
181 Inferiors with a source or destination window of
182 one depth with mapped inferiors of differing depth
183 is not illegal, but the semantics is undefined by
184 the core protocol.
185
186 XCB_GC_GRAPHICS_EXPOSURES
187 Whether ExposureEvents should be generated (1) or
188 not (0).
189
190 The default is 1.
191
192 XCB_GC_CLIP_ORIGIN_X
193 TODO
194
195 XCB_GC_CLIP_ORIGIN_Y
196 TODO
197
198 XCB_GC_CLIP_MASK
199 The clip-mask restricts writes to the destination
200 drawable. Only pixels where the clip-mask has bits
201 set to 1 are drawn. Pixels are not drawn outside
202 the area covered by the clip-mask or where the
203 clip-mask has bits set to 0. The clip-mask affects
204 all graphics requests, but it does not clip
205 sources. The clip-mask origin is interpreted rela‐
206 tive to the origin of whatever destination drawable
207 is specified in a graphics request. If a pixmap is
208 specified as the clip-mask, it must have depth 1
209 and have the same root as the gcontext (or a Match
210 error results). If clip-mask is None, then pixels
211 are always drawn, regardless of the clip origin.
212 The clip-mask can also be set with the SetClipRect‐
213 angles request.
214
215 XCB_GC_DASH_OFFSET
216 TODO
217
218 XCB_GC_DASH_LIST
219 TODO
220
221 XCB_GC_ARC_MODE
222 TODO
223
224
225
226 value_list
227 Values for each of the components specified in the bitmask
228 value_mask. The order has to correspond to the order of pos‐
229 sible value_mask bits. See the example.
230
232 Changes the components specified by value_mask for the specified graph‐
233 ics context.
234
236 Returns an xcb_void_cookie_t. Errors (if any) have to be handled in the
237 event loop.
238
239 If you want to handle errors directly with xcb_request_check instead,
240 use xcb_change_gc_checked. See xcb-requests(3) for details.
241
243 xcb_alloc_error_t
244 The X server could not allocate the requested resources (no
245 memory?).
246
247 xcb_font_error_t
248 TODO: reasons?
249
250 xcb_g_context_error_t
251 TODO: reasons?
252
253 xcb_match_error_t
254 TODO: reasons?
255
256 xcb_pixmap_error_t
257 TODO: reasons?
258
259 xcb_value_error_t
260 TODO: reasons?
261
263 /*
264 * Changes the foreground color component of the specified graphics context.
265 *
266 */
267 void my_example(xcb_connection_t *conn, xcb_gcontext_t gc, uint32_t fg, uint32_t bg) {
268 /* C99 allows us to use a compact way of changing a single component: */
269 xcb_change_gc(conn, gc, XCB_GC_FOREGROUND, (uint32_t[]){ fg });
270
271 /* The more explicit way. Beware that the order of values is important! */
272 uint32_t mask = 0;
273 mask |= XCB_GC_FOREGROUND;
274 mask |= XCB_GC_BACKGROUND;
275
276 uint32_t values[] = {
277 fg,
278 bg
279 };
280 xcb_change_gc(conn, gc, mask, values);
281 xcb_flush(conn);
282 }
283
285 xcb-requests(3), xcb-examples(3)
286
288 Generated from xproto.xml. Contact xcb@lists.freedesktop.org for cor‐
289 rections and improvements.
290
291
292
293X Version 11 libxcb 1.13.1 xcb_change_gc(3)