The _X_M_a_t_c_h_V_i_s_u_a_l_I_n_f_o function returns the visual information for a visual that matches the specified depth and class for a screen. Because multiple visuals that match the specified depth and class can exist, the exact visual chosen is undefined. If a visual is found, _X_M_a_t_c_h_V_i_s_u_a_l_I_n_f_o returns nonzero and the information on the visual to vinfo_return. Otherwise, when a visual is not found, _X_M_a_t_c_h_V_i_s_u_a_l_I_n_f_o returns zero.
The _X_V_i_s_u_a_l_I_D_F_r_o_m_V_i_s_u_a_l function returns the visual ID for the specified visual type.
/* Visual information mask bits */
lw(.5i) lw(2.5i) lw(.8i). T{ #define T} T{ _V_i_s_u_a_l_N_o_M_a_s_k T} T{ 0x0 T} T{ #define T} T{ _V_i_s_u_a_l_I_D_M_a_s_k T} T{ 0x1 T} T{ #define T} T{ _V_i_s_u_a_l_S_c_r_e_e_n_M_a_s_k T} T{ 0x2 T} T{ #define T} T{ _V_i_s_u_a_l_D_e_p_t_h_M_a_s_k T} T{ 0x4 T} T{ #define T} T{ _V_i_s_u_a_l_C_l_a_s_s_M_a_s_k T} T{ 0x8 T} T{ #define T} T{ _V_i_s_u_a_l_R_e_d_M_a_s_k_M_a_s_k T} T{ 0x10 T} T{ #define T} T{ _V_i_s_u_a_l_G_r_e_e_n_M_a_s_k_M_a_s_k T} T{ 0x20 T} T{ #define T} T{ _V_i_s_u_a_l_B_l_u_e_M_a_s_k_M_a_s_k T} T{ 0x40 T} T{ #define T} T{ _V_i_s_u_a_l_C_o_l_o_r_m_a_p_S_i_z_e_M_a_s_k T} T{ 0x80 T} T{ #define T} T{ _V_i_s_u_a_l_B_i_t_s_P_e_r_R_G_B_M_a_s_k T} T{ 0x100 T} T{ #define T} T{ _V_i_s_u_a_l_A_l_l_M_a_s_k T} T{ 0x1FF T}
/* Values */
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;