fltk 1.3.0rc3
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. Release candidate.
  SfR Fresh Dox: fltk-1.3.0rc3-source.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation)  

Fl_Plugin Class Reference

Fl_Plugin allows link-time and run-time integration of binary modules. More...

#include <Fl_Plugin.H>

Inheritance diagram for Fl_Plugin:
Collaboration diagram for Fl_Plugin:

List of all members.

Public Member Functions

 Fl_Plugin (const char *klass, const char *name)
 Create a plugin.
virtual ~Fl_Plugin ()
 Clear the plugin and remove it from the database.

Detailed Description

Fl_Plugin allows link-time and run-time integration of binary modules.

Fl_Plugin and Fl_Plugin_Manager provide a small and simple solution for linking C++ classes at run-time, or optionally linking modules at compile time without the need to change the main application.

Fl_Plugin_Manager uses static initialisation to create the plugin interface early during startup. Plugins are stored in a temporary database, organized in classes.

Plugins should derive a new class from Fl_Plugin as a base:

 class My_Plugin : public Fl_Plugin {
 public:
   My_Plugin() : Fl_Plugin("effects", "blur") { }
   void do_something(...);
 };
 My_Plugin blur_plugin();

Plugins can be put into modules and either linked befor distribution, or loaded from dynamically linkable files. An Fl_Plugin_Manager is used to list and access all currently loaded plugins.

 Fl_Plugin_Manager mgr("effects");
 int i, n = mgr.plugins();
 for (i=0; i<n; i++) {
   My_Plugin *pin = (My_Plugin*)mgr.plugin(i);
   pin->do_something();
 }

Definition at line 70 of file Fl_Plugin.H.


Constructor & Destructor Documentation

Fl_Plugin::Fl_Plugin ( const char *  klass,
const char *  name 
)

Create a plugin.

Parameters:
[in]klassplugins are grouped in classes
[in]nameevery plugin should have a unique name

Definition at line 1629 of file Fl_Preferences.cxx.

References Fl_Plugin_Manager::addPlugin().

Fl_Plugin::~Fl_Plugin ( ) [virtual]

Clear the plugin and remove it from the database.

Definition at line 1642 of file Fl_Preferences.cxx.

References Fl_Preferences::remove().


The documentation for this class was generated from the following files: