line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MSIE::MenuExt; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
47902
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
84
|
|
4
|
2
|
|
|
2
|
|
11
|
use vars qw($VERSION); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
143
|
|
5
|
|
|
|
|
|
|
$VERSION = 0.02; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
require Exporter; |
8
|
2
|
|
|
2
|
|
12
|
use base qw(Exporter); |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
289
|
|
9
|
2
|
|
|
2
|
|
21
|
use vars qw(@EXPORT); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
135
|
|
10
|
|
|
|
|
|
|
@EXPORT = qw( |
11
|
|
|
|
|
|
|
MENUEXT_DEFAULT |
12
|
|
|
|
|
|
|
MENUEXT_IMAGES |
13
|
|
|
|
|
|
|
MENUEXT_CONTROLS |
14
|
|
|
|
|
|
|
MENUEXT_TABLES |
15
|
|
|
|
|
|
|
MENUEXT_TEXT_SELECTIONS |
16
|
|
|
|
|
|
|
MENUEXT_ANCHORS |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
2
|
|
|
2
|
|
14
|
use constant MENUEXT_DEFAULT => hex(1); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
213
|
|
20
|
2
|
|
|
2
|
|
11
|
use constant MENUEXT_IMAGES => hex(2); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
106
|
|
21
|
2
|
|
|
2
|
|
18
|
use constant MENUEXT_CONTROLS => hex(4); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
93
|
|
22
|
2
|
|
|
2
|
|
11
|
use constant MENUEXT_TABLES => hex(8); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
116
|
|
23
|
2
|
|
|
2
|
|
11
|
use constant MENUEXT_TEXT_SELECTIONS => hex(10); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
89
|
|
24
|
2
|
|
|
2
|
|
24
|
use constant MENUEXT_ANCHORS => hex(20); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
569
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub new { |
27
|
0
|
|
|
0
|
|
|
my $class = shift; |
28
|
0
|
|
|
|
|
|
my $self = bless { |
29
|
|
|
|
|
|
|
actions => [], |
30
|
|
|
|
|
|
|
}, $class; |
31
|
0
|
0
|
|
|
|
|
if (@_) { |
32
|
0
|
|
|
|
|
|
$self->add_action($_) for @_; |
33
|
|
|
|
|
|
|
} |
34
|
0
|
|
|
|
|
|
return $self; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub add_action { |
38
|
0
|
|
|
0
|
|
|
my($self, $action) = @_; |
39
|
0
|
|
|
|
|
|
push @{$self->{actions}}, $action; |
|
0
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub clear_action { |
43
|
0
|
|
|
0
|
|
|
my $self = shift; |
44
|
0
|
|
|
|
|
|
$self->{actions} = []; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub content { |
48
|
0
|
|
|
0
|
|
|
my $self = shift; |
49
|
0
|
|
|
|
|
|
return "REGEDIT4\r\n" . join "\r\n\r\n", map $_->content, @{$self->{actions}}; |
|
0
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
package MSIE::MenuExt::Action; |
53
|
2
|
|
|
2
|
|
13
|
use base qw(Class::Accessor); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
3037
|
|
54
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw(title accesskey action context)); |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
my $template; |
57
|
|
|
|
|
|
|
BEGIN { |
58
|
|
|
|
|
|
|
$template = <<'EOF'; |
59
|
|
|
|
|
|
|
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\%s] |
60
|
|
|
|
|
|
|
@="%s" |
61
|
|
|
|
|
|
|
"contexts"=hex:%02x |
62
|
|
|
|
|
|
|
EOF |
63
|
|
|
|
|
|
|
; |
64
|
|
|
|
|
|
|
$template =~ s/\n/\r\n/g; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub content { |
68
|
|
|
|
|
|
|
my $self = shift; |
69
|
|
|
|
|
|
|
my $title = $self->title; |
70
|
|
|
|
|
|
|
my $accesskey = $self->accesskey || substr($title, 0, 1); |
71
|
|
|
|
|
|
|
$title =~ s/$accesskey/&$accesskey/; |
72
|
|
|
|
|
|
|
return sprintf $template, $title, $self->action, $self->context; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1; |
76
|
|
|
|
|
|
|
__END__ |