Change-Id: I84de3a7feee2f19a2464a07be25859faefc26059
Dali::Path path = Dali::Path::New();
Dali::Property::Array points;
Dali::Path path = Dali::Path::New();
Dali::Property::Array points;
points[0] = Vector3( xHalfSize, 0.0f, -xHalfSize);
points[1] = Vector3( 0.0f, 0.0f, 0.0f );
points[2] = Vector3( -xHalfSize, 0.0f, -xHalfSize);
path.SetProperty( Path::Property::POINTS, points );
Dali::Property::Array controlPoints;
points[0] = Vector3( xHalfSize, 0.0f, -xHalfSize);
points[1] = Vector3( 0.0f, 0.0f, 0.0f );
points[2] = Vector3( -xHalfSize, 0.0f, -xHalfSize);
path.SetProperty( Path::Property::POINTS, points );
Dali::Property::Array controlPoints;
- controlPoints.resize(4);
+ controlPoints.Resize(4);
controlPoints[0] = Vector3( xHalfSize, 0.0f, 0.0f );
controlPoints[1] = Vector3( xHalfSize, 0.0f, 0.0f );
controlPoints[2] = Vector3(-xHalfSize, 0.0f, 0.0f );
controlPoints[0] = Vector3( xHalfSize, 0.0f, 0.0f );
controlPoints[1] = Vector3( xHalfSize, 0.0f, 0.0f );
controlPoints[2] = Vector3(-xHalfSize, 0.0f, 0.0f );
#include <dali-toolkit/dali-toolkit.h>
#include <dali/integration-api/events/touch-event-integ.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali/integration-api/events/touch-event-integ.h>
using namespace Dali;
using namespace Dali::Toolkit;
using namespace Dali;
using namespace Dali::Toolkit;
Property::Array marks;
for( int i = 0; i < NUM_MARKS; ++i )
{
Property::Array marks;
for( int i = 0; i < NUM_MARKS; ++i )
{
- marks.push_back( MIN_BOUND + ( static_cast<float>(i) / ( NUM_MARKS - 1) ) * ( MAX_BOUND - MIN_BOUND ) );
+ marks.PushBack( MIN_BOUND + ( static_cast<float>(i) / ( NUM_MARKS - 1) ) * ( MAX_BOUND - MIN_BOUND ) );
}
slider.SetProperty( Slider::Property::MARKS, marks );
slider.SetProperty( Slider::Property::MARK_TOLERANCE, 0.1f );
}
slider.SetProperty( Slider::Property::MARKS, marks );
slider.SetProperty( Slider::Property::MARK_TOLERANCE, 0.1f );
#include <dali/public-api/render-tasks/render-task-list.h>
#include <dali/public-api/object/type-info.h>
#include <dali/public-api/object/type-registry.h>
#include <dali/public-api/render-tasks/render-task-list.h>
#include <dali/public-api/object/type-info.h>
#include <dali/public-api/object/type-registry.h>
+#include <dali/public-api/object/property-array.h>
#include <dali/public-api/actors/layer.h>
#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/actors/camera-actor.h>
#include <dali/public-api/actors/layer.h>
#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/actors/camera-actor.h>
}
case Property::ARRAY:
{
}
case Property::ARRAY:
{
- ret = std::string("Array Size=") + ToString( value.Get<Property::Array>().size() );
+ ret = std::string("Array Size=") + ToString( value.Get<Property::Array>().Size() );
break;
}
case Property::MAP:
break;
}
case Property::MAP:
}
case Toolkit::ScrollBar::Property::SCROLL_POSITION_INTERVALS:
{
}
case Toolkit::ScrollBar::Property::SCROLL_POSITION_INTERVALS:
{
- Property::Array propertyArray;
- value.Get(propertyArray);
-
Dali::Vector<float> positions;
Dali::Vector<float> positions;
- size_t positionCount = propertyArray.size();
+ size_t positionCount = value.GetSize();
positions.Resize( positionCount );
for( size_t i = 0; i != positionCount; ++i )
{
positions.Resize( positionCount );
for( size_t i = 0; i != positionCount; ++i )
{
- propertyArray[i].Get( positions[i]);
+ value.GetItem(i).Get( positions[i] );
}
scrollBarImpl.SetScrollPositionIntervals(positions);
}
scrollBarImpl.SetScrollPositionIntervals(positions);
mPathConstrainer.SetProperty( PathConstrainer::Property::FORWARD, forward );
Dali::Property::Value pointsProperty = path.GetProperty(Path::Property::POINTS);
mPathConstrainer.SetProperty( PathConstrainer::Property::FORWARD, forward );
Dali::Property::Value pointsProperty = path.GetProperty(Path::Property::POINTS);
- Property::Array points;
- pointsProperty.Get(points);
- mPathConstrainer.SetProperty( PathConstrainer::Property::POINTS, points );
+ mPathConstrainer.SetProperty( PathConstrainer::Property::POINTS, pointsProperty );
pointsProperty = path.GetProperty(Path::Property::CONTROL_POINTS);
pointsProperty = path.GetProperty(Path::Property::CONTROL_POINTS);
- pointsProperty.Get(points);
- mPathConstrainer.SetProperty( PathConstrainer::Property::CONTROL_POINTS, points );
+ mPathConstrainer.SetProperty( PathConstrainer::Property::CONTROL_POINTS, pointsProperty );
//Create linear constrainer
//Create linear constrainer
- Property::Array pointsLinearConstrainer;
- pointsProperty = Property::Value(pointsLinearConstrainer);
+ pointsProperty = Property::Value(Property::ARRAY);
pointsProperty.AppendItem(0.0f);
pointsProperty.AppendItem(1.0f);
pointsProperty.AppendItem(0.0f);
pointsProperty.AppendItem(0.0f);
pointsProperty.AppendItem(1.0f);
pointsProperty.AppendItem(0.0f);
void Slider::SetMarks( const MarkList& marks )
{
void Slider::SetMarks( const MarkList& marks )
{
- float value;
- for( MarkList::const_iterator it = marks.begin(), itEnd = marks.end(); it != itEnd; ++it )
- {
- const Property::Value& propertyValue = *it;
- propertyValue.Get( value );
-
- mMarks.push_back( value );
- }
}
const Slider::MarkList& Slider::GetMarks() const
}
const Slider::MarkList& Slider::GetMarks() const
const float MARK_TOLERANCE = GetMarkTolerance();
float mark;
const float MARK_TOLERANCE = GetMarkTolerance();
float mark;
- for( MarkList::iterator it = mMarks.begin(), itEnd = mMarks.end(); it != itEnd; ++it )
+ for( std::size_t i = 0; i < mMarks.Size(); ++i)
- const Property::Value& propertyValue = *it;
+ const Property::Value& propertyValue = mMarks[i];
propertyValue.Get( mark );
mark = MapValuePercentage( mark );
propertyValue.Get( mark );
mark = MapValuePercentage( mark );
float closestDist = std::numeric_limits<float>::max();
float mark;
float closestDist = std::numeric_limits<float>::max();
float mark;
- for( MarkList::iterator it = mMarks.begin(), itEnd = mMarks.end(); it != itEnd; ++it )
+ for( std::size_t i = 0; i < mMarks.Size(); ++i)
- const Property::Value& propertyValue = *it;
+ const Property::Value& propertyValue = mMarks[i];
propertyValue.Get( mark );
mark = MapValuePercentage( mark );
propertyValue.Get( mark );
mark = MapValuePercentage( mark );
// Binary search
int head = 0,
// Binary search
int head = 0,
- tail = mMarks.size() - 1;
+ tail = mMarks.Size() - 1;
// EXTERNAL INCLUDES
#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/adaptor-framework/timer.h>
// EXTERNAL INCLUDES
#include <dali/public-api/actors/image-actor.h>
#include <dali/public-api/adaptor-framework/timer.h>
+#include <dali/public-api/object/property-array.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
+#include <dali/public-api/object/property-array.h>
// INTERNAL INCLUDES
#include <v8-utils.h>
// INTERNAL INCLUDES
#include <v8-utils.h>
{
T tmp = value.Get<T>();
tmp.y = v;
{
T tmp = value.Get<T>();
tmp.y = v;
}
template <typename T, typename S>
}
template <typename T, typename S>
{
T tmp = value.Get<T>();
tmp.z = v;
{
T tmp = value.Get<T>();
tmp.z = v;
}
template <typename T, typename S>
}
template <typename T, typename S>
{
T tmp = value.Get<T>();
tmp.w = v;
{
T tmp = value.Get<T>();
tmp.w = v;
}
template <typename T, typename S>
void SetWidth( Dali::Property::Value &value, S& v)
{
T tmp = value.Get<T>();
tmp.width = v;
}
template <typename T, typename S>
void SetWidth( Dali::Property::Value &value, S& v)
{
T tmp = value.Get<T>();
tmp.width = v;
}
template <typename T, typename S>
}
template <typename T, typename S>
{
T tmp = value.Get<T>();
tmp.height = v;
{
T tmp = value.Get<T>();
tmp.height = v;
}
v8::Handle< v8::Value > GetV8ValueFrom( v8::Isolate* isolate,
}
v8::Handle< v8::Value > GetV8ValueFrom( v8::Isolate* isolate,
if( field == "x" || field == "width" )
{
if( field == "x" || field == "width" )
{
- Dali::Vector2 v2 = value.Get<Dali::Vector2>() ;
- ret = v8::Number::New( isolate, v2.x) ;
+ Dali::Vector2 v2 = value.Get<Dali::Vector2>();
+ ret = v8::Number::New( isolate, v2.x);
}
else if(field == "y" || field == "height")
{
}
else if(field == "y" || field == "height")
{
- Dali::Vector2 v2 = value.Get<Dali::Vector2>() ;
- ret = v8::Number::New( isolate, v2.y) ;
+ Dali::Vector2 v2 = value.Get<Dali::Vector2>();
+ ret = v8::Number::New( isolate, v2.y);
if(field == "x" || field == "width" || field == "r")
{
if(field == "x" || field == "width" || field == "r")
{
- Dali::Vector3 v3 = value.Get<Dali::Vector3>() ;
- ret = v8::Number::New( isolate, v3.x) ;
+ Dali::Vector3 v3 = value.Get<Dali::Vector3>();
+ ret = v8::Number::New( isolate, v3.x);
}
else if(field == "y" || field == "height" || field == "g")
{
}
else if(field == "y" || field == "height" || field == "g")
{
- Dali::Vector3 v3 = value.Get<Dali::Vector3>() ;
- ret = v8::Number::New( isolate, v3.y) ;
+ Dali::Vector3 v3 = value.Get<Dali::Vector3>();
+ ret = v8::Number::New( isolate, v3.y);
}
else if(field == "z" || field == "depth" || field == "b")
{
}
else if(field == "z" || field == "depth" || field == "b")
{
- Dali::Vector3 v3 = value.Get<Dali::Vector3>() ;
- ret = v8::Number::New( isolate, v3.z) ;
+ Dali::Vector3 v3 = value.Get<Dali::Vector3>();
+ ret = v8::Number::New( isolate, v3.z);
if(field == "x" || field == "s" || field == "r")
{
if(field == "x" || field == "s" || field == "r")
{
- Dali::Vector4 v4 = value.Get<Dali::Vector4>() ;
- ret = v8::Number::New( isolate, v4.x) ;
+ Dali::Vector4 v4 = value.Get<Dali::Vector4>();
+ ret = v8::Number::New( isolate, v4.x);
}
else if(field == "y" || field == "g" || field == "t")
{
}
else if(field == "y" || field == "g" || field == "t")
{
- Dali::Vector4 v4 = value.Get<Dali::Vector4>() ;
- ret = v8::Number::New( isolate, v4.y) ;
+ Dali::Vector4 v4 = value.Get<Dali::Vector4>();
+ ret = v8::Number::New( isolate, v4.y);
}
else if(field == "z" || field == "r" || field == "b")
{
}
else if(field == "z" || field == "r" || field == "b")
{
- Dali::Vector4 v4 = value.Get<Dali::Vector4>() ;
- ret = v8::Number::New( isolate, v4.z) ;
+ Dali::Vector4 v4 = value.Get<Dali::Vector4>();
+ ret = v8::Number::New( isolate, v4.z);
}
else if(field == "w" || field == "a" || field == "q")
{
}
else if(field == "w" || field == "a" || field == "q")
{
- Dali::Vector4 v4 = value.Get<Dali::Vector4>() ;
- ret = v8::Number::New( isolate, v4.w) ;
+ Dali::Vector4 v4 = value.Get<Dali::Vector4>();
+ ret = v8::Number::New( isolate, v4.w);
if(field == "roll")
{
Dali::Vector4 v4 = value.Get<Dali::Quaternion>().EulerAngles();
if(field == "roll")
{
Dali::Vector4 v4 = value.Get<Dali::Quaternion>().EulerAngles();
- ret = v8::Number::New( isolate, v4.z) ;
+ ret = v8::Number::New( isolate, v4.z);
}
else if(field == "pitch")
{
Dali::Vector4 v4 = value.Get<Dali::Quaternion>().EulerAngles();
}
else if(field == "pitch")
{
Dali::Vector4 v4 = value.Get<Dali::Quaternion>().EulerAngles();
- ret = v8::Number::New( isolate, v4.x) ;
+ ret = v8::Number::New( isolate, v4.x);
}
else if(field == "yaw")
{
Dali::Vector4 v4 = value.Get<Dali::Quaternion>().EulerAngles();
}
else if(field == "yaw")
{
Dali::Vector4 v4 = value.Get<Dali::Quaternion>().EulerAngles();
- ret = v8::Number::New( isolate, v4.y) ;
+ ret = v8::Number::New( isolate, v4.y);
}
else if(field == "axis")
}
else if(field == "axis")
- Dali::Rect<int> r = value.Get<Dali::Rect<int> >() ;
- ret = v8::Number::New( isolate, r.x) ;
+ Dali::Rect<int> r = value.Get<Dali::Rect<int> >();
+ ret = v8::Number::New( isolate, r.x);
}
else if(field == "y")
{
}
else if(field == "y")
{
- Dali::Rect<int> r = value.Get<Dali::Rect<int> >() ;
- ret = v8::Number::New( isolate, r.y) ;
+ Dali::Rect<int> r = value.Get<Dali::Rect<int> >();
+ ret = v8::Number::New( isolate, r.y);
}
else if(field == "width")
{
}
else if(field == "width")
{
- Dali::Rect<int> r = value.Get<Dali::Rect<int> >() ;
- ret = v8::Number::New( isolate, r.width) ;
+ Dali::Rect<int> r = value.Get<Dali::Rect<int> >();
+ ret = v8::Number::New( isolate, r.width);
}
else if(field == "height")
{
}
else if(field == "height")
{
- Dali::Rect<int> r = value.Get<Dali::Rect<int> >() ;
- ret = v8::Number::New( isolate, r.height) ;
+ Dali::Rect<int> r = value.Get<Dali::Rect<int> >();
+ ret = v8::Number::New( isolate, r.height);
{
if(field == "x" || field == "width")
{
{
if(field == "x" || field == "width")
{
- SetX<Dali::Vector2>(value, asFloat) ;
+ SetX<Dali::Vector2>(value, asFloat);
}
else if(field == "y" || field == "height")
{
}
else if(field == "y" || field == "height")
{
- SetY<Dali::Vector2>(value, asFloat) ;
+ SetY<Dali::Vector2>(value, asFloat);
{
if(field == "x" || field == "width" || field == "r")
{
{
if(field == "x" || field == "width" || field == "r")
{
- SetX<Dali::Vector3>(value, asFloat) ;
+ SetX<Dali::Vector3>(value, asFloat);
}
else if(field == "y" || field == "height" || field == "g")
{
}
else if(field == "y" || field == "height" || field == "g")
{
- SetY<Dali::Vector3>(value, asFloat) ;
+ SetY<Dali::Vector3>(value, asFloat);
}
else if(field == "z" || field == "depth" || field == "b")
{
}
else if(field == "z" || field == "depth" || field == "b")
{
- SetZ<Dali::Vector3>(value, asFloat) ;
+ SetZ<Dali::Vector3>(value, asFloat);
{
if(field == "x" || field == "s" || field == "r")
{
{
if(field == "x" || field == "s" || field == "r")
{
- SetX<Dali::Vector4>(value, asFloat) ;
+ SetX<Dali::Vector4>(value, asFloat);
}
else if(field == "y" || field == "g" || field == "t")
{
}
else if(field == "y" || field == "g" || field == "t")
{
- SetY<Dali::Vector4>(value, asFloat) ;
+ SetY<Dali::Vector4>(value, asFloat);
}
else if(field == "z" || field == "r" || field == "b")
{
}
else if(field == "z" || field == "r" || field == "b")
{
- SetZ<Dali::Vector4>(value, asFloat) ;
+ SetZ<Dali::Vector4>(value, asFloat);
}
else if(field == "w" || field == "a" || field == "q")
{
}
else if(field == "w" || field == "a" || field == "q")
{
- SetW<Dali::Vector4>(value, asFloat) ;
+ SetW<Dali::Vector4>(value, asFloat);
- SetX<Dali::Rect<int> >(value, asInt) ;
+ SetX<Dali::Rect<int> >(value, asInt);
}
else if(field == "y")
{
}
else if(field == "y")
{
- SetY<Dali::Rect<int> >(value, asInt) ;
+ SetY<Dali::Rect<int> >(value, asInt);
}
else if(field == "width")
{
}
else if(field == "width")
{
- SetWidth<Dali::Rect<int> >(value, asInt) ;
+ SetWidth<Dali::Rect<int> >(value, asInt);
}
else if(field == "height")
{
}
else if(field == "height")
{
{
v8::EscapableHandleScope handleScope( isolate );
{
v8::EscapableHandleScope handleScope( isolate );
- v8::Local<v8::Value> v8Value ;
+ v8::Local<v8::Value> v8Value;
switch( value.GetType() )
{
switch( value.GetType() )
{
//Cast v8::Value to v8::Array
v8::Local<v8::Array> v8Array = v8::Local<v8::Array>::Cast( v8Value );
uint32_t elementCount = v8Array->Length();
//Cast v8::Value to v8::Array
v8::Local<v8::Array> v8Array = v8::Local<v8::Array>::Cast( v8Value );
uint32_t elementCount = v8Array->Length();
- Dali::Property::Array data( elementCount );
+ Dali::Property::Array data;
+ data.Reserve( elementCount );
bool bFound(false);
for( uint32_t i(0); i<elementCount; ++i )
{
//Get Property::Value for each element in the array
bool bFound(false);
for( uint32_t i(0); i<elementCount; ++i )
{
//Get Property::Value for each element in the array
- data[i] = V8Utils::GetPropertyValueFromObject( bFound, isolate, v8Array->Get(i) );
+ data.PushBack( V8Utils::GetPropertyValueFromObject( bFound, isolate, v8Array->Get(i) ) );
}
//return the Property::Value
}
//return the Property::Value
}
v8::Local<v8::Object > object;
}
v8::Local<v8::Object > object;
- float v[4] = {0.f,0.f,0.f,0.f} ;
+ float v[4] = {0.f,0.f,0.f,0.f};
bool foundAllArguments(false);
V8Utils::ReadFloatArguments( foundAllArguments, v, 4, args, 0.f );
bool foundAllArguments(false);
V8Utils::ReadFloatArguments( foundAllArguments, v, 4, args, 0.f );