Removed Setters from EnvironmentOptions & added WindowClassName as an environment...
[platform/core/uifw/dali-adaptor.git] / adaptors / base / environment-options.cpp
index c4e3698..2df0b2b 100644 (file)
@@ -83,6 +83,7 @@ const char * GetCharEnvironmentVariable( const char * variable )
 
 EnvironmentOptions::EnvironmentOptions()
 : mWindowName(),
+  mWindowClassName(),
   mNetworkControl(0),
   mFpsFrequency(0),
   mUpdateStatusFrequency(0),
@@ -212,82 +213,19 @@ unsigned int EnvironmentOptions::GetWindowHeight() const
   return mWindowHeight;
 }
 
-void EnvironmentOptions::SetPanGesturePredictionMode( unsigned int mode )
-{
-  mPanGesturePredictionMode = mode;
-}
-
-void EnvironmentOptions::SetPanGesturePredictionAmount( unsigned int amount )
-{
-  mPanGesturePredictionAmount = amount;
-}
-
-void EnvironmentOptions::SetPanGestureMaximumPredictionAmount( unsigned int amount )
-{
-  mPanGestureMaxPredictionAmount = amount;
-}
-
-void EnvironmentOptions::SetPanGestureMinimumPredictionAmount( unsigned int amount )
-{
-  mPanGestureMinPredictionAmount = amount;
-}
-
-void EnvironmentOptions::SetPanGesturePredictionAmountAdjustment( unsigned int amount )
-{
-  mPanGesturePredictionAmountAdjustment = amount;
-}
-
-void EnvironmentOptions::SetPanGestureSmoothingMode( unsigned int mode )
-{
-  mPanGestureSmoothingMode = mode;
-}
-
-void EnvironmentOptions::SetPanGestureSmoothingAmount( float amount )
-{
-  mPanGestureSmoothingAmount = amount;
-}
-
-void EnvironmentOptions::SetMinimumPanDistance( int distance )
-{
-  mPanMinimumDistance = distance;
-}
-
-void EnvironmentOptions::SetMinimumPanEvents( int events )
-{
-  mPanMinimumEvents = events;
-}
-
-void EnvironmentOptions::SetGlesCallTime( int time )
-{
-  mGlesCallTime = time;
-}
-
 int EnvironmentOptions::GetGlesCallTime() const
 {
   return mGlesCallTime;
 }
 
-void EnvironmentOptions::SetWindowWidth( int width )
-{
-  mWindowWidth = width;
-}
-
-void EnvironmentOptions::SetWindowHeight( int height )
-{
-  mWindowHeight = height;
-}
-
-void EnvironmentOptions::SetWindowName( const char * name )
+const std::string& EnvironmentOptions::GetWindowName() const
 {
-  if ( name )
-  {
-    mWindowName = name;
-  }
+  return mWindowName;
 }
 
-const std::string& EnvironmentOptions::GetWindowName() const
+const std::string& EnvironmentOptions::GetWindowClassName() const
 {
-  return mWindowName;
+  return mWindowClassName;
 }
 
 bool EnvironmentOptions::PerformanceServerRequired() const
@@ -311,7 +249,7 @@ void EnvironmentOptions::ParseEnvironmentOptions()
   int predictionMode;
   if( GetIntegerEnvironmentVariable(DALI_ENV_PAN_PREDICTION_MODE, predictionMode) )
   {
-    SetPanGesturePredictionMode(predictionMode);
+    mPanGesturePredictionMode = predictionMode;
   }
   int predictionAmount(-1);
   if( GetIntegerEnvironmentVariable(DALI_ENV_PAN_PREDICTION_AMOUNT, predictionAmount) )
@@ -321,7 +259,7 @@ void EnvironmentOptions::ParseEnvironmentOptions()
       // do not support times in the past
       predictionAmount = 0;
     }
-    SetPanGesturePredictionAmount(predictionAmount);
+    mPanGesturePredictionAmount = predictionAmount;
   }
   int minPredictionAmount(-1);
   if( GetIntegerEnvironmentVariable(DALI_ENV_PAN_MIN_PREDICTION_AMOUNT, minPredictionAmount) )
