fltk.plugin

Plugin system for FLTK applications.

This module provides D bindings for FLTK's plugin system, which allows link-time and run-time integration of binary modules. Plugins are registered in a temporary database organized by class, and can be accessed through a plugin manager.

Example:

// Create a plugin
auto plugin = new Plugin("effects", "blur");

// Create a manager to list plugins in the "effects" class
auto mgr = new PluginManager("effects");
int count = mgr.pluginCount;

// Access plugins by index or name
auto p = mgr.plugin(0);
auto p2 = mgr.plugin("blur");

Types 2

classPlugin

Plugin for FLTK's plugin system.

Plugins allow link-time and run-time integration of binary modules. They are registered in a temporary database organized by class. Plugins should typically be subclassed to add custom functionality.

Fields
private PluginPtr handle_
private bool ownsHandle_
Methods
PluginPtr handle() nothrow @nogcReturns the underlying plugin handle.
bool isValid() const nothrow @nogcChecks if the plugin handle is valid.
Constructors
this(string klass, string name)Creates a new plugin with the given class and name.
this(PluginPtr handle, bool ownsHandle = false)Creates a Plugin wrapper for an existing handle.
Destructors

Plugin manager for accessing registered plugins.

The plugin manager provides access to all plugins registered under a specific class. It can list plugins, retrieve them by index or name, and load plugins from dynamic libraries.

Fields
private PluginManagerPtr handle_
Methods
PluginManagerPtr handle() nothrow @nogcReturns the underlying plugin manager handle.
bool isValid() const nothrow @nogcChecks if the plugin manager handle is valid.
int pluginCount()Gets the number of plugins in the managed class.
Plugin plugin(int index)Gets a plugin by index.
Plugin plugin(string name)Gets a plugin by name.
void * addPlugin(string name, Plugin plugin)Adds a plugin to the manager.
void removePlugin(void * id)Removes a plugin by its ID.
int load(string filename)Loads a plugin from a dynamic library file.
int loadAll(string filepath, string pattern = null)Loads all plugins from a directory matching a pattern.
Constructors
this(string klass)Creates a plugin manager for the given class.
Destructors