changeset 4032:058b5ade8acd

renaming embedded resources
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 09 Jun 2020 21:43:42 +0200
parents e3b3af80732d
children 0763630a42ef
files CMakeLists.txt Core/DicomParsing/FromDcmtkBridge.cpp Core/Images/Font.cpp Core/Images/Font.h Core/Toolbox.cpp OrthancServer/Database/SQLiteDatabaseWrapper.cpp OrthancServer/EmbeddedResourceHttpHandler.h OrthancServer/LuaScripting.cpp OrthancServer/OrthancConfiguration.h OrthancServer/OrthancInitialization.cpp OrthancServer/ServerContext.cpp OrthancServer/ServerIndex.cpp Resources/CMake/OrthancFrameworkConfiguration.cmake UnitTestsSources/LuaTests.cpp
diffstat 14 files changed, 19 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Tue Jun 09 21:31:13 2020 +0200
+++ b/CMakeLists.txt	Tue Jun 09 21:43:42 2020 +0200
@@ -213,7 +213,7 @@
 
 EmbedResources(
   --namespace=Orthanc.ServerResources
-  --target=ServerResources
+  --target=OrthancServerResources
   ${ORTHANC_EMBEDDED_FILES}
   )
 
--- a/Core/DicomParsing/FromDcmtkBridge.cpp	Tue Jun 09 21:31:13 2020 +0200
+++ b/Core/DicomParsing/FromDcmtkBridge.cpp	Tue Jun 09 21:43:42 2020 +0200
@@ -103,7 +103,7 @@
 #endif
 
 #if DCMTK_USE_EMBEDDED_DICTIONARIES == 1
-#  include <OrthancEmbeddedResources.h>
+#  include <OrthancFrameworkResources.h>
 #endif
 
 #if ORTHANC_ENABLE_DCMTK_JPEG == 1
