return ss.str();
}
-
-std::string PropertyValueToString( const Property::Value& value )
-{
- std::string ret;
-
- switch( value.GetType() )
- {
- case Property::NONE:
- {
- ret = "NONE";
- break;
- } ///< No type
- case Property::BOOLEAN:
- {
- ret = value.Get<bool>() ? "True" : "False";
- break;
- }
- case Property::FLOAT:
- {
-
- ret = ToString( value.Get<float>() );
- break;
- }
- case Property::INTEGER:
- {
- ret = ToString( value.Get<int>() );
- break;
- }
- case Property::UNSIGNED_INTEGER:
- {
- ret = ToString( value.Get<unsigned int>() );
- break;
- }
- case Property::VECTOR2:
- {
- ret = ToString( value.Get<Vector2>() );
- break;
- }
- case Property::VECTOR3:
- {
- ret = ToString( value.Get<Vector3>() );
- break;
- }
- case Property::VECTOR4:
- {
- ret = ToString( value.Get<Vector4>() );
- break;
- }
- case Property::MATRIX3:
- {
- ret = ToString( value.Get<Matrix3>() );
- break;
- }
- case Property::MATRIX:
- {
- ret = ToString( value.Get<Matrix>() );
- break;
- }
- case Property::RECTANGLE:
- {
- ret = ToString( value.Get< Rect<int> >() );
- break;
- }
- case Property::ROTATION:
- {
- break;
- }
- case Property::STRING:
- {
- ret = value.Get<std::string>();
- break;
- }
- case Property::ARRAY:
- {
- ret = std::string("Array Size=") + ToString( value.Get<Property::Array>().size() );
- break;
- }
- case Property::MAP:
- {
- ret = std::string("Map Size=") + ToString( value.Get<Property::Map>().size() );
- break;
- }
- case Property::TYPE_COUNT:
- {
- ret = "";
- break;
- }
- }
-
- return ret;
-}
-
/*
* Recursively collects all stylesin a node (An array of style names).
*
SelectionFinished ///< Finished selected section
};
-/**
- * Whether the given style is the default style or not.
- * @param[in] style The given style.
- * @return \e true if the given style is the default. Otherwise it returns \e false.
- */
-bool IsDefaultStyle( const TextStyle& style )
-{
- return DEFAULT_TEXT_STYLE == style;
-}
-
-/**
- * Whether the given styled text is using the default style or not.
- * @param[in] textArray The given text.
- * @return \e true if the given styled text is using the default style. Otherwise it returns \e false.
- */
-bool IsTextDefaultStyle( const Toolkit::MarkupProcessor::StyledTextArray& textArray )
-{
- for( Toolkit::MarkupProcessor::StyledTextArray::const_iterator it = textArray.begin(), endIt = textArray.end(); it != endIt; ++it )
- {
- const TextStyle& style( (*it).mStyle );
-
- if( !IsDefaultStyle( style ) )
- {
- return false;
- }
- }
-
- return true;
-}
-
std::size_t FindVisibleCharacterLeft( std::size_t cursorPosition, const Toolkit::TextView::CharacterLayoutInfoContainer& characterLayoutInfoTable )
{
for( Toolkit::TextView::CharacterLayoutInfoContainer::const_reverse_iterator it = characterLayoutInfoTable.rbegin() + characterLayoutInfoTable.size() - cursorPosition, endIt = characterLayoutInfoTable.rend();
return seed;
}
-float genRandomFloat(unsigned int& seed, unsigned int offset)
-{
- return static_cast<float>(genRandom(seed, offset)) / 0xffffffff;
-}
-
float genRandomFloat(unsigned int& seed, unsigned int offset, float min, float max)
{
const float f = static_cast<float>(genRandom(seed, offset)) / 0xffffffff;
}
};
-/**
- * Returns relative border (0.0f...1.0f x 0.0f...1.0f)
- * from an absolute pixel specified border.
- * @param[in] absolute A border using absolute pixel coordinates
- * @param[in] width The width of the texture
- * @param[in] height The height of the texture.
- * @return A border relative to the size of the Image texture dimensions.
- */
-Vector4 GetRelativeBorder(Vector4 absolute, float width, float height)
-{
- return Vector4( absolute.x / width,
- absolute.y / height,
- absolute.z / width,
- absolute.w / height);
-}
-
}
namespace Dali