removing use of using namespace std; 51/30051/8
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Fri, 7 Nov 2014 17:21:08 +0000 (17:21 +0000)
committerKimmo Hoikka <kimmo.hoikka@samsung.com>
Tue, 11 Nov 2014 17:38:55 +0000 (17:38 +0000)
Change-Id: Ide522206356666cb14faf1fc9089f48cab71be1f

16 files changed:
base/dali-toolkit/internal/controls/popup/popup-impl.cpp
base/dali-toolkit/internal/controls/popup/popup-style-impl.cpp
base/dali-toolkit/internal/controls/table-view/table-view-impl.cpp
base/dali-toolkit/internal/controls/text-input/text-input-handles-impl.cpp
base/dali-toolkit/internal/controls/text-input/text-input-impl.cpp
base/dali-toolkit/internal/controls/text-input/text-input-popup-impl.cpp
base/dali-toolkit/internal/controls/text-input/text-input-text-highlight-impl.cpp
base/dali-toolkit/public-api/controls/scrollable/item-view/depth-layout.cpp
base/dali-toolkit/public-api/controls/scrollable/item-view/grid-layout.cpp
base/dali-toolkit/public-api/controls/scrollable/item-view/navigation-layout.cpp
base/dali-toolkit/public-api/controls/scrollable/item-view/roll-layout.cpp
base/dali-toolkit/public-api/controls/scrollable/item-view/spiral-layout.cpp
optional/dali-toolkit/internal/controls/cluster/cluster-impl.cpp
optional/dali-toolkit/internal/controls/selectors/rotating-selector-impl.cpp
optional/dali-toolkit/internal/controls/slider/slider-impl.cpp
optional/dali-toolkit/public-api/controls/cluster/cluster-style.cpp

index 8c29724..f5179d7 100755 (executable)
@@ -37,7 +37,6 @@
 #include <dali-toolkit/public-api/focus-manager/focus-manager.h>
 
 using namespace Dali;
