2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://floralicense.org/license/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUiAnim_RootVisualElement.cpp
20 * @brief This is the implementation file for the _RootVisualElement class.
22 * This file contains implementation _RootVisualElement class.
26 #include <FBaseSysLog.h>
27 #include "FUiAnim_DisplayManager.h"
28 #include "FUiAnim_RootVisualElement.h"
29 #include "FUiAnim_NativeLayer.h"
30 #include "FUiAnim_VisualElementImpl.h"
32 namespace Tizen { namespace Ui { namespace Animations
35 // Root Element implementation
36 _RootVisualElement::_RootVisualElement(void)
37 : __needsUpdateFromRoot(false)
41 _pVisualElementImpl->__isRoot = true;
42 _pVisualElementImpl->__isInternal = true;
43 _pVisualElementImpl->__isImplicitAnimationEnabled = false;
46 _RootVisualElement::_RootVisualElement(const _RootVisualElement& rhs)
48 , __needsUpdateFromRoot(false)
50 , __pLayer(rhs.__pLayer)
55 _RootVisualElement::~_RootVisualElement(void)
60 SysLogException(NID_UI_ANIM, E_INVALID_STATE,"[E_INVALID_STATE] The RootVisualElement instance has been destroyed, but the layer information was not cleaned.");
61 // __pLayer->_pRootVisualElement = NULL;
68 _RootVisualElement::CloneN(void) const
70 return new (std::nothrow) _RootVisualElement(*this);
74 _RootVisualElement::SetNativeLayer(_NativeLayer* pLayer)
76 if (__pLayer == pLayer)
81 SysTryReturnResult(NID_UI_ANIM, !__pLayer || (__pLayer && pLayer == null), E_INVALID_STATE, "The layer is already assigned to another RootVisualElement instance.");
84 _RootVisualElement* pPresentation = null;
85 if (_pVisualElementImpl && _pVisualElementImpl->__pPresentation)
87 pPresentation = dynamic_cast<_RootVisualElement*>(_pVisualElementImpl->__pPresentation->__pPublicInstance);
89 SysTryReturnResult(NID_UI_ANIM, pPresentation, E_INVALID_STATE, "The presentation instance is not available.");
91 pPresentation->__pLayer = pLayer;
96 }}} //namespace Tizen { namespace Ui { namespace Animations {