Merge "Clean up the code to build successfully on macOS" into devel/master
[platform/core/uifw/dali-core.git] / dali / internal / event / actors / actor-property-handler.cpp
1 /*
2  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/internal/event/actors/actor-property-handler.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/math/vector2.h>
23 #include <dali/public-api/math/vector3.h>
24 #include <dali/devel-api/actors/actor-devel.h>
25 #include <dali/internal/event/actors/actor-impl.h>
26 #include <dali/internal/event/common/property-helper.h>
27 #include <dali/internal/update/nodes/node-messages.h>
28 #include <dali/internal/update/nodes/node-declarations.h>
29
30 using Dali::Internal::SceneGraph::Node;
31 using Dali::Internal::SceneGraph::AnimatableProperty;
32 using Dali::Internal::SceneGraph::PropertyBase;
33
34 namespace Dali
35 {
36
37 namespace Internal
38 {
39
40 namespace // unnamed namespace
41 {
42
43 struct AnchorValue
44 {
45   const char* name;
46   const Vector3& value;
47 };
48
49 DALI_ENUM_TO_STRING_TABLE_BEGIN_WITH_TYPE( AnchorValue, ANCHOR_CONSTANT )
50 DALI_ENUM_TO_STRING_WITH_SCOPE( AnchorPoint, TOP_LEFT )
51 DALI_ENUM_TO_STRING_WITH_SCOPE( AnchorPoint, TOP_CENTER )
52 DALI_ENUM_TO_STRING_WITH_SCOPE( AnchorPoint, TOP_RIGHT )
53 DALI_ENUM_TO_STRING_WITH_SCOPE( AnchorPoint, CENTER_LEFT )
54 DALI_ENUM_TO_STRING_WITH_SCOPE( AnchorPoint, CENTER )
55 DALI_ENUM_TO_STRING_WITH_SCOPE( AnchorPoint, CENTER_RIGHT )
56 DALI_ENUM_TO_STRING_WITH_SCOPE( AnchorPoint, BOTTOM_LEFT )
57 DALI_ENUM_TO_STRING_WITH_SCOPE( AnchorPoint, BOTTOM_CENTER )
58 DALI_ENUM_TO_STRING_WITH_SCOPE( AnchorPoint, BOTTOM_RIGHT )
59 DALI_ENUM_TO_STRING_TABLE_END( ANCHOR_CONSTANT )
60
61 DALI_ENUM_TO_STRING_TABLE_BEGIN( COLOR_MODE )
62 DALI_ENUM_TO_STRING( USE_OWN_COLOR )
63 DALI_ENUM_TO_STRING( USE_PARENT_COLOR )
64 DALI_ENUM_TO_STRING( USE_OWN_MULTIPLY_PARENT_COLOR )
65 DALI_ENUM_TO_STRING( USE_OWN_MULTIPLY_PARENT_ALPHA )
66 DALI_ENUM_TO_STRING_TABLE_END( COLOR_MODE )
67
68 DALI_ENUM_TO_STRING_TABLE_BEGIN( DRAW_MODE )
69 DALI_ENUM_TO_STRING_WITH_SCOPE( DrawMode, NORMAL )
70 DALI_ENUM_TO_STRING_WITH_SCOPE( DrawMode, OVERLAY_2D )
71 DALI_ENUM_TO_STRING_TABLE_END( DRAW_MODE )
72
73 DALI_ENUM_TO_STRING_TABLE_BEGIN( RESIZE_POLICY )
74 DALI_ENUM_TO_STRING_WITH_SCOPE( ResizePolicy, FIXED )
75 DALI_ENUM_TO_STRING_WITH_SCOPE( ResizePolicy, USE_NATURAL_SIZE )
76 DALI_ENUM_TO_STRING_WITH_SCOPE( ResizePolicy, FILL_TO_PARENT )
77 DALI_ENUM_TO_STRING_WITH_SCOPE( ResizePolicy, SIZE_RELATIVE_TO_PARENT )
78 DALI_ENUM_TO_STRING_WITH_SCOPE( ResizePolicy, SIZE_FIXED_OFFSET_FROM_PARENT )
79 DALI_ENUM_TO_STRING_WITH_SCOPE( ResizePolicy, FIT_TO_CHILDREN )
80 DALI_ENUM_TO_STRING_WITH_SCOPE( ResizePolicy, DIMENSION_DEPENDENCY )
81 DALI_ENUM_TO_STRING_WITH_SCOPE( ResizePolicy, USE_ASSIGNED_SIZE )
82 DALI_ENUM_TO_STRING_TABLE_END( RESIZE_POLICY )
83
84 DALI_ENUM_TO_STRING_TABLE_BEGIN( SIZE_SCALE_POLICY )
85 DALI_ENUM_TO_STRING_WITH_SCOPE( SizeScalePolicy, USE_SIZE_SET )
86 DALI_ENUM_TO_STRING_WITH_SCOPE( SizeScalePolicy, FIT_WITH_ASPECT_RATIO )
87 DALI_ENUM_TO_STRING_WITH_SCOPE( SizeScalePolicy, FILL_WITH_ASPECT_RATIO )
88 DALI_ENUM_TO_STRING_TABLE_END( SIZE_SCALE_POLICY )
89
90 DALI_ENUM_TO_STRING_TABLE_BEGIN( CLIPPING_MODE )
91 DALI_ENUM_TO_STRING_WITH_SCOPE( ClippingMode, DISABLED )
92 DALI_ENUM_TO_STRING_WITH_SCOPE( ClippingMode, CLIP_CHILDREN )
93 DALI_ENUM_TO_STRING_TABLE_END( CLIPPING_MODE )
94
95 DALI_ENUM_TO_STRING_TABLE_BEGIN( LAYOUT_DIRECTION )
96 DALI_ENUM_TO_STRING_WITH_SCOPE( LayoutDirection, LEFT_TO_RIGHT )
97 DALI_ENUM_TO_STRING_WITH_SCOPE( LayoutDirection, RIGHT_TO_LEFT )
98 DALI_ENUM_TO_STRING_TABLE_END( LAYOUT_DIRECTION )
99
100 bool GetAnchorPointConstant( const std::string& value, Vector3& anchor )
101 {
102   for( uint32_t i = 0; i < ANCHOR_CONSTANT_TABLE_COUNT; ++i )
103   {
104     uint32_t sizeIgnored = 0;
105     if( CompareTokens( value.c_str(), ANCHOR_CONSTANT_TABLE[ i ].name, sizeIgnored ) )
106     {
107       anchor = ANCHOR_CONSTANT_TABLE[ i ].value;
108       return true;
109     }
110   }
111   return false;
112 }
113
114 inline bool GetParentOriginConstant( const std::string& value, Vector3& parentOrigin )
115 {
116   // Values are the same so just use the same table as anchor-point
117   return GetAnchorPointConstant( value, parentOrigin );
118 }
119
120 } // unnamed namespace
121
122 void Actor::PropertyHandler::SetDefaultProperty( Internal::Actor& actor, Property::Index index, const Property::Value& property )
123 {
124   switch( index )
125   {
126     case Dali::Actor::Property::PARENT_ORIGIN:
127     {
128       Property::Type type = property.GetType();
129       if( type == Property::VECTOR3 )
130       {
131         actor.SetParentOrigin( property.Get< Vector3 >() );
132       }
133       else if ( type == Property::STRING )
134       {
135         std::string parentOriginString;
136         property.Get( parentOriginString );
137         Vector3 parentOrigin;
138         if( GetParentOriginConstant( parentOriginString, parentOrigin ) )
139         {
140           actor.SetParentOrigin( parentOrigin );
141         }
142       }
143       break;
144     }
145
146     case Dali::Actor::Property::PARENT_ORIGIN_X:
147     {
148       const Vector3& current = actor.GetCurrentParentOrigin();
149       actor.SetParentOrigin( Vector3( property.Get< float >(), current.y, current.z ) );
150       break;
151     }
152
153     case Dali::Actor::Property::PARENT_ORIGIN_Y:
154     {
155       const Vector3& current = actor.GetCurrentParentOrigin();
156       actor.SetParentOrigin( Vector3( current.x, property.Get< float >(), current.z ) );
157       break;
158     }
159
160     case Dali::Actor::Property::PARENT_ORIGIN_Z:
161     {
162       const Vector3& current = actor.GetCurrentParentOrigin();
163       actor.SetParentOrigin( Vector3( current.x, current.y, property.Get< float >() ) );
164       break;
165     }
166
167     case Dali::Actor::Property::ANCHOR_POINT:
168     {
169       Property::Type type = property.GetType();
170       if( type == Property::VECTOR3 )
171       {
172         actor.SetAnchorPoint( property.Get< Vector3 >() );
173       }
174       else if ( type == Property::STRING )
175       {
176         std::string anchorPointString;
177         property.Get( anchorPointString );
178         Vector3 anchor;
179         if( GetAnchorPointConstant( anchorPointString, anchor ) )
180         {
181           actor.SetAnchorPoint( anchor );
182         }
183       }
184       break;
185     }
186
187     case Dali::Actor::Property::ANCHOR_POINT_X:
188     {
189       const Vector3& current = actor.GetCurrentAnchorPoint();
190       actor.SetAnchorPoint( Vector3( property.Get< float >(), current.y, current.z ) );
191       break;
192     }
193
194     case Dali::Actor::Property::ANCHOR_POINT_Y:
195     {
196       const Vector3& current = actor.GetCurrentAnchorPoint();
197       actor.SetAnchorPoint( Vector3( current.x, property.Get< float >(), current.z ) );
198       break;
199     }
200
201     case Dali::Actor::Property::ANCHOR_POINT_Z:
202     {
203       const Vector3& current = actor.GetCurrentAnchorPoint();
204       actor.SetAnchorPoint( Vector3( current.x, current.y, property.Get< float >() ) );
205       break;
206     }
207
208     case Dali::Actor::Property::SIZE:
209     {
210       Property::Type type = property.GetType();
211       if( type == Property::VECTOR2 )
212       {
213         actor.SetSize( property.Get< Vector2 >() );
214       }
215       else if ( type == Property::VECTOR3 )
216       {
217         actor.SetSize( property.Get< Vector3 >() );
218       }
219       break;
220     }
221
222     case Dali::Actor::Property::SIZE_WIDTH:
223     {
224       actor.SetWidth( property.Get< float >() );
225       break;
226     }
227
228     case Dali::Actor::Property::SIZE_HEIGHT:
229     {
230       actor.SetHeight( property.Get< float >() );
231       break;
232     }
233
234     case Dali::Actor::Property::SIZE_DEPTH:
235     {
236       actor.SetDepth( property.Get< float >() );
237       break;
238     }
239
240     case Dali::Actor::Property::POSITION:
241     {
242       Property::Type type = property.GetType();
243       if( type == Property::VECTOR2 )
244       {
245         Vector2 position = property.Get< Vector2 >();
246         actor.SetPosition( Vector3( position.x, position.y, 0.0f ) );
247       }
248       else if ( type == Property::VECTOR3 )
249       {
250         actor.SetPosition( property.Get< Vector3 >() );
251       }
252       break;
253     }
254
255     case Dali::Actor::Property::POSITION_X:
256     {
257       actor.SetX( property.Get< float >() );
258       break;
259     }
260
261     case Dali::Actor::Property::POSITION_Y:
262     {
263       actor.SetY( property.Get< float >() );
264       break;
265     }
266
267     case Dali::Actor::Property::POSITION_Z:
268     {
269       actor.SetZ( property.Get< float >() );
270       break;
271     }
272
273     case Dali::Actor::Property::ORIENTATION:
274     {
275       actor.SetOrientation( property.Get< Quaternion >() );
276       break;
277     }
278
279     case Dali::Actor::Property::SCALE:
280     {
281       Property::Type type = property.GetType();
282       if( type == Property::FLOAT )
283       {
284         float scale = property.Get< float >();
285         actor.SetScale( scale, scale, scale );
286       }
287       else if ( type == Property::VECTOR3 )
288       {
289         actor.SetScale( property.Get< Vector3 >() );
290       }
291       break;
292     }
293
294     case Dali::Actor::Property::SCALE_X:
295     {
296       actor.SetScaleX( property.Get< float >() );
297       break;
298     }
299
300     case Dali::Actor::Property::SCALE_Y:
301     {
302       actor.SetScaleY( property.Get< float >() );
303       break;
304     }
305
306     case Dali::Actor::Property::SCALE_Z:
307     {
308       actor.SetScaleZ( property.Get< float >() );
309       break;
310     }
311
312     case Dali::Actor::Property::VISIBLE:
313     {
314       actor.SetVisible( property.Get< bool >() );
315       break;
316     }
317
318     case Dali::Actor::Property::COLOR:
319     {
320       Property::Type type = property.GetType();
321       if( type == Property::VECTOR3 )
322       {
323         Vector3 color = property.Get< Vector3 >();
324         actor.SetColor( Vector4( color.r, color.g, color.b, 1.0f ) );
325       }
326       else if( type == Property::VECTOR4 )
327       {
328         actor.SetColor( property.Get< Vector4 >() );
329       }
330       break;
331     }
332
333     case Dali::Actor::Property::COLOR_RED:
334     {
335       actor.SetColorRed( property.Get< float >() );
336       break;
337     }
338
339     case Dali::Actor::Property::COLOR_GREEN:
340     {
341       actor.SetColorGreen( property.Get< float >() );
342       break;
343     }
344
345     case Dali::Actor::Property::COLOR_BLUE:
346     {
347       actor.SetColorBlue( property.Get< float >() );
348       break;
349     }
350
351     case Dali::Actor::Property::COLOR_ALPHA:
352     case Dali::Actor::Property::OPACITY:
353     {
354       float value;
355       if( property.Get( value ) )
356       {
357         actor.SetOpacity( value );
358       }
359       break;
360     }
361
362     case Dali::Actor::Property::NAME:
363     {
364       actor.SetName( property.Get< std::string >() );
365       break;
366     }
367
368     case Dali::Actor::Property::SENSITIVE:
369     {
370       actor.SetSensitive( property.Get< bool >() );
371       break;
372     }
373
374     case Dali::Actor::Property::LEAVE_REQUIRED:
375     {
376       actor.SetLeaveRequired( property.Get< bool >() );
377       break;
378     }
379
380     case Dali::Actor::Property::INHERIT_POSITION:
381     {
382       actor.SetInheritPosition( property.Get< bool >() );
383       break;
384     }
385
386     case Dali::Actor::Property::INHERIT_ORIENTATION:
387     {
388       actor.SetInheritOrientation( property.Get< bool >() );
389       break;
390     }
391
392     case Dali::Actor::Property::INHERIT_SCALE:
393     {
394       actor.SetInheritScale( property.Get< bool >() );
395       break;
396     }
397
398     case Dali::Actor::Property::COLOR_MODE:
399     {
400       ColorMode mode = actor.mColorMode;
401       if ( Scripting::GetEnumerationProperty< ColorMode >( property, COLOR_MODE_TABLE, COLOR_MODE_TABLE_COUNT, mode ) )
402       {
403         actor.SetColorMode( mode );
404       }
405       break;
406     }
407
408     case Dali::Actor::Property::DRAW_MODE:
409     {
410       DrawMode::Type mode = actor.mDrawMode;
411       if( Scripting::GetEnumerationProperty< DrawMode::Type >( property, DRAW_MODE_TABLE, DRAW_MODE_TABLE_COUNT, mode ) )
412       {
413         actor.SetDrawMode( mode );
414       }
415       break;
416     }
417
418     case Dali::Actor::Property::SIZE_MODE_FACTOR:
419     {
420       actor.SetSizeModeFactor( property.Get< Vector3 >() );
421       break;
422     }
423
424     case Dali::Actor::Property::WIDTH_RESIZE_POLICY:
425     {
426       ResizePolicy::Type type = actor.GetResizePolicy( Dimension::WIDTH );
427       if( Scripting::GetEnumerationProperty< ResizePolicy::Type >( property, RESIZE_POLICY_TABLE, RESIZE_POLICY_TABLE_COUNT, type ) )
428       {
429         actor.SetResizePolicy( type, Dimension::WIDTH );
430       }
431       break;
432     }
433
434     case Dali::Actor::Property::HEIGHT_RESIZE_POLICY:
435     {
436       ResizePolicy::Type type = actor.GetResizePolicy( Dimension::HEIGHT );
437       if( Scripting::GetEnumerationProperty< ResizePolicy::Type >( property, RESIZE_POLICY_TABLE, RESIZE_POLICY_TABLE_COUNT, type ) )
438       {
439         actor.SetResizePolicy( type, Dimension::HEIGHT );
440       }
441       break;
442     }
443
444     case Dali::Actor::Property::SIZE_SCALE_POLICY:
445     {
446       SizeScalePolicy::Type type = actor.GetSizeScalePolicy();
447       if( Scripting::GetEnumerationProperty< SizeScalePolicy::Type >( property, SIZE_SCALE_POLICY_TABLE, SIZE_SCALE_POLICY_TABLE_COUNT, type ) )
448       {
449         actor.SetSizeScalePolicy( type );
450       }
451       break;
452     }
453
454     case Dali::Actor::Property::WIDTH_FOR_HEIGHT:
455     {
456       if( property.Get< bool >() )
457       {
458         actor.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::WIDTH );
459       }
460       break;
461     }
462
463     case Dali::Actor::Property::HEIGHT_FOR_WIDTH:
464     {
465       if( property.Get< bool >() )
466       {
467         actor.SetResizePolicy( ResizePolicy::DIMENSION_DEPENDENCY, Dimension::HEIGHT );
468       }
469       break;
470     }
471
472     case Dali::Actor::Property::PADDING:
473     {
474       Vector4 padding = property.Get< Vector4 >();
475       actor.SetPadding( Vector2( padding.x, padding.y ), Dimension::WIDTH );
476       actor.SetPadding( Vector2( padding.z, padding.w ), Dimension::HEIGHT );
477       break;
478     }
479
480     case Dali::Actor::Property::MINIMUM_SIZE:
481     {
482       Vector2 size = property.Get< Vector2 >();
483       actor.SetMinimumSize( size.x, Dimension::WIDTH );
484       actor.SetMinimumSize( size.y, Dimension::HEIGHT );
485       break;
486     }
487
488     case Dali::Actor::Property::MAXIMUM_SIZE:
489     {
490       Vector2 size = property.Get< Vector2 >();
491       actor.SetMaximumSize( size.x, Dimension::WIDTH );
492       actor.SetMaximumSize( size.y, Dimension::HEIGHT );
493       break;
494     }
495
496     case Dali::DevelActor::Property::SIBLING_ORDER:
497     {
498       int value;
499
500       if( property.Get( value ) )
501       {
502         actor.SetSiblingOrder( value );
503       }
504       break;
505     }
506
507     case Dali::Actor::Property::CLIPPING_MODE:
508     {
509       ClippingMode::Type convertedValue = actor.mClippingMode;
510       if( Scripting::GetEnumerationProperty< ClippingMode::Type >( property, CLIPPING_MODE_TABLE, CLIPPING_MODE_TABLE_COUNT, convertedValue ) )
511       {
512         actor.mClippingMode = convertedValue;
513         SetClippingModeMessage( actor.GetEventThreadServices(), actor.GetNode(), actor.mClippingMode );
514       }
515       break;
516     }
517
518     case Dali::Actor::Property::POSITION_USES_ANCHOR_POINT:
519     {
520       bool value = false;
521       if( property.Get( value ) && value != actor.mPositionUsesAnchorPoint )
522       {
523         actor.mPositionUsesAnchorPoint = value;
524         SetPositionUsesAnchorPointMessage( actor.GetEventThreadServices(), actor.GetNode(), actor.mPositionUsesAnchorPoint );
525       }
526       break;
527     }
528
529     case Dali::Actor::Property::LAYOUT_DIRECTION:
530     {
531       Dali::LayoutDirection::Type direction = actor.mLayoutDirection;
532       actor.mInheritLayoutDirection = false;
533
534       if( Scripting::GetEnumerationProperty< LayoutDirection::Type >( property, LAYOUT_DIRECTION_TABLE, LAYOUT_DIRECTION_TABLE_COUNT, direction ) )
535       {
536         actor.InheritLayoutDirectionRecursively( &actor, direction, true );
537       }
538       break;
539     }
540
541     case Dali::Actor::Property::INHERIT_LAYOUT_DIRECTION:
542     {
543       bool value = false;
544       if( property.Get( value ) )
545       {
546         actor.SetInheritLayoutDirection( value );
547       }
548       break;
549     }
550
551     case Dali::Actor::Property::KEYBOARD_FOCUSABLE:
552     {
553       bool value = false;
554       if( property.Get( value ) )
555       {
556         actor.SetKeyboardFocusable( value );
557       }
558       break;
559     }
560
561     case Dali::DevelActor::Property::UPDATE_SIZE_HINT:
562     {
563       actor.SetUpdateSizeHint( property.Get< Vector2 >() );
564       break;
565     }
566
567     case Dali::DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START:
568     {
569       bool boolValue = false;
570       if ( property.Get( boolValue ) )
571       {
572         actor.mCaptureAllTouchAfterStart = boolValue;
573       }
574       break;
575     }
576
577     case Dali::DevelActor::Property::TOUCH_AREA:
578     {
579       Vector2 vec2Value;
580       if( property.Get( vec2Value ) )
581       {
582         actor.SetTouchArea( vec2Value );
583       }
584       break;
585     }
586
587     case Dali::DevelActor::Property::BLEND_EQUATION:
588     {
589       int value;
590       if( property.Get( value ) )
591       {
592         actor.SetBlendEquation( static_cast<DevelBlendEquation::Type>( value ) );
593       }
594       break;
595     }
596
597     default:
598     {
599       // this can happen in the case of a non-animatable default property so just do nothing
600       break;
601     }
602   }
603 }
604
605 void Actor::PropertyHandler::SetSceneGraphProperty(
606     Property::Index index,
607     const PropertyMetadata& entry,
608     const Property::Value& value,
609     EventThreadServices& eventThreadServices,
610     const SceneGraph::Node& node)
611 {
612   switch( entry.GetType() )
613   {
614     case Property::BOOLEAN:
615     {
616       const AnimatableProperty< bool >* property = dynamic_cast< const AnimatableProperty< bool >* >( entry.GetSceneGraphProperty() );
617       DALI_ASSERT_DEBUG( NULL != property );
618
619       // property is being used in a separate thread; queue a message to set the property
620       SceneGraph::NodePropertyMessage<bool>::Send( eventThreadServices, &node, property, &AnimatableProperty<bool>::Bake, value.Get<bool>() );
621
622       break;
623     }
624
625     case Property::INTEGER:
626     {
627       const AnimatableProperty< int >* property = dynamic_cast< const AnimatableProperty< int >* >( entry.GetSceneGraphProperty() );
628       DALI_ASSERT_DEBUG( NULL != property );
629
630       // property is being used in a separate thread; queue a message to set the property
631       SceneGraph::NodePropertyMessage<int>::Send( eventThreadServices, &node, property, &AnimatableProperty<int>::Bake, value.Get<int>() );
632
633       break;
634     }
635
636     case Property::FLOAT:
637     {
638       const AnimatableProperty< float >* property = dynamic_cast< const AnimatableProperty< float >* >( entry.GetSceneGraphProperty() );
639       DALI_ASSERT_DEBUG( NULL != property );
640
641       // property is being used in a separate thread; queue a message to set the property
642       SceneGraph::NodePropertyMessage<float>::Send( eventThreadServices, &node, property, &AnimatableProperty<float>::Bake, value.Get<float>() );
643
644       break;
645     }
646
647     case Property::VECTOR2:
648     {
649       const AnimatableProperty< Vector2 >* property = dynamic_cast< const AnimatableProperty< Vector2 >* >( entry.GetSceneGraphProperty() );
650       DALI_ASSERT_DEBUG( NULL != property );
651
652       // property is being used in a separate thread; queue a message to set the property
653       if(entry.componentIndex == 0)
654       {
655         SceneGraph::NodePropertyComponentMessage<Vector2>::Send( eventThreadServices, &node, property, &AnimatableProperty<Vector2>::BakeX, value.Get<float>() );
656       }
657       else if(entry.componentIndex == 1)
658       {
659         SceneGraph::NodePropertyComponentMessage<Vector2>::Send( eventThreadServices, &node, property, &AnimatableProperty<Vector2>::BakeY, value.Get<float>() );
660       }
661       else
662       {
663         SceneGraph::NodePropertyMessage<Vector2>::Send( eventThreadServices, &node, property, &AnimatableProperty<Vector2>::Bake, value.Get<Vector2>() );
664       }
665
666       break;
667     }
668
669     case Property::VECTOR3:
670     {
671       const AnimatableProperty< Vector3 >* property = dynamic_cast< const AnimatableProperty< Vector3 >* >( entry.GetSceneGraphProperty() );
672       DALI_ASSERT_DEBUG( NULL != property );
673
674       // property is being used in a separate thread; queue a message to set the property
675       if(entry.componentIndex == 0)
676       {
677         SceneGraph::NodePropertyComponentMessage<Vector3>::Send( eventThreadServices, &node, property, &AnimatableProperty<Vector3>::BakeX, value.Get<float>() );
678       }
679       else if(entry.componentIndex == 1)
680       {
681         SceneGraph::NodePropertyComponentMessage<Vector3>::Send( eventThreadServices, &node, property, &AnimatableProperty<Vector3>::BakeY, value.Get<float>() );
682       }
683       else if(entry.componentIndex == 2)
684       {
685         SceneGraph::NodePropertyComponentMessage<Vector3>::Send( eventThreadServices, &node, property, &AnimatableProperty<Vector3>::BakeZ, value.Get<float>() );
686       }
687       else
688       {
689         SceneGraph::NodePropertyMessage<Vector3>::Send( eventThreadServices, &node, property, &AnimatableProperty<Vector3>::Bake, value.Get<Vector3>() );
690       }
691
692       break;
693     }
694
695     case Property::VECTOR4:
696     {
697       const AnimatableProperty< Vector4 >* property = dynamic_cast< const AnimatableProperty< Vector4 >* >( entry.GetSceneGraphProperty() );
698       DALI_ASSERT_DEBUG( NULL != property );
699
700       // property is being used in a separate thread; queue a message to set the property
701       if(entry.componentIndex == 0)
702       {
703         SceneGraph::NodePropertyComponentMessage<Vector4>::Send( eventThreadServices, &node, property, &AnimatableProperty<Vector4>::BakeX, value.Get<float>() );
704       }
705       else if(entry.componentIndex == 1)
706       {
707         SceneGraph::NodePropertyComponentMessage<Vector4>::Send( eventThreadServices, &node, property, &AnimatableProperty<Vector4>::BakeY, value.Get<float>() );
708       }
709       else if(entry.componentIndex == 2)
710       {
711         SceneGraph::NodePropertyComponentMessage<Vector4>::Send( eventThreadServices, &node, property, &AnimatableProperty<Vector4>::BakeZ, value.Get<float>() );
712       }
713       else if(entry.componentIndex == 3)
714       {
715         SceneGraph::NodePropertyComponentMessage<Vector4>::Send( eventThreadServices, &node, property, &AnimatableProperty<Vector4>::BakeW, value.Get<float>() );
716       }
717       else
718       {
719         SceneGraph::NodePropertyMessage<Vector4>::Send( eventThreadServices, &node, property, &AnimatableProperty<Vector4>::Bake, value.Get<Vector4>() );
720       }
721
722       break;
723     }
724
725     case Property::ROTATION:
726     {
727       const AnimatableProperty< Quaternion >* property = dynamic_cast< const AnimatableProperty< Quaternion >* >( entry.GetSceneGraphProperty() );
728       DALI_ASSERT_DEBUG( NULL != property );
729
730       // property is being used in a separate thread; queue a message to set the property
731       SceneGraph::NodePropertyMessage<Quaternion>::Send( eventThreadServices, &node, property,&AnimatableProperty<Quaternion>::Bake,  value.Get<Quaternion>() );
732
733       break;
734     }
735
736     case Property::MATRIX:
737     {
738       const AnimatableProperty< Matrix >* property = dynamic_cast< const AnimatableProperty< Matrix >* >( entry.GetSceneGraphProperty() );
739       DALI_ASSERT_DEBUG( NULL != property );
740
741       // property is being used in a separate thread; queue a message to set the property
742       SceneGraph::NodePropertyMessage<Matrix>::Send( eventThreadServices, &node, property,&AnimatableProperty<Matrix>::Bake,  value.Get<Matrix>() );
743
744       break;
745     }
746
747     case Property::MATRIX3:
748     {
749       const AnimatableProperty< Matrix3 >* property = dynamic_cast< const AnimatableProperty< Matrix3 >* >( entry.GetSceneGraphProperty() );
750       DALI_ASSERT_DEBUG( NULL != property );
751
752       // property is being used in a separate thread; queue a message to set the property
753       SceneGraph::NodePropertyMessage<Matrix3>::Send( eventThreadServices, &node, property,&AnimatableProperty<Matrix3>::Bake,  value.Get<Matrix3>() );
754
755       break;
756     }
757
758     default:
759     {
760       // nothing to do for other types
761     }
762   } // entry.GetType
763 }
764
765 void Actor::PropertyHandler::OnNotifyDefaultPropertyAnimation(Internal::Actor& actor, Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType)
766 {
767   switch( animationType )
768   {
769     case Animation::TO:
770     case Animation::BETWEEN:
771     {
772       switch( index )
773       {
774         case Dali::Actor::Property::SIZE:
775         {
776           if( value.Get( actor.mTargetSize ) )
777           {
778             actor.mAnimatedSize = actor.mTargetSize;
779             actor.mUseAnimatedSize = AnimatedSizeFlag::WIDTH | AnimatedSizeFlag::HEIGHT | AnimatedSizeFlag::DEPTH;
780
781             // Notify deriving classes
782             actor.OnSizeAnimation( animation, actor.mTargetSize );
783           }
784           break;
785         }
786
787         case Dali::Actor::Property::SIZE_WIDTH:
788         {
789           if( value.Get( actor.mTargetSize.width ) )
790           {
791             actor.mAnimatedSize.width = actor.mTargetSize.width;
792             actor.mUseAnimatedSize |= AnimatedSizeFlag::WIDTH;
793
794             // Notify deriving classes
795             actor.OnSizeAnimation( animation, actor.mTargetSize );
796           }
797           break;
798         }
799
800         case Dali::Actor::Property::SIZE_HEIGHT:
801         {
802           if( value.Get( actor.mTargetSize.height ) )
803           {
804             actor.mAnimatedSize.height = actor.mTargetSize.height;
805             actor.mUseAnimatedSize |= AnimatedSizeFlag::HEIGHT;
806
807             // Notify deriving classes
808             actor.OnSizeAnimation( animation, actor.mTargetSize );
809           }
810           break;
811         }
812
813         case Dali::Actor::Property::SIZE_DEPTH:
814         {
815           if( value.Get( actor.mTargetSize.depth ) )
816           {
817             actor.mAnimatedSize.depth = actor.mTargetSize.depth;
818             actor.mUseAnimatedSize |= AnimatedSizeFlag::DEPTH;
819
820             // Notify deriving classes
821             actor.OnSizeAnimation( animation, actor.mTargetSize );
822           }
823           break;
824         }
825
826         case Dali::Actor::Property::POSITION:
827         {
828           value.Get( actor.mTargetPosition );
829           break;
830         }
831
832         case Dali::Actor::Property::POSITION_X:
833         {
834           value.Get( actor.mTargetPosition.x );
835           break;
836         }
837
838         case Dali::Actor::Property::POSITION_Y:
839         {
840           value.Get( actor.mTargetPosition.y );
841           break;
842         }
843
844         case Dali::Actor::Property::POSITION_Z:
845         {
846           value.Get( actor.mTargetPosition.z );
847           break;
848         }
849
850         case Dali::Actor::Property::ORIENTATION:
851         {
852           value.Get( actor.mTargetOrientation );
853           break;
854         }
855
856         case Dali::Actor::Property::SCALE:
857         {
858           value.Get( actor.mTargetScale );
859           break;
860         }
861
862         case Dali::Actor::Property::SCALE_X:
863         {
864           value.Get( actor.mTargetScale.x );
865           break;
866         }
867
868         case Dali::Actor::Property::SCALE_Y:
869         {
870           value.Get( actor.mTargetScale.y );
871           break;
872         }
873
874         case Dali::Actor::Property::SCALE_Z:
875         {
876           value.Get( actor.mTargetScale.z );
877           break;
878         }
879
880         case Dali::Actor::Property::VISIBLE:
881         {
882           actor.SetVisibleInternal( value.Get< bool >(), SendMessage::FALSE );
883           break;
884         }
885
886         case Dali::Actor::Property::COLOR:
887         {
888           value.Get( actor.mTargetColor );
889           break;
890         }
891
892         case Dali::Actor::Property::COLOR_RED:
893         {
894           value.Get( actor.mTargetColor.r );
895           break;
896         }
897
898         case Dali::Actor::Property::COLOR_GREEN:
899         {
900           value.Get( actor.mTargetColor.g );
901           break;
902         }
903
904         case Dali::Actor::Property::COLOR_BLUE:
905         {
906           value.Get( actor.mTargetColor.b );
907           break;
908         }
909
910         case Dali::Actor::Property::COLOR_ALPHA:
911         case Dali::Actor::Property::OPACITY:
912         {
913           value.Get( actor.mTargetColor.a );
914           break;
915         }
916
917         default:
918         {
919           // Not an animatable property. Do nothing.
920           break;
921         }
922       }
923       break;
924     }
925
926     case Animation::BY:
927     {
928       switch( index )
929       {
930         case Dali::Actor::Property::SIZE:
931         {
932           if( AdjustValue< Vector3 >( actor.mTargetSize, value ) )
933           {
934             actor.mAnimatedSize = actor.mTargetSize;
935             actor.mUseAnimatedSize = AnimatedSizeFlag::WIDTH | AnimatedSizeFlag::HEIGHT | AnimatedSizeFlag::DEPTH;
936
937             // Notify deriving classes
938             actor.OnSizeAnimation( animation, actor.mTargetSize );
939           }
940           break;
941         }
942
943         case Dali::Actor::Property::SIZE_WIDTH:
944         {
945           if( AdjustValue< float >( actor.mTargetSize.width, value ) )
946           {
947             actor.mAnimatedSize.width = actor.mTargetSize.width;
948             actor.mUseAnimatedSize |= AnimatedSizeFlag::WIDTH;
949
950             // Notify deriving classes
951             actor.OnSizeAnimation( animation, actor.mTargetSize );
952           }
953           break;
954         }
955
956         case Dali::Actor::Property::SIZE_HEIGHT:
957         {
958           if( AdjustValue< float >( actor.mTargetSize.height, value ) )
959           {
960             actor.mAnimatedSize.height = actor.mTargetSize.height;
961             actor.mUseAnimatedSize |= AnimatedSizeFlag::HEIGHT;
962
963             // Notify deriving classes
964             actor.OnSizeAnimation( animation, actor.mTargetSize );
965           }
966           break;
967         }
968
969         case Dali::Actor::Property::SIZE_DEPTH:
970         {
971           if( AdjustValue< float >( actor.mTargetSize.depth, value ) )
972           {
973             actor.mAnimatedSize.depth = actor.mTargetSize.depth;
974             actor.mUseAnimatedSize |= AnimatedSizeFlag::DEPTH;
975
976             // Notify deriving classes
977             actor.OnSizeAnimation( animation, actor.mTargetSize );
978           }
979           break;
980         }
981
982         case Dali::Actor::Property::POSITION:
983         {
984           AdjustValue< Vector3 >( actor.mTargetPosition, value );
985           break;
986         }
987
988         case Dali::Actor::Property::POSITION_X:
989         {
990           AdjustValue< float >( actor.mTargetPosition.x, value );
991           break;
992         }
993
994         case Dali::Actor::Property::POSITION_Y:
995         {
996           AdjustValue< float >( actor.mTargetPosition.y, value );
997           break;
998         }
999
1000         case Dali::Actor::Property::POSITION_Z:
1001         {
1002           AdjustValue< float >( actor.mTargetPosition.z, value );
1003           break;
1004         }
1005
1006         case Dali::Actor::Property::ORIENTATION:
1007         {
1008           Quaternion relativeValue;
1009           if( value.Get( relativeValue ) )
1010           {
1011             actor.mTargetOrientation *= relativeValue;
1012           }
1013           break;
1014         }
1015
1016         case Dali::Actor::Property::SCALE:
1017         {
1018           AdjustValue< Vector3 >( actor.mTargetScale, value );
1019           break;
1020         }
1021
1022         case Dali::Actor::Property::SCALE_X:
1023         {
1024           AdjustValue< float >( actor.mTargetScale.x, value );
1025           break;
1026         }
1027
1028         case Dali::Actor::Property::SCALE_Y:
1029         {
1030           AdjustValue< float >( actor.mTargetScale.y, value );
1031           break;
1032         }
1033
1034         case Dali::Actor::Property::SCALE_Z:
1035         {
1036           AdjustValue< float >( actor.mTargetScale.z, value );
1037           break;
1038         }
1039
1040         case Dali::Actor::Property::VISIBLE:
1041         {
1042           bool relativeValue = false;
1043           if( value.Get( relativeValue ) )
1044           {
1045             bool visible = actor.mVisible || relativeValue;
1046             actor.SetVisibleInternal( visible, SendMessage::FALSE );
1047           }
1048           break;
1049         }
1050
1051         case Dali::Actor::Property::COLOR:
1052         {
1053           AdjustValue< Vector4 >( actor.mTargetColor, value );
1054           break;
1055         }
1056
1057         case Dali::Actor::Property::COLOR_RED:
1058         {
1059           AdjustValue< float >( actor.mTargetColor.r, value );
1060           break;
1061         }
1062
1063         case Dali::Actor::Property::COLOR_GREEN:
1064         {
1065           AdjustValue< float >( actor.mTargetColor.g, value );
1066           break;
1067         }
1068
1069         case Dali::Actor::Property::COLOR_BLUE:
1070         {
1071           AdjustValue< float >( actor.mTargetColor.b, value );
1072           break;
1073         }
1074
1075         case Dali::Actor::Property::COLOR_ALPHA:
1076         case Dali::Actor::Property::OPACITY:
1077         {
1078           AdjustValue< float >( actor.mTargetColor.a, value );
1079           break;
1080         }
1081
1082         default:
1083         {
1084           // Not an animatable property. Do nothing.
1085           break;
1086         }
1087       }
1088       break;
1089     }
1090   }
1091 }
1092
1093 const PropertyBase* Actor::PropertyHandler::GetSceneObjectAnimatableProperty(Property::Index index, const SceneGraph::Node& node)
1094 {
1095   const PropertyBase* property( nullptr );
1096
1097   switch( index )
1098   {
1099     case Dali::Actor::Property::SIZE:        // FALLTHROUGH
1100     case Dali::Actor::Property::SIZE_WIDTH:  // FALLTHROUGH
1101     case Dali::Actor::Property::SIZE_HEIGHT: // FALLTHROUGH
1102     case Dali::Actor::Property::SIZE_DEPTH:
1103     {
1104       property = &node.mSize;
1105       break;
1106     }
1107     case Dali::Actor::Property::POSITION:   // FALLTHROUGH
1108     case Dali::Actor::Property::POSITION_X: // FALLTHROUGH
1109     case Dali::Actor::Property::POSITION_Y: // FALLTHROUGH
1110     case Dali::Actor::Property::POSITION_Z:
1111     {
1112       property = &node.mPosition;
1113       break;
1114     }
1115     case Dali::Actor::Property::ORIENTATION:
1116     {
1117       property = &node.mOrientation;
1118       break;
1119     }
1120     case Dali::Actor::Property::SCALE:   // FALLTHROUGH
1121     case Dali::Actor::Property::SCALE_X: // FALLTHROUGH
1122     case Dali::Actor::Property::SCALE_Y: // FALLTHROUGH
1123     case Dali::Actor::Property::SCALE_Z:
1124     {
1125       property = &node.mScale;
1126       break;
1127     }
1128     case Dali::Actor::Property::VISIBLE:
1129     {
1130       property = &node.mVisible;
1131       break;
1132     }
1133     case Dali::Actor::Property::COLOR:       // FALLTHROUGH
1134     case Dali::Actor::Property::COLOR_RED:   // FALLTHROUGH
1135     case Dali::Actor::Property::COLOR_GREEN: // FALLTHROUGH
1136     case Dali::Actor::Property::COLOR_BLUE:  // FALLTHROUGH
1137     case Dali::Actor::Property::COLOR_ALPHA: // FALLTHROUGH
1138     case Dali::Actor::Property::OPACITY:
1139     {
1140       property = &node.mColor;
1141       break;
1142     }
1143     default:
1144     {
1145       break;
1146     }
1147   }
1148
1149   return property;
1150 }
1151
1152 const PropertyInputImpl* Actor::PropertyHandler::GetSceneObjectInputProperty(Property::Index index, const SceneGraph::Node& node)
1153 {
1154   const PropertyInputImpl* property( nullptr );
1155
1156   switch( index )
1157   {
1158     case Dali::Actor::Property::PARENT_ORIGIN:   // FALLTHROUGH
1159     case Dali::Actor::Property::PARENT_ORIGIN_X: // FALLTHROUGH
1160     case Dali::Actor::Property::PARENT_ORIGIN_Y: // FALLTHROUGH
1161     case Dali::Actor::Property::PARENT_ORIGIN_Z:
1162     {
1163       property = &node.mParentOrigin;
1164       break;
1165     }
1166     case Dali::Actor::Property::ANCHOR_POINT:   // FALLTHROUGH
1167     case Dali::Actor::Property::ANCHOR_POINT_X: // FALLTHROUGH
1168     case Dali::Actor::Property::ANCHOR_POINT_Y: // FALLTHROUGH
1169     case Dali::Actor::Property::ANCHOR_POINT_Z:
1170     {
1171       property = &node.mAnchorPoint;
1172       break;
1173     }
1174     case Dali::Actor::Property::WORLD_POSITION:   // FALLTHROUGH
1175     case Dali::Actor::Property::WORLD_POSITION_X: // FALLTHROUGH
1176     case Dali::Actor::Property::WORLD_POSITION_Y: // FALLTHROUGH
1177     case Dali::Actor::Property::WORLD_POSITION_Z:
1178     {
1179       property = &node.mWorldPosition;
1180       break;
1181     }
1182     case Dali::Actor::Property::WORLD_ORIENTATION:
1183     {
1184       property = &node.mWorldOrientation;
1185       break;
1186     }
1187     case Dali::Actor::Property::WORLD_SCALE:
1188     {
1189       property = &node.mWorldScale;
1190       break;
1191     }
1192     case Dali::Actor::Property::WORLD_COLOR:
1193     {
1194       property = &node.mWorldColor;
1195       break;
1196     }
1197     case Dali::Actor::Property::WORLD_MATRIX:
1198     {
1199       property = &node.mWorldMatrix;
1200       break;
1201     }
1202     case Dali::Actor::Property::CULLED:
1203     {
1204       property = &node.mCulled;
1205       break;
1206     }
1207     default:
1208     {
1209       break;
1210     }
1211   }
1212
1213   return property;
1214 }
1215
1216 int32_t Actor::PropertyHandler::GetPropertyComponentIndex(Property::Index index)
1217 {
1218   int32_t componentIndex = Property::INVALID_COMPONENT_INDEX;
1219
1220   switch( index )
1221   {
1222     case Dali::Actor::Property::PARENT_ORIGIN_X:
1223     case Dali::Actor::Property::ANCHOR_POINT_X:
1224     case Dali::Actor::Property::SIZE_WIDTH:
1225     case Dali::Actor::Property::POSITION_X:
1226     case Dali::Actor::Property::WORLD_POSITION_X:
1227     case Dali::Actor::Property::SCALE_X:
1228     case Dali::Actor::Property::COLOR_RED:
1229     {
1230       componentIndex = 0;
1231       break;
1232     }
1233
1234     case Dali::Actor::Property::PARENT_ORIGIN_Y:
1235     case Dali::Actor::Property::ANCHOR_POINT_Y:
1236     case Dali::Actor::Property::SIZE_HEIGHT:
1237     case Dali::Actor::Property::POSITION_Y:
1238     case Dali::Actor::Property::WORLD_POSITION_Y:
1239     case Dali::Actor::Property::SCALE_Y:
1240     case Dali::Actor::Property::COLOR_GREEN:
1241     {
1242       componentIndex = 1;
1243       break;
1244     }
1245
1246     case Dali::Actor::Property::PARENT_ORIGIN_Z:
1247     case Dali::Actor::Property::ANCHOR_POINT_Z:
1248     case Dali::Actor::Property::SIZE_DEPTH:
1249     case Dali::Actor::Property::POSITION_Z:
1250     case Dali::Actor::Property::WORLD_POSITION_Z:
1251     case Dali::Actor::Property::SCALE_Z:
1252     case Dali::Actor::Property::COLOR_BLUE:
1253     {
1254       componentIndex = 2;
1255       break;
1256     }
1257
1258     case Dali::Actor::Property::COLOR_ALPHA:
1259     case Dali::Actor::Property::OPACITY:
1260     {
1261       componentIndex = 3;
1262       break;
1263     }
1264
1265     default:
1266     {
1267       // Do nothing
1268       break;
1269     }
1270   }
1271
1272   return componentIndex;
1273 }
1274
1275 bool Actor::PropertyHandler::GetCachedPropertyValue(const Internal::Actor& actor, Property::Index index, Property::Value& value)
1276 {
1277   bool valueSet = true;
1278
1279   switch( index )
1280   {
1281     case Dali::Actor::Property::PARENT_ORIGIN:
1282     {
1283       value = actor.GetCurrentParentOrigin();
1284       break;
1285     }
1286
1287     case Dali::Actor::Property::PARENT_ORIGIN_X:
1288     {
1289       value = actor.GetCurrentParentOrigin().x;
1290       break;
1291     }
1292
1293     case Dali::Actor::Property::PARENT_ORIGIN_Y:
1294     {
1295       value = actor.GetCurrentParentOrigin().y;
1296       break;
1297     }
1298
1299     case Dali::Actor::Property::PARENT_ORIGIN_Z:
1300     {
1301       value = actor.GetCurrentParentOrigin().z;
1302       break;
1303     }
1304
1305     case Dali::Actor::Property::ANCHOR_POINT:
1306     {
1307       value = actor.GetCurrentAnchorPoint();
1308       break;
1309     }
1310
1311     case Dali::Actor::Property::ANCHOR_POINT_X:
1312     {
1313       value = actor.GetCurrentAnchorPoint().x;
1314       break;
1315     }
1316
1317     case Dali::Actor::Property::ANCHOR_POINT_Y:
1318     {
1319       value = actor.GetCurrentAnchorPoint().y;
1320       break;
1321     }
1322
1323     case Dali::Actor::Property::ANCHOR_POINT_Z:
1324     {
1325       value = actor.GetCurrentAnchorPoint().z;
1326       break;
1327     }
1328
1329     case Dali::Actor::Property::SIZE:
1330     {
1331       value = actor.GetTargetSize();
1332       break;
1333     }
1334
1335     case Dali::Actor::Property::SIZE_WIDTH:
1336     {
1337       value = actor.GetTargetSize().width;
1338       break;
1339     }
1340
1341     case Dali::Actor::Property::SIZE_HEIGHT:
1342     {
1343       value = actor.GetTargetSize().height;
1344       break;
1345     }
1346
1347     case Dali::Actor::Property::SIZE_DEPTH:
1348     {
1349       value = actor.GetTargetSize().depth;
1350       break;
1351     }
1352
1353     case Dali::Actor::Property::POSITION:
1354     {
1355       value = actor.GetTargetPosition();
1356       break;
1357     }
1358
1359     case Dali::Actor::Property::POSITION_X:
1360     {
1361       value = actor.GetTargetPosition().x;
1362       break;
1363     }
1364
1365     case Dali::Actor::Property::POSITION_Y:
1366     {
1367       value = actor.GetTargetPosition().y;
1368       break;
1369     }
1370
1371     case Dali::Actor::Property::POSITION_Z:
1372     {
1373       value = actor.GetTargetPosition().z;
1374       break;
1375     }
1376
1377     case Dali::Actor::Property::ORIENTATION:
1378     {
1379       value = actor.mTargetOrientation;
1380       break;
1381     }
1382
1383     case Dali::Actor::Property::SCALE:
1384     {
1385       value = actor.mTargetScale;
1386       break;
1387     }
1388
1389     case Dali::Actor::Property::SCALE_X:
1390     {
1391       value = actor.mTargetScale.x;
1392       break;
1393     }
1394
1395     case Dali::Actor::Property::SCALE_Y:
1396     {
1397       value = actor.mTargetScale.y;
1398       break;
1399     }
1400
1401     case Dali::Actor::Property::SCALE_Z:
1402     {
1403       value = actor.mTargetScale.z;
1404       break;
1405     }
1406
1407     case Dali::Actor::Property::VISIBLE:
1408     {
1409       value = actor.mVisible;
1410       break;
1411     }
1412
1413     case Dali::Actor::Property::COLOR:
1414     {
1415       value = actor.mTargetColor;
1416       break;
1417     }
1418
1419     case Dali::Actor::Property::COLOR_RED:
1420     {
1421       value = actor.mTargetColor.r;
1422       break;
1423     }
1424
1425     case Dali::Actor::Property::COLOR_GREEN:
1426     {
1427       value = actor.mTargetColor.g;
1428       break;
1429     }
1430
1431     case Dali::Actor::Property::COLOR_BLUE:
1432     {
1433       value = actor.mTargetColor.b;
1434       break;
1435     }
1436
1437     case Dali::Actor::Property::COLOR_ALPHA:
1438     case Dali::Actor::Property::OPACITY:
1439     {
1440       value = actor.mTargetColor.a;
1441       break;
1442     }
1443
1444     case Dali::Actor::Property::NAME:
1445     {
1446       value = actor.GetName();
1447       break;
1448     }
1449
1450     case Dali::Actor::Property::SENSITIVE:
1451     {
1452       value = actor.IsSensitive();
1453       break;
1454     }
1455
1456     case Dali::Actor::Property::LEAVE_REQUIRED:
1457     {
1458       value = actor.GetLeaveRequired();
1459       break;
1460     }
1461
1462     case Dali::Actor::Property::INHERIT_POSITION:
1463     {
1464       value = actor.IsPositionInherited();
1465       break;
1466     }
1467
1468     case Dali::Actor::Property::INHERIT_ORIENTATION:
1469     {
1470       value = actor.IsOrientationInherited();
1471       break;
1472     }
1473
1474     case Dali::Actor::Property::INHERIT_SCALE:
1475     {
1476       value = actor.IsScaleInherited();
1477       break;
1478     }
1479
1480     case Dali::Actor::Property::COLOR_MODE:
1481     {
1482       value = actor.GetColorMode();
1483       break;
1484     }
1485
1486     case Dali::Actor::Property::DRAW_MODE:
1487     {
1488       value = actor.GetDrawMode();
1489       break;
1490     }
1491
1492     case Dali::Actor::Property::SIZE_MODE_FACTOR:
1493     {
1494       value = actor.GetSizeModeFactor();
1495       break;
1496     }
1497
1498     case Dali::Actor::Property::WIDTH_RESIZE_POLICY:
1499     {
1500       value = Scripting::GetLinearEnumerationName< ResizePolicy::Type >( actor.GetResizePolicy( Dimension::WIDTH ), RESIZE_POLICY_TABLE, RESIZE_POLICY_TABLE_COUNT );
1501       break;
1502     }
1503
1504     case Dali::Actor::Property::HEIGHT_RESIZE_POLICY:
1505     {
1506       value = Scripting::GetLinearEnumerationName< ResizePolicy::Type >( actor.GetResizePolicy( Dimension::HEIGHT ), RESIZE_POLICY_TABLE, RESIZE_POLICY_TABLE_COUNT );
1507       break;
1508     }
1509
1510     case Dali::Actor::Property::SIZE_SCALE_POLICY:
1511     {
1512       value = actor.GetSizeScalePolicy();
1513       break;
1514     }
1515
1516     case Dali::Actor::Property::WIDTH_FOR_HEIGHT:
1517     {
1518       value = ( actor.GetResizePolicy( Dimension::WIDTH ) == ResizePolicy::DIMENSION_DEPENDENCY ) && ( actor.GetDimensionDependency( Dimension::WIDTH ) == Dimension::HEIGHT );
1519       break;
1520     }
1521
1522     case Dali::Actor::Property::HEIGHT_FOR_WIDTH:
1523     {
1524       value = ( actor.GetResizePolicy( Dimension::HEIGHT ) == ResizePolicy::DIMENSION_DEPENDENCY ) && ( actor.GetDimensionDependency( Dimension::HEIGHT ) == Dimension::WIDTH );
1525       break;
1526     }
1527
1528     case Dali::Actor::Property::PADDING:
1529     {
1530       Vector2 widthPadding = actor.GetPadding( Dimension::WIDTH );
1531       Vector2 heightPadding = actor.GetPadding( Dimension::HEIGHT );
1532       value = Vector4( widthPadding.x, widthPadding.y, heightPadding.x, heightPadding.y );
1533       break;
1534     }
1535
1536     case Dali::Actor::Property::MINIMUM_SIZE:
1537     {
1538       value = Vector2( actor.GetMinimumSize( Dimension::WIDTH ), actor.GetMinimumSize( Dimension::HEIGHT ) );
1539       break;
1540     }
1541
1542     case Dali::Actor::Property::MAXIMUM_SIZE:
1543     {
1544       value = Vector2( actor.GetMaximumSize( Dimension::WIDTH ), actor.GetMaximumSize( Dimension::HEIGHT ) );
1545       break;
1546     }
1547
1548     case Dali::Actor::Property::CLIPPING_MODE:
1549     {
1550       value = actor.mClippingMode;
1551       break;
1552     }
1553
1554     case Dali::DevelActor::Property::SIBLING_ORDER:
1555     {
1556       value = static_cast<int>( actor.GetSiblingOrder() );
1557       break;
1558     }
1559
1560     case Dali::Actor::Property::SCREEN_POSITION:
1561     {
1562       value = actor.GetCurrentScreenPosition();
1563       break;
1564     }
1565
1566     case Dali::Actor::Property::POSITION_USES_ANCHOR_POINT:
1567     {
1568       value = actor.mPositionUsesAnchorPoint;
1569       break;
1570     }
1571
1572     case Dali::Actor::Property::LAYOUT_DIRECTION:
1573     {
1574       value = actor.mLayoutDirection;
1575       break;
1576     }
1577
1578     case Dali::Actor::Property::INHERIT_LAYOUT_DIRECTION:
1579     {
1580       value = actor.IsLayoutDirectionInherited();
1581       break;
1582     }
1583
1584     case Dali::Actor::Property::ID:
1585     {
1586       value = static_cast<int>( actor.GetId() );
1587       break;
1588     }
1589
1590     case Dali::Actor::Property::HIERARCHY_DEPTH:
1591     {
1592       value = actor.GetHierarchyDepth();
1593       break;
1594     }
1595
1596     case Dali::Actor::Property::IS_ROOT:
1597     {
1598       value = actor.IsRoot();
1599       break;
1600     }
1601
1602     case Dali::Actor::Property::IS_LAYER:
1603     {
1604       value = actor.IsLayer();
1605       break;
1606     }
1607
1608     case Dali::Actor::Property::CONNECTED_TO_SCENE:
1609     {
1610       value = actor.OnScene();
1611       break;
1612     }
1613
1614     case Dali::Actor::Property::KEYBOARD_FOCUSABLE:
1615     {
1616       value = actor.IsKeyboardFocusable();
1617       break;
1618     }
1619
1620     case Dali::DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START:
1621     {
1622       value = actor.mCaptureAllTouchAfterStart;
1623       break;
1624     }
1625
1626     case Dali::DevelActor::Property::TOUCH_AREA:
1627     {
1628       value = actor.GetTouchArea();
1629       break;
1630     }
1631
1632     case Dali::DevelActor::Property::BLEND_EQUATION:
1633     {
1634       value = actor.GetBlendEquation();
1635       break;
1636     }
1637
1638     default:
1639     {
1640       // Must be a scene-graph only property
1641       valueSet = false;
1642       break;
1643     }
1644   }
1645
1646   return valueSet;
1647 }
1648
1649 bool Actor::PropertyHandler::GetCurrentPropertyValue(const Internal::Actor& actor, Property::Index index, Property::Value& value)
1650 {
1651   bool valueSet = true;
1652
1653   switch( index )
1654   {
1655     case Dali::Actor::Property::SIZE:
1656     {
1657       value = actor.GetCurrentSize();
1658       break;
1659     }
1660
1661     case Dali::Actor::Property::SIZE_WIDTH:
1662     {
1663       value = actor.GetCurrentSize().width;
1664       break;
1665     }
1666
1667     case Dali::Actor::Property::SIZE_HEIGHT:
1668     {
1669       value = actor.GetCurrentSize().height;
1670       break;
1671     }
1672
1673     case Dali::Actor::Property::SIZE_DEPTH:
1674     {
1675       value = actor.GetCurrentSize().depth;
1676       break;
1677     }
1678
1679     case Dali::Actor::Property::POSITION:
1680     {
1681       value = actor.GetCurrentPosition();
1682       break;
1683     }
1684
1685     case Dali::Actor::Property::POSITION_X:
1686     {
1687       value = actor.GetCurrentPosition().x;
1688       break;
1689     }
1690
1691     case Dali::Actor::Property::POSITION_Y:
1692     {
1693       value = actor.GetCurrentPosition().y;
1694       break;
1695     }
1696
1697     case Dali::Actor::Property::POSITION_Z:
1698     {
1699       value = actor.GetCurrentPosition().z;
1700       break;
1701     }
1702
1703     case Dali::Actor::Property::WORLD_POSITION:
1704     {
1705       value = actor.GetCurrentWorldPosition();
1706       break;
1707     }
1708
1709     case Dali::Actor::Property::WORLD_POSITION_X:
1710     {
1711       value = actor.GetCurrentWorldPosition().x;
1712       break;
1713     }
1714
1715     case Dali::Actor::Property::WORLD_POSITION_Y:
1716     {
1717       value = actor.GetCurrentWorldPosition().y;
1718       break;
1719     }
1720
1721     case Dali::Actor::Property::WORLD_POSITION_Z:
1722     {
1723       value = actor.GetCurrentWorldPosition().z;
1724       break;
1725     }
1726
1727     case Dali::Actor::Property::ORIENTATION:
1728     {
1729       value = actor.GetCurrentOrientation();
1730       break;
1731     }
1732
1733     case Dali::Actor::Property::WORLD_ORIENTATION:
1734     {
1735       value = actor.GetCurrentWorldOrientation();
1736       break;
1737     }
1738
1739     case Dali::Actor::Property::SCALE:
1740     {
1741       value = actor.GetCurrentScale();
1742       break;
1743     }
1744
1745     case Dali::Actor::Property::SCALE_X:
1746     {
1747       value = actor.GetCurrentScale().x;
1748       break;
1749     }
1750
1751     case Dali::Actor::Property::SCALE_Y:
1752     {
1753       value = actor.GetCurrentScale().y;
1754       break;
1755     }
1756
1757     case Dali::Actor::Property::SCALE_Z:
1758     {
1759       value = actor.GetCurrentScale().z;
1760       break;
1761     }
1762
1763     case Dali::Actor::Property::WORLD_SCALE:
1764     {
1765       value = actor.GetCurrentWorldScale();
1766       break;
1767     }
1768
1769     case Dali::Actor::Property::COLOR:
1770     {
1771       value = actor.GetCurrentColor();
1772       break;
1773     }
1774
1775     case Dali::Actor::Property::COLOR_RED:
1776     {
1777       value = actor.GetCurrentColor().r;
1778       break;
1779     }
1780
1781     case Dali::Actor::Property::COLOR_GREEN:
1782     {
1783       value = actor.GetCurrentColor().g;
1784       break;
1785     }
1786
1787     case Dali::Actor::Property::COLOR_BLUE:
1788     {
1789       value = actor.GetCurrentColor().b;
1790       break;
1791     }
1792
1793     case Dali::Actor::Property::COLOR_ALPHA:
1794     case Dali::Actor::Property::OPACITY:
1795     {
1796       value = actor.GetCurrentColor().a;
1797       break;
1798     }
1799
1800     case Dali::Actor::Property::WORLD_COLOR:
1801     {
1802       value = actor.GetCurrentWorldColor();
1803       break;
1804     }
1805
1806     case Dali::Actor::Property::WORLD_MATRIX:
1807     {
1808       value = actor.GetCurrentWorldMatrix();
1809       break;
1810     }
1811
1812     case Dali::Actor::Property::VISIBLE:
1813     {
1814       value = actor.IsVisible();
1815       break;
1816     }
1817
1818     case Dali::Actor::Property::CULLED:
1819     {
1820       value = actor.GetNode().IsCulled( actor.GetEventThreadServices().GetEventBufferIndex() );
1821       break;
1822     }
1823
1824     case Dali::DevelActor::Property::UPDATE_SIZE_HINT:
1825     {
1826       // node is being used in a separate thread, the value from the previous update is the same, set by user
1827       value = Vector2( actor.GetNode().GetUpdateSizeHint() );
1828       break;
1829     }
1830
1831     default:
1832     {
1833       // Must be an event-side only property
1834       valueSet = false;
1835       break;
1836     }
1837   }
1838
1839   return valueSet;
1840 }
1841
1842 } // namespace Internal
1843
1844 } // namespace Dali