line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSON::Karabiner::Rule ; |
2
|
|
|
|
|
|
|
$JSON::Karabiner::Rule::VERSION = '0.018'; |
3
|
19
|
|
|
19
|
|
135
|
use strict; |
|
19
|
|
|
|
|
44
|
|
|
19
|
|
|
|
|
568
|
|
4
|
19
|
|
|
19
|
|
98
|
use warnings; |
|
19
|
|
|
|
|
35
|
|
|
19
|
|
|
|
|
631
|
|
5
|
|
|
|
|
|
|
require JSON::Karabiner::Manipulator ; |
6
|
19
|
|
|
19
|
|
115
|
use Carp; |
|
19
|
|
|
|
|
37
|
|
|
19
|
|
|
|
|
5048
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
28
|
|
|
28
|
1
|
62
|
my $class = shift; |
10
|
28
|
|
|
|
|
50
|
my $desc = shift; |
11
|
28
|
50
|
|
|
|
68
|
croak 'JSON::Karabiner constructor requires a desc.' if !$desc; |
12
|
28
|
|
|
|
|
127
|
my $self = { |
13
|
|
|
|
|
|
|
description => $desc, |
14
|
|
|
|
|
|
|
manipulators => [] |
15
|
|
|
|
|
|
|
}; |
16
|
28
|
|
|
|
|
69
|
bless $self, $class; |
17
|
28
|
|
|
|
|
69
|
return $self; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub _disable_validity_tests { |
21
|
42
|
|
|
42
|
|
71
|
my $s = shift; |
22
|
42
|
|
|
|
|
76
|
my $enable = shift; |
23
|
|
|
|
|
|
|
|
24
|
42
|
100
|
|
|
|
136
|
my $op = $enable ? 0 : 1; |
25
|
42
|
|
|
|
|
165
|
foreach my $manip (@{$s->{manipulators}}) { |
|
42
|
|
|
|
|
125
|
|
26
|
42
|
|
|
|
|
1862
|
$manip->{_disable_validity_tests} = $op; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub _enable_validity_tests { |
31
|
21
|
|
|
21
|
|
59
|
my $s = shift; |
32
|
21
|
|
|
|
|
70
|
$s->_disable_validity_tests(1); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub add_manipulator { |
36
|
27
|
|
|
27
|
1
|
433
|
my $s = shift; |
37
|
|
|
|
|
|
|
|
38
|
27
|
|
|
|
|
158
|
my $manip = JSON::Karabiner::Manipulator->new_manipulator(); |
39
|
27
|
|
|
|
|
60
|
push @{$s->{manipulators}}, $manip; |
|
27
|
|
|
|
|
108
|
|
40
|
27
|
|
|
|
|
73
|
return $manip; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
24
|
|
|
24
|
0
|
58
|
sub TO_JSON { return { %{ shift() } }; } |
|
24
|
|
|
|
|
208
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# ABSTRACT: Rule object for holding manipulators |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |