|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /usr/share/gtk-doc/html/gdk/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Visuals</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" href="index.html" title="GDK Reference Manual">
<link rel="up" href="reference.html" title="API Reference">
<link rel="prev" href="gdk-Colormaps-and-Colors.html" title="Colormaps and Colors">
<link rel="next" href="gdk-Fonts.html" title="Fonts">
<meta name="generator" content="GTK-Doc V1.6 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="reference" href="reference.html" title="API Reference">
<link rel="index" href="ix01.html" title="Index">
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gdk-Colormaps-and-Colors.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="reference.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GDK Reference Manual</th>
<td><a accesskey="n" href="gdk-Fonts.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2995585" class="shortcut">Top</a>
 | 
<a href="#id2995878" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="gdk-Visuals"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id2995585"></a><span class="refentrytitle">Visuals</span>
</h2>
<p>Visuals —
Low-level display hardware information</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">
#include <gdk/gdk.h>
<a href="gdk-Visuals.html#GdkVisual">GdkVisual</a>;
enum <a href="gdk-Visuals.html#GdkVisualType">GdkVisualType</a>;
enum <a href="gdk-Visuals.html#GdkByteOrder">GdkByteOrder</a>;
void <a href="gdk-Visuals.html#gdk-query-depths">gdk_query_depths</a> (<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> **depths,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> *count);
void <a href="gdk-Visuals.html#gdk-query-visual-types">gdk_query_visual_types</a> (<a href="gdk-Visuals.html#GdkVisualType">GdkVisualType</a> **visual_types,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> *count);
<a
href="../glib/glib-Doubly-Linked-Lists.html#GList"
>GList</a>* <a href="gdk-Visuals.html#gdk-list-visuals">gdk_list_visuals</a> (void);
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> <a href="gdk-Visuals.html#gdk-visual-get-best-depth">gdk_visual_get_best_depth</a> (void);
<a href="gdk-Visuals.html#GdkVisualType">GdkVisualType</a> <a href="gdk-Visuals.html#gdk-visual-get-best-type">gdk_visual_get_best_type</a> (void);
<a href="gdk-Visuals.html#GdkVisual">GdkVisual</a>* <a href="gdk-Visuals.html#gdk-visual-get-system">gdk_visual_get_system</a> (void);
<a href="gdk-Visuals.html#GdkVisual">GdkVisual</a>* <a href="gdk-Visuals.html#gdk-visual-get-best">gdk_visual_get_best</a> (void);
<a href="gdk-Visuals.html#GdkVisual">GdkVisual</a>* <a href="gdk-Visuals.html#gdk-visual-get-best-with-depth">gdk_visual_get_best_with_depth</a> (<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> depth);
<a href="gdk-Visuals.html#GdkVisual">GdkVisual</a>* <a href="gdk-Visuals.html#gdk-visual-get-best-with-type">gdk_visual_get_best_with_type</a> (<a href="gdk-Visuals.html#GdkVisualType">GdkVisualType</a> visual_type);
<a href="gdk-Visuals.html#GdkVisual">GdkVisual</a>* <a href="gdk-Visuals.html#gdk-visual-get-best-with-both">gdk_visual_get_best_with_both</a> (<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> depth,
<a href="gdk-Visuals.html#GdkVisualType">GdkVisualType</a> visual_type);
#define <a href="gdk-Visuals.html#gdk-visual-ref">gdk_visual_ref</a> (v)
#define <a href="gdk-Visuals.html#gdk-visual-unref">gdk_visual_unref</a> (v)
<a href="GdkScreen.html" title="GdkScreen">GdkScreen</a>* <a href="gdk-Visuals.html#gdk-visual-get-screen">gdk_visual_get_screen</a> (<a href="gdk-Visuals.html#GdkVisual">GdkVisual</a> *visual);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2995878"></a><h2>Description</h2>
<p>
A <a href="gdk-Visuals.html#GdkVisual"><span class="type">GdkVisual</span></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 GTK+. Visuals are useful to
interpret the contents of a <a href="gdk-Images.html#GdkImage"><span class="type">GdkImage</span></a>, but you should avoid <a href="gdk-Images.html#GdkImage"><span class="type">GdkImage</span></a> precisely
because its contents depend on the display hardware; use <a
href="../gdk-pixbuf/gdk-pixbuf-gdk-pixbuf.html#GdkPixbuf"
><span class="type">GdkPixbuf</span></a> instead, for
all but the most low-level purposes. Also, anytime you provide a <a href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a>,
the visual is implied as part of the colormap (<a href="gdk-Colormaps-and-Colors.html#gdk-colormap-get-visual"><code class="function">gdk_colormap_get_visual()</code></a>), so
you won't have to provide a visual in addition.
</p>
<p>
There are several standard visuals. The visual returned
by <a href="gdk-Visuals.html#gdk-visual-get-system"><code class="function">gdk_visual_get_system()</code></a> is the system's default
visual. <a href="gdk-GdkRGB.html#gdk-rgb-get-visual"><code class="function">gdk_rgb_get_visual()</code></a> return the visual most
suited to displaying full-color image data. If you
use the calls in <span class="type">GdkRGB</span>, you should create your windows
using this visual (and the colormap returned by
<a href="gdk-GdkRGB.html#gdk-rgb-get-colormap"><code class="function">gdk_rgb_get_colormap()</code></a>).
</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, <a href="gdk-Visuals.html#GDK-VISUAL-PSEUDO-COLOR:CAPS"><code class="literal">GDK_VISUAL_PSEUDO_COLOR</code></a> is preferred at
8bpp, otherwise, the visual types are ranked in the
order of (highest to lowest) <a href="gdk-Visuals.html#GDK-VISUAL-DIRECT-COLOR:CAPS"><code class="literal">GDK_VISUAL_DIRECT_COLOR</code></a>,
<a href="gdk-Visuals.html#GDK-VISUAL-TRUE-COLOR:CAPS"><code class="literal">GDK_VISUAL_TRUE_COLOR</code></a>, <a href="gdk-Visuals.html#GDK-VISUAL-PSEUDO-COLOR:CAPS"><code class="literal">GDK_VISUAL_PSEUDO_COLOR</code></a>,
<a href="gdk-Visuals.html#GDK-VISUAL-STATIC-COLOR:CAPS"><code class="literal">GDK_VISUAL_STATIC_COLOR</code></a>, <a href="gdk-Visuals.html#GDK-VISUAL-GRAYSCALE:CAPS"><code class="literal">GDK_VISUAL_GRAYSCALE</code></a>,
then <a href="gdk-Visuals.html#GDK-VISUAL-STATIC-GRAY:CAPS"><code class="literal">GDK_VISUAL_STATIC_GRAY</code></a>.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2996104"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2996114"></a><h3>
<a name="GdkVisual"></a>GdkVisual</h3>
<a class="indexterm" name="id2996127"></a><pre class="programlisting">typedef struct {
GObject parent_instance;
GdkVisualType type;
gint depth;
GdkByteOrder byte_order;
gint colormap_size;
gint bits_per_rgb;
guint32 red_mask;
gint red_shift;
gint red_prec;
guint32 green_mask;
gint green_shift;
gint green_prec;
guint32 blue_mask;
gint blue_shift;
gint blue_prec;
} GdkVisual;
</pre>
<p>
The <span class="type">GdkVisual</span> structure contains information about
a particular visual.
</p>
<div class="example">
<a name="rgbmask"></a><p class="title"><b>Example 5. Constructing a pixel value from components</b></p>
<pre class="programlisting">
guint
pixel_from_rgb (GdkVisual *visual,
guchar r, guchar b, guchar g)
{
return ((r >> (16 - visual->red_prec)) << visual->red_shift) |
((g >> (16 - visual->green_prec)) << visual->green_shift) |
((r >> (16 - visual->blue_prec)) << visual->blue_shift);
}
</pre>
</div>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><a
href="../gobject/gobject-The-Base-Object-Type.html#GObject"
>GObject</a> <em class="structfield"><code>parent_instance</code></em>;</span></td>
<td>inherited portion from <a
href="../gobject/gobject-The-Base-Object-Type.html#GObject"
><span class="type">GObject</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><a href="gdk-Visuals.html#GdkVisualType">GdkVisualType</a> <em class="structfield"><code>type</code></em>;</span></td>
<td>The type of this visual.
</td>
</tr>
<tr>
<td>
<span class="term"><a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> <em class="structfield"><code>depth</code></em>;</span></td>
<td>The number of bits per pixel.
</td>
</tr>
<tr>
<td>
<span class="term"><a href="gdk-Visuals.html#GdkByteOrder">GdkByteOrder</a> <em class="structfield"><code>byte_order</code></em>;</span></td>
<td>The byte-order for this visual.
</td>
</tr>
<tr>
<td>
<span class="term"><a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> <em class="structfield"><code>colormap_size</code></em>;</span></td>
<td>The number of entries in the colormap, for
visuals of type <a href="gdk-Visuals.html#GDK-VISUAL-PSEUDO-COLOR:CAPS"><code class="literal">GDK_VISUAL_PSEUDO_COLOR</code></a> or
<code class="literal">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>
<td>
<span class="term"><a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> <em class="structfield"><code>bits_per_rgb</code></em>;</span></td>
<td>The number of significant bits per red, green, or blue
when specifying colors for this visual. (For instance, for
<a href="gdk-Colormaps-and-Colors.html#gdk-colormap-alloc-color"><code class="function">gdk_colormap_alloc_color()</code></a>)
</td>
</tr>
<tr>
<td>
<span class="term"><a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> <em class="structfield"><code>red_mask</code></em>;</span></td>
<td>A mask giving the bits in a pixel value that
correspond to the red field. Significant only for
<code class="literal">GDK_VISUAL_PSEUDOCOLOR</code> and <code class="literal">GDK_VISUAL_DIRECTCOLOR</code>.
</td>
</tr>
<tr>
<td>
<span class="term"><a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> <em class="structfield"><code>red_shift</code></em>;</span></td>
<td>The <em class="structfield"><code>red_shift</code></em> and
<em class="structfield"><code>red_prec</code></em> give an alternate presentation
of the information in <em class="structfield"><code>red_mask</code></em>.
<em class="structfield"><code>red_mask</code></em> is a contiguous sequence
of <em class="structfield"><code>red_prec</code></em> bits starting at bit
number <em class="structfield"><code>red_shift</code></em>. For example,
<a href="gdk-Visuals.html#rgbmask" title="Example 5. Constructing a pixel value from components">Example 5, “Constructing a pixel value from components”</a> shows constructing a pixel value
out of three 16 bit color values.
</td>
</tr>
<tr>
<td>
<span class="term"><a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> <em class="structfield"><code>red_prec</code></em>;</span></td>
<td>See above.
</td>
</tr>
<tr>
<td>
<span class="term"><a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> <em class="structfield"><code>green_mask</code></em>;</span></td>
<td>A mask giving the bits in a pixel value that
correspond to the green field.
</td>
</tr>
<tr>
<td>
<span class="term"><a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> <em class="structfield"><code>green_shift</code></em>;</span></td>
<td>The <em class="structfield"><code>green_shift</code></em> and
<em class="structfield"><code>green_prec</code></em> give an alternate presentation
of the information in <em class="structfield"><code>green_mask</code></em>.
</td>
</tr>
<tr>
<td>
<span class="term"><a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> <em class="structfield"><code>green_prec</code></em>;</span></td>
<td>See above.
</td>
</tr>
<tr>
<td>
<span class="term"><a
href="../glib/glib-Basic-Types.html#guint32"
>guint32</a> <em class="structfield"><code>blue_mask</code></em>;</span></td>
<td>A mask giving the bits in a pixel value that
correspond to the blue field.
</td>
</tr>
<tr>
<td>
<span class="term"><a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> <em class="structfield"><code>blue_shift</code></em>;</span></td>
<td>The <em class="structfield"><code>blue_shift</code></em> and
<em class="structfield"><code>blue_prec</code></em> give an alternate presentation
of the information in <em class="structfield"><code>blue_mask</code></em>.
</td>
</tr>
<tr>
<td>
<span class="term"><a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> <em class="structfield"><code>blue_prec</code></em>;</span></td>
<td>See above.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2996619"></a><h3>
<a name="GdkVisualType"></a>enum GdkVisualType</h3>
<a class="indexterm" name="id2996632"></a><pre class="programlisting">typedef enum
{
GDK_VISUAL_STATIC_GRAY,
GDK_VISUAL_GRAYSCALE,
GDK_VISUAL_STATIC_COLOR,
GDK_VISUAL_PSEUDO_COLOR,
GDK_VISUAL_TRUE_COLOR,
GDK_VISUAL_DIRECT_COLOR
} GdkVisualType;
</pre>
<p>
A set of values that describe the manner in which the
pixel values for a visual are converted into RGB
values for display.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><a name="GDK-VISUAL-STATIC-GRAY:CAPS"></a><code class="literal">GDK_VISUAL_STATIC_GRAY</code></span></td>
<td>Each pixel value indexes a grayscale value directly.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-VISUAL-GRAYSCALE:CAPS"></a><code class="literal">GDK_VISUAL_GRAYSCALE</code></span></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>
<span class="term"><a name="GDK-VISUAL-STATIC-COLOR:CAPS"></a><code class="literal">GDK_VISUAL_STATIC_COLOR</code></span></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>
<span class="term"><a name="GDK-VISUAL-PSEUDO-COLOR:CAPS"></a><code class="literal">GDK_VISUAL_PSEUDO_COLOR</code></span></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>
<span class="term"><a name="GDK-VISUAL-TRUE-COLOR:CAPS"></a><code class="literal">GDK_VISUAL_TRUE_COLOR</code></span></td>
<td>Each pixel value directly contains red, green,
and blue components. The <em class="structfield"><code>red_mask</code></em>,
<em class="structfield"><code>green_mask</code></em>, and
<em class="structfield"><code>blue_mask</code></em> fields of the <a href="gdk-Visuals.html#GdkVisual"><span class="type">GdkVisual</span></a>
structure describe how the components are assembled into a pixel value.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-VISUAL-DIRECT-COLOR:CAPS"></a><code class="literal">GDK_VISUAL_DIRECT_COLOR</code></span></td>
<td>Each pixel value contains red, green, and blue
components as for <a href="gdk-Visuals.html#GDK-VISUAL-TRUE-COLOR:CAPS"><code class="literal">GDK_VISUAL_TRUE_COLOR</code></a>, but the components are mapped via a
color table into the final output table instead of being converted directly.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2996833"></a><h3>
<a name="GdkByteOrder"></a>enum GdkByteOrder</h3>
<a class="indexterm" name="id2996845"></a><pre class="programlisting">typedef enum
{
GDK_LSB_FIRST,
GDK_MSB_FIRST
} GdkByteOrder;
</pre>
<p>
A set of values describing the possible byte-orders
for storing pixel values in memory.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><a name="GDK-LSB-FIRST:CAPS"></a><code class="literal">GDK_LSB_FIRST</code></span></td>
<td>The values are stored with the least-significant byte
first. For instance, the 32-bit value 0xffeecc would be stored
in memory as 0xcc, 0xee, 0xff, 0x00.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-MSB-FIRST:CAPS"></a><code class="literal">GDK_MSB_FIRST</code></span></td>
<td>The values are stored with the most-significant byte
first. For instance, the 32-bit value 0xffeecc would be stored
in memory as 0x00, 0xcc, 0xee, 0xff.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2996916"></a><h3>
<a name="gdk-query-depths"></a>gdk_query_depths ()</h3>
<a class="indexterm" name="id2996929"></a><pre class="programlisting">void gdk_query_depths (<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> **depths,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> *count);</pre>
<p>
This function returns the available bit depths for the default
screen. It's equivalent to listing the visuals
(<a href="gdk-Visuals.html#gdk-list-visuals"><code class="function">gdk_list_visuals()</code></a>) and then looking at the depth field in each
visual, removing duplicates.
</p>
<p>
The array returned by this function should not be freed.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>depths</code></em> :</span></td>
<td> return location for available depths
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>count</code></em> :</span></td>
<td> return location for number of available depths
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2997019"></a><h3>
<a name="gdk-query-visual-types"></a>gdk_query_visual_types ()</h3>
<a class="indexterm" name="id2997032"></a><pre class="programlisting">void gdk_query_visual_types (<a href="gdk-Visuals.html#GdkVisualType">GdkVisualType</a> **visual_types,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> *count);</pre>
<p>
This function returns the available visual types for the default
screen. It's equivalent to listing the visuals
(<a href="gdk-Visuals.html#gdk-list-visuals"><code class="function">gdk_list_visuals()</code></a>) and then looking at the type field in each
visual, removing duplicates.
</p>
<p>
The array returned by this function should not be freed.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>visual_types</code></em> :</span></td>
<td> return location for the available visual types
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>count</code></em> :</span></td>
<td> return location for the number of available visual types
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2997124"></a><h3>
<a name="gdk-list-visuals"></a>gdk_list_visuals ()</h3>
<a class="indexterm" name="id2997136"></a><pre class="programlisting"><a
href="../glib/glib-Doubly-Linked-Lists.html#GList"
>GList</a>* gdk_list_visuals (void);</pre>
<p>
Lists the available visuals for the default screen.
(See <a href="GdkScreen.html#gdk-screen-list-visuals"><code class="function">gdk_screen_list_visuals()</code></a>)
A visual describes a hardware image data format.
For example, a visual might support 24-bit color, or 8-bit color,
and might expect pixels to be in a certain format.
</p>
<p>
Call <a
href="../glib/glib-Doubly-Linked-Lists.html#g-list-free"
><code class="function">g_list_free()</code></a> on the return value when you're finished with it.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a list of visuals; the list must be freed, but not its contents
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2997206"></a><h3>
<a name="gdk-visual-get-best-depth"></a>gdk_visual_get_best_depth ()</h3>
<a class="indexterm" name="id2997219"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> gdk_visual_get_best_depth (void);</pre>
<p>
Get 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>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> best available depth
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2997261"></a><h3>
<a name="gdk-visual-get-best-type"></a>gdk_visual_get_best_type ()</h3>
<a class="indexterm" name="id2997274"></a><pre class="programlisting"><a href="gdk-Visuals.html#GdkVisualType">GdkVisualType</a> gdk_visual_get_best_type (void);</pre>
<p>
Return the best available visual type for the default GDK screen.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> best visual type
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2997315"></a><h3>
<a name="gdk-visual-get-system"></a>gdk_visual_get_system ()</h3>
<a class="indexterm" name="id2997328"></a><pre class="programlisting"><a href="gdk-Visuals.html#GdkVisual">GdkVisual</a>* gdk_visual_get_system (void);</pre>
<p>
Get the system'sdefault visual for the default GDK screen.
This is the visual for the root window of the display.
The return value should not be freed.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> system visual
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2997370"></a><h3>
<a name="gdk-visual-get-best"></a>gdk_visual_get_best ()</h3>
<a class="indexterm" name="id2997384"></a><pre class="programlisting"><a href="gdk-Visuals.html#GdkVisual">GdkVisual</a>* gdk_visual_get_best (void);</pre>
<p>
Get the visual with the most available colors for the default
GDK screen. The return value should not be freed.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> best visual
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2997425"></a><h3>
<a name="gdk-visual-get-best-with-depth"></a>gdk_visual_get_best_with_depth ()</h3>
<a class="indexterm" name="id2997438"></a><pre class="programlisting"><a href="gdk-Visuals.html#GdkVisual">GdkVisual</a>* gdk_visual_get_best_with_depth (<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> depth);</pre>
<p>
Get the best visual with depth <em class="parameter"><code>depth</code></em> for the default GDK screen.
Color visuals and visuals with mutable colormaps are preferred
over grayscale or fixed-colormap visuals. The return value should not
be freed. <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> may be returned if no visual supports <em class="parameter"><code>depth</code></em>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>depth</code></em> :</span></td>
<td> a bit depth
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> best visual for the given depth
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2997525"></a><h3>
<a name="gdk-visual-get-best-with-type"></a>gdk_visual_get_best_with_type ()</h3>
<a class="indexterm" name="id2997538"></a><pre class="programlisting"><a href="gdk-Visuals.html#GdkVisual">GdkVisual</a>* gdk_visual_get_best_with_type (<a href="gdk-Visuals.html#GdkVisualType">GdkVisualType</a> visual_type);</pre>
<p>
Get the best visual of the given <em class="parameter"><code>visual_type</code></em> for the default GDK screen.
Visuals with higher color depths are considered better. The return value
should not be freed. <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> may be returned if no visual has type
<em class="parameter"><code>visual_type</code></em>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>visual_type</code></em> :</span></td>
<td> a visual type
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> best visual of the given type
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2997624"></a><h3>
<a name="gdk-visual-get-best-with-both"></a>gdk_visual_get_best_with_both ()</h3>
<a class="indexterm" name="id2997638"></a><pre class="programlisting"><a href="gdk-Visuals.html#GdkVisual">GdkVisual</a>* gdk_visual_get_best_with_both (<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> depth,
<a href="gdk-Visuals.html#GdkVisualType">GdkVisualType</a> visual_type);</pre>
<p>
Combines <a href="gdk-Visuals.html#gdk-visual-get-best-with-depth"><code class="function">gdk_visual_get_best_with_depth()</code></a> and <a href="gdk-Visuals.html#gdk-visual-get-best-with-type"><code class="function">gdk_visual_get_best_with_type()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>depth</code></em> :</span></td>
<td> a bit depth
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>visual_type</code></em> :</span></td>
<td> a visual type
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> best visual with both <em class="parameter"><code>depth</code></em> and <em class="parameter"><code>visual_type</code></em>, or <a
href="../glib/glib-Standard-Macros.html#NULL:CAPS"
><code class="literal">NULL</code></a> if none
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2997766"></a><h3>
<a name="gdk-visual-ref"></a>gdk_visual_ref()</h3>
<a class="indexterm" name="id2997781"></a><pre class="programlisting">#define gdk_visual_ref(v) g_object_ref(v)
</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_visual_ref</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
Deprecated equivalent of <a
href="../gobject/gobject-The-Base-Object-Type.html#g-object-ref"
><code class="function">g_object_ref()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>v</code></em> :</span></td>
<td>a <a href="gdk-Visuals.html#GdkVisual"><span class="type">GdkVisual</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td>the same visual
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2997856"></a><h3>
<a name="gdk-visual-unref"></a>gdk_visual_unref()</h3>
<a class="indexterm" name="id2997871"></a><pre class="programlisting">#define gdk_visual_unref(v) g_object_unref(v)
</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_visual_unref</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
Deprecated equivalent of <a
href="../gobject/gobject-The-Base-Object-Type.html#g-object-unref"
><code class="function">g_object_unref()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>v</code></em> :</span></td>
<td>a <a href="gdk-Visuals.html#GdkVisual"><span class="type">GdkVisual</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2997935"></a><h3>
<a name="gdk-visual-get-screen"></a>gdk_visual_get_screen ()</h3>
<a class="indexterm" name="id2997951"></a><pre class="programlisting"><a href="GdkScreen.html" title="GdkScreen">GdkScreen</a>* gdk_visual_get_screen (<a href="gdk-Visuals.html#GdkVisual">GdkVisual</a> *visual);</pre>
<p>
Gets the screen to which this visual belongs</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>visual</code></em> :</span></td>
<td> a <a href="gdk-Visuals.html#GdkVisual"><span class="type">GdkVisual</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the screen to which this visual belongs.
</td>
</tr>
</tbody>
</table></div>
<p>Since 2.2
</p>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id2998025"></a><h2>See Also</h2>
<p>
<a href="gdk-Images.html#GdkImage"><span class="type">GdkImage</span></a>, <a href="gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a>, <span class="type">GdkRGB</span>
</p>
</div>
</div>
</body>
</html>