mirror of
https://github.com/ModOrganizer2/modorganizer-plugin_python.git
synced 2026-07-27 14:03:33 -07:00
Rename the wrapper declaration and definition macros.
This commit is contained in:
@@ -26,8 +26,9 @@ namespace boost
|
||||
|
||||
using namespace MOBase;
|
||||
|
||||
|
||||
#define COMMON_I_PLUGIN_WRAPPER_DEFINITIONS_(class_name, include_requirements) \
|
||||
// See COMMON_I_PLUGIN_WRAPPER_DECLARATIONS__IMPL in proxypluginwrappers.h for explanation on
|
||||
// the "include_requirements".
|
||||
#define COMMON_I_PLUGIN_WRAPPER_DEFINITIONS_IMPL(class_name, include_requirements) \
|
||||
bool class_name::init(MOBase::IOrganizer *moInfo) \
|
||||
{ \
|
||||
return basicWrapperFunctionImplementation<bool>(this, "init", boost::python::ptr(moInfo)); \
|
||||
@@ -76,7 +77,7 @@ BOOST_PP_EXPR_IF(include_requirements, \
|
||||
} \
|
||||
QList<IPluginRequirement*> class_name::requirements_Default() const { return IPlugin::requirements(); })
|
||||
|
||||
#define COMMON_I_PLUGIN_WRAPPER_DEFINITIONS(class_name) COMMON_I_PLUGIN_WRAPPER_DEFINITIONS_(class_name, 1)
|
||||
#define COMMON_I_PLUGIN_WRAPPER_DEFINITIONS(class_name) COMMON_I_PLUGIN_WRAPPER_DEFINITIONS_IMPL(class_name, 1)
|
||||
|
||||
/// end COMMON_I_PLUGIN_WRAPPER_DEFINITIONS
|
||||
/////////////////////////////
|
||||
@@ -296,7 +297,7 @@ QString IPluginGameWrapper::getLauncherName() const
|
||||
return basicWrapperFunctionImplementation<QString>(this, "getLauncherName");
|
||||
}
|
||||
|
||||
COMMON_I_PLUGIN_WRAPPER_DEFINITIONS_(IPluginGameWrapper, 0)
|
||||
COMMON_I_PLUGIN_WRAPPER_DEFINITIONS_IMPL(IPluginGameWrapper, 0)
|
||||
|
||||
std::map<std::type_index, boost::any> IPluginGameWrapper::featureList() const
|
||||
{
|
||||
|
||||
@@ -16,8 +16,9 @@
|
||||
#include <boost/python.hpp>
|
||||
#endif
|
||||
|
||||
|
||||
#define COMMON_I_PLUGIN_WRAPPER_DECLARATIONS_(include_requirements) \
|
||||
// The wrapper for IPluginGame cannot override requirements() since it's final,
|
||||
// so we need to be able to exclude the declarations.
|
||||
#define COMMON_I_PLUGIN_WRAPPER_DECLARATIONS_IMPL(include_requirements) \
|
||||
BOOST_PP_EXPR_IF(include_requirements, \
|
||||
private: mutable boost::python::object m_Requirements; ) \
|
||||
public: \
|
||||
@@ -35,7 +36,7 @@ BOOST_PP_EXPR_IF(include_requirements, \
|
||||
virtual QList<MOBase::IPluginRequirement*> requirements() const override; \
|
||||
QList<MOBase::IPluginRequirement*> requirements_Default() const;)
|
||||
|
||||
#define COMMON_I_PLUGIN_WRAPPER_DECLARATIONS COMMON_I_PLUGIN_WRAPPER_DECLARATIONS_(1)
|
||||
#define COMMON_I_PLUGIN_WRAPPER_DECLARATIONS COMMON_I_PLUGIN_WRAPPER_DECLARATIONS_IMPL(1)
|
||||
|
||||
// Even though the base interface is not a QObject, this has to be because we have no way to pass Mod Organizer a plugin that implements multiple interfaces.
|
||||
// QObject must be the first base class because moc assumes the first base class is a QObject
|
||||
@@ -134,7 +135,7 @@ public:
|
||||
virtual QString gameVersion() const override;
|
||||
virtual QString getLauncherName() const override;
|
||||
|
||||
COMMON_I_PLUGIN_WRAPPER_DECLARATIONS_(0)
|
||||
COMMON_I_PLUGIN_WRAPPER_DECLARATIONS_IMPL(0)
|
||||
|
||||
protected:
|
||||
// Apparently, Python developers interpret an underscore in a function name as it being protected
|
||||
|
||||
Reference in New Issue
Block a user