[dali_2.3.44] Merge branch 'devel/master'
[platform/core/uifw/dali-core.git] / dali / devel-api / actors / actor-devel.cpp
1 /*
2  * Copyright (c) 2024 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<> CalculateScreenExtents(Actor actor)
33 {
34   return GetImplementation(actor).CalculateScreenExtents();
35 }
36
37 Rect<> CalculateCurrentScreenExtents(Actor actor)
38 {
39   return GetImplementation(actor).CalculateCurrentScreenExtents();
40 }
41
42 VisibilityChangedSignalType& VisibilityChangedSignal(Actor actor)
43 {
44   return GetImplementation(actor).VisibilityChangedSignal();
45 }
46
47 Actor GetVisiblityChangedActor()
48 {
49   return Dali::Actor(Internal::Actor::GetVisiblityChangedActor().Get());
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 Actor::WheelEventSignalType& InterceptWheelSignal(Actor actor)
73 {
74   return GetImplementation(actor).InterceptWheelSignal();
75 }
76
77 void SetNeedGesturePropagation(Actor actor, bool propagation)
78 {
79   return GetImplementation(actor).SetNeedGesturePropagation(propagation);
80 }
81
82 void SwitchParent(Actor actor, Actor newParent)
83 {
84   return GetImplementation(actor).SwitchParent(GetImplementation(newParent));
85 }
86
87 Actor::TouchEventSignalType& HitTestResultSignal(Actor actor)
88 {
89   return GetImplementation(actor).HitTestResultSignal();
90 }
91
92 Matrix GetWorldTransform(Actor actor)
93 {
94   return CalculateActorWorldTransform(GetImplementation(actor));
95 }
96
97 Vector4 GetWorldColor(Actor actor)
98 {
99   return CalculateActorWorldColor(GetImplementation(actor));
100 }
101
102 void LookAt(Actor actor, Vector3 target, Vector3 up, Vector3 localForward, Vector3 localUp)
103 {
104   auto orientation = CalculateActorLookAtOrientation(GetImplementation(actor), target, up, localForward, localUp);
105   GetImplementation(actor).SetOrientation(orientation);
106 }
107
108 bool IsHittable(Actor actor)
109 {
110   return GetImplementation(actor).IsHittable();
111 }
112
113 bool GetTouchRequired(Actor actor)
114 {
115   return GetImplementation(actor).GetTouchRequired();
116 }
117
118 } // namespace DevelActor
119
120 } // namespace Dali