| 1 | package X11::WM::Sawfish; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | # Copyright (C) 2003 Craig B. Agricola. All rights reserved. This library is | ||||||||||||||||||||||||||||
| 4 | # free software; you can redistribute it and/or modify it under the same terms | ||||||||||||||||||||||||||||
| 5 | # as Perl itself. | ||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use 5.005; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 1 | require Exporter; | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 1 | our @ISA = qw(Exporter); | |||||||||||||||||||||||||||
| 14 | 1 | our @EXPORT_OK = qw(); | |||||||||||||||||||||||||||
| 15 | 1 | our @EXPORT = qw(); | |||||||||||||||||||||||||||
| 16 | 1 | our $VERSION = '0.03'; | |||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 1 | ▶ | use Sys::Hostname; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 1 | ▶ | use X11::WM::Sawfish::UNIX; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 21 | 1 | ▶ | use X11::WM::Sawfish::XProp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 0 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||
| 24 | 0 | my $package = shift(@_); | |||||||||||||||||||||||||||
| 25 | 0 | ▶ | $package = ref($package) || $package; | ||||||||||||||||||||||||||
|
Condition0%0/3
ref $package || $package
MC/DC0%0/2
ref $package || $package
ref $package
$package
Truth table0%0/3
A || B
A= ref $packageB= $package
| |||||||||||||||||||||||||||||
| 26 | 0 | my ($self) = new X11::WM::Sawfish::UNIX(@_); | |||||||||||||||||||||||||||
| 27 | 0 | ▶ | if (!defined($self)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 28 | 0 | $self = new X11::WM::Sawfish::XProp(@_); | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | 0 | return($self); | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 0 | ▶ | sub canonical_display_name { | ||||||||||||||||||||||||||
|
Subroutine
canonical_display_name: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 34 | 0 | my ($display) = @_; | |||||||||||||||||||||||||||
| 35 | 0 | ▶ | if (!defined($display)) { $display = $ENV{"DISPLAY"}; } | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 36 | 0 | $display =~ s/^unix:/:/; | |||||||||||||||||||||||||||
| 37 | 0 | ▶ | if (substr($display, 0, 1) eq ":") { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 38 | 0 | $display = hostname() . $display; | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | 0 | my $i = index($display, ":"); | |||||||||||||||||||||||||||
| 41 | 0 | ▶ | if (($i > -1) && (index($display, ".", $i) == -1)) | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$i > -1 and (index($display, ".", $i) == -1)
MC/DC0%0/2
$i > -1 and (index($display, ".", $i) == -1)
$i > -1
(index($display, ".", $i) == -1)
Truth table0%0/3
A and B
A= $i > -1B= (index($display, ".", $i) == -1)
| |||||||||||||||||||||||||||||
| 42 | { | ||||||||||||||||||||||||||||
| 43 | 0 | $display .= ".0"; | |||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||
| 45 | 0 | return($display); | |||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | 0 | ▶ | sub sawfish_socket_name { | ||||||||||||||||||||||||||
|
Subroutine
sawfish_socket_name: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 49 | 0 | my ($display) = @_; | |||||||||||||||||||||||||||
| 50 | 0 | my $socket = sprintf("/tmp/.sawfish-%s/%s", | |||||||||||||||||||||||||||
| 51 | (getpwuid($<))[0], canonical_display_name($display)); | ||||||||||||||||||||||||||||
| 52 | 0 | return($socket); | |||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 0 | ▶ | sub get_server_version { | ||||||||||||||||||||||||||
|
Subroutine
get_server_version: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 56 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||
| 57 | 0 | my ($response) = $self->eval_form("sawfish-version"); | |||||||||||||||||||||||||||
| 58 | 0 | ▶ | if (defined($response)) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 59 | 0 | $response =~ s#^"##; | |||||||||||||||||||||||||||
| 60 | 0 | $response =~ s#"$##; | |||||||||||||||||||||||||||
| 61 | 0 | $self->{ServerVersion} = $response; | |||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||
| 63 | 0 | return($response); | |||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||
| 66 | 0 | ▶ | sub ServerVersion { | ||||||||||||||||||||||||||
|
Subroutine
ServerVersion: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 67 | 0 | return($_[0]->{ServerVersion}); | |||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | 1 | 1; | |||||||||||||||||||||||||||
| 71 | __END__ | ||||||||||||||||||||||||||||