XQueryBestSize

Syntax

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 the connection to the X server.
class Specifies the class that you are interested in. You can pass TileShape, CursorShape, or StippleShape.
which_screen Specifies any drawable on the screen.
width
height
Specify the width and height.
width_return
height_return
Return the width and height of the object best supported by the display hardware.

Description

The XQueryBestSize() function returns the best or closest size to the specified size. For CursorShape, this is the largest size that can be fully displayed on the screen specified by which_screen. For TileShape, this is the size that can be tiled fastest. For StippleShape, this is the size that can be stippled fastest. For CursorShape, the drawable indicates the desired screen. For TileShape and StippleShape, the drawable indicates the screen and possibly the window class and depth. An InputOnly window cannot be used as the drawable for TileShape or StippleShape, or a BadMatch error results.

XQueryBestSize() can generate BadDrawable, BadMatch, and BadValue errors.

Diagnostics

BadDrawable A value for a Drawable argument does not name a defined Window or Pixmap.
BadMatch An InputOnly window is used as a Drawable.
BadMatch Some argument or pair of arguments has the correct type and range but fails to match in some other way required by the request.
BadValue Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error.

See also

XCreateGC(), XQueryBestTile(), XQueryBestStipple(), XSetArcMode(), XSetClipOrigin(), XSetFillStyle(), XSetFont(), XSetLineAttributes(), XSetState(), XSetTile(), "Setting the Fill Tile and Stipple".
Christophe Tronche, ch@tronche.com