lib/TUI/Views/Window.pm

filter: Statementstmt 33.3% 85 / 255 Branchbran 1.6% 1 / 62 Conditioncond 0.0% 0 / 24 MC/DCmcdc 0.0% 0 / 12 Subroutinesub 52.2% 23 / 44 Podpod 77.7% 14 / 18 totaltotal 29.6% 123 / 415 CC 44 SCAR 47.4
CC
44
Cov
25%
handleEvent
417.3
setState
56.0
BUILD
30.0
CRAP 115.0
« lib/TUI/Gadgets/Table.pm ↑ Summary lib/TUI/Views/Frame/Line.pm »
1 package TUI::Views::Window;
2 # ABSTRACT: A base class for managing windows
3
4 53 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 53 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 53 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7
8 53 our $VERSION = '2.000003';
9 53 $VERSION =~ tr/_//d;
10 53 our $AUTHORITY = 'cpan:BRICKPOOL';
11
12 53 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
13 53 our @EXPORT = qw(
14 TWindow
15 new_TWindow
16 );
17
18 53 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
19 53 ▶use Storable ();
Subroutine BEGIN: called CC=1 SCAR=0.0
20 53 ▶use TUI::toolkit;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 53 ▶use TUI::toolkit::Types qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
22 is_Object
23 :types
24 53 );
25
26 53 ▶use TUI::App::Program;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 53 ▶use TUI::Drivers::Const qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
28 :evXXXX
29 :kbXXXX
30 53 );
31 53 ▶use TUI::Objects::Point;
Subroutine BEGIN: called CC=1 SCAR=0.0
32 53 ▶use TUI::Objects::Rect;
Subroutine BEGIN: called CC=1 SCAR=0.0
33 53 ▶use TUI::Views::Const qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
34 :cmXXXX
35 :cpXXXX
36 :gfXXXX
37 :ofXXXX
38 :sbXXXX
39 :sfXXXX
40 :wfXXXX
41 wpBlueWindow
42 53 );
43 53 ▶use TUI::Views::CommandSet;
Subroutine BEGIN: called CC=1 SCAR=0.0
44 53 ▶use TUI::Views::Frame;
Subroutine BEGIN: called CC=1 SCAR=0.0
45 53 ▶use TUI::Views::Group;
Subroutine BEGIN: called CC=1 SCAR=0.0
46 53 ▶use TUI::Views::Palette;
Subroutine BEGIN: called CC=1 SCAR=0.0
47 53 ▶use TUI::Views::ScrollBar;
Subroutine BEGIN: called CC=1 SCAR=0.0
48 53 ▶use TUI::Views::WindowInit;
Subroutine BEGIN: called CC=1 SCAR=0.0
49
50 sub TWindow() { __PACKAGE__ }
51 sub name() { 'TWindow' }
52 0 ▶sub new_TWindow { __PACKAGE__->from(@_) }
Subroutine new_TWindow: not called CC=1 SCAR=6.9
Pod documented
53
54 53 extends ( TGroup, TWindowInit );
55
56 # Moo does not inherit attributes from secondary extends() classes.
57 # Redeclare attribute provided by TWindowInit.
58 53 ▶if ( TUI::toolkit::is_Moo ) {
Branch: 1 branch
BranchTrueFalseTotal
if (&TUI::toolkit::is_Moo()) 0 53 53
59 0 ▶ has createFrame => ( is => 'bare', default => sub { die 'required' } );
Subroutine __ANON__: not called CC=1 SCAR=6.9
60 }
61
62 # declare global variables
63 53 our $minWinSize = TPoint->new( x => 16, y => 6 );
64
65 # import global variables
66 53 ▶use vars qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
67 $appPalette
68 53 );
69 {
70 53 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
71 53 *appPalette = \${ TProgram . '::appPalette' };
72 }
73
74 # public attributes
75 53 has flags => ( is => 'rw', default => wfMove | wfGrow | wfClose | wfZoom );
76 53 has zoomRect => ( is => 'rw' );
77 0 ▶has number => ( is => 'rw', default => sub { 'required' } );
Subroutine __ANON__: not called CC=1 SCAR=1.2
78 53 has palette => ( is => 'rw', default => wpBlueWindow );
79 53 has frame => ( is => 'rw' );
80 0 ▶has title => ( is => 'rw', default => sub { 'required' } );
Subroutine __ANON__: not called CC=1 SCAR=1.2
81
82 0 ▶sub BUILDARGS { # \%args (%args)
Subroutine BUILDARGS: not called CC=1 SCAR=6.9
Pod documented
83 0 state $sig = signature(
84 method => 1,
85 named => [
86 bounds => Object,
87 title => Str, { alias => 'aTitle' },
88 number => Int, { alias => 'aNumber' },
89 ],
90 caller_level => +1,
91 );
92 0 my ( $class, $args1 ) = $sig->( @_ );
93 0 local $Carp::CarpLevel = $Carp::CarpLevel + 1;
94 0 my $args2 = TGroup->BUILDARGS( bounds => $args1->{bounds} );
95 0 my $args3 = TWindowInit->BUILDARGS( cFrame => $class->can( 'initFrame' ) );
96 0 return { %$args1, %$args2, %$args3 };
97 }
98
99 0 ▶sub BUILD { # void (\%args)
Subroutine BUILD: not called CC=5 SCAR=34.0
Pod documented
100 0 my ( $self, $args ) = @_;
101 0 ▶ assert ( @_ == 2 );
Branch: 1 branch
BranchTrueFalseTotal
unless @_ == 2 0 0 0
102 0 ▶ assert ( is_Object $self );
Branch: 1 branch
BranchTrueFalseTotal
unless &is_Object($self) 0 0 0
103 0 $self->{zoomRect} = $self->getBounds();
104
105 0 $self->{state} |= sfShadow;
106 0 $self->{options} |= ofSelectable | ofTopSelect;
107 0 $self->{growMode} = gfGrowAll | gfGrowRel;
108
109 0 ▶ if ( $self->{createFrame}
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"createFrame"} and $self->{"frame"} = $self->createFrame($self->getExtent)) 0 0 0
Condition0%0/3
$self->{"createFrame"} and $self->{"frame"} = $self->createFrame($self->getExtent)
!ll&&!rl&&r
000
MC/DC0%0/2
$self->{"createFrame"} and $self->{"frame"} = $self->createFrame($self->getExtent)
$self->{"createFrame"} $self->{"frame"} = $self->createFrame($self->getExtent)
Truth table0%0/3
A and B
A= $self->{"createFrame"}B= $self->{"frame"} = $self->createFrame($self->getExtent)
ABresult
0X0
100
111
110 && ( $self->{frame} = $self->createFrame( $self->getExtent() ) )
111 ) {
112 0 $self->insert( $self->{frame} );
113 }
114 0 return;
115 }
116
117 0 ▶sub from { # $obj ($bounds, $aTitle, $aNumber)
Subroutine from: not called CC=1 SCAR=6.9
Pod undocumented
118 0 state $sig = signature(
119 method => 1,
120 pos => [Object, Str, Int],
121 );
122 0 my ( $class, @args ) = $sig->( @_ );
123 0 return $class->new( bounds => $args[0], title => $args[1],
124 number => $args[2] );
125 }
126
127 0 ▶sub DEMOLISH { # void ($in_global_destruction)
Subroutine DEMOLISH: not called CC=3 SCAR=24.8
Pod documented
128 0 my ( $self, $in_global_destruction ) = @_;
129 0 ▶ assert ( @_ == 2 );
Branch: 1 branch
BranchTrueFalseTotal
unless @_ == 2 0 0 0
130 0 ▶ assert ( is_Object $self );
Branch: 1 branch
BranchTrueFalseTotal
unless &is_Object($self) 0 0 0
131 0 $self->{title} = undef;
132 0 return;
133 }
134
135 0 ▶sub close { # void ()
Subroutine close: not called CC=3 SCAR=24.8
Pod documented
136 0 state $sig = signature(
137 method => Object,
138 pos => [],
139 );
140 0 my ( $self ) = $sig->( @_ );
141 0 alias: for $self ( $_[0] ) { # Maybe we are destroying ourselves
142 0 ▶ if ( $self->valid( cmClose ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->valid(4)) 0 0 0
143 # so we don't try to use the frame after it's been deleted
144 0 $self->{frame} = undef;
145 0 $self->destroy( $self );
146 }
147 0 return;
148 } #/ alias
149 }
150
151 0 ▶sub getPalette { # $palette ()
Subroutine getPalette: not called CC=1 SCAR=6.9
Pod documented
152 0 state $sig = signature(
153 method => Object,
154 pos => [],
155 );
156 0 my ( $self ) = $sig->( @_ );
157 0 state $blue = TPalette->new(
158 data => cpBlueWindow,
159 size => length( cpBlueWindow )
160 );
161 0 state $cyan = TPalette->new(
162 data => cpCyanWindow,
163 size => length( cpCyanWindow )
164 );
165 0 state $gray = TPalette->new(
166 data => cpGrayWindow,
167 size => length( cpGrayWindow )
168 );
169 0 state $palettes = [ $blue, $cyan, $gray ];
170 0 return $palettes->[$appPalette]->clone();
171 } #/ sub getPalette
172
173 0 ▶sub getTitle { # $str ($maxSize)
Subroutine getTitle: not called CC=1 SCAR=6.9
Pod documented
174 0 state $sig = signature(
175 method => Object,
176 pos => [Int],
177 );
178 0 my ( $self, $maxSize ) = $sig->( @_ );
179 0 return $self->{title};
180 }
181
182 0 ▶sub handleEvent { # void ($event)
Subroutine handleEvent: not called CC=22 SCAR=60.3
Pod documented
183 0 state $sig = signature(
184 method => Object,
185 pos => [Object],
186 );
187 0 my ( $self, $event ) = $sig->( @_ );
188 0 my $limits = TRect->new();
189 0 my ( $min, $max ) = ( TPoint->new(), TPoint->new() );
190
191 0 $self->SUPER::handleEvent( $event );
192 0 ▶ if ( $event->{what} == evCommand ) {
Branch: 3 branches
BranchTrueFalseTotal
if ($event->{'what'} == 256) { } 0 0 0
elsif ($event->{'what'} == 16) { } 0 0 0
elsif ($event->{'what'} == 512 and $event->{'message'}{'command'} == 55 and $event->{'message'}{'infoInt'} == $self->{'number'} and $self->{'options'} & 1) { } 0 0 0
193 0 SWITCH: for ( $event->{message}{command} ) {
194 0 ▶ cmResize == $_ and do {
Branch: 1 branch
BranchTrueFalseTotal
6 == $_ and do { if ($self->{"flags"} & 3) { $limits = $self->{"owner"}->getExtent; $self->sizeLimits($min, $max); $self->dragView($event, $self->{"dragMode"} | $self->{"flags"} & 3, $limits, $min, $max); $self->clearEvent($event); } ; last } 0 0 0
195 0 ▶ if ( $self->{flags} & ( wfMove | wfGrow ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"flags"} & 3) 0 0 0
196 0 $limits = $self->{owner}->getExtent();
197 0 $self->sizeLimits( $min, $max );
198 $self->dragView( $event,
199 0 $self->{dragMode} | ( $self->{flags} & ( wfMove | wfGrow ) ),
200 $limits, $min, $max
201 );
202 0 $self->clearEvent( $event );
203 }
204 0 last;
205 };
206 0 ▶ cmClose == $_ and do {
Branch: 1 branch
BranchTrueFalseTotal
4 == $_ and do { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x51\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"} if ($self->{"flags"} & 4 and !$event->{"message"}{"infoPtr"} || $event->{"message"}{"infoPtr"} == $self) { $self->clearEvent($event); if (not $self->{"state"} & 512) { $self->close; } else { $event->{"what"} = 256; $event->{"message"}{"command"} = 11; $self->putEvent($event); $self->clearEvent($event); } ; } ; last } 0 0 0
207 53 ▶ no warnings 'uninitialized';
Subroutine BEGIN: called CC=1 SCAR=0.0
208 0 ▶ if ( ( $self->{flags} & wfClose )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"flags"} & 4 and !$event->{"message"}{"infoPtr"} || $event->{"message"}{"infoPtr"} == $self) 0 0 0
Condition0%0/6
$self->{"flags"} & 4 and !$event->{"message"}{"infoPtr"} || $event->{"message"}{"infoPtr"} == $self
!ll&&!rl&&r
000
not $event->{"message"}{"infoPtr"} or $event->{"message"}{"infoPtr"} == $self
l!l&&r!l&&!r
000
MC/DC0%0/3
$self->{"flags"} & 4 and !$event->{"message"}{"infoPtr"} || $event->{"message"}{"infoPtr"} == $self
$self->{"flags"} & 4 not $event->{"message"}{"infoPtr"} $event->{"message"}{"infoPtr"} == $self
Truth table0%0/4
A and not(B) or C
A= $self->{"flags"} & 4B= not $event->{"message"}{"infoPtr"}C= $event->{"message"}{"infoPtr"} == $self
ABCresult
0XX0
1000
11X1
1011
209 && ( !$event->{message}{infoPtr}
210 || $event->{message}{infoPtr} == $self
211 )
212 ) {
213 0 $self->clearEvent( $event );
214 0 ▶ if ( !( $self->{state} & sfModal ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $self->{'state'} & 512) { } 0 0 0
215 0 $self->close();
216 }
217 else {
218 0 $event->{what} = evCommand;
219 0 $event->{message}{command} = cmCancel;
220 0 $self->putEvent( $event );
221 0 $self->clearEvent( $event );
222 }
223 } #/ if ( $self->{flags} & ...)
224 0 last;
225 };
226 0 ▶ cmZoom == $_ and do {
Branch: 1 branch
BranchTrueFalseTotal
5 == $_ and do { BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x51\x51\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"} if ($self->{"flags"} & 8 and !$event->{"message"}{"infoPtr"} || $event->{"message"}{"infoPtr"} == $self) { $self->zoom; $self->clearEvent($event); } ; last } 0 0 0
227 53 ▶ no warnings 'uninitialized';
Subroutine BEGIN: called CC=1 SCAR=0.0
228 0 ▶ if ( ( $self->{flags} & wfZoom )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"flags"} & 8 and !$event->{"message"}{"infoPtr"} || $event->{"message"}{"infoPtr"} == $self) 0 0 0
Condition0%0/6
$self->{"flags"} & 8 and !$event->{"message"}{"infoPtr"} || $event->{"message"}{"infoPtr"} == $self
!ll&&!rl&&r
000
not $event->{"message"}{"infoPtr"} or $event->{"message"}{"infoPtr"} == $self
l!l&&r!l&&!r
000
MC/DC0%0/3
$self->{"flags"} & 8 and !$event->{"message"}{"infoPtr"} || $event->{"message"}{"infoPtr"} == $self
$self->{"flags"} & 8 not $event->{"message"}{"infoPtr"} $event->{"message"}{"infoPtr"} == $self
Truth table0%0/4
A and not(B) or C
A= $self->{"flags"} & 8B= not $event->{"message"}{"infoPtr"}C= $event->{"message"}{"infoPtr"} == $self
ABCresult
0XX0
1000
11X1
1011
229 && ( !$event->{message}{infoPtr}
230 || $event->{message}{infoPtr} == $self
231 )
232 ) {
233 0 $self->zoom();
234 0 $self->clearEvent( $event );
235 }
236 0 last;
237 };
238 }
239 }
240 elsif ( $event->{what} == evKeyDown ) {
241 0 SWITCH: for ( $event->{keyDown}{keyCode} ) {
242 0 ▶ kbTab == $_ and do {
Branch: 1 branch
BranchTrueFalseTotal
3849 == $_ and 0 0 0
243 0 $self->focusNext( false );
244 0 $self->clearEvent( $event );
245 0 last;
246 };
247 0 ▶ kbShiftTab == $_ and do {
Branch: 1 branch
BranchTrueFalseTotal
3840 == $_ and 0 0 0
248 0 $self->focusNext( true );
249 0 $self->clearEvent( $event );
250 0 last;
251 };
252 }
253 } #/ elsif ( $event->{what} ==...)
254 ▶ elsif ( $event->{what} == evBroadcast
Condition0%0/9
$event->{"what"} == 512 and $event->{"message"}{"command"} == 55 and $event->{"message"}{"infoInt"} == $self->{"number"} and $self->{"options"} & 1
!ll&&!rl&&r
000
$event->{"what"} == 512 and $event->{"message"}{"command"} == 55 and $event->{"message"}{"infoInt"} == $self->{"number"}
!ll&&!rl&&r
000
$event->{"what"} == 512 and $event->{"message"}{"command"} == 55
!ll&&!rl&&r
000
MC/DC0%0/4
$event->{"what"} == 512 and $event->{"message"}{"command"} == 55 and $event->{"message"}{"infoInt"} == $self->{"number"} and $self->{"options"} & 1
$event->{"what"} == 512 $event->{"message"}{"command"} == 55 $event->{"message"}{"infoInt"} == $self->{"number"} $self->{"options"} & 1
Truth table0%0/5
A and B and C and D
A= $event->{"what"} == 512B= $event->{"message"}{"command"} == 55C= $event->{"message"}{"infoInt"} == $self->{"number"}D= $self->{"options"} & 1
ABCDresult
0XXX0
10XX0
110X0
11100
11111
255 && $event->{message}{command} == cmSelectWindowNum
256 && $event->{message}{infoInt} == $self->{number}
257 && ( $self->{options} & ofSelectable )
258 ) {
259 0 $self->select();
260 0 $self->clearEvent( $event );
261 }
262 0 return;
263 } #/ sub handleEvent
264
265 0 ▶sub initFrame { # $frame ($r)
Subroutine initFrame: not called CC=1 SCAR=6.9
Pod documented
266 0 state $sig = signature(
267 method => 1,
268 pos => [Object],
269 );
270 0 my ( $class, $r ) = $sig->( @_ );
271 0 return TFrame->new( bounds => $r );
272 }
273
274 0 ▶sub setState { # void ($aState, $enable)
Subroutine setState: not called CC=7 SCAR=40.3
Pod documented
275 0 state $sig = signature(
276 method => Object,
277 pos => [PositiveOrZeroInt, Bool],
278 );
279 0 my ( $self, $aState, $enable ) = $sig->( @_ );
280 0 my $windowCommands = TCommandSet->new();
281
282 0 $self->SUPER::setState( $aState, $enable );
283 0 ▶ if ( $aState & sfSelected ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($aState & 32) 0 0 0
284 0 $self->setState( sfActive, $enable );
285 0 ▶ if ( $self->{frame} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"frame"}) 0 0 0
286 0 $self->{frame}->setState( sfActive, $enable );
287 }
288 0 $windowCommands += cmNext;
289 0 $windowCommands += cmPrev;
290 0 ▶ if ( $self->{flags} & ( wfGrow | wfMove ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"flags"} & 3) 0 0 0
291 0 $windowCommands += cmResize;
292 }
293 0 ▶ if ( $self->{flags} & wfClose ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"flags"} & 4) 0 0 0
294 0 $windowCommands += cmClose;
295 }
296 0 ▶ if ( $self->{flags} & wfZoom ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"flags"} & 8) 0 0 0
297 0 $windowCommands += cmZoom;
298 }
299 0 ▶ if ( $enable ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($enable) { } 0 0 0
300 0 $self->enableCommands( $windowCommands );
301 }
302 else {
303 0 $self->disableCommands( $windowCommands );
304 }
305 } #/ if ( $aState & sfSelected)
306 0 return;
307 } #/ sub setState
308
309 0 ▶sub sizeLimits { # void ($min, $max)
Subroutine sizeLimits: not called CC=3 SCAR=24.8
Pod documented
310 0 state $sig = signature(
311 method => Object,
312 pos => [Object, Object],
313 );
314 0 my ( $self, $min, $max ) = $sig->( @_ );
315 0 alias: for $min ( $_[1] ) {
316 0 alias: for $max ( $_[2] ) {
317 0 $self->SUPER::sizeLimits( $min, $max );
318 0 $min = $minWinSize->clone();
319 0 return;
320 }} #/ alias:
321 }
322
323 0 ▶sub standardScrollBar { # $scrollBar ($aOptions)
Subroutine standardScrollBar: not called CC=3 SCAR=24.8
Pod documented
324 0 state $sig = signature(
325 method => Object,
326 pos => [PositiveOrZeroInt],
327 );
328 0 my ( $self, $aOptions ) = $sig->( @_ );
329 0 my $r = $self->getExtent();
330 0 ▶ if ( $aOptions & sbVertical ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($aOptions & 1) { } 0 0 0
331 $r = TRect->new(
332 ax => $r->{b}{x} - 1, ay => $r->{a}{y} + 1,
333 0 bx => $r->{b}{x}, by => $r->{b}{y} - 1,
334 );
335 }
336 else {
337 $r = TRect->new(
338 ax => $r->{a}{x} + 2, ay => $r->{b}{y} - 1,
339 bx => $r->{b}{x} - 2, by => $r->{b}{y},
340 0 );
341 }
342
343 0 my $s = TScrollBar->new( bounds => $r );
344 0 $self->insert( $s );
345 0 ▶ if ( $aOptions & sbHandleKeyboard ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($aOptions & 2) 0 0 0
346 0 $s->{options} |= ofPostProcess;
347 }
348 0 return $s;
349 } #/ sub standardScrollBar
350
351 0 ▶sub zoom { # void ()
Subroutine zoom: not called CC=2 SCAR=17.9
Pod documented
352 0 state $sig = signature(
353 method => Object,
354 pos => [],
355 );
356 0 my ( $self ) = $sig->( @_ );
357 0 my ( $minSize, $maxSize ) = ( TPoint->new(), TPoint->new() );
358 0 $self->sizeLimits( $minSize, $maxSize );
359 0 ▶ if ( $self->{size} != $maxSize ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'size'} != $maxSize) { } 0 0 0
360 0 $self->{zoomRect} = $self->getBounds();
361 my $r = TRect->new(
362 ax => 0, ay => 0, bx => $maxSize->{x}, by => $maxSize->{y}
363 0 );
364 0 $self->locate( $r );
365 }
366 else {
367 0 $self->locate( $self->{zoomRect} );
368 }
369 0 return;
370 } #/ sub zoom
371
372 0 ▶sub shutDown { # void ()
Subroutine shutDown: not called CC=1 SCAR=6.9
Pod documented
373 0 state $sig = signature(
374 method => Object,
375 pos => [],
376 );
377 0 my ( $self ) = $sig->( @_ );
378 0 $self->{frame} = undef;
379 0 $self->SUPER::shutDown();
380 0 return;
381 }
382
383 0 ▶sub write :method { # void ($os)
Subroutine write: not called CC=1 SCAR=6.9
Pod undocumented
384 0 state $sig = signature(
385 method => Object,
386 pos => [Object],
387 );
388 0 my ( $self, $os ) = $sig->( @_ );
389 0 $self->SUPER::write( $os );
390 $os->put(
391 $self->{flags},
392 $self->{zoomRect},
393 $self->{number},
394 $self->{palette},
395 $self->{frame},
396 $self->{title},
397 0 );
398 0 return;
399 }
400
401 0 ▶sub read :method { # $self ($is)
Subroutine read: not called CC=1 SCAR=6.9
Pod undocumented
402 0 state $sig = signature(
403 method => Object,
404 pos => [Object],
405 );
406 0 my ( $self, $is ) = $sig->( @_ );
407 0 $self->SUPER::read( $is );
408 0 $self->{flags} = $is->get();
409 0 $self->{zoomRect} = $is->get();
410 0 $self->{number} = $is->get();
411 0 $self->{palette} = $is->get();
412 0 $self->{frame} = $is->get();
413 0 $self->{title} = $is->get();
414 0 return $self;
415 }
416
417 0 ▶sub build { # $obj ()
Subroutine build: not called CC=4 SCAR=30.0
Pod undocumented
418 0 my ( $class ) = @_;
419 0 ▶ assert ( @_ == 1 );
Branch: 1 branch
BranchTrueFalseTotal
unless @_ == 1 0 0 0
420 0 ▶ assert ( is_Str $class );
Branch: 1 branch
BranchTrueFalseTotal
unless $class->is_Str 0 0 0
421 0 ▶ assert ( Storable::is_retrieving );
Branch: 1 branch
BranchTrueFalseTotal
unless &Storable::is_retrieving() 0 0 0
422 0 return $class->new(
423 bounds => TRect->new(),
424 title => '',
425 number => 0,
426 );
427 }
428
429 53 1
430
431 __END__
« lib/TUI/Gadgets/Table.pm ↑ Summary lib/TUI/Views/Frame/Line.pm »