Remove std::vector from public api 54/40154/8
authorLee Morgan <Lee.morgan@partner.samsung.com>
Fri, 29 May 2015 13:17:33 +0000 (14:17 +0100)
committerLee Morgan <Lee.morgan@partner.samsung.com>
Fri, 29 May 2015 16:09:53 +0000 (17:09 +0100)
Change-Id: Id5905d7fe7ec8b871e251245a4d86449d9b62ab9

53 files changed:
automated-tests/src/dali-internal/utc-Dali-AnimatableMesh.cpp
automated-tests/src/dali-internal/utc-Dali-MeshActor.cpp
automated-tests/src/dali/utc-Dali-BaseHandle.cpp
automated-tests/src/dali/utc-Dali-CameraActor.cpp
automated-tests/src/dali/utc-Dali-CustomActor.cpp
automated-tests/src/dali/utc-Dali-GestureDetector.cpp
automated-tests/src/dali/utc-Dali-Handle.cpp
automated-tests/src/dali/utc-Dali-ImageActor.cpp
automated-tests/src/dali/utc-Dali-Layer.cpp
automated-tests/src/dali/utc-Dali-PanGestureDetector.cpp
automated-tests/src/dali/utc-Dali-RenderTask.cpp
automated-tests/src/dali/utc-Dali-ShaderEffect.cpp
automated-tests/src/dali/utc-Dali-TypeRegistry.cpp
dali/devel-api/scripting/scripting.cpp
dali/devel-api/scripting/scripting.h
dali/internal/event/actors/actor-impl.cpp
dali/internal/event/actors/actor-impl.h
dali/internal/event/actors/camera-actor-impl.cpp
dali/internal/event/actors/image-actor-impl.cpp
dali/internal/event/actors/layer-impl.cpp
dali/internal/event/actors/layer-impl.h
dali/internal/event/animation/animation-impl.cpp
dali/internal/event/animation/animation-impl.h
dali/internal/event/animation/linear-constrainer-impl.cpp
dali/internal/event/animation/path-constrainer-impl.cpp
dali/internal/event/animation/path-impl.cpp
dali/internal/event/common/object-impl.cpp
dali/internal/event/common/type-info-impl.cpp
dali/internal/event/common/type-info-impl.h
dali/internal/event/common/type-registry-impl.cpp
dali/internal/event/common/type-registry-impl.h
dali/internal/event/effects/shader-effect-impl.cpp
dali/internal/event/events/gesture-detector-impl.cpp
dali/internal/event/events/gesture-detector-impl.h
dali/internal/event/events/pan-gesture-detector-impl.cpp
dali/internal/event/events/pan-gesture-detector-impl.h
dali/internal/event/modeling/animatable-mesh-impl.cpp
dali/internal/event/render-tasks/render-task-impl.cpp
dali/public-api/events/gesture-detector.cpp
dali/public-api/events/gesture-detector.h
dali/public-api/events/pan-gesture-detector.cpp
dali/public-api/events/pan-gesture-detector.h
dali/public-api/object/base-handle.cpp
dali/public-api/object/base-handle.h
dali/public-api/object/base-object.cpp
dali/public-api/object/base-object.h
dali/public-api/object/property-map.cpp
dali/public-api/object/property-map.h
dali/public-api/object/property.h
dali/public-api/object/type-info.cpp
dali/public-api/object/type-info.h
dali/public-api/object/type-registry.cpp
dali/public-api/object/type-registry.h

index 0de8bbb..6de5843 100644 (file)
@@ -438,8 +438,8 @@ int UtcDaliAnimatableMeshProperties(void)
 
   Property::IndexContainer indices;
   mesh.GetPropertyIndices( indices );
-  DALI_TEST_CHECK( ! indices.empty() );
-  DALI_TEST_EQUALS( indices.size(), mesh.GetPropertyCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( indices.Size() );
+  DALI_TEST_EQUALS( indices.Size(), mesh.GetPropertyCount(), TEST_LOCATION );
   END_TEST;
 }
 
index 3a36f3d..0e5a846 100644 (file)
@@ -728,8 +728,8 @@ int UtcDaliMeshActorIndices(void)
 
   Property::IndexContainer indices;
   meshActor.GetPropertyIndices( indices );
-  DALI_TEST_CHECK( indices.size() == basicActor.GetPropertyCount() ); // Mesh Actor does not have any properties
-  DALI_TEST_EQUALS( indices.size(), meshActor.GetPropertyCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( indices.Size() == basicActor.GetPropertyCount() ); // Mesh Actor does not have any properties
+  DALI_TEST_EQUALS( indices.Size(), meshActor.GetPropertyCount(), TEST_LOCATION );
   END_TEST;
 }
 
@@ -742,7 +742,7 @@ int UtcDaliAnimatableMeshActorIndices(void)
 
   Property::IndexContainer indices;
   meshActor.GetPropertyIndices( indices );
-  DALI_TEST_CHECK( indices.size() == basicActor.GetPropertyCount() ); // Mesh Actor does not have any properties
-  DALI_TEST_EQUALS( indices.size(), meshActor.GetPropertyCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( indices.Size() == basicActor.GetPropertyCount() ); // Mesh Actor does not have any properties
+  DALI_TEST_EQUALS( indices.Size(), meshActor.GetPropertyCount(), TEST_LOCATION );
   END_TEST;
 }
index b0fb0c0..a1032a2 100644 (file)
@@ -315,7 +315,7 @@ int UtcDaliBaseHandleDoAction(void)
   DALI_TEST_CHECK(actorObject);
 
   // Check that an invalid command is not performed
-  std::vector<Property::Value> attributes;
+  Property::Map attributes;
   DALI_TEST_CHECK(actorObject.DoAction("invalidCommand", attributes) == false);
 
   // Check that the actor is visible
@@ -360,7 +360,7 @@ int UtcDaliBaseHandleDoAction(void)
   // Set the new duration to be 2 seconds
   float newDurationSeconds(2.0f);
   Property::Value newDurationSecondsValue = Property::Value( newDurationSeconds );
-  attributes.push_back(newDurationSecondsValue);
+  attributes["duration"] = newDurationSecondsValue;
 
   // Check the animation performed an action to play itself with the specified duration of 2 seconds
   animationObject.DoAction("play", attributes);
index 86b421f..6ecb98f 100644 (file)
@@ -272,7 +272,7 @@ int UtcDaliCameraActorDefaultProperties(void)
   actor.GetProperty(CameraActor::Property::INVERT_Y_AXIS).Get(bValue);
   DALI_TEST_EQUALS(false, bValue, TEST_LOCATION);
 
-  std::vector<Property::Index> indices ;
+  std::vector<Property::Index> indices;
   indices.push_back(CameraActor::Property::TYPE);
   indices.push_back(CameraActor::Property::PROJECTION_MODE);
   indices.push_back(CameraActor::Property::FIELD_OF_VIEW);
@@ -369,7 +369,7 @@ int UtcDaliCameraActorSetType02(void)
 
   CameraActor actor;
 
