From 19dd7a01769eb06d87be2874dd8510ccc142e5ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 25 Jul 2018 23:50:07 +0200 Subject: [PATCH] Move Feature[s] enums from inside plugin classes outside. Too annoyingly long to type. Also added a debug output operator for the FontConverterFeature enums, for some reason there were none. --- doc/changelog.dox | 10 + src/Magnum/Audio/AbstractImporter.cpp | 16 +- src/Magnum/Audio/AbstractImporter.h | 73 ++-- .../Audio/Test/AbstractImporterTest.cpp | 38 +- src/Magnum/Text/AbstractFont.cpp | 30 +- src/Magnum/Text/AbstractFont.h | 185 +++++---- src/Magnum/Text/AbstractFontConverter.cpp | 64 +++- src/Magnum/Text/AbstractFontConverter.h | 261 +++++++------ .../Text/Test/AbstractFontConverterTest.cpp | 41 +- src/Magnum/Text/Test/AbstractFontTest.cpp | 84 ++-- src/Magnum/Text/Test/RendererGLTest.cpp | 4 +- src/Magnum/Trade/AbstractImageConverter.cpp | 38 +- src/Magnum/Trade/AbstractImageConverter.h | 166 ++++---- src/Magnum/Trade/AbstractImporter.cpp | 28 +- src/Magnum/Trade/AbstractImporter.h | 194 +++++----- .../Trade/Test/AbstractImageConverterTest.cpp | 70 ++-- .../Trade/Test/AbstractImporterTest.cpp | 362 +++++++++--------- .../AnyAudioImporter/AnyImporter.cpp | 2 +- .../AnyAudioImporter/AnyImporter.h | 2 +- .../AnyImageConverter/AnyImageConverter.cpp | 4 +- .../AnyImageConverter/AnyImageConverter.h | 2 +- .../AnyImageImporter/AnyImageImporter.cpp | 2 +- .../AnyImageImporter/AnyImageImporter.h | 2 +- .../AnySceneImporter/AnySceneImporter.cpp | 2 +- .../AnySceneImporter/AnySceneImporter.h | 2 +- src/MagnumPlugins/MagnumFont/MagnumFont.cpp | 2 +- src/MagnumPlugins/MagnumFont/MagnumFont.h | 2 +- .../MagnumFont/Test/MagnumFontTest.cpp | 4 +- .../MagnumFontConverter.cpp | 4 +- .../MagnumFontConverter/MagnumFontConverter.h | 2 +- .../Test/MagnumFontConverterTest.cpp | 4 +- src/MagnumPlugins/ObjImporter/ObjImporter.cpp | 2 +- src/MagnumPlugins/ObjImporter/ObjImporter.h | 2 +- .../TgaImageConverter/TgaImageConverter.cpp | 2 +- .../TgaImageConverter/TgaImageConverter.h | 2 +- src/MagnumPlugins/TgaImporter/TgaImporter.cpp | 2 +- src/MagnumPlugins/TgaImporter/TgaImporter.h | 2 +- .../WavAudioImporter/WavImporter.cpp | 2 +- .../WavAudioImporter/WavImporter.h | 2 +- 39 files changed, 948 insertions(+), 768 deletions(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index 4e2ed4ef9..d356bf206 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -291,6 +291,16 @@ See also: @cpp Platform::Sdl2Application::Configuration::isMouseLocked() @ce is deprecated in favor of the new @ref Platform::Sdl2Application::setCursor() together with @ref Platform::Sdl2Application::Cursor::HiddenLocked +- @cpp Audio::AbstractImporter::Features @ce, + @cpp Text::AbstractFont::Features @ce, + @cpp Text::AbstractFontConverter::Features @ce, + @cpp Trade::AbstractImporter::Features @ce, + @cpp Trade::AbstractImageConverter::Features @ce enum sets and their + corresponding `Feature` enums are deprecated in favor of + @ref Audio::ImporterFeatures, @ref Text::FontFeatures, + @ref Text::FontConverterFeatures, @ref Trade::ImporterFeatures, + @ref Trade::ImageConverterFeatures enum sets and their corresponding enums + placed directly in the namespace to have them shorter and unambiguous @subsection changelog-latest-compatibility Potential compatibility breakages, removed APIs diff --git a/src/Magnum/Audio/AbstractImporter.cpp b/src/Magnum/Audio/AbstractImporter.cpp index 262e93aed..39052d1bb 100644 --- a/src/Magnum/Audio/AbstractImporter.cpp +++ b/src/Magnum/Audio/AbstractImporter.cpp @@ -81,7 +81,7 @@ AbstractImporter::AbstractImporter(PluginManager::Manager& man AbstractImporter::AbstractImporter(PluginManager::AbstractManager& manager, const std::string& plugin): PluginManager::AbstractManagingPlugin{manager, plugin} {} bool AbstractImporter::openData(Containers::ArrayView data) { - CORRADE_ASSERT(features() & Feature::OpenData, + CORRADE_ASSERT(features() & ImporterFeature::OpenData, "Audio::AbstractImporter::openData(): feature not supported", {}); close(); @@ -100,7 +100,7 @@ bool AbstractImporter::openFile(const std::string& filename) { } void AbstractImporter::doOpenFile(const std::string& filename) { - CORRADE_ASSERT(features() & Feature::OpenData, "Audio::AbstractImporter::openFile(): not implemented", ); + CORRADE_ASSERT(features() & ImporterFeature::OpenData, "Audio::AbstractImporter::openFile(): not implemented", ); /* Open file */ if(!Utility::Directory::exists(filename)) { @@ -136,12 +136,12 @@ Containers::Array AbstractImporter::data() { return out; } -Debug& operator<<(Debug& debug, const AbstractImporter::Feature value) { - debug << "Audio::AbstractImporter::Feature" << Debug::nospace; +Debug& operator<<(Debug& debug, const ImporterFeature value) { + debug << "Audio::ImporterFeature" << Debug::nospace; switch(value) { /* LCOV_EXCL_START */ - #define _c(v) case AbstractImporter::Feature::v: return debug << "::" #v; + #define _c(v) case ImporterFeature::v: return debug << "::" #v; _c(OpenData) #undef _c /* LCOV_EXCL_STOP */ @@ -150,9 +150,9 @@ Debug& operator<<(Debug& debug, const AbstractImporter::Feature value) { return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; } -Debug& operator<<(Debug& debug, const AbstractImporter::Features value) { - return Containers::enumSetDebugOutput(debug, value, "Audio::AbstractImporter::Features{}", { - AbstractImporter::Feature::OpenData}); +Debug& operator<<(Debug& debug, const ImporterFeatures value) { + return Containers::enumSetDebugOutput(debug, value, "Audio::ImporterFeatures{}", { + ImporterFeature::OpenData}); } }} diff --git a/src/Magnum/Audio/AbstractImporter.h b/src/Magnum/Audio/AbstractImporter.h index c08ab05a1..d30b4d94e 100644 --- a/src/Magnum/Audio/AbstractImporter.h +++ b/src/Magnum/Audio/AbstractImporter.h @@ -36,6 +36,33 @@ namespace Magnum { namespace Audio { +/** +@brief Features supported by an audio importer +@m_since_latest + +@see @ref ImporterFeatures, @ref AbstractImporter::features() +*/ +enum class ImporterFeature: UnsignedByte { + /** Opening files from raw data using @ref AbstractImporter::openData() */ + OpenData = 1 << 0 +}; + +/** +@brief Features supported by an audio importer +@m_since_latest + +@see @ref AbstractImporter::features() +*/ +typedef Containers::EnumSet ImporterFeatures; + +CORRADE_ENUMSET_OPERATORS(ImporterFeatures) + +/** @debugoperatorenum{ImporterFeatures} */ +MAGNUM_AUDIO_EXPORT Debug& operator<<(Debug& debug, ImporterFeature value); + +/** @debugoperatorenum{ImporterFeatures} */ +MAGNUM_AUDIO_EXPORT Debug& operator<<(Debug& debug, ImporterFeatures value); + /** @brief Base for audio importer plugins @@ -64,8 +91,8 @@ checked by the implementation: - Functions @ref doOpenData() and @ref doOpenFile() are called after the previous file was closed, function @ref doClose() is called only if there is any file opened. -- Function @ref doOpenData() is called only if @ref Feature::OpenData is - supported. +- Function @ref doOpenData() is called only if @ref ImporterFeature::OpenData + is supported. - All `do*()` implementations working on opened file are called only if there is any file opened. @@ -81,22 +108,17 @@ checked by the implementation: */ class MAGNUM_AUDIO_EXPORT AbstractImporter: public PluginManager::AbstractManagingPlugin { public: - /** - * @brief Features supported by this importer - * - * @see @ref Features, @ref features() + #ifdef MAGNUM_BUILD_DEPRECATED + /** @brief @copybrief ImporterFeature + * @m_deprecated_since_latest Use @ref ImporterFeature instead. */ - enum class Feature: UnsignedByte { - /** Opening files from raw data using @ref openData() */ - OpenData = 1 << 0 - }; + typedef CORRADE_DEPRECATED("use ImporterFeature instead") ImporterFeature Feature; - /** - * @brief Features supported by this importer - * - * @see @ref features() + /** @brief @copybrief ImporterFeatures + * @m_deprecated_since_latest Use @ref ImporterFeatures instead. */ - typedef Containers::EnumSet Features; + typedef CORRADE_DEPRECATED("use ImporterFeatures instead") ImporterFeatures Features; + #endif /** * @brief Plugin interface @@ -136,7 +158,7 @@ class MAGNUM_AUDIO_EXPORT AbstractImporter: public PluginManager::AbstractManagi explicit AbstractImporter(PluginManager::AbstractManager& manager, const std::string& plugin); /** @brief Features supported by this importer */ - Features features() const { return doFeatures(); } + ImporterFeatures features() const { return doFeatures(); } /** @brief Whether any file is opened */ bool isOpened() const { return doIsOpened(); } @@ -145,8 +167,8 @@ class MAGNUM_AUDIO_EXPORT AbstractImporter: public PluginManager::AbstractManagi * @brief Open raw data * * Closes previous file, if it was opened, and tries to open given - * file. Available only if @ref Feature::OpenData is supported. Returns - * @cpp true @ce on success, @cpp false @ce otherwise. + * file. Available only if @ref ImporterFeature::OpenData is supported. + * Returns @cpp true @ce on success, @cpp false @ce otherwise. * @see @ref features(), @ref openFile() */ bool openData(Containers::ArrayView data); @@ -178,7 +200,7 @@ class MAGNUM_AUDIO_EXPORT AbstractImporter: public PluginManager::AbstractManagi private: /** @brief Implementation for @ref features() */ - virtual Features doFeatures() const = 0; + virtual ImporterFeatures doFeatures() const = 0; /** @brief Implementation for @ref isOpened() */ virtual bool doIsOpened() const = 0; @@ -189,8 +211,9 @@ class MAGNUM_AUDIO_EXPORT AbstractImporter: public PluginManager::AbstractManagi /** * @brief Implementation for @ref openFile() * - * If @ref Feature::OpenData is supported, default implementation opens - * the file and calls @ref doOpenData() with its contents. + * If @ref ImporterFeature::OpenData is supported, default + * implementation opens the file and calls @ref doOpenData() with its + * contents. */ virtual void doOpenFile(const std::string& filename); @@ -207,14 +230,6 @@ class MAGNUM_AUDIO_EXPORT AbstractImporter: public PluginManager::AbstractManagi virtual Containers::Array doData() = 0; }; -CORRADE_ENUMSET_OPERATORS(AbstractImporter::Features) - -/** @debugoperatorclassenum{AbstractImporter,AbstractImporter::Feature} */ -MAGNUM_AUDIO_EXPORT Debug& operator<<(Debug& debug, AbstractImporter::Feature value); - -/** @debugoperatorclassenum{AbstractImporter,AbstractImporter::Features} */ -MAGNUM_AUDIO_EXPORT Debug& operator<<(Debug& debug, AbstractImporter::Features value); - }} #endif diff --git a/src/Magnum/Audio/Test/AbstractImporterTest.cpp b/src/Magnum/Audio/Test/AbstractImporterTest.cpp index b4e552d12..98f72c30f 100644 --- a/src/Magnum/Audio/Test/AbstractImporterTest.cpp +++ b/src/Magnum/Audio/Test/AbstractImporterTest.cpp @@ -94,7 +94,7 @@ AbstractImporterTest::AbstractImporterTest() { void AbstractImporterTest::construct() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -103,7 +103,7 @@ void AbstractImporterTest::construct() { Containers::Array doData() override { return nullptr; } } importer; - CORRADE_COMPARE(importer.features(), AbstractImporter::Features{}); + CORRADE_COMPARE(importer.features(), ImporterFeatures{}); CORRADE_VERIFY(!importer.isOpened()); importer.close(); @@ -112,7 +112,7 @@ void AbstractImporterTest::construct() { void AbstractImporterTest::openData() { struct: AbstractImporter { - Features doFeatures() const override { return Feature::OpenData; } + ImporterFeatures doFeatures() const override { return ImporterFeature::OpenData; } bool doIsOpened() const override { return _opened; } void doClose() override { _opened = false; } @@ -138,7 +138,7 @@ void AbstractImporterTest::openData() { void AbstractImporterTest::openFileAsData() { struct: AbstractImporter { - Features doFeatures() const override { return Feature::OpenData; } + ImporterFeatures doFeatures() const override { return ImporterFeature::OpenData; } bool doIsOpened() const override { return _opened; } void doClose() override { _opened = false; } @@ -164,7 +164,7 @@ void AbstractImporterTest::openFileAsData() { void AbstractImporterTest::openFileAsDataNotFound() { struct Importer: AbstractImporter { - Features doFeatures() const override { return Feature::OpenData; } + ImporterFeatures doFeatures() const override { return ImporterFeature::OpenData; } bool doIsOpened() const override { return _opened; } void doClose() override { _opened = false; } @@ -189,7 +189,7 @@ void AbstractImporterTest::openFileAsDataNotFound() { void AbstractImporterTest::openFileNotImplemented() { struct Importer: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -207,7 +207,7 @@ void AbstractImporterTest::openFileNotImplemented() { void AbstractImporterTest::openDataNotSupported() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -225,7 +225,7 @@ void AbstractImporterTest::openDataNotSupported() { void AbstractImporterTest::openDataNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return Feature::OpenData; } + ImporterFeatures doFeatures() const override { return ImporterFeature::OpenData; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -243,7 +243,7 @@ void AbstractImporterTest::openDataNotImplemented() { void AbstractImporterTest::format() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -257,7 +257,7 @@ void AbstractImporterTest::format() { void AbstractImporterTest::formatNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -275,7 +275,7 @@ void AbstractImporterTest::formatNoFile() { void AbstractImporterTest::frequency() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -289,7 +289,7 @@ void AbstractImporterTest::frequency() { void AbstractImporterTest::frequencyNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -307,7 +307,7 @@ void AbstractImporterTest::frequencyNoFile() { void AbstractImporterTest::data() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -325,7 +325,7 @@ void AbstractImporterTest::data() { void AbstractImporterTest::dataNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -343,7 +343,7 @@ void AbstractImporterTest::dataNoFile() { void AbstractImporterTest::dataCustomDeleter() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -364,15 +364,15 @@ void AbstractImporterTest::dataCustomDeleter() { void AbstractImporterTest::debugFeature() { std::ostringstream out; - Debug{&out} << AbstractImporter::Feature::OpenData << AbstractImporter::Feature(0xf0); - CORRADE_COMPARE(out.str(), "Audio::AbstractImporter::Feature::OpenData Audio::AbstractImporter::Feature(0xf0)\n"); + Debug{&out} << ImporterFeature::OpenData << ImporterFeature(0xf0); + CORRADE_COMPARE(out.str(), "Audio::ImporterFeature::OpenData Audio::ImporterFeature(0xf0)\n"); } void AbstractImporterTest::debugFeatures() { std::ostringstream out; - Debug{&out} << AbstractImporter::Feature::OpenData << AbstractImporter::Features{}; - CORRADE_COMPARE(out.str(), "Audio::AbstractImporter::Feature::OpenData Audio::AbstractImporter::Features{}\n"); + Debug{&out} << ImporterFeature::OpenData << ImporterFeatures{}; + CORRADE_COMPARE(out.str(), "Audio::ImporterFeature::OpenData Audio::ImporterFeatures{}\n"); } }}}} diff --git a/src/Magnum/Text/AbstractFont.cpp b/src/Magnum/Text/AbstractFont.cpp index 995253f0d..404f17b63 100644 --- a/src/Magnum/Text/AbstractFont.cpp +++ b/src/Magnum/Text/AbstractFont.cpp @@ -85,7 +85,7 @@ AbstractFont::AbstractFont(PluginManager::AbstractManager& manager, const std::s void AbstractFont::setFileCallback(Containers::Optional>(*callback)(const std::string&, InputFileCallbackPolicy, void*), void* const userData) { CORRADE_ASSERT(!isOpened(), "Text::AbstractFont::setFileCallback(): can't be set while a font is opened", ); - CORRADE_ASSERT(features() & (Feature::FileCallback|Feature::OpenData), "Text::AbstractFont::setFileCallback(): font plugin supports neither loading from data nor via callbacks, callbacks can't be used", ); + CORRADE_ASSERT(features() & (FontFeature::FileCallback|FontFeature::OpenData), "Text::AbstractFont::setFileCallback(): font plugin supports neither loading from data nor via callbacks, callbacks can't be used", ); _fileCallback = callback; _fileCallbackUserData = userData; @@ -95,7 +95,7 @@ void AbstractFont::setFileCallback(Containers::Optional>(*)(const std::string&, InputFileCallbackPolicy, void*), void*) {} bool AbstractFont::openData(Containers::ArrayView data, const Float size) { - CORRADE_ASSERT(features() & Feature::OpenData, + CORRADE_ASSERT(features() & FontFeature::OpenData, "Text::AbstractFont::openData(): feature not supported", false); /* We accept empty data here (instead of checking for them and failing so @@ -139,13 +139,13 @@ bool AbstractFont::openFile(const std::string& filename, const Float size) { /* If file loading callbacks are not set or the font implementation supports handling them directly, call into the implementation */ - if(!_fileCallback || (doFeatures() & Feature::FileCallback)) { + if(!_fileCallback || (doFeatures() & FontFeature::FileCallback)) { metrics = doOpenFile(filename, size); /* Otherwise, if loading from data is supported, use the callback and pass the data through to openData(). Mark the file as ready to be closed once opening is finished. */ - } else if(doFeatures() & Feature::OpenData) { + } else if(doFeatures() & FontFeature::OpenData) { /* This needs to be duplicated here and in the doOpenFile() implementation in order to support both following cases: - plugins that don't support FileCallback but have their own @@ -176,7 +176,7 @@ bool AbstractFont::openFile(const std::string& filename, const Float size) { } auto AbstractFont::doOpenFile(const std::string& filename, const Float size) -> Metrics { - CORRADE_ASSERT(features() & Feature::OpenData, "Text::AbstractFont::openFile(): not implemented", {}); + CORRADE_ASSERT(features() & FontFeature::OpenData, "Text::AbstractFont::openFile(): not implemented", {}); Metrics metrics; @@ -248,7 +248,7 @@ Vector2 AbstractFont::glyphAdvance(const UnsignedInt glyph) { void AbstractFont::fillGlyphCache(AbstractGlyphCache& cache, const std::string& characters) { CORRADE_ASSERT(isOpened(), "Text::AbstractFont::fillGlyphCache(): no font opened", ); - CORRADE_ASSERT(!(features() & Feature::PreparedGlyphCache), + CORRADE_ASSERT(!(features() & FontFeature::PreparedGlyphCache), "Text::AbstractFont::fillGlyphCache(): feature not supported", ); doFillGlyphCache(cache, Utility::Unicode::utf32(characters)); @@ -261,7 +261,7 @@ void AbstractFont::doFillGlyphCache(AbstractGlyphCache&, const std::u32string&) Containers::Pointer AbstractFont::createGlyphCache() { CORRADE_ASSERT(isOpened(), "Text::AbstractFont::createGlyphCache(): no font opened", nullptr); - CORRADE_ASSERT(features() & Feature::PreparedGlyphCache, + CORRADE_ASSERT(features() & FontFeature::PreparedGlyphCache, "Text::AbstractFont::createGlyphCache(): feature not supported", nullptr); return doCreateGlyphCache(); @@ -278,12 +278,12 @@ Containers::Pointer AbstractFont::layout(const AbstractGlyphCa return doLayout(cache, size, text); } -Debug& operator<<(Debug& debug, const AbstractFont::Feature value) { - debug << "Text::AbstractFont::Feature" << Debug::nospace; +Debug& operator<<(Debug& debug, const FontFeature value) { + debug << "Text::FontFeature" << Debug::nospace; switch(value) { /* LCOV_EXCL_START */ - #define _c(v) case AbstractFont::Feature::v: return debug << "::" #v; + #define _c(v) case FontFeature::v: return debug << "::" #v; _c(OpenData) _c(FileCallback) _c(PreparedGlyphCache) @@ -294,11 +294,11 @@ Debug& operator<<(Debug& debug, const AbstractFont::Feature value) { return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; } -Debug& operator<<(Debug& debug, const AbstractFont::Features value) { - return Containers::enumSetDebugOutput(debug, value, "Text::AbstractFont::Features{}", { - AbstractFont::Feature::OpenData, - AbstractFont::Feature::FileCallback, - AbstractFont::Feature::PreparedGlyphCache}); +Debug& operator<<(Debug& debug, const FontFeatures value) { + return Containers::enumSetDebugOutput(debug, value, "Text::FontFeatures{}", { + FontFeature::OpenData, + FontFeature::FileCallback, + FontFeature::PreparedGlyphCache}); } AbstractLayouter::AbstractLayouter(UnsignedInt glyphCount): _glyphCount(glyphCount) {} diff --git a/src/Magnum/Text/AbstractFont.h b/src/Magnum/Text/AbstractFont.h index 599a60e1a..2e38e6be0 100644 --- a/src/Magnum/Text/AbstractFont.h +++ b/src/Magnum/Text/AbstractFont.h @@ -44,6 +44,63 @@ namespace Magnum { namespace Text { +/** +@brief Features supported by a font implementation +@m_since_latest + +@see @ref FontFeatures, @ref AbstractFont::features() +*/ +enum class FontFeature: UnsignedByte { + /** Opening fonts from raw data using @ref AbstractFont::openData() */ + OpenData = 1 << 0, + + /** + * Specifying callbacks for loading additional files referenced from the + * main file using @ref AbstractFont::setFileCallback(). If the font + * doesn't expose this feature, the format is either single-file or loading + * via callbacks is not supported. + * + * See @ref Text-AbstractFont-usage-callbacks and particular font plugin + * documentation for more information. + * @m_since{2019,10} + */ + FileCallback = 1 << 1, + + #ifdef MAGNUM_BUILD_DEPRECATED + /** + * The format is multi-file, thus @ref AbstractFont::openSingleData() + * convenience function cannot be used. + * @m_deprecated_since{2019,10} Obsolete, use file callbacks + * instead. + */ + MultiFile CORRADE_DEPRECATED_ENUM("obsolete, use file callbacks instead") = FileCallback, + #endif + + /** + * The font contains prepared glyph cache. + * + * @see @ref AbstractFont::fillGlyphCache(), + * @ref AbstractFont::createGlyphCache() + */ + PreparedGlyphCache = 1 << 2 +}; + +/** +@brief Set of features supported by a font implementation +@m_since_latest + +@see @ref AbstractFont::features() +*/ +typedef Containers::EnumSet FontFeatures; + +CORRADE_ENUMSET_OPERATORS(FontFeatures) + +/** @debugoperatorenum{FontFeature} */ +MAGNUM_TEXT_EXPORT Debug& operator<<(Debug& debug, FontFeature value); + +/** @debugoperatorenum{FontFeatures} */ +MAGNUM_TEXT_EXPORT Debug& operator<<(Debug& debug, FontFeatures value); + /** @brief Base for font plugins @@ -68,13 +125,13 @@ information about actual text rendering. Besides loading data directly from the filesystem using @ref openFile() like shown above, it's possible to use @ref openData() to import data from memory. Note that the particular importer implementation must support -@ref Feature::OpenData for this method to work. +@ref FontFeature::OpenData for this method to work. Some font formats consist of more than one file and in that case you may want to intercept those references and load them in a custom way as well. For font -plugins that advertise support for this with @ref Feature::FileCallback this is -done by specifying a file loading callback using @ref setFileCallback(). The -callback gets a filename, @ref InputFileCallbackPolicy and an user +plugins that advertise support for this with @ref FontFeature::FileCallback +this is done by specifying a file loading callback using @ref setFileCallback(). +The callback gets a filename, @ref InputFileCallbackPolicy and an user pointer as parameters; returns a non-owning view on the loaded data or a @ref Corrade::Containers::NullOpt "Containers::NullOpt" to indicate the file loading failed. For example, loading a memory-mapped font could look like @@ -85,12 +142,12 @@ correctly. @snippet MagnumText.cpp AbstractFont-usage-callbacks -For importers that don't support @ref Feature::FileCallback directly, the base -@ref openFile() implementation will use the file callback to pass the loaded -data through to @ref openData(), in case the importer supports at least -@ref Feature::OpenData. If the importer supports neither @ref Feature::FileCallback -nor @ref Feature::OpenData, @ref setFileCallback() doesn't allow the callbacks -to be set. +For importers that don't support @ref FontFeature::FileCallback directly, the +base @ref openFile() implementation will use the file callback to pass the +loaded data through to @ref openData(), in case the importer supports at least +@ref FontFeature::OpenData. If the importer supports neither +@ref FontFeature::FileCallback nor @ref FontFeature::OpenData, +@ref setFileCallback() doesn't allow the callbacks to be set. The input file callback signature is the same for @ref Text::AbstractFont and @ref Trade::AbstractImporter to allow code reuse. @@ -107,56 +164,26 @@ checked by the implementation: - Functions @ref doOpenData() and @ref doOpenFile() are called after the previous file was closed, function @ref doClose() is called only if there is any file opened. -- Function @ref doOpenData() is called only if @ref Feature::OpenData is +- Function @ref doOpenData() is called only if @ref FontFeature::OpenData is supported. - The @ref doSetFileCallback() function is called only if - @ref Feature::FileCallback is supported and there is no file opened. + @ref FontFeature::FileCallback is supported and there is no file opened. - All `do*()` implementations working on opened file are called only if there is any file opened. */ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { public: - /** - * @brief Features supported by this font implementation - * - * @see @ref Features, @ref features() + #ifdef MAGNUM_BUILD_DEPRECATED + /** @brief @copybrief FontFeature + * @m_deprecated_since_latest Use @ref FontFeature instead. */ - enum class Feature: UnsignedByte { - /** Opening fonts from raw data using @ref openData() */ - OpenData = 1 << 0, + typedef CORRADE_DEPRECATED("use FontFeature instead") FontFeature Feature; - /** - * Specifying callbacks for loading additional files referenced - * from the main file using @ref setFileCallback(). If the font - * doesn't expose this feature, the format is either single-file or - * loading via callbacks is not supported. - * - * See @ref Text-AbstractFont-usage-callbacks and particular font - * plugin documentation for more information. - * @m_since{2019,10} - */ - FileCallback = 1 << 1, - - #ifdef MAGNUM_BUILD_DEPRECATED - /** - * The format is multi-file, thus @ref openSingleData() convenience - * function cannot be used. - * @m_deprecated_since{2019,10} Obsolete, use file callbacks - * instead. - */ - MultiFile CORRADE_DEPRECATED_ENUM("obsolete, use file callbacks instead") = FileCallback, - #endif - - /** - * The font contains prepared glyph cache. - * - * @see @ref fillGlyphCache(), @ref createGlyphCache() - */ - PreparedGlyphCache = 1 << 2 - }; - - /** @brief Set of features supported by this font implementation */ - typedef Containers::EnumSet Features; + /** @brief @copybrief FontFeatures + * @m_deprecated_since_latest Use @ref FontFeatures instead. + */ + typedef CORRADE_DEPRECATED("use FontFeatures instead") FontFeatures Features; + #endif /** * @brief Plugin interface @@ -193,7 +220,7 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { explicit AbstractFont(PluginManager::AbstractManager& manager, const std::string& plugin); /** @brief Features supported by this font */ - Features features() const { return doFeatures(); } + FontFeatures features() const { return doFeatures(); } /** * @brief File opening callback function @@ -215,22 +242,22 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { * @brief Set file opening callback * @m_since{2019,10} * - * In case the font plugin supports @ref Feature::FileCallback, files - * opened through @ref openFile() will be loaded through the provided - * callback. Besides that, all external files referenced by the - * top-level file will be loaded through the callback function as well, - * usually on demand. The callback function gets a filename, + * In case the font plugin supports @ref FontFeature::FileCallback, + * files opened through @ref openFile() will be loaded through the + * provided callback. Besides that, all external files referenced by + * the top-level file will be loaded through the callback function as + * well, usually on demand. The callback function gets a filename, * @ref InputFileCallbackPolicy and the @p userData pointer as input * and returns a non-owning view on the loaded data as output or a * @ref Corrade::Containers::NullOpt if loading failed --- because * empty files might also be valid in some circumstances, @cpp nullptr @ce * can't be used to indicate a failure. * - * In case the font plugin doesn't support @ref Feature::FileCallback but - * supports at least @ref Feature::OpenData, a file opened through - * @ref openFile() will be internally loaded through the provided - * callback and then passed to @ref openData(). First the file is - * loaded with @ref InputFileCallbackPolicy::LoadTemporary passed to + * In case the font plugin doesn't support @ref FontFeature::FileCallback + * but supports at least @ref FontFeature::OpenData, a file opened + * through @ref openFile() will be internally loaded through the + * provided callback and then passed to @ref openData(). First the file + * is loaded with @ref InputFileCallbackPolicy::LoadTemporary passed to * the callback, then the returned memory view is passed to * @ref openData() (sidestepping the potential @ref openFile() * implementation of that particular font plugin) and after that the @@ -241,8 +268,8 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { * * In case @p callback is @cpp nullptr @ce, the current callback (if * any) is reset. This function expects that the font plugin supports - * either @ref Feature::FileCallback or @ref Feature::OpenData. If an - * font plugin supports neither, callbacks can't be used. + * either @ref FontFeature::FileCallback or @ref FontFeature::OpenData. + * If a font plugin supports neither, callbacks can't be used. * * It's expected that this function is called *before* a file is * opened. It's also expected that the loaded data are kept in scope @@ -292,8 +319,8 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { * @param size Font size * * Closes previous file, if it was opened, and tries to open given - * file. Available only if @ref Feature::OpenData is supported. Returns - * @cpp true @ce on success, @cpp false @ce otherwise. + * file. Available only if @ref FontFeature::OpenData is supported. + * Returns @cpp true @ce on success, @cpp false @ce otherwise. * @see @ref features(), @ref openFile() */ bool openData(Containers::ArrayView data, Float size); @@ -318,8 +345,8 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { * @param size Font size * * Closes previous file, if it was opened, and tries to open given - * file. If the plugin has @ref Feature::MultiFile, the function will - * use additional files in given path, all sharing common basename + * file. If the plugin has @ref FontFeature::MultiFile, the function + * will use additional files in given path, all sharing common basename * derived from @p filename. Returns @cpp true @ce on success, * @cpp false @ce otherwise. */ @@ -393,9 +420,9 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { * @param characters UTF-8 characters to render * * Fills the cache with given characters. Fonts having - * @ref Feature::PreparedGlyphCache do not support partial glyph cache - * filling, use @ref createGlyphCache() instead. Expects that a font is - * opened. + * @ref FontFeature::PreparedGlyphCache do not support partial glyph + * cache filling, use @ref createGlyphCache() instead. Expects that a + * font is opened. */ void fillGlyphCache(AbstractGlyphCache& cache, const std::string& characters); @@ -403,7 +430,7 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { * @brief Create glyph cache * * Configures and fills glyph cache with the contents of whole font. - * Available only if @ref Feature::PreparedGlyphCache is supported. + * Available only if @ref FontFeature::PreparedGlyphCache is supported. * Other fonts support only partial glyph cache filling, see * @ref fillGlyphCache(). Expects that a font is opened. */ @@ -465,7 +492,7 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { * @brief Implementation for @ref openFile() * * Return metrics of opened font on successful opening, zeros - * otherwise. If @ref Feature::OpenData is supported, default + * otherwise. If @ref FontFeature::OpenData is supported, default * implementation opens the file and calls @ref doOpenData() with its * contents. It is allowed to call this function from your * @ref doOpenFile() implementation --- in particular, this @@ -473,7 +500,7 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { * @ref setFileCallback(). * * This function is not called when file callbacks are set through - * @ref setFileCallback() and @ref Feature::FileCallback is not + * @ref setFileCallback() and @ref FontFeature::FileCallback is not * supported --- instead, file is loaded though the callback and data * passed through to @ref doOpenData(). */ @@ -481,7 +508,7 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { private: /** @brief Implementation for @ref features() */ - virtual Features doFeatures() const = 0; + virtual FontFeatures doFeatures() const = 0; /** * @brief Implementation for @ref setFileCallback() @@ -541,14 +568,6 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin { Float _size{}, _ascent{}, _descent{}, _lineHeight{}; }; -CORRADE_ENUMSET_OPERATORS(AbstractFont::Features) - -/** @debugoperatorclassenum{AbstractFont,AbstractFont::Feature} */ -MAGNUM_TEXT_EXPORT Debug& operator<<(Debug& debug, AbstractFont::Feature value); - -/** @debugoperatorclassenum{AbstractFont,AbstractFont::Features} */ -MAGNUM_TEXT_EXPORT Debug& operator<<(Debug& debug, AbstractFont::Features value); - /** @brief Base for text layouters diff --git a/src/Magnum/Text/AbstractFontConverter.cpp b/src/Magnum/Text/AbstractFontConverter.cpp index 9c11479a6..c8e12b0ec 100644 --- a/src/Magnum/Text/AbstractFontConverter.cpp +++ b/src/Magnum/Text/AbstractFontConverter.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -98,14 +99,14 @@ AbstractFontConverter::AbstractFontConverter() = default; AbstractFontConverter::AbstractFontConverter(PluginManager::AbstractManager& manager, const std::string& plugin): PluginManager::AbstractPlugin{manager, plugin} {} std::vector>> AbstractFontConverter::exportFontToData(AbstractFont& font, AbstractGlyphCache& cache, const std::string& filename, const std::string& characters) const { - CORRADE_ASSERT(features() >= (Feature::ExportFont|Feature::ConvertData), + CORRADE_ASSERT(features() >= (FontConverterFeature::ExportFont|FontConverterFeature::ConvertData), "Text::AbstractFontConverter::exportFontToData(): feature not supported", {}); return doExportFontToData(font, cache, filename, uniqueUnicode(characters)); } std::vector>> AbstractFontConverter::doExportFontToData(AbstractFont& font, AbstractGlyphCache& cache, const std::string& filename, const std::u32string& characters) const { - CORRADE_ASSERT(!(features() & Feature::MultiFile), + CORRADE_ASSERT(!(features() & FontConverterFeature::MultiFile), "Text::AbstractFontConverter::exportFontToData(): feature advertised but not implemented", {}); std::vector>> out; @@ -114,9 +115,9 @@ std::vector>> AbstractFontConvert } Containers::Array AbstractFontConverter::exportFontToSingleData(AbstractFont& font, AbstractGlyphCache& cache, const std::string& characters) const { - CORRADE_ASSERT(features() >= (Feature::ExportFont|Feature::ConvertData), + CORRADE_ASSERT(features() >= (FontConverterFeature::ExportFont|FontConverterFeature::ConvertData), "Text::AbstractFontConverter::exportFontToSingleData(): feature not supported", nullptr); - CORRADE_ASSERT(!(features() & Feature::MultiFile), + CORRADE_ASSERT(!(features() & FontConverterFeature::MultiFile), "Text::AbstractFontConverter::exportFontToSingleData(): the format is not single-file", nullptr); return doExportFontToSingleData(font, cache, uniqueUnicode(characters)); @@ -129,14 +130,14 @@ Containers::Array AbstractFontConverter::doExportFontToSingleData(Abstract } bool AbstractFontConverter::exportFontToFile(AbstractFont& font, AbstractGlyphCache& cache, const std::string& filename, const std::string& characters) const { - CORRADE_ASSERT(features() & Feature::ExportFont, + CORRADE_ASSERT(features() & FontConverterFeature::ExportFont, "Text::AbstractFontConverter::exportFontToFile(): feature not supported", false); return doExportFontToFile(font, cache, filename, uniqueUnicode(characters)); } bool AbstractFontConverter::doExportFontToFile(AbstractFont& font, AbstractGlyphCache& cache, const std::string& filename, const std::u32string& characters) const { - CORRADE_ASSERT(features() & Feature::ConvertData, + CORRADE_ASSERT(features() & FontConverterFeature::ConvertData, "Text::AbstractFontConverter::exportFontToFile(): not implemented", false); /* Export all data */ @@ -152,14 +153,14 @@ bool AbstractFontConverter::doExportFontToFile(AbstractFont& font, AbstractGlyph } std::vector>> AbstractFontConverter::exportGlyphCacheToData(AbstractGlyphCache& cache, const std::string& filename) const { - CORRADE_ASSERT(features() >= (Feature::ExportGlyphCache|Feature::ConvertData), + CORRADE_ASSERT(features() >= (FontConverterFeature::ExportGlyphCache|FontConverterFeature::ConvertData), "Text::AbstractFontConverter::exportGlyphCacheToData(): feature not supported", {}); return doExportGlyphCacheToData(cache, filename); } std::vector>> AbstractFontConverter::doExportGlyphCacheToData(AbstractGlyphCache& cache, const std::string& filename) const { - CORRADE_ASSERT(!(features() & Feature::MultiFile), + CORRADE_ASSERT(!(features() & FontConverterFeature::MultiFile), "Text::AbstractFontConverter::exportGlyphCacheToData(): feature advertised but not implemented", {}); std::vector>> out; @@ -168,9 +169,9 @@ std::vector>> AbstractFontConvert } Containers::Array AbstractFontConverter::exportGlyphCacheToSingleData(AbstractGlyphCache& cache) const { - CORRADE_ASSERT(features() >= (Feature::ExportGlyphCache|Feature::ConvertData), + CORRADE_ASSERT(features() >= (FontConverterFeature::ExportGlyphCache|FontConverterFeature::ConvertData), "Text::AbstractFontConverter::exportGlyphCacheToSingleData(): feature not supported", nullptr); - CORRADE_ASSERT(!(features() & Feature::MultiFile), + CORRADE_ASSERT(!(features() & FontConverterFeature::MultiFile), "Text::AbstractFontConverter::exportGlyphCacheToSingleData(): the format is not single-file", nullptr); return doExportGlyphCacheToSingleData(cache); @@ -183,14 +184,14 @@ Containers::Array AbstractFontConverter::doExportGlyphCacheToSingleData(Ab } bool AbstractFontConverter::exportGlyphCacheToFile(AbstractGlyphCache& cache, const std::string& filename) const { - CORRADE_ASSERT(features() & Feature::ExportGlyphCache, + CORRADE_ASSERT(features() & FontConverterFeature::ExportGlyphCache, "Text::AbstractFontConverter::exportGlyphCacheToFile(): feature not supported", false); return doExportGlyphCacheToFile(cache, filename); } bool AbstractFontConverter::doExportGlyphCacheToFile(AbstractGlyphCache& cache, const std::string& filename) const { - CORRADE_ASSERT(features() & Feature::ConvertData, + CORRADE_ASSERT(features() & FontConverterFeature::ConvertData, "Text::AbstractFontConverter::exportGlyphCacheToFile(): not implemented", false); /* Export all data */ @@ -206,7 +207,7 @@ bool AbstractFontConverter::doExportGlyphCacheToFile(AbstractGlyphCache& cache, } Containers::Pointer AbstractFontConverter::importGlyphCacheFromData(const std::vector>>& data) const { - CORRADE_ASSERT(features() >= (Feature::ImportGlyphCache|Feature::ConvertData), + CORRADE_ASSERT(features() >= (FontConverterFeature::ImportGlyphCache|FontConverterFeature::ConvertData), "Text::AbstractFontConverter::importGlyphCacheFromData(): feature not supported", nullptr); CORRADE_ASSERT(!data.empty(), "Text::AbstractFontConverter::importGlyphCacheFromData(): no data passed", nullptr); @@ -215,7 +216,7 @@ Containers::Pointer AbstractFontConverter::importGlyphCacheF } Containers::Pointer AbstractFontConverter::doImportGlyphCacheFromData(const std::vector>>& data) const { - CORRADE_ASSERT(!(features() & Feature::MultiFile), + CORRADE_ASSERT(!(features() & FontConverterFeature::MultiFile), "Text::AbstractFontConverter::importGlyphCacheFromData(): feature advertised but not implemented", nullptr); CORRADE_ASSERT(data.size() == 1, "Text::AbstractFontConverter::importGlyphCacheFromData(): expected just one file for single-file format", nullptr); @@ -224,9 +225,9 @@ Containers::Pointer AbstractFontConverter::doImportGlyphCach } Containers::Pointer AbstractFontConverter::importGlyphCacheFromSingleData(Containers::ArrayView data) const { - CORRADE_ASSERT(features() >= (Feature::ImportGlyphCache|Feature::ConvertData), + CORRADE_ASSERT(features() >= (FontConverterFeature::ImportGlyphCache|FontConverterFeature::ConvertData), "Text::AbstractFontConverter::importGlyphCacheFromSingleData(): feature not supported", nullptr); - CORRADE_ASSERT(!(features() & Feature::MultiFile), + CORRADE_ASSERT(!(features() & FontConverterFeature::MultiFile), "Text::AbstractFontConverter::importGlyphCacheFromSingleData(): the format is not single-file", nullptr); return doImportGlyphCacheFromSingleData(data); @@ -239,14 +240,14 @@ Containers::Pointer AbstractFontConverter::doImportGlyphCach } Containers::Pointer AbstractFontConverter::importGlyphCacheFromFile(const std::string& filename) const { - CORRADE_ASSERT(features() & Feature::ImportGlyphCache, + CORRADE_ASSERT(features() & FontConverterFeature::ImportGlyphCache, "Text::AbstractFontConverter::importGlyphCacheFromFile(): feature not supported", nullptr); return doImportGlyphCacheFromFile(filename); } Containers::Pointer AbstractFontConverter::doImportGlyphCacheFromFile(const std::string& filename) const { - CORRADE_ASSERT(features() & Feature::ConvertData && !(features() & Feature::MultiFile), + CORRADE_ASSERT(features() & FontConverterFeature::ConvertData && !(features() & FontConverterFeature::MultiFile), "Text::AbstractFontConverter::importGlyphCacheFromFile(): not implemented", nullptr); /* Open file */ @@ -258,4 +259,31 @@ Containers::Pointer AbstractFontConverter::doImportGlyphCach return doImportGlyphCacheFromSingleData(Utility::Directory::read(filename)); } +Debug& operator<<(Debug& debug, const FontConverterFeature value) { + debug << "Text::FontConverterFeature" << Debug::nospace; + + switch(value) { + /* LCOV_EXCL_START */ + #define _c(v) case FontConverterFeature::v: return debug << "::" #v; + _c(ExportFont) + _c(ExportGlyphCache) + _c(ImportGlyphCache) + _c(ConvertData) + _c(MultiFile) + #undef _c + /* LCOV_EXCL_STOP */ + } + + return debug << "(" << Debug::nospace << reinterpret_cast(Containers::enumCastUnderlyingType(value)) << Debug::nospace << ")"; +} + +Debug& operator<<(Debug& debug, const FontConverterFeatures value) { + return Containers::enumSetDebugOutput(debug, value, "Text::FontConverterFeatures{}", { + FontConverterFeature::ExportFont, + FontConverterFeature::ExportGlyphCache, + FontConverterFeature::ImportGlyphCache, + FontConverterFeature::ConvertData, + FontConverterFeature::MultiFile}); +} + }} diff --git a/src/Magnum/Text/AbstractFontConverter.h b/src/Magnum/Text/AbstractFontConverter.h index b58be178c..f8f795958 100644 --- a/src/Magnum/Text/AbstractFontConverter.h +++ b/src/Magnum/Text/AbstractFontConverter.h @@ -49,6 +49,76 @@ namespace Magnum { namespace Text { +/** +@brief Features supported by a font converter +@m_since_latest + +@see @ref FontConverterFeatures, @ref AbstractFontConverter::features() +*/ +enum class FontConverterFeature: UnsignedByte { + /** + * Exporting font using @ref AbstractFontConverter::exportFontToFile(), + * @ref AbstractFontConverter::exportFontToData() or + * @ref AbstractFontConverter::exportFontToSingleData() + * @see @ref FontConverterFeature::ConvertData + */ + ExportFont = 1 << 0, + + /** + * Export glyph cache using + * @ref AbstractFontConverter::exportGlyphCacheToFile(), + * @ref AbstractFontConverter::exportGlyphCacheToData() or + * @ref AbstractFontConverter::exportGlyphCacheToSingleData() + * @see @ref FontConverterFeature::ConvertData + */ + ExportGlyphCache = 1 << 1, + + /** + * Import glyph cache using + * @ref AbstractFontConverter::importGlyphCacheFromFile(), + * @ref AbstractFontConverter::importGlyphCacheFromData() or + * @ref AbstractFontConverter::importGlyphCacheFromSingleData() + * @see @ref FontConverterFeature::ConvertData + */ + ImportGlyphCache = 1 << 2, + + /** + * Convert from/to data using + * @ref AbstractFontConverter::exportFontToData(), + * @ref AbstractFontConverter::exportFontToSingleData(), + * @ref AbstractFontConverter::exportGlyphCacheToData(), + * @ref AbstractFontConverter::exportGlyphCacheToSingleData(), + * @ref AbstractFontConverter::importGlyphCacheFromData() or + * @ref AbstractFontConverter::importGlyphCacheFromSingleData() + */ + ConvertData = 1 << 4, + + /** + * The format is multi-file, thus + * @ref AbstractFontConverter::exportFontToSingleData(), + * @ref AbstractFontConverter::exportGlyphCacheToSingleData() and + * @ref AbstractFontConverter::importGlyphCacheFromSingleData() convenience + * functions cannot be used. + */ + MultiFile = 1 << 5 +}; + +/** +@brief Features supported by a font converter +@m_since_latest + +@see @ref AbstractFontConverter::features() +*/ +typedef Containers::EnumSet FontConverterFeatures; + +CORRADE_ENUMSET_OPERATORS(FontConverterFeatures) + +/** @debugoperatorenum{FontConverterFeature} */ +MAGNUM_TEXT_EXPORT Debug& operator<<(Debug& debug, FontConverterFeature value); + +/** @debugoperatorenum{FontConverterFeatures} */ +MAGNUM_TEXT_EXPORT Debug& operator<<(Debug& debug, FontConverterFeatures value); + /** @brief Base for font converter plugins @@ -69,13 +139,14 @@ characters. You don't need to do most of the redundant sanity checks, these things are checked by the implementation: -- Functions `doExportFontTo*()` are called only if @ref Feature::ExportFont - is supported, functions `doExportGlyphCacheTo*()` are called only if - @ref Feature::ExportGlyphCache is supported. +- Functions `doExportFontTo*()` are called only if + @ref FontConverterFeature::ExportFont is supported, functions + `doExportGlyphCacheTo*()` are called only if + @ref FontConverterFeature::ExportGlyphCache is supported. - Functions `doImportGlyphCacheFrom*()` are called only if - @ref Feature::ImportGlyphCache is supported. + @ref FontConverterFeature::ImportGlyphCache is supported. - Functions `doExport*To*Data()` and `doImport*From*Data()` are called only - if @ref Feature::ConvertData is supported. + if @ref FontConverterFeature::ConvertData is supported. - Function `doImport*FromData()` is called only if there is at least one data array passed. @@ -86,55 +157,17 @@ checked by the implementation: */ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPlugin { public: - /** - * @brief Features supported by this converter - * - * @see @ref Features, @ref features() + #ifdef MAGNUM_BUILD_DEPRECATED + /** @brief @copybrief FontConverterFeature + * @m_deprecated_since_latest Use @ref FontConverterFeature instead. */ - enum class Feature: UnsignedByte { - /** - * Exporting font using @ref exportFontToFile(), @ref exportFontToData() - * or @ref exportFontToSingleData() - * @see @ref Feature::ConvertData - */ - ExportFont = 1 << 0, - - /** - * Export glyph cache using @ref exportGlyphCacheToFile(), - * @ref exportGlyphCacheToData() or @ref exportGlyphCacheToSingleData() - * @see @ref Feature::ConvertData - */ - ExportGlyphCache = 1 << 1, - - /** - * Import glyph cache using @ref importGlyphCacheFromFile(), - * @ref importGlyphCacheFromData() or @ref importGlyphCacheFromSingleData() - * @see @ref Feature::ConvertData - */ - ImportGlyphCache = 1 << 2, - - /** - * Convert from/to data using @ref exportFontToData(), - * @ref exportFontToSingleData(), @ref exportGlyphCacheToData(), - * @ref exportGlyphCacheToSingleData(), @ref importGlyphCacheFromData() - * or @ref importGlyphCacheFromSingleData() - */ - ConvertData = 1 << 4, - - /** - * The format is multi-file, thus @ref exportFontToSingleData(), - * @ref exportGlyphCacheToSingleData() and @ref importGlyphCacheFromSingleData() - * convenience functions cannot be used. - */ - MultiFile = 1 << 5 - }; + typedef CORRADE_DEPRECATED("use FontConverterFeature instead") FontConverterFeature Feature; - /** - * @brief Features supported by this converter - * - * @see @ref features() + /** @brief @copybrief FontConverterFeatures + * @m_deprecated_since_latest Use @ref FontConverterFeatures instead. */ - typedef Containers::EnumSet Features; + typedef CORRADE_DEPRECATED("use FontConverterFeatures instead") FontConverterFeatures Features; + #endif /** * @brief Plugin interface @@ -171,7 +204,7 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl explicit AbstractFontConverter(PluginManager::AbstractManager& manager, const std::string& plugin); /** @brief Features supported by this converter */ - Features features() const { return doFeatures(); } + FontConverterFeatures features() const { return doFeatures(); } /** * @brief Export font to raw data @@ -180,12 +213,13 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl * @param filename Output filename * @param characters Characters to export * - * Available only if @ref Feature::ConvertData and @ref Feature::ExportFont - * is supported. Returns pairs of filename and data on success, empty - * vector otherwise. All data will be sharing common basename derived - * from @p filename. If the plugin doesn't have @ref Feature::MultiFile, - * only one pair is returned, thus using @ref exportFontToSingleData() - * might be more convenient in that case. + * Available only if @ref FontConverterFeature::ConvertData and + * @ref FontConverterFeature::ExportFont is supported. Returns pairs of + * filename and data on success, empty vector otherwise. All data will + * be sharing common basename derived from @p filename. If the plugin + * doesn't have @ref FontConverterFeature::MultiFile, only one pair is + * returned, thus using @ref exportFontToSingleData() might be more + * convenient in that case. * @see @ref features(), @ref exportFontToFile(), * @ref exportGlyphCacheToData() */ @@ -194,10 +228,11 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl /** * @brief Export font to single raw data * - * Available only if @ref Feature::ConvertData and @ref Feature::ExportFont - * is supported and the plugin doesn't have @ref Feature::MultiFile. - * Returns data on success, zero-sized array otherwise. See - * @ref exportFontToData() for more information. + * Available only if @ref FontConverterFeature::ConvertData and + * @ref FontConverterFeature::ExportFont is supported and the plugin + * doesn't have @ref FontConverterFeature::MultiFile. Returns data on + * success, zero-sized array otherwise. See @ref exportFontToData() for + * more information. * @see @ref features(), @ref exportFontToFile(), * @ref exportGlyphCacheToSingleData() */ @@ -206,11 +241,12 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl /** * @brief Export font to file * - * Available only if @ref Feature::ExportFont is supported. If the - * plugin has @ref Feature::MultiFile, the function will create more - * than one file in given path, all sharing common basename derived - * from @p filename. Returns @cpp true @ce on success, @cpp false @ce - * otherwise. See @ref exportFontToData() for more information. + * Available only if @ref FontConverterFeature::ExportFont is + * supported. If the plugin has @ref FontConverterFeature::MultiFile, + * the function will create more than one file in given path, all + * sharing common basename derived from @p filename. Returns + * @cpp true @ce on success, @cpp false @ce otherwise. See + * @ref exportFontToData() for more information. * @see @ref features(), @ref exportFontToData(), * @ref exportGlyphCacheToFile() */ @@ -221,11 +257,12 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl * @param cache Populated glyph cache * @param filename Output filename * - * Available only if @ref Feature::ConvertData and @ref Feature::ExportGlyphCache - * is supported. Returns pairs of filename and data on success, empty - * vector otherwise. All data will be sharing common basename derived - * from @p filename. If the plugin doesn't have @ref Feature::MultiFile, - * only one pair is returned, thus using @ref exportGlyphCacheToSingleData() + * Available only if @ref FontConverterFeature::ConvertData and + * @ref FontConverterFeature::ExportGlyphCache is supported. Returns + * pairs of filename and data on success, empty vector otherwise. All + * data will be sharing common basename derived from @p filename. If + * the plugin doesn't have @ref FontConverterFeature::MultiFile, only + * one pair is returned, thus using @ref exportGlyphCacheToSingleData() * might be more convenient in that case. * * All glyphs from given cache will be exported. If you want to export @@ -238,9 +275,10 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl /** * @brief Export glyph cache to single raw data * - * Available only if @ref Feature::ConvertData and @ref Feature::ExportGlyphCache - * is supported and the plugin doesn't have @ref Feature::MultiFile. - * Returns data on success, zero-sized array otherwise. See + * Available only if @ref FontConverterFeature::ConvertData and + * @ref FontConverterFeature::ExportGlyphCache is supported and the + * plugin doesn't have @ref FontConverterFeature::MultiFile. Returns + * data on success, zero-sized array otherwise. See * @ref exportGlyphCacheToData() for more information. * @see @ref features(), @ref exportGlyphCacheToFile(), * @ref importGlyphCacheFromSingleData() @@ -250,11 +288,11 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl /** * @brief Export glyph cache to file * - * Available only if @ref Feature::ExportGlyphCache is supported. If - * the plugin has @ref Feature::MultiFile, the function will create - * more than one file in given path, all sharing common basename - * derived from @p filename. Returns @cpp true @ce on success, - * @cpp false @ce otherwise. + * Available only if @ref FontConverterFeature::ExportGlyphCache is + * supported. If the plugin has @ref FontConverterFeature::MultiFile, + * the function will create more than one file in given path, all + * sharing common basename derived from @p filename. Returns + * @cpp true @ce on success, @cpp false @ce otherwise. * @see @ref features(), @ref exportGlyphCacheToData(), * @ref exportFontToFile() */ @@ -264,11 +302,12 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl * @brief Import glyph cache from raw data * @param data Pairs of filename and file data * - * Available only if @ref Feature::ConvertData and @ref Feature::ImportGlyphCache - * is supported. Returns imported cache on success, @cpp nullptr @ce - * otherwise. If the plugin doesn't have @ref Feature::MultiFile, only - * one file is needed, thus using @ref importGlyphCacheFromSingleData() - * might be more convenient in that case. + * Available only if @ref FontConverterFeature::ConvertData and + * @ref FontConverterFeature::ImportGlyphCache is supported. Returns + * imported cache on success, @cpp nullptr @ce otherwise. If the plugin + * doesn't have @ref FontConverterFeature::MultiFile, only one file is + * needed, thus using @ref importGlyphCacheFromSingleData() might be + * more convenient in that case. * @see @ref features(), @ref importGlyphCacheFromFile(), * @ref exportGlyphCacheToData() */ @@ -277,9 +316,10 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl /** * @brief Import glyph cache from single raw data * - * Available only if @ref Feature::ConvertData and @ref Feature::ImportGlyphCache - * is supported and the plugin doesn't have @ref Feature::MultiFile. - * Returns imported cache on success, @cpp nullptr @ce otherwise. See + * Available only if @ref FontConverterFeature::ConvertData and + * @ref FontConverterFeature::ImportGlyphCache is supported and the + * plugin doesn't have @ref FontConverterFeature::MultiFile. Returns + * imported cache on success, @cpp nullptr @ce otherwise. See * @ref importGlyphCacheFromData() for multi-file conversion. * @see @ref features(), @ref importGlyphCacheFromFile(), * @ref exportFontToSingleData() @@ -289,11 +329,11 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl /** * @brief Import glyph cache from file * - * Available only if @ref Feature::ImportGlyphCache is supported. If - * the plugin has @ref Feature::MultiFile, the function will use - * additional files in given path, all sharing common basename derived - * from @p filename. Returns imported cache on success, @cpp nullptr @ce - * otherwise. + * Available only if @ref FontConverterFeature::ImportGlyphCache is + * supported. If the plugin has @ref FontConverterFeature::MultiFile, + * the function will use additional files in given path, all sharing + * common basename derived from @p filename. Returns imported cache on + * success, @cpp nullptr @ce otherwise. * @see @ref features(), @ref importGlyphCacheFromData(), * @ref exportGlyphCacheToFile() */ @@ -301,13 +341,13 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl private: /** @brief Implementation for @ref features() */ - virtual Features doFeatures() const = 0; + virtual FontConverterFeatures doFeatures() const = 0; /** * @brief Implementation for @ref exportFontToData() * - * If the plugin doesn't have @ref Feature::MultiFile, default - * implementation calls @ref doExportFontToSingleData(). + * If the plugin doesn't have @ref FontConverterFeature::MultiFile, + * default implementation calls @ref doExportFontToSingleData(). */ virtual std::vector>> doExportFontToData(AbstractFont& font, AbstractGlyphCache& cache, const std::string& filename, const std::u32string& characters) const; @@ -317,17 +357,17 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl /** * @brief Implementation for @ref exportFontToFile() * - * If @ref Feature::ConvertData is supported, default implementation - * calls @ref doExportFontToData() and saves the result to given - * file(s). + * If @ref FontConverterFeature::ConvertData is supported, default + * implementation calls @ref doExportFontToData() and saves the result + * to given file(s). */ virtual bool doExportFontToFile(AbstractFont& font, AbstractGlyphCache& cache, const std::string& filename, const std::u32string& characters) const; /** * @brief Implementation for @ref exportGlyphCacheToData() * - * If the plugin doesn't have @ref Feature::MultiFile, default - * implementation calls @ref doExportGlyphCacheToSingleData(). + * If the plugin doesn't have @ref FontConverterFeature::MultiFile, + * default implementation calls @ref doExportGlyphCacheToSingleData(). */ virtual std::vector>> doExportGlyphCacheToData(AbstractGlyphCache& cache, const std::string& filename) const; @@ -337,17 +377,17 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl /** * @brief Implementation for @ref exportGlyphCacheToFile() * - * If @ref Feature::ConvertData is supported, default implementation - * calls @ref doExportGlyphCacheToData() and saves the result to given - * file(s). + * If @ref FontConverterFeature::ConvertData is supported, default + * implementation calls @ref doExportGlyphCacheToData() and saves the + * result to given file(s). */ virtual bool doExportGlyphCacheToFile(AbstractGlyphCache& cache, const std::string& filename) const; /** * @brief Implementation for @ref importGlyphCacheFromData() * - * If the plugin doesn't have @ref Feature::MultiFile, default - * implementation calls @ref doImportGlyphCacheFromSingleData(). + * If the plugin doesn't have @ref FontConverterFeature::MultiFile, + * default implementation calls @ref doImportGlyphCacheFromSingleData(). */ virtual Containers::Pointer doImportGlyphCacheFromData(const std::vector>>& data) const; @@ -357,15 +397,14 @@ class MAGNUM_TEXT_EXPORT AbstractFontConverter: public PluginManager::AbstractPl /** * @brief Implementation for @ref importGlyphCacheFromFile() * - * If @ref Feature::ConvertData is supported and the plugin doesn't - * have @ref Feature::MultiFile, default implementation opens the file - * and calls @ref doImportGlyphCacheFromSingleData() with its contents. + * If @ref FontConverterFeature::ConvertData is supported and the + * plugin doesn't have @ref FontConverterFeature::MultiFile, default + * implementation opens the file and calls + * @ref doImportGlyphCacheFromSingleData() with its contents. */ virtual Containers::Pointer doImportGlyphCacheFromFile(const std::string& filename) const; }; -CORRADE_ENUMSET_OPERATORS(AbstractFontConverter::Features) - }} #endif diff --git a/src/Magnum/Text/Test/AbstractFontConverterTest.cpp b/src/Magnum/Text/Test/AbstractFontConverterTest.cpp index d9a07923e..89101823a 100644 --- a/src/Magnum/Text/Test/AbstractFontConverterTest.cpp +++ b/src/Magnum/Text/Test/AbstractFontConverterTest.cpp @@ -23,6 +23,7 @@ DEALINGS IN THE SOFTWARE. */ +#include #include #include #include @@ -53,6 +54,9 @@ struct AbstractFontConverterTest: TestSuite::Tester { void importGlyphCacheFromSingleData(); void importGlyphCacheFromFile(); + + void debugFeature(); + void debugFeatures(); }; AbstractFontConverterTest::AbstractFontConverterTest() { @@ -67,14 +71,17 @@ AbstractFontConverterTest::AbstractFontConverterTest() { &AbstractFontConverterTest::exportGlyphCacheToFileFailed, &AbstractFontConverterTest::importGlyphCacheFromSingleData, - &AbstractFontConverterTest::importGlyphCacheFromFile}); + &AbstractFontConverterTest::importGlyphCacheFromFile, + + &AbstractFontConverterTest::debugFeature, + &AbstractFontConverterTest::debugFeatures}); /* Create testing dir */ Utility::Directory::mkpath(TEXT_TEST_OUTPUT_DIR); } struct DummyFont: AbstractFont { - Features doFeatures() const override { return {}; } + FontFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -99,7 +106,7 @@ void AbstractFontConverterTest::convertGlyphs() { GlyphExporter(std::u32string& characters): _characters(characters) {} private: - Features doFeatures() const override { return Feature::ConvertData|Feature::ExportFont; } + FontConverterFeatures doFeatures() const override { return FontConverterFeature::ConvertData|FontConverterFeature::ExportFont; } Containers::Array doExportFontToSingleData(AbstractFont&, AbstractGlyphCache&, const std::u32string& characters) const override { _characters = characters; @@ -118,7 +125,7 @@ void AbstractFontConverterTest::convertGlyphs() { void AbstractFontConverterTest::exportFontToSingleData() { class SingleDataExporter: public Text::AbstractFontConverter { private: - Features doFeatures() const override { return Feature::ConvertData|Feature::ExportFont; } + FontConverterFeatures doFeatures() const override { return FontConverterFeature::ConvertData|FontConverterFeature::ExportFont; } Containers::Array doExportFontToSingleData(AbstractFont&, AbstractGlyphCache&, const std::u32string&) const override { Containers::Array data(1); @@ -139,7 +146,7 @@ void AbstractFontConverterTest::exportFontToSingleData() { void AbstractFontConverterTest::exportFontToFile() { class DataExporter: public Text::AbstractFontConverter { private: - Features doFeatures() const override { return Feature::ConvertData|Feature::ExportFont|Feature::MultiFile; } + FontConverterFeatures doFeatures() const override { return FontConverterFeature::ConvertData|FontConverterFeature::ExportFont|FontConverterFeature::MultiFile; } std::vector>> doExportFontToData(AbstractFont&, AbstractGlyphCache&, const std::string& filename, const std::u32string&) const override { /* Why the hell GCC 4.9 fails to do proper move so I need to @@ -167,7 +174,7 @@ void AbstractFontConverterTest::exportFontToFile() { void AbstractFontConverterTest::exportFontToFileFailed() { struct: AbstractFontConverter { - Features doFeatures() const override { return Feature::ConvertData|Feature::ExportFont|Feature::MultiFile; } + FontConverterFeatures doFeatures() const override { return FontConverterFeature::ConvertData|FontConverterFeature::ExportFont|FontConverterFeature::MultiFile; } std::vector>> doExportFontToData(AbstractFont&, AbstractGlyphCache&, const std::string&, const std::u32string&) const override { return {}; } } exporter; @@ -177,7 +184,7 @@ void AbstractFontConverterTest::exportFontToFileFailed() { void AbstractFontConverterTest::exportGlyphCacheToSingleData() { struct: Text::AbstractFontConverter { - Features doFeatures() const override { return Feature::ConvertData|Feature::ExportGlyphCache; } + FontConverterFeatures doFeatures() const override { return FontConverterFeature::ConvertData|FontConverterFeature::ExportGlyphCache; } Containers::Array doExportGlyphCacheToSingleData(AbstractGlyphCache&) const override { return Containers::Array{Containers::InPlaceInit, {'\xee'}}; @@ -196,7 +203,7 @@ void AbstractFontConverterTest::exportGlyphCacheToSingleData() { void AbstractFontConverterTest::exportGlyphCacheToFile() { class DataExporter: public Text::AbstractFontConverter { private: - Features doFeatures() const override { return Feature::ConvertData|Feature::ExportGlyphCache|Feature::MultiFile; } + FontConverterFeatures doFeatures() const override { return FontConverterFeature::ConvertData|FontConverterFeature::ExportGlyphCache|FontConverterFeature::MultiFile; } std::vector>> doExportGlyphCacheToData(AbstractGlyphCache&, const std::string& filename) const override { /* Why the hell GCC 4.9 fails to do proper move so I need to @@ -224,7 +231,7 @@ void AbstractFontConverterTest::exportGlyphCacheToFile() { void AbstractFontConverterTest::exportGlyphCacheToFileFailed() { struct: Text::AbstractFontConverter { - Features doFeatures() const override { return Feature::ConvertData|Feature::ExportGlyphCache|Feature::MultiFile; } + FontConverterFeatures doFeatures() const override { return FontConverterFeature::ConvertData|FontConverterFeature::ExportGlyphCache|FontConverterFeature::MultiFile; } std::vector>> doExportGlyphCacheToData(AbstractGlyphCache&, const std::string&) const override { return {}; } } exporter; @@ -235,7 +242,7 @@ void AbstractFontConverterTest::exportGlyphCacheToFileFailed() { class SingleGlyphCacheDataImporter: public Text::AbstractFontConverter { private: - Features doFeatures() const override { return Feature::ConvertData|Feature::ImportGlyphCache; } + FontConverterFeatures doFeatures() const override { return FontConverterFeature::ConvertData|FontConverterFeature::ImportGlyphCache; } Containers::Pointer doImportGlyphCacheFromSingleData(const Containers::ArrayView data) const override { if(data.size() == 1 && data[0] == '\xa5') @@ -259,6 +266,20 @@ void AbstractFontConverterTest::importGlyphCacheFromFile() { CORRADE_COMPARE(cache->textureSize(), (Vector2i{123, 345})); } +void AbstractFontConverterTest::debugFeature() { + std::ostringstream out; + + Debug{&out} << FontConverterFeature::ExportFont << FontConverterFeature(0xf0); + CORRADE_COMPARE(out.str(), "Text::FontConverterFeature::ExportFont Text::FontConverterFeature(0xf0)\n"); +} + +void AbstractFontConverterTest::debugFeatures() { + std::ostringstream out; + + Debug{&out} << (FontConverterFeature::ExportFont|FontConverterFeature::ImportGlyphCache) << FontConverterFeatures{}; + CORRADE_COMPARE(out.str(), "Text::FontConverterFeature::ExportFont|Text::FontConverterFeature::ImportGlyphCache Text::FontConverterFeatures{}\n"); +} + }}}} CORRADE_TEST_MAIN(Magnum::Text::Test::AbstractFontConverterTest) diff --git a/src/Magnum/Text/Test/AbstractFontTest.cpp b/src/Magnum/Text/Test/AbstractFontTest.cpp index 551418a5a..329cc03b4 100644 --- a/src/Magnum/Text/Test/AbstractFontTest.cpp +++ b/src/Magnum/Text/Test/AbstractFontTest.cpp @@ -153,7 +153,7 @@ AbstractFontTest::AbstractFontTest() { void AbstractFontTest::construct() { struct: AbstractFont { - Features doFeatures() const override { return {}; } + FontFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -164,7 +164,7 @@ void AbstractFontTest::construct() { } } font; - CORRADE_COMPARE(font.features(), AbstractFont::Features{}); + CORRADE_COMPARE(font.features(), FontFeatures{}); CORRADE_VERIFY(!font.isOpened()); font.close(); @@ -173,7 +173,7 @@ void AbstractFontTest::construct() { void AbstractFontTest::openData() { struct: AbstractFont { - Features doFeatures() const override { return Feature::OpenData; } + FontFeatures doFeatures() const override { return FontFeature::OpenData; } bool doIsOpened() const override { return _opened; } void doClose() override {} @@ -203,7 +203,7 @@ void AbstractFontTest::openData() { void AbstractFontTest::openFileAsData() { struct: AbstractFont { - Features doFeatures() const override { return Feature::OpenData; } + FontFeatures doFeatures() const override { return FontFeature::OpenData; } bool doIsOpened() const override { return _opened; } void doClose() override {} @@ -233,7 +233,7 @@ void AbstractFontTest::openFileAsData() { void AbstractFontTest::openFileAsDataNotFound() { struct: AbstractFont { - Features doFeatures() const override { return Feature::OpenData; } + FontFeatures doFeatures() const override { return FontFeature::OpenData; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -253,7 +253,7 @@ void AbstractFontTest::openFileAsDataNotFound() { void AbstractFontTest::openFileNotImplemented() { struct: AbstractFont { /* Supports neither file nor data opening */ - Features doFeatures() const override { return {}; } + FontFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -273,7 +273,7 @@ void AbstractFontTest::openFileNotImplemented() { void AbstractFontTest::openDataNotSupported() { struct: AbstractFont { /* Supports neither file nor data opening */ - Features doFeatures() const override { return {}; } + FontFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -292,7 +292,7 @@ void AbstractFontTest::openDataNotSupported() { void AbstractFontTest::openDataNotImplemented() { struct: AbstractFont { - Features doFeatures() const override { return Feature::OpenData; } + FontFeatures doFeatures() const override { return FontFeature::OpenData; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -312,7 +312,7 @@ void AbstractFontTest::openDataNotImplemented() { #ifdef MAGNUM_BUILD_DEPRECATED void AbstractFontTest::openSingleDataDeprecated() { struct: AbstractFont { - Features doFeatures() const override { return Feature::OpenData; } + FontFeatures doFeatures() const override { return FontFeature::OpenData; } bool doIsOpened() const override { return _opened; } void doClose() override {} @@ -344,7 +344,7 @@ void AbstractFontTest::openSingleDataDeprecated() { void AbstractFontTest::openMultiDataDeprecated() { struct: AbstractFont { - Features doFeatures() const override { return Feature::OpenData; } + FontFeatures doFeatures() const override { return FontFeature::OpenData; } bool doIsOpened() const override { return _opened; } void doClose() override {} @@ -382,7 +382,7 @@ void AbstractFontTest::openMultiDataDeprecated() { void AbstractFontTest::setFileCallback() { struct: AbstractFont { - Features doFeatures() const override { return Feature::OpenData|Feature::FileCallback; } + FontFeatures doFeatures() const override { return FontFeature::OpenData|FontFeature::FileCallback; } bool doIsOpened() const override { return false; } void doClose() override {} void doSetFileCallback(Containers::Optional>(*)(const std::string&, InputFileCallbackPolicy, void*), void* userData) override { @@ -408,7 +408,7 @@ void AbstractFontTest::setFileCallback() { void AbstractFontTest::setFileCallbackTemplate() { struct: AbstractFont { - Features doFeatures() const override { return Feature::OpenData|Feature::FileCallback; } + FontFeatures doFeatures() const override { return FontFeature::OpenData|FontFeature::FileCallback; } bool doIsOpened() const override { return false; } void doClose() override {} void doSetFileCallback(Containers::Optional>(*)(const std::string&, InputFileCallbackPolicy, void*), void*) override { @@ -440,7 +440,7 @@ void AbstractFontTest::setFileCallbackTemplate() { void AbstractFontTest::setFileCallbackTemplateNull() { struct: AbstractFont { - Features doFeatures() const override { return Feature::OpenData|Feature::FileCallback; } + FontFeatures doFeatures() const override { return FontFeature::OpenData|FontFeature::FileCallback; } bool doIsOpened() const override { return false; } void doClose() override {} void doSetFileCallback(Containers::Optional>(*callback)(const std::string&, InputFileCallbackPolicy, void*), void* userData) override { @@ -465,7 +465,7 @@ void AbstractFontTest::setFileCallbackTemplateNull() { void AbstractFontTest::setFileCallbackTemplateConst() { struct: AbstractFont { - Features doFeatures() const override { return Feature::OpenData|Feature::FileCallback; } + FontFeatures doFeatures() const override { return FontFeature::OpenData|FontFeature::FileCallback; } bool doIsOpened() const override { return false; } void doClose() override {} void doSetFileCallback(Containers::Optional>(*)(const std::string&, InputFileCallbackPolicy, void*), void*) override { @@ -493,7 +493,7 @@ void AbstractFontTest::setFileCallbackTemplateConst() { void AbstractFontTest::setFileCallbackFileOpened() { struct: AbstractFont { - Features doFeatures() const override { return {}; } + FontFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -515,7 +515,7 @@ void AbstractFontTest::setFileCallbackFileOpened() { void AbstractFontTest::setFileCallbackNotImplemented() { struct: AbstractFont { - Features doFeatures() const override { return Feature::FileCallback; } + FontFeatures doFeatures() const override { return FontFeature::FileCallback; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -538,7 +538,7 @@ void AbstractFontTest::setFileCallbackNotImplemented() { void AbstractFontTest::setFileCallbackNotSupported() { struct: AbstractFont { - Features doFeatures() const override { return {}; } + FontFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -561,7 +561,7 @@ void AbstractFontTest::setFileCallbackNotSupported() { void AbstractFontTest::setFileCallbackOpenFileDirectly() { struct: AbstractFont { - Features doFeatures() const override { return Feature::FileCallback|Feature::OpenData; } + FontFeatures doFeatures() const override { return FontFeature::FileCallback|FontFeature::OpenData; } bool doIsOpened() const override { return _opened; } void doClose() override { _opened = false; } @@ -604,7 +604,7 @@ void AbstractFontTest::setFileCallbackOpenFileDirectly() { void AbstractFontTest::setFileCallbackOpenFileThroughBaseImplementation() { struct: AbstractFont { - Features doFeatures() const override { return Feature::FileCallback|Feature::OpenData; } + FontFeatures doFeatures() const override { return FontFeature::FileCallback|FontFeature::OpenData; } bool doIsOpened() const override { return _opened; } void doClose() override { _opened = false; } @@ -662,7 +662,7 @@ void AbstractFontTest::setFileCallbackOpenFileThroughBaseImplementation() { void AbstractFontTest::setFileCallbackOpenFileThroughBaseImplementationFailed() { struct: AbstractFont { - Features doFeatures() const override { return Feature::FileCallback|Feature::OpenData; } + FontFeatures doFeatures() const override { return FontFeature::FileCallback|FontFeature::OpenData; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -694,7 +694,7 @@ void AbstractFontTest::setFileCallbackOpenFileThroughBaseImplementationFailed() void AbstractFontTest::setFileCallbackOpenFileAsData() { struct: AbstractFont { - Features doFeatures() const override { return Feature::OpenData; } + FontFeatures doFeatures() const override { return FontFeature::OpenData; } bool doIsOpened() const override { return _opened; } void doClose() override { _opened = false; } @@ -753,7 +753,7 @@ void AbstractFontTest::setFileCallbackOpenFileAsData() { void AbstractFontTest::setFileCallbackOpenFileAsDataFailed() { struct: AbstractFont { - Features doFeatures() const override { return Feature::OpenData; } + FontFeatures doFeatures() const override { return FontFeature::OpenData; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -785,7 +785,7 @@ void AbstractFontTest::setFileCallbackOpenFileAsDataFailed() { void AbstractFontTest::properties() { struct: AbstractFont { - Features doFeatures() const override { return Feature::OpenData; } + FontFeatures doFeatures() const override { return FontFeature::OpenData; } bool doIsOpened() const override { return _opened; } void doClose() override {} @@ -812,7 +812,7 @@ void AbstractFontTest::properties() { void AbstractFontTest::propertiesNoFont() { struct MyFont: AbstractFont { - Features doFeatures() const override { return {}; } + FontFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -838,7 +838,7 @@ void AbstractFontTest::propertiesNoFont() { void AbstractFontTest::glyphId() { struct MyFont: AbstractFont { - Features doFeatures() const override { return {}; } + FontFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -854,7 +854,7 @@ void AbstractFontTest::glyphId() { void AbstractFontTest::glyphIdNoFont() { struct MyFont: AbstractFont { - Features doFeatures() const override { return {}; } + FontFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -873,7 +873,7 @@ void AbstractFontTest::glyphIdNoFont() { void AbstractFontTest::glyphAdvance() { struct MyFont: AbstractFont { - Features doFeatures() const override { return {}; } + FontFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -889,7 +889,7 @@ void AbstractFontTest::glyphAdvance() { void AbstractFontTest::glyphAdvanceNoFont() { struct MyFont: AbstractFont { - Features doFeatures() const override { return {}; } + FontFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -920,7 +920,7 @@ void AbstractFontTest::layout() { }; struct MyFont: AbstractFont { - Features doFeatures() const override { return {}; } + FontFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -938,7 +938,7 @@ void AbstractFontTest::layout() { void AbstractFontTest::layoutNoFont() { struct MyFont: AbstractFont { - Features doFeatures() const override { return {}; } + FontFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -956,7 +956,7 @@ void AbstractFontTest::layoutNoFont() { void AbstractFontTest::fillGlyphCache() { struct MyFont: AbstractFont { - Features doFeatures() const override { return {}; } + FontFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -983,7 +983,7 @@ void AbstractFontTest::fillGlyphCache() { void AbstractFontTest::fillGlyphCacheNotSupported() { struct MyFont: AbstractFont { - Features doFeatures() const override { return Feature::PreparedGlyphCache; } + FontFeatures doFeatures() const override { return FontFeature::PreparedGlyphCache; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1001,7 +1001,7 @@ void AbstractFontTest::fillGlyphCacheNotSupported() { void AbstractFontTest::fillGlyphCacheNotImplemented() { struct MyFont: AbstractFont { - Features doFeatures() const override { return {}; } + FontFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1019,7 +1019,7 @@ void AbstractFontTest::fillGlyphCacheNotImplemented() { void AbstractFontTest::fillGlyphCacheNoFont() { struct MyFont: AbstractFont { - Features doFeatures() const override { return {}; } + FontFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -1037,7 +1037,7 @@ void AbstractFontTest::fillGlyphCacheNoFont() { void AbstractFontTest::createGlyphCache() { struct MyFont: AbstractFont { - Features doFeatures() const override { return Feature::PreparedGlyphCache; } + FontFeatures doFeatures() const override { return FontFeature::PreparedGlyphCache; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1063,7 +1063,7 @@ void AbstractFontTest::createGlyphCache() { void AbstractFontTest::createGlyphCacheNotSupported() { struct MyFont: AbstractFont { - Features doFeatures() const override { return {}; } + FontFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1080,7 +1080,7 @@ void AbstractFontTest::createGlyphCacheNotSupported() { void AbstractFontTest::createGlyphCacheNotImplemented() { struct MyFont: AbstractFont { - Features doFeatures() const override { return Feature::PreparedGlyphCache; } + FontFeatures doFeatures() const override { return FontFeature::PreparedGlyphCache; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1097,7 +1097,7 @@ void AbstractFontTest::createGlyphCacheNotImplemented() { void AbstractFontTest::createGlyphCacheNoFont() { struct MyFont: AbstractFont { - Features doFeatures() const override { return Feature::PreparedGlyphCache; } + FontFeatures doFeatures() const override { return FontFeature::PreparedGlyphCache; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -1115,15 +1115,15 @@ void AbstractFontTest::createGlyphCacheNoFont() { void AbstractFontTest::debugFeature() { std::ostringstream out; - Debug{&out} << AbstractFont::Feature::OpenData << AbstractFont::Feature(0xf0); - CORRADE_COMPARE(out.str(), "Text::AbstractFont::Feature::OpenData Text::AbstractFont::Feature(0xf0)\n"); + Debug{&out} << FontFeature::OpenData << FontFeature(0xf0); + CORRADE_COMPARE(out.str(), "Text::FontFeature::OpenData Text::FontFeature(0xf0)\n"); } void AbstractFontTest::debugFeatures() { std::ostringstream out; - Debug{&out} << (AbstractFont::Feature::OpenData|AbstractFont::Feature::PreparedGlyphCache) << AbstractFont::Features{}; - CORRADE_COMPARE(out.str(), "Text::AbstractFont::Feature::OpenData|Text::AbstractFont::Feature::PreparedGlyphCache Text::AbstractFont::Features{}\n"); + Debug{&out} << (FontFeature::OpenData|FontFeature::PreparedGlyphCache) << FontFeatures{}; + CORRADE_COMPARE(out.str(), "Text::FontFeature::OpenData|Text::FontFeature::PreparedGlyphCache Text::FontFeatures{}\n"); } }}}} diff --git a/src/Magnum/Text/Test/RendererGLTest.cpp b/src/Magnum/Text/Test/RendererGLTest.cpp index 001d4ea76..120ab37e1 100644 --- a/src/Magnum/Text/Test/RendererGLTest.cpp +++ b/src/Magnum/Text/Test/RendererGLTest.cpp @@ -71,7 +71,7 @@ class TestLayouter: public Text::AbstractLayouter { }; class TestFont: public Text::AbstractFont { - Features doFeatures() const override { return Feature::OpenData; } + FontFeatures doFeatures() const override { return FontFeature::OpenData; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -340,7 +340,7 @@ void RendererGLTest::multiline() { explicit Font(): _opened(false) {} private: - Features doFeatures() const override { return {}; } + FontFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return _opened; } void doClose() override { _opened = false; } diff --git a/src/Magnum/Trade/AbstractImageConverter.cpp b/src/Magnum/Trade/AbstractImageConverter.cpp index afc209aa2..718e4c3e6 100644 --- a/src/Magnum/Trade/AbstractImageConverter.cpp +++ b/src/Magnum/Trade/AbstractImageConverter.cpp @@ -86,7 +86,7 @@ AbstractImageConverter::AbstractImageConverter(PluginManager::Manager{manager, plugin} {} Containers::Optional AbstractImageConverter::exportToImage(const ImageView2D& image) { - CORRADE_ASSERT(features() & Feature::ConvertImage, + CORRADE_ASSERT(features() & ImageConverterFeature::ConvertImage, "Trade::AbstractImageConverter::exportToImage(): feature not supported", {}); Containers::Optional out = doExportToImage(image); @@ -99,7 +99,7 @@ Containers::Optional AbstractImageConverter::doExportToImage(const Imag } Containers::Optional AbstractImageConverter::exportToCompressedImage(const ImageView2D& image) { - CORRADE_ASSERT(features() & Feature::ConvertCompressedImage, + CORRADE_ASSERT(features() & ImageConverterFeature::ConvertCompressedImage, "Trade::AbstractImageConverter::exportToCompressedImage(): feature not supported", {}); Containers::Optional out = doExportToCompressedImage(image); @@ -112,7 +112,7 @@ Containers::Optional AbstractImageConverter::doExportToCompre } Containers::Array AbstractImageConverter::exportToData(const ImageView2D& image) { - CORRADE_ASSERT(features() & Feature::ConvertData, + CORRADE_ASSERT(features() & ImageConverterFeature::ConvertData, "Trade::AbstractImageConverter::exportToData(): feature not supported", nullptr); Containers::Array out = doExportToData(image); @@ -125,7 +125,7 @@ Containers::Array AbstractImageConverter::doExportToData(const ImageView2D } Containers::Array AbstractImageConverter::exportToData(const CompressedImageView2D& image) { - CORRADE_ASSERT(features() & Feature::ConvertCompressedData, + CORRADE_ASSERT(features() & ImageConverterFeature::ConvertCompressedData, "Trade::AbstractImageConverter::exportToData(): feature not supported", nullptr); Containers::Array out = doExportToData(image); @@ -142,14 +142,14 @@ Containers::Array AbstractImageConverter::exportToData(const ImageData2D& } bool AbstractImageConverter::exportToFile(const ImageView2D& image, const std::string& filename) { - CORRADE_ASSERT(features() & Feature::ConvertFile, + CORRADE_ASSERT(features() & ImageConverterFeature::ConvertFile, "Trade::AbstractImageConverter::exportToFile(): feature not supported", {}); return doExportToFile(image, filename); } bool AbstractImageConverter::doExportToFile(const ImageView2D& image, const std::string& filename) { - CORRADE_ASSERT(features() >= Feature::ConvertData, "Trade::AbstractImageConverter::exportToFile(): feature advertised but not implemented", false); + CORRADE_ASSERT(features() >= ImageConverterFeature::ConvertData, "Trade::AbstractImageConverter::exportToFile(): feature advertised but not implemented", false); const auto data = doExportToData(image); if(!data) return false; @@ -164,14 +164,14 @@ bool AbstractImageConverter::doExportToFile(const ImageView2D& image, const std: } bool AbstractImageConverter::exportToFile(const CompressedImageView2D& image, const std::string& filename) { - CORRADE_ASSERT(features() & Feature::ConvertCompressedFile, + CORRADE_ASSERT(features() & ImageConverterFeature::ConvertCompressedFile, "Trade::AbstractImageConverter::exportToFile(): feature not supported", {}); return doExportToFile(image, filename); } bool AbstractImageConverter::doExportToFile(const CompressedImageView2D& image, const std::string& filename) { - CORRADE_ASSERT(features() >= Feature::ConvertCompressedData, "Trade::AbstractImageConverter::exportToFile(): feature advertised but not implemented", false); + CORRADE_ASSERT(features() >= ImageConverterFeature::ConvertCompressedData, "Trade::AbstractImageConverter::exportToFile(): feature advertised but not implemented", false); const auto data = doExportToData(image); if(!data) return false; @@ -189,12 +189,12 @@ bool AbstractImageConverter::exportToFile(const ImageData2D& image, const std::s return image.isCompressed() ? exportToFile(CompressedImageView2D(image), filename) : exportToFile(ImageView2D(image), filename); } -Debug& operator<<(Debug& debug, const AbstractImageConverter::Feature value) { - debug << "Trade::AbstractImageConverter::Feature" << Debug::nospace; +Debug& operator<<(Debug& debug, const ImageConverterFeature value) { + debug << "Trade::ImageConverterFeature" << Debug::nospace; switch(value) { /* LCOV_EXCL_START */ - #define _c(v) case AbstractImageConverter::Feature::v: return debug << "::" #v; + #define _c(v) case ImageConverterFeature::v: return debug << "::" #v; _c(ConvertImage) _c(ConvertCompressedImage) _c(ConvertFile) @@ -208,15 +208,15 @@ Debug& operator<<(Debug& debug, const AbstractImageConverter::Feature value) { return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; } -Debug& operator<<(Debug& debug, const AbstractImageConverter::Features value) { - return Containers::enumSetDebugOutput(debug, value, "Trade::AbstractImageConverter::Features{}", { - AbstractImageConverter::Feature::ConvertImage, - AbstractImageConverter::Feature::ConvertCompressedImage, - AbstractImageConverter::Feature::ConvertData, - AbstractImageConverter::Feature::ConvertCompressedData, +Debug& operator<<(Debug& debug, const ImageConverterFeatures value) { + return Containers::enumSetDebugOutput(debug, value, "Trade::ImageConverterFeatures{}", { + ImageConverterFeature::ConvertImage, + ImageConverterFeature::ConvertCompressedImage, + ImageConverterFeature::ConvertData, + ImageConverterFeature::ConvertCompressedData, /* These are implied by Convert[Compressed]Data, so have to be last */ - AbstractImageConverter::Feature::ConvertFile, - AbstractImageConverter::Feature::ConvertCompressedFile}); + ImageConverterFeature::ConvertFile, + ImageConverterFeature::ConvertCompressedFile}); } }} diff --git a/src/Magnum/Trade/AbstractImageConverter.h b/src/Magnum/Trade/AbstractImageConverter.h index 192897950..e308847f6 100644 --- a/src/Magnum/Trade/AbstractImageConverter.h +++ b/src/Magnum/Trade/AbstractImageConverter.h @@ -37,6 +37,68 @@ namespace Magnum { namespace Trade { +/** +@brief Features supported by an image converter +@m_since_latest + +@see @ref ImageConverterFeatures, @ref AbstractImageConverter::features() +*/ +enum class ImageConverterFeature: UnsignedByte { + /** + * Conversion to image with different format with + * @ref AbstractImageConverter::exportToImage() + */ + ConvertImage = 1 << 0, + + /** + * Conversion to compressed image with + * @ref AbstractImageConverter::exportToCompressedImage() + */ + ConvertCompressedImage = 1 << 1, + + /** + * Exporting to file with + * @ref AbstractImageConverter::exportToFile(const ImageView2D&, const std::string&) + */ + ConvertFile = 1 << 2, + + /** + * Exporting to file with + * @ref AbstractImageConverter::exportToFile(const CompressedImageView2D&, const std::string&) + */ + ConvertCompressedFile = 1 << 3, + + /** + * Exporting to raw data with + * @ref AbstractImageConverter::exportToData(const ImageView2D&). + * Implies @ref ImageConverterFeature::ConvertFile. + */ + ConvertData = ConvertFile|(1 << 4), + + /** + * Exporting compressed image to raw data with + * @ref AbstractImageConverter::exportToData(const CompressedImageView2D&). + * Implies @ref ImageConverterFeature::ConvertCompressedFile. + */ + ConvertCompressedData = ConvertCompressedFile|(1 << 4) +}; + +/** +@brief Features supported by an image converter +@m_since_latest + +@see @ref AbstractImageConverter::features() +*/ +typedef Containers::EnumSet ImageConverterFeatures; + +CORRADE_ENUMSET_OPERATORS(ImageConverterFeatures) + +/** @debugoperatorenum{ImageConverterFeature} */ +MAGNUM_TRADE_EXPORT Debug& operator<<(Debug& debug, ImageConverterFeature value); + +/** @debugoperatorenum{ImageConverterFeatures} */ +MAGNUM_TRADE_EXPORT Debug& operator<<(Debug& debug, ImageConverterFeatures value); + /** @brief Base for image converter plugins @@ -65,14 +127,13 @@ You don't need to do most of the redundant sanity checks, these things are checked by the implementation: - The function @ref doExportToImage() is called only if - @ref Feature::ConvertImage - is supported. + @ref ImageConverterFeature::ConvertImage is supported. - The function @ref doExportToCompressedImage() is called only if - @ref Feature::ConvertCompressedImage is supported. + @ref ImageConverterFeature::ConvertCompressedImage is supported. - The function @ref doExportToData(const ImageView2D&) is called only if - @ref Feature::ConvertData is supported. + @ref ImageConverterFeature::ConvertData is supported. - The function @ref doExportToData(const CompressedImageView2D&) is called - only if @ref Feature::ConvertCompressedData is supported. + only if @ref ImageConverterFeature::ConvertCompressedData is supported. @m_class{m-block m-warning} @@ -86,44 +147,17 @@ checked by the implementation: */ class MAGNUM_TRADE_EXPORT AbstractImageConverter: public PluginManager::AbstractManagingPlugin { public: - /** - * @brief Features supported by this converter - * - * @see @ref Features, @ref features() + #ifdef MAGNUM_BUILD_DEPRECATED + /** @brief @copybrief ImageConverterFeature + * @m_deprecated_since_latest Use @ref ImageConverterFeature instead. */ - enum class Feature: UnsignedByte { - /** Conversion to image with different format with @ref exportToImage() */ - ConvertImage = 1 << 0, - - /** Conversion to compressed image with @ref exportToCompressedImage() */ - ConvertCompressedImage = 1 << 1, - - /** Exporting to file with @ref exportToFile(const ImageView2D&, const std::string&) */ - ConvertFile = 1 << 2, - - /** Exporting to file with @ref exportToFile(const CompressedImageView2D&, const std::string&) */ - ConvertCompressedFile = 1 << 3, - - /** - * Exporting to raw data with @ref exportToData(const ImageView2D&). - * Implies @ref Feature::ConvertFile. - */ - ConvertData = ConvertFile|(1 << 4), - - /** - * Exporting compressed image to raw data with - * @ref exportToData(const CompressedImageView2D&). Implies - * @ref Feature::ConvertCompressedFile. - */ - ConvertCompressedData = ConvertCompressedFile|(1 << 4) - }; + typedef CORRADE_DEPRECATED("use ImageConverterFeature instead") ImageConverterFeature Feature; - /** - * @brief Features supported by this converter - * - * @see @ref features() + /** @brief @copybrief ImageConverterFeatures + * @m_deprecated_since_latest Use @ref ImageConverterFeatures instead. */ - typedef Containers::EnumSet Features; + typedef CORRADE_DEPRECATED("use ImageConverterFeatures instead") ImageConverterFeatures Features; + #endif /** * @brief Plugin interface @@ -163,13 +197,14 @@ class MAGNUM_TRADE_EXPORT AbstractImageConverter: public PluginManager::Abstract explicit AbstractImageConverter(PluginManager::AbstractManager& manager, const std::string& plugin); /** @brief Features supported by this converter */ - Features features() const { return doFeatures(); } + ImageConverterFeatures features() const { return doFeatures(); } /** * @brief Convert image to different format * - * Available only if @ref Feature::ConvertImage is supported. Returns - * converted image on success, @ref Containers::NullOpt otherwise. + * Available only if @ref ImageConverterFeature::ConvertImage is + * supported. Returns converted image on success, + * @ref Containers::NullOpt otherwise. * @see @ref features(), @ref exportToData(), @ref exportToFile() */ Containers::Optional exportToImage(const ImageView2D& image); @@ -177,8 +212,9 @@ class MAGNUM_TRADE_EXPORT AbstractImageConverter: public PluginManager::Abstract /** * @brief Convert image to compressed format * - * Available only if @ref Feature::ConvertCompressedImage is supported. - * Returns converted image on success, @ref Containers::NullOpt otherwise. + * Available only if @ref ImageConverterFeature::ConvertCompressedImage + * is supported. Returns converted image on success, + * @ref Containers::NullOpt otherwise. * @see @ref features(), @ref exportToData(), @ref exportToFile() */ Containers::Optional exportToCompressedImage(const ImageView2D& image); @@ -186,8 +222,8 @@ class MAGNUM_TRADE_EXPORT AbstractImageConverter: public PluginManager::Abstract /** * @brief Export image to raw data * - * Available only if @ref Feature::ConvertData is supported. Returns - * data on success, zero-sized array otherwise. + * Available only if @ref ImageConverterFeature::ConvertData is + * supported. Returns data on success, zero-sized array otherwise. * @see @ref features(), @ref exportToImage(), * @ref exportToFile(const ImageView2D&, const std::string&) */ @@ -196,8 +232,8 @@ class MAGNUM_TRADE_EXPORT AbstractImageConverter: public PluginManager::Abstract /** * @brief Export compressed image to raw data * - * Available only if @ref Feature::ConvertCompressedData is supported. - * Returns data on success, zero-sized array otherwise. + * Available only if @ref ImageConverterFeature::ConvertCompressedData + * is supported. Returns data on success, zero-sized array otherwise. * @see @ref features(), @ref exportToCompressedImage(), * @ref exportToFile(const CompressedImageView2D&, const std::string&) */ @@ -216,9 +252,9 @@ class MAGNUM_TRADE_EXPORT AbstractImageConverter: public PluginManager::Abstract /** * @brief Export image to file * - * Available only if @ref Feature::ConvertFile or - * @ref Feature::ConvertData is supported. Returns `true` on success, - * `false` otherwise. + * Available only if @ref ImageConverterFeature::ConvertFile or + * @ref ImageConverterFeature::ConvertData is supported. Returns + * @cpp true @ce on success, @cpp false @ce otherwise. * @see @ref features(), @ref exportToImage(), * @ref exportToData(const ImageView2D&) */ @@ -227,9 +263,9 @@ class MAGNUM_TRADE_EXPORT AbstractImageConverter: public PluginManager::Abstract /** * @brief Export compressed image to file * - * Available only if @ref Feature::ConvertCompressedFile or - * @ref Feature::ConvertCompressedData is supported. Returns `true` on - * success, `false` otherwise. + * Available only if @ref ImageConverterFeature::ConvertCompressedFile + * or @ref ImageConverterFeature::ConvertCompressedData is supported. + * Returns @cpp true @ce on success, @cpp false @ce otherwise. * @see @ref features(), @ref exportToCompressedImage(), * @ref exportToData(const CompressedImageView2D&) */ @@ -247,7 +283,7 @@ class MAGNUM_TRADE_EXPORT AbstractImageConverter: public PluginManager::Abstract private: /** @brief Implementation of @ref features() */ - virtual Features doFeatures() const = 0; + virtual ImageConverterFeatures doFeatures() const = 0; /** @brief Implementation of @ref exportToImage() */ virtual Containers::Optional doExportToImage(const ImageView2D& image); @@ -264,30 +300,22 @@ class MAGNUM_TRADE_EXPORT AbstractImageConverter: public PluginManager::Abstract /** * @brief Implementation of @ref exportToFile(const ImageView2D&, const std::string&) * - * If @ref Feature::ConvertData is supported, default implementation - * calls @ref doExportToData(const ImageView2D&) and saves the result - * to given file. + * If @ref ImageConverterFeature::ConvertData is supported, default + * implementation calls @ref doExportToData(const ImageView2D&) and + * saves the result to given file. */ virtual bool doExportToFile(const ImageView2D& image, const std::string& filename); /** * @brief Implementation of @ref exportToFile(const CompressedImageView2D&, const std::string&) * - * If @ref Feature::ConvertCompressedData is supported, default - * implementation calls @ref doExportToData(const CompressedImageView2D&) + * If @ref ImageConverterFeature::ConvertCompressedData is supported, + * default implementation calls @ref doExportToData(const CompressedImageView2D&) * and saves the result to given file. */ virtual bool doExportToFile(const CompressedImageView2D& image, const std::string& filename); }; -CORRADE_ENUMSET_OPERATORS(AbstractImageConverter::Features) - -/** @debugoperatorclassenum{AbstractImageConverter,AbstractImageConverter::Feature} */ -MAGNUM_TRADE_EXPORT Debug& operator<<(Debug& debug, AbstractImageConverter::Feature value); - -/** @debugoperatorclassenum{AbstractImageConverter,AbstractImageConverter::Features} */ -MAGNUM_TRADE_EXPORT Debug& operator<<(Debug& debug, AbstractImageConverter::Features value); - }} #endif diff --git a/src/Magnum/Trade/AbstractImporter.cpp b/src/Magnum/Trade/AbstractImporter.cpp index f14dbb85a..9853dd0cb 100644 --- a/src/Magnum/Trade/AbstractImporter.cpp +++ b/src/Magnum/Trade/AbstractImporter.cpp @@ -96,7 +96,7 @@ AbstractImporter::AbstractImporter(PluginManager::AbstractManager& manager, cons void AbstractImporter::setFileCallback(Containers::Optional>(*callback)(const std::string&, InputFileCallbackPolicy, void*), void* const userData) { CORRADE_ASSERT(!isOpened(), "Trade::AbstractImporter::setFileCallback(): can't be set while a file is opened", ); - CORRADE_ASSERT(features() & (Feature::FileCallback|Feature::OpenData), "Trade::AbstractImporter::setFileCallback(): importer supports neither loading from data nor via callbacks, callbacks can't be used", ); + CORRADE_ASSERT(features() & (ImporterFeature::FileCallback|ImporterFeature::OpenData), "Trade::AbstractImporter::setFileCallback(): importer supports neither loading from data nor via callbacks, callbacks can't be used", ); _fileCallback = callback; _fileCallbackUserData = userData; @@ -106,7 +106,7 @@ void AbstractImporter::setFileCallback(Containers::Optional>(*)(const std::string&, InputFileCallbackPolicy, void*), void*) {} bool AbstractImporter::openData(Containers::ArrayView data) { - CORRADE_ASSERT(features() & Feature::OpenData, + CORRADE_ASSERT(features() & ImporterFeature::OpenData, "Trade::AbstractImporter::openData(): feature not supported", {}); /* We accept empty data here (instead of checking for them and failing so @@ -122,7 +122,7 @@ void AbstractImporter::doOpenData(Containers::ArrayView) { } bool AbstractImporter::openState(const void* state, const std::string& filePath) { - CORRADE_ASSERT(features() & Feature::OpenState, + CORRADE_ASSERT(features() & ImporterFeature::OpenState, "Trade::AbstractImporter::openState(): feature not supported", {}); close(); @@ -139,13 +139,13 @@ bool AbstractImporter::openFile(const std::string& filename) { /* If file loading callbacks are not set or the importer supports handling them directly, call into the implementation */ - if(!_fileCallback || (doFeatures() & Feature::FileCallback)) { + if(!_fileCallback || (doFeatures() & ImporterFeature::FileCallback)) { doOpenFile(filename); /* Otherwise, if loading from data is supported, use the callback and pass the data through to openData(). Mark the file as ready to be closed once opening is finished. */ - } else if(doFeatures() & Feature::OpenData) { + } else if(doFeatures() & ImporterFeature::OpenData) { /* This needs to be duplicated here and in the doOpenFile() implementation in order to support both following cases: - plugins that don't support FileCallback but have their own @@ -171,7 +171,7 @@ bool AbstractImporter::openFile(const std::string& filename) { } void AbstractImporter::doOpenFile(const std::string& filename) { - CORRADE_ASSERT(features() & Feature::OpenData, "Trade::AbstractImporter::openFile(): not implemented", ); + CORRADE_ASSERT(features() & ImporterFeature::OpenData, "Trade::AbstractImporter::openFile(): not implemented", ); /* If callbacks are set, use them. This is the same implementation as in openFile(), see the comment there for details. */ @@ -640,12 +640,12 @@ const void* AbstractImporter::importerState() const { const void* AbstractImporter::doImporterState() const { return nullptr; } -Debug& operator<<(Debug& debug, const AbstractImporter::Feature value) { - debug << "Trade::AbstractImporter::Feature" << Debug::nospace; +Debug& operator<<(Debug& debug, const ImporterFeature value) { + debug << "Trade::ImporterFeature" << Debug::nospace; switch(value) { /* LCOV_EXCL_START */ - #define _c(v) case AbstractImporter::Feature::v: return debug << "::" #v; + #define _c(v) case ImporterFeature::v: return debug << "::" #v; _c(OpenData) _c(OpenState) _c(FileCallback) @@ -656,11 +656,11 @@ Debug& operator<<(Debug& debug, const AbstractImporter::Feature value) { return debug << "(" << Debug::nospace << reinterpret_cast(UnsignedByte(value)) << Debug::nospace << ")"; } -Debug& operator<<(Debug& debug, const AbstractImporter::Features value) { - return Containers::enumSetDebugOutput(debug, value, "Trade::AbstractImporter::Features{}", { - AbstractImporter::Feature::OpenData, - AbstractImporter::Feature::OpenState, - AbstractImporter::Feature::FileCallback}); +Debug& operator<<(Debug& debug, const ImporterFeatures value) { + return Containers::enumSetDebugOutput(debug, value, "Trade::ImporterFeatures{}", { + ImporterFeature::OpenData, + ImporterFeature::OpenState, + ImporterFeature::FileCallback}); } }} diff --git a/src/Magnum/Trade/AbstractImporter.h b/src/Magnum/Trade/AbstractImporter.h index 965aff35b..b8fafdae0 100644 --- a/src/Magnum/Trade/AbstractImporter.h +++ b/src/Magnum/Trade/AbstractImporter.h @@ -44,6 +44,47 @@ namespace Magnum { namespace Trade { +/** +@brief Features supported by an importer +@m_since_latest + +@see @ref ImporterFeatures, @ref AbstractImporter::features() +*/ +enum class ImporterFeature: UnsignedByte { + /** Opening files from raw data using @ref AbstractImporter::openData() */ + OpenData = 1 << 0, + + /** Opening already loaded state using @ref AbstractImporter::openState() */ + OpenState = 1 << 1, + + /** + * Specifying callbacks for loading additional files referenced + * from the main file using @ref AbstractImporter::setFileCallback(). If + * the importer * doesn't expose this feature, the format is either + * single-file or loading via callbacks is not supported. + * + * See @ref Trade-AbstractImporter-usage-callbacks and particular importer + * documentation for more information. + */ + FileCallback = 1 << 2 +}; + +/** +@brief Set of features supported by an importer +@m_since_latest + +@see @ref AbstractImporter::features() +*/ +typedef Containers::EnumSet ImporterFeatures; + +CORRADE_ENUMSET_OPERATORS(ImporterFeatures) + +/** @debugoperatorenum{ImporterFeatures} */ +MAGNUM_TRADE_EXPORT Debug& operator<<(Debug& debug, ImporterFeature value); + +/** @debugoperatorenum{ImporterFeatures} */ +MAGNUM_TRADE_EXPORT Debug& operator<<(Debug& debug, ImporterFeatures value); + #ifdef MAGNUM_BUILD_DEPRECATED /** @brief @copybrief InputFileCallbackPolicy * @m_deprecated_since{2019,10} Use @ref InputFileCallbackPolicy instead. @@ -73,14 +114,15 @@ See @ref plugins for more information about general plugin usage and Besides loading data directly from the filesystem using @ref openFile() like shown above, it's possible to use @ref openData() to import data from memory. Note that the particular importer implementation must support -@ref Feature::OpenData for this method to work. +@ref ImporterFeature::OpenData for this method to work. Complex scene files often reference other files such as images and in that case you may want to intercept those references and load them in a custom way as -well. For importers that advertise support for this with @ref Feature::FileCallback -this is done by specifying a file loading callback using @ref setFileCallback(). -The callback gets a filename, @ref InputFileCallbackPolicy and an user -pointer as parameters; returns a non-owning view on the loaded data or a +well. For importers that advertise support for this with +@ref ImporterFeature::FileCallback this is done by specifying a file loading +callback using @ref setFileCallback(). The callback gets a filename, +@ref InputFileCallbackPolicy and an user pointer as parameters; returns a +non-owning view on the loaded data or a @ref Corrade::Containers::NullOpt "Containers::NullOpt" to indicate the file loading failed. For example, loading a scene from memory-mapped files could look like below. Note that the file loading callback affects @ref openFile() as @@ -90,12 +132,12 @@ correctly. @snippet MagnumTrade.cpp AbstractImporter-usage-callbacks -For importers that don't support @ref Feature::FileCallback directly, the base -@ref openFile() implementation will use the file callback to pass the loaded -data through to @ref openData(), in case the importer supports at least -@ref Feature::OpenData. If the importer supports neither @ref Feature::FileCallback -nor @ref Feature::OpenData, @ref setFileCallback() doesn't allow the callbacks -to be set. +For importers that don't support @ref ImporterFeature::FileCallback directly, +the base @ref openFile() implementation will use the file callback to pass the +loaded data through to @ref openData(), in case the importer supports at least +@ref ImporterFeature::OpenData. If the importer supports neither +@ref ImporterFeature::FileCallback nor @ref ImporterFeature::OpenData, +@ref setFileCallback() doesn't allow the callbacks to be set. The input file callback signature is the same for @ref Trade::AbstractImporter and @ref Text::AbstractFont to allow code reuse. @@ -127,9 +169,9 @@ expose internal state through various accessors: imported by @ref texture() Besides exposing internal state, importers that support the -@ref Feature::OpenState feature can also attach to existing importer state -using @ref openState(). See documentation of a particular importer for details -about concrete types returned and accepted by these functions. +@ref ImporterFeature::OpenState feature can also attach to existing importer +state using @ref openState(). See documentation of a particular importer for +details about concrete types returned and accepted by these functions. @subsection Trade-AbstractImporter-usage-casting Polymorphic imported data types @@ -170,11 +212,11 @@ functions, at least one of @ref doOpenData() / @ref doOpenFile() / @ref doOpenState() functions, function @ref doClose() and one or more tuples of data access functions, based on what features are supported in given format. -In order to support @ref Feature::FileCallback, the importer needs to properly -use the callbacks to both load the top-level file in @ref doOpenFile() and also -load any external files when needed. The @ref doOpenFile() can delegate back -into the base implementation, but it should remember at least the base file -path to pass correct paths to subsequent file callbacks. The +In order to support @ref ImporterFeature::FileCallback, the importer needs to +properly use the callbacks to both load the top-level file in @ref doOpenFile() +and also load any external files when needed. The @ref doOpenFile() can +delegate back into the base implementation, but it should remember at least the +base file path to pass correct paths to subsequent file callbacks. The @ref doSetFileCallback() can be overriden in case it's desired to respond to file loading callback setup, but doesn't have to be. @@ -190,12 +232,13 @@ checked by the implementation: - The @ref doOpenData(), @ref doOpenFile() and @ref doOpenState() functions are called after the previous file was closed, function @ref doClose() is called only if there is any file opened. -- The @ref doOpenData() function is called only if @ref Feature::OpenData is - supported. -- The @ref doOpenState() function is called only if @ref Feature::OpenState - is supported. +- The @ref doOpenData() function is called only if + @ref ImporterFeature::OpenData is supported. +- The @ref doOpenState() function is called only if + @ref ImporterFeature::OpenState is supported. - The @ref doSetFileCallback() function is called only if - @ref Feature::FileCallback is supported and there is no file opened. + @ref ImporterFeature::FileCallback is supported and there is no file + opened. - All `do*()` implementations working on an opened file are called only if there is any file opened. - All `do*()` implementations taking data ID as parameter are called only if @@ -223,36 +266,17 @@ checked by the implementation: */ class MAGNUM_TRADE_EXPORT AbstractImporter: public PluginManager::AbstractManagingPlugin { public: - /** - * @brief Features supported by this importer - * - * @see @ref Features, @ref features() + #ifdef MAGNUM_BUILD_DEPRECATED + /** @brief @copybrief ImporterFeature + * @m_deprecated_since_latest Use @ref ImporterFeature instead. */ - enum class Feature: UnsignedByte { - /** Opening files from raw data using @ref openData() */ - OpenData = 1 << 0, - - /** Opening already loaded state using @ref openState() */ - OpenState = 1 << 1, + typedef CORRADE_DEPRECATED("use ImporterFeature instead") ImporterFeature Feature; - /** - * Specifying callbacks for loading additional files referenced - * from the main file using @ref setFileCallback(). If the importer - * doesn't expose this feature, the format is either single-file or - * loading via callbacks is not supported. - * - * See @ref Trade-AbstractImporter-usage-callbacks and particular - * importer documentation for more information. - */ - FileCallback = 1 << 2 - }; - - /** - * @brief Set of features supported by this importer - * - * @see @ref features() + /** @brief @copybrief ImporterFeatures + * @m_deprecated_since_latest Use @ref ImporterFeatures instead. */ - typedef Containers::EnumSet Features; + typedef CORRADE_DEPRECATED("use ImporterFeature instead") ImporterFeatures Features; + #endif /** * @brief Plugin interface @@ -292,7 +316,7 @@ class MAGNUM_TRADE_EXPORT AbstractImporter: public PluginManager::AbstractManagi explicit AbstractImporter(PluginManager::AbstractManager& manager, const std::string& plugin); /** @brief Features supported by this importer */ - Features features() const { return doFeatures(); } + ImporterFeatures features() const { return doFeatures(); } /** * @brief File opening callback function @@ -311,22 +335,22 @@ class MAGNUM_TRADE_EXPORT AbstractImporter: public PluginManager::AbstractManagi /** * @brief Set file opening callback * - * In case the importer supports @ref Feature::FileCallback, files - * opened through @ref openFile() will be loaded through the provided - * callback. Besides that, all external files referenced by the - * top-level file will be loaded through the callback function as well, - * usually on demand. The callback function gets a filename, + * In case the importer supports @ref ImporterFeature::FileCallback, + * files opened through @ref openFile() will be loaded through the + * provided callback. Besides that, all external files referenced by + * the top-level file will be loaded through the callback function as + * well, usually on demand. The callback function gets a filename, * @ref InputFileCallbackPolicy and the @p userData pointer as input * and returns a non-owning view on the loaded data as output or a * @ref Corrade::Containers::NullOpt if loading failed --- because * empty files might also be valid in some circumstances, @cpp nullptr @ce * can't be used to indicate a failure. * - * In case the importer doesn't support @ref Feature::FileCallback but - * supports at least @ref Feature::OpenData, a file opened through - * @ref openFile() will be internally loaded through the provided - * callback and then passed to @ref openData(). First the file is - * loaded with @ref InputFileCallbackPolicy::LoadTemporary passed to + * In case the importer doesn't support @ref ImporterFeature::FileCallback + * but supports at least @ref ImporterFeature::OpenData, a file opened + * through @ref openFile() will be internally loaded through the + * provided callback and then passed to @ref openData(). First the file + * is loaded with @ref InputFileCallbackPolicy::LoadTemporary passed to * the callback, then the returned memory view is passed to * @ref openData() (sidestepping the potential @ref openFile() * implementation of that particular importer) and after that the @@ -337,8 +361,9 @@ class MAGNUM_TRADE_EXPORT AbstractImporter: public PluginManager::AbstractManagi * * In case @p callback is @cpp nullptr @ce, the current callback (if * any) is reset. This function expects that the importer supports - * either @ref Feature::FileCallback or @ref Feature::OpenData. If an - * importer supports neither, callbacks can't be used. + * either @ref ImporterFeature::FileCallback or + * @ref ImporterFeature::OpenData. If an importer supports neither, + * callbacks can't be used. * * It's expected that this function is called *before* a file is * opened. It's also expected that the loaded data are kept in scope @@ -385,9 +410,9 @@ class MAGNUM_TRADE_EXPORT AbstractImporter: public PluginManager::AbstractManagi * @brief Open raw data * * Closes previous file, if it was opened, and tries to open given raw - * data. Available only if @ref Feature::OpenData is supported. Returns - * @cpp true @ce on success, @cpp false @ce otherwise. The @p data is - * not expected to be alive after the function exits. + * data. Available only if @ref ImporterFeature::OpenData is supported. + * Returns @cpp true @ce on success, @cpp false @ce otherwise. The + * @p data is not expected to be alive after the function exits. * @see @ref features(), @ref openFile() */ bool openData(Containers::ArrayView data); @@ -399,8 +424,9 @@ class MAGNUM_TRADE_EXPORT AbstractImporter: public PluginManager::AbstractManagi * textures and materials. * * Closes previous file, if it was opened, and tries to open given - * state. Available only if @ref Feature::OpenState is supported. Returns - * @cpp true @ce on success, @cpp false @ce otherwise. + * state. Available only if @ref ImporterFeature::OpenState is + * supported. Returns @cpp true @ce on success, @cpp false @ce + * otherwise. * * See documentation of a particular plugin for more information about * type and contents of the @p state parameter. @@ -414,9 +440,10 @@ class MAGNUM_TRADE_EXPORT AbstractImporter: public PluginManager::AbstractManagi * Closes previous file, if it was opened, and tries to open given * file. Returns @cpp true @ce on success, @cpp false @ce otherwise. * If file loading callbacks are set via @ref setFileCallback() and - * @ref Feature::OpenData is supported, this function uses the callback - * to load the file and passes the memory view to @ref openData() - * instead. See @ref setFileCallback() for more information. + * @ref ImporterFeature::OpenData is supported, this function uses the + * callback to load the file and passes the memory view to + * @ref openData() instead. See @ref setFileCallback() for more + * information. * @see @ref features(), @ref openData() */ bool openFile(const std::string& filename); @@ -906,14 +933,15 @@ class MAGNUM_TRADE_EXPORT AbstractImporter: public PluginManager::AbstractManagi /** * @brief Implementation for @ref openFile() * - * If @ref Feature::OpenData is supported, default implementation opens - * the file and calls @ref doOpenData() with its contents. It is - * allowed to call this function from your @ref doOpenFile() - * implementation --- in particular, this implementation will also - * correctly handle callbacks set through @ref setFileCallback(). + * If @ref ImporterFeature::OpenData is supported, default + * implementation opens the file and calls @ref doOpenData() with its + * contents. It is allowed to call this function from your + * @ref doOpenFile() implementation --- in particular, this + * implementation will also correctly handle callbacks set through + * @ref setFileCallback(). * * This function is not called when file callbacks are set through - * @ref setFileCallback() and @ref Feature::FileCallback is not + * @ref setFileCallback() and @ref ImporterFeature::FileCallback is not * supported --- instead, file is loaded though the callback and data * passed through to @ref doOpenData(). */ @@ -921,7 +949,7 @@ class MAGNUM_TRADE_EXPORT AbstractImporter: public PluginManager::AbstractManagi private: /** @brief Implementation for @ref features() */ - virtual Features doFeatures() const = 0; + virtual ImporterFeatures doFeatures() const = 0; /** * @brief Implementation for @ref setFileCallback() @@ -1294,14 +1322,6 @@ template void AbstractImporter::setFileCallback(Callbac } #endif -CORRADE_ENUMSET_OPERATORS(AbstractImporter::Features) - -/** @debugoperatorclassenum{AbstractImporter,AbstractImporter::Feature} */ -MAGNUM_TRADE_EXPORT Debug& operator<<(Debug& debug, AbstractImporter::Feature value); - -/** @debugoperatorclassenum{AbstractImporter,AbstractImporter::Features} */ -MAGNUM_TRADE_EXPORT Debug& operator<<(Debug& debug, AbstractImporter::Features value); - }} #endif diff --git a/src/Magnum/Trade/Test/AbstractImageConverterTest.cpp b/src/Magnum/Trade/Test/AbstractImageConverterTest.cpp index 5b68e1e8f..fbccc6127 100644 --- a/src/Magnum/Trade/Test/AbstractImageConverterTest.cpp +++ b/src/Magnum/Trade/Test/AbstractImageConverterTest.cpp @@ -138,11 +138,11 @@ AbstractImageConverterTest::AbstractImageConverterTest() { void AbstractImageConverterTest::construct() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return {}; } + ImageConverterFeatures doFeatures() const override { return {}; } }; Converter converter; - CORRADE_COMPARE(converter.features(), AbstractImageConverter::Features{}); + CORRADE_COMPARE(converter.features(), ImageConverterFeatures{}); } void AbstractImageConverterTest::constructWithPluginManagerReference() { @@ -151,17 +151,17 @@ void AbstractImageConverterTest::constructWithPluginManagerReference() { explicit Converter(PluginManager::Manager& manager): AbstractImageConverter{manager} {} private: - Features doFeatures() const override { return {}; } + ImageConverterFeatures doFeatures() const override { return {}; } }; PluginManager::Manager manager; Converter converter{manager}; - CORRADE_COMPARE(converter.features(), AbstractImageConverter::Features{}); + CORRADE_COMPARE(converter.features(), ImageConverterFeatures{}); } void AbstractImageConverterTest::exportToImage() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return Feature::ConvertImage; } + ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertImage; } Containers::Optional doExportToImage(const ImageView2D& image) override { return Image2D{PixelFormat::RGBA8Unorm, image.size(), Containers::Array{96}}; } @@ -176,7 +176,7 @@ void AbstractImageConverterTest::exportToImage() { void AbstractImageConverterTest::exportToImageNotSupported() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return {}; } + ImageConverterFeatures doFeatures() const override { return {}; } }; std::ostringstream out; @@ -189,7 +189,7 @@ void AbstractImageConverterTest::exportToImageNotSupported() { void AbstractImageConverterTest::exportToImageNotImplemented() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return Feature::ConvertImage; } + ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertImage; } }; std::ostringstream out; @@ -202,7 +202,7 @@ void AbstractImageConverterTest::exportToImageNotImplemented() { void AbstractImageConverterTest::exportToImageCustomDeleter() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return Feature::ConvertImage; } + ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertImage; } Containers::Optional doExportToImage(const ImageView2D&) override { return Image2D{PixelFormat::RGBA8Unorm, {}, Containers::Array{nullptr, 0, [](char*, std::size_t) {}}}; } @@ -218,7 +218,7 @@ void AbstractImageConverterTest::exportToImageCustomDeleter() { void AbstractImageConverterTest::exportToCompressedImage() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return Feature::ConvertCompressedImage; } + ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertCompressedImage; } Containers::Optional doExportToCompressedImage(const ImageView2D& image) override { return CompressedImage2D{CompressedPixelFormat::Bc1RGBAUnorm, image.size(), Containers::Array{64}}; } @@ -233,7 +233,7 @@ void AbstractImageConverterTest::exportToCompressedImage() { void AbstractImageConverterTest::exportToCompressedImageNotSupported() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return {}; } + ImageConverterFeatures doFeatures() const override { return {}; } }; std::ostringstream out; @@ -246,7 +246,7 @@ void AbstractImageConverterTest::exportToCompressedImageNotSupported() { void AbstractImageConverterTest::exportToCompressedImageNotImplemented() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return Feature::ConvertCompressedImage; } + ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertCompressedImage; } }; std::ostringstream out; @@ -259,7 +259,7 @@ void AbstractImageConverterTest::exportToCompressedImageNotImplemented() { void AbstractImageConverterTest::exportToCompressedImageCustomDeleter() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return Feature::ConvertCompressedImage; } + ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertCompressedImage; } Containers::Optional doExportToCompressedImage(const ImageView2D&) override { return CompressedImage2D{CompressedPixelFormat::Bc1RGBAUnorm, {}, Containers::Array{nullptr, 0, [](char*, std::size_t) {}}}; } @@ -275,7 +275,7 @@ void AbstractImageConverterTest::exportToCompressedImageCustomDeleter() { void AbstractImageConverterTest::exportToData() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return Feature::ConvertData; } + ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertData; } Containers::Array doExportToData(const ImageView2D& image) override { return Containers::Array{nullptr, std::size_t(image.size().product())}; } @@ -288,7 +288,7 @@ void AbstractImageConverterTest::exportToData() { void AbstractImageConverterTest::exportToDataNotSupported() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return {}; } + ImageConverterFeatures doFeatures() const override { return {}; } }; std::ostringstream out; @@ -301,7 +301,7 @@ void AbstractImageConverterTest::exportToDataNotSupported() { void AbstractImageConverterTest::exportToDataNotImplemented() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return Feature::ConvertData; } + ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertData; } }; std::ostringstream out; @@ -314,7 +314,7 @@ void AbstractImageConverterTest::exportToDataNotImplemented() { void AbstractImageConverterTest::exportToDataCustomDeleter() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return Feature::ConvertData; } + ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertData; } Containers::Array doExportToData(const ImageView2D&) override { return Containers::Array{nullptr, 0, [](char*, std::size_t) {}}; } @@ -330,7 +330,7 @@ void AbstractImageConverterTest::exportToDataCustomDeleter() { void AbstractImageConverterTest::exportCompressedToData() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return Feature::ConvertCompressedData; } + ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertCompressedData; } Containers::Array doExportToData(const CompressedImageView2D& image) override { return Containers::Array{nullptr, std::size_t(image.size().product())}; } @@ -343,7 +343,7 @@ void AbstractImageConverterTest::exportCompressedToData() { void AbstractImageConverterTest::exportCompressedToDataNotSupported() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return {}; } + ImageConverterFeatures doFeatures() const override { return {}; } }; std::ostringstream out; @@ -356,7 +356,7 @@ void AbstractImageConverterTest::exportCompressedToDataNotSupported() { void AbstractImageConverterTest::exportCompressedToDataNotImplemented() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return Feature::ConvertData; } + ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertData; } }; std::ostringstream out; @@ -369,7 +369,7 @@ void AbstractImageConverterTest::exportCompressedToDataNotImplemented() { void AbstractImageConverterTest::exportCompressedToDataCustomDeleter() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return Feature::ConvertCompressedData; } + ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertCompressedData; } Containers::Array doExportToData(const CompressedImageView2D&) override { return Containers::Array{nullptr, 0, [](char*, std::size_t) {}}; } @@ -385,7 +385,7 @@ void AbstractImageConverterTest::exportCompressedToDataCustomDeleter() { class ImageDataExporter: public Trade::AbstractImageConverter { private: - Features doFeatures() const override { return Feature::ConvertData|Feature::ConvertCompressedData; } + ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertData|ImageConverterFeature::ConvertCompressedData; } Containers::Array doExportToData(const ImageView2D&) override { /* DirectInit / InPlaceInit is unfortunately causing a custom @@ -426,7 +426,7 @@ void AbstractImageConverterTest::exportImageDataToData() { void AbstractImageConverterTest::exportToFile() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return Feature::ConvertData; } + ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertData; } bool doExportToFile(const ImageView2D& image, const std::string& filename) override { return Utility::Directory::write(filename, Containers::Array{Containers::InPlaceInit, {char(image.size().x()), char(image.size().y())}}); @@ -444,7 +444,7 @@ void AbstractImageConverterTest::exportToFile() { void AbstractImageConverterTest::exportToFileThroughData() { class DataExporter: public AbstractImageConverter { - Features doFeatures() const override { return Feature::ConvertData; } + ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertData; } Containers::Array doExportToData(const ImageView2D& image) override { return Containers::Array{Containers::InPlaceInit, @@ -465,7 +465,7 @@ void AbstractImageConverterTest::exportToFileThroughData() { void AbstractImageConverterTest::exportToFileThroughDataNotWritable() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return Feature::ConvertData; } + ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertData; } Containers::Array doExportToData(const ImageView2D& image) override { return Containers::Array{Containers::InPlaceInit, @@ -485,7 +485,7 @@ void AbstractImageConverterTest::exportToFileThroughDataNotWritable() { void AbstractImageConverterTest::exportToFileNotSupported() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return {}; } + ImageConverterFeatures doFeatures() const override { return {}; } }; std::ostringstream out; @@ -498,7 +498,7 @@ void AbstractImageConverterTest::exportToFileNotSupported() { void AbstractImageConverterTest::exportToFileNotImplemented() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return Feature::ConvertFile; } + ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertFile; } }; std::ostringstream out; @@ -511,7 +511,7 @@ void AbstractImageConverterTest::exportToFileNotImplemented() { void AbstractImageConverterTest::exportCompressedToFile() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return Feature::ConvertCompressedFile; } + ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertCompressedFile; } bool doExportToFile(const CompressedImageView2D& image, const std::string& filename) override { return Utility::Directory::write(filename, Containers::Array{Containers::InPlaceInit, {char(image.size().x()), char(image.size().y())}}); @@ -526,7 +526,7 @@ void AbstractImageConverterTest::exportCompressedToFile() { void AbstractImageConverterTest::exportCompressedToFileThroughData() { class DataExporter: public AbstractImageConverter { - Features doFeatures() const override { return Feature::ConvertCompressedData; } + ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertCompressedData; } Containers::Array doExportToData(const CompressedImageView2D& image) override { return Containers::Array{Containers::InPlaceInit, @@ -546,7 +546,7 @@ void AbstractImageConverterTest::exportCompressedToFileThroughData() { void AbstractImageConverterTest::exportCompressedToFileThroughDataNotWritable() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return Feature::ConvertCompressedData; } + ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertCompressedData; } Containers::Array doExportToData(const CompressedImageView2D& image) override { return Containers::Array{Containers::InPlaceInit, @@ -566,7 +566,7 @@ void AbstractImageConverterTest::exportCompressedToFileThroughDataNotWritable() void AbstractImageConverterTest::exportCompressedToFileNotSupported() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return {}; } + ImageConverterFeatures doFeatures() const override { return {}; } }; std::ostringstream out; @@ -579,7 +579,7 @@ void AbstractImageConverterTest::exportCompressedToFileNotSupported() { void AbstractImageConverterTest::exportCompressedToFileNotImplemented() { class Converter: public AbstractImageConverter { - Features doFeatures() const override { return Feature::ConvertCompressedFile; } + ImageConverterFeatures doFeatures() const override { return ImageConverterFeature::ConvertCompressedFile; } }; std::ostringstream out; @@ -611,15 +611,15 @@ void AbstractImageConverterTest::exportImageDataToFile() { void AbstractImageConverterTest::debugFeature() { std::ostringstream out; - Debug{&out} << AbstractImageConverter::Feature::ConvertCompressedImage << AbstractImageConverter::Feature(0xf0); - CORRADE_COMPARE(out.str(), "Trade::AbstractImageConverter::Feature::ConvertCompressedImage Trade::AbstractImageConverter::Feature(0xf0)\n"); + Debug{&out} << ImageConverterFeature::ConvertCompressedImage << ImageConverterFeature(0xf0); + CORRADE_COMPARE(out.str(), "Trade::ImageConverterFeature::ConvertCompressedImage Trade::ImageConverterFeature(0xf0)\n"); } void AbstractImageConverterTest::debugFeatures() { std::ostringstream out; - Debug{&out} << (AbstractImageConverter::Feature::ConvertData|AbstractImageConverter::Feature::ConvertCompressedFile) << AbstractImageConverter::Features{}; - CORRADE_COMPARE(out.str(), "Trade::AbstractImageConverter::Feature::ConvertData|Trade::AbstractImageConverter::Feature::ConvertCompressedFile Trade::AbstractImageConverter::Features{}\n"); + Debug{&out} << (ImageConverterFeature::ConvertData|ImageConverterFeature::ConvertCompressedFile) << ImageConverterFeatures{}; + CORRADE_COMPARE(out.str(), "Trade::ImageConverterFeature::ConvertData|Trade::ImageConverterFeature::ConvertCompressedFile Trade::ImageConverterFeatures{}\n"); } }}}} diff --git a/src/Magnum/Trade/Test/AbstractImporterTest.cpp b/src/Magnum/Trade/Test/AbstractImporterTest.cpp index d8b3d8203..079befcb8 100644 --- a/src/Magnum/Trade/Test/AbstractImporterTest.cpp +++ b/src/Magnum/Trade/Test/AbstractImporterTest.cpp @@ -453,12 +453,12 @@ AbstractImporterTest::AbstractImporterTest() { void AbstractImporterTest::construct() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; - CORRADE_COMPARE(importer.features(), AbstractImporter::Features{}); + CORRADE_COMPARE(importer.features(), ImporterFeatures{}); CORRADE_VERIFY(!importer.isOpened()); importer.close(); @@ -471,7 +471,7 @@ void AbstractImporterTest::constructWithPluginManagerReference() { struct Importer: AbstractImporter { explicit Importer(PluginManager::Manager& manager): AbstractImporter{manager} {} - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer{manager}; @@ -481,7 +481,7 @@ void AbstractImporterTest::constructWithPluginManagerReference() { void AbstractImporterTest::openData() { struct: AbstractImporter { - Features doFeatures() const override { return Feature::OpenData; } + ImporterFeatures doFeatures() const override { return ImporterFeature::OpenData; } bool doIsOpened() const override { return _opened; } void doClose() override { _opened = false; } @@ -503,7 +503,7 @@ void AbstractImporterTest::openData() { void AbstractImporterTest::openFileAsData() { struct: AbstractImporter { - Features doFeatures() const override { return Feature::OpenData; } + ImporterFeatures doFeatures() const override { return ImporterFeature::OpenData; } bool doIsOpened() const override { return _opened; } void doClose() override { _opened = false; } @@ -525,7 +525,7 @@ void AbstractImporterTest::openFileAsData() { void AbstractImporterTest::openFileAsDataNotFound() { struct Importer: AbstractImporter { - Features doFeatures() const override { return Feature::OpenData; } + ImporterFeatures doFeatures() const override { return ImporterFeature::OpenData; } bool doIsOpened() const override { return _opened; } void doClose() override { _opened = false; } @@ -546,7 +546,7 @@ void AbstractImporterTest::openFileAsDataNotFound() { void AbstractImporterTest::openFileNotImplemented() { struct Importer: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -560,7 +560,7 @@ void AbstractImporterTest::openFileNotImplemented() { void AbstractImporterTest::openDataNotSupported() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -574,7 +574,7 @@ void AbstractImporterTest::openDataNotSupported() { void AbstractImporterTest::openDataNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return Feature::OpenData; } + ImporterFeatures doFeatures() const override { return ImporterFeature::OpenData; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -588,7 +588,7 @@ void AbstractImporterTest::openDataNotImplemented() { void AbstractImporterTest::openStateNotSupported() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -602,7 +602,7 @@ void AbstractImporterTest::openStateNotSupported() { void AbstractImporterTest::openStateNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return Feature::OpenState; } + ImporterFeatures doFeatures() const override { return ImporterFeature::OpenState; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -616,7 +616,7 @@ void AbstractImporterTest::openStateNotImplemented() { void AbstractImporterTest::setFileCallback() { struct: AbstractImporter { - Features doFeatures() const override { return Feature::OpenData|Feature::FileCallback; } + ImporterFeatures doFeatures() const override { return ImporterFeature::OpenData|ImporterFeature::FileCallback; } bool doIsOpened() const override { return false; } void doClose() override {} void doSetFileCallback(Containers::Optional>(*)(const std::string&, InputFileCallbackPolicy, void*), void* userData) override { @@ -636,7 +636,7 @@ void AbstractImporterTest::setFileCallback() { void AbstractImporterTest::setFileCallbackTemplate() { struct: AbstractImporter { - Features doFeatures() const override { return Feature::OpenData|Feature::FileCallback; } + ImporterFeatures doFeatures() const override { return ImporterFeature::OpenData|ImporterFeature::FileCallback; } bool doIsOpened() const override { return false; } void doClose() override {} void doSetFileCallback(Containers::Optional>(*)(const std::string&, InputFileCallbackPolicy, void*), void*) override { @@ -662,7 +662,7 @@ void AbstractImporterTest::setFileCallbackTemplate() { void AbstractImporterTest::setFileCallbackTemplateNull() { struct: AbstractImporter { - Features doFeatures() const override { return Feature::OpenData|Feature::FileCallback; } + ImporterFeatures doFeatures() const override { return ImporterFeature::OpenData|ImporterFeature::FileCallback; } bool doIsOpened() const override { return false; } void doClose() override {} void doSetFileCallback(Containers::Optional>(*callback)(const std::string&, InputFileCallbackPolicy, void*), void* userData) override { @@ -681,7 +681,7 @@ void AbstractImporterTest::setFileCallbackTemplateNull() { void AbstractImporterTest::setFileCallbackTemplateConst() { struct: AbstractImporter { - Features doFeatures() const override { return Feature::OpenData|Feature::FileCallback; } + ImporterFeatures doFeatures() const override { return ImporterFeature::OpenData|ImporterFeature::FileCallback; } bool doIsOpened() const override { return false; } void doClose() override {} void doSetFileCallback(Containers::Optional>(*)(const std::string&, InputFileCallbackPolicy, void*), void*) override { @@ -704,7 +704,7 @@ void AbstractImporterTest::setFileCallbackTemplateConst() { void AbstractImporterTest::setFileCallbackFileOpened() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -720,7 +720,7 @@ void AbstractImporterTest::setFileCallbackFileOpened() { void AbstractImporterTest::setFileCallbackNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return Feature::FileCallback; } + ImporterFeatures doFeatures() const override { return ImporterFeature::FileCallback; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -737,7 +737,7 @@ void AbstractImporterTest::setFileCallbackNotImplemented() { void AbstractImporterTest::setFileCallbackNotSupported() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -754,7 +754,7 @@ void AbstractImporterTest::setFileCallbackNotSupported() { void AbstractImporterTest::setFileCallbackOpenFileDirectly() { struct: AbstractImporter { - Features doFeatures() const override { return Feature::FileCallback|Feature::OpenData; } + ImporterFeatures doFeatures() const override { return ImporterFeature::FileCallback|ImporterFeature::OpenData; } bool doIsOpened() const override { return _opened; } void doClose() override { _opened = false; } @@ -785,7 +785,7 @@ void AbstractImporterTest::setFileCallbackOpenFileDirectly() { void AbstractImporterTest::setFileCallbackOpenFileThroughBaseImplementation() { struct: AbstractImporter { - Features doFeatures() const override { return Feature::FileCallback|Feature::OpenData; } + ImporterFeatures doFeatures() const override { return ImporterFeature::FileCallback|ImporterFeature::OpenData; } bool doIsOpened() const override { return _opened; } void doClose() override { _opened = false; } @@ -833,7 +833,7 @@ void AbstractImporterTest::setFileCallbackOpenFileThroughBaseImplementation() { void AbstractImporterTest::setFileCallbackOpenFileThroughBaseImplementationFailed() { struct: AbstractImporter { - Features doFeatures() const override { return Feature::FileCallback|Feature::OpenData; } + ImporterFeatures doFeatures() const override { return ImporterFeature::FileCallback|ImporterFeature::OpenData; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -859,7 +859,7 @@ void AbstractImporterTest::setFileCallbackOpenFileThroughBaseImplementationFaile void AbstractImporterTest::setFileCallbackOpenFileAsData() { struct: AbstractImporter { - Features doFeatures() const override { return Feature::OpenData; } + ImporterFeatures doFeatures() const override { return ImporterFeature::OpenData; } bool doIsOpened() const override { return _opened; } void doClose() override { _opened = false; } @@ -906,7 +906,7 @@ void AbstractImporterTest::setFileCallbackOpenFileAsData() { void AbstractImporterTest::setFileCallbackOpenFileAsDataFailed() { struct: AbstractImporter { - Features doFeatures() const override { return Feature::OpenData; } + ImporterFeatures doFeatures() const override { return ImporterFeature::OpenData; } bool doIsOpened() const override { return false; } void doClose() override {} @@ -931,7 +931,7 @@ void AbstractImporterTest::setFileCallbackOpenFileAsDataFailed() { void AbstractImporterTest::defaultScene() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -943,7 +943,7 @@ void AbstractImporterTest::defaultScene() { void AbstractImporterTest::defaultSceneNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -953,7 +953,7 @@ void AbstractImporterTest::defaultSceneNotImplemented() { void AbstractImporterTest::defaultSceneNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -969,7 +969,7 @@ int state; void AbstractImporterTest::scene() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -999,7 +999,7 @@ void AbstractImporterTest::scene() { void AbstractImporterTest::sceneCountNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -1009,7 +1009,7 @@ void AbstractImporterTest::sceneCountNotImplemented() { void AbstractImporterTest::sceneCountNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -1023,7 +1023,7 @@ void AbstractImporterTest::sceneCountNoFile() { void AbstractImporterTest::sceneForNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -1033,7 +1033,7 @@ void AbstractImporterTest::sceneForNameNotImplemented() { void AbstractImporterTest::sceneForNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -1047,7 +1047,7 @@ void AbstractImporterTest::sceneForNameNoFile() { void AbstractImporterTest::sceneNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1059,7 +1059,7 @@ void AbstractImporterTest::sceneNameNotImplemented() { void AbstractImporterTest::sceneNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -1073,7 +1073,7 @@ void AbstractImporterTest::sceneNameNoFile() { void AbstractImporterTest::sceneNameOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1089,7 +1089,7 @@ void AbstractImporterTest::sceneNameOutOfRange() { void AbstractImporterTest::sceneNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1105,7 +1105,7 @@ void AbstractImporterTest::sceneNotImplemented() { void AbstractImporterTest::sceneNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -1119,7 +1119,7 @@ void AbstractImporterTest::sceneNoFile() { void AbstractImporterTest::sceneOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1135,7 +1135,7 @@ void AbstractImporterTest::sceneOutOfRange() { void AbstractImporterTest::animation() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1165,7 +1165,7 @@ void AbstractImporterTest::animation() { void AbstractImporterTest::animationCountNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -1175,7 +1175,7 @@ void AbstractImporterTest::animationCountNotImplemented() { void AbstractImporterTest::animationCountNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -1189,7 +1189,7 @@ void AbstractImporterTest::animationCountNoFile() { void AbstractImporterTest::animationForNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -1199,7 +1199,7 @@ void AbstractImporterTest::animationForNameNotImplemented() { void AbstractImporterTest::animationForNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -1213,7 +1213,7 @@ void AbstractImporterTest::animationForNameNoFile() { void AbstractImporterTest::animationNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1225,7 +1225,7 @@ void AbstractImporterTest::animationNameNotImplemented() { void AbstractImporterTest::animationNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -1239,7 +1239,7 @@ void AbstractImporterTest::animationNameNoFile() { void AbstractImporterTest::animationNameOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1255,7 +1255,7 @@ void AbstractImporterTest::animationNameOutOfRange() { void AbstractImporterTest::animationNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1271,7 +1271,7 @@ void AbstractImporterTest::animationNotImplemented() { void AbstractImporterTest::animationNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -1285,7 +1285,7 @@ void AbstractImporterTest::animationNoFile() { void AbstractImporterTest::animationOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1301,7 +1301,7 @@ void AbstractImporterTest::animationOutOfRange() { void AbstractImporterTest::animationCustomDataDeleter() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1320,7 +1320,7 @@ void AbstractImporterTest::animationCustomDataDeleter() { void AbstractImporterTest::animationCustomTrackDeleter() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1339,7 +1339,7 @@ void AbstractImporterTest::animationCustomTrackDeleter() { void AbstractImporterTest::light() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1369,7 +1369,7 @@ void AbstractImporterTest::light() { void AbstractImporterTest::lightCountNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -1379,7 +1379,7 @@ void AbstractImporterTest::lightCountNotImplemented() { void AbstractImporterTest::lightCountNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -1393,7 +1393,7 @@ void AbstractImporterTest::lightCountNoFile() { void AbstractImporterTest::lightForNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -1403,7 +1403,7 @@ void AbstractImporterTest::lightForNameNotImplemented() { void AbstractImporterTest::lightForNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -1417,7 +1417,7 @@ void AbstractImporterTest::lightForNameNoFile() { void AbstractImporterTest::lightNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1429,7 +1429,7 @@ void AbstractImporterTest::lightNameNotImplemented() { void AbstractImporterTest::lightNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -1443,7 +1443,7 @@ void AbstractImporterTest::lightNameNoFile() { void AbstractImporterTest::lightNameOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1459,7 +1459,7 @@ void AbstractImporterTest::lightNameOutOfRange() { void AbstractImporterTest::lightNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1475,7 +1475,7 @@ void AbstractImporterTest::lightNotImplemented() { void AbstractImporterTest::lightNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -1489,7 +1489,7 @@ void AbstractImporterTest::lightNoFile() { void AbstractImporterTest::lightOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1505,7 +1505,7 @@ void AbstractImporterTest::lightOutOfRange() { void AbstractImporterTest::camera() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1535,7 +1535,7 @@ void AbstractImporterTest::camera() { void AbstractImporterTest::cameraCountNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -1545,7 +1545,7 @@ void AbstractImporterTest::cameraCountNotImplemented() { void AbstractImporterTest::cameraCountNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -1559,7 +1559,7 @@ void AbstractImporterTest::cameraCountNoFile() { void AbstractImporterTest::cameraForNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -1569,7 +1569,7 @@ void AbstractImporterTest::cameraForNameNotImplemented() { void AbstractImporterTest::cameraForNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -1583,7 +1583,7 @@ void AbstractImporterTest::cameraForNameNoFile() { void AbstractImporterTest::cameraNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1595,7 +1595,7 @@ void AbstractImporterTest::cameraNameNotImplemented() { void AbstractImporterTest::cameraNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -1609,7 +1609,7 @@ void AbstractImporterTest::cameraNameNoFile() { void AbstractImporterTest::cameraNameOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1625,7 +1625,7 @@ void AbstractImporterTest::cameraNameOutOfRange() { void AbstractImporterTest::cameraNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1641,7 +1641,7 @@ void AbstractImporterTest::cameraNotImplemented() { void AbstractImporterTest::cameraNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -1655,7 +1655,7 @@ void AbstractImporterTest::cameraNoFile() { void AbstractImporterTest::cameraOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1671,7 +1671,7 @@ void AbstractImporterTest::cameraOutOfRange() { void AbstractImporterTest::object2D() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1701,7 +1701,7 @@ void AbstractImporterTest::object2D() { void AbstractImporterTest::object2DCountNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -1711,7 +1711,7 @@ void AbstractImporterTest::object2DCountNotImplemented() { void AbstractImporterTest::object2DCountNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -1725,7 +1725,7 @@ void AbstractImporterTest::object2DCountNoFile() { void AbstractImporterTest::object2DForNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -1735,7 +1735,7 @@ void AbstractImporterTest::object2DForNameNotImplemented() { void AbstractImporterTest::object2DForNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -1749,7 +1749,7 @@ void AbstractImporterTest::object2DForNameNoFile() { void AbstractImporterTest::object2DNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1761,7 +1761,7 @@ void AbstractImporterTest::object2DNameNotImplemented() { void AbstractImporterTest::object2DNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -1775,7 +1775,7 @@ void AbstractImporterTest::object2DNameNoFile() { void AbstractImporterTest::object2DNameOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1791,7 +1791,7 @@ void AbstractImporterTest::object2DNameOutOfRange() { void AbstractImporterTest::object2DNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1807,7 +1807,7 @@ void AbstractImporterTest::object2DNotImplemented() { void AbstractImporterTest::object2DNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -1821,7 +1821,7 @@ void AbstractImporterTest::object2DNoFile() { void AbstractImporterTest::object2DOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1837,7 +1837,7 @@ void AbstractImporterTest::object2DOutOfRange() { void AbstractImporterTest::object3D() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1867,7 +1867,7 @@ void AbstractImporterTest::object3D() { void AbstractImporterTest::object3DCountNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -1877,7 +1877,7 @@ void AbstractImporterTest::object3DCountNotImplemented() { void AbstractImporterTest::object3DCountNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -1891,7 +1891,7 @@ void AbstractImporterTest::object3DCountNoFile() { void AbstractImporterTest::object3DForNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -1901,7 +1901,7 @@ void AbstractImporterTest::object3DForNameNotImplemented() { void AbstractImporterTest::object3DForNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -1915,7 +1915,7 @@ void AbstractImporterTest::object3DForNameNoFile() { void AbstractImporterTest::object3DNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1927,7 +1927,7 @@ void AbstractImporterTest::object3DNameNotImplemented() { void AbstractImporterTest::object3DNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -1941,7 +1941,7 @@ void AbstractImporterTest::object3DNameNoFile() { void AbstractImporterTest::object3DNameOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1957,7 +1957,7 @@ void AbstractImporterTest::object3DNameOutOfRange() { void AbstractImporterTest::object3DNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -1973,7 +1973,7 @@ void AbstractImporterTest::object3DNotImplemented() { void AbstractImporterTest::object3DNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -1987,7 +1987,7 @@ void AbstractImporterTest::object3DNoFile() { void AbstractImporterTest::object3DOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2003,7 +2003,7 @@ void AbstractImporterTest::object3DOutOfRange() { void AbstractImporterTest::mesh2D() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2033,7 +2033,7 @@ void AbstractImporterTest::mesh2D() { void AbstractImporterTest::mesh2DCountNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -2043,7 +2043,7 @@ void AbstractImporterTest::mesh2DCountNotImplemented() { void AbstractImporterTest::mesh2DCountNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -2057,7 +2057,7 @@ void AbstractImporterTest::mesh2DCountNoFile() { void AbstractImporterTest::mesh2DForNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -2067,7 +2067,7 @@ void AbstractImporterTest::mesh2DForNameNotImplemented() { void AbstractImporterTest::mesh2DForNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -2081,7 +2081,7 @@ void AbstractImporterTest::mesh2DForNameNoFile() { void AbstractImporterTest::mesh2DNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2093,7 +2093,7 @@ void AbstractImporterTest::mesh2DNameNotImplemented() { void AbstractImporterTest::mesh2DNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -2107,7 +2107,7 @@ void AbstractImporterTest::mesh2DNameNoFile() { void AbstractImporterTest::mesh2DNameOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2123,7 +2123,7 @@ void AbstractImporterTest::mesh2DNameOutOfRange() { void AbstractImporterTest::mesh2DNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2139,7 +2139,7 @@ void AbstractImporterTest::mesh2DNotImplemented() { void AbstractImporterTest::mesh2DNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -2153,7 +2153,7 @@ void AbstractImporterTest::mesh2DNoFile() { void AbstractImporterTest::mesh2DOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2169,7 +2169,7 @@ void AbstractImporterTest::mesh2DOutOfRange() { void AbstractImporterTest::mesh3D() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2199,7 +2199,7 @@ void AbstractImporterTest::mesh3D() { void AbstractImporterTest::mesh3DCountNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -2209,7 +2209,7 @@ void AbstractImporterTest::mesh3DCountNotImplemented() { void AbstractImporterTest::mesh3DCountNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -2223,7 +2223,7 @@ void AbstractImporterTest::mesh3DCountNoFile() { void AbstractImporterTest::mesh3DForNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -2233,7 +2233,7 @@ void AbstractImporterTest::mesh3DForNameNotImplemented() { void AbstractImporterTest::mesh3DForNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -2247,7 +2247,7 @@ void AbstractImporterTest::mesh3DForNameNoFile() { void AbstractImporterTest::mesh3DNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2259,7 +2259,7 @@ void AbstractImporterTest::mesh3DNameNotImplemented() { void AbstractImporterTest::mesh3DNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -2273,7 +2273,7 @@ void AbstractImporterTest::mesh3DNameNoFile() { void AbstractImporterTest::mesh3DNameOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2289,7 +2289,7 @@ void AbstractImporterTest::mesh3DNameOutOfRange() { void AbstractImporterTest::mesh3DNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2305,7 +2305,7 @@ void AbstractImporterTest::mesh3DNotImplemented() { void AbstractImporterTest::mesh3DNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -2319,7 +2319,7 @@ void AbstractImporterTest::mesh3DNoFile() { void AbstractImporterTest::mesh3DOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2335,7 +2335,7 @@ void AbstractImporterTest::mesh3DOutOfRange() { void AbstractImporterTest::material() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2365,7 +2365,7 @@ void AbstractImporterTest::material() { void AbstractImporterTest::materialCountNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -2375,7 +2375,7 @@ void AbstractImporterTest::materialCountNotImplemented() { void AbstractImporterTest::materialCountNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -2389,7 +2389,7 @@ void AbstractImporterTest::materialCountNoFile() { void AbstractImporterTest::materialForNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -2399,7 +2399,7 @@ void AbstractImporterTest::materialForNameNotImplemented() { void AbstractImporterTest::materialForNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -2413,7 +2413,7 @@ void AbstractImporterTest::materialForNameNoFile() { void AbstractImporterTest::materialNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2425,7 +2425,7 @@ void AbstractImporterTest::materialNameNotImplemented() { void AbstractImporterTest::materialNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -2439,7 +2439,7 @@ void AbstractImporterTest::materialNameNoFile() { void AbstractImporterTest::materialNameOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2455,7 +2455,7 @@ void AbstractImporterTest::materialNameOutOfRange() { void AbstractImporterTest::materialNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2471,7 +2471,7 @@ void AbstractImporterTest::materialNotImplemented() { void AbstractImporterTest::materialNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -2485,7 +2485,7 @@ void AbstractImporterTest::materialNoFile() { void AbstractImporterTest::materialOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2501,7 +2501,7 @@ void AbstractImporterTest::materialOutOfRange() { void AbstractImporterTest::texture() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2531,7 +2531,7 @@ void AbstractImporterTest::texture() { void AbstractImporterTest::textureCountNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -2541,7 +2541,7 @@ void AbstractImporterTest::textureCountNotImplemented() { void AbstractImporterTest::textureCountNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -2555,7 +2555,7 @@ void AbstractImporterTest::textureCountNoFile() { void AbstractImporterTest::textureForNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -2565,7 +2565,7 @@ void AbstractImporterTest::textureForNameNotImplemented() { void AbstractImporterTest::textureForNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -2579,7 +2579,7 @@ void AbstractImporterTest::textureForNameNoFile() { void AbstractImporterTest::textureNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2591,7 +2591,7 @@ void AbstractImporterTest::textureNameNotImplemented() { void AbstractImporterTest::textureNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -2605,7 +2605,7 @@ void AbstractImporterTest::textureNameNoFile() { void AbstractImporterTest::textureNameOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2621,7 +2621,7 @@ void AbstractImporterTest::textureNameOutOfRange() { void AbstractImporterTest::textureNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2637,7 +2637,7 @@ void AbstractImporterTest::textureNotImplemented() { void AbstractImporterTest::textureNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -2651,7 +2651,7 @@ void AbstractImporterTest::textureNoFile() { void AbstractImporterTest::textureOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2667,7 +2667,7 @@ void AbstractImporterTest::textureOutOfRange() { void AbstractImporterTest::image1D() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2697,7 +2697,7 @@ void AbstractImporterTest::image1D() { void AbstractImporterTest::image1DCountNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -2707,7 +2707,7 @@ void AbstractImporterTest::image1DCountNotImplemented() { void AbstractImporterTest::image1DCountNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -2721,7 +2721,7 @@ void AbstractImporterTest::image1DCountNoFile() { void AbstractImporterTest::image1DForNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -2731,7 +2731,7 @@ void AbstractImporterTest::image1DForNameNotImplemented() { void AbstractImporterTest::image1DForNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -2745,7 +2745,7 @@ void AbstractImporterTest::image1DForNameNoFile() { void AbstractImporterTest::image1DNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2757,7 +2757,7 @@ void AbstractImporterTest::image1DNameNotImplemented() { void AbstractImporterTest::image1DNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -2771,7 +2771,7 @@ void AbstractImporterTest::image1DNameNoFile() { void AbstractImporterTest::image1DNameOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2787,7 +2787,7 @@ void AbstractImporterTest::image1DNameOutOfRange() { void AbstractImporterTest::image1DNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2803,7 +2803,7 @@ void AbstractImporterTest::image1DNotImplemented() { void AbstractImporterTest::image1DNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -2817,7 +2817,7 @@ void AbstractImporterTest::image1DNoFile() { void AbstractImporterTest::image1DOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2833,7 +2833,7 @@ void AbstractImporterTest::image1DOutOfRange() { void AbstractImporterTest::image1DCustomDeleter() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2852,7 +2852,7 @@ void AbstractImporterTest::image1DCustomDeleter() { void AbstractImporterTest::image2D() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2882,7 +2882,7 @@ void AbstractImporterTest::image2D() { void AbstractImporterTest::image2DCountNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -2892,7 +2892,7 @@ void AbstractImporterTest::image2DCountNotImplemented() { void AbstractImporterTest::image2DCountNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -2906,7 +2906,7 @@ void AbstractImporterTest::image2DCountNoFile() { void AbstractImporterTest::image2DForNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -2916,7 +2916,7 @@ void AbstractImporterTest::image2DForNameNotImplemented() { void AbstractImporterTest::image2DForNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -2930,7 +2930,7 @@ void AbstractImporterTest::image2DForNameNoFile() { void AbstractImporterTest::image2DNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2942,7 +2942,7 @@ void AbstractImporterTest::image2DNameNotImplemented() { void AbstractImporterTest::image2DNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -2956,7 +2956,7 @@ void AbstractImporterTest::image2DNameNoFile() { void AbstractImporterTest::image2DNameOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2972,7 +2972,7 @@ void AbstractImporterTest::image2DNameOutOfRange() { void AbstractImporterTest::image2DNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -2988,7 +2988,7 @@ void AbstractImporterTest::image2DNotImplemented() { void AbstractImporterTest::image2DNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -3002,7 +3002,7 @@ void AbstractImporterTest::image2DNoFile() { void AbstractImporterTest::image2DOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -3018,7 +3018,7 @@ void AbstractImporterTest::image2DOutOfRange() { void AbstractImporterTest::image2DCustomDeleter() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -3037,7 +3037,7 @@ void AbstractImporterTest::image2DCustomDeleter() { void AbstractImporterTest::image3D() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -3067,7 +3067,7 @@ void AbstractImporterTest::image3D() { void AbstractImporterTest::image3DCountNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -3077,7 +3077,7 @@ void AbstractImporterTest::image3DCountNotImplemented() { void AbstractImporterTest::image3DCountNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -3091,7 +3091,7 @@ void AbstractImporterTest::image3DCountNoFile() { void AbstractImporterTest::image3DForNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -3101,7 +3101,7 @@ void AbstractImporterTest::image3DForNameNotImplemented() { void AbstractImporterTest::image3DForNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -3115,7 +3115,7 @@ void AbstractImporterTest::image3DForNameNoFile() { void AbstractImporterTest::image3DNameNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -3127,7 +3127,7 @@ void AbstractImporterTest::image3DNameNotImplemented() { void AbstractImporterTest::image3DNameNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -3141,7 +3141,7 @@ void AbstractImporterTest::image3DNameNoFile() { void AbstractImporterTest::image3DNameOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -3157,7 +3157,7 @@ void AbstractImporterTest::image3DNameOutOfRange() { void AbstractImporterTest::image3DNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -3173,7 +3173,7 @@ void AbstractImporterTest::image3DNotImplemented() { void AbstractImporterTest::image3DNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -3187,7 +3187,7 @@ void AbstractImporterTest::image3DNoFile() { void AbstractImporterTest::image3DOutOfRange() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -3203,7 +3203,7 @@ void AbstractImporterTest::image3DOutOfRange() { void AbstractImporterTest::image3DCustomDeleter() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -3222,7 +3222,7 @@ void AbstractImporterTest::image3DCustomDeleter() { void AbstractImporterTest::importerState() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} @@ -3234,7 +3234,7 @@ void AbstractImporterTest::importerState() { void AbstractImporterTest::importerStateNotImplemented() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return true; } void doClose() override {} } importer; @@ -3244,7 +3244,7 @@ void AbstractImporterTest::importerStateNotImplemented() { void AbstractImporterTest::importerStateNoFile() { struct: AbstractImporter { - Features doFeatures() const override { return {}; } + ImporterFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} } importer; @@ -3259,15 +3259,15 @@ void AbstractImporterTest::importerStateNoFile() { void AbstractImporterTest::debugFeature() { std::ostringstream out; - Debug{&out} << AbstractImporter::Feature::OpenData << AbstractImporter::Feature(0xf0); - CORRADE_COMPARE(out.str(), "Trade::AbstractImporter::Feature::OpenData Trade::AbstractImporter::Feature(0xf0)\n"); + Debug{&out} << ImporterFeature::OpenData << ImporterFeature(0xf0); + CORRADE_COMPARE(out.str(), "Trade::ImporterFeature::OpenData Trade::ImporterFeature(0xf0)\n"); } void AbstractImporterTest::debugFeatures() { std::ostringstream out; - Debug{&out} << (AbstractImporter::Feature::OpenData|AbstractImporter::Feature::OpenState) << AbstractImporter::Features{}; - CORRADE_COMPARE(out.str(), "Trade::AbstractImporter::Feature::OpenData|Trade::AbstractImporter::Feature::OpenState Trade::AbstractImporter::Features{}\n"); + Debug{&out} << (ImporterFeature::OpenData|ImporterFeature::OpenState) << ImporterFeatures{}; + CORRADE_COMPARE(out.str(), "Trade::ImporterFeature::OpenData|Trade::ImporterFeature::OpenState Trade::ImporterFeatures{}\n"); } }}}} diff --git a/src/MagnumPlugins/AnyAudioImporter/AnyImporter.cpp b/src/MagnumPlugins/AnyAudioImporter/AnyImporter.cpp index 00ed7bf8e..d20db24a5 100644 --- a/src/MagnumPlugins/AnyAudioImporter/AnyImporter.cpp +++ b/src/MagnumPlugins/AnyAudioImporter/AnyImporter.cpp @@ -39,7 +39,7 @@ AnyImporter::AnyImporter(PluginManager::AbstractManager& manager, const std::str AnyImporter::~AnyImporter() = default; -auto AnyImporter::doFeatures() const -> Features { return {}; } +ImporterFeatures AnyImporter::doFeatures() const { return {}; } bool AnyImporter::doIsOpened() const { return !!_in; } diff --git a/src/MagnumPlugins/AnyAudioImporter/AnyImporter.h b/src/MagnumPlugins/AnyAudioImporter/AnyImporter.h index 91c9b0ba1..710487f3e 100644 --- a/src/MagnumPlugins/AnyAudioImporter/AnyImporter.h +++ b/src/MagnumPlugins/AnyAudioImporter/AnyImporter.h @@ -111,7 +111,7 @@ class MAGNUM_ANYAUDIOIMPORTER_EXPORT AnyImporter: public AbstractImporter { ~AnyImporter(); private: - MAGNUM_ANYAUDIOIMPORTER_LOCAL Features doFeatures() const override; + MAGNUM_ANYAUDIOIMPORTER_LOCAL ImporterFeatures doFeatures() const override; MAGNUM_ANYAUDIOIMPORTER_LOCAL bool doIsOpened() const override; MAGNUM_ANYAUDIOIMPORTER_LOCAL void doClose() override; MAGNUM_ANYAUDIOIMPORTER_LOCAL void doOpenFile(const std::string& filename) override; diff --git a/src/MagnumPlugins/AnyImageConverter/AnyImageConverter.cpp b/src/MagnumPlugins/AnyImageConverter/AnyImageConverter.cpp index 638bd38d7..fba7866d5 100644 --- a/src/MagnumPlugins/AnyImageConverter/AnyImageConverter.cpp +++ b/src/MagnumPlugins/AnyImageConverter/AnyImageConverter.cpp @@ -40,8 +40,8 @@ AnyImageConverter::AnyImageConverter(PluginManager::AbstractManager& manager, co AnyImageConverter::~AnyImageConverter() = default; -auto AnyImageConverter::doFeatures() const -> Features { - return Feature::ConvertFile|Feature::ConvertCompressedFile; +ImageConverterFeatures AnyImageConverter::doFeatures() const { + return ImageConverterFeature::ConvertFile|ImageConverterFeature::ConvertCompressedFile; } bool AnyImageConverter::doExportToFile(const ImageView2D& image, const std::string& filename) { diff --git a/src/MagnumPlugins/AnyImageConverter/AnyImageConverter.h b/src/MagnumPlugins/AnyImageConverter/AnyImageConverter.h index 671fb384c..7194ca245 100644 --- a/src/MagnumPlugins/AnyImageConverter/AnyImageConverter.h +++ b/src/MagnumPlugins/AnyImageConverter/AnyImageConverter.h @@ -115,7 +115,7 @@ class MAGNUM_ANYIMAGECONVERTER_EXPORT AnyImageConverter: public AbstractImageCon ~AnyImageConverter(); private: - MAGNUM_ANYIMAGECONVERTER_LOCAL Features doFeatures() const override; + MAGNUM_ANYIMAGECONVERTER_LOCAL ImageConverterFeatures doFeatures() const override; MAGNUM_ANYIMAGECONVERTER_LOCAL bool doExportToFile(const ImageView2D& image, const std::string& filename) override; MAGNUM_ANYIMAGECONVERTER_LOCAL bool doExportToFile(const CompressedImageView2D& image, const std::string& filename) override; }; diff --git a/src/MagnumPlugins/AnyImageImporter/AnyImageImporter.cpp b/src/MagnumPlugins/AnyImageImporter/AnyImageImporter.cpp index fb9bce1e8..ea5b1c28c 100644 --- a/src/MagnumPlugins/AnyImageImporter/AnyImageImporter.cpp +++ b/src/MagnumPlugins/AnyImageImporter/AnyImageImporter.cpp @@ -41,7 +41,7 @@ AnyImageImporter::AnyImageImporter(PluginManager::AbstractManager& manager, cons AnyImageImporter::~AnyImageImporter() = default; -auto AnyImageImporter::doFeatures() const -> Features { return Feature::OpenData; } +ImporterFeatures AnyImageImporter::doFeatures() const { return ImporterFeature::OpenData; } bool AnyImageImporter::doIsOpened() const { return !!_in; } diff --git a/src/MagnumPlugins/AnyImageImporter/AnyImageImporter.h b/src/MagnumPlugins/AnyImageImporter/AnyImageImporter.h index 12e0748a5..ee12f31e5 100644 --- a/src/MagnumPlugins/AnyImageImporter/AnyImageImporter.h +++ b/src/MagnumPlugins/AnyImageImporter/AnyImageImporter.h @@ -136,7 +136,7 @@ class MAGNUM_ANYIMAGEIMPORTER_EXPORT AnyImageImporter: public AbstractImporter { ~AnyImageImporter(); private: - MAGNUM_ANYIMAGEIMPORTER_LOCAL Features doFeatures() const override; + MAGNUM_ANYIMAGEIMPORTER_LOCAL ImporterFeatures doFeatures() const override; MAGNUM_ANYIMAGEIMPORTER_LOCAL bool doIsOpened() const override; MAGNUM_ANYIMAGEIMPORTER_LOCAL void doClose() override; MAGNUM_ANYIMAGEIMPORTER_LOCAL void doOpenFile(const std::string& filename) override; diff --git a/src/MagnumPlugins/AnySceneImporter/AnySceneImporter.cpp b/src/MagnumPlugins/AnySceneImporter/AnySceneImporter.cpp index c50cb73bb..d13b83eb1 100644 --- a/src/MagnumPlugins/AnySceneImporter/AnySceneImporter.cpp +++ b/src/MagnumPlugins/AnySceneImporter/AnySceneImporter.cpp @@ -51,7 +51,7 @@ AnySceneImporter::AnySceneImporter(PluginManager::AbstractManager& manager, cons AnySceneImporter::~AnySceneImporter() = default; -auto AnySceneImporter::doFeatures() const -> Features { return {}; } +ImporterFeatures AnySceneImporter::doFeatures() const { return {}; } bool AnySceneImporter::doIsOpened() const { return !!_in; } diff --git a/src/MagnumPlugins/AnySceneImporter/AnySceneImporter.h b/src/MagnumPlugins/AnySceneImporter/AnySceneImporter.h index 10038dd2c..9b4cc8735 100644 --- a/src/MagnumPlugins/AnySceneImporter/AnySceneImporter.h +++ b/src/MagnumPlugins/AnySceneImporter/AnySceneImporter.h @@ -138,7 +138,7 @@ class MAGNUM_ANYSCENEIMPORTER_EXPORT AnySceneImporter: public AbstractImporter { ~AnySceneImporter(); private: - MAGNUM_ANYSCENEIMPORTER_LOCAL Features doFeatures() const override; + MAGNUM_ANYSCENEIMPORTER_LOCAL ImporterFeatures doFeatures() const override; MAGNUM_ANYSCENEIMPORTER_LOCAL bool doIsOpened() const override; MAGNUM_ANYSCENEIMPORTER_LOCAL void doClose() override; MAGNUM_ANYSCENEIMPORTER_LOCAL void doOpenFile(const std::string& filename) override; diff --git a/src/MagnumPlugins/MagnumFont/MagnumFont.cpp b/src/MagnumPlugins/MagnumFont/MagnumFont.cpp index bb2436af0..67cc31bd0 100644 --- a/src/MagnumPlugins/MagnumFont/MagnumFont.cpp +++ b/src/MagnumPlugins/MagnumFont/MagnumFont.cpp @@ -74,7 +74,7 @@ MagnumFont::MagnumFont(PluginManager::AbstractManager& manager, const std::strin MagnumFont::~MagnumFont() { close(); } -auto MagnumFont::doFeatures() const -> Features { return Feature::OpenData|Feature::FileCallback|Feature::PreparedGlyphCache; } +FontFeatures MagnumFont::doFeatures() const { return FontFeature::OpenData|FontFeature::FileCallback|FontFeature::PreparedGlyphCache; } bool MagnumFont::doIsOpened() const { return _opened && _opened->image; } diff --git a/src/MagnumPlugins/MagnumFont/MagnumFont.h b/src/MagnumPlugins/MagnumFont/MagnumFont.h index 1c26715d5..fe76a12f1 100644 --- a/src/MagnumPlugins/MagnumFont/MagnumFont.h +++ b/src/MagnumPlugins/MagnumFont/MagnumFont.h @@ -157,7 +157,7 @@ class MAGNUM_MAGNUMFONT_EXPORT MagnumFont: public AbstractFont { ~MagnumFont(); private: - MAGNUM_MAGNUMFONT_LOCAL Features doFeatures() const override; + MAGNUM_MAGNUMFONT_LOCAL FontFeatures doFeatures() const override; MAGNUM_MAGNUMFONT_LOCAL bool doIsOpened() const override; MAGNUM_MAGNUMFONT_LOCAL Metrics doOpenData(Containers::ArrayView data, Float) override; MAGNUM_MAGNUMFONT_LOCAL Metrics doOpenFile(const std::string& filename, Float) override; diff --git a/src/MagnumPlugins/MagnumFont/Test/MagnumFontTest.cpp b/src/MagnumPlugins/MagnumFont/Test/MagnumFontTest.cpp index f8400e14c..098f4a25f 100644 --- a/src/MagnumPlugins/MagnumFont/Test/MagnumFontTest.cpp +++ b/src/MagnumPlugins/MagnumFont/Test/MagnumFontTest.cpp @@ -141,7 +141,7 @@ void MagnumFontTest::layout() { void MagnumFontTest::fileCallbackImage() { Containers::Pointer font = _fontManager.instantiate("MagnumFont"); - CORRADE_VERIFY(font->features() & AbstractFont::Feature::FileCallback); + CORRADE_VERIFY(font->features() & FontFeature::FileCallback); std::unordered_map> files; files["not/a/path/font.conf"] = Utility::Directory::read(Utility::Directory::join(MAGNUMFONT_TEST_DIR, "font.conf")); @@ -162,7 +162,7 @@ void MagnumFontTest::fileCallbackImage() { void MagnumFontTest::fileCallbackImageNotFound() { Containers::Pointer font = _fontManager.instantiate("MagnumFont"); - CORRADE_VERIFY(font->features() & AbstractFont::Feature::FileCallback); + CORRADE_VERIFY(font->features() & FontFeature::FileCallback); font->setFileCallback([](const std::string&, InputFileCallbackPolicy, void*) { return Containers::Optional>{}; diff --git a/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp b/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp index 229387a34..53061adec 100644 --- a/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp +++ b/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.cpp @@ -45,8 +45,8 @@ MagnumFontConverter::MagnumFontConverter() = default; MagnumFontConverter::MagnumFontConverter(PluginManager::AbstractManager& manager, const std::string& plugin): AbstractFontConverter{manager, plugin} {} -auto MagnumFontConverter::doFeatures() const -> Features { - return Feature::ExportFont|Feature::ConvertData|Feature::MultiFile; +FontConverterFeatures MagnumFontConverter::doFeatures() const { + return FontConverterFeature::ExportFont|FontConverterFeature::ConvertData|FontConverterFeature::MultiFile; } std::vector>> MagnumFontConverter::doExportFontToData(AbstractFont& font, AbstractGlyphCache& cache, const std::string& filename, const std::u32string& characters) const { diff --git a/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.h b/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.h index b73f9a76b..54a07822f 100644 --- a/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.h +++ b/src/MagnumPlugins/MagnumFontConverter/MagnumFontConverter.h @@ -98,7 +98,7 @@ class MAGNUM_MAGNUMFONTCONVERTER_EXPORT MagnumFontConverter: public Text::Abstra explicit MagnumFontConverter(PluginManager::AbstractManager& manager, const std::string& plugin); private: - MAGNUM_MAGNUMFONTCONVERTER_LOCAL Features doFeatures() const override; + MAGNUM_MAGNUMFONTCONVERTER_LOCAL FontConverterFeatures doFeatures() const override; MAGNUM_MAGNUMFONTCONVERTER_LOCAL std::vector>> doExportFontToData(AbstractFont& font, AbstractGlyphCache& cache, const std::string& filename, const std::u32string& characters) const override; }; diff --git a/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterTest.cpp b/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterTest.cpp index 9af53835f..b98c592db 100644 --- a/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterTest.cpp +++ b/src/MagnumPlugins/MagnumFontConverter/Test/MagnumFontConverterTest.cpp @@ -88,7 +88,7 @@ void MagnumFontConverterTest::exportFont() { _opened = true; return {16.0f, 25.0f, -10.0f, 39.7333f}; } - Features doFeatures() const { return {}; } + FontFeatures doFeatures() const { return {}; } Containers::Pointer doLayout(const AbstractGlyphCache&, Float, const std::string&) { return nullptr; } UnsignedInt doGlyphId(const char32_t character) { @@ -152,7 +152,7 @@ void MagnumFontConverterTest::exportFont() { void MagnumFontConverterTest::exportFontNoGlyphCacheImageDownload() { struct MyFont: AbstractFont { /* Supports neither file nor data opening */ - Features doFeatures() const override { return {}; } + FontFeatures doFeatures() const override { return {}; } bool doIsOpened() const override { return false; } void doClose() override {} diff --git a/src/MagnumPlugins/ObjImporter/ObjImporter.cpp b/src/MagnumPlugins/ObjImporter/ObjImporter.cpp index a5ef33692..2f284df09 100644 --- a/src/MagnumPlugins/ObjImporter/ObjImporter.cpp +++ b/src/MagnumPlugins/ObjImporter/ObjImporter.cpp @@ -96,7 +96,7 @@ ObjImporter::ObjImporter(PluginManager::AbstractManager& manager, const std::str ObjImporter::~ObjImporter() = default; -auto ObjImporter::doFeatures() const -> Features { return Feature::OpenData; } +ImporterFeatures ObjImporter::doFeatures() const { return ImporterFeature::OpenData; } void ObjImporter::doClose() { _file.reset(); } diff --git a/src/MagnumPlugins/ObjImporter/ObjImporter.h b/src/MagnumPlugins/ObjImporter/ObjImporter.h index 04a71f4f0..18987589d 100644 --- a/src/MagnumPlugins/ObjImporter/ObjImporter.h +++ b/src/MagnumPlugins/ObjImporter/ObjImporter.h @@ -107,7 +107,7 @@ class MAGNUM_OBJIMPORTER_EXPORT ObjImporter: public AbstractImporter { private: struct File; - MAGNUM_OBJIMPORTER_LOCAL Features doFeatures() const override; + MAGNUM_OBJIMPORTER_LOCAL ImporterFeatures doFeatures() const override; MAGNUM_OBJIMPORTER_LOCAL bool doIsOpened() const override; MAGNUM_OBJIMPORTER_LOCAL void doOpenData(Containers::ArrayView data) override; diff --git a/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.cpp b/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.cpp index 44d10b435..42eb10342 100644 --- a/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.cpp +++ b/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.cpp @@ -43,7 +43,7 @@ TgaImageConverter::TgaImageConverter() = default; TgaImageConverter::TgaImageConverter(PluginManager::AbstractManager& manager, const std::string& plugin): AbstractImageConverter{manager, plugin} {} -auto TgaImageConverter::doFeatures() const -> Features { return Feature::ConvertData; } +ImageConverterFeatures TgaImageConverter::doFeatures() const { return ImageConverterFeature::ConvertData; } Containers::Array TgaImageConverter::doExportToData(const ImageView2D& image) { /* Initialize data buffer */ diff --git a/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.h b/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.h index 7591549d0..e48c7e822 100644 --- a/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.h +++ b/src/MagnumPlugins/TgaImageConverter/TgaImageConverter.h @@ -97,7 +97,7 @@ class MAGNUM_TGAIMAGECONVERTER_EXPORT TgaImageConverter: public AbstractImageCon explicit TgaImageConverter(PluginManager::AbstractManager& manager, const std::string& plugin); private: - Features MAGNUM_TGAIMAGECONVERTER_LOCAL doFeatures() const override; + ImageConverterFeatures MAGNUM_TGAIMAGECONVERTER_LOCAL doFeatures() const override; Containers::Array MAGNUM_TGAIMAGECONVERTER_LOCAL doExportToData(const ImageView2D& image) override; }; diff --git a/src/MagnumPlugins/TgaImporter/TgaImporter.cpp b/src/MagnumPlugins/TgaImporter/TgaImporter.cpp index 0bd55bf94..c9f85af46 100644 --- a/src/MagnumPlugins/TgaImporter/TgaImporter.cpp +++ b/src/MagnumPlugins/TgaImporter/TgaImporter.cpp @@ -46,7 +46,7 @@ TgaImporter::TgaImporter(PluginManager::AbstractManager& manager, const std::str TgaImporter::~TgaImporter() = default; -auto TgaImporter::doFeatures() const -> Features { return Feature::OpenData; } +ImporterFeatures TgaImporter::doFeatures() const { return ImporterFeature::OpenData; } bool TgaImporter::doIsOpened() const { return _in; } diff --git a/src/MagnumPlugins/TgaImporter/TgaImporter.h b/src/MagnumPlugins/TgaImporter/TgaImporter.h index 4e3494b4d..11aca871b 100644 --- a/src/MagnumPlugins/TgaImporter/TgaImporter.h +++ b/src/MagnumPlugins/TgaImporter/TgaImporter.h @@ -105,7 +105,7 @@ class MAGNUM_TGAIMPORTER_EXPORT TgaImporter: public AbstractImporter { ~TgaImporter(); private: - Features MAGNUM_TGAIMPORTER_LOCAL doFeatures() const override; + ImporterFeatures MAGNUM_TGAIMPORTER_LOCAL doFeatures() const override; bool MAGNUM_TGAIMPORTER_LOCAL doIsOpened() const override; void MAGNUM_TGAIMPORTER_LOCAL doOpenData(Containers::ArrayView data) override; void MAGNUM_TGAIMPORTER_LOCAL doClose() override; diff --git a/src/MagnumPlugins/WavAudioImporter/WavImporter.cpp b/src/MagnumPlugins/WavAudioImporter/WavImporter.cpp index ebfb2db29..e5a95f2c2 100644 --- a/src/MagnumPlugins/WavAudioImporter/WavImporter.cpp +++ b/src/MagnumPlugins/WavAudioImporter/WavImporter.cpp @@ -43,7 +43,7 @@ WavImporter::WavImporter() = default; WavImporter::WavImporter(PluginManager::AbstractManager& manager, const std::string& plugin): AbstractImporter{manager, plugin} {} -auto WavImporter::doFeatures() const -> Features { return Feature::OpenData; } +ImporterFeatures WavImporter::doFeatures() const { return ImporterFeature::OpenData; } bool WavImporter::doIsOpened() const { return !!_data; } diff --git a/src/MagnumPlugins/WavAudioImporter/WavImporter.h b/src/MagnumPlugins/WavAudioImporter/WavImporter.h index 896ed05f0..ed258f72b 100644 --- a/src/MagnumPlugins/WavAudioImporter/WavImporter.h +++ b/src/MagnumPlugins/WavAudioImporter/WavImporter.h @@ -118,7 +118,7 @@ class MAGNUM_WAVAUDIOIMPORTER_EXPORT WavImporter: public AbstractImporter { explicit WavImporter(PluginManager::AbstractManager& manager, const std::string& plugin); private: - MAGNUM_WAVAUDIOIMPORTER_LOCAL Features doFeatures() const override; + MAGNUM_WAVAUDIOIMPORTER_LOCAL ImporterFeatures doFeatures() const override; MAGNUM_WAVAUDIOIMPORTER_LOCAL bool doIsOpened() const override; MAGNUM_WAVAUDIOIMPORTER_LOCAL void doOpenData(Containers::ArrayView data) override; MAGNUM_WAVAUDIOIMPORTER_LOCAL void doClose() override;