1 #ifndef DALI_INTERNAL_WINDOWSYSTEM_TIZENWAYLAND_WINDOW_BASE_ECORE_WL_H
2 #define DALI_INTERNAL_WINDOWSYSTEM_TIZENWAYLAND_WINDOW_BASE_ECORE_WL_H
5 * Copyright (c) 2018 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.
22 #include <dali/internal/window-system/common/window-base.h>
26 #include <Ecore_Wayland.h>
27 #include <tizen-extension-client-protocol.h>
36 class WindowRenderSurface;
37 class WindowRenderSurfaceEcoreWl;
40 * WindowBaseEcoreWl class provides an WindowBase EcoreX implementation.
42 class WindowBaseEcoreWl : public WindowBase
49 WindowBaseEcoreWl( Window* window, WindowRenderSurface* windowRenderSurface );
54 virtual ~WindowBaseEcoreWl();
59 * @brief Called when the window iconify state is changed.
61 Eina_Bool OnIconifyStateChanged( void* data, int type, void* event );
64 * @brief Called when the window gains focus.
66 Eina_Bool OnFocusIn( void* data, int type, void* event );
69 * @brief Called when the window loses focus.
71 Eina_Bool OnFocusOut( void* data, int type, void* event );
74 * @brief Called when the output is transformed.
76 Eina_Bool OnOutputTransform( void* data, int type, void* event );
79 * @brief Called when the output transform should be ignored.
81 Eina_Bool OnIgnoreOutputTransform( void* data, int type, void* event );
84 * @brief RegistryGlobalCallback
86 void RegistryGlobalCallback( void* data, struct wl_registry *registry, uint32_t name, const char* interface, uint32_t version );
89 * @brief RegistryGlobalCallbackRemove
91 void RegistryGlobalCallbackRemove( void* data, struct wl_registry* registry, uint32_t id );
94 * @brief TizenPolicyNotificationChangeDone
96 void TizenPolicyNotificationChangeDone(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, int32_t level, uint32_t state );
99 * @brief TizenPolicyScreenModeChangeDone
101 void TizenPolicyScreenModeChangeDone( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t mode, uint32_t state );
104 * @brief DisplayPolicyBrightnessChangeDone
106 void DisplayPolicyBrightnessChangeDone( void* data, struct tizen_display_policy *displayPolicy, struct wl_surface* surface, int32_t brightness, uint32_t state );
111 * @copydoc Dali::Internal::Adaptor::WindowBase::Initialize()
113 virtual void Initialize() override;
116 * @copydoc Dali::Internal::Adaptor::WindowBase::ShowIndicator()
118 virtual void ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode, Dali::Window::IndicatorBgOpacity opacityMode ) override;
121 * @copydoc Dali::Internal::Adaptor::WindowBase::SetIndicatorProperties()
123 virtual void SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation ) override;
126 * @copydoc Dali::Internal::Adaptor::WindowBase::IndicatorTypeChanged()
128 virtual void IndicatorTypeChanged( IndicatorInterface::Type type ) override;
131 * @copydoc Dali::Internal::Adaptor::WindowBase::SetClass()
133 virtual void SetClass( std::string name, std::string className ) override;
136 * @copydoc Dali::Internal::Adaptor::WindowBase::Raise()
138 virtual void Raise() override;
141 * @copydoc Dali::Internal::Adaptor::WindowBase::Lower()
143 virtual void Lower() override;
146 * @copydoc Dali::Internal::Adaptor::WindowBase::Activate()
148 virtual void Activate() override;
151 * @copydoc Dali::Internal::Adaptor::WindowBase::SetAvailableOrientations()
153 virtual void SetAvailableOrientations( const std::vector< Dali::Window::WindowOrientation >& orientations ) override;
156 * @copydoc Dali::Internal::Adaptor::WindowBase::SetPreferredOrientation()
158 virtual void SetPreferredOrientation( Dali::Window::WindowOrientation orientation ) override;
161 * @copydoc Dali::Internal::Adaptor::WindowBase::SetAcceptFocus()
163 virtual void SetAcceptFocus( bool accept ) override;
166 * @copydoc Dali::Internal::Adaptor::WindowBase::Show()
168 virtual void Show() override;
171 * @copydoc Dali::Internal::Adaptor::WindowBase::Hide()
173 virtual void Hide() override;
176 * @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHintCount()
178 virtual unsigned int GetSupportedAuxiliaryHintCount() const override;
181 * @copydoc Dali::Internal::Adaptor::WindowBase::GetSupportedAuxiliaryHint()
183 virtual std::string GetSupportedAuxiliaryHint( unsigned int index ) const override;
186 * @copydoc Dali::Internal::Adaptor::WindowBase::AddAuxiliaryHint()
188 virtual unsigned int AddAuxiliaryHint( const std::string& hint, const std::string& value ) override;
191 * @copydoc Dali::Internal::Adaptor::WindowBase::RemoveAuxiliaryHint()
193 virtual bool RemoveAuxiliaryHint( unsigned int id ) override;
196 * @copydoc Dali::Internal::Adaptor::WindowBase::SetAuxiliaryHintValue()
198 virtual bool SetAuxiliaryHintValue( unsigned int id, const std::string& value ) override;
201 * @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintValue()
203 virtual std::string GetAuxiliaryHintValue( unsigned int id ) const override;
206 * @copydoc Dali::Internal::Adaptor::WindowBase::GetAuxiliaryHintId()
208 virtual unsigned int GetAuxiliaryHintId( const std::string& hint ) const override;
211 * @copydoc Dali::Internal::Adaptor::WindowBase::SetInputRegion()
213 virtual void SetInputRegion( const Rect< int >& inputRegion ) override;
216 * @copydoc Dali::Internal::Adaptor::WindowBase::SetType()
218 virtual void SetType( Dali::Window::Type type ) override;
221 * @copydoc Dali::Internal::Adaptor::WindowBase::SetNotificationLevel()
223 virtual bool SetNotificationLevel( Dali::Window::NotificationLevel::Type level ) override;
226 * @copydoc Dali::Internal::Adaptor::WindowBase::GetNotificationLevel()
228 virtual Dali::Window::NotificationLevel::Type GetNotificationLevel() const override;
231 * @copydoc Dali::Internal::Adaptor::WindowBase::SetOpaqueState()
233 virtual void SetOpaqueState( bool opaque ) override;
236 * @copydoc Dali::Internal::Adaptor::WindowBase::SetScreenOffMode()
238 virtual bool SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode) override;
241 * @copydoc Dali::Internal::Adaptor::WindowBase::GetScreenOffMode()
243 virtual Dali::Window::ScreenOffMode::Type GetScreenOffMode() const override;
246 * @copydoc Dali::Internal::Adaptor::WindowBase::SetBrightness()
248 virtual bool SetBrightness( int brightness ) override;
251 * @copydoc Dali::Internal::Adaptor::WindowBase::GetBrightness()
253 virtual int GetBrightness() const override;
256 * @copydoc Dali::Internal::Adaptor::WindowBase::GrabKey()
258 virtual bool GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode ) override;
261 * @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKey()
263 virtual bool UngrabKey( Dali::KEY key ) override;
266 * @copydoc Dali::Internal::Adaptor::WindowBase::GrabKeyList()
268 virtual bool GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result ) override;
271 * @copydoc Dali::Internal::Adaptor::WindowBase::UngrabKeyList()
273 virtual bool UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result ) override;
278 WindowBaseEcoreWl(const WindowBaseEcoreWl&) = delete;
281 WindowBaseEcoreWl& operator=(const WindowBaseEcoreWl& rhs) = delete;
285 typedef std::vector< std::pair< std::string, std::string > > AuxiliaryHints;
287 Dali::Vector< Ecore_Event_Handler* > mEcoreEventHandler;
290 WindowRenderSurfaceEcoreWl* mWindowSurface;
291 Ecore_Wl_Window* mEcoreWindow;
292 wl_display* mDisplay;
293 wl_event_queue* mEventQueue;
294 tizen_policy* mTizenPolicy;
295 tizen_display_policy* mTizenDisplayPolicy;
297 std::vector< std::string > mSupportedAuxiliaryHints;
298 AuxiliaryHints mAuxiliaryHints;
300 int mNotificationLevel;
301 uint32_t mNotificationChangeState;
302 bool mNotificationLevelChangeDone;
305 uint32_t mScreenOffModeChangeState;
306 bool mScreenOffModeChangeDone;
309 uint32_t mBrightnessChangeState;
310 bool mBrightnessChangeDone;
313 } // namespace Adaptor
315 } // namespace internal
319 #endif // DALI_INTERNAL_WINDOWSYSTEM_TIZENWAYLAND_WINDOW_BASE_ECORE_WL_H