X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Factors%2Flayer.cpp;h=2f19079147990bdd16e7cbf04d8425f71062b521;hb=0b501ba800a263b97d99adf224fc42d0c2aa8b37;hp=2904160c72f5c9540359d0727dd2be7b273f5ffc;hpb=f7892617701f1ae501fac0a58f8dfec0f5fabb37;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/public-api/actors/layer.cpp b/dali/public-api/actors/layer.cpp index 2904160..2f19079 100644 --- a/dali/public-api/actors/layer.cpp +++ b/dali/public-api/actors/layer.cpp @@ -1,40 +1,29 @@ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ // CLASS HEADER #include // INTERNAL INCLUDES #include -#include namespace Dali { - -using Dali::Layer; - -const char* const Layer::ACTION_RAISE = "raise"; -const char* const Layer::ACTION_LOWER = "lower"; -const char* const Layer::ACTION_RAISE_TO_TOP = "raise-to-top"; -const char* const Layer::ACTION_LOWER_TO_BOTTOM = "lower-to-bottom"; - - -Layer::Layer() -{ -} +Layer::Layer() = default; Layer Layer::New() { @@ -43,19 +32,20 @@ Layer Layer::New() return Layer(internal.Get()); } -Layer Layer::DownCast( BaseHandle handle ) +Layer Layer::DownCast(BaseHandle handle) { - return Layer( dynamic_cast(handle.GetObjectPtr()) ); + return Layer(dynamic_cast(handle.GetObjectPtr())); } -Layer::~Layer() -{ -} +Layer::~Layer() = default; -unsigned int Layer::GetDepth() const -{ - return GetImplementation(*this).GetDepth(); -} +Layer::Layer(const Layer& copy) = default; + +Layer& Layer::operator=(const Layer& rhs) = default; + +Layer::Layer(Layer&& rhs) noexcept = default; + +Layer& Layer::operator=(Layer&& rhs) noexcept = default; void Layer::Raise() { @@ -67,14 +57,14 @@ void Layer::Lower() GetImplementation(*this).Lower(); } -void Layer::RaiseAbove( Layer target ) +void Layer::RaiseAbove(Layer target) { - GetImplementation(*this).RaiseAbove( GetImplementation( target ) ); + GetImplementation(*this).RaiseAbove(GetImplementation(target)); } -void Layer::LowerBelow( Layer target ) +void Layer::LowerBelow(Layer target) { - GetImplementation(*this).LowerBelow( GetImplementation( target ) ); + GetImplementation(*this).LowerBelow(GetImplementation(target)); } void Layer::RaiseToTop() @@ -87,54 +77,14 @@ void Layer::LowerToBottom() GetImplementation(*this).LowerToBottom(); } -void Layer::MoveAbove( Layer target ) -{ - GetImplementation(*this).MoveAbove( GetImplementation( target ) ); -} - -void Layer::MoveBelow( Layer target ) -{ - GetImplementation(*this).MoveBelow( GetImplementation( target ) ); -} - -void Layer::SetClipping(bool enabled) +void Layer::MoveAbove(Layer target) { - GetImplementation(*this).SetClipping(enabled); + GetImplementation(*this).MoveAbove(GetImplementation(target)); } -bool Layer::IsClipping() const +void Layer::MoveBelow(Layer target) { - return GetImplementation(*this).IsClipping(); -} - -void Layer::SetClippingBox(int x, int y, int width, int height) -{ - GetImplementation(*this).SetClippingBox(x, y, width, height); -} - -void Layer::SetClippingBox(ClippingBox box) -{ - GetImplementation(*this).SetClippingBox(box.x, box.y, box.width, box.height); -} - -ClippingBox Layer::GetClippingBox() const -{ - return GetImplementation(*this).GetClippingBox(); -} - -void Layer::SetDepthTestDisabled( bool disable ) -{ - GetImplementation(*this).SetDepthTestDisabled( disable ); -} - -bool Layer::IsDepthTestDisabled() const -{ - return GetImplementation(*this).IsDepthTestDisabled(); -} - -float Layer::ZValue(const Vector3& position, float sortModifier) -{ - return -position.z + sortModifier; + GetImplementation(*this).MoveBelow(GetImplementation(target)); } void Layer::SetSortFunction(SortFunctionType function) @@ -148,4 +98,3 @@ Layer::Layer(Internal::Layer* internal) } } // namespace Dali -