Gtk2::Gdk::Visual(3)
π Gtk2::Gdk::Visual π
okay so bestie, welcome to Gtk2::Gdk::Visual β it's the Perl wrapper for GdkVisual, aka the thing that tells you how your screen actually goes about turning numbers into β¨coloursβ¨. This page lives in the User Contributed Perl Documentation section of the Gtk2::Gdk::Visual(3) manual, and I'm about to walk you through every single bit of it. no skimming, we're doing this properly π«Ά
πΈ HIERARCHY πΈ
the family tree, and it's giving very much only-child energy:
Glib::Object
+----Gtk2::Gdk::Visual
β¨ METHODS β¨
π the "just give me the best one" club
integer = Gtk2::Gdk::Visual->get_best_depthβ hands you back an integer depth. the best one, apparently. iconic behaviour πvisual = Gtk2::Gdk::Visual->get_bestβ returns a visual. the best one. it said what it said πvisualtype = Gtk2::Gdk::Visual->get_best_typeβ returns the bestvisualtype. yes queen, know your type πvisual or undef = Gtk2::Gdk::Visual->get_best_with_both ($depth, $visual_type)β the picky one, you give it both a depth and a type. returns a visual, orundefif it's not feeling it π$depth(integer)$visual_type(Gtk2::Gdk::VisualType)
visual or undef = Gtk2::Gdk::Visual->get_best_with_depth ($depth)β same vibe, but you only specify the depth. visual orundef, no in-between π¦$depth(integer)
visual or undef = Gtk2::Gdk::Visual->get_best_with_type ($visual_type)β and this one just wants the type. visual orundef, that's the deal β¨$visual_type(Gtk2::Gdk::VisualType)
π the properties, one by one
integer = $visual->bits_per_rgbβ bits per RGB, as an integer.integer = $visual->get_bits_per_rgbβ same thing, getter-style. Since: gtk+ 2.22 βunsigned = $visual->blue_maskβ the blue mask, unsigned. π(mask, shift, precision) = $visual->get_blue_pixel_detailsβ returns all three in one go: mask, shift, precision. Since: gtk+ 2.22 βinteger = $visual->blue_precβ blue precision, integer.integer = $visual->blue_shiftβ blue shift, integer.byteorder = $visual->byte_orderβ which byte order we're on.byteorder = $visual->get_byte_orderβ the getter version. Since: gtk+ 2.22 βinteger = $visual->colormap_sizeβ how big the colormap is, integer-style.integer = $visual->get_colormap_sizeβ same info, getter flavour. Since: gtk+ 2.22 βinteger = $visual->depthβ the depth. integer.integer = $visual->get_depthβ the getter for the depth. Since: gtk+ 2.22 βunsigned = $visual->green_maskβ the green mask, unsigned. π(mask, shift, precision) = $visual->get_green_pixel_detailsβ mask, shift, precision, all bundled. Since: gtk+ 2.22 βinteger = $visual->green_precβ green precision, integer.integer = $visual->green_shiftβ green shift, integer.unsigned = $visual->red_maskβ the red mask, unsigned. β€οΈ(mask, shift, precision) = $visual->get_red_pixel_detailsβ you already know: mask, shift, precision. Since: gtk+ 2.22 βinteger = $visual->red_precβ red precision, integer.integer = $visual->red_shiftβ red shift, integer.screen = $visual->get_screenβ gives you the screen. Since: gtk+ 2.2 βvisual = Gtk2::Gdk::Visual->get_systemβ the system visual. your main character, literally πvisualtype = $visual->typeβ the visual type.visualtype = $visual->get_visual_typeβ the getter for the visual type. Since: gtk+ 2.22 β
π¦ ENUMS AND FLAGS π¦
enum Gtk2::Gdk::ByteOrder
'lsb-first'/GDK_LSB_FIRST'msb-first'/GDK_MSB_FIRST
enum Gtk2::Gdk::VisualType
'static-gray'/GDK_VISUAL_STATIC_GRAY'grayscale'/GDK_VISUAL_GRAYSCALE'static-color'/GDK_VISUAL_STATIC_COLOR'pseudo-color'/GDK_VISUAL_PSEUDO_COLOR'true-color'/GDK_VISUAL_TRUE_COLOR'direct-color'/GDK_VISUAL_DIRECT_COLOR
π SEE ALSO π
Gtk2Glib::Object
π COPYRIGHT π
Copyright (C) 2003-2011 by the gtk2-perl team.
This software is licensed under the LGPL. See Gtk2 for a full notice.
π lowkey the most important part: this whole thing is LGPL, so be normal about it pls.
and that's the page, bestie!! πΈ no cap, you now know Gtk2::Gdk::Visual fr fr. this gem of a document was served to you by perl v5.42.0, dated 2025-07-25, and honestly? she ate. π
β¨π«Ά
π¦ where this page comes from
- fedora 43: perl-Gtk2 1.24993-23.fc43 Β· LicenseRef-Callaway-LGPLv2+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms