7 #include "pybind11/operators.h"
8 #include "pybind11/pybind11.h"
9 #include "pybind11/stl.h"
10 #include "pybind11/stl_bind.h"
12 namespace py = pybind11;
15 #ifdef PYBIND11_MODULE
16 PYBIND11_MODULE(gui_extension_demo, m)
18 m.doc() =
"hal GuiExtensionDemoPlugin python bindings";
22 py::module m(
"gui_extension_demo",
"hal GuiExtensionDemoPlugin python bindings");
24 py::class_<GuiExtensionDemoPlugin, RawPtrWrapper<GuiExtensionDemoPlugin>,
BasePluginInterface>(m,
"GuiExtensionDemoPlugin")
26 The name of the plugin.
31 Get the name of the plugin.
33 :returns: Plugin name.
37 The version of the plugin.
42 Get the version of the plugin.
44 :returns: Plugin version.
48 py::enum_<PluginParameter::ParameterType>(m, "ParameterType", R
"(
49 Defines the type of a gui input parameter.
69 py::class_<PluginParameter>(m,"PluginParameter")
70 .def(py::init<PluginParameter::ParameterType,std::string,std::string,std::string>())
72 Get tag name of parameter.
78 Get labl of parameter.
80 :returns: Parameter label.
84 Get text value parameter.
86 :returns: Parameter value.
90 Get labl of parameter.
92 :returns: Parameter type.
97 :param str tagname: Tag name for parameter.
102 :param str value: Value for parameter.
105 py::class_<GuiExtensionPythonBase>(m,"GuiExtensionPythonBase")
106 .def(py::init<std::string,std::string>())
108 Add form to main menu comprising parameter and push button (special parameter).
109 :param list[hal_py.PluginParameter] params: Parameter to be added.
112 Add context extension if single module selected.
113 :param str tagname: Tagname of function called from context menu.
114 :param str label: Entry for context menu.
117 Add context extension if single gate selected.
118 :param str tagname: Tagname of function called from context menu.
119 :param str label: Entry for context menu.
122 Add context extension if single net selected.
123 :param str tagname: Tagname of function called from context menu.
124 :param str label: Entry for context menu.
128 :returns: List of parameter.
129 :rtype: list[hal_py.PluginParameter]
132 Get IDs of selected modules.
134 :returns: List of module IDs.
138 Get IDs of selected gates.
140 :returns: List of gate IDs.
144 Get IDs of selected nets.
146 :returns: List of net IDs.
150 Get tag name of function triggered by GUI
152 :returns: Function tag name.
156 Clear all registered callbacks and function tags.
159 #ifndef PYBIND11_MODULE
std::string get_name() const override
std::string get_version() const override
std::vector< PluginParameter > get_parameter() const
virtual void add_main_menu(const std::vector< PluginParameter > ¶ms)
std::vector< u32 > get_selected_modules() const
virtual void add_gate_context(const std::string tagname, const std::string label)
std::vector< u32 > get_selected_gates() const
virtual void add_module_context(const std::string tagname, const std::string label)
std::string get_function_call() const
std::vector< u32 > get_selected_nets() const
virtual void add_net_context(const std::string tagname, const std::string label)
void set_value(const std::string &v)
std::string get_label() const
std::string get_value() const
std::string get_tagname() const
void set_tagname(const std::string &tg)
ParameterType get_type() const
const Module * module(const Gate *g, const NodeBoxes &boxes)