changeset 293:017044be141b am-2

renaming
author am@osimis.io
date Thu, 30 Aug 2018 17:15:22 +0200
parents df5011cf903c
children faccc4b07b92
files Applications/Samples/SampleMainNative.cpp Applications/Sdl/BasicSdlApplication.cpp Applications/Sdl/BasicSdlApplication.h Applications/Sdl/SdlEngine.cpp Applications/Sdl/SdlEngine.h Platforms/Generic/CMakeLists.txt
diffstat 6 files changed, 26 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/Samples/SampleMainNative.cpp	Thu Aug 30 17:09:31 2018 +0200
+++ b/Applications/Samples/SampleMainNative.cpp	Thu Aug 30 17:15:22 2018 +0200
@@ -34,8 +34,8 @@
   SampleApplication sampleStoneApplication(broker);
 
 #if ORTHANC_ENABLE_SDL==1
-  OrthancStone::BasicSdlApplication sdlApplication;
-  return sdlApplication.Execute(broker, sampleStoneApplication, argc, argv);
+  OrthancStone::SdlStoneApplicationRunner sdlApplicationRunner(broker, sampleStoneApplication);
+  return sdlApplicationRunner.Execute(argc, argv);
 #endif
 #if ORTHANC_ENABLE_QT==1
   OrthancStone::Samples::SampleQtApplicationRunner qtAppRunner(broker, sampleStoneApplication);
