Add renderer API and required glue.
[platform/core/uifw/dali-core.git] / dali / internal / event / actors / actor-impl.h
1 #ifndef __DALI_INTERNAL_ACTOR_H__
2 #define __DALI_INTERNAL_ACTOR_H__
3
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <string>
23
24 // INTERNAL INCLUDES
25 #include <dali/public-api/common/vector-wrapper.h>
26 #include <dali/public-api/object/ref-object.h>
27 #include <dali/public-api/actors/actor.h>
28 #include <dali/public-api/common/dali-common.h>
29 #include <dali/public-api/events/gesture.h>
30 #include <dali/public-api/math/viewport.h>
31 #include <dali/internal/event/common/object-impl.h>
32 #include <dali/internal/event/common/stage-def.h>
33 #include <dali/internal/event/actors/actor-declarations.h>
34 #include <dali/internal/event/actors/renderer-impl.h>
35 #include <dali/internal/event/actor-attachments/actor-attachment-declarations.h>
36 #include <dali/internal/update/nodes/node-declarations.h>
37
38 #ifdef DYNAMICS_SUPPORT
39 #include <dali/internal/event/dynamics/dynamics-declarations.h>
40 #endif
41
42 namespace Dali
43 {
44
45 struct KeyEvent;
46 struct TouchEvent;
47 struct HoverEvent;
48 struct MouseWheelEvent;
49
50 namespace Internal
51 {
52
53 class Actor;
54 class ActorGestureData;
55 class Animation;
56 class RenderTask;
57 class Renderer;
58 struct DynamicsData;
59
60 typedef IntrusivePtr<Actor>                   ActorPtr;
61 typedef Dali::ActorContainer                  ActorContainer; // Store handles to return via public-api
62 typedef ActorContainer::iterator              ActorIter;
63 typedef ActorContainer::const_iterator        ActorConstIter;
64
65 /**
66  * Actor is the primary object which Dali applications interact with.
67  * UI controls can be built by combining multiple actors.
68  * Multi-Touch events are received through signals emitted by the actor tree.
69  *
70  * An Actor is a proxy for a Node in the scene graph.
71  * When an Actor is added to the Stage, it creates a node and attaches it to the scene graph.
72  * The scene-graph can be updated in a separate thread, so the attachment is done using an asynchronous message.
73  * When a tree of Actors is detached from the Stage, a message is sent to destroy the associated nodes.
74  */
75 class Actor : public Object
76 {
77 public:
78
79   /**
80    * Create a new actor.
81    * @return A smart-pointer to the newly allocated Actor.
82    */
83   static ActorPtr New();
84
85   /**
86    * Retrieve the name of the actor.
87    * @return The name.
88    */
89   const std::string& GetName() const;
90
91   /**
92    * Set the name of the actor.
93    * @param[in] name The new name.
94    */
95   void SetName(const std::string& name);
96
97   /**
98    * @copydoc Dali::Actor::GetId
99    */
100   unsigned int GetId() const;
101
102   // Attachments
103
104   /**
105    * Attach an object to an actor.
106    * @pre The actor does not already have an attachment.
107    * @param[in] attachment The object to attach.
108    */
109   void Attach(ActorAttachment& attachment);
110
111   /**
112    * Retreive the object attached to an actor.
113    * @return The attachment.
114    */
115   ActorAttachmentPtr GetAttachment();
116
117   // Containment
118
119   /**
120    * Query whether an actor is the root actor, which is owned by the Stage.
121    * @return True if the actor is a root actor.
122    */
123   bool IsRoot() const
124   {
125     return mIsRoot;
126   }
127
128   /**
129    * Query whether the actor is connected to the Stage.
130    */
131   bool OnStage() const;
132
133   /**
134    * Query whether the actor is a RenderableActor derived type.
135    * @return True if the actor is renderable.
136    */
137   bool IsRenderable() const
138   {
139     // inlined as this is called a lot in hit testing
140     return mIsRenderable;
141   }
142
143   /**
144    * Query whether the actor is of class Dali::Layer
145    * @return True if the actor is a layer.
146    */
147   bool IsLayer() const
148   {
149     // inlined as this is called a lot in hit testing
150     return mIsLayer;
151   }
152
153   /**
154    * Gets the layer in which the actor is present
155    * @return The layer, which will be uninitialized if the actor is off-stage.
156    */
157   Dali::Layer GetLayer();
158
159   /**
160    * Adds a child Actor to this Actor.
161    * @pre The child actor is not the same as the parent actor.
162    * @pre The child actor does not already have a parent.
163    * @param [in] child The child.
164    * @post The child will be referenced by its parent.
165    */
166   void Add(Actor& child);
167
168   /**
169    * Inserts a child Actor to this Actor's child list
170    * @pre The child actor is not the same as the parent actor.
171    * @pre The child actor does not already have a parent.
172    * @param [in] index in childlist to insert child at
173    * @param [in] child The child.
174    * @post The child will be referenced by its parent.
175    */
176   void Insert(unsigned int index, Actor& child);
177
178   /**
179    * Removes a child Actor from this Actor.
180    * @param [in] child The child.
181    * @post The child will be unreferenced.
182    */
183   void Remove(Actor& child);
184
185   /**
186    * @copydoc Dali::Actor::Unparent
187    */
188   void Unparent();
189
190   /**
191    * Retrieve the number of children held by the actor.
192    * @return The number of children
193    */
194   unsigned int GetChildCount() const;
195
196   /**
197    * @copydoc Dali::Actor::GetChildAt
198    */
199   Dali::Actor GetChildAt(unsigned int index) const;
200
201   /**
202    * Retrieve the Actor's children.
203    * @return A copy of the container of children.
204    */
205   ActorContainer GetChildren();
206
207   /**
208    * Retrieve the Actor's children.
209    * @return A const reference to the container of children.
210    */
211   const ActorContainer& GetChildren() const;
212
213   /**
214    * Retrieve a reference to Actor's children.
215    * @note Not for public use.
216    * @return A reference to the container of children.
217    */
218   ActorContainer& GetChildrenInternal()
219   {
220     return *mChildren;
221   }
222
223   /**
224    * @copydoc Dali::Actor::FindChildByName
225    */
226   ActorPtr FindChildByName(const std::string& actorName);
227
228   /**
229    * @copydoc Dali::Actor::FindChildByAlias
230    */
231   Dali::Actor FindChildByAlias(const std::string& actorAlias);
232
233   /**
234    * @copydoc Dali::Actor::FindChildById
235    */
236   ActorPtr FindChildById(const unsigned int id);
237
238   /**
239    * Retrieve the parent of an Actor.
240    * @return The parent actor, or NULL if the Actor does not have a parent.
241    */
242   Actor* GetParent() const
243   {
244     return mParent;
245   }
246
247   /**
248    * Sets the size of an actor.
249    * ActorAttachments attached to the actor, can be scaled to fit within this area.
250    * This does not interfere with the actors scale factor.
251    * @param [in] width  The new width.
252    * @param [in] height The new height.
253    */
254   void SetSize(float width, float height);
255
256   /**
257    * Sets the size of an actor.
258    * ActorAttachments attached to the actor, can be scaled to fit within this area.
259    * This does not interfere with the actors scale factor.
260    * @param [in] width The size of the actor along the x-axis.
261    * @param [in] height The size of the actor along the y-axis.
262    * @param [in] depth The size of the actor along the z-axis.
263    */
264   void SetSize(float width, float height, float depth);
265
266   /**
267    * Sets the size of an actor.
268    * ActorAttachments attached to the actor, can be scaled to fit within this area.
269    * This does not interfere with the actors scale factor.
270    * @param [in] size The new size.
271    */
272   void SetSize(const Vector2& size);
273
274   /**
275    * Sets the size of an actor.
276    * ActorAttachments attached to the actor, can be scaled to fit within this area.
277    * This does not interfere with the actors scale factor.
278    * @param [in] size The new size.
279    */
280   void SetSize(const Vector3& size);
281
282   /**
283    * Set the width component of the Actor's size.
284    * @param [in] width The new width component.
285    */
286   void SetWidth( float width );
287
288   /**
289    * Set the height component of the Actor's size.
290    * @param [in] height The new height component.
291    */
292   void SetHeight( float height );
293
294   /**
295    * Set the depth component of the Actor's size.
296    * @param [in] depth The new depth component.
297    */
298   void SetDepth( float depth );
299
300   /**
301    * Retrieve the Actor's size from event side.
302    * This size will be the size set or if animating then the target size.
303    * @return The Actor's size.
304    */
305   const Vector3& GetSize() const;
306
307   /**
308    * Retrieve the Actor's size from update side.
309    * This size will be the size set or animating but will be a frame behind.
310    * @return The Actor's size.
311    */
312   const Vector3& GetCurrentSize() const;
313
314   /**
315    * Return the natural size of the actor
316    *
317    * @return The actor's natural size
318    */
319   virtual Vector3 GetNaturalSize() const;
320
321   /**
322    * Set the origin of an actor, within its parent's area.
323    * This is expressed in 2D unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the parent,
324    * and (1.0, 1.0, 0.5) is the bottom-right corner.
325    * The default parent-origin is top-left (0.0, 0.0, 0.5).
326    * An actor position is the distance between this origin, and the actors anchor-point.
327    * @param [in] origin The new parent-origin.
328    */
329   void SetParentOrigin(const Vector3& origin);
330
331   /**
332    * Set the x component of the parent-origin
333    * @param [in] x The new x value.
334    */
335   void SetParentOriginX( float x );
336
337   /**
338    * Set the y component of the parent-origin
339    * @param [in] y The new y value.
340    */
341   void SetParentOriginY( float y );
342
343   /**
344    * Set the z component of the parent-origin
345    * @param [in] z The new z value.
346    */
347   void SetParentOriginZ( float z );
348
349   /**
350    * Retrieve the parent-origin of an actor.
351    * @return The parent-origin.
352    */
353   const Vector3& GetCurrentParentOrigin() const;
354
355   /**
356    * Set the anchor-point of an actor. This is expressed in 2D unit coordinates, such that
357    * (0.0, 0.0, 0.5) is the top-left corner of the actor, and (1.0, 1.0, 0.5) is the bottom-right corner.
358    * The default anchor point is top-left (0.0, 0.0, 0.5).
359    * An actor position is the distance between its parent-origin, and this anchor-point.
360    * An actor's rotation is centered around its anchor-point.
361    * @param [in] anchorPoint The new anchor-point.
362    */
363   void SetAnchorPoint(const Vector3& anchorPoint);
364
365   /**
366    * Set the x component of the anchor-point.
367    * @param [in] x The new x value.
368    */
369   void SetAnchorPointX( float x );
370
371   /**
372    * Set the y component of the anchor-point.
373    * @param [in] y The new y value.
374    */
375   void SetAnchorPointY( float y );
376
377   /**
378    * Set the z component of the anchor-point.
379    * @param [in] z The new z value.
380    */
381   void SetAnchorPointZ( float z );
382
383   /**
384    * Retrieve the anchor-point of an actor.
385    * @return The anchor-point.
386    */
387   const Vector3& GetCurrentAnchorPoint() const;
388
389   /**
390    * Sets the position of the Actor.
391    * The coordinates are relative to the Actor's parent.
392    * The Actor's z position will be set to 0.0f.
393    * @param [in] x The new x position
394    * @param [in] y The new y position
395    */
396   void SetPosition(float x, float y);
397
398   /**
399    * Sets the position of the Actor.
400    * The coordinates are relative to the Actor's parent.
401    * @param [in] x The new x position
402    * @param [in] y The new y position
403    * @param [in] z The new z position
404    */
405   void SetPosition(float x, float y, float z);
406
407   /**
408    * Sets the position of the Actor.
409    * The coordinates are relative to the Actor's parent.
410    * @param [in] position The new position.
411    */
412   void SetPosition(const Vector3& position);
413
414   /**
415    * Set the position of an actor along the X-axis.
416    * @param [in] x The new x position
417    */
418   void SetX(float x);
419
420   /**
421    * Set the position of an actor along the Y-axis.
422    * @param [in] y The new y position.
423    */
424   void SetY(float y);
425
426   /**
427    * Set the position of an actor along the Z-axis.
428    * @param [in] z The new z position
429    */
430   void SetZ(float z);
431
432   /**
433    * Move an actor relative to its existing position.
434    * @param[in] distance The actor will move by this distance.
435    */
436   void MoveBy(const Vector3& distance);
437
438   /**
439    * Retrieve the position of the Actor.
440    * The coordinates are relative to the Actor's parent.
441    * @return the Actor's position.
442    */
443   const Vector3& GetCurrentPosition() const;
444
445   /**
446    * @copydoc Dali::Actor::GetCurrentWorldPosition()
447    */
448   const Vector3& GetCurrentWorldPosition() const;
449
450   /**
451    * @copydoc Dali::Actor::SetPositionInheritanceMode()
452    */
453   void SetPositionInheritanceMode( PositionInheritanceMode mode );
454
455   /**
456    * @copydoc Dali::Actor::GetPositionInheritanceMode()
457    */
458   PositionInheritanceMode GetPositionInheritanceMode() const;
459
460   /**
461    * Sets the rotation of the Actor.
462    * @param [in] angleRadians The new rotation angle in radians.
463    * @param [in] axis The new axis of rotation.
464    */
465   void SetRotation(const Radian& angleRadians, const Vector3& axis);
466
467   /**
468    * Sets the rotation of the Actor.
469    * @param [in] rotation The new rotation.
470    */
471   void SetRotation(const Quaternion& rotation);
472
473   /**
474    * Rotate an actor around its existing rotation axis.
475    * @param[in] angleRadians The angle to the rotation to combine with the existing rotation.
476    * @param[in] axis The axis of the rotation to combine with the existing rotation.
477    */
478   void RotateBy(const Radian& angleRadians, const Vector3& axis);
479
480   /**
481    * Apply a relative rotation to an actor.
482    * @param[in] relativeRotation The rotation to combine with the actors existing rotation.
483    */
484   void RotateBy(const Quaternion& relativeRotation);
485
486   /**
487    * Retreive the Actor's rotation.
488    * @return the rotation.
489    */
490   const Quaternion& GetCurrentRotation() const;
491
492   /**
493    * Set whether a child actor inherits it's parent's orientation. Default is to inherit.
494    * Switching this off means that using SetRotation() sets the actor's world orientation.
495    * @param[in] inherit - true if the actor should inherit orientation, false otherwise.
496    */
497   void SetInheritRotation(bool inherit);
498
499   /**
500    * Returns whether the actor inherit's it's parent's orientation.
501    * @return true if the actor inherit's it's parent orientation, false if it uses world orientation.
502    */
503   bool IsRotationInherited() const;
504
505   /**
506    * @brief Defines how a child actors size is affected by its parents size.
507    * @param[in] mode The size relative to parent mode to use.
508    */
509   void SetSizeMode(SizeMode mode);
510
511   /**
512    * Query how the child actors size is affected by its parents size.
513    * @return The size relative to parent mode in use.
514    */
515   SizeMode GetSizeMode() const;
516
517   /**
518    * Sets the factor of the parents size used for the child actor.
519    * Note: Only used if SizeMode is SIZE_RELATIVE_TO_PARENT or SIZE_FIXED_OFFSET_FROM_PARENT.
520    * @param[in] factor The vector to multiply the parents size by to get the childs size.
521    */
522   void SetSizeModeFactor(const Vector3& factor);
523
524   /**
525    * Gets the factor of the parents size used for the child actor.
526    * Note: Only used if SizeMode is SIZE_RELATIVE_TO_PARENT or SIZE_FIXED_OFFSET_FROM_PARENT.
527    * @return The vector being used to multiply the parents size by to get the childs size.
528    */
529   const Vector3& GetSizeModeFactor() const;
530
531   /**
532    * @copydoc Dali::Actor::GetCurrentWorldRotation()
533    */
534   const Quaternion& GetCurrentWorldRotation() const;
535
536   /**
537    * Sets a scale factor applied to an actor.
538    * @param [in] scale The scale factor applied on all axes.
539    */
540   void SetScale(float scale);
541
542   /**
543    * Sets a scale factor applied to an actor.
544    * @param [in] scaleX The scale factor applied along the x-axis.
545    * @param [in] scaleY The scale factor applied along the y-axis.
546    * @param [in] scaleZ The scale factor applied along the z-axis.
547    */
548   void SetScale(float scaleX, float scaleY, float scaleZ);
549
550   /**
551    * Sets a scale factor applied to an actor.
552    * @param [in] scale A vector representing the scale factor for each axis.
553    */
554   void SetScale(const Vector3& scale);
555
556   /**
557    * Set the x component of the scale factor.
558    * @param [in] x The new x value.
559    */
560   void SetScaleX( float x );
561
562   /**
563    * Set the y component of the scale factor.
564    * @param [in] y The new y value.
565    */
566   void SetScaleY( float y );
567
568   /**
569    * Set the z component of the scale factor.
570    * @param [in] z The new z value.
571    */
572   void SetScaleZ( float z );
573
574   /**
575    * Apply a relative scale to an actor.
576    * @param[in] relativeScale The scale to combine with the actors existing scale.
577    */
578   void ScaleBy(const Vector3& relativeScale);
579
580   /**
581    * Retrieve the scale factor applied to an actor.
582    * @return A vector representing the scale factor for each axis.
583    */
584   const Vector3& GetCurrentScale() const;
585
586   /**
587    * @copydoc Dali::Actor::GetCurrentWorldScale()
588    */
589   const Vector3& GetCurrentWorldScale() const;
590
591   /**
592    * @copydoc Dali::Actor::SetInheritScale()
593    */
594   void SetInheritScale( bool inherit );
595
596   /**
597    * @copydoc Dali::Actor::IsScaleInherited()
598    */
599   bool IsScaleInherited() const;
600
601   /**
602    * @copydoc Dali::Actor::GetCurrentWorldMatrix()
603    */
604   Matrix GetCurrentWorldMatrix() const;
605
606   // Visibility
607
608   /**
609    * Sets the visibility flag of an actor.
610    * @param [in] visible The new visibility flag.
611    */
612   void SetVisible(bool visible);
613
614   /**
615    * Retrieve the visibility flag of an actor.
616    * @return The visibility flag.
617    */
618   bool IsVisible() const;
619
620   /**
621    * Sets the opacity of an actor.
622    * @param [in] opacity The new opacity.
623    */
624   void SetOpacity(float opacity);
625
626   /**
627    * Apply a relative opacity change to an actor.
628    * @param[in] relativeOpacity The opacity to combine with the actors existing opacity.
629    */
630   void OpacityBy(float relativeOpacity);
631
632   /**
633    * Retrieve the actor's opacity.
634    * @return The actor's opacity.
635    */
636   float GetCurrentOpacity() const;
637
638   /**
639    * Sets whether an actor should emit touch or hover signals; see SignalTouch() and SignalHover().
640    * An actor is sensitive by default, which means that as soon as an application connects to the SignalTouch(),
641    * the touch event signal will be emitted, and as soon as an application connects to the SignalHover(), the
642    * hover event signal will be emitted.
643    *
644    * If the application wishes to temporarily disable the touch or hover event signal emission, then they can do so by calling:
645    * @code
646    * actor.SetSensitive(false);
647    * @endcode
648    *
649    * Then, to re-enable the touch or hover event signal emission, the application should call:
650    * @code
651    * actor.SetSensitive(true);
652    * @endcode
653    *
654    * @see SignalTouch() and SignalHover().
655    * @note If an actor's sensitivity is set to false, then it's children will not emit a touch or hover event signal either.
656    * @param[in]  sensitive  true to enable emission of the touch or hover event signals, false otherwise.
657    */
658   void SetSensitive(bool sensitive)
659   {
660     mSensitive = sensitive;
661   }
662
663   /**
664    * Query whether an actor emits touch or hover event signals.
665    * @see SetSensitive(bool)
666    * @return true, if emission of touch or hover event signals is enabled, false otherwise.
667    */
668   bool IsSensitive() const
669   {
670     return mSensitive;
671   }
672
673   /**
674    * @copydoc Dali::Actor::SetDrawMode
675    */
676   void SetDrawMode( DrawMode::Type drawMode );
677
678   /**
679    * @copydoc Dali::Actor::GetDrawMode
680    */
681   DrawMode::Type GetDrawMode() const;
682
683   /**
684    * @copydoc Dali::Actor::SetOverlay
685    */
686   void SetOverlay(bool enable);
687
688   /**
689    * @copydoc Dali::Actor::IsOverlay
690    */
691   bool IsOverlay() const;
692
693   /**
694    * Sets the actor's color.  The final color of actor depends on its color mode.
695    * This final color is applied to the drawable elements of an actor.
696    * @param [in] color The new color.
697    */
698   void SetColor(const Vector4& color);
699
700   /**
701    * Set the red component of the color.
702    * @param [in] red The new red component.
703    */
704   void SetColorRed( float red );
705
706   /**
707    * Set the green component of the color.
708    * @param [in] green The new green component.
709    */
710   void SetColorGreen( float green );
711
712   /**
713    * Set the blue component of the scale factor.
714    * @param [in] blue The new blue value.
715    */
716   void SetColorBlue( float blue );
717
718   /**
719    * Apply a relative color change to an actor.
720    * @param[in] relativeColor The color to combine with the actors existing color.
721    */
722   void ColorBy(const Vector4& relativeColor);
723
724   /**
725    * Retrieve the actor's color.
726    * @return The color.
727    */
728   const Vector4& GetCurrentColor() const;
729
730   /**
731    * Sets the actor's color mode.
732    * Color mode specifies whether Actor uses its own color or inherits its parent color
733    * @param [in] colorMode to use.
734    */
735   void SetColorMode(ColorMode colorMode);
736
737   /**
738    * Returns the actor's color mode.
739    * @return currently used colorMode.
740    */
741   ColorMode GetColorMode() const;
742
743   /**
744    * @copydoc Dali::Actor::GetCurrentWorldColor()
745    */
746   const Vector4& GetCurrentWorldColor() const;
747
748   /**
749    * @copydoc Dali::Actor::AddRenderer()
750    */
751   unsigned int AddRenderer( Renderer& renderer );
752
753   /**
754    * @copydoc Dali::Actor::GetRendererCount()
755    */
756   unsigned int GetRendererCount() const;
757
758   /**
759    * @copydoc Dali::Actor::GetRendererAt()
760    */
761   Renderer& GetRendererAt( unsigned int index );
762
763   /**
764    * @copydoc Dali::Actor::RemoveRenderer()
765    */
766   void RemoveRenderer( Renderer& renderer );
767
768   /**
769    * @copydoc Dali::Actor::RemoveRenderer()
770    */
771   void RemoveRenderer( unsigned int index );
772
773 #ifdef DYNAMICS_SUPPORT
774
775   // Dynamics
776
777   /// @copydoc Dali::Actor::DisableDynamics
778   void DisableDynamics();
779
780   /// @copydoc Dali::Actor::EnableDynamics(Dali::DynamicsBodyConfig)
781   DynamicsBodyPtr  EnableDynamics(DynamicsBodyConfigPtr bodyConfig);
782
783   /// @copydoc Dali::Actor::GetDynamicsBody
784   DynamicsBodyPtr GetDynamicsBody() const;
785
786   /// @copydoc Dali::Actor::AddDynamicsJoint(Dali::Actor,const Vector3&)
787   DynamicsJointPtr AddDynamicsJoint( ActorPtr attachedActor, const Vector3& offset );
788
789   /// @copydoc Dali::Actor::AddDynamicsJoint(Dali::Actor,const Vector3&,const Vector3&)
790   DynamicsJointPtr AddDynamicsJoint( ActorPtr attachedActor, const Vector3& offsetA, const Vector3& offsetB );
791
792   /// @copydoc Dali::Actor::GetNumberOfJoints
793   const int GetNumberOfJoints() const;
794
795   /// @copydoc Dali::Actor::GetDynamicsJointByIndex
796   DynamicsJointPtr GetDynamicsJointByIndex( const int index ) const;
797
798   /// @copydoc Dali::Actor::GetDynamicsJoint
799   DynamicsJointPtr GetDynamicsJoint( ActorPtr attachedActor ) const;
800
801   /// @copydoc Dali::Actor::RemoveDynamicsJoint
802   void RemoveDynamicsJoint( DynamicsJointPtr joint );
803
804   /**
805    * Hold a reference to a DynamicsJoint
806    * @param[in] joint The joint
807    */
808   void ReferenceJoint( DynamicsJointPtr joint );
809
810   /**
811    * Release a reference to a DynamicsJoint
812    * @param[in] joint The joint
813    */
814   void ReleaseJoint( DynamicsJointPtr joint );
815
816   /**
817    * Set this actor to be the root actor in the dynamics simulation
818    * All children of the actor are added/removed from the simulation.
819    * @param[in] flag  When true sets this actor to be the simulation world root actor and
820    *                  if OnStage() all dynamics enabled child actors are added to the simulation,
821    *                  when false stops this actor being the simulation root and if OnStage() all
822    *                  dynamics enabled child actors are removed from the simulation.
823    */
824   void SetDynamicsRoot(bool flag);
825
826 private:
827   /**
828    * Check if this actor is the root actor in the dynamics simulation
829    * @return true if this is the dynamics root actor.
830    */
831   bool IsDynamicsRoot() const;
832
833   /**
834    * Add actor to the dynamics simulation
835    * Invoked when the actor is staged, or it's parent becomes the simulation root
836    */
837   void ConnectDynamics();
838
839   /**
840    * Remove actor from the dynamics simulation
841    * Invoked when the actor is unstaged, or it's parent stops being the the simulation root
842    */
843   void DisconnectDynamics();
844
845   /**
846    * An actor in a DynamicsJoint relationship has been staged
847    * @param[in] actor The actor passed into AddDynamicsJoint()
848    */
849   void AttachedActorOnStage( Dali::Actor actor );
850
851   /**
852    * An actor in a DynamicsJoint relationship has been unstaged
853    * @param[in] actor The actor passed into AddDynamicsJoint()
854    */
855   void AttachedActorOffStage( Dali::Actor actor );
856
857 #endif // DYNAMICS_SUPPORT
858
859 public:
860   /**
861    * Converts screen coordinates into the actor's coordinate system.
862    * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
863    * @param[out] localX On return, the X-coordinate relative to the actor.
864    * @param[out] localY On return, the Y-coordinate relative to the actor.
865    * @param[in] screenX The screen X-coordinate.
866    * @param[in] screenY The screen Y-coordinate.
867    * @return True if the conversion succeeded.
868    */
869   bool ScreenToLocal(float& localX, float& localY, float screenX, float screenY) const;
870
871   /**
872    * Converts screen coordinates into the actor's coordinate system.
873    * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
874    * @param[in] renderTask The render-task used to display the actor.
875    * @param[out] localX On return, the X-coordinate relative to the actor.
876    * @param[out] localY On return, the Y-coordinate relative to the actor.
877    * @param[in] screenX The screen X-coordinate.
878    * @param[in] screenY The screen Y-coordinate.
879    * @return True if the conversion succeeded.
880    */
881   bool ScreenToLocal(RenderTask& renderTask, float& localX, float& localY, float screenX, float screenY) const;
882
883   /**
884    * Converts from the actor's coordinate system to screen coordinates.
885    * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
886    * @param[in] viewMatrix The view-matrix
887    * @param[in] projectionMatrix The projection-matrix
888    * @param[in] viewport The view-port
889    * @param[out] localX On return, the X-coordinate relative to the actor.
890    * @param[out] localY On return, the Y-coordinate relative to the actor.
891    * @param[in] screenX The screen X-coordinate.
892    * @param[in] screenY The screen Y-coordinate.
893    * @return True if the conversion succeeded.
894    */
895   bool ScreenToLocal( const Matrix& viewMatrix,
896                       const Matrix& projectionMatrix,
897                       const Viewport& viewport,
898                       float& localX,
899                       float& localY,
900                       float screenX,
901                       float screenY ) const;
902
903   /**
904    * Performs a ray-sphere test with the given pick-ray and the actor's bounding sphere.
905    * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
906    * @param[in] rayOrigin The ray origin in the world's reference system.
907    * @param[in] rayDir The ray director vector in the world's reference system.
908    * @return True if the ray intersects the actor's bounding sphere.
909    */
910   bool RaySphereTest( const Vector4& rayOrigin, const Vector4& rayDir ) const;
911
912   /**
913    * Performs a ray-actor test with the given pick-ray and the actor's geometry.
914    * @note The actor coordinates are relative to the top-left (0.0, 0.0, 0.5)
915    * @param[in] rayOrigin The ray origin in the world's reference system.
916    * @param[in] rayDir The ray director vector in the world's reference system.
917    * @param[out] hitPointLocal The hit point in the Actor's local reference system.
918    * @param[out] distance The distance from the hit point to the camera.
919    * @return True if the ray intersects the actor's geometry.
920    */
921   bool RayActorTest( const Vector4& rayOrigin, const Vector4& rayDir, Vector4& hitPointLocal, float& distance ) const;
922
923   /**
924    * Sets whether the actor should receive a notification when touch or hover motion events leave
925    * the boundary of the actor.
926    *
927    * @note By default, this is set to false as most actors do not require this.
928    * @note Need to connect to the SignalTouch or SignalHover to actually receive this event.
929    *
930    * @param[in]  required  Should be set to true if a Leave event is required
931    */
932   void SetLeaveRequired(bool required);
933
934   /**
935    * This returns whether the actor requires touch or hover events whenever touch or hover motion events leave
936    * the boundary of the actor.
937    * @return true if a Leave event is required, false otherwise.
938    */
939   bool GetLeaveRequired() const;
940
941   /**
942    * @copydoc Dali::Actor::SetKeyboardFocusable()
943    */
944   void SetKeyboardFocusable( bool focusable );
945
946   /**
947    * @copydoc Dali::Actor::IsKeyboardFocusable()
948    */
949   bool IsKeyboardFocusable() const;
950
951   /**
952    * Query whether the application or derived actor type requires touch events.
953    * @return True if touch events are required.
954    */
955   bool GetTouchRequired() const;
956
957   /**
958    * Query whether the application or derived actor type requires hover events.
959    * @return True if hover events are required.
960    */
961   bool GetHoverRequired() const;
962
963   /**
964    * Query whether the application or derived actor type requires mouse wheel events.
965    * @return True if mouse wheel events are required.
966    */
967   bool GetMouseWheelEventRequired() const;
968
969   /**
970    * Query whether the actor is actually hittable.  This method checks whether the actor is
971    * sensitive, has the visibility flag set to true and is not fully transparent.
972    * @return true, if it can be hit, false otherwise.
973    */
974   bool IsHittable() const;
975
976   // Gestures
977
978   /**
979    * Retrieve the gesture data associated with this actor. The first call to this method will
980    * allocate space for the ActorGestureData so this should only be called if an actor really does
981    * require gestures.
982    * @return Reference to the ActorGestureData for this actor.
983    * @note Once the gesture-data is created for an actor it is likely that gestures are required
984    * throughout the actor's lifetime so it will only be deleted when the actor is destroyed.
985    */
986   ActorGestureData& GetGestureData();
987
988   /**
989    * Queries whether the actor requires the gesture type.
990    * @param[in] type The gesture type.
991    */
992   bool IsGestureRequred( Gesture::Type type ) const;
993
994   // Signals
995
996   /**
997    * Used by the EventProcessor to emit touch event signals.
998    * @param[in] event The touch event.
999    * @return True if the event was consumed.
1000    */
1001   bool EmitTouchEventSignal(const TouchEvent& event);
1002
1003   /**
1004    * Used by the EventProcessor to emit hover event signals.
1005    * @param[in] event The hover event.
1006    * @return True if the event was consumed.
1007    */
1008   bool EmitHoverEventSignal(const HoverEvent& event);
1009
1010   /**
1011    * Used by the EventProcessor to emit mouse wheel event signals.
1012    * @param[in] event The mouse wheel event.
1013    * @return True if the event was consumed.
1014    */
1015   bool EmitMouseWheelEventSignal(const MouseWheelEvent& event);
1016
1017   /**
1018    * @copydoc Dali::Actor::TouchedSignal()
1019    */
1020   Dali::Actor::TouchSignalType& TouchedSignal();
1021
1022   /**
1023    * @copydoc Dali::Actor::HoveredSignal()
1024    */
1025   Dali::Actor::HoverSignalType& HoveredSignal();
1026
1027   /**
1028    * @copydoc Dali::Actor::MouseWheelEventSignal()
1029    */
1030   Dali::Actor::MouseWheelEventSignalType& MouseWheelEventSignal();
1031
1032   /**
1033    * @copydoc Dali::Actor::OnStageSignal()
1034    */
1035   Dali::Actor::OnStageSignalType& OnStageSignal();
1036
1037   /**
1038    * @copydoc Dali::Actor::OffStageSignal()
1039    */
1040   Dali::Actor::OffStageSignalType& OffStageSignal();
1041
1042   /**
1043    * Connects a callback function with the object's signals.
1044    * @param[in] object The object providing the signal.
1045    * @param[in] tracker Used to disconnect the signal.
1046    * @param[in] signalName The signal to connect to.
1047    * @param[in] functor A newly allocated FunctorDelegate.
1048    * @return True if the signal was connected.
1049    * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
1050    */
1051   static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
1052
1053   /**
1054    * Performs actions as requested using the action name.
1055    * @param[in] object The object on which to perform the action.
1056    * @param[in] actionName The action to perform.
1057    * @param[in] attributes The attributes with which to perfrom this action.
1058    * @return true if the action was done.
1059    */
1060   static bool DoAction(BaseObject* object, const std::string& actionName, const std::vector<Property::Value>& attributes);
1061
1062 public:  // For Animation
1063
1064   /**
1065    * This should only be called by Animation, when the actor is resized using Animation::Resize().
1066    *
1067    * @param[in] animation The animation that resized the actor
1068    * @param[in] targetSize The new target size of the actor
1069    */
1070   void NotifySizeAnimation( Animation& animation, const Vector3& targetSize);
1071
1072   /**
1073    * For use in derived classes.
1074    * This should only be called by Animation, when the actor is resized using Animation::Resize().
1075    */
1076   virtual void OnSizeAnimation( Animation& animation, const Vector3& targetSize) {}
1077
1078 protected:
1079
1080   enum DerivedType
1081   {
1082     BASIC,
1083     RENDERABLE,
1084     LAYER,
1085     ROOT_LAYER
1086   };
1087
1088   /**
1089    * Protected Constructor.  See Actor::New().
1090    * The second-phase construction Initialize() member should be called immediately after this.
1091    * @param[in] derivedType The derived type of actor (if any).
1092    */
1093   Actor( DerivedType derivedType );
1094
1095   /**
1096    * Second-phase constructor. Must be called immediately after creating a new Actor;
1097    */
1098   void Initialize(void);
1099
1100   /**
1101    * A reference counted object may only be deleted by calling Unreference()
1102    */
1103   virtual ~Actor();
1104
1105   /**
1106    * Called on a child during Add() when the parent actor is connected to the Stage.
1107    * @param[in] stage The stage.
1108    * @param[in] index If set, it is only used for positioning the actor within the parent's child list.
1109    */
1110   void ConnectToStage( int index = -1 );
1111
1112   /**
1113    * Helper for ConnectToStage, to recursively connect a tree of actors.
1114    * This is atomic i.e. not interrupted by user callbacks.
1115    * @param[in] index If set, it is only used for positioning the actor within the parent's child list.
1116    * @param[out] connectionList On return, the list of connected actors which require notification.
1117    */
1118   void RecursiveConnectToStage( ActorContainer& connectionList, int index = -1 );
1119
1120   /**
1121    * Connect the Node associated with this Actor to the scene-graph.
1122    * @param[in] index If set, it is only used for positioning the actor within the parent's child list.
1123    */
1124   void ConnectToSceneGraph(int index = -1);
1125
1126   /**
1127    * Helper for ConnectToStage, to notify a connected actor through the public API.
1128    */
1129   void NotifyStageConnection();
1130
1131   /**
1132    * Called on a child during Remove() when the actor was previously on the Stage.
1133    */
1134   void DisconnectFromStage();
1135
1136   /**
1137    * Helper for DisconnectFromStage, to recursively disconnect a tree of actors.
1138    * This is atomic i.e. not interrupted by user callbacks.
1139    * @param[out] disconnectionList On return, the list of disconnected actors which require notification.
1140    */
1141   void RecursiveDisconnectFromStage( ActorContainer& disconnectionList );
1142
1143   /**
1144    * Disconnect the Node associated with this Actor from the scene-graph.
1145    */
1146   void DisconnectFromSceneGraph();
1147
1148   /**
1149    * Helper for DisconnectFromStage, to notify a disconnected actor through the public API.
1150    */
1151   void NotifyStageDisconnection();
1152
1153   /**
1154    * When the Actor is OnStage, checks whether the corresponding Node is connected to the scene graph.
1155    * @return True if the Actor is OnStage & has a Node connected to the scene graph.
1156    */
1157   bool IsNodeConnected() const;
1158
1159   /**
1160    * Calculate the size of the z dimension for a 2D size
1161    *
1162    * @param[in] size The 2D size (X, Y) to calculate Z from
1163    *
1164    * @return Return the Z dimension for this size
1165    */
1166   float CalculateSizeZ( const Vector2& size ) const;
1167
1168 public: // Default property extensions from Object
1169
1170   /**
1171    * @copydoc Dali::Internal::Object::GetDefaultPropertyCount()
1172    */
1173   virtual unsigned int GetDefaultPropertyCount() const;
1174
1175   /**
1176    * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices()
1177    */
1178   virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
1179
1180   /**
1181    * @copydoc Dali::Internal::Object::GetDefaultPropertyName()
1182    */
1183   virtual const char* GetDefaultPropertyName(Property::Index index) const;
1184
1185   /**
1186    * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex()
1187    */
1188   virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const;
1189
1190   /**
1191    * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable()
1192    */
1193   virtual bool IsDefaultPropertyWritable(Property::Index index) const;
1194
1195   /**
1196    * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable()
1197    */
1198   virtual bool IsDefaultPropertyAnimatable(Property::Index index) const;
1199
1200   /**
1201    * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput()
1202    */
1203   virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
1204
1205   /**
1206    * @copydoc Dali::Internal::Object::GetDefaultPropertyType()
1207    */
1208   virtual Property::Type GetDefaultPropertyType(Property::Index index) const;
1209
1210   /**
1211    * @copydoc Dali::Internal::Object::SetDefaultProperty()
1212    */
1213   virtual void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue);
1214
1215   /**
1216    * @copydoc Dali::Internal::Object::SetSceneGraphProperty()
1217    */
1218   virtual void SetSceneGraphProperty( Property::Index index, const CustomProperty& entry, const Property::Value& value );
1219
1220   /**
1221    * @copydoc Dali::Internal::Object::GetDefaultProperty()
1222    */
1223   virtual Property::Value GetDefaultProperty( Property::Index index ) const;
1224
1225   /**
1226    * @copydoc Dali::Internal::Object::GetPropertyOwner()
1227    */
1228   virtual const SceneGraph::PropertyOwner* GetPropertyOwner() const;
1229
1230   /**
1231    * @copydoc Dali::Internal::Object::GetSceneObject()
1232    */
1233   virtual const SceneGraph::PropertyOwner* GetSceneObject() const;
1234
1235   /**
1236    * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
1237    */
1238   virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const;
1239
1240   /**
1241    * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty()
1242    */
1243   virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const;
1244
1245   /**
1246    * @copydoc Dali::Internal::Object::GetPropertyComponentIndex()
1247    */
1248   virtual int GetPropertyComponentIndex( Property::Index index ) const;
1249
1250 private:
1251
1252   // Undefined
1253   Actor();
1254
1255   // Undefined
1256   Actor(const Actor&);
1257
1258   // Undefined
1259   Actor& operator=(const Actor& rhs);
1260
1261   /**
1262    * Set the actors parent.
1263    * @param[in] parent The new parent.
1264    * @param[in] index If set, it is only used for positioning the actor within the parent's child list.
1265    */
1266   void SetParent(Actor* parent, int index = -1);
1267
1268   /**
1269    * Helper to create a Node for this Actor.
1270    * To be overriden in derived classes.
1271    * @return A newly allocated node.
1272    */
1273   virtual SceneGraph::Node* CreateNode() const;
1274
1275   /**
1276    * For use in derived classes, called after Initialize()
1277    */
1278   virtual void OnInitialize() {}
1279
1280   /**
1281    * For use in internal derived classes.
1282    * This is called during ConnectToStage(), after the actor has finished adding its node to the scene-graph.
1283    * The derived class must not modify the actor hierachy (Add/Remove children) during this callback.
1284    */
1285   virtual void OnStageConnectionInternal() {}
1286
1287   /**
1288    * For use in internal derived classes.
1289    * This is called during DisconnectFromStage(), before the actor removes its node from the scene-graph.
1290    * The derived class must not modify the actor hierachy (Add/Remove children) during this callback.
1291    */
1292   virtual void OnStageDisconnectionInternal() {}
1293
1294   /**
1295    * For use in external (CustomActor) derived classes.
1296    * This is called after the atomic ConnectToStage() traversal has been completed.
1297    */
1298   virtual void OnStageConnectionExternal() {}
1299
1300   /**
1301    * For use in external (CustomActor) derived classes.
1302    * This is called after the atomic DisconnectFromStage() traversal has been completed.
1303    */
1304   virtual void OnStageDisconnectionExternal() {}
1305
1306   /**
1307    * For use in derived classes; this is called after Add() has added a child.
1308    * @param[in] child The child that was added.
1309    */
1310   virtual void OnChildAdd( Actor& child ) {}
1311
1312   /**
1313    * For use in derived classes; this is called after Remove() has removed a child.
1314    * @param[in] child The child that was removed.
1315    */
1316   virtual void OnChildRemove( Actor& child ) {}
1317
1318   /**
1319    * For use in derived classes.
1320    * This is called after SizeSet() has been called.
1321    */
1322   virtual void OnSizeSet(const Vector3& targetSize) {}
1323
1324   /**
1325    * For use in derived classes.
1326    * This is only called if mDerivedRequiresTouch is true, and the touch-signal was not consumed.
1327    * @param[in] event The touch event.
1328    * @return True if the event should be consumed.
1329    */
1330   virtual bool OnTouchEvent(const TouchEvent& event) { return false; }
1331
1332   /**
1333    * For use in derived classes.
1334    * This is only called if mDerivedRequiresHover is true, and the hover-signal was not consumed.
1335    * @param[in] event The hover event.
1336    * @return True if the event should be consumed.
1337    */
1338   virtual bool OnHoverEvent(const HoverEvent& event) { return false; }
1339
1340   /**
1341    * For use in derived classes.
1342    * This is only called if the mouse wheel signal was not consumed.
1343    * @param[in] event The mouse event.
1344    * @return True if the event should be consumed.
1345    */
1346   virtual bool OnMouseWheelEvent(const MouseWheelEvent& event) { return false; }
1347
1348   /**
1349    * For use in derived class
1350    * If an alias for a child exists, return the child otherwise return an empty handle.
1351    * For example 'previous' could return the last selected child.
1352    * @pre The Actor has been initialized.
1353    * @param[in] actorAlias the name of the actor to find
1354    * @return A handle to the actor if found, or an empty handle if not.
1355    */
1356   virtual Dali::Actor GetChildByAlias(const std::string& actorAlias) { return Dali::Actor(); }
1357
1358   /**
1359    * Support function for FindChildByAlias
1360    * @pre The Actor has been initialized.
1361    * @param[in] actorAlias the name of the aliased actor to find
1362    * @return A handle to the actor if found, or an empty handle if not.
1363    */
1364   Dali::Actor DoGetChildByAlias(const std::string& actorAlias);
1365
1366 protected:
1367
1368   StagePtr                mStage;        ///< Used to send messages to Node; valid until Core destruction
1369   Actor*                  mParent;       ///< Each actor (except the root) can have one parent
1370   ActorContainer*         mChildren;     ///< Container of referenced actors
1371   const SceneGraph::Node* mNode;         ///< Not owned
1372   Vector3*                mParentOrigin; ///< NULL means ParentOrigin::DEFAULT. ParentOrigin is non-animatable
1373   Vector3*                mAnchorPoint;  ///< NULL means AnchorPoint::DEFAULT. AnchorPoint is non-animatable
1374
1375 #ifdef DYNAMICS_SUPPORT
1376   DynamicsData*           mDynamicsData; ///< optional physics data
1377 #endif
1378
1379   ActorGestureData*       mGestureData;  ///< Optional Gesture data. Only created when actor requires gestures
1380
1381   ActorAttachmentPtr      mAttachment;   ///< Optional referenced attachment
1382
1383   // Signals
1384   Dali::Actor::TouchSignalType             mTouchedSignal;
1385   Dali::Actor::HoverSignalType             mHoveredSignal;
1386   Dali::Actor::MouseWheelEventSignalType   mMouseWheelEventSignal;
1387   Dali::Actor::OnStageSignalType           mOnStageSignal;
1388   Dali::Actor::OffStageSignalType          mOffStageSignal;
1389
1390   Vector3         mSize;      ///< Event-side storage for size (not a pointer as most actors will have a size)
1391   Vector3         mSizeModeFactor; ///< Factor of parent size used for certain SizeModes.
1392
1393   std::string     mName;      ///< Name of the actor
1394   unsigned int    mId;        ///< A unique ID to identify the actor starting from 1, and 0 is reserved
1395
1396   const bool mIsRoot                               : 1; ///< Flag to identify the root actor
1397   const bool mIsRenderable                         : 1; ///< Flag to identify that this is a renderable actor
1398   const bool mIsLayer                              : 1; ///< Flag to identify that this is a layer
1399   bool mIsOnStage                                  : 1; ///< Flag to identify whether the actor is on-stage
1400   bool mIsDynamicsRoot                             : 1; ///< Flag to identify if this is the dynamics world root
1401   bool mSensitive                                  : 1; ///< Whether the actor emits touch event signals
1402   bool mLeaveRequired                              : 1; ///< Whether a touch event signal is emitted when the a touch leaves the actor's bounds
1403   bool mKeyboardFocusable                          : 1; ///< Whether the actor should be focusable by keyboard navigation
1404   bool mDerivedRequiresTouch                       : 1; ///< Whether the derived actor type requires touch event signals
1405   bool mDerivedRequiresHover                       : 1; ///< Whether the derived actor type requires hover event signals
1406   bool mDerivedRequiresMouseWheelEvent             : 1; ///< Whether the derived actor type requires mouse wheel event signals
1407   bool mOnStageSignalled                           : 1; ///< Set to true before OnStageConnection signal is emitted, and false before OnStageDisconnection
1408   bool mInheritRotation                            : 1; ///< Cached: Whether the parent's rotation should be inherited.
1409   bool mInheritScale                               : 1; ///< Cached: Whether the parent's scale should be inherited.
1410   DrawMode::Type mDrawMode                         : 2; ///< Cached: How the actor and its children should be drawn
1411   PositionInheritanceMode mPositionInheritanceMode : 2; ///< Cached: Determines how position is inherited
1412   ColorMode mColorMode                             : 2; ///< Cached: Determines whether mWorldColor is inherited
1413   SizeMode mSizeMode                               : 2; ///< Cached: Determines how the actors parent affects the actors size.
1414
1415 private:
1416
1417   static ActorContainer mNullChildren; ///< Empty container (shared by all actors, returned by GetChildren() const)
1418   static unsigned int   mActorCounter; ///< A counter to track the actor instance creation
1419
1420 };
1421
1422 } // namespace Internal
1423
1424 // Helpers for public-api forwarding methods
1425
1426 inline Internal::Actor& GetImplementation(Dali::Actor& actor)
1427 {
1428   DALI_ASSERT_ALWAYS(actor && "Actor handle is empty");
1429
1430   BaseObject& handle = actor.GetBaseObject();
1431
1432   return static_cast<Internal::Actor&>(handle);
1433 }
1434
1435 inline const Internal::Actor& GetImplementation(const Dali::Actor& actor)
1436 {
1437   DALI_ASSERT_ALWAYS(actor && "Actor handle is empty");
1438
1439   const BaseObject& handle = actor.GetBaseObject();
1440
1441   return static_cast<const Internal::Actor&>(handle);
1442 }
1443
1444 } // namespace Dali
1445
1446 #endif // __DALI_INTERNAL_ACTOR_H__