This file is indexed.

/usr/share/gtk-doc/html/pygtk/class-gdkvisual.html is in python-gtk2-doc 2.24.0-4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>gtk.gdk.Visual</title><link rel="stylesheet" href="style.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gdk-class-reference.html" title="The gtk.gdk Class Reference"><link rel="prev" href="class-gdkscreen.html" title="gtk.gdk.Screen"><link rel="next" href="class-gdkwindow.html" title="gtk.gdk.Window"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gtk.gdk.Visual</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gdkscreen.html">Prev</a> </td><th width="60%" align="center">The gtk.gdk Class Reference</th><td width="20%" align="right"> <a accesskey="n" href="class-gdkwindow.html">Next</a></td></tr></table><hr></div><div class="refentry" title="gtk.gdk.Visual"><a name="class-gdkvisual"></a><div class="titlepage"></div><div class="refnamediv"><h2>gtk.gdk.Visual</h2><p>gtk.gdk.Visual — an object containing hardware display
information</p></div><div class="refsect1" title="Synopsis"><a name="id3495233"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.gdk.Visual</span></span>(<span class="ooclass"><span class="classname"><PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK></span></span>):
<code class="constructorsynopsis">    <span class="methodname"><a class="link" href="class-gdkvisual.html#constructor-gdkvisual" title="Constructor">gtk.gdk.Visual</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>depth</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>visual_type</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gdkvisual.html#method-gdkvisual--get-screen" title="gtk.gdk.Visual.get_screen">get_screen</a></span>(<span class="methodparam"></span>)</code><br></pre></td></tr></table><pre class="programlisting">
<span class="bold"><strong>Functions</strong></span>

<code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gdkvisual.html#function-gdk--list-visuals" title="gtk.gdk.list_visuals">gtk.gdk.list_visuals</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gdkvisual.html#function-gdk--visual-get-best" title="gtk.gdk.visual_get_best">gtk.gdk.visual_get_best</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gdkvisual.html#function-gdk--visual-get-best-depth" title="gtk.gdk.visual_get_best_depth">gtk.gdk.visual_get_best_depth</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gdkvisual.html#function-gdk--visual-get-best-type" title="gtk.gdk.visual_get_best_type">gtk.gdk.visual_get_best_type</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gdkvisual.html#function-gdk--visual-get-best-with-depth" title="gtk.gdk.visual_get_best_with_depth">gtk.gdk.visual_get_best_with_depth</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>depth</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gdkvisual.html#function-gdk--visual-get-best-with-type" title="gtk.gdk.visual_get_best_with_type">gtk.gdk.visual_get_best_with_type</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>type</code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gdkvisual.html#function-gdk--visual-get-system" title="gtk.gdk.visual_get_system">gtk.gdk.visual_get_system</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code></code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gdkvisual.html#function-gdk--query-depths" title="gtk.gdk.query_depths">gtk.gdk.query_depths</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code></code></strong></span></span>)</code><br><code class="methodsynopsis">    def <span class="methodname"><a class="link" href="class-gdkvisual.html#function-gdk--query-visual-types" title="gtk.gdk.query_visual_types">gtk.gdk.query_visual_types</a></span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code></code></strong></span></span>)</code></pre></div><div class="refsect1" title="Ancestry"><a name="id3495528"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
  +-- <a class="link" href="class-gdkvisual.html" title="gtk.gdk.Visual">gtk.gdk.Visual</a>
