line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package POE::XUL::Session; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
5
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
70
|
|
6
|
1
|
|
|
1
|
|
592
|
use POE::XUL::ChangeManager; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use POE::XUL::EventManager; |
8
|
|
|
|
|
|
|
use XUL::Node::Application; |
9
|
|
|
|
|
|
|
use Time::HiRes; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
#use XUL::Node::ChangeManager; |
12
|
|
|
|
|
|
|
#use XUL::Node::EventManager; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# public ---------------------------------------------------------------------- |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub new { |
17
|
|
|
|
|
|
|
my $class = shift; |
18
|
|
|
|
|
|
|
my $self = bless { |
19
|
|
|
|
|
|
|
change_manager => POE::XUL::ChangeManager->new, |
20
|
|
|
|
|
|
|
event_manager => POE::XUL::EventManager->new, |
21
|
|
|
|
|
|
|
# change_manager => XUL::Node::ChangeManager->new, |
22
|
|
|
|
|
|
|
# event_manager => XUL::Node::EventManager->new, |
23
|
|
|
|
|
|
|
start_time => Time::HiRes::time(), |
24
|
|
|
|
|
|
|
@_, |
25
|
|
|
|
|
|
|
}, $class; |
26
|
|
|
|
|
|
|
$self->change_manager->event_manager($self->event_manager); |
27
|
|
|
|
|
|
|
return $self; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub handle_boot { |
31
|
|
|
|
|
|
|
my ($self, $request) = @_; |
32
|
|
|
|
|
|
|
# look for a custom POE callback for this request |
33
|
|
|
|
|
|
|
if (exists($self->{apps}->{$request->{name}})) { |
34
|
|
|
|
|
|
|
return $self->run_and_flush($self->{apps}->{$request->{name}},$request,$self); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
# return '' if ($self->{opts}->{disable_others}); |
37
|
|
|
|
|
|
|
return $self->run_and_flush |
38
|
|
|
|
|
|
|
(XUL::Node::Application->get_constructor($request->{name})); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub handle_event { |
42
|
|
|
|
|
|
|
my ($self, $request) = @_; |
43
|
|
|
|
|
|
|
my $event = $self->make_event($request); |
44
|
|
|
|
|
|
|
return $self->run_and_flush(sub { $self->fire_event($event,$request,$self) },@_); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub destroy { |
48
|
|
|
|
|
|
|
my $self = shift; |
49
|
|
|
|
|
|
|
$self->{change_manager}->destroy; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
# private --------------------------------------------------------------------- |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
# these used to pop instead of @_ |
55
|
|
|
|
|
|
|
sub run_and_flush { shift->change_manager->run_and_flush(@_) } |
56
|
|
|
|
|
|
|
sub fire_event { shift->event_manager->fire_event(@_) } |
57
|
|
|
|
|
|
|
sub make_event { shift->event_manager->make_event(@_) } |
58
|
|
|
|
|
|
|
sub change_manager { shift->{change_manager} } |
59
|
|
|
|
|
|
|
sub event_manager { shift->{event_manager} } |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |