Commit 3e83d955 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Move the metadata code into its own library

parent eca38514
...@@ -20,4 +20,5 @@ add_subdirectory( libkis ) ...@@ -20,4 +20,5 @@ add_subdirectory( libkis )
if (NOT APPLE AND HAVE_QT_QUICK) if (NOT APPLE AND HAVE_QT_QUICK)
add_subdirectory( libqml ) add_subdirectory( libqml )
endif() endif()
add_subdirectory( metadata )
...@@ -4,7 +4,6 @@ add_subdirectory( tiles3 ) ...@@ -4,7 +4,6 @@ add_subdirectory( tiles3 )
include_directories( include_directories(
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/metadata
${CMAKE_CURRENT_SOURCE_DIR}/3rdparty ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty
${CMAKE_CURRENT_SOURCE_DIR}/brushengine ${CMAKE_CURRENT_SOURCE_DIR}/brushengine
${CMAKE_CURRENT_SOURCE_DIR}/commands ${CMAKE_CURRENT_SOURCE_DIR}/commands
...@@ -275,22 +274,6 @@ set(kritaimage_LIB_SRCS ...@@ -275,22 +274,6 @@ set(kritaimage_LIB_SRCS
kis_layer_composition.cpp kis_layer_composition.cpp
kis_selection_filters.cpp kis_selection_filters.cpp
KisProofingConfiguration.h KisProofingConfiguration.h
metadata/kis_meta_data_entry.cc
metadata/kis_meta_data_filter.cc
metadata/kis_meta_data_filter_p.cc
metadata/kis_meta_data_filter_registry.cc
metadata/kis_meta_data_filter_registry_model.cc
metadata/kis_meta_data_io_backend.cc
metadata/kis_meta_data_merge_strategy.cc
metadata/kis_meta_data_merge_strategy_p.cc
metadata/kis_meta_data_merge_strategy_registry.cc
metadata/kis_meta_data_parser.cc
metadata/kis_meta_data_schema.cc
metadata/kis_meta_data_schema_registry.cc
metadata/kis_meta_data_store.cc
metadata/kis_meta_data_type_info.cc
metadata/kis_meta_data_validator.cc
metadata/kis_meta_data_value.cc
kis_keyframe.cpp kis_keyframe.cpp
kis_keyframe_channel.cpp kis_keyframe_channel.cpp
...@@ -338,10 +321,13 @@ target_link_libraries(kritaimage ...@@ -338,10 +321,13 @@ target_link_libraries(kritaimage
PUBLIC PUBLIC
kritaversion kritaversion
kritawidgets kritawidgets
kritaglobal kritapsd kritaglobal
kritaodf kritapigment kritapsd
kritaodf
kritapigment
kritacommand kritacommand
kritawidgetutils kritawidgetutils
kritametadata
Qt5::Concurrent Qt5::Concurrent
) )
...@@ -371,7 +357,6 @@ target_include_directories(kritaimage ...@@ -371,7 +357,6 @@ target_include_directories(kritaimage
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/filter> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/filter>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/generator> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/generator>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/layerstyles> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/layerstyles>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/metadata>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/processing> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/processing>
) )
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
#define KIS_EXIF_INFO_VISITOR_H #define KIS_EXIF_INFO_VISITOR_H
#include <kis_node_visitor.h> #include <kis_node_visitor.h>
#include <metadata/kis_meta_data_store.h> #include <kis_meta_data_store.h>
#include <metadata/kis_meta_data_filter_registry_model.h> #include <kis_meta_data_filter_registry_model.h>
#include <kis_paint_layer.h> #include <kis_paint_layer.h>
#include <kis_group_layer.h> #include <kis_group_layer.h>
......
...@@ -12,7 +12,6 @@ else() ...@@ -12,7 +12,6 @@ else()
endif() endif()
include_directories( include_directories(
${CMAKE_SOURCE_DIR}/libs/image/metadata
${CMAKE_BINARY_DIR}/libs/image/ ${CMAKE_BINARY_DIR}/libs/image/
${CMAKE_SOURCE_DIR}/libs/image/ ${CMAKE_SOURCE_DIR}/libs/image/
${CMAKE_SOURCE_DIR}/libs/image/brushengine ${CMAKE_SOURCE_DIR}/libs/image/brushengine
...@@ -141,7 +140,6 @@ ecm_add_tests( ...@@ -141,7 +140,6 @@ ecm_add_tests(
kis_update_scheduler_test.cpp kis_update_scheduler_test.cpp
kis_async_merger_test.cpp kis_async_merger_test.cpp
kis_cage_transform_worker_test.cpp kis_cage_transform_worker_test.cpp
kis_meta_data_test.cpp
kis_random_generator_test.cpp kis_random_generator_test.cpp
kis_keyframing_test.cpp kis_keyframing_test.cpp
kis_filter_mask_test.cpp kis_filter_mask_test.cpp
......
...@@ -586,7 +586,7 @@ void KisImageTest::testFlattenLayer() ...@@ -586,7 +586,7 @@ void KisImageTest::testFlattenLayer()
} }
} }
#include <metadata/kis_meta_data_merge_strategy_registry.h> #include <kis_meta_data_merge_strategy_registry.h>
template<class ContainerTest> template<class ContainerTest>
KisLayerSP mergeHelper(ContainerTest &p, KisLayerSP layer) KisLayerSP mergeHelper(ContainerTest &p, KisLayerSP layer)
......
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
#include <klocalizedstring.h> #include <klocalizedstring.h>
#include <kis_image.h> #include <kis_image.h>
#include <KoColorSpace.h> #include <KoColorSpace.h>
#include <metadata/kis_meta_data_store.h> #include <kis_meta_data_store.h>
#include <metadata/kis_meta_data_filter_registry_model.h> #include <kis_meta_data_filter_registry_model.h>
#include <metadata/kis_exif_info_visitor.h> #include <kis_exif_info_visitor.h>
class ExifCheck : public KisExportCheckBase class ExifCheck : public KisExportCheckBase
{ {
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include <lazybrush/kis_colorize_mask.h> #include <lazybrush/kis_colorize_mask.h>
#include <kis_layer.h> #include <kis_layer.h>
#include <kis_meta_data_merge_strategy.h> #include <kis_meta_data_merge_strategy.h>
#include <metadata/kis_meta_data_merge_strategy_registry.h> #include <kis_meta_data_merge_strategy_registry.h>
#include <kis_filter_strategy.h> #include <kis_filter_strategy.h>
#include <kis_raster_keyframe_channel.h> #include <kis_raster_keyframe_channel.h>
......
set(kritametadata_LIB_SRCS
kis_legacy_importer.cc
kis_meta_data_entry.cc
kis_meta_data_filter.cc
kis_meta_data_filter_p.cc
kis_meta_data_filter_registry.cc
kis_meta_data_filter_registry_model.cc
kis_meta_data_io_backend.cc
kis_meta_data_merge_strategy.cc
kis_meta_data_merge_strategy_p.cc
kis_meta_data_merge_strategy_registry.cc
kis_meta_data_parser.cc
kis_meta_data_schema.cc
kis_meta_data_schema_registry.cc
kis_meta_data_store.cc
kis_meta_data_type_info.cc
kis_meta_data_validator.cc
kis_meta_data_value.cc
)
add_library(kritametadata SHARED ${kritametadata_LIB_SRCS} )
generate_export_header(kritametadata)
target_link_libraries(kritametadata kritaversion kritaglobal kritaplugin kritawidgetutils)
set_target_properties(kritametadata PROPERTIES
VERSION ${GENERIC_KRITA_LIB_VERSION} SOVERSION ${GENERIC_KRITA_LIB_SOVERSION}
)
install(TARGETS kritametadata ${INSTALL_TARGETS_DEFAULT_ARGS})
add_subdirectory(tests)
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#ifndef _KIS_META_DATA_ENTRY_H_ #ifndef _KIS_META_DATA_ENTRY_H_
#define _KIS_META_DATA_ENTRY_H_ #define _KIS_META_DATA_ENTRY_H_
#include <kritaimage_export.h> #include <kritametadata_export.h>
#include <kis_debug.h> #include <kis_debug.h>
class QString; class QString;
...@@ -33,7 +33,7 @@ class Schema; ...@@ -33,7 +33,7 @@ class Schema;
/** /**
* Represent a metadata entry, a name and a value (\ref KisMetaData::Value). * Represent a metadata entry, a name and a value (\ref KisMetaData::Value).
*/ */
class KRITAIMAGE_EXPORT Entry class KRITAMETADATA_EXPORT Entry
{ {
struct Private; struct Private;
friend class Store; friend class Store;
...@@ -92,6 +92,6 @@ private: ...@@ -92,6 +92,6 @@ private:
}; };
} }
KRITAIMAGE_EXPORT QDebug operator<<(QDebug debug, const KisMetaData::Entry &c); KRITAMETADATA_EXPORT QDebug operator<<(QDebug debug, const KisMetaData::Entry &c);
#endif #endif
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#ifndef _KIS_META_DATA_FILTER_H_ #ifndef _KIS_META_DATA_FILTER_H_
#define _KIS_META_DATA_FILTER_H_ #define _KIS_META_DATA_FILTER_H_
#include <kritaimage_export.h> #include <kritametadata_export.h>
class QString; class QString;
namespace KisMetaData namespace KisMetaData
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#ifndef _KIS_META_DATA_FILTER_REGISTRY_H_ #ifndef _KIS_META_DATA_FILTER_REGISTRY_H_
#define _KIS_META_DATA_FILTER_REGISTRY_H_ #define _KIS_META_DATA_FILTER_REGISTRY_H_
#include <kritaimage_export.h> #include <kritametadata_export.h>
#include "KoGenericRegistry.h" #include "KoGenericRegistry.h"
#include "kis_meta_data_filter.h" #include "kis_meta_data_filter.h"
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
namespace KisMetaData namespace KisMetaData
{ {
class KRITAIMAGE_EXPORT FilterRegistry : public KoGenericRegistry<const KisMetaData::Filter*> class KRITAMETADATA_EXPORT FilterRegistry : public KoGenericRegistry<const KisMetaData::Filter*>
{ {
public: public:
FilterRegistry(); FilterRegistry();
......
...@@ -32,7 +32,7 @@ namespace KisMetaData ...@@ -32,7 +32,7 @@ namespace KisMetaData
* Use this model to display a list of filters (KisMetaData::Filter) that can be * Use this model to display a list of filters (KisMetaData::Filter) that can be
* enabled or disabled. * enabled or disabled.
*/ */
class KRITAIMAGE_EXPORT FilterRegistryModel : public KoGenericRegistryModel<const Filter*> class KRITAMETADATA_EXPORT FilterRegistryModel : public KoGenericRegistryModel<const Filter*>
{ {
public: public:
FilterRegistryModel(); FilterRegistryModel();
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#ifndef _KIS_META_DATA_IO_BACKEND_H_ #ifndef _KIS_META_DATA_IO_BACKEND_H_
#define _KIS_META_DATA_IO_BACKEND_H_ #define _KIS_META_DATA_IO_BACKEND_H_
#include <kritaimage_export.h> #include <kritametadata_export.h>
#include <KoGenericRegistry.h> #include <KoGenericRegistry.h>
...@@ -33,7 +33,7 @@ class Store; ...@@ -33,7 +33,7 @@ class Store;
* For instance, to add support to exif or xmp or iptc or dublin core * For instance, to add support to exif or xmp or iptc or dublin core
* or anything else, it is needed to extend this interface. * or anything else, it is needed to extend this interface.
*/ */
class KRITAIMAGE_EXPORT IOBackend class KRITAMETADATA_EXPORT IOBackend
{ {
public: public:
...@@ -98,7 +98,7 @@ public: ...@@ -98,7 +98,7 @@ public:
virtual bool loadFrom(Store* store, QIODevice* ioDevice) const = 0; virtual bool loadFrom(Store* store, QIODevice* ioDevice) const = 0;
}; };
class KRITAIMAGE_EXPORT IOBackendRegistry : public KoGenericRegistry<IOBackend*> class KRITAMETADATA_EXPORT IOBackendRegistry : public KoGenericRegistry<IOBackend*>
{ {
public: public:
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <QList> #include <QList>
#include <kritaimage_export.h> #include <kritametadata_export.h>
class QString; class QString;
...@@ -34,7 +34,7 @@ class Store; ...@@ -34,7 +34,7 @@ class Store;
* This is used to decide which entries of a metadata store is kept, or how they * This is used to decide which entries of a metadata store is kept, or how they
* are modified when a list of meta data stores are merged together. * are modified when a list of meta data stores are merged together.
*/ */
class KRITAIMAGE_EXPORT MergeStrategy class KRITAMETADATA_EXPORT MergeStrategy
{ {
public: public:
virtual ~MergeStrategy(); virtual ~MergeStrategy();
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#ifndef _KIS_META_DATA_MERGE_STRATEGY_REGISTRY_H_ #ifndef _KIS_META_DATA_MERGE_STRATEGY_REGISTRY_H_
#define _KIS_META_DATA_MERGE_STRATEGY_REGISTRY_H_ #define _KIS_META_DATA_MERGE_STRATEGY_REGISTRY_H_
#include <kritaimage_export.h> #include <kritametadata_export.h>
#include "KoGenericRegistry.h" #include "KoGenericRegistry.h"
#include "kis_meta_data_merge_strategy.h" #include "kis_meta_data_merge_strategy.h"
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
namespace KisMetaData namespace KisMetaData
{ {
class KRITAIMAGE_EXPORT MergeStrategyRegistry : public KoGenericRegistry<const KisMetaData::MergeStrategy*> class KRITAMETADATA_EXPORT MergeStrategyRegistry : public KoGenericRegistry<const KisMetaData::MergeStrategy*>
{ {
public: public:
MergeStrategyRegistry(); MergeStrategyRegistry();
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#ifndef _KIS_META_DATA_PARSER_H_ #ifndef _KIS_META_DATA_PARSER_H_
#define _KIS_META_DATA_PARSER_H_ #define _KIS_META_DATA_PARSER_H_
#include <kritaimage_export.h> #include <kritametadata_export.h>
#include <QString> #include <QString>
...@@ -30,7 +30,7 @@ class Value; ...@@ -30,7 +30,7 @@ class Value;
/** /**
* This class allow to parse from a string and return a value. * This class allow to parse from a string and return a value.
*/ */
class KRITAIMAGE_EXPORT Parser class KRITAMETADATA_EXPORT Parser
{ {
friend class TypeInfo; friend class TypeInfo;
public: public:
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#ifndef _KIS_META_DATA_SCHEMA_H_ #ifndef _KIS_META_DATA_SCHEMA_H_
#define _KIS_META_DATA_SCHEMA_H_ #define _KIS_META_DATA_SCHEMA_H_
#include <kritaimage_export.h> #include <kritametadata_export.h>
#include <kis_debug.h> #include <kis_debug.h>
class QString; class QString;
...@@ -30,7 +30,7 @@ namespace KisMetaData ...@@ -30,7 +30,7 @@ namespace KisMetaData
class SchemaRegistry; class SchemaRegistry;
class TypeInfo; class TypeInfo;
class KRITAIMAGE_EXPORT Schema class KRITAMETADATA_EXPORT Schema
{ {
friend class SchemaRegistry; friend class SchemaRegistry;
...@@ -70,6 +70,6 @@ private: ...@@ -70,6 +70,6 @@ private:
} }
KRITAIMAGE_EXPORT QDebug operator<<(QDebug debug, const KisMetaData::Schema &c); KRITAMETADATA_EXPORT QDebug operator<<(QDebug debug, const KisMetaData::Schema &c);
#endif #endif
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#ifndef _KIS_META_DATA_SCHEMA_REGISTRY_H_ #ifndef _KIS_META_DATA_SCHEMA_REGISTRY_H_
#define _KIS_META_DATA_SCHEMA_REGISTRY_H_ #define _KIS_META_DATA_SCHEMA_REGISTRY_H_
#include <kritaimage_export.h> #include <kritametadata_export.h>
class QString; class QString;
class QDebug; class QDebug;
...@@ -29,7 +29,7 @@ namespace KisMetaData ...@@ -29,7 +29,7 @@ namespace KisMetaData
class Schema; class Schema;
class KRITAIMAGE_EXPORT SchemaRegistry class KRITAMETADATA_EXPORT SchemaRegistry
{ {
struct Private; struct Private;
SchemaRegistry(); SchemaRegistry();
...@@ -64,6 +64,6 @@ private: ...@@ -64,6 +64,6 @@ private:
}; };
} }
KRITAIMAGE_EXPORT QDebug operator<<(QDebug debug, const KisMetaData::Schema &c); KRITAMETADATA_EXPORT QDebug operator<<(QDebug debug, const KisMetaData::Schema &c);
#endif #endif
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#ifndef _KIS_META_DATA_STORE_H_ #ifndef _KIS_META_DATA_STORE_H_
#define _KIS_META_DATA_STORE_H_ #define _KIS_META_DATA_STORE_H_
#include <kritaimage_export.h> #include <kritametadata_export.h>
#include <QHash> #include <QHash>
...@@ -35,7 +35,7 @@ class Value; ...@@ -35,7 +35,7 @@ class Value;
* This class holds the list of metadata entries and schemas (for instance the * This class holds the list of metadata entries and schemas (for instance the
* author of the image, copyright holder, license, aperture, speed...) * author of the image, copyright holder, license, aperture, speed...)
*/ */
class KRITAIMAGE_EXPORT Store class KRITAMETADATA_EXPORT Store
{ {
struct Private; struct Private;
public: public:
......
...@@ -21,14 +21,14 @@ ...@@ -21,14 +21,14 @@
#include <QList> #include <QList>
#include <QString> #include <QString>
#include <kritaimage_export.h> #include <kritametadata_export.h>
namespace KisMetaData namespace KisMetaData
{ {
class Parser; class Parser;
class Schema; class Schema;
class Value; class Value;
class KRITAIMAGE_EXPORT TypeInfo class KRITAMETADATA_EXPORT TypeInfo
{ {
public: public:
enum PropertyType { enum PropertyType {
...@@ -46,7 +46,7 @@ public: ...@@ -46,7 +46,7 @@ public:
OpenedChoice, OpenedChoice,
ClosedChoice ClosedChoice
}; };
class KRITAIMAGE_EXPORT Choice class KRITAMETADATA_EXPORT Choice
{ {
public: public:
Choice(const Value&, const QString& hint); Choice(const Value&, const QString& hint);
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <QHash> #include <QHash>
struct KRITAIMAGE_EXPORT KisMetaData::TypeInfo::Private { struct KRITAMETADATA_EXPORT KisMetaData::TypeInfo::Private {
Private() : embeddedTypeInfo(0), structureSchema(0), parser(0) {} Private() : embeddedTypeInfo(0), structureSchema(0), parser(0) {}
PropertyType propertyType; PropertyType propertyType;
const TypeInfo* embeddedTypeInfo; const TypeInfo* embeddedTypeInfo;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <QMap> #include <QMap>
#include <QString> #include <QString>
#include <kritaimage_export.h> #include <kritametadata_export.h>
namespace KisMetaData namespace KisMetaData
{ {
...@@ -30,10 +30,10 @@ class Store; ...@@ -30,10 +30,10 @@ class Store;
/** /**
* This class contains information on the validation results of a \ref KisMetaData::Store . * This class contains information on the validation results of a \ref KisMetaData::Store .
*/ */
class KRITAIMAGE_EXPORT Validator class KRITAMETADATA_EXPORT Validator
{ {
public: public:
class KRITAIMAGE_EXPORT Reason class KRITAMETADATA_EXPORT Reason
{ {
friend class Validator; friend class Validator;
friend class QMap<QString, Reason>; friend class QMap<QString, Reason>;
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <QList> #include <QList>
#include <QMap> #include <QMap>
#include <kritaimage_export.h> #include <kritametadata_export.h>
#include <boost/operators.hpp> #include <boost/operators.hpp>
class QVariant; class QVariant;
...@@ -43,7 +43,7 @@ struct Rational : public boost::equality_comparable<Rational> ...@@ -43,7 +43,7 @@ struct Rational : public boost::equality_comparable<Rational>
* Value is build on top of QVariant to extend it to support the various types * Value is build on top of QVariant to extend it to support the various types
* and extensions through property qualifiers. * and extensions through property qualifiers.
*/ */
class KRITAIMAGE_EXPORT Value class KRITAMETADATA_EXPORT Value