8e51ae92db63ff76456536906a711ad498b38edb
[platform/core/uifw/dali-core.git] / dali / devel-api / actors / actor-devel.cpp
1 /*
2  * Copyright (c) 2023 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 // INTERNAL INCLUDES
19 #include <dali/devel-api/actors/actor-devel.h>
20 #include <dali/internal/event/actors/actor-coords.h>
21 #include <dali/internal/event/actors/actor-impl.h>
22
23 namespace Dali
24 {
25 namespace DevelActor
26 {
27 Vector2 CalculateScreenPosition(Actor actor)
28 {
29   return GetImplementation(actor).CalculateScreenPosition();
30 }
31
32 Rect<> CalculateScreenExtentsAtEvent(Actor actor) ///< TODO : Change API name
33 {
34   return GetImplementation(actor).CalculateScreenExtents();
35 }
36
37 Rect<> CalculateScreenExtents(Actor actor) ///< TODO : Remove this API
38 {
39   return CalculateCurrentScreenExtents(actor);
40 }
41
42 Rect<> CalculateCurrentScreenExtents(Actor actor)
43 {
44   return GetImplementation(actor).CalculateCurrentScreenExtents();
45 }
46
47 VisibilityChangedSignalType& VisibilityChangedSignal(Actor actor)
48 {
49   return GetImplementation(actor).VisibilityChangedSignal();
50 }
51
52 ChildChangedSignalType& ChildAddedSignal(Actor actor)
53 {
54   return GetImplementation(actor).ChildAddedSignal();
55 }
56
57 ChildChangedSignalType& ChildRemovedSignal(Actor actor)
58 {
59   return GetImplementation(actor).ChildRemovedSignal();
60 }
61
62 ChildOrderChangedSignalType& ChildOrderChangedSignal(Actor actor)
63 {
64   return GetImplementation(actor).ChildOrderChangedSignal();
65 }
66
67 Actor::TouchEventSignalType& InterceptTouchedSignal(Actor actor)
68 {
69   return GetImplementation(actor).InterceptTouchedSignal();
70 }
71
72 void SetNeedGesturePropagation(Actor actor, bool propagation)
73 {
74   return GetImplementation(actor).SetNeedGesturePropagation(propagation);
75 }
76
77 void SwitchParent(Actor actor, Actor newParent)
78 {
79   return GetImplementation(actor).SwitchParent(GetImplementation(newParent));
80 }
81
82 Actor::TouchEventSignalType& HitTestResultSignal(Actor actor)
83 {
84   return GetImplementation(actor).HitTestResultSignal();
85 }
86
87 Matrix GetWorldTransform(Actor actor)
88 {
89   return CalculateActorWorldTransform(GetImplementation(actor));
90 }
91
92 Vector4 GetWorldColor(Actor actor)
93 {
94   return CalculateActorWorldColor(GetImplementation(actor));
95 }
96
97 void LookAt(Actor actor, Vector3 target, Vector3 up, Vector3 localForward, Vector3 localUp)
98 {
99   auto orientation = CalculateActorLookAtOrientation(GetImplementation(actor), target, up, localForward, localUp);
100   GetImplementation(actor).SetOrientation(orientation);
101 }
102
103 } // namespace DevelActor
104
105 } // namespace Dali