A SPECIFICATION FOR HYBRIS PLUGINS

written for version 0.5.0, 1999.02.25

note: version 0.5.0 never became what it supposed to be. it is now in C
instead of Perl.

1. Context

Hybris is a swiss-knife structured document editor that violently needs
plugins (because it's not swiss-knife yet, for example).

Hybris is written in Perl; Perl allows for a relatively easy to use
package system, with which it is nearly trivial to use.

Hybris has no need for security, relatively to importing plugins;
therefore there is no need to design a sophisticated "Safe" module, or
even use the one from Perl's standard library.

This plugin specification will be revised before 1.0, for version 1.0, or
for any interim version before that.

2. Basic rules

2.1 General

* The directory for the plugins is ./plugins/, from the base directory of
Hybris.

2.2 For each plugin named $FOO:

* there ought to be a Perl module called ./plugins/$FOO.pm;

* there ought to be a package named ::plugins::$FOO;

* there ought to be only this package in the module;

* $FOO must =~ /^[a-z_]+$/;

* normal Perl rules for modules apply;

3. Registering Services.

3.1. What can be supplied.

Non-tabulated lines are kinds of services; tabulated lines are examples of
services. starred examples are "abstract" services.

Window-Types (implemented since 0.5.0)
	structured_document
	cli *
	perl_interaction
	tree_interaction

Access-Types (not implemented)
	file_load_save *
	file_load_save_dulll
	file_open_close
	file_export_html
	file_export_xml

Data-Types (not implemented)
	swallow
	pixmap
	blob
	integer
	float
	date

View-Types (not implemented)
	date:spinbox
	date:calendar
	list:horiz-panes

3.2. PlugIn Data (1 of 2)

Here are pseudo-code (and/or code) declarations:

type service =~ /^WindowType|AccessType|DataType|ViewType$/;

type plugin_data is
  kind: service;
  ident: string =~ /^\w+$/;
  name:  no-nl-string;
  needs: array of ident;
  description: string;
end.

example:

package plugin::foobar
@plugin_data = [
  "WindowType",
  "foobar",
  "FooBarBazQuux",
  ["Mumble","Zaphod"],
  "Activates the improbability drive"];

3.3. Plug-In Data (2 of 2)

Disregard the previous section completely for now. Following is the _real_
mechanism.

Every plug-in initialization must register its stuff; nothing else has to
be done.

example:

plugins->register(WindowType->'Hell-o');

3.4. Inheritance.

Window-Type providers must inherit from the ::HWindow class.

others: nothing special as of now.

4. Conclusion.

this first specification of the plug-in interface is utter crap and will
be superseded. Oh, and Beware of the Leopard (tm).

