1package X11::Xlib::Pixmap;
2use strict;
3use warnings;
4use Carp;
5use parent 'X11::Xlib::XID';
6
7# All modules in dist share a version
8BEGIN { our $VERSION= $X11::Xlib::VERSION; }
9
10sub width  { croak "read-only" if @_ > 1; $_[0]{width} }
11sub height { croak "read-only" if @_ > 1; $_[0]{height} }
12sub depth  { croak "read-only" if @_ > 1; $_[0]{depth} }
13
14sub get_w_h { croak "read-only" if @_ > 1; $_[0]{width}, $_[0]{height} }
15
16sub DESTROY {
17    my $self= shift;
18    $self->display->XFreePixmap($self->xid)
19        if $self->autofree && $self->xid;
20}
21
221;
23
24__END__
25
26=head1 NAME
27
28X11::Xlib::Pixmap - XID wrapper for Pixmap
29
30=head1 DESCRIPTION
31
32Object representing a Pixmap remote X11 resource.
33
34There doesn't seem to be any way to query the attributes of a pixmap,
35so this object's attributes must be passed to the constructor.
36
37=head1 ATTRIBUTES
38
39See L<X11::Xlib::XID> for base-class attributes.
40
41=head2 width
42
43Width, in pixels
44
45=head2 height
46
47Height, in pixels
48
49=head2 depth
50
51Color depth, in bits.
52
53=head1 METHODS
54
55=head2 get_w_h
56
57  my ($w, $h)= $pixmap->get_w_h
58
59Reutrn the width and height of the pixmap as a list
60
61=head1 AUTHOR
62
63Olivier Thauvin, E<lt>nanardon@nanardon.zarb.orgE<gt>
64
65Michael Conrad, E<lt>mike@nrdvana.netE<gt>
66
67=head1 COPYRIGHT AND LICENSE
68
69Copyright (C) 2009-2010 by Olivier Thauvin
70
71Copyright (C) 2017 by Michael Conrad
72
73This library is free software; you can redistribute it and/or modify
74it under the same terms as Perl itself, either Perl version 5.10.0 or,
75at your option, any later version of Perl 5 you may have available.
76
77=cut
78