This is the base class for a user defined plugin
Overview
This is the base class for a user defined plugin.
If you generated a project with fbgen.py, you already have an implementation in projects/pluginName/pluginName.h and .cpp which you can easily extend.
Reference
createJSAPI()
virtual FB::JSAPIPtr createJSAPI() = 0
- shall return a JSAPI* wrapped in a FB::JSAPIPtr() which represents the scriptable interface for the plugin
- use JSAPIAuto for convenient creation of a scriptable object
Plugin window
- returns the current plugin window
void SetWindow(FB::PluginWindow* win)
- Called by the browser to set the current plugin window to
win
- Called by the browser to detach the current plugin window
SetHost()
void SetHost(FB::BrowserHost host)
- Called by the browser to set the browser host for the plugin to
host
IsWindowLess()
virtual bool IsWindowLess() = 0
- shall return
trueif the plugin is window-less,falseotherwise - implemented by classes that uses
PluginCore
HandleEvent()
virtual bool HandleEvent(FB::PluginEvent* ev) = 0
- receives events for the plugin
- shall return
trueif the event was handled,falseotherwise - see PluginEvent
Event maps
BEGIN_PLUGIN_EVENT_MAP()END_PLUGIN_EVENT_MAP()EVENTTYPE_CASE(eventType, handler, sourcetype)
To ease handling of events, a event mapping system is provided.
Event maps start with BEGIN_PLUGIN_EVENT_MAP() and end with END_PLUGIN_EVENT_MAP().
To specify which functions are to handle which events, use EVENTTYPE_CASE(eventType, handler):