Add an environment variable to set the default indicator visible mode 27/152827/3
authorHeeyong Song <heeyong.song@samsung.com>
Wed, 27 Sep 2017 07:31:19 +0000 (16:31 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Wed, 11 Oct 2017 00:30:51 +0000 (00:30 +0000)
Change-Id: I5a86d1bb8ffc3f21ec2a57af9b000bf958e2a327

adaptors/base/environment-options.cpp
adaptors/base/environment-options.h
adaptors/base/environment-variables.h
adaptors/common/application-impl.cpp
adaptors/common/window-impl.h
adaptors/ecore/wayland/window-impl-ecore-wl.cpp
adaptors/wayland/window-impl-wl.cpp
adaptors/x11/window-impl-x.cpp

index fef700dc437c64c36f9cb5a51dd2aa5c86a67c0a..c96edeb673da66d445b937348d9da205eaf24ef4 100644 (file)
@@ -109,6 +109,7 @@ EnvironmentOptions::EnvironmentOptions()
   mGlesCallAccumulate( false ),
   mMultiSamplingLevel( 0 ),
   mMaxTextureSize( 0 ),
+  mIndicatorVisibleMode( -1 ),
   mLogFunction( NULL )
 {
   ParseEnvironmentOptions();
@@ -265,6 +266,11 @@ unsigned int EnvironmentOptions::GetMaxTextureSize() const
   return mMaxTextureSize;
 }
 
+int EnvironmentOptions::GetIndicatorVisibleMode() const
+{
+  return mIndicatorVisibleMode;
+}
+
 bool EnvironmentOptions::PerformanceServerRequired() const
 {
   return ( ( GetPerformanceStatsLoggingOptions() > 0) ||
@@ -424,6 +430,15 @@ void EnvironmentOptions::ParseEnvironmentOptions()
       mMaxTextureSize = maxTextureSize;
     }
   }
+
+  int indicatorVisibleMode( -1 );
+  if( GetIntegerEnvironmentVariable( DALI_ENV_INDICATOR_VISIBLE_MODE, indicatorVisibleMode ) )
+  {
+    if( indicatorVisibleMode > -1 )
+    {
+      mIndicatorVisibleMode = indicatorVisibleMode;
+    }
+  }
 }
 
 } // Adaptor
index 2ab19a9a6708d9eee875d6da2048ddf33f78aaa1..42022fd9dd958c5bd3a49192206a78f9296266c5 100644 (file)
@@ -213,6 +213,11 @@ public:
    */
   unsigned int GetMaxTextureSize() const;
 
+  /**
+   * @return The maximum texture size
+   */
+  int GetIndicatorVisibleMode() const;
+
 private: // Internal
 
   /**
@@ -250,6 +255,7 @@ private: // Data
   bool mGlesCallAccumulate;                       ///< Whether or not to accumulate gles call statistics
   unsigned int mMultiSamplingLevel;               ///< The number of samples required in multisample buffers
   unsigned int mMaxTextureSize;                   ///< The maximum texture size that GL can handle
+  int mIndicatorVisibleMode;                      ///< Indicator visible mode
 
   Dali::Integration::Log::LogFunction mLogFunction;
 
index 53fe21b3bd5d5da13f64ec60e09c77433d4689e5..72b48340d7399dc2ea17b5d6a57854365233c158 100644 (file)
@@ -97,6 +97,8 @@ namespace Adaptor
 
 #define DALI_ENV_MAX_TEXTURE_SIZE "DALI_MAX_TEXTURE_SIZE"
 
+#define DALI_ENV_INDICATOR_VISIBLE_MODE "DALI_INDICATOR_VISIBLE_MODE"
+
 } // namespace Adaptor
 
 } // namespace Internal
index 5e73d5e87350785b46dd9573210bbff831d6cc9d..079846223b3bbcb2512c38d7ad6c724a85e47630 100644 (file)
@@ -146,6 +146,12 @@ void Application::CreateWindow()
   const std::string& windowClassName = mEnvironmentOptions.GetWindowClassName();
   mWindow = Dali::Window::New( mWindowPositionSize, mName, windowClassName, mWindowMode == Dali::Application::TRANSPARENT );
 
+  int indicatorVisibleMode = mEnvironmentOptions.GetIndicatorVisibleMode();
+  if( indicatorVisibleMode >= Dali::Window::INVISIBLE && indicatorVisibleMode <= Dali::Window::AUTO )
+  {
+    GetImplementation( mWindow ).SetIndicatorVisibleMode( static_cast< Dali::Window::IndicatorVisibleMode >( indicatorVisibleMode ) );
+  }
+
   // Quit the application when the window is closed
   GetImplementation( mWindow ).DeleteRequestSignal().Connect( mSlotDelegate, &Application::Quit );
 }
@@ -400,7 +406,13 @@ void Application::ReplaceWindow( const PositionSize& positionSize, const std::st
   Dali::Window newWindow = Dali::Window::New( positionSize, name, mWindowMode == Dali::Application::TRANSPARENT );
   Window& windowImpl = GetImplementation(newWindow);
   windowImpl.SetAdaptor(*mAdaptor);
-  newWindow.ShowIndicator(Dali::Window::INVISIBLE);
+
+  int indicatorVisibleMode = mEnvironmentOptions.GetIndicatorVisibleMode();
+  if( indicatorVisibleMode >= Dali::Window::INVISIBLE && indicatorVisibleMode <= Dali::Window::AUTO )
+  {
+    GetImplementation( newWindow ).SetIndicatorVisibleMode( static_cast< Dali::Window::IndicatorVisibleMode >( indicatorVisibleMode ) );
+  }
+
   Dali::RenderSurface* renderSurface = windowImpl.GetSurface();
 
   Any nativeWindow = newWindow.GetNativeHandle();
index bd04b988c7d0d8dfccaa2c8e01b9da2ee60721b3..12de6a0d763ea4639e0464db5e087705d28cfefc 100644 (file)
@@ -304,6 +304,11 @@ public:
    */
   void RotationDone( int orientation, int width, int height );
 
+  /**
+   * Set the indicator visible mode
+   */
+  void SetIndicatorVisibleMode( Dali::Window::IndicatorVisibleMode mode );
+
 private:
   /**
    * Private constructor.
index fefbd0e2f44677f1a4690d3e7ed7694a2003d942..d1ba238741c3aadaa234e5499cee5afe66e1948f 100644 (file)
@@ -908,6 +908,11 @@ void Window::RotationDone( int orientation, int width, int height )
   mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( width, height ) );
 }
 
+void Window::SetIndicatorVisibleMode( Dali::Window::IndicatorVisibleMode mode )
+{
+  mIndicatorVisible = mode;
+}
+
 unsigned int Window::GetSupportedAuxiliaryHintCount() const
 {
   return mSupportedAuxiliaryHints.size();
index 13cda8d6972ed0f29e94a8b041aef6881d3baf12..875f5cb585461c197fbf6742cbb3480d09b3f1f0 100644 (file)
@@ -318,6 +318,11 @@ void Window::RotationDone( int orientation, int width, int height )
 {
 }
 
+void Window::SetIndicatorVisibleMode( Dali::Window::IndicatorVisibleMode mode )
+{
+  mIndicatorVisible = mode;
+}
+
 unsigned int Window::GetSupportedAuxiliaryHintCount() const
 {
   return 0;
index 95717256daa92847d1f4eb34660c860f83bf767d..4820b3601614ce47ca8474882cb98398f4022876 100644 (file)
@@ -819,6 +819,11 @@ void Window::RotationDone( int orientation, int width, int height )
   }
 }
 
+void Window::SetIndicatorVisibleMode( Dali::Window::IndicatorVisibleMode mode )
+{
+  mIndicatorVisible = mode;
+}
+
 unsigned int Window::GetSupportedAuxiliaryHintCount() const
 {
   return 0;