File Coverage

blib/lib/X11/Muralis/Backend/Xsri.pm
Criterion Covered Total %
statement 6 24 25.0
branch 0 16 0.0
condition 0 3 0.0
subroutine 2 4 50.0
pod 2 2 100.0
total 10 49 20.4


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