blib/lib/X11/Muralis/Backend/Xsri.pm

filter: Statementstmt 33.3% 9 / 27 Branchbran 0.0% 0 / 16 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 2 / 4 Podpod 100% 2 / 2 totaltotal 24.0% 13 / 54 CC 10 SCAR 41.5
CC
10
Cov
20%
display
90.0
new
6.0
BEGIN
1.0
CRAP 63.4
« blib/lib/X11/Muralis/Backend/Xloadimage.pm ↑ Summary blib/lib/X11/Muralis/Backend/Hsetroot.pm »
1 package X11::Muralis::Backend::Xsri;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 our @ISA = qw(X11::Muralis::Backend);
6  
7 =head1 NAME
8  
9 X11::Muralis::Backend:Xsri - use xsri to display images on the desktop.
10  
11 =head1 VERSION
12  
13 This describes version B<0.1001> of X11::Muralis::Backend::Xsri.
14  
15 =cut
16  
17 1 our $VERSION = '0.1001';
18  
19 =head1 SYNOPSIS
20  
21 muralis --use Xsri
22  
23 =head1 DESCRIPTION
24  
25 This is a backend for muralis which uses the xsri program
26 to display images on the desktop.
27  
28 =cut
29  
30 =head1 METHODS
31  
32 =head2 new
33  
34 =cut
35  
36 sub new {
37 0 ▶ my $class = shift;
Subroutine new: not called CC=2 SCAR=17.9
Pod documented
38 0 my %parameters =
39 (
40 prog => 'xsri',
41 can_do => {
42 tile => 1,
43 fullscreen => 1,
44 centre => 1,
45 stretch => 1,
46 zoom => 1,
47 },
48 @_
49 );
50 0 ▶ my $self = bless ({%parameters}, ref ($class) || $class);
Condition0%0/3
ref $class || $class
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table0%0/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
51 0 return ($self);
52 } # new
53  
54 =head2 display
55  
56 $self->display($filename, %args);
57  
58 =cut
59  
60 sub display {
61 0 ▶ my $class = shift;
Subroutine display: not called CC=9 SCAR=45.0
Pod documented
62 0 my $filename = shift;
63 0 my %args = (
64 @_
65 );
66  
67 0 my $options = '';
68 0 ▶ $options = " --tile" if $args{tile};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"tile"} 0 0 0
69 0 ▶ $options = " --color black --scale-width=100 --scale-height=100 --keep-aspect --center-x --center-y --emblem" if $args{fullscreen};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"fullscreen"} 0 0 0
70 0 ▶ $options = " --color black --scale-width=100 --scale-height=100 --center-x --center-y --emblem" if $args{stretch};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"stretch"} 0 0 0
71 0 ▶ $options = " --color black --scale-width=$args{zoom} --scale-height=$args{zoom} --keep-aspect --emblem" if $args{zoom};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"zoom"} 0 0 0
72 0 ▶ $options = " --color black --center-x --center-y --emblem" if $args{center};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"center"} 0 0 0
73 0 ▶ $options = " --tile" if (!$options);
Branch: 1 branch
BranchTrueFalseTotal
unless $options 0 0 0
74 0 ▶ $options = $args{option} . ' ' . $options if $args{option};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"option"} 0 0 0
75 0 my $command = "xsri $options '$filename'";
76 0 ▶ print STDERR $command, "\n" if $args{verbose};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"verbose"} 0 0 0
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 1; # End of X11::Muralis::Backend::Xsri
147 __END__
« blib/lib/X11/Muralis/Backend/Xloadimage.pm ↑ Summary blib/lib/X11/Muralis/Backend/Hsetroot.pm »