4 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 #include <dali/internal/window-system/common/window-base.h>
24 namespace Dali::Internal::Adaptor
27 * WindowBaseCocoa class provides an WindowBase Win32 implementation.
29 class WindowBaseCocoa : public WindowBase
37 WindowBaseCocoa(PositionSize positionSize, Any surface, bool isTransparent);
46 * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindow()
48 Any GetNativeWindow() override;
51 * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeWindowId()
53 int GetNativeWindowId() override;
56 * @copydoc Dali::Internal::Adaptor::WindowBase::CreateEglWindow()
58 EGLNativeWindowType CreateEglWindow(int width, int height) override;
61 * @copydoc Dali::Internal::Adaptor::WindowBase::DestroyEglWindow()
63 void DestroyEglWindow() override;
66 * @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowRotation()
68 void SetEglWindowRotation(int angle) override;
71 * @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowBufferTransform()
73 void SetEglWindowBufferTransform(int angle) override;
76 * @copydoc Dali::Internal::Adaptor::WindowBase::SetEglWindowTransform()
78 void SetEglWindowTransform(int angle) override;
81 * @copydoc Dali::Internal::Adaptor::WindowBase::ResizeEglWindow()
83 void ResizeEglWindow(PositionSize positionSize) override;
86 * @copydoc Dali::Internal::Adaptor::WindowBase::IsEglWindowRotationSupported()
88 bool IsEglWindowRotationSupported() override;
91 * @copydoc Dali::Internal::Adaptor::WindowBase::Move()
93 void Move(PositionSize positionSize) override;
96 * @copydoc Dali::Internal::Adaptor::WindowBase::Resize()
98 void Resize(PositionSize positionSize) override;
101 * @copydoc Dali::Internal::Adaptor::WindowBase::MoveResize()
103 void MoveResize(PositionSize positionSize) override;
106 * @copydoc Dali::Internal::Adaptor::WindowBase::SetClass()
108 void SetClass(const std::string& name, const std::string& className) override;
111 * @copydoc Dali::Internal::Adaptor::WindowBase::Raise()
113 void Raise() override;
116 * @copydoc Dali::Internal::Adaptor::WindowBase::Lower()
118 void Lower() override;
121 * @copydoc Dali::Internal::Adaptor::WindowBase::Activate()
123 void Activate() override;
126 * @copydoc Dali::Internal::Adaptor::WindowBase::SetAvailableAnlges()
128 void SetAvailableAnlges(const std::vector<int>& angles) override;
131 * @copydoc Dali::Internal::Adaptor::WindowBase::SetPreferredAngle()
133 void SetPreferredAngle(int angle) override;
136 * @copydoc Dali::Internal::Adaptor::WindowBase::SetAcceptFocus()
138 void SetAcceptFocus(bool accept) override;
141 * @copydoc Dali::Internal::Adaptor::WindowBase::Show()
143 void Show() override;
146 * @copydoc Dali::Internal::Adaptor::WindowBase::Hide()
148 void Hide() override;
151 * @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHintCount()
153 unsigned int GetSupportedAuxiliaryHintCount() const override;
156 * @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHint()
158 std::string GetSupportedAuxiliaryHint(unsigned int index) const override;
161 * @copydoc Dali::Internal::Adaptor::WindowBase::AddAuxiliaryHint()
163 unsigned int AddAuxiliaryHint(const std::string& hint, const std::string& value) override;
166 * @copydoc Dali::Internal::Adaptor::WindowBase::RemoveAuxiliaryHint()
168 bool RemoveAuxiliaryHint(unsigned int id) override;
171 * @copydoc Dali::Internal::Adaptor::WindowBase::SetAuxiliaryHintValue()
173 bool SetAuxiliaryHintValue(unsigned int id, const std::string& value) override;
176 * @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintValue()
178 std::string GetAuxiliaryHintValue(unsigned int id) const override;
181 * @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintId()
183 unsigned int GetAuxiliaryHintId(const std::string& hint) const override;
186 * @copydoc Dali::Internal::Adaptor::WindowBase::SetInputRegion()
188 void SetInputRegion(const Rect<int>& inputRegion) override;
191 * @copydoc Dali::Internal::Adaptor::WindowBase::SetType()
193 void SetType(Dali::WindowType type) override;
196 * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
198 bool SetNotificationLevel(WindowNotificationLevel level) override;
201 * @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel()
203 WindowNotificationLevel GetNotificationLevel() const override;
206 * @copydoc Dali::Internal::Adaptor::WindowBase::SetOpaqueState()
208 void SetOpaqueState(bool opaque) override;
211 * @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode()
213 bool SetScreenOffMode(WindowScreenOffMode screenOffMode) override;
216 * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode()
218 WindowScreenOffMode GetScreenOffMode() const override;
221 * @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness()
223 bool SetBrightness(int brightness) override;
226 * @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness()
228 int GetBrightness() const override;
231 * @copydoc Dali::Internal::Adaptor::WindowBase::GrabKey()
233 bool GrabKey(Dali::KEY key, KeyGrab::KeyGrabMode grabMode) override;
236 * @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKey()
238 bool UngrabKey(Dali::KEY key) override;
241 * @copydoc Dali::Internal::Adaptor::WindowBase::GrabKeyList()
244 const Dali::Vector<Dali::KEY>& key,
245 const Dali::Vector<KeyGrab::KeyGrabMode>& grabMode,
246 Dali::Vector<bool>& result) override;
249 * @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKeyList()
252 const Dali::Vector<Dali::KEY>& key,
253 Dali::Vector<bool>& result) override;
256 * @copydoc Dali::Internal::Adaptor::WindowBase::GetDpi()
258 void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) override;
261 * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation()
263 int GetOrientation() const override;
266 * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
268 int GetScreenRotationAngle() override;
271 * @copydoc Dali::Internal::Adaptor::WindowBase::SetWindowRotationAngle()
273 void SetWindowRotationAngle(int degree) override;
276 * @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted()
278 void WindowRotationCompleted(int degree, int width, int height) override;
281 * @copydoc Dali::Internal::Adaptor::WindowBase::SetTransparency()
283 void SetTransparency(bool transparent) override;
286 * @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
288 void SetParent(WindowBase* parentWinBase) override;
291 * @copydoc Dali::Internal::Adaptor::WindowBase::CreateFrameRenderedSyncFence()
293 int CreateFrameRenderedSyncFence() override;
296 * @copydoc Dali::Internal::Adaptor::WindowBase::CreateFramePresentedSyncFence()
298 int CreateFramePresentedSyncFence() override;
302 WindowBaseCocoa(const WindowBaseCocoa&) = delete;
305 WindowBaseCocoa& operator=(const WindowBaseCocoa& rhs) = delete;
308 std::unique_ptr<Impl> mImpl;
311 } // namespace Dali::Internal::Adaptor