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::Maximize()
128 void Maximize(bool maximize) override;
131 * @copydoc Dali::Internal::Adaptor::WindowBase::IsMaximized()
133 bool IsMaximized() const override;
136 * @copydoc Dali::Internal::Adaptor::WindowBase::Minimize()
138 void Minimize(bool minimize) override;
141 * @copydoc Dali::Internal::Adaptor::WindowBase::IsMinimized()
143 bool IsMinimized() const override;
146 * @copydoc Dali::Internal::Adaptor::WindowBase::SetAvailableAnlges()
148 void SetAvailableAnlges(const std::vector<int>& angles) override;
151 * @copydoc Dali::Internal::Adaptor::WindowBase::SetPreferredAngle()
153 void SetPreferredAngle(int angle) override;
156 * @copydoc Dali::Internal::Adaptor::WindowBase::SetAcceptFocus()
158 void SetAcceptFocus(bool accept) override;
161 * @copydoc Dali::Internal::Adaptor::WindowBase::Show()
163 void Show() override;
166 * @copydoc Dali::Internal::Adaptor::WindowBase::Hide()
168 void Hide() override;
171 * @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHintCount()
173 unsigned int GetSupportedAuxiliaryHintCount() const override;
176 * @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHint()
178 std::string GetSupportedAuxiliaryHint(unsigned int index) const override;
181 * @copydoc Dali::Internal::Adaptor::WindowBase::AddAuxiliaryHint()
183 unsigned int AddAuxiliaryHint(const std::string& hint, const std::string& value) override;
186 * @copydoc Dali::Internal::Adaptor::WindowBase::RemoveAuxiliaryHint()
188 bool RemoveAuxiliaryHint(unsigned int id) override;
191 * @copydoc Dali::Internal::Adaptor::WindowBase::SetAuxiliaryHintValue()
193 bool SetAuxiliaryHintValue(unsigned int id, const std::string& value) override;
196 * @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintValue()
198 std::string GetAuxiliaryHintValue(unsigned int id) const override;
201 * @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintId()
203 unsigned int GetAuxiliaryHintId(const std::string& hint) const override;
206 * @copydoc Dali::Internal::Adaptor::WindowBase::SetInputRegion()
208 void SetInputRegion(const Rect<int>& inputRegion) override;
211 * @copydoc Dali::Internal::Adaptor::WindowBase::SetType()
213 void SetType(Dali::WindowType type) override;
216 * @copydoc Dali::Internal::Adaptor::WindowBase::GetType()
218 Dali::WindowType GetType() const override;
221 * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
223 WindowOperationResult SetNotificationLevel(WindowNotificationLevel level) override;
226 * @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel()
228 WindowNotificationLevel GetNotificationLevel() const override;
231 * @copydoc Dali::Internal::Adaptor::WindowBase::SetOpaqueState()
233 void SetOpaqueState(bool opaque) override;
236 * @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode()
238 WindowOperationResult SetScreenOffMode(WindowScreenOffMode screenOffMode) override;
241 * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode()
243 WindowScreenOffMode GetScreenOffMode() const override;
246 * @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness()
248 WindowOperationResult SetBrightness(int brightness) override;
251 * @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness()
253 int GetBrightness() const override;
256 * @copydoc Dali::Internal::Adaptor::WindowBase::GrabKey()
258 bool GrabKey(Dali::KEY key, KeyGrab::KeyGrabMode grabMode) override;
261 * @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKey()
263 bool UngrabKey(Dali::KEY key) override;
266 * @copydoc Dali::Internal::Adaptor::WindowBase::GrabKeyList()
269 const Dali::Vector<Dali::KEY>& key,
270 const Dali::Vector<KeyGrab::KeyGrabMode>& grabMode,
271 Dali::Vector<bool>& result) override;
274 * @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKeyList()
277 const Dali::Vector<Dali::KEY>& key,
278 Dali::Vector<bool>& result) override;
281 * @copydoc Dali::Internal::Adaptor::WindowBase::GetDpi()
283 void GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) override;
286 * @copydoc Dali::Internal::Adaptor::WindowBase::GetOrientation()
288 int GetOrientation() const override;
291 * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenRotationAngle()
293 int GetScreenRotationAngle() override;
296 * @copydoc Dali::Internal::Adaptor::WindowBase::SetWindowRotationAngle()
298 void SetWindowRotationAngle(int degree) override;
301 * @copydoc Dali::Internal::Adaptor::WindowBase::WindowRotationCompleted()
303 void WindowRotationCompleted(int degree, int width, int height) override;
306 * @copydoc Dali::Internal::Adaptor::WindowBase::SetTransparency()
308 void SetTransparency(bool transparent) override;
311 * @copydoc Dali::Internal::Adaptor::WindowBase::SetParent()
313 void SetParent(WindowBase* parentWinBase, bool belowParent) override;
316 * @copydoc Dali::Internal::Adaptor::WindowBase::CreateFrameRenderedSyncFence()
318 int CreateFrameRenderedSyncFence() override;
321 * @copydoc Dali::Internal::Adaptor::WindowBase::CreateFramePresentedSyncFence()
323 int CreateFramePresentedSyncFence() override;
326 * @copydoc Dali::Internal::Adaptor::WindowBase::SetPositionSizeWithAngle()
328 void SetPositionSizeWithAngle(PositionSize positionSize, int angle) override;
331 * @copydoc Dali::Internal::Adaptor::WindowBase::InitializeIme()
333 void InitializeIme() override;
336 * @copydoc Dali::Internal::Adaptor::WindowBase::ImeWindowReadyToRender()
338 void ImeWindowReadyToRender() override;
341 * @copydoc Dali::Internal::Adaptor::WindowBase::RequestMoveToServer()
343 void RequestMoveToServer() override;
346 * @copydoc Dali::Internal::Adaptor::WindowBase::RequestResizeToServer()
348 void RequestResizeToServer(WindowResizeDirection direction) override;
351 * @copydoc Dali::Internal::Adaptor::WindowBase::EnableFloatingMode()
353 void EnableFloatingMode(bool enable) override;
356 * @copydoc Dali::Internal::Adaptor::WindowBase::IsFloatingModeEnabled()
358 bool IsFloatingModeEnabled() const override;
361 * @copydoc Dali::Internal::Adaptor::WindowBase::IncludeInputRegion()
363 void IncludeInputRegion(const Rect<int>& inputRegion) override;
366 * @copydoc Dali::Internal::Adaptor::WindowBase::ExcludeInputRegion()
368 void ExcludeInputRegion(const Rect<int>& inputRegion) override;
372 WindowBaseCocoa(const WindowBaseCocoa&) = delete;
375 WindowBaseCocoa& operator=(const WindowBaseCocoa& rhs) = delete;
378 std::unique_ptr<Impl> mImpl;
381 } // namespace Dali::Internal::Adaptor