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
« Muralis/Backend/Xloadimage.pm ↑ Summary Muralis/Backend/Hsetroot.pm »
1 package X11::Muralis::Backend::Xsri;
2 3 $X11::Muralis::Backend::Xsri::VERSION = '0.1003';
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 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 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod documented
34 0 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 ▶ 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
48 0 return ($self);
49 } # new
50  
51 =head2 display
52  
53 $self->display($filename, %args);
54  
55 =cut
56  
57 0 ▶sub display {
Subroutine display: not called CC=9 SCAR=45.0
Pod documented
58 0 my $class = shift;
59 0 my $filename = shift;
60 0 my %args = (
61 @_
62 );
63  
64 0 my $options = '';
65 0 ▶ $options = " --tile" if $args{tile};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"tile"} 0 0 0
66 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
67 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
68 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
69 0 ▶ $options = " --color black --center-x --center-y --emblem" if $args{center};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"center"} 0 0 0
70 0 ▶ $options = " --tile" if (!$options);
Branch: 1 branch
BranchTrueFalseTotal
unless $options 0 0 0
71 0 ▶ $options = $args{option} . ' ' . $options if $args{option};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"option"} 0 0 0
72 0 my $command = "xsri $options '$filename'";
73 0 ▶ print STDERR $command, "\n" if $args{verbose};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"verbose"} 0 0 0
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 3 1; # End of X11::Muralis::Backend::Xsri
144 __END__
« Muralis/Backend/Xloadimage.pm ↑ Summary Muralis/Backend/Hsetroot.pm »