KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ACTION_PLUGINS Class Reference

Mainly static. More...

#include <action_plugin.h>

Static Public Member Functions

static void register_action (ACTION_PLUGIN *aAction)
 An action calls this static method when it wants to register itself into the system actions.
 
static bool deregister_object (void *aObject)
 Deregister an object which builds a action.
 
static ACTION_PLUGINGetAction (const wxString &aName)
 
static void SetActionMenu (int aIndex, int idMenu)
 Associate a menu id to an action plugin.
 
static ACTION_PLUGINGetActionByMenu (int aMenu)
 Find action plugin associated to a menu ID.
 
static void SetActionButton (ACTION_PLUGIN *aAction, int idButton)
 Associate a button id to an action plugin.
 
static ACTION_PLUGINGetActionByButton (int aButton)
 Find action plugin associated to a button ID.
 
static ACTION_PLUGINGetActionByPath (const wxString &aPath)
 Find action plugin by module path.
 
static ACTION_PLUGINGetAction (int aIndex)
 
static int GetActionsCount ()
 
static bool IsActionRunning ()
 
static void SetActionRunning (bool aRunning)
 
static void UnloadAll ()
 Unload (deregister) all action plugins.
 

Static Private Attributes

static std::vector< ACTION_PLUGIN * > m_actionsList
 ACTION_PLUGIN system wide static list.
 
static bool m_actionRunning = false
 

Detailed Description

Mainly static.

Storing all plugins information.

Definition at line 115 of file action_plugin.h.

Member Function Documentation

◆ deregister_object()

bool ACTION_PLUGINS::deregister_object ( void *  aObject)
static

Deregister an object which builds a action.

Lookup on the vector calling GetObject until find, then removed and deleted.

Parameters
aObjectis the action plugin object to be deregistered.

Definition at line 189 of file action_plugin.cpp.

References GetAction(), GetActionsCount(), ACTION_PLUGIN::GetObject(), and m_actionsList.

Referenced by PYTHON_ACTION_PLUGINS::deregister_action().

◆ GetAction() [1/2]

ACTION_PLUGIN * ACTION_PLUGINS::GetAction ( const wxString &  aName)
static
Parameters
aNameis the action plugin name.
Returns
a action object by it's name or NULL if it isn't available.

Definition at line 115 of file action_plugin.cpp.

References GetAction(), GetActionsCount(), ACTION_PLUGIN::GetName(), and name.

Referenced by PCB_EDIT_FRAME::buildActionPluginMenus(), deregister_object(), GetAction(), PCB_EDIT_FRAME::GetOrderedActionPlugins(), and register_action().

◆ GetAction() [2/2]

ACTION_PLUGIN * ACTION_PLUGINS::GetAction ( int  aIndex)
static
Parameters
aIndexis the action index in list.
Returns
a action object by it's number or NULL if it isn't available.

Definition at line 55 of file action_plugin.cpp.

References m_actionsList.

◆ GetActionByButton()

ACTION_PLUGIN * ACTION_PLUGINS::GetActionByButton ( int  aButton)
static

Find action plugin associated to a button ID.

Parameters
aButtonis the button id (defined with SetActionButton).
Returns
the associated ACTION_PLUGIN (or null if not found).

Definition at line 81 of file action_plugin.cpp.

References GetActionsCount(), and m_actionsList.

Referenced by PCB_EDIT_FRAME::OnActionPluginButton().

◆ GetActionByMenu()

ACTION_PLUGIN * ACTION_PLUGINS::GetActionByMenu ( int  aMenu)
static

Find action plugin associated to a menu ID.

Parameters
aMenuis the menu id (defined with SetActionMenu).
Returns
the associated ACTION_PLUGIN (or null if not found).

Definition at line 61 of file action_plugin.cpp.

References GetActionsCount(), and m_actionsList.

Referenced by PCB_EDIT_FRAME::OnActionPluginMenu().

◆ GetActionByPath()

ACTION_PLUGIN * ACTION_PLUGINS::GetActionByPath ( const wxString &  aPath)
static

Find action plugin by module path.

Parameters
aPathis the path of plugin.
Returns
the corresponding ACTION_PLUGIN (or null if not found).

Definition at line 101 of file action_plugin.cpp.

References GetActionsCount(), and m_actionsList.

◆ GetActionsCount()

int ACTION_PLUGINS::GetActionsCount ( )
static

◆ IsActionRunning()

bool ACTION_PLUGINS::IsActionRunning ( )
static
Returns
true if an action running right now otherwise false.

Definition at line 211 of file action_plugin.cpp.

References m_actionRunning.

Referenced by IsActionRunning().

◆ register_action()

void ACTION_PLUGINS::register_action ( ACTION_PLUGIN aAction)
static

An action calls this static method when it wants to register itself into the system actions.

Parameters
aActionis the action plugin to be registered.

Definition at line 139 of file action_plugin.cpp.

References GetAction(), GetActionsCount(), GetBitmapStore(), ACTION_PLUGIN::GetIconFileName(), ACTION_PLUGIN::GetName(), ACTION_PLUGIN::iconBitmap, m_actionsList, and PgmOrNull().

Referenced by ACTION_PLUGIN::register_action().

◆ SetActionButton()

void ACTION_PLUGINS::SetActionButton ( ACTION_PLUGIN aAction,
int  idButton 
)
static

Associate a button id to an action plugin.

Parameters
aActionis the action.
idButtonis the associated menuitem ID.

Definition at line 95 of file action_plugin.cpp.

References ACTION_PLUGIN::m_actionButtonId.

Referenced by PCB_EDIT_FRAME::AddActionPluginTools().

◆ SetActionMenu()

void ACTION_PLUGINS::SetActionMenu ( int  aIndex,
int  idMenu 
)
static

Associate a menu id to an action plugin.

Parameters
aIndexis the action index.
idMenuis the associated menuitem ID.

Definition at line 75 of file action_plugin.cpp.

References m_actionsList.

Referenced by PCB_EDIT_FRAME::buildActionPluginMenus().

◆ SetActionRunning()

void ACTION_PLUGINS::SetActionRunning ( bool  aRunning)
static
Parameters
aRunningsets whether an action is running now.

Definition at line 217 of file action_plugin.cpp.

References m_actionRunning.

Referenced by PCB_EDIT_FRAME::RunActionPlugin().

◆ UnloadAll()

void ACTION_PLUGINS::UnloadAll ( )
static

Unload (deregister) all action plugins.

Definition at line 223 of file action_plugin.cpp.

References m_actionsList.

Referenced by SCRIPTING_TOOL::ReloadPlugins(), and SCRIPTING_TOOL::reloadPlugins().

Member Data Documentation

◆ m_actionRunning

bool ACTION_PLUGINS::m_actionRunning = false
staticprivate

Definition at line 212 of file action_plugin.h.

Referenced by IsActionRunning(), and SetActionRunning().

◆ m_actionsList

std::vector< ACTION_PLUGIN * > ACTION_PLUGINS::m_actionsList
staticprivate

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