NAME
XGetVisualInfo − find the visual information structures that match the specified template.
Synopsis
XVisualInfo *XGetVisualInfo(display, vinfo_mask,
vinfo_template, nitems_return)
Display *display;
long vinfo_mask;
XVisualInfo *vinfo_template;
int *nitems_return;
Arguments
displaySpecifies a connection to an X server; returned from XOpenDisplay().
vinfo_mask
Specifies the visual mask value. Indicates which elements in template are to be matched.
vinfo_template
Specifies the visual attributes that are to be used in matching the visual structures.
nitems_return
Returns the number of matching visual structures.
Description
XGetVisualInfo() returns a list of visual structures that describe visuals supported by the server and that match the attributes specified by the vinfo_template argument. If no visual structures match the template fields specified in Vinfo_mask, XGetVisualInfo() returns a NULL. To free the data returned by this function, use XFree(). For more information, see Volume One, Chapter 7, Color.
Structures
typedef struct {
Visual *visual;
VisualID visualid;
int screen;
unsigned int depth;
int class;
unsigned long red_mask;
unsigned long green_mask;
unsigned long blue_mask;
int colormap_size;
int bits_per_rgb;
} XVisualInfo;
/* The symbols for the vinfo_mask argument are: */
#define VisualNoMask0x0
#define VisualIDMask 0x1
#define VisualScreenMask0x2
#define VisualDepthMask0x4
#define VisualClassMask0x8
#define VisualRedMaskMask0x10
#define VisualGreenMaskMask0x20
#define VisualBlueMaskMask0x40
#define VisualColormapSizeMask0x80
#define VisualBitsPerRGBMask0x100
#define VisualAllMask0x1FF
See Also
DefaultVisual(), XVisualIDFromVisual(), XMatchVisualInfo(), XListDepths().
Copyright O’Reilly & Assoc. —