NAME

X11::Protocol::Other -- miscellaneous X11::Protocol helpers

SYNOPSIS

use X11::Protocol::Other;

DESCRIPTION

This is some helper functions for X11::Protocol.

EXPORTS

Nothing is exported by default, but the functions can be requested in usual Exporter style,

use X11::Protocol::Other 'visual_is_dynamic';
if (visual_is_dynamic ($X, $visual_id)) {
  ...
}

Or just called with full package name

use X11::Protocol::Other;
if (X11::Protocol::Other::visual_is_dynamic ($X, $visual_id)) {
  ...
}

There's no :all 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.

FUNCTIONS

Screen Finding

$number = root_to_screen ($X, $root)
$hashref = root_to_screen_info ($X, $root)

Return the screen number or screen info hash for a given root window. $root can be any XID integer on $X. If it's not one of the root windows then the return is undef.

$number = default_colormap_to_screen ($X, $colormap)
$hashref = default_colormap_to_screen_info ($X, $colormap)

Return the screen number or screen info hash for a given default colormap. $colormap can be any XID integer on $X. If it's not one of the screen default colormaps then the return is undef.

Visuals

$bool = visual_is_dynamic ($X, $visual_id)
$bool = visual_class_is_dynamic ($X, $visual_class)

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.

$visual_id is one of the visual ID numbers, ie. one of the keys in $X->{'visuals'}. Or $visual_class is a VisualClass string like "PseudoColor" or corresponding integer such as 3.

Window Info

($width, $height) = window_size ($X, $window)
$visual_id = window_visual ($X, $window)

Return the size or visual ID of a given window.

$window is an integer XID on $X. If it's one of the root windows then the return values are from the screen info hash in $X, otherwise the server is queried with GetGeometry or GetWindowAttributes.

These functions are handy when there's a good chance $window might be a root window and therefore not need a server round trip.

SEE ALSO

X11::Protocol, X11::Protocol::GrabServer

HOME PAGE

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

LICENSE

Copyright 2010, 2011 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/>.