File: gdk-Visuals.html

package info (click to toggle)
gtk%2B2.0 2.20.1-2%2Bdeb6u2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 136,284 kB
  • ctags: 66,487
  • sloc: ansic: 590,318; sh: 10,559; makefile: 5,573; xml: 1,357; python: 866; perl: 776; asm: 457; awk: 72; cpp: 34
file content (675 lines) | stat: -rw-r--r-- 41,949 bytes parent folder | download | duplicates (2)
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Visuals</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" 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.14 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</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">
<a href="#gdk-Visuals.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#gdk-Visuals.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry" title="Visuals">
<a name="gdk-Visuals"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gdk-Visuals.top_of_page"></a>Visuals</span></h2>
<p>Visuals — Low-level display hardware information</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="gdk-Visuals.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gdk/gdk.h&gt;

                    <a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual">GdkVisual</a>;
enum                <a class="link" href="gdk-Visuals.html#GdkVisualType" title="enum GdkVisualType">GdkVisualType</a>;
enum                <a class="link" href="gdk-Visuals.html#GdkByteOrder" title="enum GdkByteOrder">GdkByteOrder</a>;
<span class="returnvalue">void</span>                <a class="link" href="gdk-Visuals.html#gdk-query-depths" title="gdk_query_depths ()">gdk_query_depths</a>                    (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> **depths</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *count</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gdk-Visuals.html#gdk-query-visual-types" title="gdk_query_visual_types ()">gdk_query_visual_types</a>              (<em class="parameter"><code><a class="link" href="gdk-Visuals.html#GdkVisualType" title="enum GdkVisualType"><span class="type">GdkVisualType</span></a> **visual_types</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *count</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a>*              <a class="link" href="gdk-Visuals.html#gdk-list-visuals" title="gdk_list_visuals ()">gdk_list_visuals</a>                    (<em class="parameter"><code><span class="type">void</span></code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                <a class="link" href="gdk-Visuals.html#gdk-visual-get-best-depth" title="gdk_visual_get_best_depth ()">gdk_visual_get_best_depth</a>           (<em class="parameter"><code><span class="type">void</span></code></em>);
<a class="link" href="gdk-Visuals.html#GdkVisualType" title="enum GdkVisualType"><span class="returnvalue">GdkVisualType</span></a>       <a class="link" href="gdk-Visuals.html#gdk-visual-get-best-type" title="gdk_visual_get_best_type ()">gdk_visual_get_best_type</a>            (<em class="parameter"><code><span class="type">void</span></code></em>);
<a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="returnvalue">GdkVisual</span></a>*          <a class="link" href="gdk-Visuals.html#gdk-visual-get-system" title="gdk_visual_get_system ()">gdk_visual_get_system</a>               (<em class="parameter"><code><span class="type">void</span></code></em>);
<a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="returnvalue">GdkVisual</span></a>*          <a class="link" href="gdk-Visuals.html#gdk-visual-get-best" title="gdk_visual_get_best ()">gdk_visual_get_best</a>                 (<em class="parameter"><code><span class="type">void</span></code></em>);
<a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="returnvalue">GdkVisual</span></a>*          <a class="link" href="gdk-Visuals.html#gdk-visual-get-best-with-depth" title="gdk_visual_get_best_with_depth ()">gdk_visual_get_best_with_depth</a>      (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> depth</code></em>);
<a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="returnvalue">GdkVisual</span></a>*          <a class="link" href="gdk-Visuals.html#gdk-visual-get-best-with-type" title="gdk_visual_get_best_with_type ()">gdk_visual_get_best_with_type</a>       (<em class="parameter"><code><a class="link" href="gdk-Visuals.html#GdkVisualType" title="enum GdkVisualType"><span class="type">GdkVisualType</span></a> visual_type</code></em>);
<a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="returnvalue">GdkVisual</span></a>*          <a class="link" href="gdk-Visuals.html#gdk-visual-get-best-with-both" title="gdk_visual_get_best_with_both ()">gdk_visual_get_best_with_both</a>       (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> depth</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Visuals.html#GdkVisualType" title="enum GdkVisualType"><span class="type">GdkVisualType</span></a> visual_type</code></em>);
#define             <a class="link" href="gdk-Visuals.html#gdk-visual-ref" title="gdk_visual_ref()">gdk_visual_ref</a>                      (v)
#define             <a class="link" href="gdk-Visuals.html#gdk-visual-unref" title="gdk_visual_unref()">gdk_visual_unref</a>                    (v)
<a class="link" href="GdkScreen.html" title="GdkScreen"><span class="returnvalue">GdkScreen</span></a> *         <a class="link" href="gdk-Visuals.html#gdk-visual-get-screen" title="gdk_visual_get_screen ()">gdk_visual_get_screen</a>               (<em class="parameter"><code><a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="type">GdkVisual</span></a> *visual</code></em>);
</pre>
</div>
<div class="refsect1" title="Description">
<a name="gdk-Visuals.description"></a><h2>Description</h2>
<p>
A <a class="link" href="gdk-Visuals.html#GdkVisual" title="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 class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>, but you should avoid <a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a> precisely
because its contents depend on the display hardware; use <a href="http://library.gnome.org/devel/gdk-pixbuf/unstable/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 class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a>,
the visual is implied as part of the colormap (<a class="link" href="gdk-Colormaps-and-Colors.html#gdk-colormap-get-visual" title="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 class="link" href="gdk-Visuals.html#gdk-visual-get-system" title="gdk_visual_get_system ()"><code class="function">gdk_visual_get_system()</code></a> is the system's default
visual. <a class="link" href="gdk-GdkRGB.html#gdk-rgb-get-visual" title="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 class="link" href="gdk-GdkRGB.html#gdk-rgb-get-colormap" title="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 class="link" 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 class="link" href="gdk-Visuals.html#GDK-VISUAL-DIRECT-COLOR:CAPS"><code class="literal">GDK_VISUAL_DIRECT_COLOR</code></a>,
<a class="link" href="gdk-Visuals.html#GDK-VISUAL-TRUE-COLOR:CAPS"><code class="literal">GDK_VISUAL_TRUE_COLOR</code></a>, <a class="link" href="gdk-Visuals.html#GDK-VISUAL-PSEUDO-COLOR:CAPS"><code class="literal">GDK_VISUAL_PSEUDO_COLOR</code></a>,
<a class="link" href="gdk-Visuals.html#GDK-VISUAL-STATIC-COLOR:CAPS"><code class="literal">GDK_VISUAL_STATIC_COLOR</code></a>, <a class="link" href="gdk-Visuals.html#GDK-VISUAL-GRAYSCALE:CAPS"><code class="literal">GDK_VISUAL_GRAYSCALE</code></a>,
then <a class="link" href="gdk-Visuals.html#GDK-VISUAL-STATIC-GRAY:CAPS"><code class="literal">GDK_VISUAL_STATIC_GRAY</code></a>.
</p>
</div>
<div class="refsect1" title="Details">
<a name="gdk-Visuals.details"></a><h2>Details</h2>
<div class="refsect2" title="GdkVisual">
<a name="GdkVisual"></a><h3>GdkVisual</h3>
<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>
<div class="example-contents">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="normal"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint">guint</a></span>
<span class="function">pixel_from_rgb</span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="gdk-Visuals.html#GdkVisual">GdkVisual</a> </span><span class="symbol">*</span><span class="normal">visual</span><span class="symbol">,</span>
<span class="normal">                <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guchar">guchar</a> r</span><span class="symbol">,</span><span class="normal"> <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guchar">guchar</a> b</span><span class="symbol">,</span><span class="normal"> <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guchar">guchar</a> g</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal">  </span><span class="keyword">return</span><span class="normal"> </span><span class="symbol">((</span><span class="normal">r </span><span class="symbol">&gt;&gt;</span><span class="normal"> </span><span class="symbol">(</span><span class="number">16</span><span class="normal"> </span><span class="symbol">-</span><span class="normal"> visual</span><span class="symbol">-&gt;</span><span class="normal">red_prec</span><span class="symbol">))</span><span class="normal">   </span><span class="symbol">&lt;&lt;</span><span class="normal"> visual</span><span class="symbol">-&gt;</span><span class="normal">red_shift</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">|</span>
<span class="normal">         </span><span class="symbol">((</span><span class="normal">g </span><span class="symbol">&gt;&gt;</span><span class="normal"> </span><span class="symbol">(</span><span class="number">16</span><span class="normal"> </span><span class="symbol">-</span><span class="normal"> visual</span><span class="symbol">-&gt;</span><span class="normal">green_prec</span><span class="symbol">))</span><span class="normal"> </span><span class="symbol">&lt;&lt;</span><span class="normal"> visual</span><span class="symbol">-&gt;</span><span class="normal">green_shift</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">|</span>
<span class="normal">         </span><span class="symbol">((</span><span class="normal">r </span><span class="symbol">&gt;&gt;</span><span class="normal"> </span><span class="symbol">(</span><span class="number">16</span><span class="normal"> </span><span class="symbol">-</span><span class="normal"> visual</span><span class="symbol">-&gt;</span><span class="normal">blue_prec</span><span class="symbol">))</span><span class="normal">  </span><span class="symbol">&lt;&lt;</span><span class="normal"> visual</span><span class="symbol">-&gt;</span><span class="normal">blue_shift</span><span class="symbol">);</span>
<span class="cbracket">}</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

</div>
<br class="example-break"><div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a> <em class="structfield"><code><a name="GdkVisual.parent-instance"></a>parent_instance</code></em>;</span></p></td>
<td>inherited portion from <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject"><span class="type">GObject</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="gdk-Visuals.html#GdkVisualType" title="enum GdkVisualType"><span class="type">GdkVisualType</span></a> <em class="structfield"><code><a name="GdkVisual.type"></a>type</code></em>;</span></p></td>
<td>The type of this visual.
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GdkVisual.depth"></a>depth</code></em>;</span></p></td>
<td>The number of bits per pixel.
</td>
</tr>
<tr>
<td><p><span class="term"><a class="link" href="gdk-Visuals.html#GdkByteOrder" title="enum GdkByteOrder"><span class="type">GdkByteOrder</span></a> <em class="structfield"><code><a name="GdkVisual.byte-order"></a>byte_order</code></em>;</span></p></td>
<td>The byte-order for this visual.
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GdkVisual.colormap-size"></a>colormap_size</code></em>;</span></p></td>
<td>The number of entries in the colormap, for
    visuals of type <a class="link" 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><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GdkVisual.bits-per-rgb"></a>bits_per_rgb</code></em>;</span></p></td>
<td>The number of significant bits per red, green, or blue
    when specifying colors for this visual. (For instance, for
    <a class="link" href="gdk-Colormaps-and-Colors.html#gdk-colormap-alloc-color" title="gdk_colormap_alloc_color ()"><code class="function">gdk_colormap_alloc_color()</code></a>)
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> <em class="structfield"><code><a name="GdkVisual.red-mask"></a>red_mask</code></em>;</span></p></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><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GdkVisual.red-shift"></a>red_shift</code></em>;</span></p></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 class="xref" 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><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GdkVisual.red-prec"></a>red_prec</code></em>;</span></p></td>
<td>See above.
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> <em class="structfield"><code><a name="GdkVisual.green-mask"></a>green_mask</code></em>;</span></p></td>
<td>A mask giving the bits in a pixel value that
    correspond to the green field.
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GdkVisual.green-shift"></a>green_shift</code></em>;</span></p></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><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GdkVisual.green-prec"></a>green_prec</code></em>;</span></p></td>
<td>See above.
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> <em class="structfield"><code><a name="GdkVisual.blue-mask"></a>blue_mask</code></em>;</span></p></td>
<td>A mask giving the bits in a pixel value that
    correspond to the blue field.
</td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GdkVisual.blue-shift"></a>blue_shift</code></em>;</span></p></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><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GdkVisual.blue-prec"></a>blue_prec</code></em>;</span></p></td>
<td>See above.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enum GdkVisualType">
<a name="GdkVisualType"></a><h3>enum GdkVisualType</h3>
<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><p><a name="GDK-VISUAL-STATIC-GRAY:CAPS"></a><span class="term"><code class="literal">GDK_VISUAL_STATIC_GRAY</code></span></p></td>
<td>Each pixel value indexes a grayscale value directly.
</td>
</tr>
<tr>
<td><p><a name="GDK-VISUAL-GRAYSCALE:CAPS"></a><span class="term"><code class="literal">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><a name="GDK-VISUAL-STATIC-COLOR:CAPS"></a><span class="term"><code class="literal">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><a name="GDK-VISUAL-PSEUDO-COLOR:CAPS"></a><span class="term"><code class="literal">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><a name="GDK-VISUAL-TRUE-COLOR:CAPS"></a><span class="term"><code class="literal">GDK_VISUAL_TRUE_COLOR</code></span></p></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 class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="type">GdkVisual</span></a>
   structure describe how the components are assembled into a pixel value.
</td>
</tr>
<tr>
<td><p><a name="GDK-VISUAL-DIRECT-COLOR:CAPS"></a><span class="term"><code class="literal">GDK_VISUAL_DIRECT_COLOR</code></span></p></td>
<td>Each pixel value contains red, green, and blue
   components as for <a class="link" 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" title="enum GdkByteOrder">
<a name="GdkByteOrder"></a><h3>enum GdkByteOrder</h3>
<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><p><a name="GDK-LSB-FIRST:CAPS"></a><span class="term"><code class="literal">GDK_LSB_FIRST</code></span></p></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><p><a name="GDK-MSB-FIRST:CAPS"></a><span class="term"><code class="literal">GDK_MSB_FIRST</code></span></p></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" title="gdk_query_depths ()">
<a name="gdk-query-depths"></a><h3>gdk_query_depths ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_query_depths                    (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> **depths</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *count</code></em>);</pre>
<p>
This function returns the available bit depths for the default
screen. It's equivalent to listing the visuals
(<a class="link" href="gdk-Visuals.html#gdk-list-visuals" title="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>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>depths</code></em> :</span></p></td>
<td> return location for available depths. <acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>. <acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym>. </td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>count</code></em> :</span></p></td>
<td> return location for number of available depths. <acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>. </td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gdk_query_visual_types ()">
<a name="gdk-query-visual-types"></a><h3>gdk_query_visual_types ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_query_visual_types              (<em class="parameter"><code><a class="link" href="gdk-Visuals.html#GdkVisualType" title="enum GdkVisualType"><span class="type">GdkVisualType</span></a> **visual_types</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *count</code></em>);</pre>
<p>
This function returns the available visual types for the default
screen. It's equivalent to listing the visuals
(<a class="link" href="gdk-Visuals.html#gdk-list-visuals" title="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>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>visual_types</code></em> :</span></p></td>
<td>return location for the available visual types
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>count</code></em> :</span></p></td>
<td>return location for the number of available visual types
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gdk_list_visuals ()">
<a name="gdk-list-visuals"></a><h3>gdk_list_visuals ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a>*              gdk_list_visuals                    (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Lists the available visuals for the default screen.
(See <a class="link" href="GdkScreen.html#gdk-screen-list-visuals" title="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="/usr/share/gtk-doc/html/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>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></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" title="gdk_visual_get_best_depth ()">
<a name="gdk-visual-get-best-depth"></a><h3>gdk_visual_get_best_depth ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                gdk_visual_get_best_depth           (<em class="parameter"><code><span class="type">void</span></code></em>);</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>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> best available depth
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gdk_visual_get_best_type ()">
<a name="gdk-visual-get-best-type"></a><h3>gdk_visual_get_best_type ()</h3>
<pre class="programlisting"><a class="link" href="gdk-Visuals.html#GdkVisualType" title="enum GdkVisualType"><span class="returnvalue">GdkVisualType</span></a>       gdk_visual_get_best_type            (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Return the best available visual type for the default GDK screen.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> best visual type
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gdk_visual_get_system ()">
<a name="gdk-visual-get-system"></a><h3>gdk_visual_get_system ()</h3>
<pre class="programlisting"><a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="returnvalue">GdkVisual</span></a>*          gdk_visual_get_system               (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Get the system's default 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>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> system visual. <acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>. </td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gdk_visual_get_best ()">
<a name="gdk-visual-get-best"></a><h3>gdk_visual_get_best ()</h3>
<pre class="programlisting"><a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="returnvalue">GdkVisual</span></a>*          gdk_visual_get_best                 (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
Get the visual with the most available colors for the default
GDK screen. The return value should not be freed.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> best visual. <acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>. </td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gdk_visual_get_best_with_depth ()">
<a name="gdk-visual-get-best-with-depth"></a><h3>gdk_visual_get_best_with_depth ()</h3>
<pre class="programlisting"><a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="returnvalue">GdkVisual</span></a>*          gdk_visual_get_best_with_depth      (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> depth</code></em>);</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="/usr/share/gtk-doc/html/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>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>depth</code></em> :</span></p></td>
<td>a bit depth
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> best visual for the given depth. <acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>. </td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gdk_visual_get_best_with_type ()">
<a name="gdk-visual-get-best-with-type"></a><h3>gdk_visual_get_best_with_type ()</h3>
<pre class="programlisting"><a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="returnvalue">GdkVisual</span></a>*          gdk_visual_get_best_with_type       (<em class="parameter"><code><a class="link" href="gdk-Visuals.html#GdkVisualType" title="enum GdkVisualType"><span class="type">GdkVisualType</span></a> visual_type</code></em>);</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="/usr/share/gtk-doc/html/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>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>visual_type</code></em> :</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> best visual of the given type. <acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>. </td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gdk_visual_get_best_with_both ()">
<a name="gdk-visual-get-best-with-both"></a><h3>gdk_visual_get_best_with_both ()</h3>
<pre class="programlisting"><a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="returnvalue">GdkVisual</span></a>*          gdk_visual_get_best_with_both       (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> depth</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Visuals.html#GdkVisualType" title="enum GdkVisualType"><span class="type">GdkVisualType</span></a> visual_type</code></em>);</pre>
<p>
Combines <a class="link" href="gdk-Visuals.html#gdk-visual-get-best-with-depth" title="gdk_visual_get_best_with_depth ()"><code class="function">gdk_visual_get_best_with_depth()</code></a> and <a class="link" href="gdk-Visuals.html#gdk-visual-get-best-with-type" title="gdk_visual_get_best_with_type ()"><code class="function">gdk_visual_get_best_with_type()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>depth</code></em> :</span></p></td>
<td>a bit depth
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>visual_type</code></em> :</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> best visual with both <em class="parameter"><code>depth</code></em> and
    <em class="parameter"><code>visual_type</code></em>, or <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if none. <acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>. </td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gdk_visual_ref()">
<a name="gdk-visual-ref"></a><h3>gdk_visual_ref()</h3>
<pre class="programlisting">#define gdk_visual_ref(v) g_object_ref(v)
</pre>
<div class="warning" title="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="/usr/share/gtk-doc/html/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><p><span class="term"><em class="parameter"><code>v</code></em> :</span></p></td>
<td>a <a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="type">GdkVisual</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the same visual
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gdk_visual_unref()">
<a name="gdk-visual-unref"></a><h3>gdk_visual_unref()</h3>
<pre class="programlisting">#define gdk_visual_unref(v) g_object_unref(v)
</pre>
<div class="warning" title="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="/usr/share/gtk-doc/html/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><p><span class="term"><em class="parameter"><code>v</code></em> :</span></p></td>
<td>a <a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="type">GdkVisual</span></a>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gdk_visual_get_screen ()">
<a name="gdk-visual-get-screen"></a><h3>gdk_visual_get_screen ()</h3>
<pre class="programlisting"><a class="link" href="GdkScreen.html" title="GdkScreen"><span class="returnvalue">GdkScreen</span></a> *         gdk_visual_get_screen               (<em class="parameter"><code><a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="type">GdkVisual</span></a> *visual</code></em>);</pre>
<p>
Gets the screen to which this visual belongs
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>visual</code></em> :</span></p></td>
<td>a <a class="link" href="gdk-Visuals.html#GdkVisual" title="GdkVisual"><span class="type">GdkVisual</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> the screen to which this visual belongs.
. <acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>. </td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.2</p>
</div>
</div>
<div class="refsect1" title="See Also">
<a name="gdk-Visuals.see-also"></a><h2>See Also</h2>
<p>
<a class="link" href="gdk-Images.html#GdkImage" title="GdkImage"><span class="type">GdkImage</span></a>, <a class="link" href="gdk-Colormaps-and-Colors.html#GdkColormap" title="GdkColormap"><span class="type">GdkColormap</span></a>, <span class="type">GdkRGB</span>
</p>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.14</div>
</body>
</html>