App-Codit

 view release on metacpan or  search on metacpan

lib/App/Codit/Macro.pm  view on Meta::CPAN

		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

sub 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


=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.605 second using v1.01-cache-2.11-cpan-87723dcf8b7 )