KiCad PCB EDA Suite
|
Responsible for loading plugin definitions for API-based plugins (ones that do not run inside KiCad itself, but instead are launched as external processes by KiCad) More...
#include <api_plugin_manager.h>
Classes | |
struct | JOB |
Public Member Functions | |
API_PLUGIN_MANAGER (wxEvtHandler *aParent) | |
void | ReloadPlugins () |
void | RecreatePluginEnvironment (const wxString &aIdentifier) |
void | InvokeAction (const wxString &aIdentifier) |
std::optional< const PLUGIN_ACTION * > | GetAction (const wxString &aIdentifier) |
std::vector< const PLUGIN_ACTION * > | GetActionsForScope (PLUGIN_ACTION_SCOPE aScope) |
std::map< int, wxString > & | ButtonBindings () |
std::map< int, wxString > & | MenuBindings () |
Private Types | |
enum class | JOB_TYPE { CREATE_ENV , SETUP_ENV , INSTALL_REQUIREMENTS } |
Private Member Functions | |
void | processPluginDependencies () |
void | processNextJob (wxCommandEvent &aEvent) |
Private Attributes | |
wxEvtHandler * | m_parent |
std::set< std::unique_ptr< API_PLUGIN >, CompareApiPluginIdentifiers > | m_plugins |
std::map< wxString, const API_PLUGIN * > | m_pluginsCache |
std::map< wxString, const PLUGIN_ACTION * > | m_actionsCache |
std::map< wxString, wxString > | m_environmentCache |
Map of plugin identifier to a path for the plugin's virtual environment, if it has one. | |
std::map< int, wxString > | m_buttonBindings |
Map of button wx item id to action identifier. | |
std::map< int, wxString > | m_menuBindings |
Map of menu wx item id to action identifier. | |
std::set< wxString > | m_readyPlugins |
std::set< wxString > | m_busyPlugins |
std::deque< JOB > | m_jobs |
Responsible for loading plugin definitions for API-based plugins (ones that do not run inside KiCad itself, but instead are launched as external processes by KiCad)
Definition at line 40 of file api_plugin_manager.h.
|
strongprivate |
Enumerator | |
---|---|
CREATE_ENV | |
SETUP_ENV | |
INSTALL_REQUIREMENTS |
Definition at line 85 of file api_plugin_manager.h.
API_PLUGIN_MANAGER::API_PLUGIN_MANAGER | ( | wxEvtHandler * | aParent | ) |
Definition at line 41 of file api_plugin_manager.cpp.
References processNextJob().
|
inline |
Definition at line 55 of file api_plugin_manager.h.
Referenced by EDA_DRAW_FRAME::addApiPluginTools(), and EDA_DRAW_FRAME::OnApiPluginInvoke().
std::optional< const PLUGIN_ACTION * > API_PLUGIN_MANAGER::GetAction | ( | const wxString & | aIdentifier | ) |
Definition at line 195 of file api_plugin_manager.cpp.
References m_actionsCache.
Referenced by PLUGINS_GRID_TRICKS::doPopupSelection(), PLUGINS_GRID_TRICKS::showPopupMenu(), and PANEL_PCBNEW_ACTION_PLUGINS::TransferDataFromWindow().
std::vector< const PLUGIN_ACTION * > API_PLUGIN_MANAGER::GetActionsForScope | ( | PLUGIN_ACTION_SCOPE | aScope | ) |
Definition at line 298 of file api_plugin_manager.cpp.
References m_actionsCache, and m_readyPlugins.
Referenced by EDA_DRAW_FRAME::GetOrderedPluginActions().
void API_PLUGIN_MANAGER::InvokeAction | ( | const wxString & | aIdentifier | ) |
Definition at line 204 of file api_plugin_manager.cpp.
References PLUGIN_ACTION::args, API_PLUGIN::BasePath(), PLUGIN_ACTION::entrypoint, PLUGIN_ACTION::identifier, API_PLUGIN::Identifier(), m_actionsCache, m_readyPlugins, Pgm(), PLUGIN_ACTION::plugin, API_PLUGIN::Runtime(), traceApi, and PLUGIN_RUNTIME::type.
Referenced by EDA_DRAW_FRAME::OnApiPluginInvoke().
|
inline |
Definition at line 57 of file api_plugin_manager.h.
|
private |
Definition at line 384 of file api_plugin_manager.cpp.
References CREATE_ENV, EDA_EVT_PLUGIN_AVAILABILITY_CHANGED, API_PLUGIN_MANAGER::JOB::env_path, API_PLUGIN_MANAGER::JOB::identifier, INSTALL_REQUIREMENTS, m_busyPlugins, m_jobs, m_readyPlugins, Pgm(), API_PLUGIN_MANAGER::JOB::plugin_path, SETUP_ENV, traceApi, and API_PLUGIN_MANAGER::JOB::type.
Referenced by API_PLUGIN_MANAGER().
|
private |
Definition at line 315 of file api_plugin_manager.cpp.
References CREATE_ENV, API_PLUGIN_MANAGER::JOB::env_path, API_PLUGIN_MANAGER::JOB::identifier, INSTALL_REQUIREMENTS, m_busyPlugins, m_environmentCache, m_jobs, m_plugins, m_readyPlugins, API_PLUGIN_MANAGER::JOB::plugin_path, traceApi, and API_PLUGIN_MANAGER::JOB::type.
Referenced by ReloadPlugins().
void API_PLUGIN_MANAGER::RecreatePluginEnvironment | ( | const wxString & | aIdentifier | ) |
Definition at line 162 of file api_plugin_manager.cpp.
References API_PLUGIN::BasePath(), CREATE_ENV, API_PLUGIN_MANAGER::JOB::env_path, API_PLUGIN::Identifier(), API_PLUGIN_MANAGER::JOB::identifier, m_jobs, m_pluginsCache, API_PLUGIN_MANAGER::JOB::plugin_path, traceApi, and API_PLUGIN_MANAGER::JOB::type.
Referenced by PLUGINS_GRID_TRICKS::doPopupSelection().
void API_PLUGIN_MANAGER::ReloadPlugins | ( | ) |
Definition at line 77 of file api_plugin_manager.cpp.
References EDA_EVT_PLUGIN_AVAILABILITY_CHANGED, PATHS::GetDefault3rdPartyPath(), PGM_BASE::GetLocalEnvVariables(), PATHS::GetStockPluginsPath(), PATHS::GetUserPluginsPath(), ENV_VAR::GetVersionedEnvVarValue(), m_actionsCache, m_buttonBindings, m_environmentCache, m_menuBindings, m_parent, m_plugins, m_pluginsCache, m_readyPlugins, Pgm(), processPluginDependencies(), and traceApi.
|
private |
Definition at line 70 of file api_plugin_manager.h.
Referenced by GetAction(), GetActionsForScope(), InvokeAction(), and ReloadPlugins().
|
private |
Definition at line 83 of file api_plugin_manager.h.
Referenced by processNextJob(), and processPluginDependencies().
|
private |
Map of button wx item id to action identifier.
Definition at line 76 of file api_plugin_manager.h.
Referenced by ReloadPlugins().
|
private |
Map of plugin identifier to a path for the plugin's virtual environment, if it has one.
Definition at line 73 of file api_plugin_manager.h.
Referenced by processPluginDependencies(), and ReloadPlugins().
|
private |
Definition at line 100 of file api_plugin_manager.h.
Referenced by processNextJob(), processPluginDependencies(), and RecreatePluginEnvironment().
|
private |
Map of menu wx item id to action identifier.
Definition at line 79 of file api_plugin_manager.h.
Referenced by ReloadPlugins().
|
private |
Definition at line 64 of file api_plugin_manager.h.
Referenced by ReloadPlugins().
|
private |
Definition at line 66 of file api_plugin_manager.h.
Referenced by processPluginDependencies(), and ReloadPlugins().
|
private |
Definition at line 68 of file api_plugin_manager.h.
Referenced by RecreatePluginEnvironment(), and ReloadPlugins().
|
private |
Definition at line 81 of file api_plugin_manager.h.
Referenced by GetActionsForScope(), InvokeAction(), processNextJob(), processPluginDependencies(), and ReloadPlugins().