@@ -142,10 +142,10 @@
 
 #if DCMTK_USE_EMBEDDED_DICTIONARIES == 1
   static void LoadEmbeddedDictionary(DcmDataDictionary& dictionary,
-                                     EmbeddedResources::FileResourceId resource)
+                                     FrameworkResources::FileResourceId resource)
   {
     std::string content;
-    EmbeddedResources::GetFileResource(content, resource);
+    FrameworkResources::GetFileResource(content, resource);
 
 #if ORTHANC_SANDBOXED == 0
     TemporaryFile tmp;
@@ -269,14 +269,14 @@
        * command "strace storescu 2>&1 |grep dic" shows that DICONDE
        * dictionary is not loaded by storescu.
        **/
-      //LoadEmbeddedDictionary(*locker, EmbeddedResources::DICTIONARY_DICONDE);
-
-      LoadEmbeddedDictionary(*locker, EmbeddedResources::DICTIONARY_DICOM);
+      //LoadEmbeddedDictionary(*locker, FrameworkResources::DICTIONARY_DICONDE);
+
+      LoadEmbeddedDictionary(*locker, FrameworkResources::DICTIONARY_DICOM);
 
       if (loadPrivateDictionary)
       {
         LOG(INFO) << "Loading the embedded dictionary of private tags";
-        LoadEmbeddedDictionary(*locker, EmbeddedResources::DICTIONARY_PRIVATE);
+        LoadEmbeddedDictionary(*locker, FrameworkResources::DICTIONARY_PRIVATE);
       }
       else
       {
--- a/Core/Images/Font.cpp	Tue Jun 09 21:31:13 2020 +0200
+++ b/Core/Images/Font.cpp	Tue Jun 09 21:43:42 2020 +0200
@@ -153,16 +153,6 @@
 #endif
 
 
-#if ORTHANC_HAS_EMBEDDED_RESOURCES == 1
-  void Font::LoadFromResource(EmbeddedResources::FileResourceId resource)
-  {
-    std::string content;
-    EmbeddedResources::GetFileResource(content, resource);
-    LoadFromMemory(content);
-  }
-#endif
-
-
   static unsigned int MyMin(unsigned int a, 
                             unsigned int b)
   {
--- a/Core/Images/Font.h	Tue Jun 09 21:31:13 2020 +0200
+++ b/Core/Images/Font.h	Tue Jun 09 21:43:42 2020 +0200
@@ -33,17 +33,8 @@
 
 #pragma once
 
-// To have ORTHANC_HAS_EMBEDDED_RESOURCES defined if using the shared library
 #include "../OrthancFramework.h"
 
-#if !defined(ORTHANC_HAS_EMBEDDED_RESOURCES)
-#  error Macro ORTHANC_HAS_EMBEDDED_RESOURCES must be defined
-#endif
-
-#if ORTHANC_HAS_EMBEDDED_RESOURCES == 1
-#  include <OrthancEmbeddedResources.h>   // Autogenerated file
-#endif
-
 #include "ImageAccessor.h"
 
 #include <stdint.h>
@@ -99,10 +90,6 @@
     void LoadFromFile(const std::string& path);
 #endif
 
-#if ORTHANC_HAS_EMBEDDED_RESOURCES == 1
-    void LoadFromResource(EmbeddedResources::FileResourceId resource);
-#endif
-
     const std::string& GetName() const
     {
       return name_;
--- a/Core/Toolbox.cpp	Tue Jun 09 21:31:13 2020 +0200
+++ b/Core/Toolbox.cpp	Tue Jun 09 21:43:42 2020 +0200
@@ -118,7 +118,7 @@
 
 #if defined(ORTHANC_STATIC_ICU)
 #  if (ORTHANC_STATIC_ICU == 1 && ORTHANC_ENABLE_LOCALE == 1)
-#    include <OrthancEmbeddedResources.h>
+#    include <OrthancFrameworkResources.h>
 #    include <unicode/udata.h>
 #    include <unicode/uloc.h>
 #    include "Compression/GzipCompressor.h"
@@ -1473,8 +1473,8 @@
 
       GzipCompressor compressor;
       compressor.Uncompress(globalIcuData_,
-                            EmbeddedResources::GetFileResourceBuffer(EmbeddedResources::LIBICU_DATA),
-                            EmbeddedResources::GetFileResourceSize(EmbeddedResources::LIBICU_DATA));
+                            FrameworkResources::GetFileResourceBuffer(FrameworkResources::LIBICU_DATA),
+                            FrameworkResources::GetFileResourceSize(FrameworkResources::LIBICU_DATA));
 
       std::string md5;
       Toolbox::ComputeMD5(md5, globalIcuData_);
--- a/OrthancServer/Database/SQLiteDatabaseWrapper.cpp	Tue Jun 09 21:31:13 2020 +0200
+++ b/OrthancServer/Database/SQLiteDatabaseWrapper.cpp	Tue Jun 09 21:43:42 2020 +0200
@@ -40,7 +40,7 @@
 #include "../Search/ISqlLookupFormatter.h"
 #include "../ServerToolbox.h"
 
-#include <ServerResources.h>
+#include <OrthancServerResources.h>
 
 #include <stdio.h>
 #include <boost/lexical_cast.hpp>
--- a/OrthancServer/EmbeddedResourceHttpHandler.h	Tue Jun 09 21:31:13 2020 +0200
+++ b/OrthancServer/EmbeddedResourceHttpHandler.h	Tue Jun 09 21:43:42 2020 +0200
@@ -35,7 +35,7 @@
 
 #include "../Core/HttpServer/IHttpHandler.h"
 
-#include <ServerResources.h>   // Autogenerated file
+#include <OrthancServerResources.h>   // Autogenerated file
 #include <boost/shared_ptr.hpp>
 
 namespace Orthanc
--- a/OrthancServer/LuaScripting.cpp	Tue Jun 09 21:31:13 2020 +0200
+++ b/OrthancServer/LuaScripting.cpp	Tue Jun 09 21:43:42 2020 +0200
@@ -42,7 +42,7 @@
 #include "../Core/Logging.h"
 #include "../Core/Lua/LuaFunctionCall.h"
 
-#include <ServerResources.h>
+#include <OrthancServerResources.h>
 
 
 namespace Orthanc
--- a/OrthancServer/OrthancConfiguration.h	Tue Jun 09 21:31:13 2020 +0200
+++ b/OrthancServer/OrthancConfiguration.h	Tue Jun 09 21:43:42 2020 +0200
@@ -37,7 +37,7 @@
 #include "../Core/WebServiceParameters.h"
 #include "../Core/DicomNetworking/RemoteModalityParameters.h"
 
-#include <ServerResources.h>
+#include <OrthancServerResources.h>
 
 #include <boost/filesystem.hpp>
 #include <boost/thread/shared_mutex.hpp>
--- a/OrthancServer/OrthancInitialization.cpp	Tue Jun 09 21:31:13 2020 +0200
+++ b/OrthancServer/OrthancInitialization.cpp	Tue Jun 09 21:43:42 2020 +0200
@@ -48,7 +48,7 @@
 #include "Database/SQLiteDatabaseWrapper.h"
 #include "OrthancConfiguration.h"
 
-#include <ServerResources.h>
+#include <OrthancServerResources.h>
 
 #include <dcmtk/dcmnet/dul.h>   // For dcmDisableGethostbyaddr()
 
--- a/OrthancServer/ServerContext.cpp	Tue Jun 09 21:31:13 2020 +0200
+++ b/OrthancServer/ServerContext.cpp	Tue Jun 09 21:43:42 2020 +0200
@@ -53,7 +53,6 @@
 #include "ServerToolbox.h"
 #include "StorageCommitmentReports.h"
 
-#include <OrthancEmbeddedResources.h>
 #include <dcmtk/dcmdata/dcfilefo.h>
 
 
--- a/OrthancServer/ServerIndex.cpp	Tue Jun 09 21:31:13 2020 +0200
+++ b/OrthancServer/ServerIndex.cpp	Tue Jun 09 21:43:42 2020 +0200
@@ -46,7 +46,6 @@
 
 #include "Database/ResourcesContent.h"
 #include "DicomInstanceToStore.h"
-#include "OrthancEmbeddedResources.h"
 #include "OrthancConfiguration.h"
 #include "Search/DatabaseLookup.h"
 #include "Search/DicomTagConstraint.h"
--- a/Resources/CMake/OrthancFrameworkConfiguration.cmake	Tue Jun 09 21:31:13 2020 +0200
+++ b/Resources/CMake/OrthancFrameworkConfiguration.cmake	Tue Jun 09 21:43:42 2020 +0200
@@ -678,7 +678,8 @@
 
 
 EmbedResources(
-  --target=OrthancEmbeddedResources
+  --namespace=Orthanc.FrameworkResources
+  --target=OrthancFrameworkResources
   ${LIBICU_RESOURCES}
   ${DCMTK_DICTIONARIES}
   )
--- a/UnitTestsSources/LuaTests.cpp	Tue Jun 09 21:31:13 2020 +0200
+++ b/UnitTestsSources/LuaTests.cpp	Tue Jun 09 21:43:42 2020 +0200
@@ -42,7 +42,7 @@
 #include "../Core/Toolbox.h"
 #include "../Core/Lua/LuaFunctionCall.h"
 
-#include <ServerResources.h>
+#include <OrthancServerResources.h>
 
 #include <boost/lexical_cast.hpp>