Gtk2::CV::Plugin - plugin superclass and nonexistent documentation


Gtk2-CV documentation Contained in the Gtk2-CV distribution.

Index


Code Index:

NAME

Top

Gtk2::CV::Plugin - plugin superclass and nonexistent documentation

SYNOPSIS

Top

 # in ~/.cvrc:
 # require "/path/to/plugin/class";

 # in the plugin file:
 package myplugin;
 use Gtk2::CV::Plugin; # registers the current class as plugin

 # see eg/plugin-skeleton for a starting point

DESCRIPTION

Top

$plugin->new_imagewindow ($imagewindow)
$plugin->new_schnauzer ($schnauzer)

AUTHOR

Top

 Marc Lehmann <schmorp@schmorp.de>
 http://home.schmorp.de/


Gtk2-CV documentation Contained in the Gtk2-CV distribution.
package Gtk2::CV::Plugin;

use common::sense;

my %registry;

sub import {
   my ($self) = @_;

   return unless $self eq Gtk2::CV::Plugin::;

   my $caller = caller;
   $registry{$caller}++;
   push @{"$caller\::ISA"}, __PACKAGE__;
}

sub call_accum {
   my ($self, $accum, $method, @args) = @_;

   my $state = { };

   for my $plugin (keys %registry) {
      $accum->($state, $plugin->$method (@args))
         or last;
   }

   $state->{accum}
}

sub call {
   my ($self, $method, @args) = @_;

   $self->call_accum (sub { 1 }, $method, @args)
}

sub new_imagewindow {
}

sub new_schnauzer {
}

1