-  Dali::Camera::Type cameraType = Dali::Camera::FREE_LOOK ;
+  Dali::Camera::Type cameraType = Dali::Camera::FREE_LOOK;
   try
   {
     cameraType = actor.GetType();
@@ -802,8 +802,8 @@ int UtcDaliCameraActorPropertyIndices(void)
   Actor basicActor = Actor::New();
   Property::IndexContainer indices;
   camera.GetPropertyIndices( indices );
-  DALI_TEST_CHECK( indices.size() > basicActor.GetPropertyCount() );
-  DALI_TEST_EQUALS( indices.size(), camera.GetPropertyCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( indices.Size() > basicActor.GetPropertyCount() );
+  DALI_TEST_EQUALS( indices.Size(), camera.GetPropertyCount(), TEST_LOCATION );
   END_TEST;
 }
 
index fb8d631..7f60458 100644 (file)
@@ -221,7 +221,7 @@ struct TestCustomActor : public CustomActorImpl
 
   void SetDaliProperty(std::string s)
   {
-    Self().SetProperty(mDaliProperty, s) ;
+    Self().SetProperty(mDaliProperty, s);
   }
   void TestRelayoutRequest()
   {
@@ -1587,7 +1587,7 @@ int UtcDaliCustomActorOnPropertySet(void)
   TestCustomActor custom = TestCustomActor::New();
   DALI_TEST_EQUALS( 0, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
 
-  custom.SetDaliProperty("yes") ;
+  custom.SetDaliProperty("yes");
 
   DALI_TEST_EQUALS( 1, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
   DALI_TEST_EQUALS( "OnPropertySet", custom.GetMethodsCalled()[ 0 ], TEST_LOCATION );
@@ -1767,7 +1767,7 @@ int UtcDaliCustomActorDoAction(void)
 
   DALI_TEST_CHECK(customActorObject);
 
-  std::vector<Property::Value> attributes;
+  Property::Map attributes;
 
   // Check that an invalid command is not performed
   DALI_TEST_CHECK(customActorObject.DoAction("invalidCommand", attributes) == false);
index 710c23b..9bc99e6 100644 (file)
@@ -137,13 +137,17 @@ int UtcDaliGestureDetectorAttachP(void)
 
   detector.Attach(actor);
 
-  std::vector<Actor> actors = detector.GetAttachedActors();
-
-  if (find(actors.begin(), actors.end(), actor) != actors.end())
+  bool found = false;
+  for(size_t i = 0; i < detector.GetAttachedActorCount(); i++)
   {
-    tet_result(TET_PASS);
+    if( detector.GetAttachedActor(i) == actor )
+    {
+      tet_result(TET_PASS);
+      found = true;
+    }
   }
-  else
+
+  if(!found)
   {
     tet_result(TET_FAIL);
   }
@@ -190,13 +194,18 @@ int UtcDaliGestureDetectorDetachP(void)
 
   Actor actor = Actor::New();
   detector.Attach(actor);
-  std::vector<Actor> actors = detector.GetAttachedActors();
 
-  if (find(actors.begin(), actors.end(), actor) != actors.end())
+  bool found = false;
+  for(size_t i = 0; i < detector.GetAttachedActorCount(); i++)
   {
-    tet_result(TET_PASS);
+    if( detector.GetAttachedActor(i) == actor )
+    {
+      tet_result(TET_PASS);
+      found = true;
+    }
   }
-  else
+
+  if(!found)
   {
     tet_result(TET_FAIL);
   }
@@ -204,15 +213,24 @@ int UtcDaliGestureDetectorDetachP(void)
   // Detach and retrieve attached actors again, the vector should be empty.
   detector.Detach(actor);
 
-  actors = detector.GetAttachedActors();
-  if (actors.empty())
+  found = false;
+  for(size_t i = 0; i < detector.GetAttachedActorCount(); i++)
   {
-    tet_result(TET_PASS);
+    if( detector.GetAttachedActor(i) == actor )
+    {
+      found = true;
+    }
   }
-  else
+
+  if(found)
   {
     tet_result(TET_FAIL);
   }
+  else
+  {
+    tet_result(TET_PASS);
+  }
+
   END_TEST;
 }
 
@@ -309,14 +327,12 @@ int UtcDaliGestureDetectorDetachAllP(void)
     detector.Attach(actor);
   }
 
-  std::vector<Actor> attachedActors = detector.GetAttachedActors();
-  DALI_TEST_EQUALS(actorsToAdd, attachedActors.size(), TEST_LOCATION);
+  DALI_TEST_EQUALS(actorsToAdd, detector.GetAttachedActorCount(), TEST_LOCATION);
 
   // Detach and retrieve attached actors again, the vector should be empty.
   detector.DetachAll();
 
-  attachedActors = detector.GetAttachedActors();
-  DALI_TEST_EQUALS(true, attachedActors.empty(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0, detector.GetAttachedActorCount(), TEST_LOCATION);
   END_TEST;
 }
 
@@ -338,14 +354,12 @@ int UtcDaliGestureDetectorDetachAllN(void)
     detector.Attach(actor);
   }
 
-  std::vector<Actor> attachedActors = detector.GetAttachedActors();
-  DALI_TEST_EQUALS(actorsToAdd, attachedActors.size(), TEST_LOCATION);
+  DALI_TEST_EQUALS(actorsToAdd, detector.GetAttachedActorCount(), TEST_LOCATION);
 
   // Detach and retrieve attached actors again, the vector should be empty.
   detector.DetachAll();
 
-  attachedActors = detector.GetAttachedActors();
-  DALI_TEST_EQUALS(true, attachedActors.empty(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0, detector.GetAttachedActorCount(), TEST_LOCATION);
   DALI_TEST_EQUALS(true, gestureManager.WasCalled(TestGestureManager::UnregisterType), TEST_LOCATION);
 
   // Call DetachAll again, there should not be any exception
@@ -371,17 +385,17 @@ int UtcDaliGestureDetectorGetAttachedActors(void)
   GestureDetector detector = PanGestureDetector::New();
 
   // Initially there should not be any actors.
-  DALI_TEST_EQUALS(0u, detector.GetAttachedActors().size(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0u, detector.GetAttachedActorCount(), TEST_LOCATION);
 
   // Attach one actor
   Actor actor1 = Actor::New();
   detector.Attach(actor1);
-  DALI_TEST_EQUALS(1u, detector.GetAttachedActors().size(), TEST_LOCATION);
+  DALI_TEST_EQUALS(1u, detector.GetAttachedActorCount(), TEST_LOCATION);
 
   // Attach another actor
   Actor actor2 = Actor::New();
   detector.Attach(actor2);
-  DALI_TEST_EQUALS(2u, detector.GetAttachedActors().size(), TEST_LOCATION);
+  DALI_TEST_EQUALS(2u, detector.GetAttachedActorCount(), TEST_LOCATION);
 
   // Attach another five actors
   std::vector<Actor> myActors;
@@ -391,35 +405,35 @@ int UtcDaliGestureDetectorGetAttachedActors(void)
     myActors.push_back(actor);
     detector.Attach(actor);
   }
-  DALI_TEST_EQUALS(7u, detector.GetAttachedActors().size(), TEST_LOCATION);
+  DALI_TEST_EQUALS(7u, detector.GetAttachedActorCount(), TEST_LOCATION);
 
   // Detach actor2
   detector.Detach(actor2);
-  DALI_TEST_EQUALS(6u, detector.GetAttachedActors().size(), TEST_LOCATION);
+  DALI_TEST_EQUALS(6u, detector.GetAttachedActorCount(), TEST_LOCATION);
 
   // Attach actor1 again, count should not increase.
   detector.Attach(actor1);
-  DALI_TEST_EQUALS(6u, detector.GetAttachedActors().size(), TEST_LOCATION);
+  DALI_TEST_EQUALS(6u, detector.GetAttachedActorCount(), TEST_LOCATION);
 
   // Detach actor2 again, count should not decrease.
   detector.Detach(actor2);
-  DALI_TEST_EQUALS(6u, detector.GetAttachedActors().size(), TEST_LOCATION);
+  DALI_TEST_EQUALS(6u, detector.GetAttachedActorCount(), TEST_LOCATION);
 
   // Detach actor1.
   detector.Detach(actor1);
-  DALI_TEST_EQUALS(5u, detector.GetAttachedActors().size(), TEST_LOCATION);
+  DALI_TEST_EQUALS(5u, detector.GetAttachedActorCount(), TEST_LOCATION);
 
   // Create scoped actor, actor should be automatically removed from the detector when it goes out
   // of scope.
   {
     Actor scopedActor = Actor::New();
     detector.Attach(scopedActor);
-    DALI_TEST_EQUALS(6u, detector.GetAttachedActors().size(), TEST_LOCATION);
+    DALI_TEST_EQUALS(6u, detector.GetAttachedActorCount(), TEST_LOCATION);
   }
-  DALI_TEST_EQUALS(5u, detector.GetAttachedActors().size(), TEST_LOCATION);
+  DALI_TEST_EQUALS(5u, detector.GetAttachedActorCount(), TEST_LOCATION);
 
   // Detach all so nothing remains.
   detector.DetachAll();
-  DALI_TEST_EQUALS(0u, detector.GetAttachedActors().size(), TEST_LOCATION);
+  DALI_TEST_EQUALS(0u, detector.GetAttachedActorCount(), TEST_LOCATION);
   END_TEST;
 }
index 9520e8d..c0b4fe6 100644 (file)
@@ -719,8 +719,8 @@ int UtcDaliHandleGetPropertyIndices(void)
   // Actor
   Actor actor = Actor::New();
   actor.GetPropertyIndices( indices );
-  DALI_TEST_CHECK( ! indices.empty() );
-  DALI_TEST_EQUALS( indices.size(), actor.GetPropertyCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( indices.Size() );
+  DALI_TEST_EQUALS( indices.Size(), actor.GetPropertyCount(), TEST_LOCATION );
   END_TEST;
 }
 
index 9c18fc0..4179adc 100644 (file)
@@ -857,8 +857,8 @@ int UtcDaliImageActorPropertyIndices(void)
 
   Property::IndexContainer indices;
   imageActor.GetPropertyIndices( indices );
-  DALI_TEST_CHECK( indices.size() > basicActor.GetPropertyCount() );
-  DALI_TEST_EQUALS( indices.size(), imageActor.GetPropertyCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( indices.Size() > basicActor.GetPropertyCount() );
+  DALI_TEST_EQUALS( indices.Size(), imageActor.GetPropertyCount(), TEST_LOCATION );
   END_TEST;
 }
 
index 5c6d1b8..e48da87 100644 (file)
@@ -441,7 +441,7 @@ int UtcDaliLayerDefaultProperties(void)
 
   Layer actor = Layer::New();
 
-  std::vector<Property::Index> indices ;
+  std::vector<Property::Index> indices;
   indices.push_back(Layer::Property::CLIPPING_ENABLE);
   indices.push_back(Layer::Property::CLIPPING_BOX);
 
@@ -463,7 +463,7 @@ int UtcDaliLayerDefaultProperties(void)
 
   actor.SetProperty(Layer::Property::CLIPPING_BOX, Property::Value(Rect<int>(testBox)));
 
-  DALI_TEST_CHECK(Property::RECTANGLE == actor.GetPropertyType(Layer::Property::CLIPPING_BOX)) ;
+  DALI_TEST_CHECK(Property::RECTANGLE == actor.GetPropertyType(Layer::Property::CLIPPING_BOX));
 
   Property::Value v = actor.GetProperty(Layer::Property::CLIPPING_BOX);
 
@@ -508,8 +508,8 @@ int UtcDaliLayerPropertyIndices(void)
 
   Property::IndexContainer indices;
   layer.GetPropertyIndices( indices );
-  DALI_TEST_CHECK( indices.size() > basicActor.GetPropertyCount() );
-  DALI_TEST_EQUALS( indices.size(), layer.GetPropertyCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( indices.Size() > basicActor.GetPropertyCount() );
+  DALI_TEST_EQUALS( indices.Size(), layer.GetPropertyCount(), TEST_LOCATION );
   END_TEST;
 }
 
index b68da92..1db4833 100644 (file)
@@ -43,8 +43,6 @@ void utc_dali_pan_gesture_detector_cleanup(void)
 ///////////////////////////////////////////////////////////////////////////////
 namespace
 {
-typedef Dali::PanGestureDetector::AngleContainer::size_type AngleSizeType;
-
 const int PAN_EVENT_TIME_DELTA = 8;
 const int PAN_GESTURE_UPDATE_COUNT = 50;
 
@@ -1742,38 +1740,39 @@ int UtcDaliPanGestureAngleHandling(void)
   TestApplication application;
 
   PanGestureDetector detector = PanGestureDetector::New();
-  const PanGestureDetector::AngleContainer& angles( detector.GetAngles() );
-  DALI_TEST_EQUALS( angles.empty(), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 0, TEST_LOCATION );
 
   detector.AddAngle( PanGestureDetector::DIRECTION_LEFT, Radian( Math::PI * 0.25 ) );
-  DALI_TEST_EQUALS( angles.size(), static_cast<AngleSizeType>(1), TEST_LOCATION );
-  for ( PanGestureDetector::AngleContainer::const_iterator iter = angles.begin(), endIter = angles.end(); iter != endIter; ++iter )
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 1, TEST_LOCATION );
+  bool found = false;
+  for( size_t i = 0; i < detector.GetAngleCount(); i++)
   {
-    if ( iter->first == PanGestureDetector::DIRECTION_LEFT )
+    if( detector.GetAngle(i).first == PanGestureDetector::DIRECTION_LEFT )
     {
       tet_result( TET_PASS );
+      found = true;
       break;
     }
+  }
 
-    if ( iter == endIter )
-    {
-      tet_printf("%s, angle not added\n", TEST_LOCATION );
-      tet_result( TET_FAIL );
-    }
+  if(!found )
+  {
+    tet_printf("%s, angle not added\n", TEST_LOCATION );
+    tet_result( TET_FAIL );
   }
 
   detector.AddAngle( PanGestureDetector::DIRECTION_RIGHT, Radian( Math::PI * 0.25 ) );
-  DALI_TEST_EQUALS( angles.size(), static_cast<AngleSizeType>(2), TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 2, TEST_LOCATION );
 
   // Remove something not in the container.
   detector.RemoveAngle( PanGestureDetector::DIRECTION_UP );
-  DALI_TEST_EQUALS( angles.size(), static_cast<AngleSizeType>(2), TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 2, TEST_LOCATION );
 
   detector.RemoveAngle( PanGestureDetector::DIRECTION_RIGHT );
-  DALI_TEST_EQUALS( angles.size(), static_cast<AngleSizeType>(1), TEST_LOCATION );
-  for ( PanGestureDetector::AngleContainer::const_iterator iter = angles.begin(), endIter = angles.end(); iter != endIter; ++iter )
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 1, TEST_LOCATION );
+  for ( size_t i = 0; i < detector.GetAngleCount(); i++)
   {
-    if ( iter->first == PanGestureDetector::DIRECTION_RIGHT )
+    if ( detector.GetAngle(i).first == PanGestureDetector::DIRECTION_RIGHT )
     {
       tet_printf("%s, angle not removed\n", TEST_LOCATION );
       tet_result( TET_FAIL );
@@ -1782,7 +1781,7 @@ int UtcDaliPanGestureAngleHandling(void)
   }
 
   detector.ClearAngles();
-  DALI_TEST_EQUALS( angles.size(), static_cast<AngleSizeType>(0), TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 0, TEST_LOCATION );
   END_TEST;
 }
 
@@ -1796,39 +1795,38 @@ int UtcDaliPanGestureAngleOutOfRange(void)
   TestApplication application;
 
   PanGestureDetector detector = PanGestureDetector::New();
-  const PanGestureDetector::AngleContainer& angles( detector.GetAngles() );
-  DALI_TEST_EQUALS( angles.empty(), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 0, TEST_LOCATION );
 
   //
   // Angle
   //
 
   detector.AddAngle( Degree(180.0f) );
-  DALI_TEST_EQUALS( angles.begin()->first, Radian( Degree(-180.0f) ), 0.000001, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngle(0).first, Radian( Degree(-180.0f) ), 0.000001, TEST_LOCATION );
   detector.ClearAngles();
 
   detector.AddAngle( Degree(190.0f) );
-  DALI_TEST_EQUALS( angles.begin()->first, Radian( Degree(-170.0f) ), 0.000001, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngle(0).first, Radian( Degree(-170.0f) ), 0.000001, TEST_LOCATION );
   detector.ClearAngles();
 
   detector.AddAngle( Degree(-190.0f) );
-  DALI_TEST_EQUALS( angles.begin()->first, Radian( Degree(170.0f) ), 0.000001, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngle(0).first, Radian( Degree(170.0f) ), 0.000001, TEST_LOCATION );
   detector.ClearAngles();
 
   detector.AddAngle( Degree(350.0f) );
-  DALI_TEST_EQUALS( angles.begin()->first, Radian( Degree(-10.0f) ), 0.000001, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngle(0).first, Radian( Degree(-10.0f) ), 0.000001, TEST_LOCATION );
   detector.ClearAngles();
 
   detector.AddAngle( Degree(-350.0f) );
-  DALI_TEST_EQUALS( angles.begin()->first, Radian( Degree(10.0f) ), 0.000001, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngle(0).first, Radian( Degree(10.0f) ), 0.000001, TEST_LOCATION );
   detector.ClearAngles();
 
   detector.AddAngle( Degree(370.0f) );
-  DALI_TEST_EQUALS( angles.begin()->first, Radian( Degree(10.0f) ), 0.000001, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngle(0).first, Radian( Degree(10.0f) ), 0.000001, TEST_LOCATION );
   detector.ClearAngles();
 
   detector.AddAngle( Degree(-370.0f) );
-  DALI_TEST_EQUALS( angles.begin()->first, Radian( Degree(-10.0f) ), 0.000001, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngle(0).first, Radian( Degree(-10.0f) ), 0.000001, TEST_LOCATION );
   detector.ClearAngles();
 
   //
@@ -1836,19 +1834,19 @@ int UtcDaliPanGestureAngleOutOfRange(void)
   //
 
   detector.AddAngle( PanGestureDetector::DIRECTION_RIGHT, Degree( 0.0f ) );
-  DALI_TEST_EQUALS( angles.begin()->second, Radian( Degree(0.0f) ), 0.000001, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngle(0).second, Radian( Degree(0.0f) ), 0.000001, TEST_LOCATION );
   detector.ClearAngles();
 
   detector.AddAngle( PanGestureDetector::DIRECTION_RIGHT, Degree( -10.0f ) );
-  DALI_TEST_EQUALS( angles.begin()->second, Radian( Degree(10.0f) ), 0.000001, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngle(0).second, Radian( Degree(10.0f) ), 0.000001, TEST_LOCATION );
   detector.ClearAngles();
 
   detector.AddAngle( PanGestureDetector::DIRECTION_RIGHT, Degree( -181.0f ) );
-  DALI_TEST_EQUALS( angles.begin()->second, Radian( Degree(180.0f) ), 0.000001, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngle(0).second, Radian( Degree(180.0f) ), 0.000001, TEST_LOCATION );
   detector.ClearAngles();
 
   detector.AddAngle( PanGestureDetector::DIRECTION_RIGHT, Degree( 181.0f ) );
-  DALI_TEST_EQUALS( angles.begin()->second, Radian( Degree(180.0f) ), 0.000001, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngle(0).second, Radian( Degree(180.0f) ), 0.000001, TEST_LOCATION );
   detector.ClearAngles();
   END_TEST;
 }
@@ -1930,47 +1928,51 @@ int UtcDaliPanGestureDirectionHandling(void)
   TestApplication application;
 
   PanGestureDetector detector = PanGestureDetector::New();
-  const PanGestureDetector::AngleContainer& angles( detector.GetAngles() );
-  DALI_TEST_EQUALS( angles.empty(), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 0, TEST_LOCATION );
 
   detector.AddDirection( PanGestureDetector::DIRECTION_LEFT, Radian( Math::PI * 0.25 ) );
-  DALI_TEST_EQUALS( angles.size(), static_cast<AngleSizeType>(2), TEST_LOCATION );
-  for ( PanGestureDetector::AngleContainer::const_iterator iter = angles.begin(), endIter = angles.end(); iter != endIter; ++iter )
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 2, TEST_LOCATION );
+  bool found = false;
+  for ( size_t i = 0; detector.GetAngleCount(); i++)
   {
-    if ( iter->first == PanGestureDetector::DIRECTION_LEFT )
+    if ( detector.GetAngle(i).first == PanGestureDetector::DIRECTION_LEFT )
     {
       tet_result( TET_PASS );
+      found = true;
       break;
     }
 
-    if ( iter == endIter )
-    {
-      tet_printf("%s, angle not added\n", TEST_LOCATION );
-      tet_result( TET_FAIL );
-    }
   }
 
-  for ( PanGestureDetector::AngleContainer::const_iterator iter = angles.begin(), endIter = angles.end(); iter != endIter; ++iter )
+  if (!found )
   {
-    if ( iter->first == PanGestureDetector::DIRECTION_RIGHT )
+    tet_printf("%s, angle not added\n", TEST_LOCATION );
+    tet_result( TET_FAIL );
+  }
+
+  found = false;
+  for( size_t i = 0; i < detector.GetAngleCount(); i++)
+  {
+    if( detector.GetAngle(i).first == PanGestureDetector::DIRECTION_RIGHT )
     {
       tet_result( TET_PASS );
+      found = true;
       break;
     }
+  }
 
-    if ( iter == endIter )
-    {
-      tet_printf("%s, angle not added\n", TEST_LOCATION );
-      tet_result( TET_FAIL );
-    }
+  if(!found )
+  {
+    tet_printf("%s, angle not added\n", TEST_LOCATION );
+    tet_result( TET_FAIL );
   }
 
   // Remove something not in the container.
   detector.RemoveDirection( PanGestureDetector::DIRECTION_UP );
-  DALI_TEST_EQUALS( angles.size(), static_cast<AngleSizeType>(2), TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 2, TEST_LOCATION );
 
   detector.RemoveDirection( PanGestureDetector::DIRECTION_RIGHT );
-  DALI_TEST_EQUALS( angles.size(), static_cast<AngleSizeType>(0), TEST_LOCATION );
+  DALI_TEST_EQUALS( detector.GetAngleCount(), 0, TEST_LOCATION );
   END_TEST;
 }
 
@@ -2394,8 +2396,8 @@ int UtcDaliPanGesturePropertyIndices(void)
 
   Property::IndexContainer indices;
   detector.GetPropertyIndices( indices );
-  DALI_TEST_CHECK( ! indices.empty() );
-  DALI_TEST_EQUALS( indices.size(), detector.GetPropertyCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( indices.Size() );
+  DALI_TEST_EQUALS( indices.Size(), detector.GetPropertyCount(), TEST_LOCATION );
   END_TEST;
 }
 
index 69e80e9..0e86033 100644 (file)
@@ -2962,8 +2962,8 @@ int UtcDaliRenderTaskProperties(void)
 
   Property::IndexContainer indices;
   task.GetPropertyIndices( indices );
-  DALI_TEST_CHECK( ! indices.empty() );
-  DALI_TEST_EQUALS( indices.size(), task.GetPropertyCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( indices.Size() );
+  DALI_TEST_EQUALS( indices.Size(), task.GetPropertyCount(), TEST_LOCATION );
   END_TEST;
 }
 
index ecbe97e..ddbf86d 100644 (file)
@@ -893,8 +893,8 @@ int UtcDaliShaderEffectPropertyIndices(void)
 
   Property::IndexContainer indices;
   effect.GetPropertyIndices( indices );
-  DALI_TEST_CHECK( ! indices.empty() );
-  DALI_TEST_EQUALS( indices.size(), effect.GetPropertyCount(), TEST_LOCATION );
+  DALI_TEST_CHECK( indices.Size() );
+  DALI_TEST_EQUALS( indices.Size(), effect.GetPropertyCount(), TEST_LOCATION );
   END_TEST;
 }
 
index 49c8fc4..19c5a8d 100644 (file)
@@ -481,7 +481,7 @@ static void ResetFunctorCounts()
 }
 
 static std::string lastActionCustom;
-bool DoActionCustom(BaseObject* object, const std::string& actionName, const std::vector<Property::Value>& attributes)
+bool DoActionCustom(BaseObject* object, const std::string& actionName, const Property::Map& /*attributes*/)
 {
   lastActionCustom = actionName;
   return true;
@@ -674,42 +674,38 @@ int UtcDaliTypeRegistryGetTypeInfoFromTypeIdN(void)
   END_TEST;
 }
 
-int UtcDaliTypeRegistryGetTypeNamesP(void)
+int UtcDaliTypeRegistryGetTypeNameCountP(void)
 {
   TestApplication application;
-
+  TypeRegistry typeRegistry = TypeRegistry::Get();
   TypeInfo type;
 
-  TypeRegistry::NameContainer names = TypeRegistry::Get().GetTypeNames();
-
-  for(TypeRegistry::NameContainer::iterator iter = names.begin();
-      iter != names.end(); ++iter)
+  for(size_t i = 0; i < typeRegistry.GetTypeNameCount(); i++)
   {
-    type = TypeRegistry::Get().GetTypeInfo( *iter );
+    type = typeRegistry.GetTypeInfo( typeRegistry.GetTypeName(i) );
     DALI_TEST_CHECK( type );
   }
 
   END_TEST;
 }
 
-int UtcDaliTypeRegistryGetTypeNamesN(void)
+
+int UtcDaliTypeRegistryGetTypeNamesP(void)
 {
   TestApplication application;
-
+  TypeRegistry typeRegistry = TypeRegistry::Get();
   TypeInfo type;
 
-  TypeRegistry::NameContainer names = TypeRegistry::Get().GetTypeNames();
-
-  for(TypeRegistry::NameContainer::iterator iter = names.begin();
-      iter != names.end(); ++iter)
+  for(size_t i = 0; i < typeRegistry.GetTypeNameCount(); i++)
   {
-    type = TypeRegistry::Get().GetTypeInfo( *iter );
-    DALI_TEST_CHECK( type.GetName() != "MyDummyActor" );
+    type = typeRegistry.GetTypeInfo( typeRegistry.GetTypeName(i) );
+    DALI_TEST_CHECK( type );
   }
 
   END_TEST;
 }
 
+
 // Note: No negative test case for UtcDaliTypeRegistryTypeRegistration can be implemented.
 int UtcDaliTypeRegistryTypeRegistrationNotCallingCreateOnInitP(void)
 {
@@ -729,19 +725,9 @@ int UtcDaliTypeRegistryTypeRegistrationNotCallingCreateOnInitP(void)
   MyTestCustomActor customHandle = MyTestCustomActor::DownCast( handle );
   DALI_TEST_CHECK( customHandle );
 
-  TypeInfo::NameContainer names;
-  type.GetActions(names);
-  TypeInfo::NameContainer baseNames;
-  baseType.GetActions(baseNames);
-  DALI_TEST_EQUALS( names.size(), TEST_ACTION_COUNT + baseNames.size(), TEST_LOCATION );
-
-  names.clear();
-  type.GetSignals(names);
-
-  baseNames.clear();
-  baseType.GetSignals(baseNames);
+  DALI_TEST_EQUALS( type.GetActionCount(), TEST_ACTION_COUNT + baseType.GetActionCount(), TEST_LOCATION );
 
-  DALI_TEST_EQUALS( names.size(), TEST_SIGNAL_COUNT + baseNames.size(), TEST_LOCATION );
+  DALI_TEST_EQUALS( type.GetSignalCount(), TEST_SIGNAL_COUNT + baseType.GetSignalCount(), TEST_LOCATION );
 
   {
     TestConnectionTracker tracker;
@@ -769,7 +755,7 @@ int UtcDaliTypeRegistryTypeRegistrationNotCallingCreateOnInitP(void)
   DALI_TEST_EQUALS( CustomTestFunctor::mTotalInstanceCount, 2/*temporary copy + FunctorDelegate copy*/, TEST_LOCATION );
   DALI_TEST_EQUALS( CustomTestFunctor::mCurrentInstanceCount, 0, TEST_LOCATION );
 
-  std::vector<Property::Value> attributes;
+  Property::Map attributes;
   handle.DoAction("act1", attributes);
   DALI_TEST_CHECK( lastActionCustom == "act1" );
   END_TEST;
@@ -891,21 +877,9 @@ int UtcDaliTypeRegistrySignalConnectorTypeN(void)
   MyTestCustomActor customHandle = MyTestCustomActor::DownCast( handle );
   DALI_TEST_CHECK( customHandle );
 
-  TypeInfo::NameContainer names;
-  TypeInfo::NameContainer baseNames;
-
-  type.GetActions(names);
-  baseType.GetActions(baseNames);
-
-  DALI_TEST_EQUALS( names.size(), TEST_ACTION_COUNT + baseNames.size(), TEST_LOCATION );
-
-  names.clear();
-  baseNames.clear();
-
-  type.GetSignals(names);
-  baseType.GetSignals(baseNames);
+  DALI_TEST_EQUALS( type.GetActionCount(), TEST_ACTION_COUNT + baseType.GetActionCount(), TEST_LOCATION );
 
-  DALI_TEST_EQUALS( names.size(), TEST_SIGNAL_COUNT + baseNames.size(), TEST_LOCATION );
+  DALI_TEST_EQUALS( type.GetSignalCount(), TEST_SIGNAL_COUNT + baseType.GetSignalCount(), TEST_LOCATION );
 
   {
     TestConnectionTracker tracker;
@@ -942,7 +916,7 @@ int UtcDaliTypeRegistryTypeActionP(void)
   BaseHandle handle = type.CreateInstance();
   DALI_TEST_CHECK( handle );
 
-  std::vector<Property::Value> attributes;
+  Property::Map attributes;
   DALI_TEST_CHECK( handle.DoAction("act1", attributes) );
   DALI_TEST_CHECK( lastActionCustom == "act1" );
 
@@ -961,7 +935,7 @@ int UtcDaliTypeRegistryTypeActionN(void)
   BaseHandle handle = type.CreateInstance();
   DALI_TEST_CHECK( handle );
 
-  std::vector<Property::Value> attributes;
+  Property::Map attributes;
   DALI_TEST_CHECK( !handle.DoAction( "unknown-action", attributes ) );
 
   END_TEST;
@@ -1018,19 +992,17 @@ int UtcDaliTypeRegistryPropertyRegistrationP(void)
   // Check property count of type-info is 1
   Property::IndexContainer indices;
   typeInfo.GetPropertyIndices( indices );
-  DALI_TEST_EQUALS( indices.size(), 1u, TEST_LOCATION );
+  DALI_TEST_EQUALS( indices.Size(), 1u, TEST_LOCATION );
 
   // check property name count
-  TypeInfo::NameContainer names;
-  typeInfo.GetProperties(names);
-  DALI_TEST_CHECK( 1 == names.size() );
+  DALI_TEST_CHECK( 1 == typeInfo.GetPropertyCount() );
 
   // Ensure indices returned from actor and customActor differ by two
   Actor actor = Actor::New();
   actor.GetPropertyIndices( indices );
-  unsigned int actorIndices = indices.size();
+  unsigned int actorIndices = indices.Size();
   customActor.GetPropertyIndices( indices );
-  unsigned int customActorIndices = indices.size();
+  unsigned int customActorIndices = indices.Size();
   DALI_TEST_EQUALS( actorIndices + 2u, customActorIndices, TEST_LOCATION ); // Custom property + registered property
   END_TEST;
 }
@@ -1111,14 +1083,14 @@ int UtcDaliTypeRegistryAnimatablePropertyRegistrationP(void)
   // Check property count of type-info is 1
   Property::IndexContainer indices;
   typeInfo.GetPropertyIndices( indices );
-  DALI_TEST_EQUALS( indices.size(), 1u, TEST_LOCATION );
+  DALI_TEST_EQUALS( indices.Size(), 1u, TEST_LOCATION );
 
   // Ensure indices returned from actor and customActor differ by one
   Actor actor = Actor::New();
   actor.GetPropertyIndices( indices );
-  unsigned int actorIndices = indices.size();
+  unsigned int actorIndices = indices.Size();
   customActor.GetPropertyIndices( indices );
-  unsigned int customActorIndices = indices.size();
+  unsigned int customActorIndices = indices.Size();
   DALI_TEST_EQUALS( actorIndices + 1u, customActorIndices, TEST_LOCATION ); // Custom property + registered property
 
   END_TEST;
@@ -1200,7 +1172,7 @@ int UtcDaliTypeRegistryAnimatablePropertyComponentRegistrationP(void)
   // Check property count of type-info is 1
   Property::IndexContainer indices;
   typeInfo.GetPropertyIndices( indices );
-  DALI_TEST_EQUALS( indices.size(), 1u, TEST_LOCATION );
+  DALI_TEST_EQUALS( indices.Size(), 1u, TEST_LOCATION );
 
   // Register animatable property components
   std::string animatablePropertyComponentName1( "animatable-prop-1-x" );
@@ -1245,9 +1217,9 @@ int UtcDaliTypeRegistryAnimatablePropertyComponentRegistrationP(void)
   // Ensure indices returned from actor and customActor differ by three
   Actor actor = Actor::New();
   actor.GetPropertyIndices( indices );
-  unsigned int actorIndices = indices.size();
+  unsigned int actorIndices = indices.Size();
   customActor.GetPropertyIndices( indices );
-  unsigned int customActorIndices = indices.size();
+  unsigned int customActorIndices = indices.Size();
   DALI_TEST_EQUALS( actorIndices + 3u, customActorIndices, TEST_LOCATION ); // Custom property + registered property
 
   END_TEST;
@@ -1343,7 +1315,7 @@ int UtcDaliTypeRegistryActionViaBaseHandle(void)
   application.Render(0);
   DALI_TEST_CHECK(!a.IsVisible());
 
-  std::vector<Property::Value> attributes;
+  Property::Map attributes;
 
   DALI_TEST_CHECK(hdl.DoAction("show", attributes));
 
index 0e76807..636874a 100644 (file)
@@ -533,8 +533,9 @@ void CreatePropertyMap( Actor actor, Property::Map& map )
     // Default properties
     Property::IndexContainer indices;
     actor.GetPropertyIndices( indices );
-    const Property::IndexContainer::const_iterator endIter = indices.end();
-    for ( Property::IndexContainer::iterator iter = indices.begin(); iter != endIter; ++iter )
+    const Property::IndexContainer::ConstIterator endIter = indices.End();
+
+    for ( Property::IndexContainer::Iterator iter = indices.Begin(); iter != endIter; ++iter )
     {
       map[ actor.GetPropertyName( *iter ) ] = actor.GetProperty( *iter );
     }
@@ -596,6 +597,34 @@ void CreatePropertyMap( Image image, Property::Map& map )
   }
 }
 
+
+DALI_IMPORT_API bool SetRotation( const Property::Value& value, Quaternion& quaternion )
+{
+  bool done = false;
+  Property::Type type = value.GetType();
+  if( Property::VECTOR3 == type )
+  {
+    Vector3 v3;
+    value.Get(v3);
+    quaternion.SetEuler( Radian(Degree(v3.x)), Radian(Degree(v3.y)), Radian(Degree(v3.z)) );
+    done = true;
+  }
+  else if( Property::VECTOR4 == type )
+  {
+    Vector4 v4;
+    value.Get(v4);
+    quaternion = Quaternion(v4);
+    done = true;
+  }
+  else if( Property::ROTATION == type )
+  {
+    value.Get(quaternion);
+    done = true;
+  }
+
+  return done;
+}
+
 } // namespace scripting
 
 } // namespace Dali
index 6f14206..b0cd9ad 100644 (file)
@@ -311,6 +311,15 @@ DALI_IMPORT_API void CreatePropertyMap( Actor actor, Property::Map& map );
  */
 DALI_IMPORT_API void CreatePropertyMap( Image image, Property::Map& map );
 
+/**
+ * @brief Sets a quaterion rotation from a script provided value (quaternion,euler vector3,quaternion vector4)
+ *
+ * @param[in] value Propery value
+ * @param[out] quaternion Output Rotation
+ * @return true if quaternion was set
+ */
+DALI_IMPORT_API bool SetRotation( const Property::Value& value, Quaternion& quaternion );
+
 }
 
 } // namespace Dali
index 763f84a..a12f052 100644 (file)
@@ -22,7 +22,6 @@
 #include <cmath>
 #include <algorithm>
 #include <cfloat>
-#include <cstring> // for strcmp
 
 // INTERNAL INCLUDES
 
@@ -108,7 +107,7 @@ unsigned int Actor::mActorCounter = 0;
 struct Actor::RelayoutData
 {
   RelayoutData()
-  : sizeModeFactor( Vector3::ONE ), preferredSize( Vector2::ZERO ), sizeSetPolicy( SizeScalePolicy::USE_SIZE_SET ), relayoutEnabled( false ), insideRelayout( false )
+    : sizeModeFactor( Vector3::ONE ), preferredSize( Vector2::ZERO ), sizeSetPolicy( SizeScalePolicy::USE_SIZE_SET ), relayoutEnabled( false ), insideRelayout( false )
   {
     // Set size negotiation defaults
     for( unsigned int i = 0; i < Dimension::DIMENSION_COUNT; ++i )
@@ -2237,23 +2236,23 @@ bool Actor::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tra
   bool connected( true );
   Actor* actor = dynamic_cast< Actor* >( object );
 
-  if( 0 == strcmp( signalName.c_str(), SIGNAL_TOUCHED ) ) // don't want to convert char* to string
+  if( 0 == signalName.compare( SIGNAL_TOUCHED ) )
   {
     actor->TouchedSignal().Connect( tracker, functor );
   }
-  else if( 0 == strcmp( signalName.c_str(), SIGNAL_HOVERED ) )
+  else if( 0 == signalName.compare( SIGNAL_HOVERED ) )
   {
     actor->HoveredSignal().Connect( tracker, functor );
   }
-  else if( 0 == strcmp( signalName.c_str(), SIGNAL_WHEEL_EVENT ) )
+  else if( 0 == signalName.compare( SIGNAL_WHEEL_EVENT ) )
   {
     actor->WheelEventSignal().Connect( tracker, functor );
   }
-  else if( 0 == strcmp( signalName.c_str(), SIGNAL_ON_STAGE ) )
+  else if( 0 == signalName.compare( SIGNAL_ON_STAGE ) )
   {
     actor->OnStageSignal().Connect( tracker, functor );
   }
-  else if( 0 == strcmp( signalName.c_str(), SIGNAL_OFF_STAGE ) )
+  else if( 0 == signalName.compare( SIGNAL_OFF_STAGE ) )
   {
     actor->OffStageSignal().Connect( tracker, functor );
   }
@@ -2582,11 +2581,11 @@ unsigned int Actor::GetDefaultPropertyCount() const
 
 void Actor::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
 {
-  indices.reserve( DEFAULT_PROPERTY_COUNT );
+  indices.Reserve( DEFAULT_PROPERTY_COUNT );
 
   for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
   {
-    indices.push_back( i );
+    indices.PushBack( i );
   }
 }
 
@@ -2608,7 +2607,7 @@ Property::Index Actor::GetDefaultPropertyIndex( const std::string& name ) const
   for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
   {
     const Internal::PropertyDetails* property = &DEFAULT_PROPERTY_DETAILS[ i ];
-    if( 0 == strcmp( name.c_str(), property->name ) ) // dont want to convert rhs to string
+    if( 0 == name.compare( property->name ) )
     {
       index = i;
       break;
@@ -3858,19 +3857,19 @@ SceneGraph::Node* Actor::CreateNode() const
   return Node::New();
 }
 
-bool Actor::DoAction( BaseObject* object, const std::string& actionName, const std::vector< Property::Value >& attributes )
+bool Actor::DoAction( BaseObject* object, const std::string& actionName, const Property::Map& /* attributes */ )
 {
   bool done = false;
   Actor* actor = dynamic_cast< Actor* >( object );
 
   if( actor )
   {
-    if( 0 == strcmp( actionName.c_str(), ACTION_SHOW ) ) // dont want to convert char* to string
+    if( 0 == actionName.compare( ACTION_SHOW ) )
     {
       actor->SetVisible( true );
       done = true;
     }
-    else if( 0 == strcmp( actionName.c_str(), ACTION_HIDE ) )
+    else if( 0 == actionName.compare( ACTION_HIDE ) )
     {
       actor->SetVisible( false );
       done = true;
index 448a462..412d2a0 100644 (file)
@@ -1520,7 +1520,7 @@ public:
    */
   static bool DoAction( BaseObject* object,
                         const std::string& actionName,
-                        const std::vector< Property::Value >& attributes );
+                        const Property::Map& attributes );
 
 public:
   // For Animation
index fb40a16..8294fa3 100644 (file)
@@ -402,12 +402,12 @@ void CameraActor::GetDefaultPropertyIndices( Property::IndexContainer& indices )
 {
   Actor::GetDefaultPropertyIndices( indices ); // Actor class properties
 
-  indices.reserve( indices.size() + DEFAULT_PROPERTY_COUNT );
+  indices.Reserve( indices.Size() + DEFAULT_PROPERTY_COUNT );
 
   int index = DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
   for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i, ++index )
   {
-    indices.push_back( index );
+    indices.PushBack( index );
   }
 }
 
index 0323e7d..1cb191e 100644 (file)
@@ -250,12 +250,12 @@ void ImageActor::GetDefaultPropertyIndices( Property::IndexContainer& indices )
 {
   RenderableActor::GetDefaultPropertyIndices( indices ); // RenderableActor class properties
 
-  indices.reserve( indices.size() + DEFAULT_PROPERTY_COUNT );
+  indices.Reserve( indices.Size() + DEFAULT_PROPERTY_COUNT );
 
   int index = DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
   for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i, ++index )
   {
-    indices.push_back( index );
+    indices.PushBack( index );
   }
 }
 
index debb79b..830384e 100644 (file)
@@ -19,7 +19,6 @@
 #include <dali/internal/event/actors/layer-impl.h>
 
 // EXTERNAL INCLUDES
-#include <cstring> // for strcmp
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
@@ -332,12 +331,12 @@ unsigned int Layer::GetDefaultPropertyCount() const
 void Layer::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
 {
   Actor::GetDefaultPropertyIndices( indices ); // Actor class properties
-  indices.reserve( indices.size() + DEFAULT_PROPERTY_COUNT );
+  indices.Reserve( indices.Size() + DEFAULT_PROPERTY_COUNT );
 
   int index = DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
   for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i, ++index )
   {
-    indices.push_back( index );
+    indices.PushBack( index );
   }
 }
 
@@ -413,7 +412,7 @@ Property::Index Layer::GetDefaultPropertyIndex(const std::string& name) const
   for( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
   {
     const Internal::PropertyDetails* property = &DEFAULT_PROPERTY_DETAILS[i];
-    if( 0 == strcmp( name.c_str(), property->name ) ) // dont want to convert rhs to string
+    if( 0 == name.compare( property->name ) ) // dont want to convert rhs to string
     {
       index = i + DEFAULT_DERIVED_ACTOR_PROPERTY_START_INDEX;
       break;
@@ -491,29 +490,29 @@ Property::Value Layer::GetDefaultProperty( Property::Index index ) const
   return ret;
 }
 
-bool Layer::DoAction( BaseObject* object, const std::string& actionName, const std::vector<Property::Value>& attributes )
+bool Layer::DoAction( BaseObject* object, const std::string& actionName, const Property::Map& /*attributes*/ )
 {
   bool done = false;
   Layer* layer = dynamic_cast<Layer*>( object );
 
   if( layer )
   {
-    if( 0 == strcmp( actionName.c_str(), ACTION_RAISE ) )
+    if( 0 == actionName.compare( ACTION_RAISE ) )
     {
       layer->Raise();
       done = true;
     }
-    else if( 0 == strcmp( actionName.c_str(), ACTION_LOWER ) )
+    else if( 0 == actionName.compare( ACTION_LOWER ) )
     {
       layer->Lower();
       done = true;
     }
-    else if( 0 == strcmp( actionName.c_str(), ACTION_RAISE_TO_TOP ) )
+    else if( 0 == actionName.compare( ACTION_RAISE_TO_TOP ) )
     {
       layer->RaiseToTop();
       done = true;
     }
-    else if( 0 == strcmp( actionName.c_str(), ACTION_LOWER_TO_BOTTOM ) )
+    else if( 0 == actionName.compare( ACTION_LOWER_TO_BOTTOM ) )
     {
       layer->LowerToBottom();
       done = true;
index 22a74be..ebdf48b 100644 (file)
@@ -198,7 +198,7 @@ public:
   /**
    * @copydoc Dali::Internal::Actor::DoAction()
    */
-  static bool DoAction(BaseObject* object, const std::string& actionName, const std::vector<Property::Value>& attributes);
+  static bool DoAction(BaseObject* object, const std::string& actionName, const Property::Map& attributes);
 
 public: // Default property extensions from Object
   /**
index cbd91ec..1aa61e7 100644 (file)
@@ -17,9 +17,9 @@
 
 // CLASS HEADER
 #include <dali/internal/event/animation/animation-impl.h>
+#include <dali/public-api/object/property-map.h>
 
 // EXTERNAL INCLUDES
-#include <cstring> // for strcmp
 
 // INTERNAL INCLUDES
 #include <dali/public-api/actors/actor.h>
@@ -765,7 +765,7 @@ bool Animation::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface*
   bool connected( true );
   Animation* animation = dynamic_cast<Animation*>(object);
 
-  if ( 0 == strcmp( signalName.c_str(), SIGNAL_FINISHED ) )
+  if( 0 == signalName.compare( SIGNAL_FINISHED ) )
   {
     animation->FinishedSignal().Connect( tracker, functor );
   }
@@ -859,29 +859,29 @@ void Animation::Hide(Actor& actor, float delaySeconds)
                                                       TimePeriod(delaySeconds, 0.0f/*immediate*/) ) );
 }
 
-bool Animation::DoAction( BaseObject* object, const std::string& actionName, const std::vector<Property::Value>& attributes )
+bool Animation::DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes )
 {
   bool done = false;
   Animation* animation = dynamic_cast<Animation*>( object );
 
   if( animation )
   {
-    if( 0 == strcmp( actionName.c_str(), ACTION_PLAY ) )
+    if( 0 == actionName.compare( ACTION_PLAY ) )
     {
-      if( attributes.size() > 0 )
+      if( Property::Value* value = attributes.Find("duration", Property::FLOAT) )
       {
-        animation->SetDuration( attributes[0].Get<float>() );
+        animation->SetDuration( value->Get<float>() );
       }
 
       animation->Play();
       done = true;
     }
-    else if( 0 == strcmp( actionName.c_str(), ACTION_STOP ) )
+    else if( 0 == actionName.compare( ACTION_STOP ) )
     {
       animation->Stop();
       done = true;
     }
-    else if( 0 == strcmp( actionName.c_str(), ACTION_PAUSE ) )
+    else if( 0 == actionName.compare( ACTION_PAUSE ) )
     {
       animation->Pause();
       done = true;
index bbf68b1..6272042 100644 (file)
@@ -188,7 +188,7 @@ public:
    * @param[in] attributes The attributes with which to perfrom this action.
    * @return true if action was done
    */
-  static bool DoAction(BaseObject* object, const std::string& actionName, const std::vector<Property::Value>& attributes);
+  static bool DoAction(BaseObject* object, const std::string& actionName, const Property::Map& attributes);
 
   /**
    * This callback is intended for internal use only, to avoid the overhead of using a signal.
index 8d9d014..22c9dfe 100644 (file)
@@ -64,11 +64,11 @@ unsigned int LinearConstrainer::GetDefaultPropertyCount() const
 
 void LinearConstrainer::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
 {
-  indices.reserve( DEFAULT_PROPERTY_COUNT );
+  indices.Reserve( DEFAULT_PROPERTY_COUNT );
 
   for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
   {
-    indices.push_back( i );
+    indices.PushBack( i );
   }
 }
 
index 4e5c0d9..7e5111c 100644 (file)
@@ -67,11 +67,11 @@ unsigned int PathConstrainer::GetDefaultPropertyCount() const
 
 void PathConstrainer::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
 {
-  indices.reserve( DEFAULT_PROPERTY_COUNT );
+  indices.Reserve( DEFAULT_PROPERTY_COUNT );
 
   for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
   {
-    indices.push_back( i );
+    indices.PushBack( i );
   }
 }
 
index c696a97..1572cae 100644 (file)
@@ -93,11 +93,11 @@ unsigned int Path::GetDefaultPropertyCount() const
 
 void Path::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
 {
-  indices.reserve( DEFAULT_PROPERTY_COUNT );
+  indices.Reserve( DEFAULT_PROPERTY_COUNT );
 
   for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
   {
-    indices.push_back( i );
+    indices.PushBack( i );
   }
 }
 
index 787c694..d09d502 100644 (file)
@@ -488,7 +488,7 @@ Property::Value Object::GetProperty(Property::Index index) const
 
 void Object::GetPropertyIndices( Property::IndexContainer& indices ) const
 {
-  indices.clear();
+  indices.Clear();
 
   // Default Properties
   GetDefaultPropertyIndices( indices );
@@ -503,14 +503,14 @@ void Object::GetPropertyIndices( Property::IndexContainer& indices ) const
   // Custom Properties
   if ( mCustomProperties.Count() > 0 )
   {
-    indices.reserve( indices.size() + mCustomProperties.Count() );
+    indices.Reserve( indices.Size() + mCustomProperties.Count() );
 
     PropertyMetadataLookup::ConstIterator iter = mCustomProperties.Begin();
     const PropertyMetadataLookup::ConstIterator endIter = mCustomProperties.End();
     int i=0;
     for ( ; iter != endIter; ++iter, ++i )
     {
-      indices.push_back( PROPERTY_CUSTOM_START_INDEX + i );
+      indices.PushBack( PROPERTY_CUSTOM_START_INDEX + i );
     }
   }
 }
index 2156b39..7efff52 100644 (file)
@@ -138,7 +138,7 @@ BaseHandle TypeInfo::CreateInstance() const
   return ret;
 }
 
-bool TypeInfo::DoActionTo(BaseObject *object, const std::string &actionName, const std::vector<Property::Value> &properties)
+  bool TypeInfo::DoActionTo(BaseObject *object, const std::string &actionName, const Property::Map &properties)
 {
   bool done = false;
 
@@ -200,68 +200,114 @@ Dali::TypeInfo::CreateFunction TypeInfo::GetCreator() const
   return mCreate;
 }
 
-void TypeInfo::GetActions( Dali::TypeInfo::NameContainer& ret ) const
+size_t TypeInfo::GetActionCount() const
 {
-  for(ActionContainer::const_iterator iter = mActions.begin(); iter != mActions.end(); ++iter)
-  {
-    ret.push_back(iter->first);
-  }
+  size_t count = mActions.size();
 
   Dali::TypeInfo base = Dali::TypeRegistry::Get().GetTypeInfo( mBaseTypeName );
   while( base )
   {
-    for(ActionContainer::const_iterator iter = GetImplementation(base).mActions.begin();
-        iter != GetImplementation(base).mActions.end(); ++iter)
-    {
-      ret.push_back(iter->first);
-    }
-
+    count += GetImplementation(base).mActions.size();
     base = Dali::TypeRegistry::Get().GetTypeInfo( base.GetBaseName() );
   }
+
+  return count;
 }
 
-void TypeInfo::GetSignals(Dali::TypeInfo::NameContainer& ret) const
+std::string TypeInfo::GetActionName(size_t index) const
 {
-  for(ConnectorContainer::const_iterator iter = mSignalConnectors.begin(); iter != mSignalConnectors.end(); ++iter)
+  std::string name;
+
+  if( index < mActions.size() )
   {
-    ret.push_back(iter->first);
+    name = mActions[index].first;
   }
+  else
+  {
+    size_t count = mActions.size();
+
+    Dali::TypeInfo base = Dali::TypeRegistry::Get().GetTypeInfo( mBaseTypeName );
+    while( base )
+    {
+      size_t baseCount = GetImplementation(base).mActions.size();
+
+      if( index < count + baseCount )
+      {
+        name = GetImplementation(base).mActions[ index - count ].first;
+        break;
+      }
+
+      count += baseCount;
+
+      base = Dali::TypeRegistry::Get().GetTypeInfo( base.GetBaseName() );
+    }
+  }
+
+  return name;
+}
+
+size_t TypeInfo::GetSignalCount() const
+{
+  size_t count = mSignalConnectors.size();
 
   Dali::TypeInfo base = Dali::TypeRegistry::Get().GetTypeInfo( mBaseTypeName );
   while( base )
   {
-    for(ConnectorContainer::const_iterator iter = GetImplementation(base).mSignalConnectors.begin();
-        iter != GetImplementation(base).mSignalConnectors.end(); ++iter)
+    count += GetImplementation(base).mSignalConnectors.size();
+    base = Dali::TypeRegistry::Get().GetTypeInfo( base.GetBaseName() );
+  }
+
+  return count;
+}
+
+std::string TypeInfo::GetSignalName(size_t index) const
+{
+  std::string name;
+
+  if( index < mSignalConnectors.size() )
+  {
+    name = mSignalConnectors[index].first;
+  }
+  else
+  {
+    size_t count = mSignalConnectors.size();
+
+    Dali::TypeInfo base = Dali::TypeRegistry::Get().GetTypeInfo( mBaseTypeName );
+    while( base )
     {
-      ret.push_back(iter->first);
-    }
+      size_t baseCount = GetImplementation(base).mSignalConnectors.size();
 
-    base = Dali::TypeRegistry::Get().GetTypeInfo( base.GetBaseName() );
+      if( index < count + baseCount )
+      {
+        name = GetImplementation(base).mSignalConnectors[ index - count ].first;
+        break;
+      }
+
+      count += baseCount;
+
+      base = Dali::TypeRegistry::Get().GetTypeInfo( base.GetBaseName() );
+    }
   }
+
+  return name;
 }
 
-void TypeInfo::GetProperties( Dali::TypeInfo::NameContainer& ret ) const
+std::string TypeInfo::GetPropertyName(size_t index) const
 {
+  std::string name;
   Property::IndexContainer indices;
 
   GetPropertyIndices(indices);
 
-  ret.reserve(indices.size());
-
-  for(Property::IndexContainer::iterator iter = indices.begin(); iter != indices.end(); ++iter)
+  if( index < indices.Size() )
   {
-    const std::string& name = GetPropertyName( *iter );
-    if(name.size())
-    {
-      ret.push_back( name );
-    }
-    else
-    {
-      DALI_LOG_WARNING("Property had no name\n");
-    }
+    name = GetPropertyName( indices[index] );
   }
+
+  return name;
 }
 
+
 void TypeInfo::GetPropertyIndices( Property::IndexContainer& indices ) const
 {
   Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
@@ -273,12 +319,12 @@ void TypeInfo::GetPropertyIndices( Property::IndexContainer& indices ) const
 
   if ( ! mRegisteredProperties.empty() )
   {
-    indices.reserve( indices.size() + mRegisteredProperties.size() );
+    indices.Reserve( indices.Size() + mRegisteredProperties.size() );
 
     const RegisteredPropertyContainer::const_iterator endIter = mRegisteredProperties.end();
     for ( RegisteredPropertyContainer::const_iterator iter = mRegisteredProperties.begin(); iter != endIter; ++iter )
     {
-      indices.push_back( iter->first );
+      indices.PushBack( iter->first );
     }
   }
 }
@@ -410,9 +456,9 @@ void TypeInfo::AddAnimatablePropertyComponent( const std::string& name, Property
   DALI_ASSERT_ALWAYS( success && "Property component already registered" );
 }
 
-unsigned int TypeInfo::GetPropertyCount() const
+size_t TypeInfo::GetPropertyCount() const
 {
-  unsigned int count( mRegisteredProperties.size() );
+  size_t count( mRegisteredProperties.size() );
 
   Dali::TypeInfo base = TypeRegistry::Get()->GetTypeInfo( mBaseTypeName );
   while ( base )
index 65430b9..9055e35 100644 (file)
@@ -76,19 +76,34 @@ public:
   Dali::TypeInfo::CreateFunction GetCreator() const;
 
   /**
-   * @copydoc Dali::TypeInfo::GetActions
+   * @copydoc Dali::TypeInfo::GetActionCount
    */
-  void GetActions( Dali::TypeInfo::NameContainer& container ) const;
+  size_t GetActionCount() const;
 
   /**
-   * @copydoc Dali::TypeInfo::GetSignals
+   * @copydoc Dali::TypeInfo::GetActionName
    */
-  void GetSignals( Dali::TypeInfo::NameContainer& container) const;
+  std::string GetActionName(size_t index) const;
 
   /**
-   * @copydoc Dali::TypeInfo::GetProperties
+   * @copydoc Dali::TypeInfo::GetSignalCount
    */
-  void GetProperties( Dali::TypeInfo::NameContainer& container) const;
+  size_t GetSignalCount() const;
+
+  /**
+   * @copydoc Dali::TypeInfo::GetSignalName
+   */
+  std::string GetSignalName(size_t index) const;
+
+  /**
+   * @copydoc Dali::TypeInfo::GetPropertyCount
+   */
+  size_t GetPropertyCount() const;
+
+  /**
+   * @copydoc Dali::TypeInfo::GetPropertyName
+   */
+  std::string GetPropertyName(size_t index) const;
 
   /**
    * Adds the property indices to the container specified.
@@ -148,7 +163,7 @@ public:
    * @param [in] properties The arguments of the action
    * @return bool If the action could be executed
    */
-  bool DoActionTo(BaseObject *object, const std::string &actionName, const std::vector<Property::Value> &properties);
+  bool DoActionTo(BaseObject *object, const std::string &actionName, const Property::Map &properties);
 
   /**
    * Connects a callback function with the object's signals.
@@ -162,12 +177,6 @@ public:
   bool ConnectSignal( BaseObject* object, ConnectionTrackerInterface* connectionTracker, const std::string& signalName, FunctorDelegate* functor );
 
   /**
-   * Retrieve the property count for this type.
-   * @return The total number of properties.
-   */
-  unsigned int GetPropertyCount() const;
-
-  /**
    * Given a property name, retrieve the index.
    * @param[in] name The name of the property.
    * @return The index associated with that name.
index eca99bc..d875fc5 100644 (file)
@@ -99,18 +99,27 @@ Dali::TypeInfo TypeRegistry::GetTypeInfo( const std::type_info& registerType )
   return ret;
 }
 
-Dali::TypeRegistry::NameContainer TypeRegistry::GetTypeNames() const
+size_t TypeRegistry::GetTypeNameCount() const
 {
-  Dali::TypeRegistry::NameContainer ret;
+  return mRegistryLut.size();
+}
+
+
+std::string TypeRegistry::GetTypeName(size_t index) const
+{
+  std::string name;
 
-  for(RegistryMap::const_iterator iter = mRegistryLut.begin(); iter != mRegistryLut.end(); ++iter)
+  if( index < mRegistryLut.size() )
   {
-    ret.push_back(iter->first);
+    RegistryMap::const_iterator iter = mRegistryLut.begin();
+    std::advance(iter, index);
+    name = iter->first;
   }
 
-  return ret;
+  return name;
 }
 
+
 bool TypeRegistry::Register( const std::type_info& theTypeInfo, const std::type_info& baseTypeInfo,
                              Dali::TypeInfo::CreateFunction createInstance, bool callCreateOnInit )
 {
@@ -239,7 +248,7 @@ bool TypeRegistry::RegisterAnimatablePropertyComponent( TypeRegistration& regist
   return false;
 }
 
-bool TypeRegistry::DoActionTo( BaseObject * const object, const std::string &actionName, const std::vector<Property::Value> &properties)
+bool TypeRegistry::DoActionTo( BaseObject * const object, const std::string &actionName, const Property::Map &properties)
 {
   bool done = false;
 
index c3f5c90..5423349 100644 (file)
@@ -56,9 +56,14 @@ public:
   Dali::TypeInfo GetTypeInfo( const std::type_info& registerType );
 
   /*
-   * @copydoc Dali::TypeRegistry::GetTypeNames
+   * @copydoc Dali::TypeRegistry::GetTypeNameCount
    */
-  Dali::TypeRegistry::NameContainer GetTypeNames() const;
+  size_t GetTypeNameCount() const;
+
+  /*
+   * @copydoc Dali::TypeRegistry::GetTypeName
+   */
+  std::string GetTypeName(size_t index) const;
 
   /*
    * Register a creation function under a unique name.
@@ -136,7 +141,7 @@ public:
    * @copydoc Dali::Internal::TypeInfo::DoActionTo
    * Walks all base types until it finds a doer.
    */
-  bool DoActionTo( BaseObject * const object, const std::string &actionName, const std::vector<Property::Value> &properties);
+  bool DoActionTo( BaseObject * const object, const std::string &actionName, const Property::Map& properties);
 
   /**
    * @copydoc Dali::BaseHandle::ConnectSignal()
index 0eaa1ab..58ff0eb 100644 (file)
@@ -383,11 +383,11 @@ unsigned int ShaderEffect::GetDefaultPropertyCount() const
 
 void ShaderEffect::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
 {
-  indices.reserve( DEFAULT_PROPERTY_COUNT );
+  indices.Reserve( DEFAULT_PROPERTY_COUNT );
 
   for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
   {
-    indices.push_back( i );
+    indices.PushBack( i );
   }
 }
 
index eb2060d..b3ef831 100644 (file)
@@ -140,19 +140,21 @@ void GestureDetector::DetachAll()
   }
 }
 
-std::vector<Dali::Actor> GestureDetector::GetAttachedActors() const
+size_t GestureDetector::GetAttachedActorCount() const
 {
-  // Will only be used by Public API.
-  // Unlikely that it will be called that often so copying should be OK.
+  return mAttachedActors.size();
+}
 
-  std::vector<Dali::Actor> actors;
+Dali::Actor GestureDetector::GetAttachedActor(size_t index) const
+{
+  Dali::Actor actor;
 
-  for ( GestureDetectorActorContainer::const_iterator iter = mAttachedActors.begin(), endIter = mAttachedActors.end(); iter != endIter; ++iter )
+  if( index < mAttachedActors.size() )
   {
-    actors.push_back(Dali::Actor(*iter));
+    actor = Dali::Actor( mAttachedActors[index] );
   }
 
-  return actors;
+  return actor;
 }
 
 bool GestureDetector::IsAttached(Actor& actor) const
index 3fc429c..5168a4b 100644 (file)
@@ -76,9 +76,14 @@ public:
   void DetachAll();
 
   /**
-   * @copydoc Dali::GestureDetector::GetAttachedActors() const
+   * @copydoc Dali::GestureDetector::GetAttachedActorCount() const
    */
-  std::vector<Dali::Actor> GetAttachedActors() const;
+  size_t GetAttachedActorCount() const;
+
+  /**
+   * @copydoc Dali::GestureDetector::GetAttachedActor() const
+   */
+  Dali::Actor GetAttachedActor(size_t index) const;
 
   /**
    * Returns a const reference to the container of attached actor pointers.
index 49028e6..bb830ab 100644 (file)
@@ -187,11 +187,24 @@ void PanGestureDetector::AddDirection( Radian direction, Radian threshold )
   AddAngle( direction, threshold );
 }
 
-const PanGestureDetector::AngleContainer& PanGestureDetector::GetAngles() const
+size_t PanGestureDetector::GetAngleCount() const
 {
-  return mAngleContainer;
+  return mAngleContainer.size();
 }
 
+PanGestureDetector::AngleThresholdPair PanGestureDetector::GetAngle(size_t index) const
+{
+  PanGestureDetector::AngleThresholdPair ret( Radian(0),Radian(0) );
+
+  if( index < mAngleContainer.size() )
+  {
+    ret = mAngleContainer[index];
+  }
+
+  return ret;
+}
+
+
 void PanGestureDetector::ClearAngles()
 {
   mAngleContainer.clear();
@@ -320,12 +333,12 @@ unsigned int PanGestureDetector::GetDefaultPropertyCount() const
 
 void PanGestureDetector::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
 {
-  indices.reserve( DEFAULT_PROPERTY_COUNT );
+  indices.Reserve( DEFAULT_PROPERTY_COUNT );
 
   int index = DEFAULT_GESTURE_DETECTOR_PROPERTY_START_INDEX;
   for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i, ++index )
   {
-    indices.push_back( index );
+    indices.PushBack( index );
   }
 }
 
index 257d123..ebf040e 100644 (file)
@@ -49,8 +49,8 @@ class PanGestureDetector : public GestureDetector
 {
 public: // Typedefs
 
-  typedef Dali::PanGestureDetector::AngleContainer AngleContainer;
   typedef Dali::PanGestureDetector::AngleThresholdPair AngleThresholdPair;
+  typedef std::vector<AngleThresholdPair> AngleContainer;
 
 public: // Creation
 
@@ -98,9 +98,14 @@ public:
   void AddDirection( Radian direction, Radian threshold );
 
   /**
-   * @copydoc Dali::PanGestureDetector::GetAngles()
+   * @copydoc Dali::PanGestureDetector::GetAngleCount()
    */
-  const AngleContainer& GetAngles() const;
+  size_t GetAngleCount() const;
+
+  /**
+   * @copydoc Dali::PanGestureDetector::GetAngle()
+   */
+  AngleThresholdPair GetAngle(size_t index) const;
 
   /**
    * @copydoc Dali::PanGestureDetector::ClearAngles()
index 2073d51..97a4328 100644 (file)
@@ -206,11 +206,11 @@ unsigned int AnimatableMesh::GetDefaultPropertyCount() const
 
 void AnimatableMesh::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
 {
-  indices.reserve( mPropertyCount );
+  indices.Reserve( mPropertyCount );
 
   for ( int i = 0; i < mPropertyCount; ++i )
   {
-    indices.push_back( i );
+    indices.PushBack( i );
   }
 }
 
index 8edb7b3..ff8c400 100644 (file)
@@ -453,11 +453,11 @@ unsigned int RenderTask::GetDefaultPropertyCount() const
 
 void RenderTask::GetDefaultPropertyIndices( Property::IndexContainer& indices ) const
 {
-  indices.reserve( DEFAULT_PROPERTY_COUNT );
+  indices.Reserve( DEFAULT_PROPERTY_COUNT );
 
   for ( int i = 0; i < DEFAULT_PROPERTY_COUNT; ++i )
   {
-    indices.push_back( i );
+    indices.PushBack( i );
   }
 }
 
index 0c27828..16f2be0 100644 (file)
@@ -68,9 +68,14 @@ void GestureDetector::DetachAll()
   GetImplementation(*this).DetachAll();
 }
 
-std::vector<Actor> GestureDetector::GetAttachedActors() const
+size_t GestureDetector::GetAttachedActorCount() const
 {
-  return GetImplementation(*this).GetAttachedActors();
+  return GetImplementation(*this).GetAttachedActorCount();
+}
+
+Actor GestureDetector::GetAttachedActor(size_t index) const
+{
+  return GetImplementation(*this).GetAttachedActor(index);
 }
 
 } // namespace Dali
index d6bc55d..1b7ce75 100644 (file)
@@ -117,12 +117,20 @@ public: // Actor related
   void DetachAll();
 
   /**
-   * @brief Returns a vector of actors attached to the gesture detector.
+   * @brief Returns the number of actors attached to the gesture detector.
    *
-   * @return The attached actor vector.
+   * @return The count
    * @pre The gesture detector has been initialized.
    */
-  std::vector<Actor> GetAttachedActors() const;
+  size_t GetAttachedActorCount() const;
+
+  /**
+   * @brief Returns an actor by index. An empty handle if the index is not valid.
+   *
+   * @return The attached actor or an empty handle.
+   * @pre The gesture detector has been initialized.
+   */
+  Actor GetAttachedActor(size_t index) const;
 
 protected:
 
index 398c015..78ed53d 100644 (file)
@@ -98,9 +98,14 @@ void PanGestureDetector::AddDirection( Radian direction, Radian threshold )
   GetImplementation(*this).AddDirection( direction, threshold );
 }
 
-const PanGestureDetector::AngleContainer& PanGestureDetector::GetAngles() const
+size_t PanGestureDetector::GetAngleCount() const
 {
-  return GetImplementation(*this).GetAngles();
+  return GetImplementation(*this).GetAngleCount();
+}
+
+PanGestureDetector::AngleThresholdPair PanGestureDetector::GetAngle(size_t index) const
+{
+  return GetImplementation(*this).GetAngle(index);
 }
 
 void PanGestureDetector::ClearAngles()
index e41e63e..84fb8dc 100644 (file)
@@ -83,7 +83,6 @@ public:
 
   // Directional Pan
   typedef std::pair< Radian, Radian > AngleThresholdPair; ///< Range of angles for a direction
-  typedef std::vector< AngleThresholdPair > AngleContainer; ///< Group of angular thresholds for all directions
 
   static const Radian DIRECTION_LEFT;       ///< For a left pan (-PI Radians).
   static const Radian DIRECTION_RIGHT;      ///< For a right pan (0 Radians).
@@ -238,12 +237,21 @@ public: // Directional Panning
   void AddDirection( Radian direction, Radian threshold = DEFAULT_THRESHOLD );
 
   /**
-   * @brief Returns the container of all the angles this pan gesture detector emits a signal.
+   * @brief Returns the count of angles that this pan gesture detector emits a signal.
    *
-   * @return a const reference to the container of all the angles.
+   * @return The count.
    * @pre The gesture detector has been initialized.
    */
-  const AngleContainer& GetAngles() const;
+  size_t GetAngleCount() const;
+
+  /**
+   * @brief Returns the angle by index that this pan gesture detector emits a signal.
+   *
+   * @return an angle threshold pair, or a zero valued angle pair when index is invalid.
+   * @pre The gesture detector has been initialized.
+   * @pre The index is less than GetAngleCount()
+   */
+  AngleThresholdPair GetAngle(size_t index) const;
 
   /**
    * @brief Clears any directional angles that are used by the gesture detector.
index cf8e790..24085ea 100644 (file)
@@ -57,7 +57,7 @@ BaseHandle& BaseHandle::operator=(const BaseHandle& rhs)
   return *this;
 }
 
-bool BaseHandle::DoAction(const std::string& command, const std::vector<Property::Value>& attributes)
+bool BaseHandle::DoAction(const std::string& command, const Property::Map& attributes)
 {
   return GetImplementation(*this).DoAction( command, attributes );
 }
index 8149da9..42194e0 100644 (file)
@@ -122,7 +122,7 @@ public:
    * @param [in] attributes The list of attributes for the action.
    * @return The action is performed by the object or not.
    */
-  bool DoAction(const std::string& actionName, const std::vector<Property::Value>& attributes);
+  bool DoAction(const std::string& actionName, const Property::Map& attributes);
 
   /**
    * @brief Returns the type name for the Handle.
index f86cd81..e050fc5 100644 (file)
@@ -55,7 +55,7 @@ void BaseObject::UnregisterObject()
   }
 }
 
-bool BaseObject::DoAction(const std::string& actionName, const std::vector<Property::Value>& attributes)
+bool BaseObject::DoAction(const std::string& actionName, const Property::Map& attributes)
 {
   Dali::Internal::TypeRegistry* registry = Dali::Internal::TypeRegistry::Get();
 
index ba1193b..c39f9c5 100644 (file)
@@ -54,7 +54,7 @@ public:
   /**
    * @copydoc Dali::BaseHandle::DoAction
    */
-  bool DoAction(const std::string& actionName, const std::vector<Property::Value>& attributes);
+  bool DoAction(const std::string& actionName, const Property::Map& attributes);
 
   /**
    * @copydoc Dali::BaseHandle::GetTypeName
index e2c6fd9..882aad7 100644 (file)
@@ -93,6 +93,19 @@ Property::Value* Property::Map::Find( const std::string& key ) const
   return NULL; // Not found
 }
 
+Property::Value* Property::Map::Find( const std::string& key, Property::Type type ) const
+{
+  for ( Container::iterator iter = mImpl->mContainer.begin(), endIter = mImpl->mContainer.end(); iter != endIter; ++iter )
+  {
+    // test type first to shortcut eval (possibly reducing string compares)
+    if( (iter->second.GetType() == type) && (iter->first == key) )
+    {
+      return &iter->second;
+    }
+  }
+  return NULL; // Not found
+}
+
 void Property::Map::Clear()
 {
   mImpl->mContainer.clear();
index 002b0d4..2a41a78 100644 (file)
@@ -105,6 +105,16 @@ public:
   Value* Find( const std::string& key ) const;
 
   /**
+   * @brief Finds the value for the specified key if it exists and its type is type
+   *
+   * @param[in]  key   The key to find.
+   * @param[in]  type  The type to check.
+   *
+   * @return A const pointer to the value if it exists, NULL otherwise
+   */
+  Value* Find( const std::string& key, Property::Type type ) const;
+
+  /**
    * @brief Clears the map.
    */
   void Clear();
index 7458f09..3e7d2d3 100644 (file)
@@ -25,6 +25,7 @@
 // INTERNAL INCLUDES
 #include <dali/public-api/common/vector-wrapper.h>
 #include <dali/public-api/common/dali-common.h>
+#include <dali/public-api/common/dali-vector.h>
 
 namespace Dali
 {
@@ -44,7 +45,7 @@ struct DALI_IMPORT_API Property
   static const int INVALID_INDEX; ///< -1 is not a valid property index
   static const int INVALID_COMPONENT_INDEX; ///< -1 is not a valid property index
 
-  typedef std::vector< Index > IndexContainer; ///< A vector of property indices
+  typedef Dali::Vector< Index > IndexContainer; ///< A vector of property indices
 
   /**
    * @brief A value-type representing a property value.
index 6846c31..0aeb2f1 100644 (file)
@@ -65,24 +65,40 @@ TypeInfo::CreateFunction TypeInfo::GetCreator() const
   return GetImplementation(*this).GetCreator();
 }
 
-void TypeInfo::GetActions( TypeInfo::NameContainer& container ) const
+size_t TypeInfo::GetActionCount() const
 {
-  GetImplementation(*this).GetActions( container );
+  return GetImplementation(*this).GetActionCount();
 }
 
-void TypeInfo::GetSignals( TypeInfo::NameContainer& container ) const
+std::string TypeInfo::GetActionName(size_t index)
 {
-  GetImplementation(*this).GetSignals( container );
+  return GetImplementation(*this).GetActionName(index);
 }
 
-void TypeInfo::GetProperties( TypeInfo::NameContainer& container ) const
+size_t TypeInfo::GetSignalCount() const
 {
-  GetImplementation(*this).GetProperties( container );
+  return GetImplementation(*this).GetSignalCount();
 }
 
+std::string TypeInfo::GetSignalName(size_t index)
+{
+  return GetImplementation(*this).GetSignalName(index);
+}
+
+size_t TypeInfo::GetPropertyCount() const
+{
+  return GetImplementation(*this).GetPropertyCount();
+}
+
+std::string TypeInfo::GetPropertyName(size_t index)
+{
+  return GetImplementation(*this).GetPropertyName(index);
+}
+
+
 void TypeInfo::GetPropertyIndices( Property::IndexContainer& indices ) const
 {
-  indices.clear(); // We do not want to clear the container if called internally, so only clear here
+  indices.Clear(); // We do not want to clear the container if called internally, so only clear here
   GetImplementation(*this).GetPropertyIndices( indices );
 }
 
index 872290f..4cb68b0 100644 (file)
@@ -34,10 +34,6 @@ namespace Internal DALI_INTERNAL
   class TypeInfo;
 };
 
-typedef std::vector<Property::Value> PropertyValueContainer;
-typedef PropertyValueContainer::iterator PropertyValueIter; ///< Iterator for Dali::PropertyValueContainer
-typedef PropertyValueContainer::const_iterator PropertyValueConstIter; ///< Const iterator for Dali::PropertyValueContainer
-
 /**
  * @brief TypeInfo class for instantiation of registered types and introspection of
  * their actions and signals.
@@ -49,7 +45,7 @@ class DALI_IMPORT_API TypeInfo : public BaseHandle
 public:
   typedef BaseHandle (*CreateFunction)(); ///< Function signature for creating an instance of the associated object type.
 
-  typedef bool (*ActionFunction)(BaseObject*, const std::string&, const PropertyValueContainer&); ///< Function signature for creating scriptable actions
+  typedef bool (*ActionFunction)(BaseObject*, const std::string&, const Property::Map&); ///< Function signature for creating scriptable actions
 
   /**
    * @brief Connects a callback function with the object's signals.
@@ -83,8 +79,6 @@ public:
    */
   typedef Property::Value (*GetPropertyFunction)( BaseObject* object, Property::Index index );
 
-  typedef std::vector<std::string> NameContainer; ///< Container of names for signals and actions
-
   /**
    * @brief Allows the creation of an empty TypeInfo handle.
    */
@@ -141,25 +135,49 @@ public:
   CreateFunction GetCreator() const;
 
   /**
-   * @brief Retrieve the actions for this type.
+   * @brief Retrieve the number of actions for this type.
+   *
+   * @return The count
+   */
+  size_t GetActionCount() const;
+
+  /**
+   * @brief Retrieve the action name for the index.
+   *
+   * @param[in] index Index to lookup
+   * @return action name or empty string where index is invalid
+   */
+  std::string GetActionName(size_t index);
+
+  /**
+   * @brief Retrieve the number of signals for this type.
    *
-   * @param[in] container of action names
+   * @return The count
    */
-  void GetActions( NameContainer &container ) const;
+  size_t GetSignalCount() const;
 
   /**
-   * @brief Retrieve the signals for this type.
+   * @brief Retrieve the signal name for the index.
+   *
+   * @param[in] index Index to lookup
+   * @return signal name or empty string where index is invalid
+   */
+  std::string GetSignalName(size_t index);
+
+/**
+   * @brief Retrieve the number of propertys for this type.
    *
-   * @param[in] container of action names
+   * @return The count
    */
-  void GetSignals( NameContainer &container ) const;
+  size_t GetPropertyCount() const;
 
   /**
-   * @brief Retrieve the event side registered properties for this type.
+   * @brief Retrieve the property name for the index.
    *
-   * @param[in] container of action names
+   * @param[in] index Index to lookup
+   * @return property name or empty string where index is invalid
    */
-  void GetProperties( NameContainer &container ) const;
+  std::string GetPropertyName(size_t index);
 
   // Properties
 
index a5e4ec6..ac1f2fb 100644 (file)
@@ -61,9 +61,14 @@ Dali::TypeInfo TypeRegistry::GetTypeInfo( const std::type_info& registerType )
   return GetImplementation(*this).GetTypeInfo( registerType );
 }
 
-TypeRegistry::NameContainer TypeRegistry::GetTypeNames() const
+size_t TypeRegistry::GetTypeNameCount() const
 {
-  return GetImplementation(*this).GetTypeNames();
+  return GetImplementation(*this).GetTypeNameCount();
+}
+
+std::string TypeRegistry::GetTypeName(size_t index) const
+{
+  return GetImplementation(*this).GetTypeName(index);
 }
 
 TypeRegistry::TypeRegistry(Internal::TypeRegistry* internal)
index 2155cb5..162d3ca 100644 (file)
@@ -91,8 +91,6 @@ class TypeRegistry;
 class DALI_IMPORT_API TypeRegistry : public BaseHandle
 {
 public:
-  typedef std::vector<std::string> NameContainer; ///< Container of type names
-
   /**
    * @brief Get Type Registry handle.
    *
@@ -142,11 +140,18 @@ public:
   TypeInfo GetTypeInfo( const std::type_info& registerType );
 
   /**
-   * @brief Get type names.
+   * @brief Get type name count.
+   *
+   * @return The count
+   */
+  size_t GetTypeNameCount() const;
+
+  /**
+   * @brief Get type names by index.
    *
-   * @return list of known types by name
+   * @return The type name or an empty string when index is not valid
    */
-  NameContainer GetTypeNames() const;
+  std::string GetTypeName(size_t index) const;
 
 public: // Not intended for application developers