Image::Base::X11::Protocol::Window -- draw into an X11::Protocol window
use Image::Base::X11::Protocol::Drawable; my $X = X11::Protocol->new; use Image::Base::X11::Protocol::Window; my $image = Image::Base::X11::Protocol::Window->new (-X => $X, -window => $win_xid); $image->line (0,0, 99,99, '#FF00FF'); $image->rectangle (10,10, 20,15, 'white');
Image::Base::X11::Protocol::Window is a subclass of
Image::Base Image::Base::X11::Protocol::Drawable Image::Base::X11::Protocol::Window
Image::Base to draw into an X window by speaking directly to an X server using
X11::Protocol. There's no file load or save, just drawing operations.
As an experimental feature, if the
X11::Protocol object has the SHAPE extension available and initialized then colour "None" means transparent and drawing it subtracts from the window's shape to make see-though holes. This is fun, and makes "None" more or less work like other
Image::Base subclasses, but is probably not actually very useful.
See "FUNCTIONS" in Image::Base::X11::Protocol::Drawable and "FUNCTIONS" in Image::Base for behaviour inherited from the superclasses.
$image = Image::Base::X11::Protocol::Window->new (key=>value,...)
Create and return a new image object. This requires an
X11::Protocol connection object and window XID (an integer).
$image = Image::Base::X11::Protocol::Window->new (-X => $x11_protocol_obj, -window => $win_xid);
-colormap is set from the window's current colormap attribute, or pass a value to save a server round-trip if you know it already or if you want a different colormap.
There's nothing to create a new X window since there's many settings for it and they seem outside the scope of this wrapper.
The target window.
-window access the same attribute.
Changing these resizes the window per
ConfigureWindow. See the base Drawable class for the way fetching uses
The maximum size allowed by the protocol in various places is 32767x32767, and the minimum is 1x1. When creating or resizing currently the sizes end up chopped by Perl's
pack to a signed 16 bits, which means 32768 to 65535 results in an X protocol error (being negatives), but for instance 65546 wraps around to 10 and will seem to work.
In the current code a window size change made outside this wrapper (including perhaps by the user through the window manager) is not noticed by the wrapper and
-height remain as the cached values. A
GetGeometry for every
get() would be the only way to be sure of the right values, but a server query every time would likely be very slow for generic image code designed for in-memory images, and of course most of the time the window size doesn't change.
Changing this doesn't change the window's colormap attribute, it's just where the drawing operations should allocate colours.
Image-Base-X11-Protocol is Copyright 2010, 2011, 2012, 2013 Kevin Ryde
Image-Base-X11-Protocol 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.
Image-Base-X11-Protocol 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 Image-Base-X11-Protocol. If not, see <http://www.gnu.org/licenses/>.