2013-09-01 18:36:43 +02:00
|
|
|
#include "proxypluginwrappers.h"
|
2018-04-25 17:25:12 +01:00
|
|
|
|
2013-09-01 18:36:43 +02:00
|
|
|
#include "gilock.h"
|
2018-04-20 16:39:58 +01:00
|
|
|
#include <QUrl>
|
2015-11-08 23:15:55 +00:00
|
|
|
#include <QWidget>
|
2018-05-03 21:56:23 +01:00
|
|
|
#include "pythonwrapperutilities.h"
|
2018-04-22 00:59:42 +01:00
|
|
|
#include "sipApiAccess.h"
|
2013-09-01 18:36:43 +02:00
|
|
|
|
2016-11-27 16:54:19 +02:00
|
|
|
namespace boost
|
|
|
|
|
{
|
2016-12-12 05:13:08 -08:00
|
|
|
// See bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2852624
|
|
|
|
|
#if (_MSC_VER == 1900)
|
2016-11-27 16:54:19 +02:00
|
|
|
template<> const volatile MOBase::IOrganizer* get_pointer(const volatile MOBase::IOrganizer* p) { return p; }
|
|
|
|
|
template<> const volatile MOBase::IModInterface* get_pointer(const volatile MOBase::IModInterface* p) { return p; }
|
|
|
|
|
template<> const volatile MOBase::IPluginGame* get_pointer(const volatile MOBase::IPluginGame* p) { return p; }
|
|
|
|
|
template<> const volatile MOBase::IProfile* get_pointer(const volatile MOBase::IProfile* p) { return p; }
|
|
|
|
|
template<> const volatile MOBase::IModList* get_pointer(const volatile MOBase::IModList* p) { return p; }
|
|
|
|
|
template<> const volatile MOBase::IPluginList* get_pointer(const volatile MOBase::IPluginList* p) { return p; }
|
|
|
|
|
template<> const volatile MOBase::IDownloadManager* get_pointer(const volatile MOBase::IDownloadManager* p) { return p; }
|
|
|
|
|
template<> const volatile MOBase::IModRepositoryBridge* get_pointer(const volatile MOBase::IModRepositoryBridge* p) { return p; }
|
2016-12-12 05:13:08 -08:00
|
|
|
#endif
|
2016-11-27 16:54:19 +02:00
|
|
|
}
|
2013-09-01 18:36:43 +02:00
|
|
|
|
|
|
|
|
using namespace MOBase;
|
|
|
|
|
|
|
|
|
|
|
2018-04-19 00:42:24 +01:00
|
|
|
#define COMMON_I_PLUGIN_WRAPPER_DEFINITIONS(class_name) \
|
|
|
|
|
bool class_name::init(MOBase::IOrganizer *moInfo) \
|
|
|
|
|
{ \
|
2018-05-03 22:22:32 +01:00
|
|
|
return basicWrapperFunctionImplementation<class_name, bool>(this, "init", boost::python::ptr(moInfo)); \
|
2018-04-19 00:42:24 +01:00
|
|
|
} \
|
|
|
|
|
\
|
|
|
|
|
QString class_name::name() const \
|
|
|
|
|
{ \
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<class_name, QString>(this, "name"); \
|
2018-04-19 00:42:24 +01:00
|
|
|
} \
|
|
|
|
|
\
|
|
|
|
|
QString class_name::author() const \
|
|
|
|
|
{ \
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<class_name, QString>(this, "author"); \
|
2018-04-19 00:42:24 +01:00
|
|
|
} \
|
|
|
|
|
\
|
|
|
|
|
QString class_name::description() const \
|
|
|
|
|
{ \
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<class_name, QString>(this, "description"); \
|
2018-04-19 00:42:24 +01:00
|
|
|
} \
|
|
|
|
|
\
|
|
|
|
|
MOBase::VersionInfo class_name::version() const \
|
|
|
|
|
{ \
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<class_name, MOBase::VersionInfo>(this, "version"); \
|
2018-04-19 00:42:24 +01:00
|
|
|
} \
|
|
|
|
|
\
|
|
|
|
|
bool class_name::isActive() const \
|
|
|
|
|
{ \
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<class_name, bool>(this, "isActive"); \
|
2018-04-19 00:42:24 +01:00
|
|
|
} \
|
|
|
|
|
\
|
|
|
|
|
QList<MOBase::PluginSetting> class_name::settings() const \
|
|
|
|
|
{ \
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<class_name, QList<MOBase::PluginSetting>>(this, "settings"); \
|
2018-04-19 00:42:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// end COMMON_I_PLUGIN_WRAPPER_DEFINITIONS
|
2016-01-10 19:50:19 +01:00
|
|
|
/////////////////////////////
|
|
|
|
|
/// IPlugin Wrapper
|
2018-04-17 21:07:42 +01:00
|
|
|
|
|
|
|
|
|
2018-04-19 00:42:24 +01:00
|
|
|
COMMON_I_PLUGIN_WRAPPER_DEFINITIONS(IPluginWrapper)
|
2016-01-10 19:50:19 +01:00
|
|
|
/// end IPlugin Wrapper
|
2013-09-01 18:36:43 +02:00
|
|
|
/////////////////////////////////////
|
2018-04-19 00:50:28 +01:00
|
|
|
/// IPluginDiagnose Wrapper
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COMMON_I_PLUGIN_WRAPPER_DEFINITIONS(IPluginDiagnoseWrapper)
|
|
|
|
|
|
|
|
|
|
std::vector<unsigned int> IPluginDiagnoseWrapper::activeProblems() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginDiagnoseWrapper, std::vector<unsigned int>>(this, "activeProblems");
|
2018-04-19 00:50:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginDiagnoseWrapper::shortDescription(unsigned int key) const
|
|
|
|
|
{
|
2018-05-03 22:22:32 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginDiagnoseWrapper, QString>(this, "shortDescription", key);
|
2018-04-19 00:50:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginDiagnoseWrapper::fullDescription(unsigned int key) const
|
|
|
|
|
{
|
2018-05-03 22:22:32 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginDiagnoseWrapper, QString>(this, "fullDescription", key);
|
2018-04-19 00:50:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IPluginDiagnoseWrapper::hasGuidedFix(unsigned int key) const
|
|
|
|
|
{
|
2018-05-03 22:22:32 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginDiagnoseWrapper, bool>(this, "hasGuidedFix", key);
|
2018-04-19 00:50:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IPluginDiagnoseWrapper::startGuidedFix(unsigned int key) const
|
|
|
|
|
{
|
2018-05-03 22:22:32 +01:00
|
|
|
basicWrapperFunctionImplementation<IPluginDiagnoseWrapper, void>(this, "startGuidedFix", key);
|
2018-04-19 00:50:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IPluginDiagnoseWrapper::invalidate()
|
|
|
|
|
{
|
|
|
|
|
IPluginDiagnose::invalidate();
|
|
|
|
|
}
|
|
|
|
|
/// end IPluginDiagnose Wrapper
|
|
|
|
|
/////////////////////////////////////
|
2018-04-19 02:09:27 +01:00
|
|
|
/// IPluginFileMapper Wrapper
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COMMON_I_PLUGIN_WRAPPER_DEFINITIONS(IPluginFileMapperWrapper)
|
|
|
|
|
|
|
|
|
|
MappingType IPluginFileMapperWrapper::mappings() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginFileMapperWrapper, MappingType>(this, "mappings");
|
2018-04-19 02:09:27 +01:00
|
|
|
}
|
|
|
|
|
/// end IPluginFileMapper Wrapper
|
|
|
|
|
/////////////////////////////////////
|
2018-04-17 23:03:08 +01:00
|
|
|
/// IPluginGame Wrapper
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QString IPluginGameWrapper::gameName() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, QString>(this, "gameName");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IPluginGameWrapper::initializeProfile(const QDir & directory, ProfileSettings settings) const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
basicWrapperFunctionImplementation<IPluginGameWrapper, void>(this, "initializeProfile", directory, settings);
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginGameWrapper::savegameExtension() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, QString>(this, "savegameExtension");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginGameWrapper::savegameSEExtension() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, QString>(this, "savegameSEExtension");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IPluginGameWrapper::isInstalled() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, bool>(this, "isInstalled");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QIcon IPluginGameWrapper::gameIcon() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, QIcon>(this, "gameIcon");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QDir IPluginGameWrapper::gameDirectory() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, QDir>(this, "gameDirectory");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QDir IPluginGameWrapper::dataDirectory() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, QDir>(this, "dataDirectory");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IPluginGameWrapper::setGamePath(const QString & path)
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
basicWrapperFunctionImplementation<IPluginGameWrapper, void>(this, "setGamePath", path);
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QDir IPluginGameWrapper::documentsDirectory() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, QDir>(this, "documentsDirectory");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QDir IPluginGameWrapper::savesDirectory() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, QDir>(this, "savesDirectory");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QList<MOBase::ExecutableInfo> IPluginGameWrapper::executables() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, QList<MOBase::ExecutableInfo>>(this, "executables");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
2019-01-11 01:39:05 -06:00
|
|
|
QList<MOBase::ExecutableForcedLoadSetting> IPluginGameWrapper::executableForcedLoads() const
|
|
|
|
|
{
|
|
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, QList<MOBase::ExecutableForcedLoadSetting>>(this, "executableForcedLoads");
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-17 23:03:08 +01:00
|
|
|
QString IPluginGameWrapper::steamAPPId() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, QString>(this, "steamAPPId");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QStringList IPluginGameWrapper::primaryPlugins() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, QStringList>(this, "primaryPlugins");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QStringList IPluginGameWrapper::gameVariants() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, QStringList>(this, "gameVariants");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IPluginGameWrapper::setGameVariant(const QString & variant)
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
basicWrapperFunctionImplementation<IPluginGameWrapper, void>(this, "setGameVariant", variant);
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginGameWrapper::binaryName() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, QString>(this, "binaryName");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginGameWrapper::gameShortName() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, QString>(this, "gameShortName");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
2018-05-03 16:17:39 -05:00
|
|
|
QStringList IPluginGameWrapper::primarySources() const
|
|
|
|
|
{
|
2018-05-03 22:32:31 -05:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, QStringList>(this, "primarySources");
|
2018-05-03 16:17:39 -05:00
|
|
|
}
|
|
|
|
|
|
2018-04-17 23:03:08 +01:00
|
|
|
QStringList IPluginGameWrapper::validShortNames() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, QStringList>(this, "validShortNames");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginGameWrapper::gameNexusName() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, QString>(this, "gameNexusName");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QStringList IPluginGameWrapper::iniFiles() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, QStringList>(this, "iniFiles");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QStringList IPluginGameWrapper::DLCPlugins() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, QStringList>(this, "DLCPlugins");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QStringList IPluginGameWrapper::CCPlugins() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, QStringList>(this, "CCPlugins");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IPluginGame::LoadOrderMechanism IPluginGameWrapper::loadOrderMechanism() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, IPluginGame::LoadOrderMechanism>(this, "loadOrderMechanism");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IPluginGame::SortMechanism IPluginGameWrapper::sortMechanism() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, IPluginGame::SortMechanism>(this, "sortMechanism");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int IPluginGameWrapper::nexusModOrganizerID() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, int>(this, "nexusModOrganizerID");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int IPluginGameWrapper::nexusGameID() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, int>(this, "nexusGameID");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IPluginGameWrapper::looksValid(QDir const & dir) const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, bool>(this, "looksValid", dir);
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginGameWrapper::gameVersion() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, QString>(this, "gameVersion");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginGameWrapper::getLauncherName() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, QString>(this, "getLauncherName");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
2018-04-19 00:42:24 +01:00
|
|
|
COMMON_I_PLUGIN_WRAPPER_DEFINITIONS(IPluginGameWrapper)
|
2018-04-17 23:03:08 +01:00
|
|
|
|
|
|
|
|
std::map<std::type_index, boost::any> IPluginGameWrapper::featureList() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginGameWrapper, std::map<std::type_index, boost::any>>(this, "_featureList");
|
2018-04-17 23:03:08 +01:00
|
|
|
}
|
|
|
|
|
/// end IPluginGame Wrapper
|
|
|
|
|
/////////////////////////////////////
|
2013-09-01 18:36:43 +02:00
|
|
|
/// IPluginInstallerCustom Wrapper
|
|
|
|
|
|
|
|
|
|
|
2018-04-19 00:42:24 +01:00
|
|
|
COMMON_I_PLUGIN_WRAPPER_DEFINITIONS(IPluginInstallerCustomWrapper)
|
2013-09-01 18:36:43 +02:00
|
|
|
|
|
|
|
|
unsigned int IPluginInstallerCustomWrapper::priority() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginInstallerCustomWrapper, unsigned int>(this, "priority");
|
2013-09-01 18:36:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IPluginInstallerCustomWrapper::isManualInstaller() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginInstallerCustomWrapper, bool>(this, "isManualInstaller");
|
2013-09-01 18:36:43 +02:00
|
|
|
}
|
|
|
|
|
|
2018-05-03 21:56:23 +01:00
|
|
|
bool IPluginInstallerCustomWrapper::isArchiveSupported(const DirectoryTree &archiveTree) const
|
2013-09-01 18:36:43 +02:00
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
//return basicWrapperFunctionImplementation<IPluginInstallerCustomWrapper, bool>(this, "isArchiveSupported", archiveTree);
|
|
|
|
|
// This was a stub implementation when I got here, and a real one won't compile.
|
|
|
|
|
return false;
|
2013-09-01 18:36:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IPluginInstallerCustomWrapper::isArchiveSupported(const QString &archiveName) const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginInstallerCustomWrapper, bool>(this, "isArchiveSupported", archiveName);
|
2013-09-01 18:36:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::set<QString> IPluginInstallerCustomWrapper::supportedExtensions() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginInstallerCustomWrapper, std::set<QString>>(this, "supportedExtensions");
|
2013-09-01 18:36:43 +02:00
|
|
|
}
|
|
|
|
|
|
2018-05-07 01:28:59 -05:00
|
|
|
IPluginInstaller::EInstallResult IPluginInstallerCustomWrapper::install(GuessedValue<QString> &modName, QString gameName, const QString &archiveName,
|
2018-04-17 22:31:53 +01:00
|
|
|
const QString &version, int modID)
|
2013-09-01 18:36:43 +02:00
|
|
|
{
|
2018-05-07 01:28:59 -05:00
|
|
|
return basicWrapperFunctionImplementation<IPluginInstallerCustomWrapper, IPluginInstaller::EInstallResult>(this, "install", modName, gameName, archiveName, version, modID);
|
2013-09-01 18:36:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void IPluginInstallerCustomWrapper::setParentWidget(QWidget *parent)
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
basicWrapperFunctionImplementation<IPluginInstallerCustomWrapper, void>(this, "setParentWidget", parent);
|
2013-09-01 18:36:43 +02:00
|
|
|
}
|
2018-04-17 21:07:42 +01:00
|
|
|
/// end IPluginInstallerCustom Wrapper
|
|
|
|
|
/////////////////////////////
|
2018-04-20 16:39:58 +01:00
|
|
|
/// IPluginModPage Wrapper
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COMMON_I_PLUGIN_WRAPPER_DEFINITIONS(IPluginModPageWrapper)
|
|
|
|
|
|
|
|
|
|
QString IPluginModPageWrapper::displayName() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginModPageWrapper, QString>(this, "displayName");
|
2018-04-20 16:39:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QIcon IPluginModPageWrapper::icon() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginModPageWrapper, QIcon>(this, "icon");
|
2018-04-20 16:39:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QUrl IPluginModPageWrapper::pageURL() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginModPageWrapper, QUrl>(this, "pageURL");
|
2018-04-20 16:39:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IPluginModPageWrapper::useIntegratedBrowser() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginModPageWrapper, bool>(this, "useIntegratedBrowser");
|
2018-04-20 16:39:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool IPluginModPageWrapper::handlesDownload(const QUrl & pageURL, const QUrl & downloadURL, MOBase::ModRepositoryFileInfo & fileInfo) const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginModPageWrapper, bool>(this, "handlesDownload", pageURL, downloadURL, fileInfo);
|
2018-04-20 16:39:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IPluginModPageWrapper::setParentWidget(QWidget * widget)
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
basicWrapperFunctionImplementation<IPluginModPageWrapper, void>(this, "setParentWidget", widget);
|
2018-04-20 16:39:58 +01:00
|
|
|
}
|
|
|
|
|
/// end IPluginModPage Wrapper
|
|
|
|
|
/////////////////////////////
|
2018-04-22 00:34:59 +01:00
|
|
|
/// IPluginPreview Wrapper
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COMMON_I_PLUGIN_WRAPPER_DEFINITIONS(IPluginPreviewWrapper)
|
|
|
|
|
|
|
|
|
|
std::set<QString> IPluginPreviewWrapper::supportedExtensions() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginPreviewWrapper, std::set<QString>>(this, "supportedExtensions");
|
2018-04-22 00:34:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QWidget *IPluginPreviewWrapper::genFilePreview(const QString &fileName, const QSize &maxSize) const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
// This is complicated, so we can't use the basic implementation
|
2018-04-22 00:34:59 +01:00
|
|
|
try {
|
2019-06-01 00:57:16 +01:00
|
|
|
GILock lock;
|
2018-05-03 21:56:23 +01:00
|
|
|
boost::python::override implementation = this->get_override("genFilePreview");
|
|
|
|
|
if (!implementation)
|
|
|
|
|
throw MissingImplementation(this->className, "genFilePreview");
|
|
|
|
|
boost::python::object pyVersion = implementation(fileName, maxSize);
|
2018-04-22 00:34:59 +01:00
|
|
|
// We need responsibility for deleting the QWidget to be transferred to C++
|
2019-07-01 22:19:14 -05:00
|
|
|
sipAPIAccess::sipAPI()->api_transfer_to(pyVersion.ptr(), Py_None);
|
2018-04-22 00:34:59 +01:00
|
|
|
return boost::python::extract<QWidget *>(pyVersion)();
|
|
|
|
|
} PYCATCH;
|
|
|
|
|
}
|
|
|
|
|
/// end IPluginPreview Wrapper
|
|
|
|
|
/////////////////////////////
|
2018-04-17 21:07:42 +01:00
|
|
|
/// IPluginTool Wrapper
|
2013-09-01 18:36:43 +02:00
|
|
|
|
|
|
|
|
|
2018-04-19 00:42:24 +01:00
|
|
|
COMMON_I_PLUGIN_WRAPPER_DEFINITIONS(IPluginToolWrapper)
|
2018-04-17 21:07:42 +01:00
|
|
|
|
|
|
|
|
QString IPluginToolWrapper::displayName() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginToolWrapper, QString>(this, "displayName");
|
2018-04-17 21:07:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString IPluginToolWrapper::tooltip() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginToolWrapper, QString>(this, "tooltip");
|
2018-04-17 21:07:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QIcon IPluginToolWrapper::icon() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
return basicWrapperFunctionImplementation<IPluginToolWrapper, QIcon>(this, "icon");
|
2018-04-17 21:07:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IPluginToolWrapper::setParentWidget(QWidget *parent)
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
basicWrapperFunctionImplementation<IPluginToolWrapper, void>(this, "setParentWidget", parent);
|
2018-04-17 21:07:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void IPluginToolWrapper::display() const
|
|
|
|
|
{
|
2018-05-03 21:56:23 +01:00
|
|
|
basicWrapperFunctionImplementation<IPluginToolWrapper, void>(this, "display");
|
2018-04-17 21:07:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// end IPluginTool Wrapper
|