.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "X11::Protocol::Other 3pm" .TH X11::Protocol::Other 3pm "2019-08-26" "perl v5.28.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" X11::Protocol::Other \-\- miscellaneous X11::Protocol helpers .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use X11::Protocol::Other; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is some helper functions for \f(CW\*(C`X11::Protocol\*(C'\fR. .SH "EXPORTS" .IX Header "EXPORTS" Nothing is exported by default, but the functions can be requested in usual \&\f(CW\*(C`Exporter\*(C'\fR style, .PP .Vb 4 \& use X11::Protocol::Other \*(Aqvisual_is_dynamic\*(Aq; \& if (visual_is_dynamic ($X, $visual_id)) { \& ... \& } .Ve .PP Or just called with full package name .PP .Vb 4 \& use X11::Protocol::Other; \& if (X11::Protocol::Other::visual_is_dynamic ($X, $visual_id)) { \& ... \& } .Ve .PP There's no \f(CW\*(C`:all\*(C'\fR tag since this module is meant as a grab-bag of functions and to import as-yet unknown things would be asking for name clashes. .SH "FUNCTIONS" .IX Header "FUNCTIONS" .SS "Screen Finding" .IX Subsection "Screen Finding" .ie n .IP """$number = root_to_screen ($X, $root)""" 4 .el .IP "\f(CW$number = root_to_screen ($X, $root)\fR" 4 .IX Item "$number = root_to_screen ($X, $root)" .PD 0 .ie n .IP """$hashref = root_to_screen_info ($X, $root)""" 4 .el .IP "\f(CW$hashref = root_to_screen_info ($X, $root)\fR" 4 .IX Item "$hashref = root_to_screen_info ($X, $root)" .PD Return the screen number or screen info hash for a given root window. \&\f(CW$root\fR can be any \s-1XID\s0 integer on \f(CW$X\fR. If it's not one of the root windows then the return is \f(CW\*(C`undef\*(C'\fR. .ie n .IP """$number = default_colormap_to_screen ($X, $colormap)""" 4 .el .IP "\f(CW$number = default_colormap_to_screen ($X, $colormap)\fR" 4 .IX Item "$number = default_colormap_to_screen ($X, $colormap)" .PD 0 .ie n .IP """$hashref = default_colormap_to_screen_info ($X, $colormap)""" 4 .el .IP "\f(CW$hashref = default_colormap_to_screen_info ($X, $colormap)\fR" 4 .IX Item "$hashref = default_colormap_to_screen_info ($X, $colormap)" .PD Return the screen number or screen info hash for a given default colormap. \&\f(CW$colormap\fR can be any \s-1XID\s0 integer on \f(CW$X\fR. If it's not one of the screen default colormaps then the return is \f(CW\*(C`undef\*(C'\fR. .SS "Visuals" .IX Subsection "Visuals" .ie n .IP """$bool = visual_is_dynamic ($X, $visual_id)""" 4 .el .IP "\f(CW$bool = visual_is_dynamic ($X, $visual_id)\fR" 4 .IX Item "$bool = visual_is_dynamic ($X, $visual_id)" .PD 0 .ie n .IP """$bool = visual_class_is_dynamic ($X, $visual_class)""" 4 .el .IP "\f(CW$bool = visual_class_is_dynamic ($X, $visual_class)\fR" 4 .IX Item "$bool = visual_class_is_dynamic ($X, $visual_class)" .PD Return true if the given visual is dynamic, meaning colormap entries on it can be changed to change the colour of a given pixel value. .Sp \&\f(CW$visual_id\fR is one of the visual \s-1ID\s0 numbers, ie. one of the keys in \&\f(CW\*(C`$X\->{\*(Aqvisuals\*(Aq}\*(C'\fR. Or \f(CW$visual_class\fR is a VisualClass string like \&\*(L"PseudoColor\*(R" or corresponding integer such as 3. .SS "Window Info" .IX Subsection "Window Info" .ie n .IP """($width, $height) = window_size ($X, $window)""" 4 .el .IP "\f(CW($width, $height) = window_size ($X, $window)\fR" 4 .IX Item "($width, $height) = window_size ($X, $window)" .PD 0 .ie n .IP """$visual_id = window_visual ($X, $window)""" 4 .el .IP "\f(CW$visual_id = window_visual ($X, $window)\fR" 4 .IX Item "$visual_id = window_visual ($X, $window)" .PD Return the size or visual \s-1ID\s0 of a given window. .Sp \&\f(CW$window\fR is an integer \s-1XID\s0 on \f(CW$X\fR. If it's one of the root windows then the return values are from the screen info hash in \f(CW$X\fR, otherwise the server is queried with \f(CW\*(C`GetGeometry()\*(C'\fR (for the size) or \&\f(CW\*(C`GetWindowAttributes()\*(C'\fR (for the visual). .Sp These functions are handy when there's a good chance \f(CW$window\fR might be a root window and therefore not need a server round trip. .ie n .IP """@atoms = get_property_atoms($X, $window, $property)""" 4 .el .IP "\f(CW@atoms = get_property_atoms($X, $window, $property)\fR" 4 .IX Item "@atoms = get_property_atoms($X, $window, $property)" Get from \f(CW$window\fR (integer \s-1XID\s0) a list-of-atoms property \f(CW$property\fR (atom integer). The return is a list of atom integers, possibly an empty list. If \f(CW$property\fR doesn't exist or is not atoms then return an empty list. .ie n .IP """set_property_atoms($X, $window, $property, @atoms)""" 4 .el .IP "\f(CWset_property_atoms($X, $window, $property, @atoms)\fR" 4 .IX Item "set_property_atoms($X, $window, $property, @atoms)" Set on \f(CW$window\fR (integer \s-1XID\s0) a list-of-atoms property \f(CW$property\fR (atom integer) as the given list of \f(CW@atoms\fR (possibly empty). .SS "Colour Parsing" .IX Subsection "Colour Parsing" .ie n .IP """($red16, $green16, $blue16) = hexstr_to_rgb($str)""" 4 .el .IP "\f(CW($red16, $green16, $blue16) = hexstr_to_rgb($str)\fR" 4 .IX Item "($red16, $green16, $blue16) = hexstr_to_rgb($str)" Parse a given \s-1RGB\s0 colour string like \*(L"#FF00FF\*(R" into 16\-bit red, green, blue components. The return values are always in the range 0 to 65535. The strings recognised are 1, 2, 3 or 4 digit hex. .Sp .Vb 4 \& #RGB \& #RRGGBB \& #RRRGGGBBB \& #RRRRGGGGBBBB .Ve .Sp If \f(CW$str\fR is unrecognised then the return is an empty list, so for instance .Sp .Vb 2 \& my @rgb = hexstr_to_rgb($str) \& or die "Unrecognised colour: $str"; .Ve .Sp The digits of the 1, 2 and 3 forms are replicated as necessary to give a 16\-bit range. For example 3\-digit style \*(L"#321FFF000\*(R" gives return values 0x3213, 0xFFFF, 0. Or 1\-digit \*(L"#F0F\*(R" is 0xFFFF, 0, 0xFFFF. Notice \*(L"F\*(R" expands to 0xFFFF so an \*(L"F\*(R", \*(L"\s-1FF\*(R"\s0 or \*(L"\s-1FFF\*(R"\s0 all mean full saturation the same as a 4\-digit \*(L"\s-1FFFF\*(R".\s0 .Sp Would it be worth recognising the Xcms style \*(L"rgb:RR/GG/BB\*(R"? Perhaps that's best left to full Xcms, or general colour conversion modules. The X11R6 X(7) man page describes the \*(L"rgb:\*(R" form, but just \*(L"#\*(R" is much more common. .SH "SEE ALSO" .IX Header "SEE ALSO" X11::Protocol, X11::Protocol::GrabServer .PP Color::Library (many named colours), Convert::Color, Graphics::Color (Moose based) for more colour parsing .PP X11::AtomConstants, X11::CursorFont .SH "HOME PAGE" .IX Header "HOME PAGE" .SH "LICENSE" .IX Header "LICENSE" Copyright 2010, 2011, 2012, 2013, 2014, 2017, 2019 Kevin Ryde .PP X11\-Protocol\-Other is free software; you can redistribute it and/or modify it under the terms of the \s-1GNU\s0 General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. .PP X11\-Protocol\-Other is distributed in the hope that it will be useful, but \&\s-1WITHOUT ANY WARRANTY\s0; without even the implied warranty of \s-1MERCHANTABILITY\s0 or \s-1FITNESS FOR A PARTICULAR PURPOSE.\s0 See the \s-1GNU\s0 General Public License for more details. .PP You should have received a copy of the \s-1GNU\s0 General Public License along with X11\-Protocol\-Other. If not, see .