C
Macros
Once you have successfully connected your application to an X server, you can obtain data from the Display structure associated with that display. The Xlib interface provides a number of useful C language macros and corresponding functions for other language bindings which return data from the Display structure.
The function versions of these macros have the same names as the macros except that the function forms begin with the letter “X.” They use the same arguments. Using the macro versions is slightly more efficient in C because it eliminates function call overhead.
For the purposes of this appendix, the macros are divided into four categories: Display macros, Image Format macros, Keysym Classification macros, and Resource Manager macros. The macros are listed alphabetically within each category.
Note that some macros take as arguments an integer screen (scr_num) or pointer to a screen structure (scr_pnt). scr_num is returned by the DefaultScreen macro and scr_pnt is returned by the DefaultScreenOfDisplay macro.
Display Macros
| AllPlanes () | Return a value with all bits set suitable for use as a plane mask argument. |
| BlackPixel(display, scr_num) | Return the black pixel value in the default colormap that is created by XOpenDisplay. |
| BlackPixelOfScreen(scr_pnt) | Return the black pixel value in the default colormap of the specified screen. |
| CellsOfScreen(scr_pnt) | Return the number of colormap cells in the default colormap of the specified screen. |
| ConnectionNumber |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access