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

#include <pcbnew_action_plugins.h>

Inheritance diagram for PYTHON_ACTION_PLUGIN:
ACTION_PLUGIN

Public Member Functions

 PYTHON_ACTION_PLUGIN (PyObject *action)
 
 ~PYTHON_ACTION_PLUGIN ()
 
wxString GetCategoryName () override
 
wxString GetClassName () override
 
wxString GetName () override
 
wxString GetDescription () override
 
bool GetShowToolbarButton () override
 
wxString GetIconFileName (bool aDark) override
 
wxString GetPluginPath () override
 
void Run () override
 This method the the action.
 
void * GetObject () override
 This method gets the pointer to the object from where this action constructs.
 
void register_action ()
 It's the standard method of a "ACTION_PLUGIN" to register itself into the ACTION_PLUGINS singleton manager.
 

Public Attributes

int m_actionMenuId
 
int m_actionButtonId
 
wxBitmap iconBitmap
 
bool show_on_toolbar
 

Private Member Functions

PyObject * CallMethod (const char *aMethod, PyObject *aArglist=nullptr)
 
wxString CallRetStrMethod (const char *aMethod, PyObject *aArglist=nullptr)
 

Private Attributes

wxString m_cachedName
 
PyObject * m_PyAction
 

Detailed Description

Definition at line 40 of file pcbnew_action_plugins.h.

Constructor & Destructor Documentation

◆ PYTHON_ACTION_PLUGIN()

PYTHON_ACTION_PLUGIN::PYTHON_ACTION_PLUGIN ( PyObject *  action)

Definition at line 48 of file pcbnew_action_plugins.cpp.

References m_PyAction.

◆ ~PYTHON_ACTION_PLUGIN()

PYTHON_ACTION_PLUGIN::~PYTHON_ACTION_PLUGIN ( )

Definition at line 57 of file pcbnew_action_plugins.cpp.

References m_PyAction.

Member Function Documentation

◆ CallMethod()

PyObject * PYTHON_ACTION_PLUGIN::CallMethod ( const char *  aMethod,
PyObject *  aArglist = nullptr 
)
private

◆ CallRetStrMethod()

wxString PYTHON_ACTION_PLUGIN::CallRetStrMethod ( const char *  aMethod,
PyObject *  aArglist = nullptr 
)
private

◆ GetCategoryName()

wxString PYTHON_ACTION_PLUGIN::GetCategoryName ( )
overridevirtual
Returns
the category name of the action (to be able to group action under the same submenu).

Implements ACTION_PLUGIN.

Definition at line 166 of file pcbnew_action_plugins.cpp.

References CallRetStrMethod().

◆ GetClassName()

wxString PYTHON_ACTION_PLUGIN::GetClassName ( )
overridevirtual
Returns
the name of the Python class defining the action

Implements ACTION_PLUGIN.

Definition at line 174 of file pcbnew_action_plugins.cpp.

References CallRetStrMethod().

◆ GetDescription()

wxString PYTHON_ACTION_PLUGIN::GetDescription ( )
overridevirtual
Returns
a description of the action plugin.

Implements ACTION_PLUGIN.

Definition at line 193 of file pcbnew_action_plugins.cpp.

References CallRetStrMethod().

◆ GetIconFileName()

wxString PYTHON_ACTION_PLUGIN::GetIconFileName ( bool  aDark)
overridevirtual
Parameters
aDarkset to true if requesting dark theme icon.
Returns
a path to icon for the action plugin button.

Implements ACTION_PLUGIN.

Definition at line 211 of file pcbnew_action_plugins.cpp.

References CallRetStrMethod().

◆ GetName()

wxString PYTHON_ACTION_PLUGIN::GetName ( )
overridevirtual
Returns
the name of the action.

Implements ACTION_PLUGIN.

Definition at line 182 of file pcbnew_action_plugins.cpp.

References CallRetStrMethod(), m_cachedName, and name.

◆ GetObject()

void * PYTHON_ACTION_PLUGIN::GetObject ( )
overridevirtual

This method gets the pointer to the object from where this action constructs.

Returns
it's a void pointer, as it could be a PyObject or any other

Implements ACTION_PLUGIN.

Definition at line 241 of file pcbnew_action_plugins.cpp.

References m_PyAction.

◆ GetPluginPath()

wxString PYTHON_ACTION_PLUGIN::GetPluginPath ( )
overridevirtual
Returns
a path this plugin was loaded from.

Implements ACTION_PLUGIN.

Definition at line 225 of file pcbnew_action_plugins.cpp.

References CallRetStrMethod().

◆ GetShowToolbarButton()

bool PYTHON_ACTION_PLUGIN::GetShowToolbarButton ( )
overridevirtual
Returns
true if button should be shown on top toolbar.

Implements ACTION_PLUGIN.

Definition at line 201 of file pcbnew_action_plugins.cpp.

References CallMethod().

◆ register_action()

void ACTION_PLUGIN::register_action ( )
inherited

It's the standard method of a "ACTION_PLUGIN" to register itself into the ACTION_PLUGINS singleton manager.

Definition at line 43 of file action_plugin.cpp.

References ACTION_PLUGINS::register_action().

Referenced by PYTHON_ACTION_PLUGINS::register_action().

◆ Run()

void PYTHON_ACTION_PLUGIN::Run ( )
overridevirtual

This method the the action.

Implements ACTION_PLUGIN.

Definition at line 233 of file pcbnew_action_plugins.cpp.

References CallMethod().

Member Data Documentation

◆ iconBitmap

wxBitmap ACTION_PLUGIN::iconBitmap
inherited

◆ m_actionButtonId

int ACTION_PLUGIN::m_actionButtonId
inherited

Definition at line 106 of file action_plugin.h.

Referenced by ACTION_PLUGINS::SetActionButton().

◆ m_actionMenuId

int ACTION_PLUGIN::m_actionMenuId
inherited

Definition at line 103 of file action_plugin.h.

◆ m_cachedName

wxString PYTHON_ACTION_PLUGIN::m_cachedName
private

Definition at line 56 of file pcbnew_action_plugins.h.

Referenced by CallMethod(), and GetName().

◆ m_PyAction

PyObject* PYTHON_ACTION_PLUGIN::m_PyAction
private

◆ show_on_toolbar

bool ACTION_PLUGIN::show_on_toolbar
inherited

Definition at line 112 of file action_plugin.h.


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