Rename the wrapper declaration and definition macros.

This commit is contained in:
Mikaël Capelle
2020-11-11 22:02:40 +01:00
parent 27c34af2aa
commit cbb911f6a0
2 changed files with 10 additions and 8 deletions
+5 -4
View File
@@ -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
{
+5 -4
View File
@@ -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