1
1
<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.73.2"><link rel="start" 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" lang="en"><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
2
information</p></div><div class="refsect1" lang="en"><a name="id3021834"></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>):
2
information</p></div><div class="refsect1" lang="en"><a name="id3222088"></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>):
3
3
<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">
4
4
<span class="bold"><strong>Functions</strong></span>
6
<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" lang="en"><a name="id3022129"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
6
<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" lang="en"><a name="id3222384"></a><h2>Ancestry</h2><pre class="synopsis">+-- <PYGTKDOCLINK HREF="class-gobject">gobject.GObject</PYGTKDOCLINK>
7
7
+-- <a class="link" href="class-gdkvisual.html" title="gtk.gdk.Visual">gtk.gdk.Visual</a>
8
</pre></div><div class="refsect1" lang="en"><a name="id3022155"></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><col><col></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
8
</pre></div><div class="refsect1" lang="en"><a name="id3222410"></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><col><col></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
9
9
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>
10
10
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
11
11
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
34
34
<code class="literal">gtk.gdk.VISUAL_STATIC_COLOR</code>,
35
35
<code class="literal">gtk.gdk.VISUAL_PSEUDO_COLOR</code>,
36
36
<code class="literal">gtk.gdk.VISUAL_TRUE_COLOR</code>,
37
<code class="literal">gtk.gdk.VISUAL_DIRECT_COLOR</code></td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3022611"></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>
37
<code class="literal">gtk.gdk.VISUAL_DIRECT_COLOR</code></td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3222865"></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>
38
38
describes a particular video hardware display format. It includes
39
39
information about the number of bits used for each color, the way the bits
40
40
are translated into an RGB value for display, and the way the bits are
85
85
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
86
86
as for <code class="literal">gtk.gdk.TRUE_COLOR</code>, but the components are mapped
87
87
via a color table into the final output table instead of being converted
88
directly. </td></tr></tbody></table><p></p></div><div class="refsect1" lang="en"><a name="id3129548"></a><h2>Methods</h2><div class="refsect2" lang="en"><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
88
directly. </td></tr></tbody></table><p></p></div><div class="refsect1" lang="en"><a name="id3223330"></a><h2>Methods</h2><div class="refsect2" lang="en"><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
89
89
to.</td></tr></tbody></table><div class="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
90
90
<a class="link" href="class-gdkscreen.html" title="gtk.gdk.Screen"><code class="classname">gtk.gdk.Screen</code></a>
91
that this visual belongs to.</p></div></div><div class="refsect1" lang="en"><a name="id3129618"></a><h2>Functions</h2><div class="refsect2" lang="en"><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>
91
that this visual belongs to.</p></div></div><div class="refsect1" lang="en"><a name="id3223400"></a><h2>Functions</h2><div class="refsect2" lang="en"><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>
92
92
objects</td></tr></tbody></table><p>The <code class="function">gtk.gdk.list_visuals</code>() function returns
93
93
a list containing the available <a class="link" href="class-gdkvisual.html" title="gtk.gdk.Visual"><code class="classname">gtk.gdk.Visual</code></a>
94
94
objects for the default screen.</p></div><div class="refsect2" lang="en"><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