</pre></div><div class="refsect1" title="Attributes"><a name="id3495554"></a><h2>Attributes</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table cellpadding="5" width="100%" border="0"><colgroup><col width="1in"><col width="1in"><col width="4in"></colgroup><tbody><tr valign="top"><td valign="top">"bits_per_rgb"</td><td valign="top">Read</td><td valign="top">The number of significant bits per red, green, or blue
when specifying colors for this visual. (For instance, for the <a class="link" href="class-gdkcolormap.html#method-gdkcolormap--alloc-color" title="gtk.gdk.Colormap.alloc_color"><code class="methodname">gtk.gdk.Colormap.alloc_color</code>()</a> 
method)</td></tr><tr valign="top"><td valign="top">"blue_mask"</td><td valign="top">Read</td><td valign="top">A mask giving the bits in a pixel value that correspond
to the blue field.</td></tr><tr valign="top"><td valign="top">"blue_prec"</td><td valign="top">Read</td><td valign="top">See above.</td></tr><tr valign="top"><td valign="top">"blue_shift"</td><td valign="top">Read</td><td valign="top">The <em class="parameter"><code>blue_shift</code></em> and
<em class="parameter"><code>blue_prec</code></em> give an alternate presentation of the
information in <em class="parameter"><code>blue_mask</code></em>. </td></tr><tr valign="top"><td valign="top">"byte_order"</td><td valign="top">Read</td><td valign="top">The byte-order for this visual - either:
<code class="literal">gtk.gdk.LSB_FIRST</code> or
<code class="literal">gtk.gdk.MSB_FIRST</code>.</td></tr><tr valign="top"><td valign="top">"colormap_size"</td><td valign="top">Read</td><td valign="top">The number of entries in the colormap, for visuals of
type <code class="literal">gtk.gdk.VISUAL_PSEUDO_COLOR</code> or
<code class="literal">gtk.gdk.VISUAL_GRAY_SCALE</code>. 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.</td></tr><tr valign="top"><td valign="top">"depth"</td><td valign="top">Read</td><td valign="top">The number of bits per pixel.</td></tr><tr valign="top"><td valign="top">"green_mask"</td><td valign="top">Read</td><td valign="top">A mask giving the bits in a pixel value that correspond
to the green field.</td></tr><tr valign="top"><td valign="top">"green_prec"</td><td valign="top">Read</td><td valign="top">See above.</td></tr><tr valign="top"><td valign="top">"green_shift"</td><td valign="top">Read</td><td valign="top">The <em class="parameter"><code>green_shift</code></em> and
<em class="parameter"><code>green_prec</code></em> give an alternate presentation of the
information in <em class="parameter"><code>green_mask</code></em>.</td></tr><tr valign="top"><td valign="top">"red_mask"</td><td valign="top">Read</td><td valign="top">A mask giving the bits in a pixel value that correspond
to the red field. Significant only for
<code class="literal">gtk.gdk.VISUAL_PSEUDOCOLOR</code> and
<code class="literal">gtk.gdk.VISUAL_DIRECTCOLOR</code>.</td></tr><tr valign="top"><td valign="top">"red_prec"</td><td valign="top">Read</td><td valign="top">See above.</td></tr><tr valign="top"><td valign="top">"red_shift"</td><td valign="top">Read</td><td valign="top">The <em class="parameter"><code>red_shift</code></em> and
<em class="parameter"><code>red_prec</code></em> give an alternate presentation of the
information in <em class="parameter"><code>red_mask</code></em>.
<em class="parameter"><code>red_mask</code></em> is a contiguous sequence of
<em class="parameter"><code>red_prec</code></em> bits starting at bit number
<em class="parameter"><code>red_shift</code></em>.</td></tr><tr valign="top"><td valign="top">"type"</td><td valign="top">Read</td><td valign="top">The type of this visual - one of:
<code class="literal">gtk.gdk.VISUAL_STATIC_GRAY</code>,
<code class="literal">gtk.gdk.VISUAL_GRAYSCALE</code>,
<code class="literal">gtk.gdk.VISUAL_STATIC_COLOR</code>,
<code class="literal">gtk.gdk.VISUAL_PSEUDO_COLOR</code>,
<code class="literal">gtk.gdk.VISUAL_TRUE_COLOR</code>,
<code class="literal">gtk.gdk.VISUAL_DIRECT_COLOR</code></td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" title="Description"><a name="id3496010"></a><h2>Description</h2><p>A <a class="link" href="class-gdkvisual.html" title="gtk.gdk.Visual"><code class="classname">gtk.gdk.Visual</code></a>
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.</p><p>Usually you can avoid thinking about visuals in
<code class="literal">PyGTK</code>. Visuals are useful to interpret the contents of a
<a class="link" href="class-gdkimage.html" title="gtk.gdk.Image"><code class="classname">gtk.gdk.Image</code></a>,
but you should avoid <a class="link" href="class-gdkimage.html" title="gtk.gdk.Image"><code class="classname">gtk.gdk.Image</code></a>
precisely because its contents depend on the display hardware; use <a class="link" href="class-gdkpixbuf.html" title="gtk.gdk.Pixbuf"><code class="classname">gtk.gdk.Pixbuf</code></a>
instead, for all but the most low-level purposes. Also, anytime you provide
a <a class="link" href="class-gdkcolormap.html" title="gtk.gdk.Colormap"><code class="classname">gtk.gdk.Colormap</code></a>,
the visual is implied as part of the colormap (see the <a class="link" href="class-gdkcolormap.html#method-gdkcolormap--get-visual" title="gtk.gdk.Colormap.get_visual"><code class="methodname">gtk.gdk.Colormap.get_visual</code>()</a> 
method), so you won't have to provide a visual in addition.</p><p>There are several standard visuals. The visual returned by the
<a class="link" href="class-gdkvisual.html#function-gdk--visual-get-system" title="gtk.gdk.visual_get_system"><code class="methodname">gtk.gdk.visual_get_system</code>()</a> 
function is the system's default visual. The <a class="link" href="gdk-functions.html#function-gdk--rgb-get-visual" title="gtk.gdk.rgb_get_visual"><code class="methodname">gtk.gdk.rgb_get_visual</code>()</a> 
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 <a class="link" href="gdk-functions.html#function-gdk--rgb-get-colormap" title="gtk.gdk.rgb_get_colormap"><code class="methodname">gtk.gdk.rgb_get_colormap</code>()</a> 
function).</p><p>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,
<code class="literal">gtk.gdk.VISUAL_PSEUDO_COLOR</code> is preferred at 8bpp,
otherwise, the visual types are ranked in the order of (highest to lowest)
<code class="literal">gtk.gdk.VISUAL_DIRECT_COLOR</code>,
<code class="literal">gtk.gdk.VISUAL_TRUE_COLOR</code>,
<code class="literal">gtk.gdk.VISUAL_PSEUDO_COLOR</code>,
<code class="literal">gtk.gdk.VISUAL_STATIC_COLOR</code>,
<code class="literal">gtk.gdk.VISUAL_GRAYSCALE</code>, then
<code class="literal">gtk.gdk.VISUAL_STATIC_GRAY</code>.</p></div><div class="refsect1" title="Constructor"><a name="constructor-gdkvisual"></a><h2>Constructor</h2><pre class="programlisting"><code class="constructorsynopsis">    <span class="methodname">gtk.gdk.Visual</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>depth</code></strong></span></span>, <span class="methodparam"><span class="parameter"><strong class="parameter"><code>visual_type</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>depth</code></strong> :</span></p></td><td>a bit depth</td></tr><tr><td><p><span class="term"><strong class="parameter"><code>visual_type</code></strong> :</span></p></td><td>a visual type</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the best <a class="link" href="class-gdkvisual.html" title="gtk.gdk.Visual"><code class="classname">gtk.gdk.Visual</code></a> with
both <em class="parameter"><code>depth</code></em> and <em class="parameter"><code>visual_type</code></em>, or
<code class="literal">None</code> if none</td></tr></tbody></table><p>Creates a new <a class="link" href="class-gdkvisual.html" title="gtk.gdk.Visual"><code class="classname">gtk.gdk.Visual</code></a> that
is the best choice for the specified <em class="parameter"><code>depth</code></em> and
<em class="parameter"><code>visual_type</code></em>. 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
<em class="parameter"><code>visual_type</code></em> must be one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><code class="literal">gtk.gdk.VISUAL_STATIC_GRAY</code></span></p></td><td>Each pixel value indexes a grayscale value
directly.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.VISUAL_GRAYSCALE</code></span></p></td><td>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.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.VISUAL_STATIC_COLOR</code></span></p></td><td>Each pixel value is an index into a predefined,
unmodifiable color map that maps pixel values into RGB values.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.VISUAL_PSEUDO_COLOR</code></span></p></td><td>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.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.VISUAL_TRUE_COLOR</code></span></p></td><td>Each pixel value directly contains red, green, and blue
components. The red_mask, green_mask, and blue_mask fields of the <a class="link" href="class-gdkvisual.html" title="gtk.gdk.Visual"><code class="classname">gtk.gdk.Visual</code></a>
structure describe how the components are assembled into a pixel
value.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.VISUAL_DIRECT_COLOR</code></span></p></td><td>Each pixel value contains red, green, and blue components
as for <code class="literal">gtk.gdk.TRUE_COLOR</code>, but the components are mapped
via a color table into the final output table instead of being converted
directly. </td></tr></tbody></table><p></p></div><div class="refsect1" title="Methods"><a name="id3159379"></a><h2>Methods</h2><div class="refsect2" title="gtk.gdk.Visual.get_screen"><a name="method-gdkvisual--get-screen"></a><h3>gtk.gdk.Visual.get_screen</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">get_screen</span>()</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the screen that this visual belongs
to.</td></tr></tbody></table><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This method is available in PyGTK 2.2 and above.</p></div><p>The <code class="methodname">get_screen</code>() method returns the
<a class="link" href="class-gdkscreen.html" title="gtk.gdk.Screen"><code class="classname">gtk.gdk.Screen</code></a>
that this visual belongs to.</p></div></div><div class="refsect1" title="Functions"><a name="id3159449"></a><h2>Functions</h2><div class="refsect2" title="gtk.gdk.list_visuals"><a name="function-gdk--list-visuals"></a><h3>gtk.gdk.list_visuals</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gtk.gdk.list_visuals</span>()</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>a list of <a class="link" href="class-gdkvisual.html" title="gtk.gdk.Visual"><code class="classname">gtk.gdk.Visual</code></a>
objects</td></tr></tbody></table><p>The <code class="function">gtk.gdk.list_visuals</code>() function returns
a list containing the available <a class="link" href="class-gdkvisual.html" title="gtk.gdk.Visual"><code class="classname">gtk.gdk.Visual</code></a>
objects for the default screen.</p></div><div class="refsect2" title="gtk.gdk.visual_get_best"><a name="function-gdk--visual-get-best"></a><h3>gtk.gdk.visual_get_best</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gtk.gdk.visual_get_best</span>()</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the best <a class="link" href="class-gdkvisual.html" title="gtk.gdk.Visual"><code class="classname">gtk.gdk.Visual</code></a> for
the default screen</td></tr></tbody></table><p>The <code class="function">gtk.gdk.visual_get_best</code>() function
returns the visual with the most available colors for the default
screen.</p></div><div class="refsect2" title="gtk.gdk.visual_get_best_depth"><a name="function-gdk--visual-get-best-depth"></a><h3>gtk.gdk.visual_get_best_depth</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gtk.gdk.visual_get_best_depth</span>()</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the best available depth.</td></tr></tbody></table><p>The <code class="function">gtk.gdk.visual_get_best_depth</code>()
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.</p></div><div class="refsect2" title="gtk.gdk.visual_get_best_type"><a name="function-gdk--visual-get-best-type"></a><h3>gtk.gdk.visual_get_best_type</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gtk.gdk.visual_get_best_type</span>()</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the <a class="link" href="class-gdkvisual.html" title="gtk.gdk.Visual"><code class="classname">gtk.gdk.Visual</code></a> with
the best type for the default screen</td></tr></tbody></table><p>The <code class="function">gtk.gdk.visual_get_best_type</code>() function
returns the best available <a class="link" href="class-gdkvisual.html" title="gtk.gdk.Visual"><code class="classname">gtk.gdk.Visual</code></a> type
for the default screen.</p></div><div class="refsect2" title="gtk.gdk.visual_get_best_with_depth"><a name="function-gdk--visual-get-best-with-depth"></a><h3>gtk.gdk.visual_get_best_with_depth</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gtk.gdk.visual_get_best_with_depth</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>depth</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>depth</code></strong> :</span></p></td><td>the number of bits per
pixel</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the best <a class="link" href="class-gdkvisual.html" title="gtk.gdk.Visual"><code class="classname">gtk.gdk.Visual</code></a> for
the specified <em class="parameter"><code>depth</code></em></td></tr></tbody></table><p>The <code class="function">gtk.gdk.visual_get_best_with_depth</code>()
function returns the best <a class="link" href="class-gdkvisual.html" title="gtk.gdk.Visual"><code class="classname">gtk.gdk.Visual</code></a> with
the specified <em class="parameter"><code>depth</code></em>.</p></div><div class="refsect2" title="gtk.gdk.visual_get_best_with_type"><a name="function-gdk--visual-get-best-with-type"></a><h3>gtk.gdk.visual_get_best_with_type</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gtk.gdk.visual_get_best_with_type</span>(<span class="methodparam"><span class="parameter"><strong class="parameter"><code>type</code></strong></span></span>)</code></pre><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><strong class="parameter"><code>type</code></strong> :</span></p></td><td>a visual type</td></tr><tr><td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td><td>the best gdkVisual for the visual type
specified by <em class="parameter"><code>type</code></em></td></tr></tbody></table><p>The <code class="function">gtk.gdk.visual_get_best_with_type</code>()
function returns the best <a class="link" href="class-gdkvisual.html" title="gtk.gdk.Visual"><code class="classname">gtk.gdk.Visual</code></a> for
the visual type specified by <em class="parameter"><code>type</code></em>. The value of
<em class="parameter"><code>visual_type</code></em> must be one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><code class="literal">gtk.gdk.VISUAL_STATIC_GRAY</code></span></p></td><td>Each pixel value indexes a grayscale value
directly.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.VISUAL_GRAYSCALE</code></span></p></td><td>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.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.VISUAL_STATIC_COLOR</code></span></p></td><td>Each pixel value is an index into a predefined,
unmodifiable color map that maps pixel values into RGB values.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.VISUAL_PSEUDO_COLOR</code></span></p></td><td>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.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.VISUAL_TRUE_COLOR</code></span></p></td><td>Each pixel value directly contains red, green, and blue
components. The red_mask, green_mask, and blue_mask fields of the <a class="link" href="class-gdkvisual.html" title="gtk.gdk.Visual"><code class="classname">gtk.gdk.Visual</code></a>
structure describe how the components are assembled into a pixel
value.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.VISUAL_DIRECT_COLOR</code></span></p></td><td>Each pixel value contains red, green, and blue
components as for <code class="literal">gtk.gdk.TRUE_COLOR</code>, but the components
are mapped via a color table into the final output table instead of being
converted directly. </td></tr></tbody></table><p></p></div><div class="refsect2" title="gtk.gdk.visual_get_system"><a name="function-gdk--visual-get-system"></a><h3>gtk.gdk.visual_get_system</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gtk.gdk.visual_get_system</span>()</code></pre><p>The <code class="function">gtk.gdk.visual_get_system</code>() function
returns the default <a class="link" href="class-gdkvisual.html" title="gtk.gdk.Visual"><code class="classname">gtk.gdk.Visual</code></a> for
the system's default screen.</p></div><div class="refsect2" title="gtk.gdk.query_depths"><a name="function-gdk--query-depths"></a><h3>gtk.gdk.query_depths</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gtk.gdk.query_depths</span>()</code></pre><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This function is available in PyGTK 2.4 and above.</p></div><p>The <code class="function">gtk.gdk.query_depths</code>() function returns
a tuple containing the unique supported visual depths for the default
screen. It's equivalent to listing the visuals (see the <a class="link" href="class-gdkvisual.html#function-gdk--list-visuals" title="gtk.gdk.list_visuals"><code class="function">gtk.gdk.list_visuals</code>()</a>
function) and then looking at the depth field in each visual, removing
duplicates.</p></div><div class="refsect2" title="gtk.gdk.query_visual_types"><a name="function-gdk--query-visual-types"></a><h3>gtk.gdk.query_visual_types</h3><pre class="programlisting"><code class="methodsynopsis">    def <span class="methodname">gtk.gdk.query_visual_types</span>()</code></pre><p>The <code class="function">gtk.gdk.query_visual_types</code>() function
returns a tuple containing the unique visual types supported by the default
screen.It's equivalent to listing the visuals (see the <a class="link" href="class-gdkvisual.html#function-gdk--list-visuals" title="gtk.gdk.list_visuals"><code class="function">gtk.gdk.list_visuals</code>()</a>
function) and then looking at the type field in each visual, removing
duplicates.</p><p>The returned value will be one of:</p><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><p><span class="term"><code class="literal">gtk.gdk.VISUAL_STATIC_GRAY</code></span></p></td><td>Each pixel value indexes a grayscale value
	    directly.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.VISUAL_GRAYSCALE</code></span></p></td><td>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.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.VISUAL_STATIC_COLOR</code></span></p></td><td>Each pixel value is an index into a predefined,
	    unmodifiable color map that maps pixel values into RGB
	    values.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.VISUAL_PSEUDO_COLOR</code></span></p></td><td>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.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.VISUAL_TRUE_COLOR</code></span></p></td><td>Each pixel value directly contains red, green, and blue
	    components. The red_mask, green_mask, and blue_mask fields of
	    the <a class="link" href="class-gdkvisual.html" title="gtk.gdk.Visual"><code class="classname">gtk.gdk.Visual</code></a>
	    structure describe how the components are assembled into a pixel
	    value.</td></tr><tr><td><p><span class="term"><code class="literal">gtk.gdk.VISUAL_DIRECT_COLOR</code></span></p></td><td>Each pixel value contains red, green, and blue
	    components as for <code class="literal">gtk.gdk.VISUAL_TRUE_COLOR</code>,
	    but the components are mapped via a color table into the final
	    output table instead of being converted directly.</td></tr></tbody></table><p></p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-gdkscreen.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="gdk-class-reference.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="class-gdkwindow.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.gdk.Screen </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> gtk.gdk.Window</td></tr></table></div></body></html>