#include <dali-toolkit/public-api/focus-manager/focus-manager.h>
using namespace Dali;
-using namespace std;
namespace
{
using namespace Dali;
using namespace Dali::Toolkit;
-using namespace std;
namespace // unnamed namespace
{
// 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
{
}
// 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
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();
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();
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;
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
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
{
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>() );
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;
}
#include <dali-toolkit/public-api/controls/alignment/alignment.h>
using namespace Dali;
-using namespace std;
namespace
{
#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
++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();
}
#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)
// INTERNAL INCLUDES
using namespace Dali;
-using namespace std;
namespace
{
using namespace Dali;
using namespace Dali::Toolkit;
-using namespace std;
namespace // unnamed namespace
{
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;
if (row < 0.0f)
{
- darkness = alpha = max(0.0f, 1.0f + row);
+ darkness = alpha = std::max(0.0f, 1.0f + row);
}
else
{
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)));
}
}
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);
}
using namespace Dali;
using namespace Dali::Toolkit;
-using namespace std;
namespace // unnamed namespace
{
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.
#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
{
using namespace Dali;
using namespace Dali::Toolkit;
-using namespace std;
namespace // unnamed namespace
{
}
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);
}
}
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);
}
}
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),
}
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,
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);
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);
}
};
using namespace Dali;
using namespace Dali::Toolkit;
-using namespace std;
namespace // unnamed namespace
{
{
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;
}
{
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;
}
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);
}
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/cluster/cluster-style.h>
-using namespace std;
using namespace Dali;
namespace // unnamed namespace
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/selectors/rotating-selector.h>
-using namespace std;
-
namespace
{
const float TOUCH_OPACITY_THRESHOLD = 0.1f;
#include <sstream>
using namespace Dali;
-using namespace std;
namespace Dali
{
{
std::stringstream ss;
ss.precision( GetValuePrecision() );
- ss << fixed << clampledValue;
+ ss << std::fixed << clampledValue;
mHandleValueTextView.SetText( ss.str() );
}
}
{
std::stringstream ss;
ss.precision( GetValuePrecision() );
- ss << fixed << value;
+ ss << std::fixed << value;
mValueTextView.SetText( ss.str() );
TextStyle style;
style.SetTextColor( GetPopupTextColor() );
using namespace Dali;
using namespace Dali::Toolkit;
-using namespace std;
namespace Dali
{