niepce r6 - in trunk: . src/fwk/utils
- From: hub svn gnome org
- To: svn-commits-list gnome org
- Subject: niepce r6 - in trunk: . src/fwk/utils
- Date: Wed, 17 Dec 2008 02:18:32 +0000 (UTC)
Author: hub
Date: Wed Dec 17 02:18:32 2008
New Revision: 6
URL: http://svn.gnome.org/viewvc/niepce?rev=6&view=rev
Log:
* src/fwk/utils/exempi.h:
* src/fwk/utils/exempi.cpp:
* src/fwk/utils/testufrawmeta.cpp:
* src/fwk/utils/ufrawmeta.cpp:
* src/fwk/utils/Makefile.am:
ufraw interop is now defined in the framework.
Modified:
trunk/ChangeLog
trunk/src/fwk/utils/Makefile.am
trunk/src/fwk/utils/exempi.cpp
trunk/src/fwk/utils/exempi.h
trunk/src/fwk/utils/testufrawmeta.cpp
trunk/src/fwk/utils/ufrawmeta.cpp
Modified: trunk/src/fwk/utils/Makefile.am
==============================================================================
--- trunk/src/fwk/utils/Makefile.am (original)
+++ trunk/src/fwk/utils/Makefile.am Wed Dec 17 02:18:32 2008
@@ -4,14 +4,12 @@
INCLUDES = -I$(top_srcdir)/src/ @EXEMPI_CFLAGS@ @LIBXML2_CFLAGS@
TESTS = testmoniker testfiles testgeometry testxmp \
- teststringutils test_db test_db2 test_db3 test_db4
-#testufrawmeta
+ teststringutils test_db test_db2 test_db3 test_db4 testufrawmeta
EXTRA_DIST = test.xmp test2.ufraw
check_PROGRAMS = testmoniker testfiles testgeometry testxmp \
- teststringutils test_db test_db2 test_db3 test_db4
-#testufrawmeta
+ teststringutils test_db test_db2 test_db3 test_db4 testufrawmeta
testmoniker_SOURCES = testmoniker.cpp
testmoniker_LDADD = libniepceutils.a \
Modified: trunk/src/fwk/utils/exempi.cpp
==============================================================================
--- trunk/src/fwk/utils/exempi.cpp (original)
+++ trunk/src/fwk/utils/exempi.cpp Wed Dec 17 02:18:32 2008
@@ -33,17 +33,29 @@
namespace bfs = boost::filesystem;
+namespace xmp {
+
+const char * UFRAW_INTEROP_NAMESPACE = "http://xmlns.figuiere.net/ns/ufraw_interop/1.0";;
+const char * UFRAW_INTEROP_NS_PREFIX = "ufrint";
+
+}
+
namespace utils {
ExempiManager::ExempiManager(const ns_defs_t* namespaces)
{
- if(xmp_init() && (namespaces != NULL)) {
- const ns_defs_t* iter = namespaces;
- for( ; iter->ns != NULL; iter++)
- {
- // TODO check the return code
- xmp_register_namespace(iter->ns,
- iter->prefix, NULL);
+ if(xmp_init()) {
+ xmp_register_namespace(xmp::UFRAW_INTEROP_NAMESPACE,
+ xmp::UFRAW_INTEROP_NS_PREFIX, NULL);
+
+ if(namespaces != NULL) {
+ const ns_defs_t* iter = namespaces;
+ for( ; iter->ns != NULL; iter++)
+ {
+ // TODO check the return code
+ xmp_register_namespace(iter->ns,
+ iter->prefix, NULL);
+ }
}
}
}
@@ -240,6 +252,6 @@
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0))
indent-tabs-mode:nil
- fill-column:99
+ fill-column:80
End:
*/
Modified: trunk/src/fwk/utils/exempi.h
==============================================================================
--- trunk/src/fwk/utils/exempi.h (original)
+++ trunk/src/fwk/utils/exempi.h Wed Dec 17 02:18:32 2008
@@ -99,7 +99,9 @@
const char * section;
const MetaDataFormat * formats;
};
-
+
+extern const char * UFRAW_INTEROP_NAMESPACE;
+extern const char * UFRAW_INTEROP_NS_PREFIX;
}
Modified: trunk/src/fwk/utils/testufrawmeta.cpp
==============================================================================
--- trunk/src/fwk/utils/testufrawmeta.cpp (original)
+++ trunk/src/fwk/utils/testufrawmeta.cpp Wed Dec 17 02:18:32 2008
@@ -1,7 +1,7 @@
/*
* niepce - utils/testxmp.cpp
*
- * Copyright (C) 2007 Hubert Figuiere
+ * Copyright (C) 2007-2008 Hubert Figuiere
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,7 +25,6 @@
#include <exempi/xmpconsts.h>
-#include "niepce/xmp.h"
#include "debug.h"
#include "exempi.h"
#include "ufrawmeta.h"
@@ -40,7 +39,7 @@
else {
dir = pdir;
}
- utils::ExempiManager xmpManager(niepce::xmp_namespaces);
+ utils::ExempiManager xmpManager(NULL);
xmp::ScopedPtr<XmpPtr> xmp(xmp_new_empty());
@@ -96,7 +95,7 @@
BOOST_CHECK(aDim == 3321);
bool imported = false;
- BOOST_CHECK(xmp_get_property_bool(xmp, niepce::NIEPCE_XMP_NAMESPACE,
+ BOOST_CHECK(xmp_get_property_bool(xmp, xmp::UFRAW_INTEROP_NAMESPACE,
"ImportedFromUFraw", &imported, NULL));
BOOST_CHECK(imported);
Modified: trunk/src/fwk/utils/ufrawmeta.cpp
==============================================================================
--- trunk/src/fwk/utils/ufrawmeta.cpp (original)
+++ trunk/src/fwk/utils/ufrawmeta.cpp Wed Dec 17 02:18:32 2008
@@ -1,7 +1,7 @@
/*
- * niepce - utils/ufrawmeta.h
+ * niepce - utils/ufrawmeta.cpp
*
- * Copyright (C) 2007 Hubert Figuiere
+ * Copyright (C) 2007-2008 Hubert Figuiere
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -28,9 +28,9 @@
#include <exempi/xmpconsts.h>
-#include "niepce/xmp.h"
#include "debug.h"
#include "ufrawmeta.h"
+#include "exempi.h"
namespace bfs = boost::filesystem;
@@ -337,7 +337,7 @@
DBG_OUT("file not found %s", m_id_file.string().c_str());
}
if(has_data) {
- xmp_set_property_bool(xmp, niepce::NIEPCE_XMP_NAMESPACE,
+ xmp_set_property_bool(xmp, xmp::UFRAW_INTEROP_NAMESPACE,
"ImportedFromUFraw", true, 0);
}
return has_data;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]