| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Growl::Any::DesktopNotify; |
|
2
|
3
|
|
|
3
|
|
14
|
use strict; |
|
|
3
|
|
|
|
|
5
|
|
|
|
3
|
|
|
|
|
96
|
|
|
3
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
|
3
|
|
|
|
|
6
|
|
|
|
3
|
|
|
|
|
77
|
|
|
4
|
3
|
|
|
3
|
|
13
|
use parent qw(Growl::Any::Base); |
|
|
3
|
|
|
|
|
3
|
|
|
|
3
|
|
|
|
|
15
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
178
|
use Carp (); |
|
|
3
|
|
|
|
|
6
|
|
|
|
3
|
|
|
|
|
50
|
|
|
7
|
3
|
|
|
3
|
|
923
|
use Desktop::Notify (); |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
174
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub register { |
|
10
|
0
|
|
|
0
|
0
|
|
my ($self, $appname, $events) = @_; |
|
11
|
0
|
|
|
|
|
|
$self->SUPER::register($appname, $events); |
|
12
|
0
|
|
|
|
|
|
$self->{instance} = Desktop::Notify->new( |
|
13
|
|
|
|
|
|
|
"app_name" => $self->appname, |
|
14
|
|
|
|
|
|
|
); |
|
15
|
|
|
|
|
|
|
} |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub notify { |
|
18
|
0
|
|
|
0
|
0
|
|
my ($self, $event, $title, $message, $icon) = @_; |
|
19
|
0
|
0
|
|
|
|
|
$icon = $self->icon_file($icon) if defined $icon; |
|
20
|
0
|
|
|
|
|
|
my $notify = $self->{instance}->create( |
|
21
|
|
|
|
|
|
|
body => $self->encode($message), |
|
22
|
|
|
|
|
|
|
summary => $self->encode($title), |
|
23
|
|
|
|
|
|
|
timeout => 5000, |
|
24
|
|
|
|
|
|
|
app_icon => $icon, |
|
25
|
|
|
|
|
|
|
); |
|
26
|
0
|
|
|
|
|
|
$notify->show(); |
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
|
30
|
|
|
|
|
|
|
__END__ |