Changed indicator bg color.
[platform/framework/native/uifw.git] / src / ui / FUi_EcoreEvasMgr.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0/
10 //
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.
16 //
17
18 /**
19  * @file                FUi_EcoreEvasMgr.cpp
20  * @brief               This is the implementation file for the _EcoreEvasMgr class.
21  */
22
23 #include <new>
24 #include <FBaseErrors.h>
25 #include <FBaseSysLog.h>
26 #include "FUi_EcoreEvasMgr.h"
27 #include "FUi_EcoreEvas.h"
28
29 using namespace Tizen::Ui;
30
31 namespace
32 {
33 _EcoreEvasMgr* __pEcoreEvasMgr = null;
34 } // Anonymous
35
36 namespace Tizen { namespace Ui
37 {
38
39 _EcoreEvasMgr::_EcoreEvasMgr(void)
40         : __pEcoreEvas(null)
41 {
42 }
43
44 _EcoreEvasMgr::~_EcoreEvasMgr(void)
45 {
46 }
47
48 void
49 _EcoreEvasMgr::SetEcoreEvas(const _EcoreEvas& ecoreEvas)
50 {
51         __pEcoreEvas = &ecoreEvas;
52 }
53
54 _EcoreEvas*
55 _EcoreEvasMgr::GetEcoreEvas(void) const
56 {
57         return const_cast<_EcoreEvas*>(__pEcoreEvas);
58 }
59
60 void
61 _EcoreEvasMgr::BeginMainLoop(void)
62 {
63         ecore_main_loop_begin();
64 }
65
66 void
67 _EcoreEvasMgr::EndMainLoop(void)
68 {
69         ecore_main_loop_quit();
70 }
71
72 void
73 _EcoreEvasMgr::SetRenderBackend(int backend)
74 {
75         GetEcoreEvas()->SetRenderBackend((_RenderBackend)backend);
76 }
77
78 int
79 _EcoreEvasMgr::GetRenderBackend(void)
80 {
81         return GetEcoreEvas()->GetRenderBackend();
82 }
83
84 void
85 DestroyEcoreEvasMgr(void)
86 {
87         _EcoreEvasMgr* pEcoreEvasMgr = GetEcoreEvasMgr();
88
89         if (pEcoreEvasMgr)
90         {
91                 _EcoreEvas* pEcoreEvas = pEcoreEvasMgr->GetEcoreEvas();
92                 if (pEcoreEvas)
93                 {
94                         delete pEcoreEvas;
95                 }
96         }
97
98         delete __pEcoreEvasMgr;
99         __pEcoreEvasMgr = null;
100 }
101
102 _EcoreEvasMgr*
103 GetEcoreEvasMgr(void)
104 {
105         if (__pEcoreEvasMgr)
106         {
107                 return __pEcoreEvasMgr;
108         }
109
110         __pEcoreEvasMgr = new (std::nothrow) _EcoreEvasMgr;
111
112         return __pEcoreEvasMgr;
113 }
114
115 }} // Tizen::Ui