From 9e4cfaa0f09019e4431799e1535165cf799b6d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Sat, 24 Oct 2020 20:52:52 +0200 Subject: [PATCH] Add IOrganizer::onProfileXXX callbacks. --- src/runner/converters.h | 8 ++++++-- src/runner/pythonrunner.cpp | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/runner/converters.h b/src/runner/converters.h index ea7ffd2..7933fbf 100644 --- a/src/runner/converters.h +++ b/src/runner/converters.h @@ -331,14 +331,18 @@ namespace utils { }; template - struct wrap_impl, Ws... > { + struct wrap_impl, Ws... > : public wrap_impl<> { + using wrap_impl<>::apply; + static auto apply(T t) { return boost::ref(t); } }; template - struct wrap_impl, Ws... > { + struct wrap_impl, Ws... > : public wrap_impl<> { + using wrap_impl<>::apply; + static auto apply(T t) { return bpy::ptr(t); } diff --git a/src/runner/pythonrunner.cpp b/src/runner/pythonrunner.cpp index d0aa990..9087f7d 100644 --- a/src/runner/pythonrunner.cpp +++ b/src/runner/pythonrunner.cpp @@ -138,6 +138,8 @@ BOOST_PYTHON_MODULE(mobase) utils::register_functor_converter&)>(); // converter for the onPluginStateChanged-callback (IPluginList) utils::register_functor_converter(); utils::register_functor_converter(); + utils::register_functor_converter>(); + utils::register_functor_converter>(); utils::register_functor_converter>(); utils::register_functor_converter(); utils::register_functor_converter)>(); @@ -327,6 +329,9 @@ BOOST_PYTHON_MODULE(mobase) .def("onAboutToRun", &IOrganizer::onAboutToRun, bpy::arg("callback")) .def("onFinishedRun", &IOrganizer::onFinishedRun, bpy::arg("callback")) .def("onUserInterfaceInitialized", &IOrganizer::onUserInterfaceInitialized, bpy::arg("callback")) + .def("onProfileCreated", &IOrganizer::onProfileCreated, bpy::arg("callback")) + .def("onProfileRenamed", &IOrganizer::onProfileRenamed, bpy::arg("callback")) + .def("onProfileRemoved", &IOrganizer::onProfileRemoved, bpy::arg("callback")) .def("onProfileChanged", &IOrganizer::onProfileChanged, bpy::arg("callback")) .def("onPluginSettingChanged", &IOrganizer::onPluginSettingChanged, bpy::arg("callback")) ;