|
5 | 5 | #include <format> |
6 | 6 | #include <memory> |
7 | 7 |
|
| 8 | +#include <pybind11_utils/generator.h> |
8 | 9 | #include <uibase/executableinfo.h> |
9 | 10 | #include <uibase/filemapping.h> |
10 | 11 | #include <uibase/game_features/igamefeatures.h> |
11 | 12 | #include <uibase/guessedvalue.h> |
12 | 13 | #include <uibase/idownloadmanager.h> |
| 14 | +#include <uibase/iexecutable.h> |
| 15 | +#include <uibase/iexecutableslist.h> |
13 | 16 | #include <uibase/iinstallationmanager.h> |
14 | 17 | #include <uibase/imodinterface.h> |
15 | 18 | #include <uibase/imodrepositorybridge.h> |
@@ -198,6 +201,27 @@ namespace mo2::python { |
198 | 201 | .def("forced", &ExecutableForcedLoadSetting::forced) |
199 | 202 | .def("library", &ExecutableForcedLoadSetting::library) |
200 | 203 | .def("process", &ExecutableForcedLoadSetting::process); |
| 204 | + |
| 205 | + py::class_<IExecutable>(m, "IExecutable") |
| 206 | + .def("title", &IExecutable::title) |
| 207 | + .def("binaryInfo", &IExecutable::binaryInfo) |
| 208 | + .def("arguments", &IExecutable::arguments) |
| 209 | + .def("steamAppID", &IExecutable::steamAppID) |
| 210 | + .def("workingDirectory", &IExecutable::workingDirectory) |
| 211 | + .def("isShownOnToolbar", &IExecutable::isShownOnToolbar) |
| 212 | + .def("usesOwnIcon", &IExecutable::usesOwnIcon) |
| 213 | + .def("minimizeToSystemTray", &IExecutable::minimizeToSystemTray) |
| 214 | + .def("hide", &IExecutable::hide); |
| 215 | + |
| 216 | + py::class_<IExecutablesList>(m, "IExecutablesList") |
| 217 | + .def("executables", |
| 218 | + [](IExecutablesList* executablesList) { |
| 219 | + return make_generator(executablesList->executables(), |
| 220 | + py::return_value_policy::reference); |
| 221 | + }) |
| 222 | + .def("getByTitle", &IExecutablesList::getByTitle, "title"_a) |
| 223 | + .def("getByBinary", &IExecutablesList::getByBinary, "info"_a) |
| 224 | + .def("titleExists", &IExecutablesList::contains, "title"_a); |
201 | 225 | } |
202 | 226 |
|
203 | 227 | void add_modinterface_classes(py::module_ m) |
@@ -625,6 +649,8 @@ namespace mo2::python { |
625 | 649 | .def("pluginList", &IOrganizer::pluginList, |
626 | 650 | py::return_value_policy::reference) |
627 | 651 | .def("modList", &IOrganizer::modList, py::return_value_policy::reference) |
| 652 | + .def("executablesList", &IOrganizer::executablesList, |
| 653 | + py::return_value_policy::reference) |
628 | 654 | .def("gameFeatures", &IOrganizer::gameFeatures, |
629 | 655 | py::return_value_policy::reference) |
630 | 656 | .def("profile", &IOrganizer::profile) |
|
0 commit comments