1 #ifndef DALI_INTERNAL_OFFSCREEN_APPLICATION_IMPL_H
2 #define DALI_INTERNAL_OFFSCREEN_APPLICATION_IMPL_H
5 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
24 #include <dali/integration-api/adaptor-framework/scene-holder-impl.h>
25 #include <dali/public-api/common/intrusive-ptr.h>
26 #include <dali/public-api/object/base-object.h>
27 #include <dali/public-api/signals/connection-tracker.h>
30 #include <dali/devel-api/adaptor-framework/offscreen-application.h>
31 #include <dali/devel-api/adaptor-framework/offscreen-window.h>
33 using RenderMode = Dali::OffscreenApplication::RenderMode;
43 * Implementation of the OffscreenApplication class.
45 class OffscreenApplication : public BaseObject,
46 public ConnectionTracker
50 typedef Dali::OffscreenApplication::OffscreenApplicationSignalType OffscreenApplicationSignalType;
53 * @brief Create a new OffscreenApplication
54 * @param[in] width The width of the default OffscreenWindow
55 * @param[in] height The height of the default OffscreenWindow
56 * @param[in] surface The native surface handle to create the default OffscreenWindow
57 * @param[in] isTranslucent Whether the OffscreenWindow is translucent or not
59 static IntrusivePtr<OffscreenApplication> New( uint16_t width, uint16_t height, Dali::Any surface, bool isTranslucent, RenderMode renderMode);
64 * @copydoc Dali::OffscreenApplication::Start()
69 * @copydoc Dali::OffscreenApplication::Stop()
74 * @copydoc Dali::OffscreenApplication::GetDefaultWindow()
76 Dali::OffscreenWindow GetWindow();
79 * @copydoc Dali::OffscreenApplication::RenderOnce()
86 * @copydoc Dali::OffscreenApplication::InitSignal()
88 OffscreenApplicationSignalType& InitSignal()
94 * @copydoc Dali::OffscreenApplication::TerminateSignal()
96 OffscreenApplicationSignalType& TerminateSignal()
98 return mTerminateSignal;
103 * Private constructor
104 * @param[in] width The width of the OffscreenWindow
105 * @param[in] height The height of the OffscreenApplication
106 * @param[in] surface The native surface handle to create the default OffscreenWindow
107 * @param[in] isTranslucent Whether the OffscreenWindow is translucent or not
109 OffscreenApplication( uint16_t width, uint16_t height, Dali::Any surface, bool isTranslucent, RenderMode renderMode );
115 virtual ~OffscreenApplication();
118 OffscreenApplication( const OffscreenApplication& );
119 OffscreenApplication& operator=( OffscreenApplication& );
122 Dali::Adaptor* mAdaptor;
123 Dali::OffscreenWindow mDefaultWindow;
125 OffscreenApplicationSignalType mInitSignal;
126 OffscreenApplicationSignalType mTerminateSignal;
129 inline OffscreenApplication& GetImplementation( Dali::OffscreenApplication& offscreenApplication )
131 DALI_ASSERT_ALWAYS( offscreenApplication && "OffscreenApplication handle is empty" );
133 BaseObject& handle = offscreenApplication.GetBaseObject();
135 return static_cast<OffscreenApplication&>( handle );
138 inline const OffscreenApplication& GetImplementation( const Dali::OffscreenApplication& offscreenApplication )
140 DALI_ASSERT_ALWAYS( offscreenApplication && "OffscreenApplication handle is empty" );
142 const BaseObject& handle = offscreenApplication.GetBaseObject();
144 return static_cast<const OffscreenApplication&>( handle );
147 } // namespace Internal
151 #endif // DALI_INTERNAL_OFFSCREEN_APPLICATION_IMPL_H