Muralis/Backend/Xloadimage.pm

filter: Statementstmt 32.1% 9 / 28 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 23.6% 13 / 55 CC 10 SCAR 41.5
CC
10
Cov
19%
display
90.0
new
6.0
BEGIN
1.0
CRAP 63.4
« Muralis.pm ↑ Summary Muralis/Backend/Xsri.pm »
1 package X11::Muralis::Backend::Xloadimage;
2 3 $X11::Muralis::Backend::Xloadimage::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:Xloadimage - use xloadimage to display images on the desktop.
11  
12 =head1 VERSION
13  
14 version 0.1003
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 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 => '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 ▶ 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
50 0 return ($self);
51 } # new
52  
53 =head2 display
54  
55 $self->display($filename, %args);
56  
57 =cut
58  
59 0 ▶sub display {
Subroutine display: not called CC=9 SCAR=45.0
Pod documented
60 0 my $class = shift;
61 0 my $filename = shift;
62 0 my %args = (
63 @_
64 );
65  
66 0 my $options = '';
67 0 ▶ $options .= " -tile" if $args{tile};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"tile"} 0 0 0
68 0 ▶ $options .= " -fullscreen -border black" if $args{fullscreen};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"fullscreen"} 0 0 0
69 0 ▶ $options .= " -center" if $args{center};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"center"} 0 0 0
70 0 ▶ $options .= " -colors " . $args{colors} if $args{colors};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"colors"} 0 0 0
71 0 ▶ $options .= " -zoom " . $args{zoom} if $args{zoom};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"zoom"} 0 0 0
72 0 ▶ $options = $args{option} . ' ' . $options if $args{option};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"option"} 0 0 0
73 0 my $window = '-onroot';
74 0 ▶ $window = "-windowid $args{window}" if $args{window};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"window"} 0 0 0
75 0 my $command = "xloadimage $window $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 3 1; # End of X11::Muralis::Backend::Xloadimage
147 __END__
« Muralis.pm ↑ Summary Muralis/Backend/Xsri.pm »