<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="class-gdkvisual">
  <refnamediv>
    <refname>gtk.gdk.Visual</refname>
    <refpurpose>an object containing hardware display
information</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>gtk.gdk.Visual</classname></ooclass>
      <ooclass><classname><link
linkend="class-gobject">gobject.GObject</link></classname></ooclass>
      <constructorsynopsis language="python">
	<methodname><link
linkend="constructor-gdkvisual">gtk.gdk.Visual</link></methodname>
	<methodparam><parameter
		       role="keyword">depth</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">visual_type</parameter></methodparam>
      </constructorsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gdkvisual--get-screen">get_screen</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
    </classsynopsis>
    
    <programlisting>
<emphasis role="bold">Functions</emphasis>

<methodsynopsis language="python">
    <methodname><link linkend="function-gdk--list-visuals">gtk.gdk.list_visuals</link></methodname>
    <methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
    <methodname><link linkend="function-gdk--visual-get-best">gtk.gdk.visual_get_best</link></methodname>
    <methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
    <methodname><link linkend="function-gdk--visual-get-best-depth">gtk.gdk.visual_get_best_depth</link></methodname>
    <methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
    <methodname><link linkend="function-gdk--visual-get-best-type">gtk.gdk.visual_get_best_type</link></methodname>
    <methodparam></methodparam>
  </methodsynopsis><methodsynopsis language="python">
    <methodname><link linkend="function-gdk--visual-get-best-with-depth">gtk.gdk.visual_get_best_with_depth</link></methodname>
    <methodparam><parameter role="keyword">depth</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
    <methodname><link linkend="function-gdk--visual-get-best-with-type">gtk.gdk.visual_get_best_with_type</link></methodname>
    <methodparam><parameter role="keyword">type</parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
    <methodname><link linkend="function-gdk--visual-get-system">gtk.gdk.visual_get_system</link></methodname>
    <methodparam><parameter role="keyword"></parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
    <methodname><link linkend="function-gdk--query-depths">gtk.gdk.query_depths</link></methodname>
    <methodparam><parameter role="keyword"></parameter></methodparam>
  </methodsynopsis><methodsynopsis language="python">
    <methodname><link linkend="function-gdk--query-visual-types">gtk.gdk.query_visual_types</link></methodname>
    <methodparam><parameter role="keyword"></parameter></methodparam>
  </methodsynopsis></programlisting>

  </refsect1>

  <refsect1>
    <title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
  +-- <link linkend="class-gdkvisual">gtk.gdk.Visual</link>
</synopsis>

  </refsect1>

  <refsect1>
    <title>Attributes</title>

    <blockquote role="properties">
      <informaltable pgwide="1" frame="none">
	<tgroup cols="3">
	<?dbhtml cellpadding="5"?>
	  <colspec column="1" colwidth="1in"/>
	  <colspec column="2" colwidth="1in"/>
	  <colspec column="3" colwidth="4in"/>
	  <tbody>

	    <row valign="top">
	      <entry>"bits_per_rgb"</entry>
	      <entry>Read</entry>
	      <entry>The number of significant bits per red, green, or blue
when specifying colors for this visual. (For instance, for the <link
linkend="method-gdkcolormap--alloc-color"><methodname>gtk.gdk.Colormap.alloc_color</methodname>()</link> 
method)</entry>
	    </row>

	    <row valign="top">
	      <entry>"blue_mask"</entry>
	      <entry>Read</entry>
	      <entry>A mask giving the bits in a pixel value that correspond
to the blue field.</entry>
	    </row>

	    <row valign="top">
	      <entry>"blue_prec"</entry>
	      <entry>Read</entry>
	      <entry>See above.</entry>
	    </row>

	    <row valign="top">
	      <entry>"blue_shift"</entry>
	      <entry>Read</entry>
	      <entry>The <parameter>blue_shift</parameter> and
<parameter>blue_prec</parameter> give an alternate presentation of the
information in <parameter>blue_mask</parameter>. </entry>
	    </row>

	    <row valign="top">
	      <entry>"byte_order"</entry>
	      <entry>Read</entry>
	      <entry>The byte-order for this visual - either:
