line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Gtk2::Ex::MindMapView::Layout::Group; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.000001'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
26
|
|
6
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
26
|
|
7
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
59
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
5
|
use constant COLUMN_MAX_WIDTH=>400; # pixels |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
56
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
6
|
use constant PAD_HEIGHT=>10; # pixels |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
5
|
use constant PAD_WIDTH=>30; # pixels |
|
1
|
|
|
|
|
21
|
|
|
1
|
|
|
|
|
579
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new |
16
|
|
|
|
|
|
|
{ |
17
|
0
|
|
|
0
|
1
|
|
my $class = shift(@_); |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
my %args = @_; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
my $self = \%args; |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
bless $self, $class; |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
_zero($self, qw(x y height width)); |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
return $self; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# my @values = $group->get(qw(x y width height)); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub get |
34
|
|
|
|
|
|
|
{ |
35
|
0
|
|
|
0
|
1
|
|
my $self = shift(@_); |
36
|
|
|
|
|
|
|
|
37
|
0
|
0
|
|
|
|
|
return undef if (scalar @_ == 0); |
38
|
|
|
|
|
|
|
|
39
|
0
|
0
|
|
|
|
|
return _get($self,shift(@_)) if (scalar @_ == 1); |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
my @values = (); |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
|
|
|
foreach my $key (@_) { push @values, _get($self,$key); } |
|
0
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
return @values; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# $group->get_horizontal_padding(); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub get_horizontal_padding() |
52
|
|
|
|
|
|
|
{ |
53
|
0
|
|
|
0
|
1
|
|
return PAD_WIDTH; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
# $group->get_max_width(); |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub get_max_width |
60
|
|
|
|
|
|
|
{ |
61
|
0
|
|
|
0
|
1
|
|
return COLUMN_MAX_WIDTH; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
# $group->get_vertical_padding(); |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub get_vertical_padding() |
68
|
|
|
|
|
|
|
{ |
69
|
0
|
|
|
0
|
1
|
|
return PAD_HEIGHT; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
# $group->set(x=>0, y=>10, width=>20, height=>30); |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub set |
76
|
|
|
|
|
|
|
{ |
77
|
0
|
|
|
0
|
1
|
|
my $self = shift(@_); |
78
|
|
|
|
|
|
|
|
79
|
0
|
|
|
|
|
|
my %args = @_; |
80
|
|
|
|
|
|
|
|
81
|
0
|
|
|
|
|
|
foreach my $key (keys %args) |
82
|
|
|
|
|
|
|
{ |
83
|
0
|
|
|
|
|
|
$self->{$key} = $args{$key}; |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub _get |
89
|
|
|
|
|
|
|
{ |
90
|
0
|
|
|
0
|
|
|
my ($self, $key) = @_; |
91
|
|
|
|
|
|
|
|
92
|
0
|
|
|
|
|
|
my $value = $self->{$key}; |
93
|
|
|
|
|
|
|
|
94
|
0
|
0
|
|
|
|
|
croak "Undefined value for key $key.\n" if (!defined $value); |
95
|
|
|
|
|
|
|
|
96
|
0
|
|
|
|
|
|
return $value; |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
sub _zero |
101
|
|
|
|
|
|
|
{ |
102
|
0
|
|
|
0
|
|
|
my $self = shift(@_); |
103
|
|
|
|
|
|
|
|
104
|
0
|
|
|
|
|
|
foreach my $arg (@_) |
105
|
|
|
|
|
|
|
{ |
106
|
0
|
0
|
|
|
|
|
if (!defined $self->{$arg}) { $self->{$arg} = 0; } |
|
0
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
1; # Magic true value required at end of module |
113
|
|
|
|
|
|
|
__END__ |