12.07.2015 Views

Xlib − C Language X Interface

Xlib − C Language X Interface

Xlib − C Language X Interface

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Xlib</strong> − C LibraryX11, Release 6.7 DRAFTint XRectInRegion (r, x, y, width, height)Region r;int x, y;unsigned int width, height;rxywidthheightSpecifies the region.Specify the x and y coordinates, which define the coordinates of the upper-leftcorner of the rectangle.Specify the width and height, which define the rectangle.The XRectInRegion function returns RectangleIn if the rectangle is entirely in the specifiedregion, RectangleOut if the rectangle is entirely out of the specified region, and RectanglePartif the rectangle is partially in the specified region.16.6. Using Cut Buffers<strong>Xlib</strong> provides functions to manipulate cut buffers, a very simple form of cut-and-paste inter-clientcommunication. Selections are a much more powerful and useful mechanism for interchangingdata between clients (see section 4.5) and generally should be used instead of cut buffers.Cut buffers are implemented as properties on the first root window ofthe display. The buffers canonly contain text, in the STRING encoding. The text encoding is not changed by <strong>Xlib</strong> whenfetching or storing. Eight buffers are provided and can be accessed as a ring or as explicit buffers(numbered 0 through 7).To store data in cut buffer 0, use XStoreBytes.XStoreBytes (display, bytes, nbytes)Display *display;char *bytes;int nbytes;displaybytesnbytesSpecifies the connection to the X server.Specifies the bytes, which are not necessarily ASCII or null-terminated.Specifies the number of bytes to be stored.The data can have embedded null characters and need not be null-terminated. The cut buffer’scontents can be retrieved later by any client calling XFetchBytes.XStoreBytes can generate a BadAlloc error.To store data in a specified cut buffer, use XStoreBuffer.412

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!