<literal>gtk.gdk.LSB_FIRST</literal> or
<literal>gtk.gdk.MSB_FIRST</literal>.</entry>
	    </row>

	    <row valign="top">
	      <entry>"colormap_size"</entry>
	      <entry>Read</entry>
	      <entry>The number of entries in the colormap, for visuals of
type <literal>gtk.gdk.VISUAL_PSEUDO_COLOR</literal> or
<literal>gtk.gdk.VISUAL_GRAY_SCALE</literal>. For other visual types, it is
the number of possible levels per color component. If the visual has
different numbers of levels for different components, the value of this
field is undefined.</entry>
	    </row>

	    <row valign="top">
	      <entry>"depth"</entry>
	      <entry>Read</entry>
	      <entry>The number of bits per pixel.</entry>
	    </row>

	    <row valign="top">
	      <entry>"green_mask"</entry>
	      <entry>Read</entry>
	      <entry>A mask giving the bits in a pixel value that correspond
to the green field.</entry>
	    </row>

	    <row valign="top">
	      <entry>"green_prec"</entry>
	      <entry>Read</entry>
	      <entry>See above.</entry>
	    </row>

	    <row valign="top">
	      <entry>"green_shift"</entry>
	      <entry>Read</entry>
	      <entry>The <parameter>green_shift</parameter> and
<parameter>green_prec</parameter> give an alternate presentation of the
information in <parameter>green_mask</parameter>.</entry>
	    </row>

	    <row valign="top">
	      <entry>"red_mask"</entry>
	      <entry>Read</entry>
	      <entry>A mask giving the bits in a pixel value that correspond
to the red field. Significant only for
<literal>gtk.gdk.VISUAL_PSEUDOCOLOR</literal> and
<literal>gtk.gdk.VISUAL_DIRECTCOLOR</literal>.</entry>
	    </row>

	    <row valign="top">
	      <entry>"red_prec"</entry>
	      <entry>Read</entry>
	      <entry>See above.</entry>
	    </row>

	    <row valign="top">
	      <entry>"red_shift"</entry>
	      <entry>Read</entry>
	      <entry>The <parameter>red_shift</parameter> and
<parameter>red_prec</parameter> give an alternate presentation of the
information in <parameter>red_mask</parameter>.
<parameter>red_mask</parameter> is a contiguous sequence of
<parameter>red_prec</parameter> bits starting at bit number
<parameter>red_shift</parameter>.</entry>
	    </row>

	    <row valign="top">
	      <entry>"type"</entry>
	      <entry>Read</entry>
	      <entry>The type of this visual - one of:
<literal>gtk.gdk.VISUAL_STATIC_GRAY</literal>,
<literal>gtk.gdk.VISUAL_GRAYSCALE</literal>,
<literal>gtk.gdk.VISUAL_STATIC_COLOR</literal>,
<literal>gtk.gdk.VISUAL_PSEUDO_COLOR</literal>,
<literal>gtk.gdk.VISUAL_TRUE_COLOR</literal>,
<literal>gtk.gdk.VISUAL_DIRECT_COLOR</literal></entry>
	    </row>

	  </tbody>
	</tgroup>
      </informaltable>
    </blockquote>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <para>A <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link>
describes a particular video hardware display format. It includes
information about the number of bits used for each color, the way the bits
are translated into an RGB value for display, and the way the bits are
stored in memory. For example, a piece of display hardware might support
24-bit color, 16-bit color, or 8-bit color; meaning 24/16/8-bit pixel sizes.
For a given pixel size, pixels can be in different formats; for example the
"red" element of an RGB pixel may be in the top 8 bits of the pixel, or may
be in the lower 4 bits.</para>

    <para>Usually you can avoid thinking about visuals in
<literal>PyGTK</literal>. Visuals are useful to interpret the contents of a
<link linkend="class-gdkimage"><classname>gtk.gdk.Image</classname></link>,
but you should avoid <link
linkend="class-gdkimage"><classname>gtk.gdk.Image</classname></link>
precisely because its contents depend on the display hardware; use <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>
instead, for all but the most low-level purposes. Also, anytime you provide
a <link
linkend="class-gdkcolormap"><classname>gtk.gdk.Colormap</classname></link>,
the visual is implied as part of the colormap (see the <link
linkend="method-gdkcolormap--get-visual"><methodname>gtk.gdk.Colormap.get_visual</methodname>()</link> 
method), so you won't have to provide a visual in addition.</para>

    <para>There are several standard visuals. The visual returned by the
