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