[niepce] Move the Niepce XMP declaration to the framework. Fix the tests for that.



commit 0f780c57a1309a48d0b79acd5b007911a3b7fd3e
Author: Hub Figuiere <hub figuiere net>
Date:   Mon Nov 7 22:33:51 2011 -0800

    Move the Niepce XMP declaration to the framework.
    Fix the tests for that.

 src/engine/db/libmetadata.cpp |    3 +--
 src/fwk/utils/exempi.cpp      |    8 ++++++--
 src/fwk/utils/exempi.hpp      |    2 ++
 src/niepce/Makefile.am        |    4 ++--
 src/niepce/main.cpp           |    3 +--
 src/niepce/xmp.cpp            |   34 ----------------------------------
 src/niepce/xmp.hpp            |   34 ----------------------------------
 7 files changed, 12 insertions(+), 76 deletions(-)
---
diff --git a/src/engine/db/libmetadata.cpp b/src/engine/db/libmetadata.cpp
index 99ac4cf..8b98055 100644
--- a/src/engine/db/libmetadata.cpp
+++ b/src/engine/db/libmetadata.cpp
@@ -23,7 +23,6 @@
 
 #include "fwk/base/debug.hpp"
 #include "libmetadata.hpp"
-#include "niepce/xmp.hpp"
 
 namespace eng {
 
@@ -53,7 +52,7 @@ bool xmpPropertyNameFromIndex(int meta, std::string & ns, std::string & property
         property = "Orientation";
         break;
     case MAKE_METADATA_IDX(eng::META_NS_NIEPCE, eng::META_NIEPCE_FLAG):
-        ns = niepce::NIEPCE_XMP_NAMESPACE;
+        ns = xmp::NIEPCE_XMP_NAMESPACE;
         property = "Flag";
         break;
     default:
diff --git a/src/fwk/utils/exempi.cpp b/src/fwk/utils/exempi.cpp
index 6783d2b..6b32371 100644
--- a/src/fwk/utils/exempi.cpp
+++ b/src/fwk/utils/exempi.cpp
@@ -30,12 +30,14 @@
 #include <exempi/xmpconsts.h>
 
 #include "fwk/base/debug.hpp"
-#include "niepce/xmp.hpp"
 #include "exempi.hpp"
 #include "pathutils.hpp"
 
 namespace xmp {
 
+const char * NIEPCE_XMP_NAMESPACE = "http://xmlns.figuiere.net/ns/niepce/1.0";;
+const char * NIEPCE_XMP_NS_PREFIX = "niepce";
+
 const char * UFRAW_INTEROP_NAMESPACE = "http://xmlns.figuiere.net/ns/ufraw_interop/1.0";;
 const char * UFRAW_INTEROP_NS_PREFIX = "ufrint";
 
@@ -48,6 +50,8 @@ ExempiManager::ExempiManager(const ns_defs_t* namespaces)
     if(xmp_init()) {
         xmp_register_namespace(xmp::UFRAW_INTEROP_NAMESPACE,
                                xmp::UFRAW_INTEROP_NS_PREFIX, NULL);
+        xmp_register_namespace(xmp::NIEPCE_XMP_NAMESPACE,
+                               xmp::NIEPCE_XMP_NS_PREFIX, NULL);
         
         if(namespaces != NULL) {
             const ns_defs_t* iter = namespaces;
@@ -194,7 +198,7 @@ int32_t XmpMeta::rating() const
 int32_t XmpMeta::flag() const
 {
     int32_t _flag = 0;
-    if(!xmp_get_property_int32(m_xmp, niepce::NIEPCE_XMP_NAMESPACE, "Flag", 
+    if(!xmp_get_property_int32(m_xmp, xmp::NIEPCE_XMP_NAMESPACE, "Flag", 
                                &_flag, NULL)) {
         ERR_OUT("get \"Flag\" property failed: %d", xmp_get_error());
     }
diff --git a/src/fwk/utils/exempi.hpp b/src/fwk/utils/exempi.hpp
index 80477b7..d4de3c8 100644
--- a/src/fwk/utils/exempi.hpp
+++ b/src/fwk/utils/exempi.hpp
@@ -99,6 +99,8 @@ struct MetaDataSectionFormat {
     const MetaDataFormat * formats;
 };
 
+extern const char * NIEPCE_XMP_NAMESPACE;
+extern const char * NIEPCE_XMP_NS_PREFIX;
 extern const char * UFRAW_INTEROP_NAMESPACE;	
 extern const char * UFRAW_INTEROP_NS_PREFIX;	
 
diff --git a/src/niepce/Makefile.am b/src/niepce/Makefile.am
index f6c2f20..521b4ef 100644
--- a/src/niepce/Makefile.am
+++ b/src/niepce/Makefile.am
@@ -31,8 +31,8 @@ niepce_LDADD = \
 	@GEGLMM_LIBS@ @OPENRAW_LIBS@ @EXEMPI_LIBS@
 
 
-niepce_SOURCES = xmp.cpp \
+niepce_SOURCES = \
 	stock.hpp stock.cpp \
 	notificationcenter.hpp notificationcenter.cpp \
-        notifications.hpp xmp.hpp \
+        notifications.hpp \
 	main.cpp
diff --git a/src/niepce/main.cpp b/src/niepce/main.cpp
index 4606857..dd477a9 100644
--- a/src/niepce/main.cpp
+++ b/src/niepce/main.cpp
@@ -28,7 +28,6 @@
 
 #include "fwk/utils/init.hpp"
 #include "fwk/utils/exempi.hpp"
-#include "xmp.hpp"
 #include "ui/niepceapplication.hpp"
 
 int main(int argc, char ** argv)
@@ -39,7 +38,7 @@ int main(int argc, char ** argv)
 
   fwk::utils::init();
 
-  fwk::ExempiManager ex_manager(niepce::xmp_namespaces);
+  fwk::ExempiManager ex_manager(NULL);
 
 	return fwk::Application::main(
 		boost::bind(&ui::NiepceApplication::create),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]