From 93aeac258aadc2e7fc9baa9f7526bff8224eb77f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 25 Mar 2018 21:06:27 +0200 Subject: [PATCH] Adapted to Corrade::PluginManager changes. --- src/Magnum/Audio/AbstractImporter.cpp | 4 ++++ src/Magnum/Audio/AbstractImporter.h | 13 +++++++++---- src/Magnum/Text/AbstractFont.cpp | 4 ++++ src/Magnum/Text/AbstractFont.h | 13 +++++++++---- src/Magnum/Text/AbstractFontConverter.cpp | 4 ++++ src/Magnum/Text/AbstractFontConverter.h | 14 ++++++++++---- src/Magnum/Trade/AbstractImageConverter.cpp | 4 ++++ src/Magnum/Trade/AbstractImageConverter.h | 13 +++++++++---- src/Magnum/Trade/AbstractImporter.cpp | 4 ++++ src/Magnum/Trade/AbstractImporter.h | 13 +++++++++---- src/MagnumPlugins/MagnumFont/MagnumFont.cpp | 1 + .../MagnumFont/pluginRegistration.cpp | 2 ++ .../MagnumFontConverter/MagnumFontConverter.cpp | 1 + .../MagnumFontConverter/pluginRegistration.cpp | 2 ++ 14 files changed, 72 insertions(+), 20 deletions(-) diff --git a/src/Magnum/Audio/AbstractImporter.cpp b/src/Magnum/Audio/AbstractImporter.cpp index 8b3972c88..cfdf73106 100644 --- a/src/Magnum/Audio/AbstractImporter.cpp +++ b/src/Magnum/Audio/AbstractImporter.cpp @@ -31,6 +31,10 @@ namespace Magnum { namespace Audio { +std::string AbstractImporter::pluginInterface() { + return "cz.mosra.magnum.Audio.AbstractImporter/0.1"; +} + AbstractImporter::AbstractImporter() = default; AbstractImporter::AbstractImporter(PluginManager::Manager& manager): PluginManager::AbstractManagingPlugin{manager} {} diff --git a/src/Magnum/Audio/AbstractImporter.h b/src/Magnum/Audio/AbstractImporter.h index 094b37079..06ad870a9 100644 --- a/src/Magnum/Audio/AbstractImporter.h +++ b/src/Magnum/Audio/AbstractImporter.h @@ -60,16 +60,12 @@ checked by the implementation: - All `do*()` implementations working on opened file are called only if there is any file opened. -Plugin interface string is @cpp "cz.mosra.magnum.Audio.AbstractImporter/0.1" @ce. - @attention @ref Corrade::Containers::Array instances returned from the plugin should *not* use anything else than the default deleter, otherwise this can cause dangling function pointer call on array destruction if the plugin gets unloaded before the array is destroyed. */ class MAGNUM_AUDIO_EXPORT AbstractImporter: public PluginManager::AbstractManagingPlugin { - CORRADE_PLUGIN_INTERFACE("cz.mosra.magnum.Audio.AbstractImporter/0.1") - public: /** * @brief Features supported by this importer @@ -88,6 +84,15 @@ class MAGNUM_AUDIO_EXPORT AbstractImporter: public PluginManager::AbstractManagi */ typedef Containers::EnumSet Features; + /** + * @brief Plugin interface + * + * @code{.cpp} + * "cz.mosra.magnum.Audio.AbstractImporter/0.1" + * @endcode + */ + static std::string pluginInterface(); + /** @brief Default constructor */ explicit AbstractImporter(); diff --git a/src/Magnum/Text/AbstractFont.cpp b/src/Magnum/Text/AbstractFont.cpp index f66ecbff2..077e3d71b 100644 --- a/src/Magnum/Text/AbstractFont.cpp +++ b/src/Magnum/Text/AbstractFont.cpp @@ -34,6 +34,10 @@ namespace Magnum { namespace Text { +std::string AbstractFont::pluginInterface() { + return "cz.mosra.magnum.Text.AbstractFont/0.2.4"; +} + AbstractFont::AbstractFont(): _size(0.0f) {} AbstractFont::AbstractFont(PluginManager::AbstractManager& manager, const std::string& plugin): AbstractPlugin{manager, plugin}, _size{0.0f}, _lineHeight{0.0f} {} diff --git a/src/Magnum/Text/AbstractFont.h b/src/Magnum/Text/AbstractFont.h index 20fc8a954..d11b9ed28 100644 --- a/src/Magnum/Text/AbstractFont.h +++ b/src/Magnum/Text/AbstractFont.h @@ -71,12 +71,8 @@ checked by the implementation: @ref Feature::OpenData is supported. - All `do*()` implementations working on opened file are called only if there is any file opened. - -Plugin interface string is @cpp "cz.mosra.magnum.Text.AbstractFont/0.2.4" @ce. */ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { - CORRADE_PLUGIN_INTERFACE("cz.mosra.magnum.Text.AbstractFont/0.2.4") - public: /** * @brief Features supported by this importer @@ -104,6 +100,15 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { /** @brief Set of features supported by this importer */ typedef Containers::EnumSet Features; + /** + * @brief Plugin interface + * + * @code{.cpp} + * "cz.mosra.magnum.Text.AbstractFont/0.2.4" + * @endcode + */ + static std::string pluginInterface(); + /** @brief Default constructor */ explicit AbstractFont(); diff --git a/src/Magnum/Text/AbstractFontConverter.cpp b/src/Magnum/Text/AbstractFontConverter.cpp index 6abd66bcd..21bc93a4b 100644 --- a/src/Magnum/Text/AbstractFontConverter.cpp +++ b/src/Magnum/Text/AbstractFontConverter.cpp @@ -51,6 +51,10 @@ std::u32string uniqueUnicode(const std::string& characters) } +std::string AbstractFontConverter::pluginInterface() { + return "cz.mosra.magnum.Text.AbstractFontConverter/0.1.2"; +} + AbstractFontConverter::AbstractFontConverter() = default; AbstractFontConverter::AbstractFontConverter(PluginManager::AbstractManager& manager, const std::string& plugin): PluginManager::AbstractPlugin{manager, plugin} {} diff --git a/src/Magnum/Text/AbstractFontConverter.h b/src/Magnum/Text/AbstractFontConverter.h index 5646892cc..b439d9983 100644 --- a/src/Magnum/Text/AbstractFontConverter.h +++ b/src/Magnum/Text/AbstractFontConverter.h @@ -30,6 +30,7 @@ */ #include +#include #include #include "Magnum/Magnum.h" @@ -68,16 +69,12 @@ checked by the implementation: - Function `doImport*FromData()` is called only if there is at least one data array passed. -Plugin interface string is @cpp "cz.mosra.magnum.Text.AbstractFontConverter/0.1.2" @ce. - @attention @ref Corrade::Containers::Array instances returned from the plugin should *not* use anything else than the default deleter, otherwise this can cause dangling function pointer call on array destruction if the plugin gets unloaded before the array is destroyed. */ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPlugin { - CORRADE_PLUGIN_INTERFACE("cz.mosra.magnum.Text.AbstractFontConverter/0.1.2") - public: /** * @brief Features supported by this converter @@ -129,6 +126,15 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl */ typedef Containers::EnumSet Features; + /** + * @brief Plugin interface + * + * @code{.cpp} + * "cz.mosra.magnum.Text.AbstractFontConverter/0.1.2" + * @endcode + */ + static std::string pluginInterface(); + /** @brief Default constructor */ explicit AbstractFontConverter(); diff --git a/src/Magnum/Trade/AbstractImageConverter.cpp b/src/Magnum/Trade/AbstractImageConverter.cpp index 5307c1d77..cf781e130 100644 --- a/src/Magnum/Trade/AbstractImageConverter.cpp +++ b/src/Magnum/Trade/AbstractImageConverter.cpp @@ -34,6 +34,10 @@ namespace Magnum { namespace Trade { +std::string AbstractImageConverter::pluginInterface() { + return "cz.mosra.magnum.Trade.AbstractImporter/0.3"; +} + AbstractImageConverter::AbstractImageConverter() = default; AbstractImageConverter::AbstractImageConverter(PluginManager::Manager& manager): PluginManager::AbstractManagingPlugin{manager} {} diff --git a/src/Magnum/Trade/AbstractImageConverter.h b/src/Magnum/Trade/AbstractImageConverter.h index 4e15cf40f..3dfe440f4 100644 --- a/src/Magnum/Trade/AbstractImageConverter.h +++ b/src/Magnum/Trade/AbstractImageConverter.h @@ -68,16 +68,12 @@ checked by the implementation: - The function @ref doExportToData(const CompressedImageView2D&) is called only if @ref Feature::ConvertCompressedData is supported. -Plugin interface string is @cpp "cz.mosra.magnum.Trade.AbstractImageConverter/0.2.1" @ce. - @attention @ref Corrade::Containers::Array instances returned from the plugin should *not* use anything else than the default deleter, otherwise this can cause dangling function pointer call on array destruction if the plugin gets unloaded before the array is destroyed. */ class MAGNUM_EXPORT AbstractImageConverter: public PluginManager::AbstractManagingPlugin { - CORRADE_PLUGIN_INTERFACE("cz.mosra.magnum.Trade.AbstractImageConverter/0.2.1") - public: /** * @brief Features supported by this converter @@ -118,6 +114,15 @@ class MAGNUM_EXPORT AbstractImageConverter: public PluginManager::AbstractManagi */ typedef Containers::EnumSet Features; + /** + * @brief Plugin interface + * + * @code{.cpp} + * "cz.mosra.magnum.Trade.AbstractImageConverter/0.2.1" + * @endcode + */ + static std::string pluginInterface(); + /** @brief Default constructor */ explicit AbstractImageConverter(); diff --git a/src/Magnum/Trade/AbstractImporter.cpp b/src/Magnum/Trade/AbstractImporter.cpp index 4ee01d4d5..19db18ac7 100644 --- a/src/Magnum/Trade/AbstractImporter.cpp +++ b/src/Magnum/Trade/AbstractImporter.cpp @@ -43,6 +43,10 @@ namespace Magnum { namespace Trade { +std::string AbstractImporter::pluginInterface() { + return "cz.mosra.magnum.Trade.AbstractImporter/0.3"; +} + AbstractImporter::AbstractImporter() = default; AbstractImporter::AbstractImporter(PluginManager::Manager& manager): PluginManager::AbstractManagingPlugin{manager} {} diff --git a/src/Magnum/Trade/AbstractImporter.h b/src/Magnum/Trade/AbstractImporter.h index e57c38c16..ba9fc44c3 100644 --- a/src/Magnum/Trade/AbstractImporter.h +++ b/src/Magnum/Trade/AbstractImporter.h @@ -79,8 +79,6 @@ checked by the implementation: - All `do*()` implementations taking data ID as parameter are called only if the ID is from valid range. -Plugin interface string is @cpp "cz.mosra.magnum.Trade.AbstractImporter/0.3" @ce. - @attention @ref Corrade::Containers::Array instances returned from the plugin should *not* use anything else than the default deleter, otherwise this can cause dangling function pointer call on array destruction if the plugin @@ -89,8 +87,6 @@ Plugin interface string is @cpp "cz.mosra.magnum.Trade.AbstractImporter/0.3" @ce @todo How to handle casting from std::unique_ptr<> in more convenient way? */ class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractManagingPlugin { - CORRADE_PLUGIN_INTERFACE("cz.mosra.magnum.Trade.AbstractImporter/0.3") - public: /** * @brief Features supported by this importer @@ -108,6 +104,15 @@ class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractManagingPlug /** @brief Set of features supported by this importer */ typedef Containers::EnumSet Features; + /** + * @brief Plugin interface + * + * @code{.cpp} + * "cz.mosra.magnum.Trade.AbstractImporter/0.3" + * @endcode + */ + static std::string pluginInterface(); + /** @brief Default constructor */ explicit AbstractImporter(); diff --git a/src/MagnumPlugins/MagnumFont/MagnumFont.cpp b/src/MagnumPlugins/MagnumFont/MagnumFont.cpp index bd2baf6d0..d4640c473 100644 --- a/src/MagnumPlugins/MagnumFont/MagnumFont.cpp +++ b/src/MagnumPlugins/MagnumFont/MagnumFont.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include diff --git a/src/MagnumPlugins/MagnumFont/pluginRegistration.cpp b/src/MagnumPlugins/MagnumFont/pluginRegistration.cpp index 11f89232f..4b61aeb7f 100644 --- a/src/MagnumPlugins/MagnumFont/pluginRegistration.cpp +++ b/src/MagnumPlugins/MagnumFont/pluginRegistration.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#include + #include "MagnumPlugins/MagnumFont/MagnumFont.h" CORRADE_PLUGIN_REGISTER(MagnumFont, Magnum::Text::MagnumFont, diff --git a/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp b/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp index f5b65af67..2fa67a815 100644 --- a/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp +++ b/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include "Magnum/Image.h" diff --git a/src/MagnumPlugins/MagnumFontConverter/pluginRegistration.cpp b/src/MagnumPlugins/MagnumFontConverter/pluginRegistration.cpp index 802ce4b8f..1a89192ee 100644 --- a/src/MagnumPlugins/MagnumFontConverter/pluginRegistration.cpp +++ b/src/MagnumPlugins/MagnumFontConverter/pluginRegistration.cpp @@ -23,6 +23,8 @@ DEALINGS IN THE SOFTWARE. */ +#include + #include "MagnumPlugins/MagnumFontConverter/MagnumFontConverter.h" CORRADE_PLUGIN_REGISTER(MagnumFontConverter, Magnum::Text::MagnumFontConverter,