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
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>GTK+ Foundation Classes</title>
<link href="gfc.css" rel="stylesheet" type="text/css">
<meta content="The GFC Development Team" name="author">
<meta content="Core Library Reference Manual" name="description">
</head>
<body style="color: rgb(0, 0, 0); background-color: rgb(243, 244, 248);"
alink="#000099" link="#000099" vlink="#990099">
<table style="text-align: left; width: 1227px; height: 117px;"
border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td
style="text-align: center; background-color: rgb(255, 255, 255); width: 220px; vertical-align: top;"><img
alt="GFC Logo" src="../images/gfc.png"
style="width: 207px; height: 92px;"></td>
<td
style="text-align: center; background-color: rgb(87, 107, 152); vertical-align: middle;"><img
alt="GFC Title Logo" src="../images/gfc-title.png"
style="width: 418px; height: 76px;"><br>
</td>
</tr>
<tr>
<td
style="text-align: center; background-color: rgb(65, 77, 104); vertical-align: middle;"><big><span
style="color: rgb(255, 255, 153); font-weight: bold;">Reference Manual</span></big><br>
</td>
<td
style="text-align: center; background-color: rgb(148, 164, 200); vertical-align: middle;"><small
style="font-family: helvetica,arial,sans-serif;"><a
href="../html/index.html">Main Page</a> | <a
href="../html/namespaces.html">Namespace List</a> | <a
href="classes.html">Alphabetical List</a> | <a
href="../html/annotated.html">Class List</a> | <a
href="../html/files.html">File List</a></small><br>
</td>
</tr>
</tbody>
</table>
<small> </small>
</body>
</html>
<!-- Generated by Doxygen 1.3.8 -->
<h1>GFC::Gdk::Visual Class Reference</h1>A GdkVisual C++ wrapper class.
<a href="#_details">More...</a>
<p>
<code>#include <<a class="el" href="visual_8hh-source.html">gfc/gdk/visual.hh</a>></code>
<p>
<p>Inheritance diagram for GFC::Gdk::Visual:
<p><center><img src="classGFC_1_1Gdk_1_1Visual.png" usemap="#GFC::Gdk::Visual_map" border="0" alt=""></center>
<map name="GFC::Gdk::Visual_map">
<area doxygen="gfccore.tag:" href="classGFC_1_1G_1_1Object.html" alt="GFC::G::Object" shape="rect" coords="0,112,134,136">
<area doxygen="gfccore.tag:" href="classGFC_1_1G_1_1TypeInstance.html" alt="GFC::G::TypeInstance" shape="rect" coords="0,56,134,80">
<area doxygen="gfccore.tag:" href="classGFC_1_1Trackable.html" alt="GFC::Trackable" shape="rect" coords="0,0,134,24">
</map>
<a href="classGFC_1_1Gdk_1_1Visual-members.html">List of all members.</a><h2>Public Member Functions</h2>
<tr><td colspan="2"><div class="groupHeader">Constructors</div></td></tr>
<ul>
<li><a class="anchor" name="z223_0" doxytag="GFC::Gdk::Visual::~Visual" ></a>
virtual <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z223_0">~Visual</a> ()
<dl class="el"><dd class="mdescRight">Destructor. <br></dl></ul>
<tr><td colspan="2"><div class="groupHeader">Accessors</div></td></tr>
<ul>
<li><a class="anchor" name="z224_0" doxytag="GFC::Gdk::Visual::gdk_visual" ></a>
GdkVisual * <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_0">gdk_visual</a> () const
<dl class="el"><dd class="mdescRight">Get a pointer to the GdkVisual structure. <br></dl><li><a class="anchor" name="z224_1" doxytag="GFC::Gdk::Visual::operator GdkVisual *" ></a>
<a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_1">operator GdkVisual *</a> () const
<dl class="el"><dd class="mdescRight">Conversion operator; safely converts a <a class="el" href="classGFC_1_1Gdk_1_1Visual.html">Visual</a> to a GdkVisual pointer. <br></dl><li><a class="anchor" name="z224_2" doxytag="GFC::Gdk::Visual::type" ></a>
<a class="el" href="namespaceGFC_1_1Gdk.html#a290">VisualType</a> <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_2">type</a> () const
<dl class="el"><dd class="mdescRight">Returns the type of this visual. <br></dl><li><a class="anchor" name="z224_3" doxytag="GFC::Gdk::Visual::depth" ></a>
int <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_3">depth</a> () const
<dl class="el"><dd class="mdescRight">Returns the number of bits per pixel. <br></dl><li><a class="anchor" name="z224_4" doxytag="GFC::Gdk::Visual::byte_order" ></a>
<a class="el" href="namespaceGFC_1_1Gdk.html#a279">ByteOrder</a> <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_4">byte_order</a> () const
<dl class="el"><dd class="mdescRight">Returns the byte-order for this visual. <br></dl><li>int <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_5">colormap_size</a> () const
<dl class="el"><dd class="mdescRight">Returns the number of entries in the colormap, for visuals of type VISUAL_PSEUDO_COLOR or VISUAL_GRAY_SCALE, for other visual types, it is the number of possible levels per color component. <a href="#z224_5"></a><br></dl><li><a class="anchor" name="z224_6" doxytag="GFC::Gdk::Visual::bits_per_rgb" ></a>
int <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_6">bits_per_rgb</a> () const
<dl class="el"><dd class="mdescRight">Returns the number of significant bits per red, green, or blue when specifying colors for this visual (for instance, for <a class="el" href="classGFC_1_1Gdk_1_1Colormap.html#z108_0">Gdk::Colormap::alloc_color()</a>). <br></dl><li>unsigned int <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_7">red_mask</a> () const
<dl class="el"><dd class="mdescRight">Returns a mask giving the bits in a pixel value that correspond to the red field. <a href="#z224_7"></a><br></dl><li>int <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_8">red_shift</a> () const
<dl class="el"><dd class="mdescRight">Returns the red_shift. <a href="#z224_8"></a><br></dl><li><a class="anchor" name="z224_9" doxytag="GFC::Gdk::Visual::red_prec" ></a>
int <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_9">red_prec</a> () const
<dl class="el"><dd class="mdescRight">Returns the red_prec (see <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_8">red_shift()</a>). <br></dl><li><a class="anchor" name="z224_10" doxytag="GFC::Gdk::Visual::green_mask" ></a>
unsigned int <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_10">green_mask</a> () const
<dl class="el"><dd class="mdescRight">Returns a mask giving the bits in a pixel value that correspond to the green field. <br></dl><li>int <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_11">green_shift</a> () const
<dl class="el"><dd class="mdescRight">Returns the green_shift. <a href="#z224_11"></a><br></dl><li><a class="anchor" name="z224_12" doxytag="GFC::Gdk::Visual::green_prec" ></a>
int <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_12">green_prec</a> () const
<dl class="el"><dd class="mdescRight">Returns the green_prec (see <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_11">green_shift()</a>). <br></dl><li><a class="anchor" name="z224_13" doxytag="GFC::Gdk::Visual::blue_mask" ></a>
unsigned int <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_13">blue_mask</a> () const
<dl class="el"><dd class="mdescRight">Returns a mask giving the bits in a pixel value that correspond to the blue field. <br></dl><li>int <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_14">blue_shift</a> () const
<dl class="el"><dd class="mdescRight">Returns the blue_shift. <a href="#z224_14"></a><br></dl><li><a class="anchor" name="z224_15" doxytag="GFC::Gdk::Visual::blue_prec" ></a>
int <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_15">blue_prec</a> () const
<dl class="el"><dd class="mdescRight">Returns the blue_prec (see <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_14">blue_shift()</a>). <br></dl><li>int <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_16">get_best_depth</a> () const
<dl class="el"><dd class="mdescRight">Get the best available depth for the default <a class="el" href="classGFC_1_1Gdk_1_1Screen.html">Gdk::Screen</a>. <a href="#z224_16"></a><br></dl><li><a class="el" href="namespaceGFC_1_1Gdk.html#a290">VisualType</a> <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_17">get_best_type</a> () const
<dl class="el"><dd class="mdescRight">Return the best available visual type for the default <a class="el" href="classGFC_1_1Gdk_1_1Screen.html">Gdk::Screen</a>. <a href="#z224_17"></a><br></dl></ul>
<h2>Static Public Member Functions</h2>
<ul>
<li><a class="anchor" name="e0" doxytag="GFC::Gdk::Visual::get_best" ></a>
const <a class="el" href="classGFC_1_1Gdk_1_1Visual.html">Visual</a> * <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#e0">get_best</a> ()
<dl class="el"><dd class="mdescRight">Returns the visual with the most available colors for the default <a class="el" href="classGFC_1_1Gdk_1_1Screen.html">Gdk::Screen</a>. <br></dl><li>const <a class="el" href="classGFC_1_1Gdk_1_1Visual.html">Visual</a> * <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#e1">get_best</a> (int depth)
<dl class="el"><dd class="mdescRight">Get the best visual with depth <em>depth</em> for the default <a class="el" href="classGFC_1_1Gdk_1_1Screen.html">Gdk::Screen</a>. <a href="#e1"></a><br></dl><li>const <a class="el" href="classGFC_1_1Gdk_1_1Visual.html">Visual</a> * <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#e2">get_best</a> (<a class="el" href="namespaceGFC_1_1Gdk.html#a290">VisualType</a> visual_type)
<dl class="el"><dd class="mdescRight">Get the best visual of the given visual_type for the default <a class="el" href="classGFC_1_1Gdk_1_1Screen.html">Gdk::Screen</a>. <a href="#e2"></a><br></dl><li>const <a class="el" href="classGFC_1_1Gdk_1_1Visual.html">Visual</a> * <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#e3">get_best</a> (int depth, <a class="el" href="namespaceGFC_1_1Gdk.html#a290">VisualType</a> visual_type)
<dl class="el"><dd class="mdescRight">Get the best visual of the given <em>visual_type</em> with depth <em>depth</em> for the default <a class="el" href="classGFC_1_1Gdk_1_1Screen.html">Gdk::Screen</a>. <a href="#e3"></a><br></dl><li>const <a class="el" href="classGFC_1_1Gdk_1_1Visual.html">Visual</a> * <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#e4">get_system</a> ()
<dl class="el"><dd class="mdescRight">Returns the system's default visual for the default <a class="el" href="classGFC_1_1Gdk_1_1Screen.html">Gdk::Screen</a>. <a href="#e4"></a><br></dl><li>std::vector< int > <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#e5">query_depths</a> ()
<dl class="el"><dd class="mdescRight">This method returns the available bit depths for the default screen. <a href="#e5"></a><br></dl><li>bool <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#e6">query_visual_types</a> (std::vector< <a class="el" href="namespaceGFC_1_1Gdk.html#a290">VisualType</a> > &visual_types)
<dl class="el"><dd class="mdescRight">This method returns the available visual types for the default screen. <a href="#e6"></a><br></dl><li>bool <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#e7">list_visuals</a> (std::vector< const <a class="el" href="classGFC_1_1Gdk_1_1Visual.html">Visual</a> * > &visuals)
<dl class="el"><dd class="mdescRight">Lists the available visuals for the default screen (see <a class="el" href="classGFC_1_1Gdk_1_1Screen.html#z198_12">Gdk::Screen::list_visuals()</a>). <a href="#e7"></a><br></dl></ul>
<h2>Protected Member Functions</h2>
<tr><td colspan="2"><div class="groupHeader">Constructors</div></td></tr>
<ul>
<li><a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z222_0">Visual</a> (GdkVisual *visual, bool <a class="elRef" doxygen="gfccore.tag:" href="classGFC_1_1Trackable.html#z143_1">owns_reference</a>=true)
<dl class="el"><dd class="mdescRight">Construct a new <a class="el" href="classGFC_1_1Gdk_1_1Visual.html">Visual</a> from an existing GdkVisual. <a href="#z222_0"></a><br></dl></ul>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A GdkVisual C++ wrapper class.
<p>
A <a class="el" href="classGFC_1_1Gdk_1_1Visual.html">Visual</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>
Usually you can avoid thinking about visuals in GTK+. Visuals are useful to interpret the contents of a <a class="el" href="classGFC_1_1Gdk_1_1Image.html">Gdk::Image</a>, but you should avoid <a class="el" href="classGFC_1_1Gdk_1_1Image.html">Gdk::Image</a> precisely because its contents depend on the display hardware; use <a class="el" href="classGFC_1_1Gdk_1_1Pixbuf.html">Gdk::Pixbuf</a> instead, for all but the most low-level purposes. Also, anytime you provide a <a class="el" href="classGFC_1_1Gdk_1_1Colormap.html">Gdk::Colormap</a>, the visual is implied as part of the colormap (<a class="el" href="classGFC_1_1Gdk_1_1Colormap.html#z107_2">Gdk::Colormap::get_visual()</a>), so you won't have to provide a visual in addition.<p>
There are several standard visuals. The visual returned by <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#e4">get_system()</a> is the system's default visual. A number of methods 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, VISUAL_PSEUDO_COLOR is preferred at 8bpp, otherwise, the visual types are ranked in the order of (highest to lowest) VISUAL_DIRECT_COLOR, VISUAL_TRUE_COLOR, VISUAL_PSEUDO_COLOR, VISUAL_STATIC_COLOR, VISUAL_GRAYSCALE, then VISUAL_STATIC_GRAY.
<p>
<hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="z222_0" doxytag="GFC::Gdk::Visual::Visual" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> GFC::Gdk::Visual::Visual </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">GdkVisual * </td>
<td class="mdname" nowrap> <em>visual</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>bool </td>
<td class="mdname" nowrap> <em>owns_reference</em> = <code>true</code></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [explicit, protected]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Construct a new <a class="el" href="classGFC_1_1Gdk_1_1Visual.html">Visual</a> from an existing GdkVisual.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>visual</em> </td><td>A pointer to a GdkVisual. </td></tr>
<tr><td></td><td valign=top><em>owns_reference</em> </td><td>Set false if the initial reference count is floating, set true if it's not.</td></tr>
</table>
</dl>
<br>
The <em>visual</em> can be a newly created GdkVisual or an existing GdkVisual. (see <a class="elRef" doxygen="gfccore.tag:" href="classGFC_1_1G_1_1Object.html#z68_0">G::Object::Object</a>). </td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="z224_14" doxytag="GFC::Gdk::Visual::blue_shift" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int GFC::Gdk::Visual::blue_shift </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the blue_shift.
<p>
The blue_shift and blue_prec give an alternate presentation of the information in blue_mask (see example in <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_8">red_shift()</a>). </td>
</tr>
</table>
<a class="anchor" name="z224_5" doxytag="GFC::Gdk::Visual::colormap_size" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int GFC::Gdk::Visual::colormap_size </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the number of entries in the colormap, for visuals of type VISUAL_PSEUDO_COLOR or VISUAL_GRAY_SCALE, for other visual types, it is the number of possible levels per color component.
<p>
If the visual has different numbers of levels for different components, the value of this field is undefined. </td>
</tr>
</table>
<a class="anchor" name="e3" doxytag="GFC::Gdk::Visual::get_best" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> const <a class="el" href="classGFC_1_1Gdk_1_1Visual.html">Visual</a>* GFC::Gdk::Visual::get_best </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">int </td>
<td class="mdname" nowrap> <em>depth</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap><a class="el" href="namespaceGFC_1_1Gdk.html#a290">VisualType</a> </td>
<td class="mdname" nowrap> <em>visual_type</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Get the best visual of the given <em>visual_type</em> with depth <em>depth</em> for the default <a class="el" href="classGFC_1_1Gdk_1_1Screen.html">Gdk::Screen</a>.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>depth</em> </td><td>A bit depth. </td></tr>
<tr><td></td><td valign=top><em>visual_type</em> </td><td>A visual type. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The best visual with both <em>depth</em> and <em>visual_type</em>, or null if none. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="e2" doxytag="GFC::Gdk::Visual::get_best" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> const <a class="el" href="classGFC_1_1Gdk_1_1Visual.html">Visual</a>* GFC::Gdk::Visual::get_best </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="namespaceGFC_1_1Gdk.html#a290">VisualType</a> </td>
<td class="mdname1" valign="top" nowrap> <em>visual_type</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Get the best visual of the given visual_type for the default <a class="el" href="classGFC_1_1Gdk_1_1Screen.html">Gdk::Screen</a>.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>visual_type</em> </td><td>A visual type. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The best visual of the given type; or null if no visual has type <em>visual_type</em>.</dd></dl>
<br>
Visuals with higher color depths are considered better. </td>
</tr>
</table>
<a class="anchor" name="e1" doxytag="GFC::Gdk::Visual::get_best" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> const <a class="el" href="classGFC_1_1Gdk_1_1Visual.html">Visual</a>* GFC::Gdk::Visual::get_best </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">int </td>
<td class="mdname1" valign="top" nowrap> <em>depth</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Get the best visual with depth <em>depth</em> for the default <a class="el" href="classGFC_1_1Gdk_1_1Screen.html">Gdk::Screen</a>.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>depth</em> </td><td>A bit depth. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The best visual for the given depth, or null if no visual supports <em>depth</em>.</dd></dl>
<br>
<a class="el" href="classGFC_1_1Gdk_1_1Color.html">Color</a> visuals and visuals with mutable colormaps are preferred over grayscale or fixed-colormap visuals. Null may be returned if no visual supports depth. </td>
</tr>
</table>
<a class="anchor" name="z224_16" doxytag="GFC::Gdk::Visual::get_best_depth" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int GFC::Gdk::Visual::get_best_depth </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Get the best available depth for the default <a class="el" href="classGFC_1_1Gdk_1_1Screen.html">Gdk::Screen</a>.
<p>
<dl compact><dt><b>Returns:</b></dt><dd>The best available depth.</dd></dl>
<br>
"Best" means "largest," i.e. 32 preferred over 24 preferred over 8 bits per pixel. </td>
</tr>
</table>
<a class="anchor" name="z224_17" doxytag="GFC::Gdk::Visual::get_best_type" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="namespaceGFC_1_1Gdk.html#a290">VisualType</a> GFC::Gdk::Visual::get_best_type </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Return the best available visual type for the default <a class="el" href="classGFC_1_1Gdk_1_1Screen.html">Gdk::Screen</a>.
<p>
<dl compact><dt><b>Returns:</b></dt><dd>The best visual type. </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="e4" doxytag="GFC::Gdk::Visual::get_system" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> const <a class="el" href="classGFC_1_1Gdk_1_1Visual.html">Visual</a>* GFC::Gdk::Visual::get_system </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the system's default visual for the default <a class="el" href="classGFC_1_1Gdk_1_1Screen.html">Gdk::Screen</a>.
<p>
This is the visual for the root window of the display. </td>
</tr>
</table>
<a class="anchor" name="z224_11" doxytag="GFC::Gdk::Visual::green_shift" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int GFC::Gdk::Visual::green_shift </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the green_shift.
<p>
The green_shift and green_prec give an alternate presentation of the information in green_mask (see example in <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_8">red_shift()</a>). </td>
</tr>
</table>
<a class="anchor" name="e7" doxytag="GFC::Gdk::Visual::list_visuals" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool GFC::Gdk::Visual::list_visuals </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">std::vector< const <a class="el" href="classGFC_1_1Gdk_1_1Visual.html">Visual</a> * > & </td>
<td class="mdname1" valign="top" nowrap> <em>visuals</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Lists the available visuals for the default screen (see <a class="el" href="classGFC_1_1Gdk_1_1Screen.html#z198_12">Gdk::Screen::list_visuals()</a>).
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>visuals</em> </td><td>A reference to a vector of const Visual* to hold the list of available visuals. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd><em>true</em> if the vector is not empty.</dd></dl>
<br>
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. </td>
</tr>
</table>
<a class="anchor" name="e5" doxytag="GFC::Gdk::Visual::query_depths" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> std::vector<int> GFC::Gdk::Visual::query_depths </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
This method returns the available bit depths for the default screen.
<p>
<dl compact><dt><b>Returns:</b></dt><dd>A vector of int holding the available depths.</dd></dl>
<br>
It's equivalent to listing the visuals (<a class="el" href="classGFC_1_1Gdk_1_1Visual.html#e7">list_visuals()</a>) and then looking at the <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_3">depth()</a> field in each visual, removing duplicates. </td>
</tr>
</table>
<a class="anchor" name="e6" doxytag="GFC::Gdk::Visual::query_visual_types" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool GFC::Gdk::Visual::query_visual_types </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">std::vector< <a class="el" href="namespaceGFC_1_1Gdk.html#a290">VisualType</a> > & </td>
<td class="mdname1" valign="top" nowrap> <em>visual_types</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
This method returns the available visual types for the default screen.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td></td><td valign=top><em>visual_types</em> </td><td>A reference to a vector of VisualType to hold the available visual types. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd><em>true</em> if the vector is not empty.</dd></dl>
<br>
It's equivalent to listing the visuals (<a class="el" href="classGFC_1_1Gdk_1_1Visual.html#e7">list_visuals()</a>) and then looking at the <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_2">type()</a> field in each visual, removing duplicates. </td>
</tr>
</table>
<a class="anchor" name="z224_7" doxytag="GFC::Gdk::Visual::red_mask" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> unsigned int GFC::Gdk::Visual::red_mask </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns a mask giving the bits in a pixel value that correspond to the red field.
<p>
Significant only for VISUAL_PSEUDOCOLOR and VISUAL_DIRECTCOLOR. </td>
</tr>
</table>
<a class="anchor" name="z224_8" doxytag="GFC::Gdk::Visual::red_shift" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int GFC::Gdk::Visual::red_shift </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns the red_shift.
<p>
The <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_8">red_shift()</a> and <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_9">red_prec()</a> give an alternate presentation of the information in <a class="el" href="classGFC_1_1Gdk_1_1Visual.html#z224_7">red_mask()</a>. The <em>red_mask</em> is a contiguous sequence of <em>red_prec</em> bits starting at bit number <em>red_shift</em>.<p>
<b>Example:</b> Constructing a pixel value out of three 16 bit color values. <div class="fragment"><pre> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>
pixel_from_rgb(<span class="keyword">const</span> Gdk::Visual& visual, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> r, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> b, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> g)
{
<span class="keywordflow">return</span> ((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> </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="visual_8hh-source.html">visual.hh</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Tue Aug 24 00:34:36 2004 for GFC-UI by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 ></a> 1.3.8 </small></address>
</body>
</html>
|