-using namespace std;
 
 namespace
 {
index 7ce77b1..7a97456 100644 (file)
@@ -19,7 +19,6 @@
 
 using namespace Dali;
 using namespace Dali::Toolkit;
-using namespace std;
 
 namespace // unnamed namespace
 {
index 4db1a13..85099f5 100644 (file)
@@ -20,7 +20,6 @@
 
 // EXTERNAL INCLUDES
 #include <sstream>
-#include <dali/public-api/adaptor-framework/physical-keyboard.h>
 #include <dali/public-api/animation/constraint.h>
 #include <dali/public-api/animation/time-period.h>
 #include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/scripting/scripting.h>
 #include <dali/integration-api/debug.h>
 
-// INTERNAL INCLUDES
-#include <dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h>
-
 using namespace Dali;
-using namespace std;
 
 namespace
 {
@@ -119,7 +114,7 @@ void PrintArray( Array2d<Size>& array )
 }
 // debugging support, very useful when new features are added or bugs are hunted down
 // currently not called from code so compiler will optimize these away, kept here for future debugging
-void PrintVector( vector<float>& array )
+void PrintVector( std::vector<float>& array )
 {
   TV_LOG( "vector, size [%d]\n", array.size() );
   // print values
@@ -364,14 +359,14 @@ void TableView::InsertRow( unsigned int rowIndex )
 
 void TableView::DeleteRow( unsigned int rowIndex )
 {
-  vector< Actor > ignored;
+  std::vector< Actor > ignored;
   DeleteRow( rowIndex, ignored );
 }
 
-void TableView::DeleteRow( unsigned int rowIndex, vector<Actor>& removed )
+void TableView::DeleteRow( unsigned int rowIndex, std::vector<Actor>& removed )
 {
   RelayoutingLock lock( *this );
-  vector< CellData > lost;
+  std::vector< CellData > lost;
   mCellData.DeleteRow( rowIndex, lost );
   // need to update the cellinfos for the items that moved
   const unsigned int rowCount = mCellData.GetRows();
@@ -451,14 +446,14 @@ void TableView::InsertColumn( unsigned int columnIndex )
 
 void TableView::DeleteColumn( unsigned int columnIndex )
 {
-  vector< Actor > ignored;
+  std::vector< Actor > ignored;
   DeleteColumn( columnIndex, ignored );
 }
 
-void TableView::DeleteColumn( unsigned int columnIndex, vector<Actor>& removed )
+void TableView::DeleteColumn( unsigned int columnIndex, std::vector<Actor>& removed )
 {
   RelayoutingLock lock( *this );
-  vector< CellData > lost;
+  std::vector< CellData > lost;
   mCellData.DeleteColumn( columnIndex, lost );
   // need to update the cellinfos for the items that moved
   const unsigned int rowCount = mCellData.GetRows();
@@ -502,17 +497,17 @@ void TableView::DeleteColumn( unsigned int columnIndex, vector<Actor>& removed )
 
 void TableView::Resize( unsigned int rows, unsigned int columns )
 {
-  vector< Actor > ignored;
+  std::vector< Actor > ignored;
   Resize( rows, columns, ignored );
 }
 
-void TableView::Resize( unsigned int rows, unsigned int columns, vector<Actor>& removed )
+void TableView::Resize( unsigned int rows, unsigned int columns, std::vector<Actor>& removed )
 {
   RelayoutingLock lock( *this );
   unsigned int oldRows = GetRows();
   unsigned int oldColumns = GetColumns();
   // resize data array
-  vector< CellData > lost;
+  std::vector< CellData > lost;
   ResizeContainers( rows, columns, lost );
   // calculate if we lost rows or columns
   unsigned int rowsRemoved = 0;
@@ -975,11 +970,11 @@ void TableView::OnInitialize()
 
 void TableView::ResizeContainers( unsigned int rows, unsigned int columns )
 {
-  vector<CellData> ignored;
+  std::vector<CellData> ignored;
   ResizeContainers( rows, columns, ignored );
 }
 
-void TableView::ResizeContainers( unsigned int rows, unsigned int columns, vector<CellData>& removed )
+void TableView::ResizeContainers( unsigned int rows, unsigned int columns, std::vector<CellData>& removed )
 {
   mCellData.Resize( rows, columns, removed );
   // we dont care if these go smaller, data will be regenerated or is not needed anymore
@@ -990,11 +985,11 @@ void TableView::ResizeContainers( unsigned int rows, unsigned int columns, vecto
   mRelativeWidths.resize( columns );
 }
 
-void TableView::RemoveAndGetLostActors( const vector<CellData>& lost, vector<Actor>& removed,
+void TableView::RemoveAndGetLostActors( const std::vector<CellData>& lost, std::vector<Actor>& removed,
                                         unsigned int rowsRemoved, unsigned int columnsRemoved )
 {
   // iterate through all lost cells
-  vector< CellData >::const_iterator iter = lost.begin();
+  std::vector< CellData >::const_iterator iter = lost.begin();
   for( ; iter != lost.end(); ++iter )
   {
     // if it is a valid actor
@@ -1170,12 +1165,12 @@ void TableView::SetHeightOrWidthProperty(TableView& tableViewImpl,
     {
       Property::Value& item = map.GetValue(i);
 
-      if( istringstream(map.GetKey(i)) >> rowIndex  // the key is a number
+      if( std::istringstream(map.GetKey(i)) >> rowIndex  // the key is a number
           && Property::MAP == item.GetType())
       {
         if( item.HasKey( "policy" ) && item.HasKey( "value" ) )
         {
-          Toolkit::TableView::LayoutPolicy policy = Scripting::GetEnumeration< Toolkit::TableView::LayoutPolicy >( item.GetValue("policy").Get<string>(), LAYOUT_POLICY_STRING_TABLE, LAYOUT_POLICY_STRING_TABLE_COUNT );
+          Toolkit::TableView::LayoutPolicy policy = Scripting::GetEnumeration< Toolkit::TableView::LayoutPolicy >( item.GetValue("policy").Get<std::string>(), LAYOUT_POLICY_STRING_TABLE, LAYOUT_POLICY_STRING_TABLE_COUNT );
           if( policy == Toolkit::TableView::Fixed )
           {
             (tableViewImpl.*funcFixed)( rowIndex, item.GetValue("value").Get<float>() );
@@ -1206,29 +1201,25 @@ Property::Value TableView::GetColumnWidthsPropertyValue()
 
 void TableView::GetMapPropertyValue( const std::vector<float>& fixedSize, const std::vector<float>& relativeSize, Property::Map& map )
 {
-  string fixedPolicy( Scripting::GetEnumerationName< Toolkit::TableView::LayoutPolicy >( Toolkit::TableView::Fixed, LAYOUT_POLICY_STRING_TABLE, LAYOUT_POLICY_STRING_TABLE_COUNT ) );
-  string relativePolicy( Scripting::GetEnumerationName< Toolkit::TableView::LayoutPolicy >( Toolkit::TableView::Relative, LAYOUT_POLICY_STRING_TABLE, LAYOUT_POLICY_STRING_TABLE_COUNT ) );
-  Property::StringValuePair fixedPolicyPair( "policy", fixedPolicy );
-  Property::StringValuePair relativePolicyPair( "policy", relativePolicy );
+  std::string fixedPolicy( Scripting::GetEnumerationName< Toolkit::TableView::LayoutPolicy >( Toolkit::TableView::Fixed, LAYOUT_POLICY_STRING_TABLE, LAYOUT_POLICY_STRING_TABLE_COUNT ) );
+  std::string relativePolicy( Scripting::GetEnumerationName< Toolkit::TableView::LayoutPolicy >( Toolkit::TableView::Relative, LAYOUT_POLICY_STRING_TABLE, LAYOUT_POLICY_STRING_TABLE_COUNT ) );
 
   size_t count = fixedSize.size();
   for( size_t index = 0; index < count; index++ )
   {
     if( ! EqualsZero( fixedSize[index] ) )
     {
-      Property::StringValuePair valuePair( "value", fixedSize[index] );
       Property::Map item;
-      item[ fixedPolicyPair.first ] = fixedPolicyPair.second;
-      item[ valuePair.first ] = valuePair.second;
+      item[ "policy" ] = fixedPolicy;
+      item[ "value" ] = fixedSize[index];
 
       map[ static_cast<std::ostringstream*>( &(std::ostringstream() << index ) )->str() ] = item;
     }
     else if( ! EqualsZero( relativeSize[index] ) )
     {
-      Property::StringValuePair valuePair( "value", relativeSize[index] );
       Property::Map item;
-      item[ relativePolicyPair.first ] = relativePolicyPair.second;
-      item[ valuePair.first ] = valuePair.second;
+      item[ "policy" ] = relativePolicy;
+      item[ "value" ] = relativeSize[index];
 
       map[ static_cast<std::ostringstream*>( &(std::ostringstream() << index ) )->str() ] = item;
     }
index 9882c1e..90dd6d5 100644 (file)
@@ -37,7 +37,6 @@
 #include <dali-toolkit/public-api/controls/alignment/alignment.h>
 #include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
 
-using namespace std;
 using namespace Dali;
 
 // Local Data
@@ -4177,7 +4176,7 @@ bool TextInput::ReturnClosestIndex(const Vector2& source, std::size_t& closestIn
         ++closestIndex;
       }
     }
-    else if( closestIndex == numeric_limits<std::size_t>::max() ) // -1 RTL (after last arabic character on line)
+    else if( closestIndex == std::numeric_limits<std::size_t>::max() ) // -1 RTL (after last arabic character on line)
     {
       closestIndex = mTextLayoutInfo.mCharacterVisualToLogicalMap.size();
     }
index d82c8db..63c82fe 100644 (file)
@@ -25,7 +25,6 @@
 #include <dali-toolkit/public-api/controls/buttons/push-button.h>
 #include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
 
-using namespace std;
 using namespace Dali;
 
 #define GET_LOCALE_TEXT(string) dgettext("sys_string", string)
index 95ee8c3..cce79c0 100644 (file)
@@ -24,7 +24,6 @@
 
 using namespace Dali;
 using namespace Dali::Toolkit;
-using namespace std;
 
 namespace // unnamed namespace
 {
@@ -60,7 +59,7 @@ struct GetColumnPositionDefaultFunction
                    float layoutWidth)
   {
     // Share the available space between margins & column spacings
-    float availableSpace = max(0.0f, (layoutWidth - itemSize.width*numberOfColumns));
+    float availableSpace = std::max(0.0f, (layoutWidth - itemSize.width*numberOfColumns));
 
     float leftMargin = availableSpace/numberOfColumns * 0.5f;
 
@@ -312,7 +311,7 @@ struct DepthColorConstraint
 
     if (row < 0.0f)
     {
-      darkness = alpha = max(0.0f, 1.0f + row);
+      darkness = alpha = std::max(0.0f, 1.0f + row);
     }
     else
     {
@@ -327,7 +326,7 @@ struct DepthColorConstraint
 
       if (row > (mNumberOfRows-1.0f))
       {
-        alpha = max(0.0f, 1.0f - (row-(mNumberOfRows-1.0f)));
+        alpha = std::max(0.0f, 1.0f - (row-(mNumberOfRows-1.0f)));
       }
     }
 
@@ -551,8 +550,8 @@ ItemRange DepthLayout::GetItemsWithinArea(float firstItemPosition, Vector3 layou
   float firstRow = -(firstItemPosition/mImpl->mNumberOfColumns);
   float lastRow = firstRow + mImpl->mNumberOfRows * 0.5f;
 
-  unsigned int firstItem = static_cast<unsigned int>(max(0.0f, firstRow * mImpl->mNumberOfColumns));
-  unsigned int lastItem  = static_cast<unsigned int>(max(0.0f, lastRow  * mImpl->mNumberOfColumns));
+  unsigned int firstItem = static_cast<unsigned int>(std::max(0.0f, firstRow * mImpl->mNumberOfColumns));
+  unsigned int lastItem  = static_cast<unsigned int>(std::max(0.0f, lastRow  * mImpl->mNumberOfColumns));
 
   return ItemRange(firstItem, lastItem+1);
 }
index cd36304..efb16e2 100644 (file)
@@ -24,7 +24,6 @@
 
 using namespace Dali;
 using namespace Dali::Toolkit;
-using namespace std;
 
 namespace // unnamed namespace
 {
@@ -620,8 +619,8 @@ void GridLayout::GetResizeAnimation(Animation& animation, Actor actor, Vector3 s
     Vector3 currentSize( actor.GetCurrentSize() );
     Vector3 shrink( currentSize );
 
-    shrink.width = min(size.width, currentSize.width);
-    shrink.height = min(size.height, currentSize.height);
+    shrink.width = std::min(size.width, currentSize.width);
+    shrink.height = std::min(size.height, currentSize.height);
 
     // Do a nonlinear size animation to shrink the actor first when the actor size changes,
     // so that we can avoid the actors overlapping during orientation change.
index f492280..d415d5e 100755 (executable)
@@ -20,7 +20,6 @@
 #include <dali-toolkit/public-api/controls/scrollable/item-view/navigation-layout.h>
 using namespace Dali;
 using namespace Dali::Toolkit;
-using namespace std;
 
 namespace // unnamed namespace
 {
index 65986db..966b665 100644 (file)
@@ -24,7 +24,6 @@
 
 using namespace Dali;
 using namespace Dali::Toolkit;
-using namespace std;
 
 namespace // unnamed namespace
 {
@@ -69,13 +68,13 @@ struct RollPositionConstraint0
     }
     else
     {
-      float yStep = max(50.0f, min(itemSize.y, scrollSpeedFactor));
+      float yStep = std::max(50.0f, std::min(itemSize.y, scrollSpeedFactor));
       y = adjustedLayoutPosition < Math::MACHINE_EPSILON_0 ? adjustedLayoutPosition * yStep : (layoutSize.height * 0.5f + adjustedRowSpacing) + (adjustedLayoutPosition - 1.0f) * yStep;
       y += itemSize.y * 0.5f - layoutSize.height * 0.5f;
     }
 
     float z = adjustedLayoutPosition * (10.0f + scrollSpeedFactor);
-    z -= min(3000.0f, scrollSpeedFactor * 2.0f);
+    z -= std::min(3000.0f, scrollSpeedFactor * 2.0f);
 
     return Vector3(itemSize.x * 0.5f - layoutSize.x * 0.5f, y, z);
   }
@@ -112,13 +111,13 @@ struct RollPositionConstraint90
     }
     else
     {
-      float xStep = max(50.0f, min(itemSize.y, scrollSpeedFactor));
+      float xStep = std::max(50.0f, std::min(itemSize.y, scrollSpeedFactor));
       x = adjustedLayoutPosition < Math::MACHINE_EPSILON_0 ? adjustedLayoutPosition * xStep : (layoutSize.width * 0.5f + adjustedRowSpacing) + (adjustedLayoutPosition - 1.0f) * xStep;
       x += itemSize.y * 0.5f - layoutSize.width * 0.5f;
     }
 
     float z = adjustedLayoutPosition * (10.0f + scrollSpeedFactor);
-    z -= min(3000.0f, scrollSpeedFactor * 2.0f);
+    z -= std::min(3000.0f, scrollSpeedFactor * 2.0f);
 
     return Vector3(x, itemSize.x * 0.5f - layoutSize.y * 0.5f, z);
   }
@@ -155,13 +154,13 @@ struct RollPositionConstraint180
     }
     else
     {
-      float yStep = max(50.0f, min(itemSize.y, scrollSpeedFactor));
+      float yStep = std::max(50.0f, std::min(itemSize.y, scrollSpeedFactor));
       y = adjustedLayoutPosition < Math::MACHINE_EPSILON_0 ? adjustedLayoutPosition * yStep : (layoutSize.height * 0.5f + adjustedRowSpacing) + (adjustedLayoutPosition - 1.0f) * yStep;
       y += itemSize.y * 0.5f - layoutSize.height * 0.5f;
     }
 
     float z = adjustedLayoutPosition * (10.0f + scrollSpeedFactor);
-    z -= min(3000.0f, scrollSpeedFactor * 2.0f);
+    z -= std::min(3000.0f, scrollSpeedFactor * 2.0f);
 
 
     return Vector3(-(itemSize.x * 0.5f - layoutSize.x * 0.5f),
@@ -201,13 +200,13 @@ struct RollPositionConstraint270
     }
     else
     {
-      float xStep = max(50.0f, min(itemSize.y, scrollSpeedFactor));
+      float xStep = std::max(50.0f, std::min(itemSize.y, scrollSpeedFactor));
       x = adjustedLayoutPosition < Math::MACHINE_EPSILON_0 ? adjustedLayoutPosition * xStep : (layoutSize.width * 0.5f + adjustedRowSpacing) + (adjustedLayoutPosition - 1.0f) * xStep;
       x += itemSize.y * 0.5f - layoutSize.width * 0.5f;
     }
 
     float z = adjustedLayoutPosition * (10.0f + scrollSpeedFactor);
-    z -= min(3000.0f, scrollSpeedFactor * 2.0f);
+    z -= std::min(3000.0f, scrollSpeedFactor * 2.0f);
 
     return Vector3(-x,
                    itemSize.x * 0.5f - layoutSize.y * 0.5f,
@@ -267,10 +266,10 @@ struct RollScaleConstraint
       factor = adjustedLayoutPosition - 1.0f;
     }
 
-    float scale = min(1.0f, max(0.1f, 1.0f - 0.1f * factor));
+    float scale = std::min(1.0f, std::max(0.1f, 1.0f - 0.1f * factor));
     if(scrollSpeed > 0.0f)
     {
-      scale *= min(1.0f, max(0.1f, 1.0f / (scrollSpeed * 0.05f)));
+      scale *= std::min(1.0f, std::max(0.1f, 1.0f / (scrollSpeed * 0.05f)));
     }
 
     return Vector3(scale, scale, scale);
@@ -293,8 +292,8 @@ struct RollColorConstraint
       factor = adjustedLayoutPosition - 1.0f;
     }
 
-    float darkness = min(1.0f, max(0.5f, 1.0f - 0.5f * factor));
-    float alpha = min(1.0f, max(0.0f, 1.0f - 0.9f * factor));
+    float darkness = std::min(1.0f, std::max(0.5f, 1.0f - 0.5f * factor));
+    float alpha = std::min(1.0f, std::max(0.0f, 1.0f - 0.9f * factor));
     return Vector4(darkness, darkness, darkness, alpha);
   }
 };
index 80eda13..471574c 100644 (file)
@@ -24,7 +24,6 @@
 
 using namespace Dali;
 using namespace Dali::Toolkit;
-using namespace std;
 
 namespace // unnamed namespace
 {
@@ -372,7 +371,7 @@ void SpiralLayout::SetItemSpacing(Radian itemSpacing)
 {
   mImpl->mItemSpacingRadians = itemSpacing;
 
-  float itemsPerSpiral = max(1.0f, (2.0f*(float)Math::PI) / mImpl->mItemSpacingRadians);
+  float itemsPerSpiral = std::max(1.0f, (2.0f*(float)Math::PI) / mImpl->mItemSpacingRadians);
   mImpl->mItemDescent = mImpl->mRevolutionDistance / itemsPerSpiral;
 }
 
@@ -385,7 +384,7 @@ void SpiralLayout::SetRevolutionDistance(float distance)
 {
   mImpl->mRevolutionDistance = distance;
 
-  float itemsPerSpiral = max(1.0f, (2.0f*(float)Math::PI) / mImpl->mItemSpacingRadians);
+  float itemsPerSpiral = std::max(1.0f, (2.0f*(float)Math::PI) / mImpl->mItemSpacingRadians);
   mImpl->mItemDescent = mImpl->mRevolutionDistance / itemsPerSpiral;
 }
 
@@ -464,10 +463,10 @@ ItemRange SpiralLayout::GetItemsWithinArea(float firstItemPosition, Vector3 layo
   float layoutHeight = IsHorizontal(mOrientation) ? layoutSize.width : layoutSize.height;
   float itemsPerSpiral = layoutHeight / mImpl->mItemDescent;
   float itemsCachedBeforeTopItem = layoutHeight * (mImpl->mTopItemAlignment + 0.5f) / mImpl->mItemDescent;
-  float itemsViewable = min(itemsPerSpiral, itemsPerSpiral - itemsCachedBeforeTopItem - firstItemPosition + 1.0f);
+  float itemsViewable = std::min(itemsPerSpiral, itemsPerSpiral - itemsCachedBeforeTopItem - firstItemPosition + 1.0f);
 
-  unsigned int firstItem = static_cast<unsigned int>(max(0.0f, -firstItemPosition - itemsCachedBeforeTopItem - 1.0f));
-  unsigned int lastItem  = static_cast<unsigned int>(max(0.0f, firstItem + itemsViewable));
+  unsigned int firstItem = static_cast<unsigned int>(std::max(0.0f, -firstItemPosition - itemsCachedBeforeTopItem - 1.0f));
+  unsigned int lastItem  = static_cast<unsigned int>(std::max(0.0f, firstItem + itemsViewable));
 
   return ItemRange(firstItem, lastItem+1);
 }
index b2f88cf..e53c0b5 100644 (file)
@@ -27,7 +27,6 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/cluster/cluster-style.h>
 
-using namespace std;
 using namespace Dali;
 
 namespace // unnamed namespace
index dac574e..a95ee7c 100644 (file)
@@ -27,8 +27,6 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/selectors/rotating-selector.h>
 
-using namespace std;
-
 namespace
 {
 const float TOUCH_OPACITY_THRESHOLD = 0.1f;
index baef732..76db7ca 100755 (executable)
@@ -28,7 +28,6 @@
 #include <sstream>
 
 using namespace Dali;
-using namespace std;
 
 namespace Dali
 {
@@ -384,7 +383,7 @@ void Slider::DisplayValue( float value, bool raiseSignals )
   {
     std::stringstream ss;
     ss.precision( GetValuePrecision() );
-    ss << fixed << clampledValue;
+    ss << std::fixed << clampledValue;
     mHandleValueTextView.SetText( ss.str() );
   }
 }
@@ -1052,7 +1051,7 @@ void Slider::DisplayPopup( float value )
   {
     std::stringstream ss;
     ss.precision( GetValuePrecision() );
-    ss << fixed << value;
+    ss << std::fixed << value;
     mValueTextView.SetText( ss.str() );
     TextStyle style;
     style.SetTextColor( GetPopupTextColor() );