=pod

=head1 NAME

FLTK::ShapedWindow - Custom shaped window

=head1 Description

This window's shape is clipped to an area defined by the alpha from an
L<Image|FLTK::Image> object. Current implementation insists that this be an
L<FLTK::xbmImage|FLTK::xbmImage>, which limits you to 1-bit alpha which must
be supplied by the program. It should not be hard to modify this on newer
systems to accept an arbitrary L<Image|FLTK::Image>.

The layout and widgets inside are unaware of the mask shape, and most will act
as though the bounding box is available to them. Therefore this window type is
usally sublassed or occupied by a single widget.

If the window will be short-lived and does not have to move, you may be much
better off using a L<MenuWindow|FLTK::MenuWindow>. This is a normal window but
with no border and no pixels are changed unless you draw into them. Thus you
can get arbitrary shapes by the simple expediency of not drawing where it
should be "transparent".

The window borders and caption created by the window system are turned off by
default for a L<ShapedWindow|FLTK::ShapedWindow> object. They can be
re-enabled by calling L<C<Window::border( $set )>|FLTK::Window/"border">.

=head1 Functions

=head2 C<new>
X<new>

=over

=item C<my $self = $shapedwindow-E<gt>new( $x, $y, $w, $h, $label );>X<my_self_shapedwindow_E_gt_new_x_y_w_h_label_>

Creates a new L<FLTK::ShapedWindow|FLTK::ShapedWindow> widget.

=for hackers xs/ShapedWindow.xs line 49

=back

=head2 C<shape>
X<shape>

=over

=item C<$shapedwindow-E<gt>shape( $img );>X<_shapedwindow_E_gt_shape_img_>

The alpha channel of the supplied image is used as the shape of the window. A
pointer to the image is stored, so it must remain in existence until
L<C<shape( )>|FLTK::ShapedWindow/"shape"> is called again or the
L<ShapedWindow|FLTK::ShapedWindow> is destroyed.

If you want your window to resize you should subclass and make a
C<layout( )> method that draws a new image and calls
L<C<shape( )>|FLTK::ShapedWindow/"shape">.

=pod 

=for hackers xs/ShapedWindow.xs line 86

=back

=head1 Author

Sanko Robinson <sanko@cpan.org> - http://sankorobinson.com/

=head1 License and Legal

Copyright (C) 2008-2010 by Sanko Robinson <sanko@cpan.org>

This program is free software; you can redistribute it and/or modify it under
the terms of
L<The Artistic License 2.0|http://www.perlfoundation.org/artistic_license_2_0>.
See the F<LICENSE> file included with this distribution or
L<notes on the Artistic License 2.0|http://www.perlfoundation.org/artistic_2_0_notes>
for clarification.

When separated from the distribution, all original POD documentation is
covered by the
L<Creative Commons Attribution-Share Alike 3.0 License|http://creativecommons.org/licenses/by-sa/3.0/us/legalcode>.
See the
L<clarification of the CCA-SA3.0|http://creativecommons.org/licenses/by-sa/3.0/us/>.


=for git $Id: ShapedWindow.xs 7483df2 2011-04-09 05:42:22Z sanko@cpan.org $

=cut