--- a/Applications/Sdl/BasicSdlApplication.cpp	Thu Aug 30 17:09:31 2018 +0200
+++ b/Applications/Sdl/BasicSdlApplication.cpp	Thu Aug 30 17:15:22 2018 +0200
@@ -37,12 +37,12 @@
 
 namespace OrthancStone
 {
-  void BasicSdlApplication::Initialize()
+  void SdlStoneApplicationRunner::Initialize()
   {
     SdlWindow::GlobalInitialize();
   }
 
-  void BasicSdlApplication::DeclareCommandLineOptions(boost::program_options::options_description& options)
+  void SdlStoneApplicationRunner::DeclareCommandLineOptions(boost::program_options::options_description& options)
   {
     boost::program_options::options_description sdl("SDL options");
     sdl.add_options()
@@ -54,7 +54,7 @@
     options.add(sdl);
   }
 
-  void BasicSdlApplication::ParseCommandLineOptions(const boost::program_options::variables_map& parameters)
+  void SdlStoneApplicationRunner::ParseCommandLineOptions(const boost::program_options::variables_map& parameters)
   {
     if (!parameters.count("width") ||
         !parameters.count("height") ||
@@ -88,7 +88,7 @@
 
   }
 
-  void BasicSdlApplication::Run(BasicNativeApplicationContext& context, const std::string& title, int argc, char* argv[])
+  void SdlStoneApplicationRunner::Run(NativeStoneApplicationContext& context, const std::string& title, int argc, char* argv[])
   {
     /**************************************************************
      * Run the application inside a SDL window
@@ -100,7 +100,7 @@
     SdlEngine sdl(window, context);
 
     {
-      BasicNativeApplicationContext::GlobalMutexLocker locker(context);
+      NativeStoneApplicationContext::GlobalMutexLocker locker(context);
       context.GetCentralViewport().Register(sdl);  // (*)
     }
 
@@ -118,7 +118,7 @@
     context.Stop();
   }
 
-  void BasicSdlApplication::Finalize()
+  void SdlStoneApplicationRunner::Finalize()
   {
     SdlWindow::GlobalFinalize();
   }
--- a/Applications/Sdl/BasicSdlApplication.h	Thu Aug 30 17:09:31 2018 +0200
+++ b/Applications/Sdl/BasicSdlApplication.h	Thu Aug 30 17:15:22 2018 +0200
@@ -21,7 +21,7 @@
 
 #pragma once
 
-#include "../Generic/BasicNativeApplication.h"
+#include "../Generic/NativeStoneApplicationRunner.h"
 
 #if ORTHANC_ENABLE_SDL != 1
 #error this file shall be included only with the ORTHANC_ENABLE_SDL set to 1
@@ -31,15 +31,21 @@
 
 namespace OrthancStone
 {
-  class BasicSdlApplication : public BasicNativeApplication
+  class SdlStoneApplicationRunner : public NativeStoneApplicationRunner
   {
     unsigned int width_;
     unsigned int height_;
     bool enableOpenGl_;
   public:
+    SdlStoneApplicationRunner(MessageBroker& broker,
+                                 IStoneApplication& application)
+      : NativeStoneApplicationRunner(broker, application)
+    {
+    }
+
     virtual void Initialize();
     virtual void DeclareCommandLineOptions(boost::program_options::options_description& options);
-    virtual void Run(BasicNativeApplicationContext& context, const std::string& title, int argc, char* argv[]);
+    virtual void Run(NativeStoneApplicationContext& context, const std::string& title, int argc, char* argv[]);
     virtual void ParseCommandLineOptions(const boost::program_options::variables_map& parameters);
     virtual void Finalize();
   };
--- a/Applications/Sdl/SdlEngine.cpp	Thu Aug 30 17:09:31 2018 +0200
+++ b/Applications/Sdl/SdlEngine.cpp	Thu Aug 30 17:15:22 2018 +0200
@@ -41,7 +41,7 @@
   {
     if (viewportChanged_)
     {
-      BasicNativeApplicationContext::GlobalMutexLocker locker(context_);
+      NativeStoneApplicationContext::GlobalMutexLocker locker(context_);
       surface_.Render(context_.GetCentralViewport());
 
       viewportChanged_ = false;
@@ -98,7 +98,7 @@
 
 
   SdlEngine::SdlEngine(SdlWindow& window,
-                       BasicNativeApplicationContext& context) :
+                       NativeStoneApplicationContext& context) :
     window_(window),
     context_(context),
     surface_(window),
@@ -118,7 +118,7 @@
     const uint8_t* keyboardState = SDL_GetKeyboardState(&scancodeCount);
 
     {
-      BasicNativeApplicationContext::GlobalMutexLocker locker(context_);
+      NativeStoneApplicationContext::GlobalMutexLocker locker(context_);
       SetSize(window_.GetWidth(), window_.GetHeight());
       context_.GetCentralViewport().SetDefaultView();
     }
@@ -133,7 +133,7 @@
       while (!stop &&
              SDL_PollEvent(&event))
       {
-        BasicNativeApplicationContext::GlobalMutexLocker locker(context_);
+        NativeStoneApplicationContext::GlobalMutexLocker locker(context_);
 
         if (event.type == SDL_QUIT) 
         {
--- a/Applications/Sdl/SdlEngine.h	Thu Aug 30 17:09:31 2018 +0200
+++ b/Applications/Sdl/SdlEngine.h	Thu Aug 30 17:15:22 2018 +0200
@@ -24,7 +24,7 @@
 #if ORTHANC_ENABLE_SDL == 1
 
 #include "SdlCairoSurface.h"
-#include "../Generic/BasicNativeApplicationContext.h"
+#include "../Generic/NativeStoneApplicationContext.h"
 
 namespace OrthancStone
 {
@@ -32,7 +32,7 @@
   {
   private:
     SdlWindow&                window_;
-    BasicNativeApplicationContext&  context_;
+    NativeStoneApplicationContext&  context_;
     SdlCairoSurface           surface_;
     bool                      viewportChanged_;
 
@@ -46,7 +46,7 @@
 
   public:
     SdlEngine(SdlWindow& window,
-              BasicNativeApplicationContext& context);
+              NativeStoneApplicationContext& context);
   
     virtual ~SdlEngine();
 
--- a/Platforms/Generic/CMakeLists.txt	Thu Aug 30 17:09:31 2018 +0200
+++ b/Platforms/Generic/CMakeLists.txt	Thu Aug 30 17:15:22 2018 +0200
@@ -29,8 +29,8 @@
 
 LIST(APPEND ORTHANC_BOOST_COMPONENTS program_options)
 
-SET(ENABLE_SDL OFF)
-SET(ENABLE_QT ON)
+SET(ENABLE_SDL ON)
+SET(ENABLE_QT OFF)
 SET(ORTHANC_SANDBOXED OFF)
 SET(ENABLE_CRYPTO_OPTIONS ON)
 SET(ENABLE_GOOGLE_TEST ON)