File Coverage

blib/lib/X11/Muralis/Backend/Xloadimage.pm
Criterion Covered Total %
statement 6 25 24.0
branch 0 16 0.0
condition 0 3 0.0
subroutine 2 4 50.0
pod 2 2 100.0
total 10 50 20.0


line stmt bran cond sub pod time code
1             package X11::Muralis::Backend::Xloadimage;
2             $X11::Muralis::Backend::Xloadimage::VERSION = '0.1002';
3 2     2   3009 use strict;
  2         3  
  2         44  
4 2     2   6 use warnings;
  2         3  
  2         419  
5              
6             our @ISA = qw(X11::Muralis::Backend);
7              
8             =head1 NAME
9              
10             X11::Muralis::Backend:Xloadimage - use xloadimage to display images on the desktop.
11              
12             =head1 VERSION
13              
14             version 0.1002
15              
16             =head1 SYNOPSIS
17              
18             muralis --use Xloadimage
19              
20             =head1 DESCRIPTION
21              
22             This is a backend for muralis which uses the xloadimage program
23             to display images on the desktop.
24              
25             =cut
26              
27             =head1 METHODS
28              
29             =head2 new
30              
31             =cut
32              
33             sub new {
34 0     0 1   my $class = shift;
35 0           my %parameters =
36             (
37             prog => 'xloadimage',
38             can_do => {
39             tile => 1,
40             fullscreen => 1,
41             centre => 1,
42             zoom => 1,
43             colours => 1,
44             window => 1,
45             'option:smooth' => 1,
46             },
47             @_
48             );
49 0   0       my $self = bless ({%parameters}, ref ($class) || $class);
50 0           return ($self);
51             } # new
52              
53             =head2 display
54              
55             $self->display($filename, %args);
56              
57             =cut
58              
59             sub display {
60 0     0 1   my $class = shift;
61 0           my $filename = shift;
62 0           my %args = (
63             @_
64             );
65              
66 0           my $options = '';
67 0 0         $options .= " -tile" if $args{tile};
68 0 0         $options .= " -fullscreen -border black" if $args{fullscreen};
69 0 0         $options .= " -center" if $args{center};
70 0 0         $options .= " -colors " . $args{colors} if $args{colors};
71 0 0         $options .= " -zoom " . $args{zoom} if $args{zoom};
72 0 0         $options = $args{option} . ' ' . $options if $args{option};
73 0           my $window = '-onroot';
74 0 0         $window = "-windowid $args{window}" if $args{window};
75 0           my $command = "xloadimage $window $options '$filename'";
76 0 0         print STDERR $command, "\n" if $args{verbose};
77 0           system($command);
78             } # display
79              
80             =head1 REQUIRES
81              
82             Test::More
83              
84             =head1 INSTALLATION
85              
86             To install this module, run the following commands:
87              
88             perl Build.PL
89             ./Build
90             ./Build test
91             ./Build install
92              
93             Or, if you're on a platform (like DOS or Windows) that doesn't like the
94             "./" notation, you can do this:
95              
96             perl Build.PL
97             perl Build
98             perl Build test
99             perl Build install
100              
101             In order to install somewhere other than the default, such as
102             in a directory under your home directory, like "/home/fred/perl"
103             go
104              
105             perl Build.PL --install_base /home/fred/perl
106              
107             as the first step instead.
108              
109             This will install the files underneath /home/fred/perl.
110              
111             You will then need to make sure that you alter the PERL5LIB variable to
112             find the modules, and the PATH variable to find the script.
113              
114             Therefore you will need to change:
115             your path, to include /home/fred/perl/script (where the script will be)
116              
117             PATH=/home/fred/perl/script:${PATH}
118              
119             the PERL5LIB variable to add /home/fred/perl/lib
120              
121             PERL5LIB=/home/fred/perl/lib:${PERL5LIB}
122              
123             =head1 SEE ALSO
124              
125             perl(1).
126              
127             =head1 BUGS
128              
129             Please report any bugs or feature requests to the author.
130              
131             =head1 AUTHOR
132              
133             Kathryn Andersen RUBYKAT
134             perlkat AT katspace DOT org
135             www.katspace.org
136              
137             =head1 COPYRIGHT AND LICENCE
138              
139             Copyright (c) 2008 by Kathryn Andersen
140              
141             This program is free software; you can redistribute it and/or modify it
142             under the same terms as Perl itself.
143              
144             =cut
145              
146             1; # End of X11::Muralis::Backend::Xloadimage
147             __END__