line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package UI::Various::PoorTerm::container; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Author, Copyright and License: see end of file |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
UI::Various::PoorTerm::container - abstract helper class for PoorTerm's container UI elements |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 SYNOPSIS |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# This module should only be used by the container UI element classes of |
12
|
|
|
|
|
|
|
# UI::Various::PoorTerm! |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 ABSTRACT |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
This module provides some helper functions for the container UI elements of |
17
|
|
|
|
|
|
|
the minimal fallback UI. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 DESCRIPTION |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
The documentation of this module is only intended for developers of the |
22
|
|
|
|
|
|
|
package itself. |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
All functions of the module will be included as second "base class" (in |
25
|
|
|
|
|
|
|
C<@ISA>) like (and instead of) C>. |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head2 Attributes |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=over |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=item _active |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Container elements may contain a reference to an array containing only the |
34
|
|
|
|
|
|
|
references to the active UI elements (those that are accessible, basically |
35
|
|
|
|
|
|
|
everything not just a simple text output). |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=back |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=cut |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
######################################################################### |
42
|
|
|
|
|
|
|
|
43
|
4
|
|
|
4
|
|
43
|
use v5.14; |
|
4
|
|
|
|
|
9
|
|
44
|
4
|
|
|
4
|
|
18
|
use strictures; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
17
|
|
45
|
4
|
|
|
4
|
|
549
|
no indirect 'fatal'; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
17
|
|
46
|
4
|
|
|
4
|
|
227
|
no multidimensional; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
16
|
|
47
|
4
|
|
|
4
|
|
111
|
use warnings 'once'; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
201
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
our $VERSION = '0.24'; |
50
|
|
|
|
|
|
|
|
51
|
4
|
|
|
4
|
|
33
|
use UI::Various::core; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
29
|
|
52
|
4
|
|
|
4
|
|
363
|
use UI::Various::PoorTerm::base; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
978
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
require Exporter; |
55
|
|
|
|
|
|
|
our @ISA = qw(UI::Various::PoorTerm::base); |
56
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
######################################################################### |
59
|
|
|
|
|
|
|
######################################################################### |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 METHODS |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
The module provides the following common (internal) methods for all |
64
|
|
|
|
|
|
|
UI::Various::PoorTerm container UI element classes: |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
######################################################################### |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head2 B<_self_destruct> - remove children and self-destruct |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
$ui_element->_self_destruct; |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head3 description: |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Remove all children (to get rid of possible circular references) and remove |
77
|
|
|
|
|
|
|
itself from "Window Manager" C>. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=cut |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub _self_destruct($) |
84
|
|
|
|
|
|
|
{ |
85
|
18
|
|
|
18
|
|
2940
|
my ($self) = @_; |
86
|
18
|
|
|
|
|
30
|
local $_; |
87
|
|
|
|
|
|
|
|
88
|
18
|
100
|
|
|
|
55
|
defined $self->{_active} and delete $self->{_active}; |
89
|
18
|
|
|
|
|
51
|
while ($_ = $self->child) |
90
|
|
|
|
|
|
|
{ |
91
|
59
|
100
|
|
|
|
224
|
if ($_->can('_self_destruct')) |
92
|
2
|
|
|
|
|
13
|
{ $_->_self_destruct; } |
93
|
|
|
|
|
|
|
else |
94
|
57
|
|
|
|
|
120
|
{ $self->remove($_); } |
95
|
|
|
|
|
|
|
} |
96
|
18
|
|
|
|
|
45
|
$self->parent->remove($self); |
97
|
18
|
|
|
|
|
53
|
$self = undef; |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
1; |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
######################################################################### |
103
|
|
|
|
|
|
|
######################################################################### |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 SEE ALSO |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
L |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head1 LICENSE |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
Copyright (C) Thomas Dorner. |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify it |
114
|
|
|
|
|
|
|
under the same terms as Perl itself. See LICENSE file for more details. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head1 AUTHOR |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
Thomas Dorner Edorner (at) cpan (dot) orgE |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=cut |