line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Devel::ebug::Wx::Plugin; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
4
|
1
|
|
|
1
|
|
4
|
use base qw(Exporter); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
600
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our @EXPORT_OK = qw(load_plugins MODIFY_CODE_ATTRIBUTES); |
7
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( manager => [ qw(load_plugins) ], |
8
|
|
|
|
|
|
|
plugin => [ qw(MODIFY_CODE_ATTRIBUTES) ], |
9
|
|
|
|
|
|
|
); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my %attributes; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub load_plugins { |
14
|
1
|
|
|
1
|
0
|
3
|
my( %args ) = @_; |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
|
|
914
|
require Module::Pluggable::Object; |
17
|
1
|
|
|
|
|
6718
|
Module::Pluggable::Object->new( %args, require => 1 )->plugins; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub MODIFY_CODE_ATTRIBUTES { |
21
|
4
|
|
|
4
|
|
211
|
my( $class, $code, @attrs ) = @_; |
22
|
4
|
|
|
|
|
8
|
my( @known, @unknown ); |
23
|
|
|
|
|
|
|
|
24
|
4
|
|
|
|
|
12
|
foreach ( @attrs ) { |
25
|
4
|
50
|
|
|
|
43
|
/^(?:Service|Command|View|Configuration|Configurable)\s*(?:$|\()/ ? |
26
|
|
|
|
|
|
|
push @known, $_ : push @unknown, $_; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
4
|
|
|
|
|
35
|
$attributes{$class}{$code} = [ $code, \@known ]; |
30
|
|
|
|
|
|
|
|
31
|
4
|
|
|
|
|
20
|
return @unknown; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
our $AUTOLOAD; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub AUTOLOAD { |
37
|
0
|
|
|
0
|
|
|
( my $method = $AUTOLOAD ) =~ s/.*:://; |
38
|
0
|
0
|
|
|
|
|
return if $method eq 'DESTROY'; |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
return _instantiators( $method ); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub _instantiators { |
44
|
0
|
|
|
0
|
|
|
my( $name ) = @_; |
45
|
0
|
|
|
|
|
|
$name =~ s/s$//; |
46
|
0
|
|
|
|
|
|
my $is_class = $name =~ s/_classe$//; |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
my @rv; |
49
|
0
|
|
|
|
|
|
foreach my $c ( keys %attributes ) { |
50
|
0
|
|
|
|
|
|
my $class = $c; |
51
|
0
|
|
|
|
|
|
foreach my $v ( values %{$attributes{$c}} ) { |
|
0
|
|
|
|
|
|
|
52
|
0
|
|
|
|
|
|
my( $code, $attrs ) = @$v; |
53
|
0
|
0
|
|
|
|
|
next unless grep lc( $_ ) eq $name, @$attrs; |
54
|
0
|
0
|
|
|
|
|
if( $is_class ) { |
55
|
0
|
|
|
|
|
|
push @rv, $class; |
56
|
|
|
|
|
|
|
} else { |
57
|
|
|
|
|
|
|
push @rv, sub { |
58
|
0
|
|
|
0
|
|
|
$code->( $class, @_ ); |
59
|
0
|
|
|
|
|
|
}; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
return @rv; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |