d34a14f4245e9058a207fdfe0bc110067b763aef
[platform/core/uifw/dali-adaptor.git] / adaptors / base / display-connection.cpp
1 /*
2  * Copyright (c) 2015 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 <base/display-connection.h>
20
21 // EXTERNAL INCLUDES
22
23 // INTERNAL INCLUDES
24 #include <display-connection-impl.h>
25 #include <egl-interface.h>
26
27 namespace Dali
28 {
29
30 DisplayConnection* DisplayConnection::New()
31 {
32   Internal::Adaptor::DisplayConnection* internal(Internal::Adaptor::DisplayConnection::New());
33
34   return new DisplayConnection(internal);
35 }
36
37 DisplayConnection* DisplayConnection::New( RenderSurface::Type type )
38 {
39   Internal::Adaptor::DisplayConnection* internal(Internal::Adaptor::DisplayConnection::New());
40   internal->SetSurfaceType( type );
41
42   return new DisplayConnection(internal);
43 }
44
45 DisplayConnection::DisplayConnection()
46 : mImpl( NULL )
47 {
48 }
49
50 DisplayConnection::DisplayConnection(Internal::Adaptor::DisplayConnection* impl)
51 : mImpl(impl)
52 {
53 }
54
55 DisplayConnection::~DisplayConnection()
56 {
57   if (mImpl)
58   {
59     delete mImpl;
60     mImpl = NULL;
61   }
62 }
63
64 Any DisplayConnection::GetDisplay()
65 {
66   return mImpl->GetDisplay();
67 }
68
69 void DisplayConnection::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical)
70 {
71   Internal::Adaptor::DisplayConnection::GetDpi(dpiHorizontal, dpiVertical);
72 }
73
74 void DisplayConnection::ConsumeEvents()
75 {
76   mImpl->ConsumeEvents();
77 }
78
79 bool DisplayConnection::InitializeEgl(EglInterface& egl)
80 {
81   return mImpl->InitializeEgl(egl);
82 }
83
84 }