line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Gtk2::Ex::MindMapView::Border::Rectangle; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.000001'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
2165
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
37
|
|
6
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
81
|
|
7
|
1
|
|
|
1
|
|
8
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
77
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
6
|
use List::Util; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
56
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
433
|
use Gnome2::Canvas; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
use Gtk2::Ex::MindMapView::ArgUtils; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
use base 'Gtk2::Ex::MindMapView::Border'; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub new |
18
|
|
|
|
|
|
|
{ |
19
|
|
|
|
|
|
|
my $class = shift(@_); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my $self = $class->SUPER::new(@_); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
my %attributes = @_; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
args_valid(\%attributes, qw(group content x y width height width_pixels |
26
|
|
|
|
|
|
|
padding_pixels fill_color_gdk outline_color_gdk)); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
arg_default($self, "fill_color_gdk", Gtk2::Gdk::Color->parse('white')); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
arg_default($self, "outline_color_gdk", Gtk2::Gdk::Color->parse('gray')); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
$self->{border} = $self->border_get_image(); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
$self->{content}->set(anchor=>'north-west'); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
my ($top, $left, $bottom, $right) = $self->border_insets(); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
$self->{width} = $self->{content}->get('width') + ($left + $right); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
$self->{height} = $self->{content}->get('height') + ($top + $bottom); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
return $self; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
sub border_get_image |
47
|
|
|
|
|
|
|
{ |
48
|
|
|
|
|
|
|
my $self = shift(@_); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
return Gnome2::Canvas::Item->new($self->{group}, 'Gnome2::Canvas::Rect', |
51
|
|
|
|
|
|
|
'fill-color-gdk'=>$self->{fill_color_gdk}, |
52
|
|
|
|
|
|
|
'outline-color-gdk'=>$self->{outline_color_gdk}); |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub border_set_x |
57
|
|
|
|
|
|
|
{ |
58
|
|
|
|
|
|
|
my ($self, $value) = @_; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
$self->{border}->set(x1=>$value); |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
$self->{border}->set(x2=>$value + $self->{width}); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub border_set_y |
67
|
|
|
|
|
|
|
{ |
68
|
|
|
|
|
|
|
my ($self, $value) = @_; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
$self->{border}->set(y1=>$value); |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
$self->{border}->set(y2=>$value + $self->{height}); |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub border_set_width |
77
|
|
|
|
|
|
|
{ |
78
|
|
|
|
|
|
|
my ($self, $value) = @_; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
$self->{border}->set(x2=>$self->{x} + $value); |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub border_set_height |
85
|
|
|
|
|
|
|
{ |
86
|
|
|
|
|
|
|
my ($self, $value) = @_; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
$self->{border}->set(y2=>$self->{y} + $value); |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
sub border_set_param |
93
|
|
|
|
|
|
|
{ |
94
|
|
|
|
|
|
|
my ($self, $name, $value) = @_; |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
$self->{border}->set($name=>$value); |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
1; # Magic true value required at end of module |
102
|
|
|
|
|
|
|
__END__ |