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_NativeLayer.cpp
20 * @brief This file contains implementation of _NativeLayer class
22 * This file contains implementation _NativeLayer class.
26 #include <FBaseSysLog.h>
28 #include "FUiAnim_RootVisualElement.h"
29 #include "FUiAnim_NativeLayer.h"
30 #include "FUiAnim_DisplayManager.h"
31 #include "FUiAnim_EflLayer.h"
33 namespace Tizen { namespace Ui { namespace Animations
36 _NativeLayer::_NativeLayer(void)
37 : _pRootVisualElement(null)
41 _NativeLayer::~_NativeLayer(void)
43 if(_pRootVisualElement)
45 _DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
48 pDisplayManager->UnregisterRoot(*_pRootVisualElement);
50 _pRootVisualElement->SetNativeLayer(null);
51 _pRootVisualElement->Destroy();
52 _pRootVisualElement = null;
57 _NativeLayer::CreateInstanceN(void)
60 _EflLayer* pLayer = new (std::nothrow) _EflLayer;
68 #else ////#elif defined(VE_OPENGL)
77 _NativeLayer::Construct(void)
79 SysAssertf(_pRootVisualElement == null, "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class.");
81 _pRootVisualElement = new _RootVisualElement();
82 result r = _pRootVisualElement->Construct();
83 SysTryReturnResult(NID_UI_ANIM, r == E_SUCCESS, r, "Propagating.");
84 _pRootVisualElement->SetShowState(true);
86 _DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
89 pDisplayManager->RegisterRoot(*_pRootVisualElement);
93 SysTryReturnResult(NID_UI_ANIM, r == E_SUCCESS, r, "Constructing failed.");
95 _pRootVisualElement->SetNativeLayer(this);
97 r = Configure(*_pRootVisualElement);
98 SysTryReturnResult(NID_UI_ANIM, r == E_SUCCESS, r, "Configuring failed.");
104 _NativeLayer::GetRootVisualElement(void) const
106 return _pRootVisualElement;