<link
linkend="function-gdk--visual-get-system"><methodname>gtk.gdk.visual_get_system</methodname>()</link> 
function is the system's default visual. The <link
linkend="function-gdk--rgb-get-visual"><methodname>gtk.gdk.rgb_get_visual</methodname>()</link> 
function returns the visual most suited to displaying full-color image data.
If you use the calls in GdkRGB, you should create your windows using this
visual (and the colormap returned by the <link
linkend="function-gdk--rgb-get-colormap"><methodname>gtk.gdk.rgb_get_colormap</methodname>()</link> 
function).</para>

    <para>A number of functions are provided for determining the "best"
available visual. For the purposes of making this determination, higher bit
depths are considered better, and for visuals of the same bit depth,
<literal>gtk.gdk.VISUAL_PSEUDO_COLOR</literal> is preferred at 8bpp,
otherwise, the visual types are ranked in the order of (highest to lowest)
<literal>gtk.gdk.VISUAL_DIRECT_COLOR</literal>,
<literal>gtk.gdk.VISUAL_TRUE_COLOR</literal>,
<literal>gtk.gdk.VISUAL_PSEUDO_COLOR</literal>,
<literal>gtk.gdk.VISUAL_STATIC_COLOR</literal>,
<literal>gtk.gdk.VISUAL_GRAYSCALE</literal>, then
<literal>gtk.gdk.VISUAL_STATIC_GRAY</literal>.</para>

  </refsect1>

  <refsect1 id="constructor-gdkvisual">
    <title>Constructor</title>

    <programlisting><constructorsynopsis language="python">
	<methodname>gtk.gdk.Visual</methodname>
	<methodparam><parameter
		       role="keyword">depth</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">visual_type</parameter></methodparam>
      </constructorsynopsis></programlisting>
    <variablelist>
      <varlistentry>
	<term><parameter role="keyword">depth</parameter>&nbsp;:</term>
	<listitem><simpara>a bit depth</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter
role="keyword">visual_type</parameter>&nbsp;:</term>
	<listitem><simpara>a visual type</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	<listitem><simpara>the best <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link> with
both <parameter>depth</parameter> and <parameter>visual_type</parameter>, or
<literal>None</literal> if none</simpara></listitem>
      </varlistentry>
    </variablelist>

    <para>Creates a new <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link> that
is the best choice for the specified <parameter>depth</parameter> and
<parameter>visual_type</parameter>. Color visuals and visuals with mutable
colormaps are preferred over grayscale or fixed-colormap visuals and visuals
with higher color depths are considered better. The value of
<parameter>visual_type</parameter> must be one of:</para>

    <variablelist>
      <varlistentry>
	<term><literal>gtk.gdk.VISUAL_STATIC_GRAY</literal></term>
	<listitem>
	  <simpara>Each pixel value indexes a grayscale value
directly.</simpara>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><literal>gtk.gdk.VISUAL_GRAYSCALE</literal></term>
	<listitem>
	  <simpara>Each pixel is an index into a color map that maps pixel
values into grayscale values. The color map can be changed by an
application.</simpara>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><literal>gtk.gdk.VISUAL_STATIC_COLOR</literal></term>
	<listitem>
	  <simpara>Each pixel value is an index into a predefined,
unmodifiable color map that maps pixel values into RGB values.</simpara>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><literal>gtk.gdk.VISUAL_PSEUDO_COLOR</literal></term>
	<listitem>
	  <simpara>Each pixel is an index into a color map that maps pixel
values into rgb values. The color map can be changed by an
application.</simpara>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><literal>gtk.gdk.VISUAL_TRUE_COLOR</literal></term>
	<listitem>
	  <simpara>Each pixel value directly contains red, green, and blue
components. The red_mask, green_mask, and blue_mask fields of the <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link>
structure describe how the components are assembled into a pixel
value.</simpara>
	</listitem>
      </varlistentry>
      <varlistentry>
	<term><literal>gtk.gdk.VISUAL_DIRECT_COLOR</literal></term>
	<listitem>
	  <simpara>Each pixel value contains red, green, and blue components
