# HG changeset patch # User Sebastien Jodogne # Date 1574957613 -3600 # Node ID 4cc997207d8a50ed8f116a4ae887fc7ea4256831 # Parent bdc6837d5917de5fa5898821afb901047dbe714f fix compatibility between SDL and DCMTK diff -r bdc6837d5917 -r 4cc997207d8a Applications/Sdl/SdlCairoSurface.h --- a/Applications/Sdl/SdlCairoSurface.h Wed Nov 27 14:34:34 2019 +0100 +++ b/Applications/Sdl/SdlCairoSurface.h Thu Nov 28 17:13:33 2019 +0100 @@ -27,6 +27,8 @@ #include "../../Framework/Wrappers/CairoSurface.h" #include "../../Framework/Deprecated/Viewport/IViewport.h" +#include + #include namespace OrthancStone diff -r bdc6837d5917 -r 4cc997207d8a Applications/Sdl/SdlOrthancSurface.cpp --- a/Applications/Sdl/SdlOrthancSurface.cpp Wed Nov 27 14:34:34 2019 +0100 +++ b/Applications/Sdl/SdlOrthancSurface.cpp Thu Nov 28 17:13:33 2019 +0100 @@ -27,6 +27,8 @@ #include #include +#include + namespace OrthancStone { SdlOrthancSurface::SdlOrthancSurface(SdlWindow& window) : diff -r bdc6837d5917 -r 4cc997207d8a Framework/OpenGL/SdlOpenGLContext.h --- a/Framework/OpenGL/SdlOpenGLContext.h Wed Nov 27 14:34:34 2019 +0100 +++ b/Framework/OpenGL/SdlOpenGLContext.h Thu Nov 28 17:13:33 2019 +0100 @@ -26,6 +26,8 @@ #include "IOpenGLContext.h" #include "../Viewport/SdlWindow.h" +#include + #include namespace OrthancStone diff -r bdc6837d5917 -r 4cc997207d8a Framework/Viewport/SdlWindow.cpp --- a/Framework/Viewport/SdlWindow.cpp Wed Nov 27 14:34:34 2019 +0100 +++ b/Framework/Viewport/SdlWindow.cpp Thu Nov 28 17:13:33 2019 +0100 @@ -31,6 +31,8 @@ #endif // WIN32 +#include +#include #include namespace OrthancStone diff -r bdc6837d5917 -r 4cc997207d8a Framework/Viewport/SdlWindow.h --- a/Framework/Viewport/SdlWindow.h Wed Nov 27 14:34:34 2019 +0100 +++ b/Framework/Viewport/SdlWindow.h Thu Nov 28 17:13:33 2019 +0100 @@ -23,18 +23,22 @@ #if ORTHANC_ENABLE_SDL == 1 -#include -#include #include +// Forward declaration of SDL type to avoid clashes with DCMTK headers +// on "typedef Sint8", in "StoneInitialization.cpp" +struct SDL_Window; +struct SDL_Renderer; +struct SDL_Surface; + namespace OrthancStone { class SdlWindow : public boost::noncopyable { private: - SDL_Window *window_; - SDL_Renderer *renderer_; - bool maximized_; + struct SDL_Window *window_; + struct SDL_Renderer *renderer_; + bool maximized_; public: SdlWindow(const char* title, @@ -54,7 +58,7 @@ unsigned int GetHeight() const; - void Render(SDL_Surface* surface); + void Render(struct SDL_Surface* surface); void ToggleMaximize(); diff -r bdc6837d5917 -r 4cc997207d8a Resources/CMake/OrthancStoneConfiguration.cmake --- a/Resources/CMake/OrthancStoneConfiguration.cmake Wed Nov 27 14:34:34 2019 +0100 +++ b/Resources/CMake/OrthancStoneConfiguration.cmake Thu Nov 28 17:13:33 2019 +0100 @@ -250,10 +250,6 @@ ## All the source files required to build Stone of Orthanc ##################################################################### -set(APPLICATIONS_SOURCES - ${ORTHANC_STONE_ROOT}/Applications/IStoneApplication.h - ) - if (NOT ORTHANC_SANDBOXED) set(PLATFORM_SOURCES ${ORTHANC_STONE_ROOT}/Platforms/Generic/WebServiceCommandBase.cpp @@ -265,46 +261,21 @@ ${ORTHANC_STONE_ROOT}/Platforms/Generic/OracleDelayedCallExecutor.h ) - if (ENABLE_STONE_DEPRECATED) - list(APPEND PLATFORM_SOURCES - ${ORTHANC_STONE_ROOT}/Platforms/Generic/OracleWebService.cpp - ${ORTHANC_STONE_ROOT}/Framework/Deprecated/Viewport/CairoFont.cpp + if (ENABLE_SDL) + list(APPEND ORTHANC_STONE_SOURCES + ${ORTHANC_STONE_ROOT}/Framework/Viewport/SdlWindow.cpp ) endif() if (ENABLE_SDL OR ENABLE_QT) - if (ENABLE_STONE_DEPRECATED) - list(APPEND APPLICATIONS_SOURCES - ${ORTHANC_STONE_ROOT}/Applications/Generic/NativeStoneApplicationRunner.cpp - ${ORTHANC_STONE_ROOT}/Applications/Generic/NativeStoneApplicationContext.cpp - ) - endif() - - if (ENABLE_SDL) + if (ENABLE_OPENGL) list(APPEND ORTHANC_STONE_SOURCES - ${ORTHANC_STONE_ROOT}/Framework/Viewport/SdlWindow.cpp + ${ORTHANC_STONE_ROOT}/Framework/OpenGL/SdlOpenGLContext.cpp + ${ORTHANC_STONE_ROOT}/Framework/Viewport/SdlViewport.cpp ) - - list(APPEND APPLICATIONS_SOURCES - ${ORTHANC_STONE_ROOT}/Applications/Sdl/SdlCairoSurface.cpp - ${ORTHANC_STONE_ROOT}/Applications/Sdl/SdlEngine.cpp - ${ORTHANC_STONE_ROOT}/Applications/Sdl/SdlOrthancSurface.cpp - ${ORTHANC_STONE_ROOT}/Applications/Sdl/SdlStoneApplicationRunner.cpp - ) - - if (ENABLE_OPENGL) - list(APPEND ORTHANC_STONE_SOURCES - ${ORTHANC_STONE_ROOT}/Framework/OpenGL/SdlOpenGLContext.cpp - ${ORTHANC_STONE_ROOT}/Framework/Viewport/SdlViewport.cpp - ) - endif() endif() endif() elseif (ENABLE_WASM) - list(APPEND APPLICATIONS_SOURCES - ${ORTHANC_STONE_ROOT}/Applications/Wasm/StartupParametersBuilder.cpp - ) - set(STONE_WASM_SOURCES ${ORTHANC_STONE_ROOT}/Platforms/Wasm/Defaults.cpp ${ORTHANC_STONE_ROOT}/Platforms/Wasm/WasmDelayedCallExecutor.cpp @@ -331,15 +302,45 @@ DEPENDS "${ORTHANC_STONE_ROOT}/Platforms/Wasm/default-library.js") endif() -if (ENABLE_SDL OR ENABLE_WASM) - list(APPEND APPLICATIONS_SOURCES - ${ORTHANC_STONE_ROOT}/Applications/Generic/GuiAdapter.cpp - ${ORTHANC_STONE_ROOT}/Applications/Generic/GuiAdapter.h - ) -endif() +if (ENABLE_STONE_DEPRECATED) + if (NOT ORTHANC_SANDBOXED) + list(APPEND PLATFORM_SOURCES + ${ORTHANC_STONE_ROOT}/Platforms/Generic/OracleWebService.cpp + ${ORTHANC_STONE_ROOT}/Framework/Deprecated/Viewport/CairoFont.cpp + ) + endif() + + if (ENABLE_SDL OR ENABLE_WASM) + list(APPEND APPLICATIONS_SOURCES + ${ORTHANC_STONE_ROOT}/Applications/Generic/GuiAdapter.cpp + ${ORTHANC_STONE_ROOT}/Applications/Generic/GuiAdapter.h + ) + endif() -if (ENABLE_STONE_DEPRECATED) + if (ENABLE_SDL OR ENABLE_QT) + list(APPEND APPLICATIONS_SOURCES + ${ORTHANC_STONE_ROOT}/Applications/Generic/NativeStoneApplicationRunner.cpp + ${ORTHANC_STONE_ROOT}/Applications/Generic/NativeStoneApplicationContext.cpp + ) + endif() + + if (ENABLE_SDL) + list(APPEND APPLICATIONS_SOURCES + ${ORTHANC_STONE_ROOT}/Applications/Sdl/SdlCairoSurface.cpp + ${ORTHANC_STONE_ROOT}/Applications/Sdl/SdlEngine.cpp + ${ORTHANC_STONE_ROOT}/Applications/Sdl/SdlOrthancSurface.cpp + ${ORTHANC_STONE_ROOT}/Applications/Sdl/SdlStoneApplicationRunner.cpp + ) + endif() + + if (ENABLE_WASM) + list(APPEND APPLICATIONS_SOURCES + ${ORTHANC_STONE_ROOT}/Applications/Wasm/StartupParametersBuilder.cpp + ) + endif() + list(APPEND ORTHANC_STONE_SOURCES + ${ORTHANC_STONE_ROOT}/Applications/IStoneApplication.h ${ORTHANC_STONE_ROOT}/Applications/StoneApplicationContext.cpp ${ORTHANC_STONE_ROOT}/Framework/Deprecated/Layers/CircleMeasureTracker.cpp ${ORTHANC_STONE_ROOT}/Framework/Deprecated/Layers/ColorFrameRenderer.cpp