1xcb-examples(3) XCB examples xcb-examples(3)
2
3
4
6 xcb-examples - manpage examples
7
9 Many of the XCB manpages contain example code. These examples intend to
10 explain how to use one particular part of XCB. They almost never repre‐
11 sent a standalone (or even useful) program - X11 programs are rela‐
12 tively involved and thus beyond the scope of a manpage example.
13
14
16 Every example assumes you have an xcb_connection and possibly other
17 variables at hand. For illustrating how xcb_get_property works, you
18 need the window of which you want to get the property, for example. To
19 make it clear that these variables are your responsibility, these exam‐
20 ples consist of a single function which takes the necessary variables
21 as parameters.
22
23
25 Flushing means calling xcb_flush to clear the XCB-internal write buffer
26 and send all pending requests to the X11 server. You don't explicitly
27 need to flush before using a reply function (like
28 xcb_query_pointer_reply), but you do need to flush before entering the
29 event loop of your program.
30
31 There are only two cases when XCB flushes by itself. The first case is
32 when its write buffer becomes full, the second case is when you are
33 asking for the reply of a request which wasn't flushed out yet (like
34 xcb_query_pointer_reply). This last point also includes
35 xcb_request_check(). Please note that waiting for an event does NOT
36 flush.
37
38 Examples generally include the xcb_flush call where appropriate (for
39 example after setting a property). Therefore, including these functions
40 and calling them in your application should just work. However, you
41 might get better results when flushing outside of the function, depend‐
42 ing on the architecture of your program.
43
44
46 If an example does not compile (without warnings) when using -std=c99,
47 that is considered a documentation bug. Similarly, not handling errors
48 or leaking memory is also considered a documentation bug. Please inform
49 us about it on xcb@lists.freedesktop.org.
50
51
53 Every example uses 4 spaces for indentation.
54
55 Comments are in asterisks, like /* this */.
56
57 No line is longer than 80 characters (including indentation).
58
59
61 xcb_connect(3), xcb_get_property(3), xcb_flush(3)
62
64 Michael Stapelberg <michael+xcb at stapelberg dot de>
65
66
67
68X Version 11 libxcb 1.13 xcb-examples(3)