as for <literal>gtk.gdk.TRUE_COLOR</literal>, but the components are mapped
via a color table into the final output table instead of being converted
directly. </simpara>
	</listitem>
      </varlistentry>
    </variablelist>

    <para></para>

  </refsect1>

  <refsect1>
    <title>Methods</title>

    <refsect2 id="method-gdkvisual--get-screen">
      <title>gtk.gdk.Visual.get_screen</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_screen</methodname>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the screen that this visual belongs
to.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.2 and above.</para>
      </note>

      <para>The <methodname>get_screen</methodname>() method returns the
<link linkend="class-gdkscreen"><classname>gtk.gdk.Screen</classname></link>
that this visual belongs to.</para>

    </refsect2>

  </refsect1>

  <refsect1>
    <title>Functions</title>

    <refsect2 id="function-gdk--list-visuals">
      <title>gtk.gdk.list_visuals</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.list_visuals</methodname>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a list of <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link>
objects</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.list_visuals</function>() function returns
a list containing the available <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link>
objects for the default screen.</para>

    </refsect2>

    <refsect2 id="function-gdk--visual-get-best">
      <title>gtk.gdk.visual_get_best</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.visual_get_best</methodname>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the best <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link> for
the default screen</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.visual_get_best</function>() function
returns the visual with the most available colors for the default
screen.</para>

    </refsect2>

    <refsect2 id="function-gdk--visual-get-best-depth">
      <title>gtk.gdk.visual_get_best_depth</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.visual_get_best_depth</methodname>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the best available depth.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.visual_get_best_depth</function>()
function returns the best available depth for the default GDK screen.
"Best" means "largest," i.e. 32 preferred over 24 preferred over 8 bits
per pixel.</para>

    </refsect2>

    <refsect2 id="function-gdk--visual-get-best-type">
      <title>gtk.gdk.visual_get_best_type</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.visual_get_best_type</methodname>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link> with
the best type for the default screen</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.visual_get_best_type</function>() function
returns the best available <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link> type
for the default screen.</para>

    </refsect2>

    <refsect2 id="function-gdk--visual-get-best-with-depth">
      <title>gtk.gdk.visual_get_best_with_depth</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.visual_get_best_with_depth</methodname>
	  <methodparam><parameter
			 role="keyword">depth</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">depth</parameter>&nbsp;:</term>
	  <listitem><simpara>the number of bits per
pixel</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the best <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link> for
the specified <parameter>depth</parameter></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.visual_get_best_with_depth</function>()
function returns the best <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link> with
the specified <parameter>depth</parameter>.</para>

    </refsect2>

    <refsect2 id="function-gdk--visual-get-best-with-type">
      <title>gtk.gdk.visual_get_best_with_type</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.visual_get_best_with_type</methodname>
	  <methodparam><parameter
			 role="keyword">type</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">type</parameter>&nbsp;:</term>
	  <listitem><simpara>a visual type</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the best gdkVisual for the visual type
specified by <parameter>type</parameter></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.visual_get_best_with_type</function>()
function returns the best <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link> for
the visual type specified by <parameter>type</parameter>. The value of
<parameter>visual_type</parameter> must be one of:</para>

      <variablelist>
	<varlistentry>
	  <term><literal>gtk.gdk.VISUAL_STATIC_GRAY</literal></term>
	  <listitem>
	    <simpara>Each pixel value indexes a grayscale value
directly.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.VISUAL_GRAYSCALE</literal></term>
	  <listitem>
	    <simpara>Each pixel is an index into a color map that maps pixel
values into grayscale values. The color map can be changed by an
application.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.VISUAL_STATIC_COLOR</literal></term>
	  <listitem>
	    <simpara>Each pixel value is an index into a predefined,
unmodifiable color map that maps pixel values into RGB values.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.VISUAL_PSEUDO_COLOR</literal></term>
	  <listitem>
	    <simpara>Each pixel is an index into a color map that maps pixel
values into rgb values. The color map can be changed by an
application.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.VISUAL_TRUE_COLOR</literal></term>
	  <listitem>
	    <simpara>Each pixel value directly contains red, green, and blue
