X11::A...stants(3pm)

πŸ“¦
version 31 Β· 7 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

🌸 X11::AtomConstants β€” NAME πŸ’–

okay so bestie, this page is X11::A...stants(3pm) (yes the header truncates it, it's giving ✨mysterious✨) and the whole vibe is: X11::AtomConstants β€” predefined X11 atoms. that's it, that's the name, she's simple and she serves πŸ’…


✨ SYNOPSIS ✨

you drop her in and go:

use X11::AtomConstants;
$X->ChangeProperty($window,
                   X11::AtomConstants::WM_NAME,  # property
                   X11::AtomConstants::PIXMAP,   # type
                   8,                            # format
                   'Replace',
                   'My Window Title');

look at that. WM_NAME as the property, PIXMAP as the type, format 8, mode 'Replace', and the title 'My Window Title'. chef's kiss 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

so these are the X11 pre-defined atoms, packaged up as Perl constants. that's the whole thing. for example PIXMAP is 20, because the PIXMAP atom is number 20, no cap:

my $atom_id = X11::AtomConstants::PIXMAP;  # $atom_id is 20
my $name = $X->GetAtomName($atom_id);      # $name is "PIXMAP"

see how she round-trips? you give the number, you get the name back. iconic behavior, honestly 😭

now β€” LAST_PREDEFINED is not an atom, bestie, don't let the name fool you. she's just the last of the predefined values, and that value happens to be WM_TRANSIENT_FOR. periodt.

here's the full roster, every single one, no skips, i would never πŸ™ˆ

  • PRIMARY β€” 1
  • SECONDARY β€” 2
  • ARC β€” 3
  • ATOM β€” 4
  • BITMAP β€” 5
  • CARDINAL β€” 6
  • COLORMAP β€” 7
  • CURSOR β€” 8
  • CUT_BUFFER0 β€” 9
  • CUT_BUFFER1 β€” 10
  • CUT_BUFFER2 β€” 11
  • CUT_BUFFER3 β€” 12
  • CUT_BUFFER4 β€” 13
  • CUT_BUFFER5 β€” 14
  • CUT_BUFFER6 β€” 15
  • CUT_BUFFER7 β€” 16
  • DRAWABLE β€” 17
  • FONT β€” 18
  • INTEGER β€” 19
  • PIXMAP β€” 20
  • POINT β€” 21
  • RECTANGLE β€” 22
  • RESOURCE_MANAGER β€” 23
  • RGB_COLOR_MAP β€” 24
  • RGB_BEST_MAP β€” 25
  • RGB_BLUE_MAP β€” 26
  • RGB_DEFAULT_MAP β€” 27
  • RGB_GRAY_MAP β€” 28
  • RGB_GREEN_MAP β€” 29
  • RGB_RED_MAP β€” 30
  • STRING β€” 31
  • VISUALID β€” 32
  • WINDOW β€” 33
  • WM_COMMAND β€” 34
  • WM_HINTS β€” 35
  • WM_CLIENT_MACHINE β€” 36
  • WM_ICON_NAME β€” 37
  • WM_ICON_SIZE β€” 38
  • WM_NAME β€” 39
  • WM_NORMAL_HINTS β€” 40
  • WM_SIZE_HINTS β€” 41
  • WM_ZOOM_HINTS β€” 42
  • MIN_SPACE β€” 43
  • NORM_SPACE β€” 44
  • MAX_SPACE β€” 45
  • END_SPACE β€” 46
  • SUPERSCRIPT_X β€” 47
  • SUPERSCRIPT_Y β€” 48
  • SUBSCRIPT_X β€” 49
  • SUBSCRIPT_Y β€” 50
  • UNDERLINE_POSITION β€” 51
  • UNDERLINE_THICKNESS β€” 52
  • STRIKEOUT_ASCENT β€” 53
  • STRIKEOUT_DESCENT β€” 54
  • ITALIC_ANGLE β€” 55
  • X_HEIGHT β€” 56
  • QUAD_WIDTH β€” 57
  • WEIGHT β€” 58
  • POINT_SIZE β€” 59
  • RESOLUTION β€” 60
  • COPYRIGHT β€” 61
  • NOTICE β€” 62
  • FONT_NAME β€” 63
  • FAMILY_NAME β€” 64
  • FULL_NAME β€” 65
  • CAP_HEIGHT β€” 66
  • WM_CLASS β€” 67
  • WM_TRANSIENT_FOR β€” 68
  • LAST_PREDEFINED β€” 68

sixty-eight of them and then LAST_PREDEFINED also sitting at 68 like πŸ‘‘ because she is the last one. the math is mathing.


πŸŽ€ EXPORTS πŸŽ€

nothing is exported by default, bestie β€” she's not gonna dump 68 constants in your namespace uninvited, she has boundaries. but you can ask for them the usual Exporter way:

use X11::AtomConstants 'PIXMAP';
blah (atom => PIXMAP);

and if you want everything, the :all tag imports the whole squad:

use X11::AtomConstants ':all';
blah (atom1 => POINT,
      atom2 => RECTANGLE);
lowkey heads up though: a lot of these atoms have super generic names β€” STRING, WEIGHT, like girl, those could mean anything 😭 β€” so importing them might not be the move. and that's fine!! you can always just use the full package name and nobody gets hurt:
use X11::AtomConstants;
blah (atom => X11::AtomConstants::PIXMAP);

fully-qualified and unbothered. that's the safe route, fr fr.


πŸ’œ SEE ALSO πŸ’œ

go read these too, they're all part of the same little universe:

  • X11::CursorFont
  • X11::Keysyms
  • X11::Protocol
  • X11::Protocol::Other
  • X11::Protocol::WM

and for the real source-of-truth tea:

  • the X Window System Protocol specification (the values live in Appendix B), at /usr/share/X11/doc/hardcopy/XProtocol/proto.PS.gz
  • /usr/include/X11/Xatom.h

🌈 HOME PAGE 🌈

<http://user42.tuxfamily.org/x11-protocol-other/index.html>


πŸ’– LICENSE πŸ’–

Copyright 2011, 2012, 2013, 2014, 2017 Kevin Ryde.

X11-Protocol-Other is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

X11-Protocol-Other is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with X11-Protocol-Other. If not, see <http://www.gnu.org/licenses/>.


and that's the whole page, bestie!! πŸŽ€ this was X11::A...stants(3pm) from the User Contributed Perl Documentation, perl v5.28.1, dated 2019-08-26 β€” go forth and name your atoms, you absolute main character πŸ¦‹βœ¨πŸ‘‘

πŸ“¦ where this page comes from