mirror of
https://github.com/ModOrganizer2/modorganizer-plugin_python.git
synced 2026-07-27 14:03:33 -07:00
Remove useless wrappers.
This commit is contained in:
+47
-56
@@ -371,16 +371,15 @@ BOOST_PYTHON_MODULE(mobase)
|
||||
}
|
||||
|
||||
|
||||
bpy::class_<IProfileWrapper, boost::noncopyable>("IProfile")
|
||||
.def("name", bpy::pure_virtual(&IProfile::name))
|
||||
.def("absolutePath", bpy::pure_virtual(&IProfile::absolutePath))
|
||||
.def("localSavesEnabled", bpy::pure_virtual(&IProfile::localSavesEnabled))
|
||||
.def("localSettingsEnabled", bpy::pure_virtual(&IProfile::localSettingsEnabled))
|
||||
.def("invalidationActive", bpy::pure_virtual(&IProfile::invalidationActive))
|
||||
bpy::class_<IProfile, boost::noncopyable>("IProfile", bpy::no_init)
|
||||
.def("name", &IProfile::name)
|
||||
.def("absolutePath", &IProfile::absolutePath)
|
||||
.def("localSavesEnabled", &IProfile::localSavesEnabled)
|
||||
.def("localSettingsEnabled", &IProfile::localSettingsEnabled)
|
||||
.def("invalidationActive", &IProfile::invalidationActive)
|
||||
;
|
||||
|
||||
bpy::class_<IModRepositoryBridgeWrapper, boost::noncopyable>("ModRepositoryBridge")
|
||||
.def(bpy::init<bpy::optional<QObject*>>())
|
||||
bpy::class_<IModRepositoryBridge, boost::noncopyable>("ModRepositoryBridge", bpy::no_init)
|
||||
.def("requestDescription", &IModRepositoryBridge::requestDescription)
|
||||
.def("requestFiles", &IModRepositoryBridge::requestFiles)
|
||||
.def("requestFileInfo", &IModRepositoryBridge::requestFileInfo)
|
||||
@@ -390,15 +389,7 @@ BOOST_PYTHON_MODULE(mobase)
|
||||
Q_DELEGATE(IModRepositoryBridge, QObject, "_object")
|
||||
;
|
||||
|
||||
bpy::class_<IModRepositoryBridgeWrapper, boost::noncopyable>("IModRepositoryBridge")
|
||||
.def("requestDescription", bpy::pure_virtual(&IModRepositoryBridge::requestDescription))
|
||||
.def("requestFiles", bpy::pure_virtual(&IModRepositoryBridge::requestFiles))
|
||||
.def("requestFileInfo", bpy::pure_virtual(&IModRepositoryBridge::requestFileInfo))
|
||||
.def("requestDownloadURL", bpy::pure_virtual(&IModRepositoryBridge::requestDownloadURL))
|
||||
.def("requestToggleEndorsement", bpy::pure_virtual(&IModRepositoryBridge::requestToggleEndorsement))
|
||||
;
|
||||
|
||||
bpy::class_<ModRepositoryFileInfo>("ModRepositoryFileInfo")
|
||||
bpy::class_<ModRepositoryFileInfo>("ModRepositoryFileInfo", bpy::no_init)
|
||||
.def(bpy::init<const ModRepositoryFileInfo &>())
|
||||
.def(bpy::init<bpy::optional<QString, int, int>>())
|
||||
.def("__str__", &ModRepositoryFileInfo::toString)
|
||||
@@ -421,10 +412,10 @@ BOOST_PYTHON_MODULE(mobase)
|
||||
.def_readwrite("userData", &ModRepositoryFileInfo::userData)
|
||||
;
|
||||
|
||||
bpy::class_<IDownloadManagerWrapper, boost::noncopyable>("IDownloadManager")
|
||||
.def("startDownloadURLs", bpy::pure_virtual(&IDownloadManager::startDownloadURLs))
|
||||
.def("startDownloadNexusFile", bpy::pure_virtual(&IDownloadManager::startDownloadNexusFile))
|
||||
.def("downloadPath", bpy::pure_virtual(&IDownloadManager::downloadPath))
|
||||
bpy::class_<IDownloadManager, boost::noncopyable>("IDownloadManager", bpy::no_init)
|
||||
.def("startDownloadURLs", &IDownloadManager::startDownloadURLs)
|
||||
.def("startDownloadNexusFile", &IDownloadManager::startDownloadNexusFile)
|
||||
.def("downloadPath", &IDownloadManager::downloadPath)
|
||||
|
||||
Q_DELEGATE(IDownloadManager, QObject, "_object")
|
||||
;
|
||||
@@ -436,20 +427,20 @@ BOOST_PYTHON_MODULE(mobase)
|
||||
.def("setURL", &IInstallationManager::setURL)
|
||||
;
|
||||
|
||||
bpy::class_<IModInterfaceWrapper, boost::noncopyable>("IModInterface")
|
||||
.def("name", bpy::pure_virtual(&IModInterface::name))
|
||||
.def("absolutePath", bpy::pure_virtual(&IModInterface::absolutePath))
|
||||
.def("setVersion", bpy::pure_virtual(&IModInterface::setVersion))
|
||||
.def("setNewestVersion", bpy::pure_virtual(&IModInterface::setNewestVersion))
|
||||
.def("setIsEndorsed", bpy::pure_virtual(&IModInterface::setIsEndorsed))
|
||||
.def("setNexusID", bpy::pure_virtual(&IModInterface::setNexusID))
|
||||
.def("addNexusCategory", bpy::pure_virtual(&IModInterface::addNexusCategory))
|
||||
.def("addCategory", bpy::pure_virtual(&IModInterface::addCategory))
|
||||
.def("removeCategory", bpy::pure_virtual(&IModInterface::removeCategory))
|
||||
.def("categories", bpy::pure_virtual(&IModInterface::categories))
|
||||
.def("setGamePlugin", bpy::pure_virtual(&IModInterface::setGamePlugin))
|
||||
.def("setName", bpy::pure_virtual(&IModInterface::setName))
|
||||
.def("remove", bpy::pure_virtual(&IModInterface::remove))
|
||||
bpy::class_<IModInterface, boost::noncopyable>("IModInterface", bpy::no_init)
|
||||
.def("name", &IModInterface::name)
|
||||
.def("absolutePath", &IModInterface::absolutePath)
|
||||
.def("setVersion", &IModInterface::setVersion)
|
||||
.def("setNewestVersion", &IModInterface::setNewestVersion)
|
||||
.def("setIsEndorsed", &IModInterface::setIsEndorsed)
|
||||
.def("setNexusID", &IModInterface::setNexusID)
|
||||
.def("addNexusCategory", &IModInterface::addNexusCategory)
|
||||
.def("addCategory", &IModInterface::addCategory)
|
||||
.def("removeCategory", &IModInterface::removeCategory)
|
||||
.def("categories", &IModInterface::categories)
|
||||
.def("setGamePlugin", &IModInterface::setGamePlugin)
|
||||
.def("setName", &IModInterface::setName)
|
||||
.def("remove", &IModInterface::remove)
|
||||
;
|
||||
|
||||
bpy::enum_<MOBase::EGuessQuality>("GuessQuality")
|
||||
@@ -503,18 +494,18 @@ BOOST_PYTHON_MODULE(mobase)
|
||||
.value("active", IPluginList::STATE_ACTIVE)
|
||||
;
|
||||
|
||||
bpy::class_<IPluginListWrapper, boost::noncopyable>("IPluginList")
|
||||
.def("state", bpy::pure_virtual(&MOBase::IPluginList::state))
|
||||
.def("priority", bpy::pure_virtual(&MOBase::IPluginList::priority))
|
||||
.def("loadOrder", bpy::pure_virtual(&MOBase::IPluginList::loadOrder))
|
||||
.def("isMaster", bpy::pure_virtual(&MOBase::IPluginList::isMaster))
|
||||
.def("masters", bpy::pure_virtual(&MOBase::IPluginList::masters))
|
||||
.def("origin", bpy::pure_virtual(&MOBase::IPluginList::origin))
|
||||
.def("onRefreshed", bpy::pure_virtual(&MOBase::IPluginList::onRefreshed))
|
||||
.def("onPluginMoved", bpy::pure_virtual(&MOBase::IPluginList::onPluginMoved))
|
||||
.def("pluginNames", bpy::pure_virtual(&MOBase::IPluginList::pluginNames))
|
||||
.def("setState", bpy::pure_virtual(&MOBase::IPluginList::setState))
|
||||
.def("setLoadOrder", bpy::pure_virtual(&MOBase::IPluginList::setLoadOrder))
|
||||
bpy::class_<IPluginList, boost::noncopyable>("IPluginList", bpy::no_init)
|
||||
.def("state", &MOBase::IPluginList::state)
|
||||
.def("priority", &MOBase::IPluginList::priority)
|
||||
.def("loadOrder", &MOBase::IPluginList::loadOrder)
|
||||
.def("isMaster", &MOBase::IPluginList::isMaster)
|
||||
.def("masters", &MOBase::IPluginList::masters)
|
||||
.def("origin", &MOBase::IPluginList::origin)
|
||||
.def("onRefreshed", &MOBase::IPluginList::onRefreshed)
|
||||
.def("onPluginMoved", &MOBase::IPluginList::onPluginMoved)
|
||||
.def("pluginNames", &MOBase::IPluginList::pluginNames)
|
||||
.def("setState", &MOBase::IPluginList::setState)
|
||||
.def("setLoadOrder", &MOBase::IPluginList::setLoadOrder)
|
||||
;
|
||||
|
||||
bpy::enum_<IModList::ModState>("ModState")
|
||||
@@ -527,15 +518,15 @@ BOOST_PYTHON_MODULE(mobase)
|
||||
.value("alternate", IModList::STATE_ALTERNATE)
|
||||
;
|
||||
|
||||
bpy::class_<IModListWrapper, boost::noncopyable>("IModList")
|
||||
.def("displayName", bpy::pure_virtual(&MOBase::IModList::displayName))
|
||||
.def("allMods", bpy::pure_virtual(&MOBase::IModList::allMods))
|
||||
.def("state", bpy::pure_virtual(&MOBase::IModList::state))
|
||||
.def("setActive", bpy::pure_virtual(&MOBase::IModList::setActive))
|
||||
.def("priority", bpy::pure_virtual(&MOBase::IModList::priority))
|
||||
.def("setPriority", bpy::pure_virtual(&MOBase::IModList::setPriority))
|
||||
.def("onModStateChanged", bpy::pure_virtual(&MOBase::IModList::onModStateChanged))
|
||||
.def("onModMoved", bpy::pure_virtual(&MOBase::IModList::onModMoved))
|
||||
bpy::class_<IModList, boost::noncopyable>("IModList", bpy::no_init)
|
||||
.def("displayName", &MOBase::IModList::displayName)
|
||||
.def("allMods", &MOBase::IModList::allMods)
|
||||
.def("state", &MOBase::IModList::state)
|
||||
.def("setActive", &MOBase::IModList::setActive)
|
||||
.def("priority", &MOBase::IModList::priority)
|
||||
.def("setPriority", &MOBase::IModList::setPriority)
|
||||
.def("onModStateChanged", &MOBase::IModList::onModStateChanged)
|
||||
.def("onModMoved", &MOBase::IModList::onModMoved)
|
||||
;
|
||||
|
||||
bpy::class_<IPluginWrapper, boost::noncopyable>("IPlugin")
|
||||
|
||||
@@ -31,79 +31,6 @@
|
||||
|
||||
extern MOBase::IOrganizer *s_Organizer;
|
||||
|
||||
struct IProfileWrapper: MOBase::IProfile, boost::python::wrapper<MOBase::IProfile>
|
||||
{
|
||||
virtual QString name() const override { return this->get_override("name")(); }
|
||||
virtual QString absolutePath() const override { return this->get_override("absolutePath")(); }
|
||||
virtual bool localSavesEnabled() const override { return this->get_override("localSavesEnabled")(); }
|
||||
virtual bool localSettingsEnabled() const override { return this->get_override("localSettingsEnabled")(); }
|
||||
virtual bool invalidationActive(bool *supported) const override { return this->get_override("invalidationActive")(supported); }
|
||||
};
|
||||
|
||||
struct IDownloadManagerWrapper: MOBase::IDownloadManager, boost::python::wrapper<MOBase::IDownloadManager>
|
||||
{
|
||||
virtual int startDownloadURLs(const QStringList &urls) { return this->get_override("startDownloadURLs")(urls); }
|
||||
virtual int startDownloadNexusFile(int modID, int fileID) { return this->get_override("startDownloadNexusFile")(modID, fileID); }
|
||||
virtual QString downloadPath(int id) { return this->get_override("downloadPath")(id); }
|
||||
};
|
||||
|
||||
struct IModRepositoryBridgeWrapper: MOBase::IModRepositoryBridge, boost::python::wrapper<MOBase::IModRepositoryBridge>
|
||||
{
|
||||
using IModRepositoryBridge::IModRepositoryBridge;
|
||||
virtual void requestDescription(QString gameName, int modID, QVariant userData) { this->get_override("requestDescription")(gameName, modID, userData); }
|
||||
virtual void requestFiles(QString gameName, int modID, QVariant userData) { this->get_override("requestFiles")(gameName, modID, userData); }
|
||||
virtual void requestFileInfo(QString gameName, int modID, int fileID, QVariant userData) { this->get_override("requestFileInfo")(gameName, modID, fileID, userData); }
|
||||
virtual void requestDownloadURL(QString gameName, int modID, int fileID, QVariant userData) { this->get_override("requestDownloadURL")(gameName, modID, fileID, userData); }
|
||||
virtual void requestToggleEndorsement(QString gameName, int modID, QString modVersion, bool endorse, QVariant userData) { this->get_override("requestToggleEndorsement")(gameName, modID, endorse, userData); }
|
||||
};
|
||||
|
||||
struct IModInterfaceWrapper: MOBase::IModInterface, boost::python::wrapper<MOBase::IModInterface>
|
||||
{
|
||||
virtual QString name() const override { return this->get_override("name")(); }
|
||||
virtual QString absolutePath() const override { return this->get_override("absolutePath")(); }
|
||||
virtual void setVersion(const MOBase::VersionInfo &version) override { this->get_override("setVersion")(version); }
|
||||
virtual void setNewestVersion(const MOBase::VersionInfo &version) override { this->get_override("setNewestVersion")(version); }
|
||||
virtual void setIsEndorsed(bool endorsed) override { this->get_override("setIsEndorsed")(endorsed); }
|
||||
virtual void setNexusID(int nexusID) override { this->get_override("setNexusID")(nexusID); }
|
||||
virtual void setInstallationFile(const QString &fileName) override { this->get_override("setInstallationFile")(fileName); }
|
||||
virtual void addNexusCategory(int categoryID) override { this->get_override("addNexusCategory")(categoryID); }
|
||||
virtual void setGamePlugin(const MOBase::IPluginGame *gamePlugin) override { this->get_override("setGamePlugin")(gamePlugin); }
|
||||
virtual bool setName(const QString &name) override { return this->get_override("setName")(name); }
|
||||
virtual bool remove() override { return this->get_override("remove")(); }
|
||||
virtual void addCategory(const QString &categoryName) override { this->get_override("addCategory")(categoryName); }
|
||||
virtual bool removeCategory(const QString &categoryName) override { return this->get_override("removeCategory")(categoryName); }
|
||||
virtual QStringList categories() const override { return this->get_override("categories")(); }
|
||||
};
|
||||
|
||||
|
||||
struct IPluginListWrapper: MOBase::IPluginList, boost::python::wrapper<MOBase::IPluginList> {
|
||||
virtual PluginStates state(const QString &name) const { return this->get_override("state")(name); }
|
||||
virtual int priority(const QString &name) const { return this->get_override("priority")(name); }
|
||||
virtual int loadOrder(const QString &name) const { return this->get_override("loadOrder")(name); }
|
||||
virtual bool isMaster(const QString &name) const { return this->get_override("isMaster")(name); }
|
||||
virtual QStringList masters(const QString &name) const { return this->get_override("masters")(name); }
|
||||
virtual QString origin(const QString &name) const { return this->get_override("origin")(name); }
|
||||
virtual bool onRefreshed(const std::function<void ()> &callback) { return this->get_override("onRefreshed")(callback); }
|
||||
virtual bool onPluginMoved(const std::function<void (const QString &, int, int)> &callback) { return this->get_override("onPluginMoved")(callback); }
|
||||
virtual bool onPluginStateChanged(const std::function<void (const QString &, PluginStates)> &callback) override { return this->get_override("onPluginStateChanged")(callback); }
|
||||
virtual QStringList pluginNames() const override { return this->get_override("pluginNames")(); }
|
||||
virtual void setState(const QString &name, PluginStates state) override { this->get_override("setState")(name, state); }
|
||||
virtual void setLoadOrder(const QStringList &pluginList) override { this->get_override("setLoadOrder")(pluginList); }
|
||||
};
|
||||
|
||||
|
||||
struct IModListWrapper: MOBase::IModList, boost::python::wrapper<MOBase::IModList> {
|
||||
virtual QString displayName(const QString &internalName) const override { return this->get_override("displayName")(internalName); }
|
||||
virtual QStringList allMods() const override { return this->get_override("allMods")(); }
|
||||
virtual ModStates state(const QString &name) const override { return this->get_override("state")(name); }
|
||||
virtual int priority(const QString &name) const override { return this->get_override("priority")(name); }
|
||||
virtual bool setActive(const QString &name, bool active) override { return this->get_override("setActive")(name, active); }
|
||||
virtual bool setPriority(const QString &name, int newPriority) override { return this->get_override("setPriority")(name, newPriority); }
|
||||
virtual bool onModStateChanged(const std::function<void (const QString &, ModStates)> &func) override { return this->get_override("onModStateChanged")(func); }
|
||||
virtual bool onModMoved(const std::function<void (const QString &, int, int)> &func) override { return this->get_override("onModMoved")(func); }
|
||||
};
|
||||
|
||||
|
||||
// This needs to be extendable in Python, so actually needs a wrapper (everything else probably doesn't):
|
||||
class ISaveGameWrapper : public MOBase::ISaveGame, public boost::python::wrapper<MOBase::ISaveGame>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user