components. The red_mask, green_mask, and blue_mask fields of the <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link>
structure describe how the components are assembled into a pixel
value.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.VISUAL_DIRECT_COLOR</literal></term>
	  <listitem>
	    <simpara>Each pixel value contains red, green, and blue
components as for <literal>gtk.gdk.TRUE_COLOR</literal>, but the components
are mapped via a color table into the final output table instead of being
converted directly. </simpara>
	  </listitem>
	</varlistentry>
      </variablelist>

      <para></para>

    </refsect2>

    <refsect2 id="function-gdk--visual-get-system">
      <title>gtk.gdk.visual_get_system</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.visual_get_system</methodname>
	  <variablelist>
	    <varlistentry>
	      <term><emphasis>Returns</emphasis>&nbsp;:</term>
	      <listitem><simpara>the system <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link></simpara></listitem>
	    </varlistentry>
	  </variablelist>
	</methodsynopsis></programlisting>

      <para>The <function>gtk.gdk.visual_get_system</function>() function
returns the default <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link> for
the system's default screen.</para>

    </refsect2>

    <refsect2 id="function-gdk--query-depths">
      <title>gtk.gdk.query_depths</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.query_depths</methodname>
	  <variablelist>
	    <varlistentry>
	      <term><emphasis>Returns</emphasis>&nbsp;:</term>
	      <listitem><simpara>a tuple containing the unique supported
	      visual depths</simpara></listitem>
	    </varlistentry>
	  </variablelist>
	</methodsynopsis></programlisting>

      <note>
	<para>This function is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <function>gtk.gdk.query_depths</function>() function returns
a tuple containing the unique supported visual depths for the default
screen. It's equivalent to listing the visuals (see the <link
linkend="function-gdk--list-visuals"><function>gtk.gdk.list_visuals</function>()</link>
function) and then looking at the depth field in each visual, removing
duplicates.</para>

    </refsect2>

    <refsect2 id="function-gdk--query-visual-types">
      <title>gtk.gdk.query_visual_types</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.query_visual_types</methodname>
	  <variablelist>
	    <varlistentry>
	      <term><emphasis>Returns</emphasis>&nbsp;:</term>
	      <listitem><simpara>the system <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link></simpara></listitem>
	    </varlistentry>
	  </variablelist>
	</methodsynopsis></programlisting>

      <para>The <function>gtk.gdk.query_visual_types</function>() function
returns a tuple containing the unique visual types supported by the default
screen.It's equivalent to listing the visuals (see the <link
linkend="function-gdk--list-visuals"><function>gtk.gdk.list_visuals</function>()</link>
function) and then looking at the type field in each visual, removing
duplicates.</para>

      <para>The returned value will be one of:</para>

      <variablelist>
	<varlistentry>
	  <term><literal>gtk.gdk.VISUAL_STATIC_GRAY</literal></term>
	  <listitem>
	    <simpara>Each pixel value indexes a grayscale value
	    directly.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.VISUAL_GRAYSCALE</literal></term>
	  <listitem>
	    <simpara>Each pixel is an index into a color map that maps pixel
	    values into grayscale values. The color map can be changed by an
	    application.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.VISUAL_STATIC_COLOR</literal></term>
	  <listitem>
	    <simpara>Each pixel value is an index into a predefined,
	    unmodifiable color map that maps pixel values into RGB
	    values.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.VISUAL_PSEUDO_COLOR</literal></term>
	  <listitem>
	    <simpara>Each pixel is an index into a color map that maps pixel
	    values into rgb values. The color map can be changed by an
	    application.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.VISUAL_TRUE_COLOR</literal></term>
	  <listitem>
	    <simpara>Each pixel value directly contains red, green, and blue
	    components. The red_mask, green_mask, and blue_mask fields of
	    the <link
	    linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link>
	    structure describe how the components are assembled into a pixel
	    value.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.VISUAL_DIRECT_COLOR</literal></term>
	  <listitem>
	    <simpara>Each pixel value contains red, green, and blue
	    components as for <literal>gtk.gdk.VISUAL_TRUE_COLOR</literal>,
	    but the components are mapped via a color table into the final
	    output table instead of being converted directly.</simpara>
	  </listitem>
	</varlistentry>
      </variablelist>

      <para></para>

    </refsect2>

  </refsect1>

</refentry>
