NAME
Image::Base::X11::Protocol::Window -- draw into an X11::Protocol window
SYNOPSIS
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');
CLASS HIERARCHY
Image::Base::X11::Protocol::Window
is a subclass of Image::Base::X11::Protocol::Drawable
,
Image::Base
Image::Base::X11::Protocol::Drawable
Image::Base::X11::Protocol::Window
DESCRIPTION
Image::Base::X11::Protocol::Window
extends 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, making see-though holes. Is this worthwhile?
FUNCTIONS
$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 lots of settings for it and they seem outside the scope of this image wrapper.
ATTRIBUTES
-window
(XID integer)-
The target window.
-drawable
and-window
access the same attribute. -width
(integer)-height
(integer)-
Changing these resizes the window (
ConfigureWindow
). See the base Drawable class for the way fetching usesGetGeometry
.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
-width
and-height
remain as the cached values. AGetGeometry
for everyget
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. -colormap
(integer XID)-
Changing this doesn't change the window's colormap attribute, it's just where the drawing operations should allocate colours.
SEE ALSO
Image::Base, Image::Base::X11::Protocol::Drawable, Image::Base::X11::Protocol::Pixmap, X11::Protocol
HOME PAGE
http://user42.tuxfamily.org/image-base-x11-protocol/index.html
LICENSE
Image-Base-X11-Protocol is Copyright 2010 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/>.