line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Growl::Any::NetGrowlClient; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
31
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
110
|
|
4
|
3
|
|
|
3
|
|
13
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
73
|
|
5
|
3
|
|
|
3
|
|
13
|
use parent qw(Growl::Any::Base); |
|
3
|
|
|
|
|
13
|
|
|
3
|
|
|
|
|
13
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
152
|
use Carp (); |
|
3
|
|
|
|
|
12
|
|
|
3
|
|
|
|
|
42
|
|
8
|
3
|
|
|
3
|
|
928
|
use Net::GrowlClient (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
197
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub register { |
11
|
0
|
|
|
0
|
0
|
|
my ($self, $appname, $events) = @_; |
12
|
0
|
|
|
|
|
|
$self->set_appname($appname); |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
|
|
|
$self->{instance} = Net::GrowlClient->init( |
15
|
|
|
|
|
|
|
CLIENT_TYPE_REGISTRATION => 0, |
16
|
|
|
|
|
|
|
CLIENT_TYPE_NOTIFICATION => 1, |
17
|
|
|
|
|
|
|
CLIENT_PASSWORD => $self->{password}, |
18
|
|
|
|
|
|
|
CLIENT_APPLICATION_NAME => $self->appname, |
19
|
0
|
|
|
|
|
|
CLIENT_NOTIFICATION_LIST => [ $self->encode_list(@{$events}), 'Error'], |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
}; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub notify { |
24
|
0
|
|
|
0
|
0
|
|
my ($self, $event, $title, $message, $icon) = @_; |
25
|
0
|
|
|
|
|
|
$self->{instance}->notify( |
26
|
|
|
|
|
|
|
title => $self->encode($title), |
27
|
|
|
|
|
|
|
message => $self->encode($message), |
28
|
|
|
|
|
|
|
notification => $self->encode($event), |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
__END__ |