line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#! perl |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
12
|
use v5.26; |
|
1
|
|
|
|
|
5
|
|
4
|
1
|
|
|
1
|
|
6
|
use Object::Pad; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
5
|
1
|
|
|
1
|
|
156
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
59
|
|
6
|
1
|
|
|
1
|
|
6
|
use utf8; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# Use this package as an intermediate to trace the actual operations. |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
class SVGPDF::PAST; |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
253
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6431
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
field $pdf :param; |
15
|
0
|
0
|
|
0
|
0
|
|
field $xo :accessor; |
|
0
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
field $indent; |
18
|
0
|
0
|
|
0
|
0
|
|
field $prog :accessor; |
|
0
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
0
|
0
|
|
method xdbg ( $fmt, @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
21
|
0
|
0
|
|
|
|
|
if ( $fmt =~ /\%/ ) { |
22
|
0
|
|
|
|
|
|
$prog .= $indent . sprintf( $fmt, @args) . "\n"; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
else { |
25
|
0
|
|
|
|
|
|
$prog .= $indent . join( "", $fmt, @args ) . "\n"; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
BUILD { |
30
|
|
|
|
|
|
|
$indent = $prog = ""; |
31
|
|
|
|
|
|
|
$xo = $pdf->xo_form; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
#### Coordinates |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
0
|
0
|
|
method bbox ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
$self->xdbg( "\$page->bbox( ", join(", ", @args ), " );" ); |
38
|
0
|
|
|
|
|
|
$xo->bbox( @args ); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
0
|
0
|
|
method transform ( %args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
my $tag = "\$xo->transform("; |
43
|
0
|
|
|
|
|
|
while ( my ($k,$v) = each %args ) { |
44
|
0
|
|
|
|
|
|
$tag .= " $k => "; |
45
|
0
|
0
|
|
|
|
|
if ( ref($v) eq 'ARRAY' ) { |
46
|
0
|
|
|
|
|
|
$tag .= "[ " . join(", ", @$v) . " ]"; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
else { |
49
|
0
|
|
|
|
|
|
$tag .= "\"$v\""; |
50
|
|
|
|
|
|
|
} |
51
|
0
|
|
|
|
|
|
$tag .= ", "; |
52
|
|
|
|
|
|
|
} |
53
|
0
|
|
|
|
|
|
substr( $tag, -2, 2, " );" ); |
54
|
0
|
|
|
|
|
|
$self->xdbg($tag); |
55
|
0
|
|
|
|
|
|
$xo->transform( %args ); |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
0
|
|
|
0
|
0
|
|
method matrix ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
59
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->matrix( ", join(", ", @args ), " );" ); |
60
|
0
|
|
|
|
|
|
$xo->matrix(@args); |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
#### Graphics. |
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
0
|
0
|
|
method fill ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
66
|
0
|
0
|
|
|
|
|
die if @args; |
67
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->fill();" ); |
68
|
0
|
|
|
|
|
|
$xo->fill( @args ); |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
0
|
|
|
0
|
0
|
|
method fill_color ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
72
|
0
|
0
|
|
|
|
|
Carp::confess("currentColor") if $args[0] eq 'currentColor'; |
73
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->fill_color( \"@args\" );" ); |
74
|
0
|
|
|
|
|
|
$xo->fill_color( @args ); |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
0
|
|
|
0
|
0
|
|
method line_cap ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
78
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->line_cap( ", join(", ", @args ), " );" ); |
79
|
0
|
|
|
|
|
|
$xo->line_cap( @args ); |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
0
|
|
|
0
|
0
|
|
method line_dash_pattern ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
83
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->line_dash_pattern( ", join(", ", @args ), " );" ); |
84
|
0
|
|
|
|
|
|
$xo->line_dash_pattern( @args ); |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
0
|
|
|
0
|
0
|
|
method line_join ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
88
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->line_join( ", join(", ", @args ), " );" ); |
89
|
0
|
|
|
|
|
|
$xo->line_join( @args ); |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
0
|
|
|
0
|
0
|
|
method line_width ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
93
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->line_width( ", join(", ", @args ), " );" ); |
94
|
0
|
|
|
|
|
|
$xo->line_width( @args ); |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
0
|
|
|
0
|
0
|
|
method paint ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
98
|
0
|
0
|
|
|
|
|
die if @args; |
99
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->paint();" ); |
100
|
0
|
|
|
|
|
|
$xo->paint( @args ); |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
0
|
|
|
0
|
0
|
|
method restore ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
104
|
0
|
0
|
|
|
|
|
die if @args; |
105
|
0
|
|
|
|
|
|
$indent = substr( $indent, 2 ); |
106
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->restore();" ); |
107
|
0
|
|
|
|
|
|
$xo->restore; |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
0
|
|
|
0
|
0
|
|
method save ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
111
|
0
|
0
|
|
|
|
|
die if @args; |
112
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->save();" ); |
113
|
0
|
|
|
|
|
|
$indent = "$indent "; |
114
|
0
|
|
|
|
|
|
$xo->save; |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
0
|
|
|
0
|
0
|
|
method stroke ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
118
|
0
|
0
|
|
|
|
|
die if @args; |
119
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->stroke();" ); |
120
|
0
|
|
|
|
|
|
$xo->stroke( @args ); |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
0
|
|
|
0
|
0
|
|
method stroke_color ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
124
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->stroke_color( \"@args\" );" ); |
125
|
0
|
|
|
|
|
|
$xo->stroke_color( @args ); |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
#### Texts, |
129
|
|
|
|
|
|
|
|
130
|
0
|
|
|
0
|
0
|
|
method font ( $font, $size, $name = "default" ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
131
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->font( \$font, $size );\t# $name" ); |
132
|
0
|
|
|
|
|
|
$xo->font( $font, $size ); |
133
|
|
|
|
|
|
|
} |
134
|
|
|
|
|
|
|
|
135
|
0
|
|
|
0
|
0
|
|
method text ( $text, %opts ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
136
|
0
|
|
|
|
|
|
my $t = $text; |
137
|
0
|
0
|
0
|
|
|
|
if ( length($t) == 1 && ord($t) > 255 ) { |
138
|
0
|
|
|
|
|
|
$t = sprintf("\\x{%04x}", ord($t)); |
139
|
|
|
|
|
|
|
} |
140
|
|
|
|
|
|
|
else { |
141
|
0
|
|
|
|
|
|
$t =~ s/(["\\\x{0}-\x{1f}\x{ff}-\x{ffff}])/sprintf("\\x{%x}", ord($1))/ge; |
|
0
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
} |
143
|
|
|
|
|
|
|
$self->xdbg( "\$xo->text( \"$t\", ", |
144
|
0
|
|
|
|
|
|
join( ", ", map { "$_ => \"$opts{$_}\"" } keys %opts ), |
|
0
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
" );" ); |
146
|
0
|
|
|
|
|
|
$xo->text( $text, %opts ); |
147
|
|
|
|
|
|
|
} |
148
|
|
|
|
|
|
|
|
149
|
0
|
|
|
0
|
0
|
|
method textstart ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
150
|
0
|
0
|
|
|
|
|
die if @args; |
151
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->textstart();" ); |
152
|
0
|
|
|
|
|
|
$xo->textstart( @args ); |
153
|
|
|
|
|
|
|
} |
154
|
|
|
|
|
|
|
|
155
|
0
|
|
|
0
|
0
|
|
method textend ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
156
|
0
|
0
|
|
|
|
|
die if @args; |
157
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->textend();" ); |
158
|
0
|
|
|
|
|
|
$xo->textend( @args ); |
159
|
|
|
|
|
|
|
} |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
#### Basic shapes. |
162
|
|
|
|
|
|
|
|
163
|
0
|
|
|
0
|
0
|
|
method circle ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
164
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->circle( ", join(", ",@args), " );" ); |
165
|
0
|
|
|
|
|
|
$xo->circle( @args ); |
166
|
|
|
|
|
|
|
} |
167
|
|
|
|
|
|
|
|
168
|
0
|
|
|
0
|
0
|
|
method ellipse ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
169
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->ellipse( ", join(", ",@args), " );" ); |
170
|
0
|
|
|
|
|
|
$xo->ellipse( @args ); |
171
|
|
|
|
|
|
|
} |
172
|
|
|
|
|
|
|
|
173
|
0
|
|
|
0
|
0
|
|
method image( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
174
|
0
|
|
|
|
|
|
my $image = shift(@args); |
175
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->image(, ", join(", ",@args), " );" ); |
176
|
0
|
|
|
|
|
|
$xo->image( $image, @args ); |
177
|
|
|
|
|
|
|
} |
178
|
|
|
|
|
|
|
|
179
|
0
|
|
|
0
|
0
|
|
method line ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
180
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->line( ", join(", ",@args), " );" ); |
181
|
0
|
|
|
|
|
|
$xo->line( @args ); |
182
|
|
|
|
|
|
|
} |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
# Note: polygon is a closed polyline. |
185
|
0
|
|
|
0
|
0
|
|
method polyline ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
186
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->polyline( ", join(", ",@args), " );" ); |
187
|
0
|
|
|
|
|
|
$xo->polyline( @args ); |
188
|
|
|
|
|
|
|
} |
189
|
|
|
|
|
|
|
|
190
|
0
|
|
|
0
|
0
|
|
method rect ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
191
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->rect( ", join(", ",@args), " );" ); |
192
|
0
|
|
|
|
|
|
$xo->rect( @args ); |
193
|
|
|
|
|
|
|
} |
194
|
|
|
|
|
|
|
|
195
|
0
|
|
|
0
|
0
|
|
method rectangle ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
196
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->rectangle( ", join(", ",@args), " );" ); |
197
|
0
|
|
|
|
|
|
$xo->rectangle( @args ); |
198
|
|
|
|
|
|
|
} |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
#### Paths. |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
#### NOT USED. |
203
|
0
|
|
|
0
|
0
|
|
method bogen ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
204
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->bogen( ", join(", ",@args), " );" ); |
205
|
0
|
|
|
|
|
|
$xo->bogen( @args ); |
206
|
|
|
|
|
|
|
} |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
#### NOT USED. |
209
|
0
|
|
|
0
|
0
|
|
method bogen_ellip ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
210
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->bogen_ellip( ", join(", ",@args), " );" ); |
211
|
0
|
|
|
|
|
|
$xo->bogen_ellip( @args ); |
212
|
|
|
|
|
|
|
} |
213
|
|
|
|
|
|
|
|
214
|
0
|
|
|
0
|
0
|
|
method close ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
215
|
0
|
0
|
|
|
|
|
die if @args; |
216
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->close();" ); |
217
|
0
|
|
|
|
|
|
$xo->close( @args ); |
218
|
|
|
|
|
|
|
} |
219
|
|
|
|
|
|
|
|
220
|
0
|
|
|
0
|
0
|
|
method curve ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
221
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->curve( ", join(", ",@args), " );" ); |
222
|
0
|
|
|
|
|
|
$xo->curve( @args ); |
223
|
|
|
|
|
|
|
} |
224
|
|
|
|
|
|
|
|
225
|
0
|
|
|
0
|
0
|
|
method hline ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
226
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->hline( @args );" ); |
227
|
0
|
|
|
|
|
|
$xo->hline( @args ); |
228
|
|
|
|
|
|
|
} |
229
|
|
|
|
|
|
|
|
230
|
0
|
|
|
0
|
0
|
|
method move ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
231
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->move( ", join(", ",@args), " );" ); |
232
|
0
|
|
|
|
|
|
$xo->move( @args ); |
233
|
|
|
|
|
|
|
} |
234
|
|
|
|
|
|
|
|
235
|
0
|
|
|
0
|
0
|
|
method pie ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
236
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->pie( ", join(", ",@args), " );" ); |
237
|
0
|
|
|
|
|
|
$xo->pie( @args ); |
238
|
|
|
|
|
|
|
} |
239
|
|
|
|
|
|
|
|
240
|
0
|
|
|
0
|
0
|
|
method spline ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
241
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->spline( ", join(", ",@args), " );" ); |
242
|
0
|
|
|
|
|
|
$xo->spline( @args ); |
243
|
|
|
|
|
|
|
} |
244
|
|
|
|
|
|
|
|
245
|
0
|
|
|
0
|
0
|
|
method vline ( @args ) { |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
246
|
0
|
|
|
|
|
|
$self->xdbg( "\$xo->vline( @args );" ); |
247
|
0
|
|
|
|
|
|
$xo->vline( @args ); |
248
|
|
|
|
|
|
|
} |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
1; |