Clean up the code to build successfully on macOS
[platform/core/uifw/dali-core.git] / dali / public-api / actors / custom-actor-impl.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/public-api/actors/custom-actor-impl.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/internal/event/actors/custom-actor-internal.h>
23 #include <dali/public-api/common/dali-common.h>
24
25 namespace Dali
26 {
27 CustomActor CustomActorImpl::Self() const
28 {
29   return CustomActor(mOwner);
30 }
31
32 void CustomActorImpl::OnPropertySet(Property::Index index, const Property::Value& propertyValue)
33 {
34 }
35
36 CustomActorImpl::CustomActorImpl(ActorFlags flags)
37 : mOwner(nullptr),
38   mFlags(flags)
39 {
40 }
41
42 CustomActorImpl::~CustomActorImpl()
43 {
44 }
45
46 void CustomActorImpl::Initialize(Internal::CustomActor& owner)
47 {
48   DALI_ASSERT_DEBUG(mOwner == NULL); // should not already be owned
49
50   mOwner = &owner;
51 }
52
53 Internal::CustomActor* CustomActorImpl::GetOwner() const
54 {
55   return mOwner;
56 }
57
58 bool CustomActorImpl::IsRelayoutEnabled() const
59 {
60   return (mFlags & DISABLE_SIZE_NEGOTIATION) == 0;
61 }
62
63 void CustomActorImpl::RelayoutRequest()
64 {
65   mOwner->RelayoutRequest();
66 }
67
68 float CustomActorImpl::GetHeightForWidthBase(float width)
69 {
70   return mOwner->GetHeightForWidthBase(width);
71 }
72
73 float CustomActorImpl::GetWidthForHeightBase(float height)
74 {
75   return mOwner->GetWidthForHeightBase(height);
76 }
77
78 float CustomActorImpl::CalculateChildSizeBase(const Dali::Actor& child, Dimension::Type dimension)
79 {
80   return mOwner->CalculateChildSizeBase(child, dimension);
81 }
82
83 bool CustomActorImpl::RelayoutDependentOnChildrenBase(Dimension::Type dimension)
84 {
85   return mOwner->RelayoutDependentOnChildrenBase(dimension);
86 }
87
88 } // namespace Dali