XQueryBestSize()XQueryBestSize()Name
XQueryBestSize – obtain the "best" supported cursor, tile, or stipple
size.
Synopsis
Status XQueryBestSize(display, class, which_screen, width,
height, width_return, height_return)
Display *display;
int class;
Drawable which_screen;
unsigned int width, height;
unsigned int *width_return, *height_return;
Arguments
display Specifies a connection to an X server; returned from
XOpenDisplay().
class Specifies the class that you are interested in. Pass
one of these constants: TileShape, CursorShape, or Stip‐
pleShape.
which_screen Specifies a drawable ID that tells the server which
screen you want the best size for.
width Specify the preferred width and height in pixels.
height
width_return Return the closest supported width and height, in pix‐
height_return els, available for the object on the display hardware.
Returns
Zero on failure, non-zero on success.
DescriptionXQueryBestSize() returns the "fastest" or "closest" size to the speci‐
fied size. For class of CursorShape, this is the closest size that can
be fully displayed on the screen. For TileShape and StippleShape, this
is the closest size that can be tiled or stippled "fastest."
For CursorShape, the drawable indicates the desired screen. For Tile‐
Shape and StippleShape, the drawable indicates the screen and possibly
the visual class and depth (server-dependent). An InputOnly window
cannot be used as the drawable for TileShape or StippleShape (else a
BadMatch error occurs).
XQueryBestSize() returns non-zero if the call succeeded in getting a
supported size (may be the same or different from the specified size),
or zero if the call failed.
Errors
BadDrawable
BadMatch InputOnly drawable for class TileShape or StippleShape.
BadValue
See AlsoXCreateBitmapFromData(), XCreatePixmap(), XCreatePixmapFromBitmap‐
Data(), XFreePixmap(), XQueryBestStipple(), XQueryBestTile(), XRead‐
BitmapFile(), XSetTile(), XSetWindowBackgroundPixmap(), XSetWindowBor‐
derPixmap(), XWriteBitmapFile().
Xlib - Pixmaps and Tiles XQueryBestSize()