[Tizen] Sync for libds
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / offscreen-application.cpp
1 /*
2  * Copyright (c) 2020 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 <dali/devel-api/adaptor-framework/offscreen-application.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/internal/offscreen/common/offscreen-application-impl.h>
23
24 namespace Dali
25 {
26 OffscreenApplication OffscreenApplication::New(uint16_t width, uint16_t height, bool isTranslucent, OffscreenApplication::RenderMode renderMode)
27 {
28   Dali::Any                                    surface;
29   IntrusivePtr<Internal::OffscreenApplication> impl = Internal::OffscreenApplication::New(width, height, surface, isTranslucent, renderMode);
30
31   OffscreenApplication offscreenApplication = OffscreenApplication(impl.Get());
32
33   return offscreenApplication;
34 }
35
36 OffscreenApplication OffscreenApplication::New(Dali::Any surface, bool isTranslucent, OffscreenApplication::RenderMode renderMode)
37 {
38   IntrusivePtr<Internal::OffscreenApplication> impl = Internal::OffscreenApplication::New(0, 0, surface, isTranslucent, renderMode);
39
40   OffscreenApplication offscreenApplication = OffscreenApplication(impl.Get());
41
42   return offscreenApplication;
43 }
44
45 OffscreenApplication::OffscreenApplication() = default;
46
47 OffscreenApplication::OffscreenApplication(const OffscreenApplication& offscreenApplication) = default;
48
49 OffscreenApplication& OffscreenApplication::operator=(const OffscreenApplication& offscreenApplication) = default;
50
51 OffscreenApplication::~OffscreenApplication() = default;
52
53 void OffscreenApplication::Start()
54 {
55   Internal::GetImplementation(*this).Start();
56 }
57
58 void OffscreenApplication::Stop()
59 {
60   Internal::GetImplementation(*this).Stop();
61 }
62
63 Dali::OffscreenWindow OffscreenApplication::GetWindow()
64 {
65   return Internal::GetImplementation(*this).GetWindow();
66 }
67
68 void OffscreenApplication::RenderOnce()
69 {
70   Internal::GetImplementation(*this).RenderOnce();
71 }
72
73 OffscreenApplication::OffscreenApplicationSignalType& OffscreenApplication::InitSignal()
74 {
75   return Internal::GetImplementation(*this).InitSignal();
76 }
77
78 OffscreenApplication::OffscreenApplicationSignalType& OffscreenApplication::TerminateSignal()
79 {
80   return Internal::GetImplementation(*this).TerminateSignal();
81 }
82
83 OffscreenApplication::OffscreenApplication(Internal::OffscreenApplication* offscreenApplication)
84 : BaseHandle(offscreenApplication)
85 {
86 }
87
88 } // namespace Dali