Gtk2::Gdk::Visual(3)

πŸ“¦
version 1.24993 Β· 2 versions
, in fedora 43

πŸ’– 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 best visualtype. 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, or undef if 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 or undef, 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 or undef, 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 πŸ‘€

  • Gtk2
  • Glib::Object

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