OpenCPN Partial API docs
Loading...
Searching...
No Matches
PluginLoader Class Reference

PluginLoader is a backend module without any direct GUI functionality. More...

#include <plugin_loader.h>

Public Member Functions

bool LoadAllPlugIns (bool enabled_plugins)
 
void SetPluginDefaultIcon (const wxBitmap *bitmap)
 
const wxBitmap * GetPluginDefaultIcon ()
 
bool UnLoadPlugIn (size_t ix)
 Unload, delete and remove item ix in GetPlugInArray(). More...
 
bool UnLoadAllPlugIns ()
 
bool DeactivateAllPlugIns ()
 
bool DeactivatePlugIn (PlugInContainer *pic)
 
bool UpdatePlugIns ()
 
void UpdateManagedPlugins ()
 
PlugInContainerLoadPlugIn (wxString plugin_file)
 
PlugInContainerLoadPlugIn (wxString plugin_file, PlugInContainer *pic)
 
ArrayOfPlugIns * GetPlugInArray ()
 
bool IsPlugInAvailable (wxString commonName)
 
bool CheckPluginCompatibility (wxString plugin_file)
 

Static Public Member Functions

static PluginLoadergetInstance ()
 

Public Attributes

EventVar evt_blacklisted_plugin
 
EventVar evt_deactivate_plugin
 Receives a malloc'ed copy of a PlugInContainer owned by listener. More...
 
EventVar evt_incompatible_plugin
 
EventVar evt_load_directory
 
EventVar evt_load_plugin
 
EventVar evt_plugin_unload
 
EventVar evt_pluglist_change
 
EventVar evt_unreadable_plugin
 
EventVar evt_update_chart_types
 
EventVar evt_plugin_loadall_finalize
 
EventVar evt_version_incompatible_plugin
 

Detailed Description

PluginLoader is a backend module without any direct GUI functionality.

Instead, it generates events listed here. Each event is mirrored by a public variable, by convention having the same name in lower case.

The general usage pattern to process events, here using EVT_LOAD_PLUGIN:

PluginLoader::getInstance()->evt_load_plugin.listen(this, EVT_LOAD_PLUGIN) Bind(EVT_LOAD_PLUGIN, [&](wxCommandEvent ev) { code to run on event... });

The code in plugin_loader uses evt_load_plugin.notify() to trigger the event. notify() might have a string or void* argument; these are available as ev.GetString() or ev.GetClientData() in the Bind() lambda function.

Examples: PlugInManager::PlugInManager() in pluginmanager.cpp

Definition at line 141 of file plugin_loader.h.

Constructor & Destructor Documentation

◆ ~PluginLoader()

virtual PluginLoader::~PluginLoader ( )
inlinevirtual

Definition at line 160 of file plugin_loader.h.

Member Function Documentation

◆ CheckPluginCompatibility()

bool PluginLoader::CheckPluginCompatibility ( wxString  plugin_file)

Definition at line 989 of file plugin_loader.cpp.

◆ DeactivateAllPlugIns()

bool PluginLoader::DeactivateAllPlugIns ( )

Definition at line 812 of file plugin_loader.cpp.

◆ DeactivatePlugIn()

bool PluginLoader::DeactivatePlugIn ( PlugInContainer pic)

Definition at line 548 of file plugin_loader.cpp.

◆ getInstance()

PluginLoader * PluginLoader::getInstance ( )
static

Definition at line 185 of file plugin_loader.cpp.

◆ GetPlugInArray()

ArrayOfPlugIns * PluginLoader::GetPlugInArray ( )
inline

Definition at line 177 of file plugin_loader.h.

◆ GetPluginDefaultIcon()

const wxBitmap * PluginLoader::GetPluginDefaultIcon ( )

Definition at line 216 of file plugin_loader.cpp.

◆ IsPlugInAvailable()

bool PluginLoader::IsPlugInAvailable ( wxString  commonName)

Definition at line 195 of file plugin_loader.cpp.

◆ LoadAllPlugIns()

bool PluginLoader::LoadAllPlugIns ( bool  enabled_plugins)

Definition at line 228 of file plugin_loader.cpp.

◆ LoadPlugIn() [1/2]

PlugInContainer * PluginLoader::LoadPlugIn ( wxString  plugin_file)

Definition at line 1161 of file plugin_loader.cpp.

◆ LoadPlugIn() [2/2]

PlugInContainer * PluginLoader::LoadPlugIn ( wxString  plugin_file,
PlugInContainer pic 
)

Definition at line 1170 of file plugin_loader.cpp.

◆ SetPluginDefaultIcon()

void PluginLoader::SetPluginDefaultIcon ( const wxBitmap *  bitmap)

Definition at line 222 of file plugin_loader.cpp.

◆ UnLoadAllPlugIns()

bool PluginLoader::UnLoadAllPlugIns ( )

Definition at line 802 of file plugin_loader.cpp.

◆ UnLoadPlugIn()

bool PluginLoader::UnLoadPlugIn ( size_t  ix)

Unload, delete and remove item ix in GetPlugInArray().

Definition at line 606 of file plugin_loader.cpp.

◆ UpdateManagedPlugins()

void PluginLoader::UpdateManagedPlugins ( )

Definition at line 624 of file plugin_loader.cpp.

◆ UpdatePlugIns()

bool PluginLoader::UpdatePlugIns ( )

Definition at line 487 of file plugin_loader.cpp.

Member Data Documentation

◆ evt_blacklisted_plugin

EventVar PluginLoader::evt_blacklisted_plugin

Definition at line 143 of file plugin_loader.h.

◆ evt_deactivate_plugin

EventVar PluginLoader::evt_deactivate_plugin

Receives a malloc'ed copy of a PlugInContainer owned by listener.

Definition at line 146 of file plugin_loader.h.

◆ evt_incompatible_plugin

EventVar PluginLoader::evt_incompatible_plugin

Definition at line 148 of file plugin_loader.h.

◆ evt_load_directory

EventVar PluginLoader::evt_load_directory

Definition at line 149 of file plugin_loader.h.

◆ evt_load_plugin

EventVar PluginLoader::evt_load_plugin

Definition at line 150 of file plugin_loader.h.

◆ evt_plugin_loadall_finalize

EventVar PluginLoader::evt_plugin_loadall_finalize

Definition at line 155 of file plugin_loader.h.

◆ evt_plugin_unload

EventVar PluginLoader::evt_plugin_unload

Definition at line 151 of file plugin_loader.h.

◆ evt_pluglist_change

EventVar PluginLoader::evt_pluglist_change

Definition at line 152 of file plugin_loader.h.

◆ evt_unreadable_plugin

EventVar PluginLoader::evt_unreadable_plugin

Definition at line 153 of file plugin_loader.h.

◆ evt_update_chart_types

EventVar PluginLoader::evt_update_chart_types

Definition at line 154 of file plugin_loader.h.

◆ evt_version_incompatible_plugin

EventVar PluginLoader::evt_version_incompatible_plugin

Definition at line 156 of file plugin_loader.h.


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