<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<!-- lifted from troff+man by doclifter -->
<refentry id='xgetvinfoman'>
<!-- '\" t -->
<!--  Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1994, 1996 X Consortium -->

<!--  Permission is hereby granted, free of charge, to any person obtaining -->
<!--  a copy of this software and associated documentation files (the -->
<!--  "Software"), to deal in the Software without restriction, including -->
<!--  without limitation the rights to use, copy, modify, merge, publish, -->
<!--  distribute, sublicense, and/or sell copies of the Software, and to -->
<!--  permit persons to whom the Software is furnished to do so, subject to -->
<!--  the following conditions: -->

<!--  The above copyright notice and this permission notice shall be included -->
<!--  in all copies or substantial portions of the Software. -->

<!--  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -->
<!--  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -->
<!--  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -->
<!--  IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR -->
<!--  OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -->
<!--  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -->
<!--  OTHER DEALINGS IN THE SOFTWARE. -->

<!--  Except as contained in this notice, the name of the X Consortium shall -->
<!--  not be used in advertising or otherwise to promote the sale, use or -->
<!--  other dealings in this Software without prior written authorization -->
<!--  from the X Consortium. -->

<!--  Copyright \(co 1985, 1986, 1987, 1988, 1989, 1990, 1991 by -->
<!--  Digital Equipment Corporation -->

<!--  Portions Copyright \(co 1990, 1991 by -->
<!--  Tektronix, Inc. -->

<!--  Permission to use, copy, modify and distribute this documentation for -->
<!--  any purpose and without fee is hereby granted, provided that the above -->
<!--  copyright notice appears in all copies and that both that copyright notice -->
<!--  and this permission notice appear in all copies, and that the names of -->
<!--  Digital and Tektronix not be used in in advertising or publicity pertaining -->
<!--  to this documentation without specific, written prior permission. -->
<!--  Digital and Tektronix makes no representations about the suitability -->
<!--  of this documentation for any purpose. -->
<!--  It is provided ``as is'' without express or implied warranty. -->
<!--   -->
<!--  $XFree86: xc/doc/man/X11/XGetVInfo.man,v 1.5 2003/11/23 05:40:33 dawes Exp $ -->

<!-- .na -->
<!-- FD listing suppressed (not used) -->
<!-- FN listing suppressed (not used) -->
<!-- C{ listing suppressed (not used) -->
<!-- C} listing suppressed (not used) -->
<!-- Pn listing suppressed (not used) -->
<!-- hN listing suppressed (not used) -->
<!-- NT listing suppressed (not used) -->
<!-- .		\" Note End \-\- doug kraft 3/85 -->
<!-- NE listing suppressed (not used) -->
<!-- .ny0 -->
<!-- '\" t -->
<refmeta>
<refentrytitle>XGetVisualInfo</refentrytitle>
<manvolnum>3X11</manvolnum>
<refmiscinfo class='date'>__xorgversion__</refmiscinfo>
<refmiscinfo class='source'>XLIB FUNCTIONS</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>XGetVisualInfo</refname>
<refname>XMatchVisualInfo</refname>
<refname>XVisualIDFromVisual</refname>
<refname>XVisualInfo</refname>
<refpurpose>obtain visual information and visual structure</refpurpose>
</refnamediv>
<!-- body begins here -->

<refsect1 id='syntax'><title>SYNTAX</title>

<para>XVisualInfo *XGetVisualInfo&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;, long
<emphasis remap='I'>vinfo_mask</emphasis>&hairsp;, XVisualInfo *<emphasis remap='I'>vinfo_template</emphasis>&hairsp;, int
*<emphasis remap='I'>nitems_return</emphasis>&hairsp;);</para> 

<para>Status XMatchVisualInfo&hairsp;(&hairsp;Display *<emphasis remap='I'>display</emphasis>&hairsp;, int <emphasis remap='I'>screen</emphasis>&hairsp;, int
<emphasis remap='I'>depth</emphasis>&hairsp;, int <emphasis remap='I'>class</emphasis>&hairsp;, XVisualInfo *<emphasis remap='I'>vinfo_return</emphasis>&hairsp;);</para> 

<para>VisualID XVisualIDFromVisual&hairsp;(&hairsp;Visual *&hairsp;<emphasis remap='I'>visual</emphasis>&hairsp;);</para> 
</refsect1>

<refsect1 id='arguments'><title>ARGUMENTS</title>
<variablelist remap='IP'>
  <varlistentry>
  <term><emphasis remap='I'>class</emphasis></term>
  <listitem>
<para>Specifies the class of the screen.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>depth</emphasis></term>
  <listitem>
<para>Specifies the depth of the screen.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>display</emphasis></term>
  <listitem>
<para>Specifies the connection to the X server.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>nitems_return</emphasis></term>
  <listitem>
<para>Returns the number of matching visual structures.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>screen</emphasis></term>
  <listitem>
<para>Specifies the screen.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>visual</emphasis></term>
  <listitem>
<para>Specifies the visual type.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>vinfo_mask</emphasis></term>
  <listitem>
<para>Specifies the visual mask value.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>vinfo_return</emphasis></term>
  <listitem>
<para>Returns the matched visual information.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>vinfo_template</emphasis></term>
  <listitem>
<para>Specifies the visual attributes that are to be used in matching the visual
structures.</para>
  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='description'><title>DESCRIPTION</title>
<para>The
<emphasis remap='I'>&hairsp;XGetVisualInfo&hairsp;</emphasis>
function returns a list of visual structures that have attributes 
equal to the attributes specified by vinfo_template.
If no visual structures match the template using the specified vinfo_mask,
<emphasis remap='I'>&hairsp;XGetVisualInfo&hairsp;</emphasis>
returns a NULL.
To free the data returned by this function, use
<emphasis remap='I'>&hairsp;XFree&hairsp;</emphasis>.</para>

<para>The
<emphasis remap='I'>&hairsp;XMatchVisualInfo&hairsp;</emphasis>
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,
<emphasis remap='I'>&hairsp;XMatchVisualInfo&hairsp;</emphasis>
returns nonzero and the information on the visual to vinfo_return.
Otherwise, when a visual is not found,
<emphasis remap='I'>&hairsp;XMatchVisualInfo&hairsp;</emphasis>
returns zero.</para>

<para>The
<emphasis remap='I'>&hairsp;XVisualIDFromVisual&hairsp;</emphasis>
function returns the visual ID for the specified visual type.</para>
</refsect1>

<refsect1 id='structures'><title>STRUCTURES</title>
<para>The
<emphasis remap='I'>&hairsp;XVisualInfo&hairsp;</emphasis>
structure contains:</para>


<para>/&lowast; Visual information mask bits */</para>


<informaltable pgwide='0' frame='none'>
  <tgroup cols='3' align='center'>
    <colspec colname='c1'/>
    <colspec colname='c2'/>
    <colspec colname='c3'/>
    <tbody>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN VisualNoMask</entry>
        <entry align='left'>0x0</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN VisualIDMask</entry>
        <entry align='left'>0x1</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN VisualScreenMask</entry>
        <entry align='left'>0x2</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN VisualDepthMask</entry>
        <entry align='left'>0x4</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN VisualClassMask</entry>
        <entry align='left'>0x8</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN VisualRedMaskMask</entry>
        <entry align='left'>0x10</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN VisualGreenMaskMask</entry>
        <entry align='left'>0x20</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN VisualBlueMaskMask</entry>
        <entry align='left'>0x40</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN VisualColormapSizeMask</entry>
        <entry align='left'>0x80</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN VisualBitsPerRGBMask</entry>
        <entry align='left'>0x100</entry>
      </row>
      <row>
        <entry align='left'>T{
#define</entry>
        <entry align='left'>.ZN VisualAllMask</entry>
        <entry align='left'>0x1FF</entry>
      </row>
    </tbody>
  </tgroup>
</informaltable>


<literallayout remap='.nf'>
<!-- .0D  0 -->

<!-- .ps \n(PS -->
<!-- .if \n(VS&gt;=40 .vs \n(VSu -->
<!-- .if \n(VS&lt;=39 .vs \n(VSp -->
<!-- .TA .5i 3i -->
<!-- .ta .5i 3i -->
/&lowast; 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;
<!-- .ce 0  IGNORED -->
<!-- .in \n(OIu  IGNORED -->

</literallayout> <!-- .fi -->
</refsect1>

<refsect1 id='see_also'><title>SEE ALSO</title>
<para>XFree(3X11)
<!-- .br -->
<userinput>Xlib - C Language X Interface</userinput></para>
</refsect1>
</refentry>