@@ -331,7 +269,7 @@ void EnvironmentOptions::ParseEnvironmentOptions()
       // do not support times in the past
       minPredictionAmount = 0;
     }
-    SetPanGestureMinimumPredictionAmount(minPredictionAmount);
+    mPanGestureMinPredictionAmount = minPredictionAmount;
   }
   int maxPredictionAmount(-1);
   if( GetIntegerEnvironmentVariable(DALI_ENV_PAN_MAX_PREDICTION_AMOUNT, maxPredictionAmount) )
@@ -341,7 +279,7 @@ void EnvironmentOptions::ParseEnvironmentOptions()
       // maximum amount should not be smaller than minimum amount
       maxPredictionAmount = minPredictionAmount;
     }
-    SetPanGestureMaximumPredictionAmount(maxPredictionAmount);
+    mPanGestureMaxPredictionAmount = maxPredictionAmount;
   }
   int predictionAmountAdjustment(-1);
   if( GetIntegerEnvironmentVariable(DALI_ENV_PAN_PREDICTION_AMOUNT_ADJUSTMENT, predictionAmountAdjustment) )
@@ -351,46 +289,56 @@ void EnvironmentOptions::ParseEnvironmentOptions()
       // negative amount doesn't make sense
       predictionAmountAdjustment = 0;
     }
-    SetPanGesturePredictionAmountAdjustment(predictionAmountAdjustment);
+    mPanGesturePredictionAmountAdjustment = predictionAmountAdjustment;
   }
   int smoothingMode;
   if( GetIntegerEnvironmentVariable(DALI_ENV_PAN_SMOOTHING_MODE, smoothingMode) )
   {
-    SetPanGestureSmoothingMode(smoothingMode);
+    mPanGestureSmoothingMode = smoothingMode;
   }
   float smoothingAmount = 1.0f;
   if( GetFloatEnvironmentVariable(DALI_ENV_PAN_SMOOTHING_AMOUNT, smoothingAmount) )
   {
     smoothingAmount = Clamp(smoothingAmount, 0.0f, 1.0f);
-    SetPanGestureSmoothingAmount(smoothingAmount);
+    mPanGestureSmoothingAmount = smoothingAmount;
   }
 
   int minimumDistance(-1);
   if ( GetIntegerEnvironmentVariable(DALI_ENV_PAN_MINIMUM_DISTANCE, minimumDistance ))
   {
-    SetMinimumPanDistance( minimumDistance );
+    mPanMinimumDistance = minimumDistance;
   }
 
   int minimumEvents(-1);
   if ( GetIntegerEnvironmentVariable(DALI_ENV_PAN_MINIMUM_EVENTS, minimumEvents ))
   {
-    SetMinimumPanEvents( minimumEvents );
+    mPanMinimumEvents = minimumEvents;
   }
 
   int glesCallTime(0);
   if ( GetIntegerEnvironmentVariable(DALI_GLES_CALL_TIME, glesCallTime ))
   {
-    SetGlesCallTime( glesCallTime );
+    mGlesCallTime = glesCallTime;
   }
 
   int windowWidth(0), windowHeight(0);
   if ( GetIntegerEnvironmentVariable( DALI_WINDOW_WIDTH, windowWidth ) && GetIntegerEnvironmentVariable( DALI_WINDOW_HEIGHT, windowHeight ) )
   {
-    SetWindowWidth( windowWidth );
-    SetWindowHeight( windowHeight );
+    mWindowWidth = windowWidth;
+    mWindowHeight = windowHeight;
   }
 
-  SetWindowName( GetCharEnvironmentVariable( DALI_WINDOW_NAME ) );
+  const char * windowName = GetCharEnvironmentVariable( DALI_WINDOW_NAME );
+  if ( windowName )
+  {
+    mWindowName = windowName;
+  }
+
+  const char * windowClassName = GetCharEnvironmentVariable( DALI_WINDOW_CLASS_NAME );
+  if ( windowClassName )
+  {
+    mWindowClassName = windowClassName;
+  }
 }
 
 } // Adaptor