Browse Source

Adapted to Corrade::PluginManager changes.

pull/205/head
Vladimír Vondruš 8 years ago
parent
commit
93aeac258a
  1. 4
      src/Magnum/Audio/AbstractImporter.cpp
  2. 13
      src/Magnum/Audio/AbstractImporter.h
  3. 4
      src/Magnum/Text/AbstractFont.cpp
  4. 13
      src/Magnum/Text/AbstractFont.h
  5. 4
      src/Magnum/Text/AbstractFontConverter.cpp
  6. 14
      src/Magnum/Text/AbstractFontConverter.h
  7. 4
      src/Magnum/Trade/AbstractImageConverter.cpp
  8. 13
      src/Magnum/Trade/AbstractImageConverter.h
  9. 4
      src/Magnum/Trade/AbstractImporter.cpp
  10. 13
      src/Magnum/Trade/AbstractImporter.h
  11. 1
      src/MagnumPlugins/MagnumFont/MagnumFont.cpp
  12. 2
      src/MagnumPlugins/MagnumFont/pluginRegistration.cpp
  13. 1
      src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp
  14. 2
      src/MagnumPlugins/MagnumFontConverter/pluginRegistration.cpp

4
src/Magnum/Audio/AbstractImporter.cpp

@ -31,6 +31,10 @@
namespace Magnum { namespace Audio { namespace Magnum { namespace Audio {
std::string AbstractImporter::pluginInterface() {
return "cz.mosra.magnum.Audio.AbstractImporter/0.1";
}
AbstractImporter::AbstractImporter() = default; AbstractImporter::AbstractImporter() = default;
AbstractImporter::AbstractImporter(PluginManager::Manager<AbstractImporter>& manager): PluginManager::AbstractManagingPlugin<AbstractImporter>{manager} {} AbstractImporter::AbstractImporter(PluginManager::Manager<AbstractImporter>& manager): PluginManager::AbstractManagingPlugin<AbstractImporter>{manager} {}

13
src/Magnum/Audio/AbstractImporter.h

@ -60,16 +60,12 @@ checked by the implementation:
- All `do*()` implementations working on opened file are called only if - All `do*()` implementations working on opened file are called only if
there is any file opened. 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 @attention @ref Corrade::Containers::Array instances returned from the plugin
should *not* use anything else than the default deleter, otherwise this can should *not* use anything else than the default deleter, otherwise this can
cause dangling function pointer call on array destruction if the plugin cause dangling function pointer call on array destruction if the plugin
gets unloaded before the array is destroyed. gets unloaded before the array is destroyed.
*/ */
class MAGNUM_AUDIO_EXPORT AbstractImporter: public PluginManager::AbstractManagingPlugin<AbstractImporter> { class MAGNUM_AUDIO_EXPORT AbstractImporter: public PluginManager::AbstractManagingPlugin<AbstractImporter> {
CORRADE_PLUGIN_INTERFACE("cz.mosra.magnum.Audio.AbstractImporter/0.1")
public: public:
/** /**
* @brief Features supported by this importer * @brief Features supported by this importer
@ -88,6 +84,15 @@ class MAGNUM_AUDIO_EXPORT AbstractImporter: public PluginManager::AbstractManagi
*/ */
typedef Containers::EnumSet<Feature> Features; typedef Containers::EnumSet<Feature> Features;
/**
* @brief Plugin interface
*
* @code{.cpp}
* "cz.mosra.magnum.Audio.AbstractImporter/0.1"
* @endcode
*/
static std::string pluginInterface();
/** @brief Default constructor */ /** @brief Default constructor */
explicit AbstractImporter(); explicit AbstractImporter();

4
src/Magnum/Text/AbstractFont.cpp

@ -34,6 +34,10 @@
namespace Magnum { namespace Text { namespace Magnum { namespace Text {
std::string AbstractFont::pluginInterface() {
return "cz.mosra.magnum.Text.AbstractFont/0.2.4";
}
AbstractFont::AbstractFont(): _size(0.0f) {} AbstractFont::AbstractFont(): _size(0.0f) {}
AbstractFont::AbstractFont(PluginManager::AbstractManager& manager, const std::string& plugin): AbstractPlugin{manager, plugin}, _size{0.0f}, _lineHeight{0.0f} {} AbstractFont::AbstractFont(PluginManager::AbstractManager& manager, const std::string& plugin): AbstractPlugin{manager, plugin}, _size{0.0f}, _lineHeight{0.0f} {}

13
src/Magnum/Text/AbstractFont.h

@ -71,12 +71,8 @@ checked by the implementation:
@ref Feature::OpenData is supported. @ref Feature::OpenData is supported.
- All `do*()` implementations working on opened file are called only if - All `do*()` implementations working on opened file are called only if
there is any file opened. 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 { class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin {
CORRADE_PLUGIN_INTERFACE("cz.mosra.magnum.Text.AbstractFont/0.2.4")
public: public:
/** /**
* @brief Features supported by this importer * @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 */ /** @brief Set of features supported by this importer */
typedef Containers::EnumSet<Feature> Features; typedef Containers::EnumSet<Feature> Features;
/**
* @brief Plugin interface
*
* @code{.cpp}
* "cz.mosra.magnum.Text.AbstractFont/0.2.4"
* @endcode
*/
static std::string pluginInterface();
/** @brief Default constructor */ /** @brief Default constructor */
explicit AbstractFont(); explicit AbstractFont();

4
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() = default;
AbstractFontConverter::AbstractFontConverter(PluginManager::AbstractManager& manager, const std::string& plugin): PluginManager::AbstractPlugin{manager, plugin} {} AbstractFontConverter::AbstractFontConverter(PluginManager::AbstractManager& manager, const std::string& plugin): PluginManager::AbstractPlugin{manager, plugin} {}

14
src/Magnum/Text/AbstractFontConverter.h

@ -30,6 +30,7 @@
*/ */
#include <memory> #include <memory>
#include <Corrade/Containers/EnumSet.h>
#include <Corrade/PluginManager/AbstractPlugin.h> #include <Corrade/PluginManager/AbstractPlugin.h>
#include "Magnum/Magnum.h" #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 - Function `doImport*FromData()` is called only if there is at least one data
array passed. 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 @attention @ref Corrade::Containers::Array instances returned from the plugin
should *not* use anything else than the default deleter, otherwise this can should *not* use anything else than the default deleter, otherwise this can
cause dangling function pointer call on array destruction if the plugin cause dangling function pointer call on array destruction if the plugin
gets unloaded before the array is destroyed. gets unloaded before the array is destroyed.
*/ */
class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPlugin { class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPlugin {
CORRADE_PLUGIN_INTERFACE("cz.mosra.magnum.Text.AbstractFontConverter/0.1.2")
public: public:
/** /**
* @brief Features supported by this converter * @brief Features supported by this converter
@ -129,6 +126,15 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl
*/ */
typedef Containers::EnumSet<Feature> Features; typedef Containers::EnumSet<Feature> Features;
/**
* @brief Plugin interface
*
* @code{.cpp}
* "cz.mosra.magnum.Text.AbstractFontConverter/0.1.2"
* @endcode
*/
static std::string pluginInterface();
/** @brief Default constructor */ /** @brief Default constructor */
explicit AbstractFontConverter(); explicit AbstractFontConverter();

4
src/Magnum/Trade/AbstractImageConverter.cpp

@ -34,6 +34,10 @@
namespace Magnum { namespace Trade { namespace Magnum { namespace Trade {
std::string AbstractImageConverter::pluginInterface() {
return "cz.mosra.magnum.Trade.AbstractImporter/0.3";
}
AbstractImageConverter::AbstractImageConverter() = default; AbstractImageConverter::AbstractImageConverter() = default;
AbstractImageConverter::AbstractImageConverter(PluginManager::Manager<AbstractImageConverter>& manager): PluginManager::AbstractManagingPlugin<AbstractImageConverter>{manager} {} AbstractImageConverter::AbstractImageConverter(PluginManager::Manager<AbstractImageConverter>& manager): PluginManager::AbstractManagingPlugin<AbstractImageConverter>{manager} {}

13
src/Magnum/Trade/AbstractImageConverter.h

@ -68,16 +68,12 @@ checked by the implementation:
- The function @ref doExportToData(const CompressedImageView2D&) is called - The function @ref doExportToData(const CompressedImageView2D&) is called
only if @ref Feature::ConvertCompressedData is supported. 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 @attention @ref Corrade::Containers::Array instances returned from the plugin
should *not* use anything else than the default deleter, otherwise this can should *not* use anything else than the default deleter, otherwise this can
cause dangling function pointer call on array destruction if the plugin cause dangling function pointer call on array destruction if the plugin
gets unloaded before the array is destroyed. gets unloaded before the array is destroyed.
*/ */
class MAGNUM_EXPORT AbstractImageConverter: public PluginManager::AbstractManagingPlugin<AbstractImageConverter> { class MAGNUM_EXPORT AbstractImageConverter: public PluginManager::AbstractManagingPlugin<AbstractImageConverter> {
CORRADE_PLUGIN_INTERFACE("cz.mosra.magnum.Trade.AbstractImageConverter/0.2.1")
public: public:
/** /**
* @brief Features supported by this converter * @brief Features supported by this converter
@ -118,6 +114,15 @@ class MAGNUM_EXPORT AbstractImageConverter: public PluginManager::AbstractManagi
*/ */
typedef Containers::EnumSet<Feature> Features; typedef Containers::EnumSet<Feature> Features;
/**
* @brief Plugin interface
*
* @code{.cpp}
* "cz.mosra.magnum.Trade.AbstractImageConverter/0.2.1"
* @endcode
*/
static std::string pluginInterface();
/** @brief Default constructor */ /** @brief Default constructor */
explicit AbstractImageConverter(); explicit AbstractImageConverter();

4
src/Magnum/Trade/AbstractImporter.cpp

@ -43,6 +43,10 @@
namespace Magnum { namespace Trade { namespace Magnum { namespace Trade {
std::string AbstractImporter::pluginInterface() {
return "cz.mosra.magnum.Trade.AbstractImporter/0.3";
}
AbstractImporter::AbstractImporter() = default; AbstractImporter::AbstractImporter() = default;
AbstractImporter::AbstractImporter(PluginManager::Manager<AbstractImporter>& manager): PluginManager::AbstractManagingPlugin<AbstractImporter>{manager} {} AbstractImporter::AbstractImporter(PluginManager::Manager<AbstractImporter>& manager): PluginManager::AbstractManagingPlugin<AbstractImporter>{manager} {}

13
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 - All `do*()` implementations taking data ID as parameter are called only if
the ID is from valid range. 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 @attention @ref Corrade::Containers::Array instances returned from the plugin
should *not* use anything else than the default deleter, otherwise this can should *not* use anything else than the default deleter, otherwise this can
cause dangling function pointer call on array destruction if the plugin 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? @todo How to handle casting from std::unique_ptr<> in more convenient way?
*/ */
class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractManagingPlugin<AbstractImporter> { class MAGNUM_EXPORT AbstractImporter: public PluginManager::AbstractManagingPlugin<AbstractImporter> {
CORRADE_PLUGIN_INTERFACE("cz.mosra.magnum.Trade.AbstractImporter/0.3")
public: public:
/** /**
* @brief Features supported by this importer * @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 */ /** @brief Set of features supported by this importer */
typedef Containers::EnumSet<Feature> Features; typedef Containers::EnumSet<Feature> Features;
/**
* @brief Plugin interface
*
* @code{.cpp}
* "cz.mosra.magnum.Trade.AbstractImporter/0.3"
* @endcode
*/
static std::string pluginInterface();
/** @brief Default constructor */ /** @brief Default constructor */
explicit AbstractImporter(); explicit AbstractImporter();

1
src/MagnumPlugins/MagnumFont/MagnumFont.cpp

@ -27,6 +27,7 @@
#include <sstream> #include <sstream>
#include <Corrade/Containers/ArrayView.h> #include <Corrade/Containers/ArrayView.h>
#include <Corrade/Utility/Configuration.h>
#include <Corrade/Utility/Directory.h> #include <Corrade/Utility/Directory.h>
#include <Corrade/Utility/Unicode.h> #include <Corrade/Utility/Unicode.h>

2
src/MagnumPlugins/MagnumFont/pluginRegistration.cpp

@ -23,6 +23,8 @@
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
*/ */
#include <Corrade/PluginManager/AbstractManager.h>
#include "MagnumPlugins/MagnumFont/MagnumFont.h" #include "MagnumPlugins/MagnumFont/MagnumFont.h"
CORRADE_PLUGIN_REGISTER(MagnumFont, Magnum::Text::MagnumFont, CORRADE_PLUGIN_REGISTER(MagnumFont, Magnum::Text::MagnumFont,

1
src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp

@ -27,6 +27,7 @@
#include <sstream> #include <sstream>
#include <Corrade/Containers/Array.h> #include <Corrade/Containers/Array.h>
#include <Corrade/Utility/Configuration.h>
#include <Corrade/Utility/Directory.h> #include <Corrade/Utility/Directory.h>
#include "Magnum/Image.h" #include "Magnum/Image.h"

2
src/MagnumPlugins/MagnumFontConverter/pluginRegistration.cpp

@ -23,6 +23,8 @@
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
*/ */
#include <Corrade/PluginManager/AbstractManager.h>
#include "MagnumPlugins/MagnumFontConverter/MagnumFontConverter.h" #include "MagnumPlugins/MagnumFontConverter/MagnumFontConverter.h"
CORRADE_PLUGIN_REGISTER(MagnumFontConverter, Magnum::Text::MagnumFontConverter, CORRADE_PLUGIN_REGISTER(MagnumFontConverter, Magnum::Text::MagnumFontConverter,

Loading…
Cancel
Save