summaryrefslogtreecommitdiff
path: root/docs/reference/pygtk-gdkvisual.xml
blob: bc7c96cadba00006939a35673579d069b785bfa1 (plain)
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
<?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="30"?>
	  <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 <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link> with
the best depth.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.visual_get_best_depth</function>()
function returns the <link
linkend="class-gdkvisual"><classname>gtk.gdk.Visual</classname></link> with
the best depth for the default screen where "best" means the largest</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>