Add TouchDelegateArea property.
[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_DELEGATE_AREA:
578     {
579       Vector2 vec2Value;
580       if( property.Get( vec2Value ) )
581       {
582         actor.SetTouchDelegateArea( vec2Value );
583       }
584       break;
585     }
586
587
588     default:
589     {
590       // this can happen in the case of a non-animatable default property so just do nothing
591       break;
592     }
593   }
594 }
595
596 void Actor::PropertyHandler::SetSceneGraphProperty(
597     Property::Index index,
598     const PropertyMetadata& entry,
599     const Property::Value& value,
600     EventThreadServices& eventThreadServices,
601     const SceneGraph::Node& node)
602 {
603   switch( entry.GetType() )
604   {
605     case Property::BOOLEAN:
606     {
607       const AnimatableProperty< bool >* property = dynamic_cast< const AnimatableProperty< bool >* >( entry.GetSceneGraphProperty() );
608       DALI_ASSERT_DEBUG( NULL != property );
609
610       // property is being used in a separate thread; queue a message to set the property
611       SceneGraph::NodePropertyMessage<bool>::Send( eventThreadServices, &node, property, &AnimatableProperty<bool>::Bake, value.Get<bool>() );
612
613       break;
614     }
615
616     case Property::INTEGER:
617     {
618       const AnimatableProperty< int >* property = dynamic_cast< const AnimatableProperty< int >* >( entry.GetSceneGraphProperty() );
619       DALI_ASSERT_DEBUG( NULL != property );
620
621       // property is being used in a separate thread; queue a message to set the property
622       SceneGraph::NodePropertyMessage<int>::Send( eventThreadServices, &node, property, &AnimatableProperty<int>::Bake, value.Get<int>() );
623
624       break;
625     }
626
627     case Property::FLOAT:
628     {
629       const AnimatableProperty< float >* property = dynamic_cast< const AnimatableProperty< float >* >( entry.GetSceneGraphProperty() );
630       DALI_ASSERT_DEBUG( NULL != property );
631
632       // property is being used in a separate thread; queue a message to set the property
633       SceneGraph::NodePropertyMessage<float>::Send( eventThreadServices, &node, property, &AnimatableProperty<float>::Bake, value.Get<float>() );
634
635       break;
636     }
637
638     case Property::VECTOR2:
639     {
640       const AnimatableProperty< Vector2 >* property = dynamic_cast< const AnimatableProperty< Vector2 >* >( entry.GetSceneGraphProperty() );
641       DALI_ASSERT_DEBUG( NULL != property );
642
643       // property is being used in a separate thread; queue a message to set the property
644       if(entry.componentIndex == 0)
645       {
646         SceneGraph::NodePropertyComponentMessage<Vector2>::Send( eventThreadServices, &node, property, &AnimatableProperty<Vector2>::BakeX, value.Get<float>() );
647       }
648       else if(entry.componentIndex == 1)
649       {
650         SceneGraph::NodePropertyComponentMessage<Vector2>::Send( eventThreadServices, &node, property, &AnimatableProperty<Vector2>::BakeY, value.Get<float>() );
651       }
652       else
653       {
654         SceneGraph::NodePropertyMessage<Vector2>::Send( eventThreadServices, &node, property, &AnimatableProperty<Vector2>::Bake, value.Get<Vector2>() );
655       }
656
657       break;
658     }
659
660     case Property::VECTOR3:
661     {
662       const AnimatableProperty< Vector3 >* property = dynamic_cast< const AnimatableProperty< Vector3 >* >( entry.GetSceneGraphProperty() );
663       DALI_ASSERT_DEBUG( NULL != property );
664
665       // property is being used in a separate thread; queue a message to set the property
666       if(entry.componentIndex == 0)
667       {
668         SceneGraph::NodePropertyComponentMessage<Vector3>::Send( eventThreadServices, &node, property, &AnimatableProperty<Vector3>::BakeX, value.Get<float>() );
669       }
670       else if(entry.componentIndex == 1)
671       {
672         SceneGraph::NodePropertyComponentMessage<Vector3>::Send( eventThreadServices, &node, property, &AnimatableProperty<Vector3>::BakeY, value.Get<float>() );
673       }
674       else if(entry.componentIndex == 2)
675       {
676         SceneGraph::NodePropertyComponentMessage<Vector3>::Send( eventThreadServices, &node, property, &AnimatableProperty<Vector3>::BakeZ, value.Get<float>() );
677       }
678       else
679       {
680         SceneGraph::NodePropertyMessage<Vector3>::Send( eventThreadServices, &node, property, &AnimatableProperty<Vector3>::Bake, value.Get<Vector3>() );
681       }
682
683       break;
684     }
685
686     case Property::VECTOR4:
687     {
688       const AnimatableProperty< Vector4 >* property = dynamic_cast< const AnimatableProperty< Vector4 >* >( entry.GetSceneGraphProperty() );
689       DALI_ASSERT_DEBUG( NULL != property );
690
691       // property is being used in a separate thread; queue a message to set the property
692       if(entry.componentIndex == 0)
693       {
694         SceneGraph::NodePropertyComponentMessage<Vector4>::Send( eventThreadServices, &node, property, &AnimatableProperty<Vector4>::BakeX, value.Get<float>() );
695       }
696       else if(entry.componentIndex == 1)
697       {
698         SceneGraph::NodePropertyComponentMessage<Vector4>::Send( eventThreadServices, &node, property, &AnimatableProperty<Vector4>::BakeY, value.Get<float>() );
699       }
700       else if(entry.componentIndex == 2)
701       {
702         SceneGraph::NodePropertyComponentMessage<Vector4>::Send( eventThreadServices, &node, property, &AnimatableProperty<Vector4>::BakeZ, value.Get<float>() );
703       }
704       else if(entry.componentIndex == 3)
705       {
706         SceneGraph::NodePropertyComponentMessage<Vector4>::Send( eventThreadServices, &node, property, &AnimatableProperty<Vector4>::BakeW, value.Get<float>() );
707       }
708       else
709       {
710         SceneGraph::NodePropertyMessage<Vector4>::Send( eventThreadServices, &node, property, &AnimatableProperty<Vector4>::Bake, value.Get<Vector4>() );
711       }
712
713       break;
714     }
715
716     case Property::ROTATION:
717     {
718       const AnimatableProperty< Quaternion >* property = dynamic_cast< const AnimatableProperty< Quaternion >* >( entry.GetSceneGraphProperty() );
719       DALI_ASSERT_DEBUG( NULL != property );
720
721       // property is being used in a separate thread; queue a message to set the property
722       SceneGraph::NodePropertyMessage<Quaternion>::Send( eventThreadServices, &node, property,&AnimatableProperty<Quaternion>::Bake,  value.Get<Quaternion>() );
723
724       break;
725     }
726
727     case Property::MATRIX:
728     {
729       const AnimatableProperty< Matrix >* property = dynamic_cast< const AnimatableProperty< Matrix >* >( entry.GetSceneGraphProperty() );
730       DALI_ASSERT_DEBUG( NULL != property );
731
732       // property is being used in a separate thread; queue a message to set the property
733       SceneGraph::NodePropertyMessage<Matrix>::Send( eventThreadServices, &node, property,&AnimatableProperty<Matrix>::Bake,  value.Get<Matrix>() );
734
735       break;
736     }
737
738     case Property::MATRIX3:
739     {
740       const AnimatableProperty< Matrix3 >* property = dynamic_cast< const AnimatableProperty< Matrix3 >* >( entry.GetSceneGraphProperty() );
741       DALI_ASSERT_DEBUG( NULL != property );
742
743       // property is being used in a separate thread; queue a message to set the property
744       SceneGraph::NodePropertyMessage<Matrix3>::Send( eventThreadServices, &node, property,&AnimatableProperty<Matrix3>::Bake,  value.Get<Matrix3>() );
745
746       break;
747     }
748
749     default:
750     {
751       // nothing to do for other types
752     }
753   } // entry.GetType
754 }
755
756 void Actor::PropertyHandler::OnNotifyDefaultPropertyAnimation(Internal::Actor& actor, Animation& animation, Property::Index index, const Property::Value& value, Animation::Type animationType)
757 {
758   switch( animationType )
759   {
760     case Animation::TO:
761     case Animation::BETWEEN:
762     {
763       switch( index )
764       {
765         case Dali::Actor::Property::SIZE:
766         {
767           if( value.Get( actor.mTargetSize ) )
768           {
769             actor.mAnimatedSize = actor.mTargetSize;
770             actor.mUseAnimatedSize = AnimatedSizeFlag::WIDTH | AnimatedSizeFlag::HEIGHT | AnimatedSizeFlag::DEPTH;
771
772             // Notify deriving classes
773             actor.OnSizeAnimation( animation, actor.mTargetSize );
774           }
775           break;
776         }
777
778         case Dali::Actor::Property::SIZE_WIDTH:
779         {
780           if( value.Get( actor.mTargetSize.width ) )
781           {
782             actor.mAnimatedSize.width = actor.mTargetSize.width;
783             actor.mUseAnimatedSize |= AnimatedSizeFlag::WIDTH;
784
785             // Notify deriving classes
786             actor.OnSizeAnimation( animation, actor.mTargetSize );
787           }
788           break;
789         }
790
791         case Dali::Actor::Property::SIZE_HEIGHT:
792         {
793           if( value.Get( actor.mTargetSize.height ) )
794           {
795             actor.mAnimatedSize.height = actor.mTargetSize.height;
796             actor.mUseAnimatedSize |= AnimatedSizeFlag::HEIGHT;
797
798             // Notify deriving classes
799             actor.OnSizeAnimation( animation, actor.mTargetSize );
800           }
801           break;
802         }
803
804         case Dali::Actor::Property::SIZE_DEPTH:
805         {
806           if( value.Get( actor.mTargetSize.depth ) )
807           {
808             actor.mAnimatedSize.depth = actor.mTargetSize.depth;
809             actor.mUseAnimatedSize |= AnimatedSizeFlag::DEPTH;
810
811             // Notify deriving classes
812             actor.OnSizeAnimation( animation, actor.mTargetSize );
813           }
814           break;
815         }
816
817         case Dali::Actor::Property::POSITION:
818         {
819           value.Get( actor.mTargetPosition );
820           break;
821         }
822
823         case Dali::Actor::Property::POSITION_X:
824         {
825           value.Get( actor.mTargetPosition.x );
826           break;
827         }
828
829         case Dali::Actor::Property::POSITION_Y:
830         {
831           value.Get( actor.mTargetPosition.y );
832           break;
833         }
834
835         case Dali::Actor::Property::POSITION_Z:
836         {
837           value.Get( actor.mTargetPosition.z );
838           break;
839         }
840
841         case Dali::Actor::Property::ORIENTATION:
842         {
843           value.Get( actor.mTargetOrientation );
844           break;
845         }
846
847         case Dali::Actor::Property::SCALE:
848         {
849           value.Get( actor.mTargetScale );
850           break;
851         }
852
853         case Dali::Actor::Property::SCALE_X:
854         {
855           value.Get( actor.mTargetScale.x );
856           break;
857         }
858
859         case Dali::Actor::Property::SCALE_Y:
860         {
861           value.Get( actor.mTargetScale.y );
862           break;
863         }
864
865         case Dali::Actor::Property::SCALE_Z:
866         {
867           value.Get( actor.mTargetScale.z );
868           break;
869         }
870
871         case Dali::Actor::Property::VISIBLE:
872         {
873           actor.SetVisibleInternal( value.Get< bool >(), SendMessage::FALSE );
874           break;
875         }
876
877         case Dali::Actor::Property::COLOR:
878         {
879           value.Get( actor.mTargetColor );
880           break;
881         }
882
883         case Dali::Actor::Property::COLOR_RED:
884         {
885           value.Get( actor.mTargetColor.r );
886           break;
887         }
888
889         case Dali::Actor::Property::COLOR_GREEN:
890         {
891           value.Get( actor.mTargetColor.g );
892           break;
893         }
894
895         case Dali::Actor::Property::COLOR_BLUE:
896         {
897           value.Get( actor.mTargetColor.b );
898           break;
899         }
900
901         case Dali::Actor::Property::COLOR_ALPHA:
902         case Dali::Actor::Property::OPACITY:
903         {
904           value.Get( actor.mTargetColor.a );
905           break;
906         }
907
908         default:
909         {
910           // Not an animatable property. Do nothing.
911           break;
912         }
913       }
914       break;
915     }
916
917     case Animation::BY:
918     {
919       switch( index )
920       {
921         case Dali::Actor::Property::SIZE:
922         {
923           if( AdjustValue< Vector3 >( actor.mTargetSize, value ) )
924           {
925             actor.mAnimatedSize = actor.mTargetSize;
926             actor.mUseAnimatedSize = AnimatedSizeFlag::WIDTH | AnimatedSizeFlag::HEIGHT | AnimatedSizeFlag::DEPTH;
927
928             // Notify deriving classes
929             actor.OnSizeAnimation( animation, actor.mTargetSize );
930           }
931           break;
932         }
933
934         case Dali::Actor::Property::SIZE_WIDTH:
935         {
936           if( AdjustValue< float >( actor.mTargetSize.width, value ) )
937           {
938             actor.mAnimatedSize.width = actor.mTargetSize.width;
939             actor.mUseAnimatedSize |= AnimatedSizeFlag::WIDTH;
940
941             // Notify deriving classes
942             actor.OnSizeAnimation( animation, actor.mTargetSize );
943           }
944           break;
945         }
946
947         case Dali::Actor::Property::SIZE_HEIGHT:
948         {
949           if( AdjustValue< float >( actor.mTargetSize.height, value ) )
950           {
951             actor.mAnimatedSize.height = actor.mTargetSize.height;
952             actor.mUseAnimatedSize |= AnimatedSizeFlag::HEIGHT;
953
954             // Notify deriving classes
955             actor.OnSizeAnimation( animation, actor.mTargetSize );
956           }
957           break;
958         }
959
960         case Dali::Actor::Property::SIZE_DEPTH:
961         {
962           if( AdjustValue< float >( actor.mTargetSize.depth, value ) )
963           {
964             actor.mAnimatedSize.depth = actor.mTargetSize.depth;
965             actor.mUseAnimatedSize |= AnimatedSizeFlag::DEPTH;
966
967             // Notify deriving classes
968             actor.OnSizeAnimation( animation, actor.mTargetSize );
969           }
970           break;
971         }
972
973         case Dali::Actor::Property::POSITION:
974         {
975           AdjustValue< Vector3 >( actor.mTargetPosition, value );
976           break;
977         }
978
979         case Dali::Actor::Property::POSITION_X:
980         {
981           AdjustValue< float >( actor.mTargetPosition.x, value );
982           break;
983         }
984
985         case Dali::Actor::Property::POSITION_Y:
986         {
987           AdjustValue< float >( actor.mTargetPosition.y, value );
988           break;
989         }
990
991         case Dali::Actor::Property::POSITION_Z:
992         {
993           AdjustValue< float >( actor.mTargetPosition.z, value );
994           break;
995         }
996
997         case Dali::Actor::Property::ORIENTATION:
998         {
999           Quaternion relativeValue;
1000           if( value.Get( relativeValue ) )
1001           {
1002             actor.mTargetOrientation *= relativeValue;
1003           }
1004           break;
1005         }
1006
1007         case Dali::Actor::Property::SCALE:
1008         {
1009           AdjustValue< Vector3 >( actor.mTargetScale, value );
1010           break;
1011         }
1012
1013         case Dali::Actor::Property::SCALE_X:
1014         {
1015           AdjustValue< float >( actor.mTargetScale.x, value );
1016           break;
1017         }
1018
1019         case Dali::Actor::Property::SCALE_Y:
1020         {
1021           AdjustValue< float >( actor.mTargetScale.y, value );
1022           break;
1023         }
1024
1025         case Dali::Actor::Property::SCALE_Z:
1026         {
1027           AdjustValue< float >( actor.mTargetScale.z, value );
1028           break;
1029         }
1030
1031         case Dali::Actor::Property::VISIBLE:
1032         {
1033           bool relativeValue = false;
1034           if( value.Get( relativeValue ) )
1035           {
1036             bool visible = actor.mVisible || relativeValue;
1037             actor.SetVisibleInternal( visible, SendMessage::FALSE );
1038           }
1039           break;
1040         }
1041
1042         case Dali::Actor::Property::COLOR:
1043         {
1044           AdjustValue< Vector4 >( actor.mTargetColor, value );
1045           break;
1046         }
1047
1048         case Dali::Actor::Property::COLOR_RED:
1049         {
1050           AdjustValue< float >( actor.mTargetColor.r, value );
1051           break;
1052         }
1053
1054         case Dali::Actor::Property::COLOR_GREEN:
1055         {
1056           AdjustValue< float >( actor.mTargetColor.g, value );
1057           break;
1058         }
1059
1060         case Dali::Actor::Property::COLOR_BLUE:
1061         {
1062           AdjustValue< float >( actor.mTargetColor.b, value );
1063           break;
1064         }
1065
1066         case Dali::Actor::Property::COLOR_ALPHA:
1067         case Dali::Actor::Property::OPACITY:
1068         {
1069           AdjustValue< float >( actor.mTargetColor.a, value );
1070           break;
1071         }
1072
1073         default:
1074         {
1075           // Not an animatable property. Do nothing.
1076           break;
1077         }
1078       }
1079       break;
1080     }
1081   }
1082 }
1083
1084 const PropertyBase* Actor::PropertyHandler::GetSceneObjectAnimatableProperty(Property::Index index, const SceneGraph::Node& node)
1085 {
1086   const PropertyBase* property( nullptr );
1087
1088   switch( index )
1089   {
1090     case Dali::Actor::Property::SIZE:        // FALLTHROUGH
1091     case Dali::Actor::Property::SIZE_WIDTH:  // FALLTHROUGH
1092     case Dali::Actor::Property::SIZE_HEIGHT: // FALLTHROUGH
1093     case Dali::Actor::Property::SIZE_DEPTH:
1094     {
1095       property = &node.mSize;
1096       break;
1097     }
1098     case Dali::Actor::Property::POSITION:   // FALLTHROUGH
1099     case Dali::Actor::Property::POSITION_X: // FALLTHROUGH
1100     case Dali::Actor::Property::POSITION_Y: // FALLTHROUGH
1101     case Dali::Actor::Property::POSITION_Z:
1102     {
1103       property = &node.mPosition;
1104       break;
1105     }
1106     case Dali::Actor::Property::ORIENTATION:
1107     {
1108       property = &node.mOrientation;
1109       break;
1110     }
1111     case Dali::Actor::Property::SCALE:   // FALLTHROUGH
1112     case Dali::Actor::Property::SCALE_X: // FALLTHROUGH
1113     case Dali::Actor::Property::SCALE_Y: // FALLTHROUGH
1114     case Dali::Actor::Property::SCALE_Z:
1115     {
1116       property = &node.mScale;
1117       break;
1118     }
1119     case Dali::Actor::Property::VISIBLE:
1120     {
1121       property = &node.mVisible;
1122       break;
1123     }
1124     case Dali::Actor::Property::COLOR:       // FALLTHROUGH
1125     case Dali::Actor::Property::COLOR_RED:   // FALLTHROUGH
1126     case Dali::Actor::Property::COLOR_GREEN: // FALLTHROUGH
1127     case Dali::Actor::Property::COLOR_BLUE:  // FALLTHROUGH
1128     case Dali::Actor::Property::COLOR_ALPHA: // FALLTHROUGH
1129     case Dali::Actor::Property::OPACITY:
1130     {
1131       property = &node.mColor;
1132       break;
1133     }
1134     default:
1135     {
1136       break;
1137     }
1138   }
1139
1140   return property;
1141 }
1142
1143 const PropertyInputImpl* Actor::PropertyHandler::GetSceneObjectInputProperty(Property::Index index, const SceneGraph::Node& node)
1144 {
1145   const PropertyInputImpl* property( nullptr );
1146
1147   switch( index )
1148   {
1149     case Dali::Actor::Property::PARENT_ORIGIN:   // FALLTHROUGH
1150     case Dali::Actor::Property::PARENT_ORIGIN_X: // FALLTHROUGH
1151     case Dali::Actor::Property::PARENT_ORIGIN_Y: // FALLTHROUGH
1152     case Dali::Actor::Property::PARENT_ORIGIN_Z:
1153     {
1154       property = &node.mParentOrigin;
1155       break;
1156     }
1157     case Dali::Actor::Property::ANCHOR_POINT:   // FALLTHROUGH
1158     case Dali::Actor::Property::ANCHOR_POINT_X: // FALLTHROUGH
1159     case Dali::Actor::Property::ANCHOR_POINT_Y: // FALLTHROUGH
1160     case Dali::Actor::Property::ANCHOR_POINT_Z:
1161     {
1162       property = &node.mAnchorPoint;
1163       break;
1164     }
1165     case Dali::Actor::Property::WORLD_POSITION:   // FALLTHROUGH
1166     case Dali::Actor::Property::WORLD_POSITION_X: // FALLTHROUGH
1167     case Dali::Actor::Property::WORLD_POSITION_Y: // FALLTHROUGH
1168     case Dali::Actor::Property::WORLD_POSITION_Z:
1169     {
1170       property = &node.mWorldPosition;
1171       break;
1172     }
1173     case Dali::Actor::Property::WORLD_ORIENTATION:
1174     {
1175       property = &node.mWorldOrientation;
1176       break;
1177     }
1178     case Dali::Actor::Property::WORLD_SCALE:
1179     {
1180       property = &node.mWorldScale;
1181       break;
1182     }
1183     case Dali::Actor::Property::WORLD_COLOR:
1184     {
1185       property = &node.mWorldColor;
1186       break;
1187     }
1188     case Dali::Actor::Property::WORLD_MATRIX:
1189     {
1190       property = &node.mWorldMatrix;
1191       break;
1192     }
1193     case Dali::Actor::Property::CULLED:
1194     {
1195       property = &node.mCulled;
1196       break;
1197     }
1198     default:
1199     {
1200       break;
1201     }
1202   }
1203
1204   return property;
1205 }
1206
1207 int32_t Actor::PropertyHandler::GetPropertyComponentIndex(Property::Index index)
1208 {
1209   int32_t componentIndex = Property::INVALID_COMPONENT_INDEX;
1210
1211   switch( index )
1212   {
1213     case Dali::Actor::Property::PARENT_ORIGIN_X:
1214     case Dali::Actor::Property::ANCHOR_POINT_X:
1215     case Dali::Actor::Property::SIZE_WIDTH:
1216     case Dali::Actor::Property::POSITION_X:
1217     case Dali::Actor::Property::WORLD_POSITION_X:
1218     case Dali::Actor::Property::SCALE_X:
1219     case Dali::Actor::Property::COLOR_RED:
1220     {
1221       componentIndex = 0;
1222       break;
1223     }
1224
1225     case Dali::Actor::Property::PARENT_ORIGIN_Y:
1226     case Dali::Actor::Property::ANCHOR_POINT_Y:
1227     case Dali::Actor::Property::SIZE_HEIGHT:
1228     case Dali::Actor::Property::POSITION_Y:
1229     case Dali::Actor::Property::WORLD_POSITION_Y:
1230     case Dali::Actor::Property::SCALE_Y:
1231     case Dali::Actor::Property::COLOR_GREEN:
1232     {
1233       componentIndex = 1;
1234       break;
1235     }
1236
1237     case Dali::Actor::Property::PARENT_ORIGIN_Z:
1238     case Dali::Actor::Property::ANCHOR_POINT_Z:
1239     case Dali::Actor::Property::SIZE_DEPTH:
1240     case Dali::Actor::Property::POSITION_Z:
1241     case Dali::Actor::Property::WORLD_POSITION_Z:
1242     case Dali::Actor::Property::SCALE_Z:
1243     case Dali::Actor::Property::COLOR_BLUE:
1244     {
1245       componentIndex = 2;
1246       break;
1247     }
1248
1249     case Dali::Actor::Property::COLOR_ALPHA:
1250     case Dali::Actor::Property::OPACITY:
1251     {
1252       componentIndex = 3;
1253       break;
1254     }
1255
1256     default:
1257     {
1258       // Do nothing
1259       break;
1260     }
1261   }
1262
1263   return componentIndex;
1264 }
1265
1266 bool Actor::PropertyHandler::GetCachedPropertyValue(const Internal::Actor& actor, Property::Index index, Property::Value& value)
1267 {
1268   bool valueSet = true;
1269
1270   switch( index )
1271   {
1272     case Dali::Actor::Property::PARENT_ORIGIN:
1273     {
1274       value = actor.GetCurrentParentOrigin();
1275       break;
1276     }
1277
1278     case Dali::Actor::Property::PARENT_ORIGIN_X:
1279     {
1280       value = actor.GetCurrentParentOrigin().x;
1281       break;
1282     }
1283
1284     case Dali::Actor::Property::PARENT_ORIGIN_Y:
1285     {
1286       value = actor.GetCurrentParentOrigin().y;
1287       break;
1288     }
1289
1290     case Dali::Actor::Property::PARENT_ORIGIN_Z:
1291     {
1292       value = actor.GetCurrentParentOrigin().z;
1293       break;
1294     }
1295
1296     case Dali::Actor::Property::ANCHOR_POINT:
1297     {
1298       value = actor.GetCurrentAnchorPoint();
1299       break;
1300     }
1301
1302     case Dali::Actor::Property::ANCHOR_POINT_X:
1303     {
1304       value = actor.GetCurrentAnchorPoint().x;
1305       break;
1306     }
1307
1308     case Dali::Actor::Property::ANCHOR_POINT_Y:
1309     {
1310       value = actor.GetCurrentAnchorPoint().y;
1311       break;
1312     }
1313
1314     case Dali::Actor::Property::ANCHOR_POINT_Z:
1315     {
1316       value = actor.GetCurrentAnchorPoint().z;
1317       break;
1318     }
1319
1320     case Dali::Actor::Property::SIZE:
1321     {
1322       value = actor.GetTargetSize();
1323       break;
1324     }
1325
1326     case Dali::Actor::Property::SIZE_WIDTH:
1327     {
1328       value = actor.GetTargetSize().width;
1329       break;
1330     }
1331
1332     case Dali::Actor::Property::SIZE_HEIGHT:
1333     {
1334       value = actor.GetTargetSize().height;
1335       break;
1336     }
1337
1338     case Dali::Actor::Property::SIZE_DEPTH:
1339     {
1340       value = actor.GetTargetSize().depth;
1341       break;
1342     }
1343
1344     case Dali::Actor::Property::POSITION:
1345     {
1346       value = actor.GetTargetPosition();
1347       break;
1348     }
1349
1350     case Dali::Actor::Property::POSITION_X:
1351     {
1352       value = actor.GetTargetPosition().x;
1353       break;
1354     }
1355
1356     case Dali::Actor::Property::POSITION_Y:
1357     {
1358       value = actor.GetTargetPosition().y;
1359       break;
1360     }
1361
1362     case Dali::Actor::Property::POSITION_Z:
1363     {
1364       value = actor.GetTargetPosition().z;
1365       break;
1366     }
1367
1368     case Dali::Actor::Property::ORIENTATION:
1369     {
1370       value = actor.mTargetOrientation;
1371       break;
1372     }
1373
1374     case Dali::Actor::Property::SCALE:
1375     {
1376       value = actor.mTargetScale;
1377       break;
1378     }
1379
1380     case Dali::Actor::Property::SCALE_X:
1381     {
1382       value = actor.mTargetScale.x;
1383       break;
1384     }
1385
1386     case Dali::Actor::Property::SCALE_Y:
1387     {
1388       value = actor.mTargetScale.y;
1389       break;
1390     }
1391
1392     case Dali::Actor::Property::SCALE_Z:
1393     {
1394       value = actor.mTargetScale.z;
1395       break;
1396     }
1397
1398     case Dali::Actor::Property::VISIBLE:
1399     {
1400       value = actor.mVisible;
1401       break;
1402     }
1403
1404     case Dali::Actor::Property::COLOR:
1405     {
1406       value = actor.mTargetColor;
1407       break;
1408     }
1409
1410     case Dali::Actor::Property::COLOR_RED:
1411     {
1412       value = actor.mTargetColor.r;
1413       break;
1414     }
1415
1416     case Dali::Actor::Property::COLOR_GREEN:
1417     {
1418       value = actor.mTargetColor.g;
1419       break;
1420     }
1421
1422     case Dali::Actor::Property::COLOR_BLUE:
1423     {
1424       value = actor.mTargetColor.b;
1425       break;
1426     }
1427
1428     case Dali::Actor::Property::COLOR_ALPHA:
1429     case Dali::Actor::Property::OPACITY:
1430     {
1431       value = actor.mTargetColor.a;
1432       break;
1433     }
1434
1435     case Dali::Actor::Property::NAME:
1436     {
1437       value = actor.GetName();
1438       break;
1439     }
1440
1441     case Dali::Actor::Property::SENSITIVE:
1442     {
1443       value = actor.IsSensitive();
1444       break;
1445     }
1446
1447     case Dali::Actor::Property::LEAVE_REQUIRED:
1448     {
1449       value = actor.GetLeaveRequired();
1450       break;
1451     }
1452
1453     case Dali::Actor::Property::INHERIT_POSITION:
1454     {
1455       value = actor.IsPositionInherited();
1456       break;
1457     }
1458
1459     case Dali::Actor::Property::INHERIT_ORIENTATION:
1460     {
1461       value = actor.IsOrientationInherited();
1462       break;
1463     }
1464
1465     case Dali::Actor::Property::INHERIT_SCALE:
1466     {
1467       value = actor.IsScaleInherited();
1468       break;
1469     }
1470
1471     case Dali::Actor::Property::COLOR_MODE:
1472     {
1473       value = actor.GetColorMode();
1474       break;
1475     }
1476
1477     case Dali::Actor::Property::DRAW_MODE:
1478     {
1479       value = actor.GetDrawMode();
1480       break;
1481     }
1482
1483     case Dali::Actor::Property::SIZE_MODE_FACTOR:
1484     {
1485       value = actor.GetSizeModeFactor();
1486       break;
1487     }
1488
1489     case Dali::Actor::Property::WIDTH_RESIZE_POLICY:
1490     {
1491       value = Scripting::GetLinearEnumerationName< ResizePolicy::Type >( actor.GetResizePolicy( Dimension::WIDTH ), RESIZE_POLICY_TABLE, RESIZE_POLICY_TABLE_COUNT );
1492       break;
1493     }
1494
1495     case Dali::Actor::Property::HEIGHT_RESIZE_POLICY:
1496     {
1497       value = Scripting::GetLinearEnumerationName< ResizePolicy::Type >( actor.GetResizePolicy( Dimension::HEIGHT ), RESIZE_POLICY_TABLE, RESIZE_POLICY_TABLE_COUNT );
1498       break;
1499     }
1500
1501     case Dali::Actor::Property::SIZE_SCALE_POLICY:
1502     {
1503       value = actor.GetSizeScalePolicy();
1504       break;
1505     }
1506
1507     case Dali::Actor::Property::WIDTH_FOR_HEIGHT:
1508     {
1509       value = ( actor.GetResizePolicy( Dimension::WIDTH ) == ResizePolicy::DIMENSION_DEPENDENCY ) && ( actor.GetDimensionDependency( Dimension::WIDTH ) == Dimension::HEIGHT );
1510       break;
1511     }
1512
1513     case Dali::Actor::Property::HEIGHT_FOR_WIDTH:
1514     {
1515       value = ( actor.GetResizePolicy( Dimension::HEIGHT ) == ResizePolicy::DIMENSION_DEPENDENCY ) && ( actor.GetDimensionDependency( Dimension::HEIGHT ) == Dimension::WIDTH );
1516       break;
1517     }
1518
1519     case Dali::Actor::Property::PADDING:
1520     {
1521       Vector2 widthPadding = actor.GetPadding( Dimension::WIDTH );
1522       Vector2 heightPadding = actor.GetPadding( Dimension::HEIGHT );
1523       value = Vector4( widthPadding.x, widthPadding.y, heightPadding.x, heightPadding.y );
1524       break;
1525     }
1526
1527     case Dali::Actor::Property::MINIMUM_SIZE:
1528     {
1529       value = Vector2( actor.GetMinimumSize( Dimension::WIDTH ), actor.GetMinimumSize( Dimension::HEIGHT ) );
1530       break;
1531     }
1532
1533     case Dali::Actor::Property::MAXIMUM_SIZE:
1534     {
1535       value = Vector2( actor.GetMaximumSize( Dimension::WIDTH ), actor.GetMaximumSize( Dimension::HEIGHT ) );
1536       break;
1537     }
1538
1539     case Dali::Actor::Property::CLIPPING_MODE:
1540     {
1541       value = actor.mClippingMode;
1542       break;
1543     }
1544
1545     case Dali::DevelActor::Property::SIBLING_ORDER:
1546     {
1547       value = static_cast<int>( actor.GetSiblingOrder() );
1548       break;
1549     }
1550
1551     case Dali::Actor::Property::SCREEN_POSITION:
1552     {
1553       value = actor.GetCurrentScreenPosition();
1554       break;
1555     }
1556
1557     case Dali::Actor::Property::POSITION_USES_ANCHOR_POINT:
1558     {
1559       value = actor.mPositionUsesAnchorPoint;
1560       break;
1561     }
1562
1563     case Dali::Actor::Property::LAYOUT_DIRECTION:
1564     {
1565       value = actor.mLayoutDirection;
1566       break;
1567     }
1568
1569     case Dali::Actor::Property::INHERIT_LAYOUT_DIRECTION:
1570     {
1571       value = actor.IsLayoutDirectionInherited();
1572       break;
1573     }
1574
1575     case Dali::Actor::Property::ID:
1576     {
1577       value = static_cast<int>( actor.GetId() );
1578       break;
1579     }
1580
1581     case Dali::Actor::Property::HIERARCHY_DEPTH:
1582     {
1583       value = actor.GetHierarchyDepth();
1584       break;
1585     }
1586
1587     case Dali::Actor::Property::IS_ROOT:
1588     {
1589       value = actor.IsRoot();
1590       break;
1591     }
1592
1593     case Dali::Actor::Property::IS_LAYER:
1594     {
1595       value = actor.IsLayer();
1596       break;
1597     }
1598
1599     case Dali::Actor::Property::CONNECTED_TO_SCENE:
1600     {
1601       value = actor.OnScene();
1602       break;
1603     }
1604
1605     case Dali::Actor::Property::KEYBOARD_FOCUSABLE:
1606     {
1607       value = actor.IsKeyboardFocusable();
1608       break;
1609     }
1610
1611     case Dali::DevelActor::Property::CAPTURE_ALL_TOUCH_AFTER_START:
1612     {
1613       value = actor.mCaptureAllTouchAfterStart;
1614       break;
1615     }
1616
1617     case Dali::DevelActor::Property::TOUCH_DELEGATE_AREA:
1618     {
1619       value = actor.GetTouchDelegateArea();
1620       break;
1621     }
1622
1623     default:
1624     {
1625       // Must be a scene-graph only property
1626       valueSet = false;
1627       break;
1628     }
1629   }
1630
1631   return valueSet;
1632 }
1633
1634 bool Actor::PropertyHandler::GetCurrentPropertyValue(const Internal::Actor& actor, Property::Index index, Property::Value& value)
1635 {
1636   bool valueSet = true;
1637
1638   switch( index )
1639   {
1640     case Dali::Actor::Property::SIZE:
1641     {
1642       value = actor.GetCurrentSize();
1643       break;
1644     }
1645
1646     case Dali::Actor::Property::SIZE_WIDTH:
1647     {
1648       value = actor.GetCurrentSize().width;
1649       break;
1650     }
1651
1652     case Dali::Actor::Property::SIZE_HEIGHT:
1653     {
1654       value = actor.GetCurrentSize().height;
1655       break;
1656     }
1657
1658     case Dali::Actor::Property::SIZE_DEPTH:
1659     {
1660       value = actor.GetCurrentSize().depth;
1661       break;
1662     }
1663
1664     case Dali::Actor::Property::POSITION:
1665     {
1666       value = actor.GetCurrentPosition();
1667       break;
1668     }
1669
1670     case Dali::Actor::Property::POSITION_X:
1671     {
1672       value = actor.GetCurrentPosition().x;
1673       break;
1674     }
1675
1676     case Dali::Actor::Property::POSITION_Y:
1677     {
1678       value = actor.GetCurrentPosition().y;
1679       break;
1680     }
1681
1682     case Dali::Actor::Property::POSITION_Z:
1683     {
1684       value = actor.GetCurrentPosition().z;
1685       break;
1686     }
1687
1688     case Dali::Actor::Property::WORLD_POSITION:
1689     {
1690       value = actor.GetCurrentWorldPosition();
1691       break;
1692     }
1693
1694     case Dali::Actor::Property::WORLD_POSITION_X:
1695     {
1696       value = actor.GetCurrentWorldPosition().x;
1697       break;
1698     }
1699
1700     case Dali::Actor::Property::WORLD_POSITION_Y:
1701     {
1702       value = actor.GetCurrentWorldPosition().y;
1703       break;
1704     }
1705
1706     case Dali::Actor::Property::WORLD_POSITION_Z:
1707     {
1708       value = actor.GetCurrentWorldPosition().z;
1709       break;
1710     }
1711
1712     case Dali::Actor::Property::ORIENTATION:
1713     {
1714       value = actor.GetCurrentOrientation();
1715       break;
1716     }
1717
1718     case Dali::Actor::Property::WORLD_ORIENTATION:
1719     {
1720       value = actor.GetCurrentWorldOrientation();
1721       break;
1722     }
1723
1724     case Dali::Actor::Property::SCALE:
1725     {
1726       value = actor.GetCurrentScale();
1727       break;
1728     }
1729
1730     case Dali::Actor::Property::SCALE_X:
1731     {
1732       value = actor.GetCurrentScale().x;
1733       break;
1734     }
1735
1736     case Dali::Actor::Property::SCALE_Y:
1737     {
1738       value = actor.GetCurrentScale().y;
1739       break;
1740     }
1741
1742     case Dali::Actor::Property::SCALE_Z:
1743     {
1744       value = actor.GetCurrentScale().z;
1745       break;
1746     }
1747
1748     case Dali::Actor::Property::WORLD_SCALE:
1749     {
1750       value = actor.GetCurrentWorldScale();
1751       break;
1752     }
1753
1754     case Dali::Actor::Property::COLOR:
1755     {
1756       value = actor.GetCurrentColor();
1757       break;
1758     }
1759
1760     case Dali::Actor::Property::COLOR_RED:
1761     {
1762       value = actor.GetCurrentColor().r;
1763       break;
1764     }
1765
1766     case Dali::Actor::Property::COLOR_GREEN:
1767     {
1768       value = actor.GetCurrentColor().g;
1769       break;
1770     }
1771
1772     case Dali::Actor::Property::COLOR_BLUE:
1773     {
1774       value = actor.GetCurrentColor().b;
1775       break;
1776     }
1777
1778     case Dali::Actor::Property::COLOR_ALPHA:
1779     case Dali::Actor::Property::OPACITY:
1780     {
1781       value = actor.GetCurrentColor().a;
1782       break;
1783     }
1784
1785     case Dali::Actor::Property::WORLD_COLOR:
1786     {
1787       value = actor.GetCurrentWorldColor();
1788       break;
1789     }
1790
1791     case Dali::Actor::Property::WORLD_MATRIX:
1792     {
1793       value = actor.GetCurrentWorldMatrix();
1794       break;
1795     }
1796
1797     case Dali::Actor::Property::VISIBLE:
1798     {
1799       value = actor.IsVisible();
1800       break;
1801     }
1802
1803     case Dali::Actor::Property::CULLED:
1804     {
1805       value = actor.GetNode().IsCulled( actor.GetEventThreadServices().GetEventBufferIndex() );
1806       break;
1807     }
1808
1809     case Dali::DevelActor::Property::UPDATE_SIZE_HINT:
1810     {
1811       // node is being used in a separate thread, the value from the previous update is the same, set by user
1812       value = Vector2( actor.GetNode().GetUpdateSizeHint() );
1813       break;
1814     }
1815
1816     default:
1817     {
1818       // Must be an event-side only property
1819       valueSet = false;
1820       break;
1821     }
1822   }
1823
1824   return valueSet;
1825 }
1826
1827 } // namespace Internal
1828
1829 } // namespace Dali