[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()
46 {
47 }
48
49 OffscreenApplication::OffscreenApplication( const OffscreenApplication& offscreenApplication )
50 : BaseHandle( offscreenApplication )
51 {
52 }
53
54 OffscreenApplication& OffscreenApplication::operator=( const OffscreenApplication& offscreenApplication )
55 {
56   if( *this != offscreenApplication )
57   {
58     BaseHandle::operator=( offscreenApplication );
59   }
60   return *this;
61 }
62
63 OffscreenApplication::~OffscreenApplication()
64 {
65 }
66
67 void OffscreenApplication::Start()
68 {
69   Internal::GetImplementation( *this ).Start();
70 }
71
72 void OffscreenApplication::Stop()
73 {
74   Internal::GetImplementation( *this ).Stop();
75 }
76
77 Dali::OffscreenWindow OffscreenApplication::GetWindow()
78 {
79   return Internal::GetImplementation( *this ).GetWindow();
80 }
81
82 void OffscreenApplication::RenderOnce()
83 {
84   Internal::GetImplementation( *this ).RenderOnce();
85 }
86
87 OffscreenApplication::OffscreenApplicationSignalType& OffscreenApplication::InitSignal()
88 {
89   return Internal::GetImplementation( *this ).InitSignal();
90 }
91
92 OffscreenApplication::OffscreenApplicationSignalType& OffscreenApplication::TerminateSignal()
93 {
94   return Internal::GetImplementation( *this ).TerminateSignal();
95 }
96
97 OffscreenApplication::OffscreenApplication( Internal::OffscreenApplication* offscreenApplication )
98 : BaseHandle( offscreenApplication )
99 {
100 }
101
102 }  // namespace Dali