DALI_TEST_EQUALS( "IMAGE_PATH_1", button.GetProperty( PushButton::PROPERTY_NORMAL_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
Property::Map map;
- map.push_back( Property::StringValuePair( "type", "ImageActor" ) );
+ map[ "type" ] = "ImageActor";
button.SetProperty( PushButton::PROPERTY_NORMAL_STATE_ACTOR, map );
DALI_TEST_EQUALS( "ImageActor", button.GetProperty( PushButton::PROPERTY_NORMAL_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
DALI_TEST_EQUALS( "IMAGE_PATH_2", button.GetProperty( PushButton::PROPERTY_PRESSED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
Property::Map map;
- map.push_back( Property::StringValuePair( "type", "Actor" ) );
+ map[ "type" ] = "Actor";
button.SetProperty( PushButton::PROPERTY_PRESSED_STATE_ACTOR, map );
DALI_TEST_EQUALS( "Actor", button.GetProperty( PushButton::PROPERTY_PRESSED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
DALI_TEST_EQUALS( "IMAGE_PATH_3", button.GetProperty( PushButton::PROPERTY_DIMMED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
Property::Map map;
- map.push_back( Property::StringValuePair( "type", "Actor" ) );
+ map[ "type" ] = "Actor";
button.SetProperty( PushButton::PROPERTY_DIMMED_STATE_ACTOR, map );
DALI_TEST_EQUALS( "Actor", button.GetProperty( PushButton::PROPERTY_DIMMED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
DALI_TEST_EQUALS( "TextView", button.GetProperty( PushButton::PROPERTY_LABEL_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
Property::Map map;
- map.push_back( Property::StringValuePair( "type", "Actor" ) );
+ map[ "type" ] = "Actor";
button.SetProperty( PushButton::PROPERTY_LABEL_ACTOR, map );
DALI_TEST_EQUALS( "Actor", button.GetProperty( PushButton::PROPERTY_LABEL_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
//{ "policy": "fixed", "value": 30.0 },
Property::Map item1;
- item1.push_back( Property::StringValuePair( "policy", "fixed" ) );
- item1.push_back( Property::StringValuePair( "value", 30.f) );
+ item1[ "policy" ] = "fixed";
+ item1[ "value" ] = 30.f;
//{ "policy": "relative", "value": 0.2 },
Property::Map item2;
- item2.push_back( Property::StringValuePair( "policy", "relative" ) );
- item2.push_back( Property::StringValuePair( "value", 0.2f ) );
+ item2[ "policy" ] = "relative";
+ item2[ "value" ] = 0.2f;
// Test "layout-rows" property
DALI_TEST_CHECK( tableView.GetPropertyIndex(PROPERTY_NAME_LAYOUT_ROWS) == TableView::PROPERTY_LAYOUT_ROWS );
* }
*/
Property::Map layoutRows;
- layoutRows.push_back( Property::StringValuePair("1", item1) );
- layoutRows.push_back( Property::StringValuePair("3", item2) );
+ layoutRows[ "1" ] = item1;
+ layoutRows[ "3" ] = item2;
tableView.SetProperty( TableView::PROPERTY_LAYOUT_ROWS, layoutRows );
DALI_TEST_EQUALS( tableView.GetFixedHeight( 1u ), 30.f, TEST_LOCATION );
DALI_TEST_EQUALS( tableView.GetRelativeHeight( 3u ), 0.2f, TEST_LOCATION );
Property::Map layoutRowsGet = tableView.GetProperty(TableView::PROPERTY_LAYOUT_ROWS).Get<Property::Map>();
- DALI_TEST_CHECK( layoutRowsGet[0].first.compare(layoutRows[0].first) == 0 );
- DALI_TEST_CHECK( layoutRowsGet[0].second.GetValue( "policy" ).Get<std::string>().compare(layoutRows[0].second.GetValue( "policy" ).Get<std::string>()) == 0 );
- DALI_TEST_EQUALS( layoutRowsGet[0].second.GetValue( "value" ).Get<float>(),layoutRows[0].second.GetValue( "value" ).Get<float>(), TEST_LOCATION );
- DALI_TEST_CHECK( layoutRowsGet[1].first.compare(layoutRows[1].first) == 0 );
- DALI_TEST_CHECK( layoutRowsGet[1].second.GetValue( "policy" ).Get<std::string>().compare(layoutRows[1].second.GetValue( "policy" ).Get<std::string>()) == 0 );
- DALI_TEST_EQUALS( layoutRowsGet[1].second.GetValue( "value" ).Get<float>(),layoutRows[1].second.GetValue( "value" ).Get<float>(), TEST_LOCATION );
+ DALI_TEST_CHECK( layoutRowsGet.GetKey(0).compare(layoutRows.GetKey(0)) == 0 );
+ DALI_TEST_CHECK( layoutRowsGet.GetValue(0).GetValue( "policy" ).Get<std::string>().compare(layoutRows.GetValue(0).GetValue( "policy" ).Get<std::string>()) == 0 );
+ DALI_TEST_EQUALS( layoutRowsGet.GetValue(0).GetValue( "value" ).Get<float>(),layoutRows.GetValue(0).GetValue( "value" ).Get<float>(), TEST_LOCATION );
+ DALI_TEST_CHECK( layoutRowsGet.GetKey(1).compare(layoutRows.GetKey(1)) == 0 );
+ DALI_TEST_CHECK( layoutRowsGet.GetValue(1).GetValue( "policy" ).Get<std::string>().compare(layoutRows.GetValue(1).GetValue( "policy" ).Get<std::string>()) == 0 );
+ DALI_TEST_EQUALS( layoutRowsGet.GetValue(1).GetValue( "value" ).Get<float>(),layoutRows.GetValue(1).GetValue( "value" ).Get<float>(), TEST_LOCATION );
// Test "layout-columns" property
DALI_TEST_CHECK( tableView.GetPropertyIndex( PROPERTY_NAME_LAYOUT_COLUMNS ) == TableView::PROPERTY_LAYOUT_COLUMNS );
* }
*/
Property::Map layoutColumns;
- layoutColumns.push_back( Property::StringValuePair("2", item2) );
- layoutColumns.push_back( Property::StringValuePair("3", item1) );
+ layoutColumns[ "2" ] = item2;
+ layoutColumns[ "3" ] = item1;
tableView.SetProperty( TableView::PROPERTY_LAYOUT_COLUMNS, layoutColumns );
DALI_TEST_EQUALS( tableView.GetRelativeWidth( 2u ), 0.2f, TEST_LOCATION );
DALI_TEST_EQUALS( tableView.GetFixedWidth( 3u ), 30.f, TEST_LOCATION );
Property::Map layoutColumnsGet = tableView.GetProperty(TableView::PROPERTY_LAYOUT_COLUMNS).Get<Property::Map>();
- DALI_TEST_CHECK( layoutColumnsGet[0].first.compare(layoutColumns[0].first) == 0 );
- DALI_TEST_CHECK( layoutColumnsGet[0].second.GetValue( "policy" ).Get<std::string>().compare(layoutColumns[0].second.GetValue( "policy" ).Get<std::string>()) == 0 );
- DALI_TEST_EQUALS( layoutColumnsGet[0].second.GetValue( "value" ).Get<float>(),layoutColumns[0].second.GetValue( "value" ).Get<float>(), TEST_LOCATION );
- DALI_TEST_CHECK( layoutColumnsGet[1].first.compare(layoutColumns[1].first) == 0 );
- DALI_TEST_CHECK( layoutColumnsGet[1].second.GetValue( "policy" ).Get<std::string>().compare(layoutColumns[1].second.GetValue( "policy" ).Get<std::string>()) == 0 );
- DALI_TEST_EQUALS( layoutColumnsGet[1].second.GetValue( "value" ).Get<float>(),layoutColumns[1].second.GetValue( "value" ).Get<float>(), TEST_LOCATION );
+ DALI_TEST_CHECK( layoutColumnsGet.GetKey(0).compare(layoutColumns.GetKey(0)) == 0 );
+ DALI_TEST_CHECK( layoutColumnsGet.GetValue(0).GetValue( "policy" ).Get<std::string>().compare(layoutColumns.GetValue(0).GetValue( "policy" ).Get<std::string>()) == 0 );
+ DALI_TEST_EQUALS( layoutColumnsGet.GetValue(0).GetValue( "value" ).Get<float>(),layoutColumns.GetValue(0).GetValue( "value" ).Get<float>(), TEST_LOCATION );
+ DALI_TEST_CHECK( layoutColumnsGet.GetKey(1).compare(layoutColumns.GetKey(1)) == 0 );
+ DALI_TEST_CHECK( layoutColumnsGet.GetValue(1).GetValue( "policy" ).Get<std::string>().compare(layoutColumns.GetValue(1).GetValue( "policy" ).Get<std::string>()) == 0 );
+ DALI_TEST_EQUALS( layoutColumnsGet.GetValue(1).GetValue( "value" ).Get<float>(),layoutColumns.GetValue(1).GetValue( "value" ).Get<float>(), TEST_LOCATION );
END_TEST;
}
DALI_TEST_CHECK( !control.GetBackgroundActor() );
DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::TRANSPARENT, TEST_LOCATION );
DALI_TEST_EQUALS( control.GetProperty( Control::PROPERTY_BACKGROUND_COLOR ).Get< Vector4 >(), Color::TRANSPARENT, TEST_LOCATION );
- DALI_TEST_CHECK( control.GetProperty( Control::PROPERTY_BACKGROUND ).Get< Property::Map >().empty() );
+ DALI_TEST_CHECK( control.GetProperty( Control::PROPERTY_BACKGROUND ).Get< Property::Map >().Empty() );
control.SetProperty( Control::PROPERTY_BACKGROUND_COLOR, Color::RED );
DALI_TEST_CHECK( control.GetBackgroundActor() );
DALI_TEST_EQUALS( control.GetProperty( Control::PROPERTY_BACKGROUND_COLOR ).Get< Vector4 >(), Color::RED, TEST_LOCATION );
Property::Map imageMap;
- imageMap.push_back( Property::StringValuePair( "filename", "TestImage" ) );
+ imageMap[ "filename" ] = "TestImage";
Property::Map map;
- map.push_back( Property::StringValuePair( "image", imageMap ) );
+ map[ "image" ] = imageMap;
control.SetProperty( Control::PROPERTY_BACKGROUND, map );
DALI_TEST_CHECK( control.GetBackgroundActor() );
DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::RED, TEST_LOCATION );
DALI_TEST_CHECK( !control.GetBackgroundActor() );
DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::TRANSPARENT, TEST_LOCATION );
DALI_TEST_EQUALS( control.GetProperty( Control::PROPERTY_BACKGROUND_COLOR ).Get< Vector4 >(), Color::TRANSPARENT, TEST_LOCATION );
- DALI_TEST_CHECK( control.GetProperty( Control::PROPERTY_BACKGROUND ).Get< Property::Map >().empty() );
+ DALI_TEST_CHECK( control.GetProperty( Control::PROPERTY_BACKGROUND ).Get< Property::Map >().Empty() );
END_TEST;
}
}
case Property::MAP:
{
- ret = std::string("Map Size=") + ToString( value.Get<Property::Map>().size() );
+ ret = std::string("Map Size=") + ToString( value.Get<Property::Map>().Count() );
break;
}
case Property::TYPE_COUNT:
{
DALI_ASSERT_ALWAYS(mParser.GetRoot() && "Builder script not loaded");
- PropertyValueMap overrideMap;
+ Property::Map overrideMap;
Replacement replacements(overrideMap, mReplacementMap);
OptionalChild add = IsChild(*mParser.GetRoot(), sectionName);
return anim;
}
-Animation Builder::CreateAnimation( const std::string& animationName, const PropertyValueMap& map, Dali::Actor sourceActor )
+Animation Builder::CreateAnimation( const std::string& animationName, const Property::Map& map, Dali::Actor sourceActor )
{
Replacement replacement(map, mReplacementMap);
return CreateAnimation( animationName, replacement, sourceActor);
}
-Animation Builder::CreateAnimation( const std::string& animationName, const PropertyValueMap& map )
+Animation Builder::CreateAnimation( const std::string& animationName, const Property::Map& map )
{
Replacement replacement(map, mReplacementMap);
return CreateAnimation( animationName, replacement, Stage::GetCurrent().GetRootLayer() );
}
-void Builder::AddConstants( const PropertyValueMap& map )
+void Builder::AddConstants( const Property::Map& map )
{
- for(PropertyValueMap::const_iterator iter = map.begin(); iter != map.end(); ++iter)
- {
- mReplacementMap[ (*iter).first ] = (*iter).second;
- }
+ mReplacementMap.Merge( map );
}
void Builder::AddConstant( const std::string& key, const Property::Value& value )
mReplacementMap[key] = value;
}
-const PropertyValueMap& Builder::GetConstants() const
+const Property::Map& Builder::GetConstants() const
{
return mReplacementMap;
}
const Property::Value& Builder::GetConstant( const std::string& key ) const
{
- PropertyValueMap::const_iterator iter = mReplacementMap.find( key );
- if( iter != mReplacementMap.end() )
+ Property::Value* match = mReplacementMap.Find( key );
+ if( match )
{
- return (*iter).second;
+ return (*match);
}
else
{
}
}
-void Builder::LoadConstants( const TreeNode& root, PropertyValueMap& intoMap )
+void Builder::LoadConstants( const TreeNode& root, Property::Map& intoMap )
{
Replacement replacer(intoMap);
}
#if defined(DEBUG_ENABLED)
- PropertyValueMap::const_iterator iter = intoMap.find( "CONFIG_SCRIPT_LOG_LEVEL" );
- if( iter != intoMap.end() && (*iter).second.GetType() == Property::STRING )
+ Property::Value* iter = intoMap.Find( "CONFIG_SCRIPT_LOG_LEVEL" );
+ if( iter && iter->GetType() == Property::STRING )
{
- std::string logLevel( (*iter).second.Get< std::string >() );
+ std::string logLevel( iter->Get< std::string >() );
if( logLevel == "NoLogging" )
{
gFilterScript->SetLogLevel( Integration::Log::NoLogging );
}
}
-BaseHandle Builder::Create( const std::string& templateName, const PropertyValueMap& map )
+BaseHandle Builder::Create( const std::string& templateName, const Property::Map& map )
{
Replacement replacement( map, mReplacementMap );
return Create( templateName, replacement );
/**
* @copydoc Toolkit::Builder::AddConstants
*/
- void AddConstants( const PropertyValueMap& map );
+ void AddConstants( const Property::Map& map );
/**
* @copydoc Toolkit::Builder::AddConstant
/**
* @copydoc Toolkit::Builder::GetConstants
*/
- const PropertyValueMap& GetConstants() const;
+ const Property::Map& GetConstants() const;
/**
* @copydoc Toolkit::Builder::GetConstant
Animation CreateAnimation( const std::string& animationName );
/**
- * @copydoc Toolkit::Builder::CreateAnimation( const std::string& animationName, const PropertyValueMap& map );
+ * @copydoc Toolkit::Builder::CreateAnimation( const std::string& animationName, const Property::Map& map );
*/
- Animation CreateAnimation( const std::string& animationName, const PropertyValueMap& map );
+ Animation CreateAnimation( const std::string& animationName, const Property::Map& map );
/**
* @copydoc Toolkit::Builder::CreateAnimation( const std::string&,Dali::Actor);
Animation CreateAnimation( const std::string& animationName, Dali::Actor sourceActor );
/**
- * @copydoc Toolkit::Builder::CreateAnimation( const std::string&,const PropertyValueMap&,Dali::Actor);
+ * @copydoc Toolkit::Builder::CreateAnimation( const std::string&,const Property::Map&, Dali::Actor);
*/
- Animation CreateAnimation( const std::string& animationName, const PropertyValueMap& map, Dali::Actor sourceActor );
+ Animation CreateAnimation( const std::string& animationName, const Property::Map& map, Dali::Actor sourceActor );
/**
* @copydoc Toolkit::Builder::Create( const std::string& templateName );
BaseHandle Create( const std::string& templateName );
/**
- * @copydoc Toolkit::Builder::Create( const std::string& templateName, const PropertyValueMap& map );
+ * @copydoc Toolkit::Builder::Create( const std::string& templateName, const Property::Map& map );
*/
- BaseHandle Create( const std::string& templateName, const PropertyValueMap& map );
+ BaseHandle Create( const std::string& templateName, const Property::Map& map );
/**
* @copydoc Toolkit::Builder::CreateFromJson( const std::string& json );
SlotDelegate<Builder> mSlotDelegate;
- PropertyValueMap mReplacementMap;
+ Property::Map mReplacementMap;
BaseHandle Create( const std::string& templateName, const Replacement& constant );
BaseHandle DoCreate( const TreeNode& root, const TreeNode& node, Actor parent, const Replacement& replacements );
- void LoadConstants( const TreeNode& root, PropertyValueMap& intoMap );
+ void LoadConstants( const TreeNode& root, Property::Map& intoMap );
void LoadIncludes( const std::string& data );
namespace // anon
{
-PropertyValueMap::const_iterator FindReplacement( const std::string &str,
- const PropertyValueMap& overrideMap, const PropertyValueMap& defaultMap )
+Property::Value* FindReplacement( const std::string &str, const Property::Map& overrideMap, const Property::Map& defaultMap )
{
- PropertyValueMap::const_iterator ret = defaultMap.end();
+ Property::Value* ret = overrideMap.Find( str );
- PropertyValueMap::const_iterator iter = overrideMap.find( str );
-
- if( iter != overrideMap.end() )
- {
- ret = iter;
- }
- else
+ if ( !ret )
{
- PropertyValueMap::const_iterator iter = defaultMap.find( str );
+ ret = defaultMap.Find( str );
- if( iter != defaultMap.end() )
- {
- ret = iter;
- }
- else
- {
- // @ todo
- // try localized text ie dgettext. Look for colon {DOMAIN:TEXT} {LC_MESSAGE:ID_XXXX}
-
- }
+ // @ todo
+ // try localized text ie dgettext. Look for colon {DOMAIN:TEXT} {LC_MESSAGE:ID_XXXX}
}
return ret;
}
bool ResolvePartialReplacement( const std::string &initialValue, Property::Value &out,
- const PropertyValueMap& overrideMap, const PropertyValueMap& defaultMap )
+ const Property::Map& overrideMap, const Property::Map& defaultMap )
{
if( initialValue.size() >= 2 )
{
const std::string str( initialValue.substr( startPos, size ) );
- PropertyValueMap::const_iterator iter = FindReplacement( str, overrideMap, defaultMap );
+ Property::Value* value = FindReplacement( str, overrideMap, defaultMap );
- if( iter == defaultMap.end() )
+ if( !value )
{
DALI_SCRIPT_WARNING( "Cannot find replacement for '%s'\n", str.c_str() );
}
else
{
- if( Property::STRING != (*iter).second.GetType() )
+ if( Property::STRING != value->GetType() )
{
DALI_SCRIPT_WARNING( "Cannot replace substring in non string property type='%s'. Initial value '%s'\n",
PropertyTypes::GetName( out.GetType() ), initialValue.c_str() );
{
std::string newString = \
initialValue.substr(0, startPos - 1) +
- (*iter).second.Get<std::string>() +
+ value->Get< std::string >() +
initialValue.substr( startPos + size + 1 );
return ResolvePartialReplacement( newString, out, overrideMap, defaultMap );
} // namespace anon
-Replacement::Replacement( const PropertyValueMap& overrideMap, const PropertyValueMap& defaultMap )
+Replacement::Replacement( const Property::Map& overrideMap, const Property::Map& defaultMap )
: mOverrideMap( &overrideMap ), mDefaultMap( &defaultMap )
{
namespace
{
-PropertyValueMap noMap;
+Property::Map noMap;
}
-Replacement::Replacement( const PropertyValueMap& defaultMap )
+Replacement::Replacement( const Property::Map& defaultMap )
: mOverrideMap( &noMap ), mDefaultMap( &defaultMap )
{
{
OptionalString ret;
- if( node.HasSubstitution() && ((*mOverrideMap).size() || (*mDefaultMap).size()) )
+ if( node.HasSubstitution() && ((*mOverrideMap).Count() || (*mDefaultMap).Count()) )
{
OptionalString v = ::IsString( node );
if( v )
DALI_ASSERT_DEBUG( mOverrideMap && "missing map");
DALI_ASSERT_DEBUG( mDefaultMap && "missing map");
- PropertyValueMap::const_iterator iter = FindReplacement( replacementString, *mOverrideMap, *mDefaultMap );
+ Property::Value* value = FindReplacement( replacementString, *mOverrideMap, *mDefaultMap );
- if( iter == (*mDefaultMap).end() )
+ if( !value )
{
DALI_SCRIPT_WARNING("Cannot find replacement for '%s'\n", replacementString.c_str());
}
else
{
- out = (*iter).second;
+ out = *value;
#if defined(DEBUG_ENABLED)
DALI_SCRIPT_VERBOSE(" Full replacement for '%s' => to Type '%s'\n",
replacementString.c_str(),
}
}
-// template <typename T, OptionalValue<T> (*ISTYPE)( const TreeNode& node ), Property::Type TYPE>
-// OptionalValue<T> IsOfType( const TreeNode& node, const PropertyValueMap& overrideMap, const PropertyValueMap& defaultMap )
-// {
-// OptionalValue<T> ret;
-// if( OptionalString replace = HasFullReplacement( node, overrideMap, defaultMap ) )
-// {
-// Property::Value value = GetFullReplacement( *replace, overrideMap, defaultMap );
-// if( TYPE == value.GetType() )
-// {
-// ret = value.Get<T>();
-// }
-// }
-// else
-// {
-// ret = ISTYPE( node );
-// }
-// return ret;
-
-// }
-
-// OptionalFloat Replacement::IsFloat( const TreeNode & node ) const
-// {
-// return IsOfType<float, ::IsFloat, Property::FLOAT>( node, *mOverrideMap, *mDefaultMap );
-// /* OptionalFloat ret; */
-// /* if( OptionalString replace = HasFullReplacement( node ) ) */
-// /* { */
-// /* Property::Value value = GetFullReplacement( replace ); */
-// /* if( Property::FLOAT == value.GetType() ) */
-// /* { */
-// /* ret = value.Get<float>(); */
-// /* } */
-// /* } */
-// /* else */
-// /* { */
-// /* ret = IsFloat( node ); */
-// /* } */
-// /* return ret; */
-// }
-
OptionalFloat Replacement::IsFloat( const TreeNode & node ) const
{
OptionalFloat ret;
DALI_ASSERT_DEBUG( mOverrideMap && "missing map");
DALI_ASSERT_DEBUG( mDefaultMap && "missing map");
- if( node.HasSubstitution() && ((*mOverrideMap).size() || (*mDefaultMap).size()) )
+ if( node.HasSubstitution() && ((*mOverrideMap).Count() || (*mDefaultMap).Count()) )
{
if( OptionalString v = ::IsString( node ) )
{
* @param overrideMap The user overriding map
* @param defaultMap The default map to use
*/
- Replacement( const PropertyValueMap& overrideMap, const PropertyValueMap& defaultMap );
+ Replacement( const Property::Map& overrideMap, const Property::Map& defaultMap );
/*
* Constructor with default map
* Make a deep copy of the tree.
* @param overrideMap The user overriding map
*/
- Replacement( const PropertyValueMap& defaultMap );
+ Replacement( const Property::Map& defaultMap );
/* @brief Check node for a type
*
private:
// Overriding map (overrides the default map). The map is not owned.
- const PropertyValueMap* const mOverrideMap;
+ const Property::Map* const mOverrideMap;
- // Defautl map. The map is not owned.
- const PropertyValueMap* const mDefaultMap;
+ // Default map. The map is not owned.
+ const Property::Map* const mDefaultMap;
// compiler
// Replacement & operation=( Replacement& replacement );
// EXTERNAL INCLUDES
#include <algorithm>
+#include <dali/public-api/events/mouse-wheel-event.h>
+#include <dali/public-api/common/set-wrapper.h>
// INTERNAL INCLUDES
-#include <dali/public-api/events/mouse-wheel-event.h>
#include <dali-toolkit/public-api/controls/scrollable/item-view/item-factory.h>
#include <dali-toolkit/internal/controls/scrollable/scroll-connector-impl.h>
#include <dali-toolkit/internal/controls/scrollable/bouncing-effect-actor.h>
-using namespace std;
+using std::string;
+using std::set;
using namespace Dali;
namespace // unnamed namespace
mAddingItems = true;
// Insert from lowest id to highest
- set<Item> sortedItems;
+ std::set<Item> sortedItems;
for( ConstItemIter iter = newItems.begin(); newItems.end() != iter; ++iter )
{
sortedItems.insert( *iter );
}
- for( set<Item>::iterator iter = sortedItems.begin(); sortedItems.end() != iter; ++iter )
+ for( std::set<Item>::iterator iter = sortedItems.begin(); sortedItems.end() != iter; ++iter )
{
Self().Add( iter->second );
- cout << "inserting item: " << iter->first << endl;
-
ItemPoolIter foundIter = mItemPool.find( iter->first );
if( mItemPool.end() != foundIter )
{
void ItemView::AddActorsWithinRange( ItemRange range, float durationSeconds )
{
- range.end = min(mItemFactory.GetNumberOfItems(), range.end);
+ range.end = std::min(mItemFactory.GetNumberOfItems(), range.end);
// The order of addition depends on the scroll direction.
if (mRefreshOrderHint)
{
Actor self = Self();
float minLayoutPosition = layout.GetMinimumLayoutPosition(mItemFactory.GetNumberOfItems(), targetSize);
- float clamppedPosition = min(0.0f, max(minLayoutPosition, targetPosition));
+ float clamppedPosition = std::min(0.0f, std::max(minLayoutPosition, targetPosition));
mScrollOvershoot = targetPosition - clamppedPosition;
self.SetProperty(mPropertyMinimumLayoutPosition, minLayoutPosition);
RemoveAnimation(mScrollAnimation);
- float flickAnimationDuration = Clamp( mActiveLayout->GetItemFlickAnimationDuration() * max(1.0f, fabsf(firstItemScrollPosition - GetCurrentLayoutPosition(0)))
+ float flickAnimationDuration = Clamp( mActiveLayout->GetItemFlickAnimationDuration() * std::max(1.0f, fabsf(firstItemScrollPosition - GetCurrentLayoutPosition(0)))
, DEFAULT_MINIMUM_SWIPE_DURATION, DEFAULT_MAXIMUM_SWIPE_DURATION);
mScrollAnimation = Animation::New(flickAnimationDuration);
float positionDelta = GetCurrentLayoutPosition(0) + scrollDistance;
float minLayoutPosition = mActiveLayout->GetMinimumLayoutPosition(mItemFactory.GetNumberOfItems(), Self().GetCurrentSize());
self.SetProperty(mPropertyMinimumLayoutPosition, minLayoutPosition);
- float clamppedPosition = min(0.0f, max(minLayoutPosition, positionDelta));
+ float clamppedPosition = std::min(0.0f, std::max(minLayoutPosition, positionDelta));
overshoot = positionDelta - clamppedPosition;
}
void ScrollView::TransformTo(const Vector3& position,
DirectionBias horizontalBias, DirectionBias verticalBias)
{
- TransformTo(position, mSnapDuration, horizontalBias, verticalBias);
+ TransformTo(position, mSnapDuration, mSnapAlphaFunction, horizontalBias, verticalBias);
}
-void ScrollView::TransformTo(const Vector3& position, float duration,
+void ScrollView::TransformTo(const Vector3& position, float duration, AlphaFunction alpha,
DirectionBias horizontalBias, DirectionBias verticalBias)
{
Actor self( Self() );
mScrollStartedSignalV2.Emit( currentScrollPosition );
bool animating = AnimateTo(-position,
Vector3::ONE * duration,
- mSnapAlphaFunction,
+ alpha,
true,
horizontalBias,
verticalBias,
ScrollTo(position, duration, DirectionBiasNone, DirectionBiasNone);
}
+void ScrollView::ScrollTo(const Vector3& position, float duration, AlphaFunction alpha)
+{
+ ScrollTo(position, duration, alpha, DirectionBiasNone, DirectionBiasNone);
+}
+
void ScrollView::ScrollTo(const Vector3& position, float duration,
DirectionBias horizontalBias, DirectionBias verticalBias)
{
- DALI_LOG_SCROLL_STATE("[0x%X] position[%.2f, %.2f] duration[%.2f]",
- this, position.x, position.y, duration, int(horizontalBias), int(verticalBias));
+ ScrollTo(position, duration, mSnapAlphaFunction, horizontalBias, verticalBias);
+}
- TransformTo(position, duration, horizontalBias, verticalBias);
+void ScrollView::ScrollTo(const Vector3& position, float duration, AlphaFunction alpha,
+ DirectionBias horizontalBias, DirectionBias verticalBias)
+{
+ DALI_LOG_SCROLL_STATE("[0x%X] position[%.2f, %.2f] duration[%.2f]", this, position.x, position.y, duration, int(horizontalBias), int(verticalBias));
+ TransformTo(position, duration, alpha, horizontalBias, verticalBias);
}
void ScrollView::ScrollTo(unsigned int page)
DirectionBias horizontalBias = DirectionBiasNone, DirectionBias verticalBias = DirectionBiasNone);
/**
- * @copydoc ScrollTo(const Vector3&, float, DirectionBias, DirectionBias)
+ * @copydoc ScrollTo(const Vector3&, float, AlhpaFunction, DirectionBias, DirectionBias)
*/
- void TransformTo(const Vector3& position, float duration,
+ void TransformTo(const Vector3& position, float duration, AlphaFunction alpha,
DirectionBias horizontalBias = DirectionBiasNone, DirectionBias verticalBias = DirectionBiasNone);
/**
void ScrollTo(const Vector3& position, float duration);
/**
+ * @copydoc Toolkit::Scrollable::ScrollTo(const Vector3& position, float duration, AlphaFunction alpha)
+ */
+ void ScrollTo(const Vector3& position, float duration, AlphaFunction alpha);
+
+ /**
* @copydoc Toolkit::ScrollView::ScrollTo(const Vector3 &position, float duration, DirectionBias horizontalBias, DirectionBias verticalBias)
*/
void ScrollTo(const Vector3& position, float duration,
DirectionBias horizontalBias, DirectionBias verticalBias);
/**
+ * @copydoc Toolkit::ScrollView::ScrollTo(const Vector3 &position, float duration, AlphaFunction alpha, DirectionBias horizontalBias, DirectionBias verticalBias)
+ */
+ void ScrollTo(const Vector3& position, float duration, AlphaFunction alpha,
+ DirectionBias horizontalBias, DirectionBias verticalBias);
+
+ /**
* @copydoc Toolkit::ScrollView::ScrollTo(unsigned int page)
*/
void ScrollTo(unsigned int page);
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/dali.h>
+#include <dali/public-api/common/map-wrapper.h>
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-component-impl.h>
if( Property::MAP == value.GetType() )
{
Property::Map map = value.Get<Property::Map>();
- unsigned int rowIndex;
- for( Property::Map::const_iterator iter = map.begin(); iter != map.end(); iter++)
+ unsigned int rowIndex(0);
+ for ( unsigned int i = 0, count = map.Count(); i < count; ++i )
{
- if( istringstream(iter->first) >> rowIndex // the key is a number
- && Property::MAP == (iter->second).GetType())
+ Property::Value& item = map.GetValue(i);
+
+ if( istringstream(map.GetKey(i)) >> rowIndex // the key is a number
+ && Property::MAP == item.GetType())
{
- Property::Value item = iter->second;
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 );
{
Property::StringValuePair valuePair( "value", fixedSize[index] );
Property::Map item;
- item.push_back( fixedPolicyPair );
- item.push_back( valuePair );
+ item[ fixedPolicyPair.first ] = fixedPolicyPair.second;
+ item[ valuePair.first ] = valuePair.second;
- map.push_back( Property::StringValuePair( static_cast<std::ostringstream*>( &(std::ostringstream() << index ) )->str(), item ) );
+ 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.push_back( relativePolicyPair );
- item.push_back( valuePair );
+ item[ relativePolicyPair.first ] = relativePolicyPair.second;
+ item[ valuePair.first ] = valuePair.second;
- map.push_back( Property::StringValuePair( static_cast<std::ostringstream*>( &(std::ostringstream() << index ) )->str(), item ) );
+ map[ static_cast<std::ostringstream*>( &(std::ostringstream() << index ) )->str() ] = item;
}
}
}
// EXTERNAL INCLUDES
#include <string>
+#include <dali/dali.h>
+#include <dali/public-api/common/map-wrapper.h>
// INTERNAL INCLUDES
-#include <dali/dali.h>
#include <dali-toolkit/public-api/focus-manager/focus-manager.h>
namespace Dali
#include <dali-toolkit/public-api/controls/control.h>
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali-toolkit/public-api/styling/style-manager.h>
-#include <dali-toolkit/internal/styling/util.h>
#include <dali/integration-api/debug.h>
// EXTERNAL INCLUDES
}
TypeRegistration STYLE_MANAGER_TYPE( typeid(Dali::Toolkit::StyleManager), typeid(Dali::BaseHandle), Create, true /* Create instance at startup */ );
-/**
- * Merge two maps into one
- */
-void MergeMaps( const PropertyValueMap& a, const PropertyValueMap& b, PropertyValueMap& out )
-{
- out = a;
- for( PropertyValueMap::const_iterator it = b.begin(), itEnd = b.end(); it != itEnd; ++it )
- {
- out[ it->first ] = it->second;
- }
-}
-
} // namespace
Toolkit::StyleManager StyleManager::Get()
}
StyleManager::StyleManager()
- : mOrientationDegrees( 0 ), // Portrait
- mSetThemeConnection( false )
+ : mOrientationDegrees( 0 ) // Portrait
{
// Add theme builder constants
mThemeBuilderConstants[ PACKAGE_PATH_KEY ] = DEFAULT_PACKAGE_PATH;
StyleManager::~StyleManager()
{
- // Disconnect from signal
- SetOrientation( Orientation() );
}
void StyleManager::SetOrientationValue( int orientation )
{
- mOrientationDegrees = orientation;
-
- Util::ConnectEventProcessingFinishedSignal();
- mSetThemeConnection = true;
+ if( orientation != mOrientationDegrees )
+ {
+ mOrientationDegrees = orientation;
+ // TODO: if orientation changed, apply the new style to all controls
+ // dont want to really do the whole load from file again if the bundle contains both portrait & landscape
+ SetTheme();
+ }
}
int StyleManager::GetOrientationValue()
bool StyleManager::GetStyleConstant( const std::string& key, Property::Value& valueOut )
{
- Toolkit::PropertyValueMap::iterator valueIt = mStyleBuilderConstants.find( key );
- if( valueIt != mStyleBuilderConstants.end() )
+ Property::Value* value = mStyleBuilderConstants.Find( key );
+ if( value )
{
- valueOut = valueIt->second;
+ valueOut = *value;
return true;
}
void StyleManager::OnOrientationChanged( Orientation orientation )
{
mOrientation = orientation;
-
- if( mOrientation )
- {
- Util::ConnectEventProcessingFinishedSignal();
- mSetThemeConnection = true;
- }
+ // TODO: if orientation changed, apply the new style to all controls
+ // dont want to really do the whole load from file again if the bundle contains both portrait & landscape
+ SetTheme();
}
-Toolkit::Builder StyleManager::CreateBuilder( const PropertyValueMap& constants )
+Toolkit::Builder StyleManager::CreateBuilder( const Property::Map& constants )
{
Toolkit::Builder builder = Toolkit::Builder::New();
builder.AddConstants( constants );
else
{
// Merge theme and style constants
- PropertyValueMap constants;
- MergeMaps( mThemeBuilderConstants, mStyleBuilderConstants, constants );
+ Property::Map constants( mThemeBuilderConstants );
+ constants.Merge( mStyleBuilderConstants );
// Create it
builder = CreateBuilder( constants );
{
mThemeFile = themeFile;
- Util::ConnectEventProcessingFinishedSignal();
- mSetThemeConnection = true;
+ // need to do style change synchronously as app might create a UI control on the next line
+ SetTheme();
}
void StyleManager::RequestDefaultTheme()
RequestThemeChange( DEFAULT_THEME );
}
-bool StyleManager::IsThemeRequestPending()
-{
- return mSetThemeConnection;
-}
-
void StyleManager::SetTheme()
{
mThemeBuilder = CreateBuilder( mThemeBuilderConstants );
LoadJSON( mThemeBuilder, mThemeFile );
- mSetThemeConnection = false;
-
StyleChange change;
change.themeChange = true;
mStyleChangeSignal.Emit( Toolkit::StyleManager::Get(), change );
// EXTERNAL INCLUDES
#include <string>
#include <list>
+#include <dali/public-api/common/map-wrapper.h>
// INTERNAL INCLUDES
-
#include <dali/dali.h>
#include <dali-toolkit/public-api/styling/style-manager.h>
#include <dali-toolkit/public-api/builder/builder.h>
*
* @return Return the newly created builder
*/
- Toolkit::Builder CreateBuilder( const PropertyValueMap& constants );
+ Toolkit::Builder CreateBuilder( const Property::Map& constants );
/**
* @brief Load a JSON file into given builder
std::string mThemeFile; ///< The full path of the current theme file
- Toolkit::PropertyValueMap mThemeBuilderConstants; ///< Contants to give the theme builder
- Toolkit::PropertyValueMap mStyleBuilderConstants; ///< Constants specific to building styles
+ Property::Map mThemeBuilderConstants; ///< Contants to give the theme builder
+ Property::Map mStyleBuilderConstants; ///< Constants specific to building styles
BuilderMap mBuilderCache; ///< Cache of builders keyed by JSON file name
- bool mSetThemeConnection; ///< Has the callback to set the theme been set
-
// Signals
Toolkit::StyleManager::StyleChangeSignalType mStyleChangeSignal; ///< Emitted when the style( theme/font ) changes
};
+++ /dev/null
-#ifndef __DALI_TOOLKIT_INTERNAL_UTIL_H__
-#define __DALI_TOOLKIT_INTERNAL_UTIL_H__
-
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-// EXTERNAL INCLUDES
-
-// INTERNAL INCLUDES
-
-#include <dali/dali.h>
-#include <dali-toolkit/internal/styling/style-manager-impl.h>
-
-namespace Dali
-{
-
-namespace Toolkit
-{
-
-namespace Internal
-{
-
-namespace Util
-{
-
-/**
- * @brief Callback that the EventProcessingFinishedSignal signal calls
- *
- * Priorities calls to managers
- */
-inline void EventProcessingFinishedSignalPrioritizer()
-{
- // Priority 0: Set all styles
- Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
- if( GetImpl(styleManager).IsThemeRequestPending() )
- {
- GetImpl(styleManager).SetTheme();
- }
-
- // Todo: Priority 1: Do relayout after styles have been set
-}
-
-/**
- * @brief Connect to the EventProcessingFinishedSignal
- *
- * Needs to be called only once, but will still operate successfully if called multiple times.
- * Makes the assumption that this is the only thing connecting to the EventProcessingFinishedSignal.
- */
-inline void ConnectEventProcessingFinishedSignal()
-{
- Stage stage = Stage::GetCurrent();
-
- // This is only intended for one purpose!
- if( stage.EventProcessingFinishedSignal().GetConnectionCount() == 0 )
- {
- stage.EventProcessingFinishedSignal().Connect( &EventProcessingFinishedSignalPrioritizer );
- }
-}
-
-} // namespace Util
-
-} // namespace Internal
-
-} // namespace Toolkit
-
-} // namespace Dali
-
-#endif // __DALI_TOOLKIT_INTERNAL_STYLE_MANAGER_H__
-
GetImpl(*this).LoadFromString( data );
}
-void Builder::AddConstants( const PropertyValueMap& map )
+void Builder::AddConstants( const Property::Map& map )
{
GetImpl(*this).AddConstants( map );
}
GetImpl(*this).AddConstant( key, value );
}
-const PropertyValueMap& Builder::GetConstants() const
+const Property::Map& Builder::GetConstants() const
{
return GetImpl(*this).GetConstants();
}
return GetImpl(*this).CreateAnimation( animationName );
}
-Animation Builder::CreateAnimation( const std::string& animationName, const PropertyValueMap& map )
+Animation Builder::CreateAnimation( const std::string& animationName, const Property::Map& map )
{
return GetImpl(*this).CreateAnimation( animationName, map );
}
return GetImpl(*this).CreateAnimation( animationName, sourceActor );
}
-Animation Builder::CreateAnimation( const std::string& animationName, const PropertyValueMap& map, Dali::Actor sourceActor )
+Animation Builder::CreateAnimation( const std::string& animationName, const Property::Map& map, Dali::Actor sourceActor )
{
return GetImpl(*this).CreateAnimation( animationName, map, sourceActor );
}
return GetImpl(*this).Create( templateName );
}
-BaseHandle Builder::Create( const std::string& templateName, const PropertyValueMap& map )
+BaseHandle Builder::Create( const std::string& templateName, const Property::Map& map )
{
return GetImpl(*this).Create( templateName, map );
}
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/dali.h>
namespace Dali DALI_IMPORT_API
class Builder;
}
-typedef std::map<std::string, Property::Value> PropertyValueMap;
-
/**
* This class provides the ability to load and style an actor tree from a string representation.
*
* @brief Adds user defined constants to all future style template or animation expansions
*
* e.g.
- * PropertyValueMap map;
+ * Property::Map map;
* map["IMAGE_DIRECTORY"] = "/usr/share/images";
* builder.AddConstants( map );
*
* @pre The Builder has been initialized.
* @param map The user defined constants used in template expansions.
*/
- void AddConstants( const PropertyValueMap& map );
+ void AddConstants( const Property::Map& map );
/**
* @brief Adds or modifies a user defined constant to all future style template or animation expansions
*
* e.g.
* @code
- * PropertyValueMap map = builder.GetConstants(); // get copy of current constants
+ * Property::Map map = builder.GetConstants(); // get copy of current constants
* map["IMAGE_DIRECTORY"] = "/usr/share/images"; // make modification
* builder.AddConstants( map ); // write back changes
* @endcode
* @pre The Builder has been initialized.
* @return A reference to the currently defined constants.
*/
- const PropertyValueMap& GetConstants() const;
+ const Property::Map& GetConstants() const;
/**
* @brief Gets a currently defined constant, or returns Property::INVALID
*
* e.g.
* @code
- * PropertyValueMap map = builder.GetConstants(); // get copy of current constants
+ * Property::Map map = builder.GetConstants(); // get copy of current constants
* map["IMAGE_DIRECTORY"] = "/usr/share/images"; // make modification
* builder.AddConstants( map ); // write back changes
* @endcode
* @brief Creates an animation from the set of known animations with user defined constants
*
* e.g.
- * PropertyValueMap map;
+ * Property::Map map;
* map["ACTOR"] = actor.GetName(); // replaces '{ACTOR} in the template
* Animation a = builder.CreateAnimation( "wobble");
*
* @param map The user defined constants used in style template expansion.
* @returns The base handle of the created object
*/
- Animation CreateAnimation( const std::string& animationName, const PropertyValueMap& map );
+ Animation CreateAnimation( const std::string& animationName, const Property::Map& map );
/**
* @brief Creates an animation from the set of known animations.
*
* The animation is applied to a specific actor.
* e.g.
- * PropertyValueMap map;
+ * Property::Map map;
* map["ACTOR"] = actor.GetName(); // replaces '{ACTOR} in the template
* Actor myInstance = builder.Create( "template-actor-tree" )
* Animation a = builder.CreateAnimation( "wobble", myInstance);
* @param sourceActor The starting point in an actor tree, from which to look for property owners
* @returns The base handle of the created object
*/
- Animation CreateAnimation( const std::string& animationName, const PropertyValueMap& map, Dali::Actor sourceActor );
+ Animation CreateAnimation( const std::string& animationName, const Property::Map& map, Dali::Actor sourceActor );
/**
* @brief Creates an object (e.g. an actor) from the set of known style templates
* @brief Creates an object from the style templates with user defined constants
*
* e.g.
- * PropertyValueMap map;
+ * Property::Map map;
* map["IMAGE_DIR"] = "/usr/share/images"; // replaces '{IMAGE_DIR} in the template
* mActor.Add( Actor::DownCast(builder.Create( "default-image", map) ) );
*
* @param map The user defined constants used in template expansion.
* @returns The base handle of the created object
*/
- BaseHandle Create( const std::string& templateName, const PropertyValueMap& map );
+ BaseHandle Create( const std::string& templateName, const Property::Map& map );
/**
* @brief Creates an object (e.g. an actor) from given json snippet
controlImpl.SetBackground( image );
}
}
- else if ( value.Get< Property::Map >().empty() )
+ else if ( value.Get< Property::Map >().Empty() )
{
// An empty map means the background is no longer required
controlImpl.ClearBackground();
Image image = imageActor.GetImage();
Property::Map imageMap;
Scripting::CreatePropertyMap( image, imageMap );
- map.push_back( Property::StringValuePair( "image", imageMap ) );
+ map[ "image" ] = imageMap;
}
}
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/dali.h>
+#include <dali/public-api/common/vector-wrapper.h>
+
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/scrollable/scroll-component.h>
namespace Dali DALI_IMPORT_API
// EXTERNAL INCLUDES
#include <boost/function.hpp>
+#include <dali/public-api/common/vector-wrapper.h>
// INTERNAL INCLUDES
-#include <dali/dali.h>
#include <dali-toolkit/public-api/controls/scrollable/item-view/item-layout.h>
namespace Dali DALI_IMPORT_API
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/dali.h>
+#include <dali/public-api/common/vector-wrapper.h>
+
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/enums.h>
#include <dali-toolkit/public-api/controls/control.h>
// EXTERNAL INCLUDES
#include <utility> // std::pair
-#include <dali/dali.h>
+#include <dali/public-api/actors/actor.h>
+#include <dali/public-api/common/vector-wrapper.h>
namespace Dali DALI_IMPORT_API
{
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/dali.h>
+#include <dali/public-api/common/vector-wrapper.h>
namespace Dali DALI_IMPORT_API
{
GetImpl(*this).ScrollTo(position, duration);
}
+void ScrollView::ScrollTo(const Vector3 &position, float duration, AlphaFunction alpha)
+{
+ GetImpl(*this).ScrollTo(position, duration, alpha);
+}
+
void ScrollView::ScrollTo(const Vector3 &position, float duration,
DirectionBias horizontalBias, DirectionBias verticalBias)
{
GetImpl(*this).ScrollTo(position, duration, horizontalBias, verticalBias);
}
+void ScrollView::ScrollTo(const Vector3 &position, float duration, AlphaFunction alpha,
+ DirectionBias horizontalBias, DirectionBias verticalBias)
+{
+ GetImpl(*this).ScrollTo(position, duration, alpha, horizontalBias, verticalBias);
+}
+
void ScrollView::ScrollTo(unsigned int page)
{
GetImpl(*this).ScrollTo(page);
void ScrollTo(const Vector3 &position, float duration);
/**
+ * @brief Scrolls View to position specified (contents will scroll to this position)
+ *
+ * Position 0,0 is the origin. Increasing X scrolls contents left, while
+ * increasing Y scrolls contents up.
+ * - If Rulers have been applied to the axes, then the contents will scroll until
+ * reaching the domain boundary.
+ * @note Contents will not snap to ruler snap points.
+ *
+ * @param[in] position The position to scroll to.
+ * @param[in] duration The duration of the animation in seconds
+ * @param[in] alpha The alpha function to use
+ */
+ void ScrollTo(const Vector3 &position, float duration, AlphaFunction alpha);
+
+ /**
* @brief Scrolls View to position specified (contents will scroll to this position).
*
* Position 0,0 is the origin. Increasing X scrolls contents left, while
DirectionBias horizontalBias, DirectionBias verticalBias);
/**
+ * @brief Scrolls View to position specified (contents will scroll to this position)
+ *
+ * Position 0,0 is the origin. Increasing X scrolls contents left, while
+ * increasing Y scrolls contents up.
+ * - If Rulers have been applied to the axes, then the contents will scroll until
+ * reaching the domain boundary.
+ * @note Contents will not snap to ruler snap points.
+ * Biasing parameters are provided such that in scenarios with 2 or 2x2 pages in
+ * wrap mode, the application developer can decide whether to scroll left or right
+ * to get to the target page
+ *
+ * @param[in] position The position to scroll to.
+ * @param[in] duration The duration of the animation in seconds
+ * @param[in] horizontalBias Whether to bias scrolling to left or right.
+ * @param[in] verticalBias Whether to bias scrolling to top or bottom.
+ * @param[in] alpha Alpha function to use
+ */
+ void ScrollTo(const Vector3 &position, float duration, AlphaFunction alpha,
+ DirectionBias horizontalBias, DirectionBias verticalBias);
+
+ /**
* @brief Scrolls View to page currently based on assumption that each page is
* "(page) * ScrollViewSize.width, 0".
*
*
*/
+// EXTERNAL INCLUDES
+#include <dali/public-api/common/vector-wrapper.h>
+
// INTERNAL INCLUDES
-#include <dali/public-api/common/dali-vector.h>
#include <dali-toolkit/public-api/controls/control.h>
namespace Dali DALI_IMPORT_API
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/public-api/common/vector-wrapper.h>
-
#include <dali/public-api/text/text.h>
#include <dali/public-api/text/text-style.h>
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/dali.h>
+#include <dali/public-api/common/map-wrapper.h>
+
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
*
*/
-// INTERNAL INCLUDES
+// EXTERNAL INCLUDES
#include <dali/dali.h>
+#include <dali/public-api/common/map-wrapper.h>
+
+// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali-toolkit/public-api/controls/page-turn-view/page-turn-view.h>
#include <dali-toolkit/internal/shader-effects/page-turn-effect-impl.h>
*
*/
+// EXTERNAL INCLUDES
#include <dali/dali.h>
+#include <dali/public-api/common/map-wrapper.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
// EXTERNAL INCLUDES
#include <dali/dali.h>
+#include <dali/public-api/common/map-wrapper.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
*
*/
+// EXTERNAL INCLUDES
+#include <dali/public-api/common/dali-vector.h>
+
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control.h>
#include <dali-toolkit/public-api/controls/alignment/alignment.h>
const unsigned int TOOLKIT_MAJOR_VERSION = 1;
const unsigned int TOOLKIT_MINOR_VERSION = 0;
-const unsigned int TOOLKIT_MICRO_VERSION = 13;
+const unsigned int TOOLKIT_MICRO_VERSION = 14;
const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
Name: dali-toolkit
Summary: The OpenGLES Canvas Core Library Toolkit
-Version: 1.0.13
+Version: 1.0.14
Release: 1
Group: System/Libraries
License: Apache-2.0