App-Codit
view release on metacpan or search on metacpan
lib/App/Codit/Macro.pm view on Meta::CPAN
434445464748495051525354555657585960616263646566676869
LINE
=> 1,
MDI
=>
$mdi
,
NAME
=>
$name
,
REMAIN
=> 0,
WIDG
=>
$mdi
->docGet(
$doc
),
};
bless
$self
,
$class
;
return
$self
}
=item B<busy>
Returns true when the macro is running.
=cut
sub
busy {
my
$self
=
shift
;
return
$self
->dem->jobExists(
$self
->jobname)
}
sub
call {
return
$_
[0]->{CALL} }
sub
countref {
my
$self
=
shift
;
$self
->{COUNTREF} =
shift
if
@_
;
return
$self
->{COUNTREF}
lib/App/Codit/Macro.pm view on Meta::CPAN
146147148149150151152153154155156157158159160161162163164165166sub
name {
return
$_
[0]->{NAME} }
=item B<start>
Starts the macro.
=cut
sub
start {
my
$self
=
shift
;
return
if
$self
->busy;
$self
->dem->jobAdd(
$self
->jobname,
$self
->interval,
'cycle'
,
$self
);
my
$mdi
=
$self
->mdi;
my
$count
= 0;
$self
->countref(\
$count
);
my
$last
=
$self
->
last
;
unless
(
defined
$last
) {
my
$w
=
$mdi
->docGet(
$self
->doc);
lib/App/Codit/Macro.pm view on Meta::CPAN
173174175176177178179180181182183184185186187188189190191192193=item B<stop>
Stops the macro. It is called after the last line is processed. However, you
may call it to interrupt the macro.
=cut
sub
stop {
my
$self
=
shift
;
return
unless
$self
->busy;
$self
->dem->jobRemove(
$self
->jobname);
my
$mdi
=
$self
->mdi;
$mdi
->macroRemove(
$self
->doc,
$self
->name)
unless
$self
->remain;
$mdi
->progressRemove(
$self
->jobname);
}
=item B<remain>I<(?$flag?)>
Default value false. If you set it the macro will not be removed
from memory after it finishes.
( run in 0.245 second using v1.01-cache-2.11-cpan-d6f9594c0a5 )