| 1 | package Khonsu::Page; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 3 | ▶ | use parent 'Khonsu::Ra'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | sub attributes { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 122 | ▶ | my $a = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
attributes: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | return ( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | header => {$a->RW, $a->OBJ}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | footer => {$a->RW, $a->OBJ}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | page_size => {$a->RW, $a->REQ, $a->STR}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | background => {$a->RW, $a->STR}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | num => {$a->RW, $a->REQ, $a->NUM}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | current => {$a->RW, $a->OBJ}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 122 | ▶ | columns => {$a->RW, $a->NUM, default => sub { 1 }}, | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 122 | ▶ | column => {$a->RW, $a->NUM, default => sub { 1 }}, | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 122 | ▶ | rows => {$a->RW, $a->NUM, default => sub { 1 }}, | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 122 | ▶ | row => {$a->RW, $a->NUM, default => sub { 1 }}, | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 122 | is_rotated => {$a->RW, $a->NUM}, | |||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | header => {$a->RW, $a->OBJ}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | footer => {$a->RW, $a->OBJ}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | toc => {$a->RW, $a->BOOL}, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | $a->POINTS, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | $a->BOX, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | sub add { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 122 | ▶ | my ($self, $file, %args) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add: called CC=7 SCAR=23.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 122 | ▶ | my $page = $args{open} ? $file->pdf->openpage($args{num} || $self->num) : $file->pdf->page($args{num} || $self->num || 0); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition25%2/8
$args{'num'} || $self->num
$args{'num'} || $self->num || 0
$args{"num"} or $self->num
MC/DC0%0/2
$args{'num'} || $self->num
$args{'num'}
$self->num
MC/DC0%0/2
$args{'num'} || $self->num || 0
$args{"num"}
$self->num
Truth table0%0/3
A || B
A= $args{'num'}B= $self->num
Truth table33%1/3
A or B
A= $args{"num"}B= $self->num
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 122 | $page->mediabox($self->page_size); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 122 | $self->set_points($page->get_mediabox); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 122 | $self->current($page); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 122 | ▶ | $self->rotate if $args{rotate}; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 122 | ▶ | if ($self->background) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 122 | $self->box->add( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | $file, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | fill_colour => $self->background, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | $self->get_points | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 122 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | sub rotate { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 0 | ▶ | my ($self) = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
rotate: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 0 | my ($blx, $bly, $trx, $try) = $self->current->get_mediabox; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 0 | $self->current->mediabox( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | $self->x(0), | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | $self->y(0), | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | $self->w($try), | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | $self->h($trx), | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 0 | $self->is_rotated(!$self->is_rotated); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 0 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | sub render { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 122 | ▶ | my ($self, $file) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
render: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 122 | ▶ | $self->header->render($file) if $self->header; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 122 | ▶ | $self->footer->render($file) if $self->footer; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 3 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||