[Copyright status: this file is in the public domain.] There are some calls which would generate protocol requests, except that the client already has all the relevant information on hand. Some of these are documented elsewhere: For See lx_bitmap_bit_order image.txt lx_bitmap_scanline_pad image.txt lx_bitmap_scanline_unit image.txt lx_fontinfo_charinfo font-info.txt lx_fontinfo_free font-info.txt lx_fontinfo_free_priv font-info.txt lx_fontinfo_recache font-info.txt lx_get_private private-data.txt lx_get_udata private-data.txt lx_image_byte_order image.txt lx_map_visuals visual.txt lx_new_conn_private private-data.txt lx_num_formats image.txt lx_pixmap_bpp image.txt lx_pixmap_depth image.txt lx_pixmap_pad image.txt lx_set_private private-data.txt lx_set_udata private-data.txt lx_text_extents_8 font-info.txt The rest are documented here for lack of anywhere else to document them. They return some attributes of the connection which are sent by the server during connection startup - or, in a few cases, attribtues of the library itself. Screens are numbered from 0 upward; for example, a display with 5 screens will number them 0 through 4. When applied to an LX_CONN that has failed (for example, if there has been a protocol error on the connection), these can fail. The values in this case are given as "on error". Additionally, for the calls that take additional values, such as a screen number, the "on error" value is returned in response to passing an out-of-range value (such as a screen number which is negative or too large). lx_backing_store ---------------- LX_BACKINGSTORE lx_backing_store(LX_CONN *c, int n) Returns screen n's backing-store support setting. This is one of the LX_BACKINGSTORE_* values and can be Always, WhenMapped, or Never. It indicates when the server supports backing-store for windows on this screen (there may be additional limitations, such as the size of the affected window or total backing-store storage space). Returns LX_LBACKING_STORE_Error on error. lx_black_pixel, lx_white_pixel -------------- -------------- unsigned int lx_black_pixel(LX_CONN *c, int n) unsigned int lx_white_pixel(LX_CONN *c, int n) Returns the black and white pixel values for screen n. These are colormap cells (pixel values) permanently allocated in the screen's default colormap. Their actual RGB values may be settable on some screens and, even when not, may not actually represent black and white. The names "are intended to convey the expected relative inetnsity of the colors", as the protocol document puts it. The intent is that simple applications content with just two contrasting colours ("monochrome") don't need to bother with colormap allocation and such. These return an undefined value on error. (It will be valid from a C perspective but meaningless from an X perspective.) lx_default_screen ----------------- int lx_default_screen(LX_CONN *c) Returns the default screen number, or -1 on error. lx_input_mask ---------------- unsigned int lx_input_mask(LX_CONN *c, int n) Returns the input mask for screen n. This is a snapshot of what pGetWindowAttributes (see lx_GetWindowAttributes in core.txt) would return as the all_events event mask for the root window, as of the moment the connection is established. (The actual event mask may change after connection establishment; the value this routine returns is fixed for the life of the connection.) Returns 0 on error. lx_library_major, lx_library_minor ---------------- ---------------- int lx_library_major(void) int lx_library_minor(void) Return the major and minor protocol version numbers (see lx_proto_major and lx_proto_minor) the liblx library in use is designed for. Provided the library and protocol major versions are equal and the library minor version is <= protocol minor version, they should be compatible. However, these are not useful in practice; in my experience the protocol major version is always 11 and the protocol minor version is always 0. These calls have no error conditions. lx_min_keycode, lx_max_keycode -------------- -------------- int lx_max_keycode(LX_CONN *c) int lx_min_keycode(LX_CONN *c) Return the maximum and minimum keycode values for the server Return -1 on error. lx_min_maps, lx_max_maps ----------- ----------- int lx_min_maps(LX_CONN *c, int n) int lx_max_maps(LX_CONN *c, int n) These return screen n's min-installed-maps and max-installed-maps values. These are the minimum and maximum number of colormaps which can be installed simultaneously. See lx_InstallColormap, in core.txt, for a discussion of what min-installed-maps is good for; as far as I can tell, max-installed-maps is not really useful for anything. Return -1 on error. lx_max_request -------------- int lx_max_request(LX_CONN *c) Returns the maximum request size, in 4-byte units, supported on this connection. Requests larger than this produce Length errors. The protocol document specifies that this value will always be at least 4096. (In my experience, it is typically 65535, the largest value the protocol can represent. liblx currently has no support for the BIG-REQUESTS extension, which can raise this limit; I intend to fix that.) Returns -1 on error. lx_motion_buffer_size --------------------- int lx_motion_buffer_size(LX_CONN *c) Returns the server's motion buffer size. See lx_GetMotionEvents, in core.txt, for a discussion of the motion buffer. Returns -1 on error. lx_nscreens ----------- int lx_nscreens(LX_CONN *c) Returns the number of screens on the display. Returns -1 on error. lx_proto_major, lx_proto_minor -------------- -------------- int lx_proto_major(LX_CONN *c) int lx_proto_minor(LX_CONN *c) Return the major and minor protocol version numbers the server is using for this connection. See lx_library_major and lx_library_minor for more. Return -1 on error. lx_resource_base, lx_resource_mask ---------------- ---------------- LX_XID lx_resource_base(LX_CONN *c) LX_XID lx_resource_mask(LX_CONN *c) Return the resource base and mask values for this connection. Resource IDs (windows, fonts, GC, etc) for resources created by this client are constructed by the client, by choosing some subset of the bits in the mask and ORing the result with the base. The mask "contains a single contiguous set of bits (at least 18)" (the protocol document does not say it does not contain any other bits, but I believe that is the intent). It is an IDChoice error for the client to attempt to create a resource with an ID not constructed as described above. Few-to-no applications will care about these. liblx creates resource IDs for resource creations calls internally. Return 0 on error. lx_root ------- LX_XID lx_root(LX_CONN *c, int n) Returns the root window of screen n. Returns LX_WINDOW_None on error. lx_root_colormap ---------------- LX_XID lx_root_colormap(LX_CONN *c, int n) Returns the default colormap for screen n. Returns LX_COLORMAP_None on error. lx_root_depth ------------- int lx_root_depth(LX_CONN *c, int n) Returns the depth of the root window of screen n. Returns -1 on error. lx_root_visual -------------- LX_XID lx_root_visual(LX_CONN *c, int n) Returns the Visual for the root window of screen n. Returns LX_VISUAL_None on error. lx_root_width, lx_root_height ------------- -------------- unsigned int lx_root_width(LX_CONN *c, int n) unsigned int lx_root_height(LX_CONN *c, int n) Return width and height of screen n in pixels. Return 0 on error. lx_root_width_mm, lx_root_height_mm ---------------- ----------------- unsigned int lx_root_width_mm(LX_CONN *c, int n) unsigned int lx_root_height_mm(LX_CONN *c, int n) Return width and height of screen n in millimetres, 0 on error. These values are not really useful, as in many cases the X server does not have access to the mechanical size of the screen; in some cases it can even change at run-time (for example, if a video cable is unplugged and replugged to a different monitor). Return 0 on error. lx_save_under ------------- int lx_save_under(LX_CONN *c, int n) Returns screen n's save-under support setting. This is a boolean, zero indicating no support and nonzero indicating support. (The save-under hint may be set regardless, but the server is always permitted to ignore it.) Returns -1 on error. lx_screen_ndepths, lx_screen_depth ----------------- --------------- int lx_screen_ndepths(LX_CONN *c, int n) int lx_screen_depth(LX_CONN *c, int n, int d) LX_XIDLIST *lx_screen_visuals(LX_CONN *c, int n, int d) As part of connection setup, the server returns a list of depths, indicating what depths are supported for pixmaps and windows, and what visuals are usable for windows. For each entry in this depth table, the actual depth is returned, along with a (possibly empty) list of visuals. Pixmaps are supported for each depth in the table; windows are suppoprted for each depth which has at least one visual listed. lx_screen_ndepths returns the number of entries in the depth table., or -1 on error. lx_screen_depth takes a screen number (n) and an index in that screen's depth table (d) and returns the depth for that table entry, or -1 on error. lx_screen_visuals takes a screen number (n) and an index in that screen's depth table (d) and returns the list of visuals for that table entry, or nil on error. (If there are no visuals listed for that table entry, the returned list will be empty.) See lists.txt for more on LX_XIDLISTs. lx_vendor, lx_release --------- ---------- void lx_vendor(LX_CONN *c, int *lenp, const char **strp) Returns the vendor string received by the client at connection setup. The length is returned through lenp. The string itself is returned through strp. The string pointed to is owned by liblx; the client must not try to do anything with it except read it. It exists until the LX_CONN is closed. On error, returns -1 for length and nil for the pointer.