Loading include/pyhandler.h +76 −64 Original line number Diff line number Diff line Loading @@ -6,18 +6,17 @@ #define PYHANDLER_H #include <wx/string.h> #include <Python.h> #include <wx/wxPython/wxPython.h> #include <vector> /* Use the boost library : */ #include <boost/python.hpp> #include <Python.h> class PyHandler { typedef void (*initfunc_t )(); private: Loading @@ -38,9 +37,15 @@ class PyHandler wxString name; std::vector< initfunc_t > registry; ModuleRecord( const wxString & modName ) : name(modName) {} ModuleRecord( const wxString &modName ) : name( modName ) { } }; std::vector< ModuleRecord > m_ModuleRegistry; void DoInitModules(); // Events Loading @@ -49,11 +54,16 @@ class PyHandler wxString key; std::vector< boost::python::object > functors; Event( const wxString & strKey ) : key( strKey ) {} Event( const wxString &strKey ) : key( strKey ) { } }; std::vector< Event > m_EventRegistry; public: // Singletton handling: static PyHandler* GetInstance(); Loading @@ -80,12 +90,15 @@ class PyHandler // - C++ interface void DeclareEvent( const wxString& key ); void TriggerEvent( const wxString& key ); void TriggerEvent( const wxString & key, const boost::python::object & param ); void TriggerEvent( const wxString& key, const boost::python::object& param ); int GetEventIndex( const wxString& key ); // - Py Interface void RegisterCallback ( const wxString & key, const boost::python::object & obj ); void UnRegisterCallback( const wxString & key, const boost::python::object & obj ); void RegisterCallback( const wxString& key, const boost::python::object& obj ); void UnRegisterCallback( const wxString& key, const boost::python::object& obj ); // Object conversions Loading @@ -100,4 +113,3 @@ class PyHandler #define KICAD_PY_BIND_MODULE( mod ) PyHandler::GetInstance()->AddModule( init # mod ) #endif //PYHANDLER_H Loading
include/pyhandler.h +76 −64 Original line number Diff line number Diff line Loading @@ -6,18 +6,17 @@ #define PYHANDLER_H #include <wx/string.h> #include <Python.h> #include <wx/wxPython/wxPython.h> #include <vector> /* Use the boost library : */ #include <boost/python.hpp> #include <Python.h> class PyHandler { typedef void (*initfunc_t )(); private: Loading @@ -38,9 +37,15 @@ class PyHandler wxString name; std::vector< initfunc_t > registry; ModuleRecord( const wxString & modName ) : name(modName) {} ModuleRecord( const wxString &modName ) : name( modName ) { } }; std::vector< ModuleRecord > m_ModuleRegistry; void DoInitModules(); // Events Loading @@ -49,11 +54,16 @@ class PyHandler wxString key; std::vector< boost::python::object > functors; Event( const wxString & strKey ) : key( strKey ) {} Event( const wxString &strKey ) : key( strKey ) { } }; std::vector< Event > m_EventRegistry; public: // Singletton handling: static PyHandler* GetInstance(); Loading @@ -80,12 +90,15 @@ class PyHandler // - C++ interface void DeclareEvent( const wxString& key ); void TriggerEvent( const wxString& key ); void TriggerEvent( const wxString & key, const boost::python::object & param ); void TriggerEvent( const wxString& key, const boost::python::object& param ); int GetEventIndex( const wxString& key ); // - Py Interface void RegisterCallback ( const wxString & key, const boost::python::object & obj ); void UnRegisterCallback( const wxString & key, const boost::python::object & obj ); void RegisterCallback( const wxString& key, const boost::python::object& obj ); void UnRegisterCallback( const wxString& key, const boost::python::object& obj ); // Object conversions Loading @@ -100,4 +113,3 @@ class PyHandler #define KICAD_PY_BIND_MODULE( mod ) PyHandler::GetInstance()->AddModule( init # mod ) #endif //PYHANDLER_H