The stages of me learning XCB, both in C++ and Rust. There are a couple of side lessons (CMake and vendoring) that are as aside to the whole story, but they're at least important to preserve.
Go to file
Elf M. Sternberg bafa8bfd23 In this commit, we learned about X11 iterators, which iterate through
monstrous things allocated in memory that you just have to "know" are
of a certain structure.  In this case, we used `xcb_screen_next` to
say that we want the first (and all) screens attached to our current
X11 session.  And we used
`xcb_setup_roots_iterator(xcb_get_setup(connection))` to initialize
our iterator to our connection object in local memory.

Other things we've learned along the way: the file description that
represents our connection can be a TCP/IP socket or a Unix Domain
socket (a filesystem socket, named or not), and the only way to know
which is to find if there's a hostname before the colon ':' in the
display name of the server.  Not sure how that's going to work.

Also, found a really good reference: [Basic Graphics Tutorial with
XCB](https://www.x.org/releases/X11R7.6/doc/libxcb/tutorial/index.html).
It doesn't cover our specific use-case, but it's worth looking into.
2022-02-17 18:25:49 -08:00
docs In this commit, we learned about X11 iterators, which iterate through 2022-02-17 18:25:49 -08:00
src In this commit, we learned about X11 iterators, which iterate through 2022-02-17 18:25:49 -08:00
.gitignore Initial commit: XRandR connects to the server via XCB. 2022-02-17 07:01:34 -08:00
CMakeLists.txt Initial commit: XRandR connects to the server via XCB. 2022-02-17 07:01:34 -08:00
LICENSE Initial commit: XRandR connects to the server via XCB. 2022-02-17 07:01:34 -08:00
Makefile Initial commit: XRandR connects to the server via XCB. 2022-02-17 07:01:34 -08:00
README.md Initial commit: XRandR connects to the server via XCB. 2022-02-17 07:01:34 -08:00

README.md

WHAT:

This is an attempt to write a simple iteration of XRandR using XCB and C++.

WHY:

I'm not familiar enough with this ecosystem to be useful in it, and I need to start getting some familiarity with it before I start hacking a Rust project that needs XCB/XRandR capability.

REQURIEMENTS:

This code has been tested with gcc-7.3, and should work on any C++17-compliant compiler with the relevant standard library, and obviously X Windows.

STATUS:

In progress.

DETAILS:

BUILDING:

From the base directory of the project:

mkdir build
cd build
cmake ..
make