Plugins - mattbichay/test GitHub Wiki
Rocket has a simple, straightforward system for writing plugins. Plugins receive notification when contexts and elements are created and destroyed.
All plugins derive from the Rocket::Core::Plugin class. The virtual functions that can be overridden are:
The OnInitialise() function will be called on all registered plugins when Rocket is successfully initialised. If Rocket is already initialised when a plugin is registered, OnInitialise() will be immediately called on the plugin.
OnShutdown() is called on all registered plugins when Rocket is shut down, immediately after all the contexts and elements are destroyed. Plugins must release any resources they have allocated, including themselves, during this call.
OnDocumentOpen is called when a RML stream is opened, Load/Unload are global callbacks called before and after the documents load/unload respectively.
OnContextCreate() and OnContextDestroy() are called on every registered plugin when a context is successfully created or destroyed.
OnElementCreate() and OnElementDestroy() are called on every registered plugin when an element is successfully created or destroyed.
To register a plugin, call the RegisterPlugin() function in Rocket::Core.