2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include <window-impl.h>
22 // Ecore is littered with C style cast
23 #pragma GCC diagnostic push
24 #pragma GCC diagnostic ignored "-Wold-style-cast"
26 #include <Ecore_Wayland.h>
27 #include <tizen-extension-client-protocol.h>
29 #include <dali/integration-api/core.h>
30 #include <dali/integration-api/system-overlay.h>
31 #include <dali/public-api/render-tasks/render-task.h>
32 #include <dali/public-api/render-tasks/render-task-list.h>
33 #include <orientation.h>
36 #include <window-render-surface.h>
37 #include <drag-and-drop-detector-impl.h>
38 #include <ecore-indicator-impl.h>
39 #include <window-visibility-observer.h>
40 #include <orientation-impl.h>
44 const float INDICATOR_ANIMATION_DURATION( 0.18f ); // 180 milli seconds
45 const float INDICATOR_SHOW_Y_POSITION( 0.0f );
46 const float INDICATOR_HIDE_Y_POSITION( -52.0f );
56 #if defined(DEBUG_ENABLED)
57 Debug::Filter* gWindowLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_WINDOW");
61 * TODO: Abstract Window class out and move this into a window implementation for Ecore
63 struct Window::EventHandler
67 * @param[in] window A pointer to the window class.
69 EventHandler( Window* window )
76 mTizenDisplayPolicy( NULL ),
77 mNotificationLevel( -1 ),
78 mNotificationChangeState( 0 ),
79 mNotificationLevelChangeDone( true ),
81 mScreenOffModeChangeState( 0 ),
82 mScreenOffModeChangeDone( true ),
84 mBrightnessChangeState( 0 ),
85 mBrightnessChangeDone( true )
87 // store ecore window handle
88 ECore::WindowRenderSurface* wlWindow( dynamic_cast< ECore::WindowRenderSurface * >( mWindow->mSurface ) );
91 mEcoreWindow = wlWindow->GetWlWindow();
93 DALI_ASSERT_ALWAYS( mEcoreWindow != 0 && "There is no ecore Wl window");
95 if( mWindow->mEcoreEventHander )
97 mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL_EVENT_WINDOW_ICONIFY_STATE_CHANGE, EcoreEventWindowIconifyStateChanged, this ) );
98 mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL_EVENT_FOCUS_IN, EcoreEventWindowFocusIn, this ) );
99 mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL_EVENT_FOCUS_OUT, EcoreEventWindowFocusOut, this ) );
100 mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL_EVENT_OUTPUT_TRANSFORM, EcoreEventOutputTransform, this) );
101 mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL_EVENT_IGNORE_OUTPUT_TRANSFORM, EcoreEventIgnoreOutputTransform, this) );
104 mDisplay = ecore_wl_display_get();
108 wl_display* displayWrapper = static_cast< wl_display* >( wl_proxy_create_wrapper( mDisplay ) );
111 mEventQueue = wl_display_create_queue( mDisplay );
114 wl_proxy_set_queue( reinterpret_cast< wl_proxy* >( displayWrapper ), mEventQueue );
116 wl_registry* registry = wl_display_get_registry( displayWrapper );
117 wl_registry_add_listener( registry, &mRegistryListener, this );
120 wl_proxy_wrapper_destroy( displayWrapper );
130 for( Dali::Vector< Ecore_Event_Handler* >::Iterator iter = mEcoreEventHandler.Begin(), endIter = mEcoreEventHandler.End(); iter != endIter; ++iter )
132 ecore_event_handler_del( *iter );
134 mEcoreEventHandler.Clear();
138 wl_event_queue_destroy( mEventQueue );
144 /// Called when the window iconify state is changed.
145 static Eina_Bool EcoreEventWindowIconifyStateChanged( void* data, int type, void* event )
147 Ecore_Wl_Event_Window_Iconify_State_Change* iconifyChangedEvent( static_cast< Ecore_Wl_Event_Window_Iconify_State_Change* >( event ) );
148 EventHandler* handler( static_cast< EventHandler* >( data ) );
149 Eina_Bool handled( ECORE_CALLBACK_PASS_ON );
151 if ( handler && handler->mWindow )
153 WindowVisibilityObserver* observer( handler->mWindow->mAdaptor );
154 if ( observer && ( iconifyChangedEvent->win == static_cast< unsigned int> ( ecore_wl_window_id_get( handler->mEcoreWindow ) ) ) )
156 if( iconifyChangedEvent->iconified == EINA_TRUE )
158 handler->mWindow->mIconified = true;
159 if( handler->mWindow->mVisible )
161 observer->OnWindowHidden();
163 DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%d) Iconfied\n", handler->mEcoreWindow );
167 handler->mWindow->mIconified = false;
168 if( handler->mWindow->mVisible )
170 observer->OnWindowShown();
172 DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%d) Shown\n", handler->mEcoreWindow );
174 handled = ECORE_CALLBACK_DONE;
181 /// Called when the window gains focus
182 static Eina_Bool EcoreEventWindowFocusIn( void* data, int type, void* event )
184 Ecore_Wl_Event_Focus_In* focusInEvent( static_cast< Ecore_Wl_Event_Focus_In* >( event ) );
185 EventHandler* handler( static_cast< EventHandler* >( data ) );
187 if ( handler && handler->mWindow && focusInEvent->win == static_cast< unsigned int >( ecore_wl_window_id_get( handler->mEcoreWindow ) ) )
189 DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window EcoreEventWindowFocusIn\n" );
191 handler->mWindow->mFocusChangedSignal.Emit( true );
194 return ECORE_CALLBACK_PASS_ON;
197 /// Called when the window loses focus
198 static Eina_Bool EcoreEventWindowFocusOut( void* data, int type, void* event )
200 Ecore_Wl_Event_Focus_Out* focusOutEvent( static_cast< Ecore_Wl_Event_Focus_Out* >( event ) );
201 EventHandler* handler( static_cast< EventHandler* >( data ) );
203 if ( handler && handler->mWindow && focusOutEvent->win == static_cast< unsigned int >(ecore_wl_window_id_get( handler->mEcoreWindow ) ) )
205 DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window EcoreEventWindowFocusOut\n" );
207 handler->mWindow->mFocusChangedSignal.Emit( false );
210 return ECORE_CALLBACK_PASS_ON;
213 /// Called when the output is transformed
214 static Eina_Bool EcoreEventOutputTransform( void* data, int type, void* event )
216 Ecore_Wl_Event_Output_Transform* transformEvent( static_cast< Ecore_Wl_Event_Output_Transform* >( event ) );
217 EventHandler* handler( static_cast< EventHandler* >( data ) );
219 if ( handler && handler->mWindow && transformEvent->output == ecore_wl_window_output_find( handler->mEcoreWindow ) )
221 DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%d) EcoreEventOutputTransform\n", handler->mEcoreWindow );
223 ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( handler->mWindow->mSurface ) );
226 wlSurface->OutputTransformed();
228 PositionSize positionSize = wlSurface->GetPositionSize();
229 handler->mWindow->mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
230 handler->mWindow->mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
234 return ECORE_CALLBACK_PASS_ON;
237 /// Called when the output transform should be ignored
238 static Eina_Bool EcoreEventIgnoreOutputTransform( void* data, int type, void* event )
240 Ecore_Wl_Event_Ignore_Output_Transform* ignoreTransformEvent( static_cast< Ecore_Wl_Event_Ignore_Output_Transform* >( event ) );
241 EventHandler* handler( static_cast< EventHandler* >( data ) );
243 if ( handler && handler->mWindow && ignoreTransformEvent->win == handler->mEcoreWindow )
245 DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%d) EcoreEventIgnoreOutputTransform\n", handler->mEcoreWindow );
247 ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( handler->mWindow->mSurface ) );
250 wlSurface->OutputTransformed();
252 PositionSize positionSize = wlSurface->GetPositionSize();
253 handler->mWindow->mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
254 handler->mWindow->mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
258 return ECORE_CALLBACK_PASS_ON;
261 static void RegistryGlobalCallback( void* data, struct wl_registry *registry, uint32_t name, const char* interface, uint32_t version )
263 Window::EventHandler* eventHandler = static_cast< Window::EventHandler* >( data );
265 if( strcmp( interface, tizen_policy_interface.name ) == 0 )
267 eventHandler->mTizenPolicy = static_cast< tizen_policy* >( wl_registry_bind( registry, name, &tizen_policy_interface, version ) );
268 if( !eventHandler->mTizenPolicy )
270 DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window::EventHandler::RegistryGlobalCallback: wl_registry_bind(tizen_policy_interface) is failed.\n" );
274 tizen_policy_add_listener( eventHandler->mTizenPolicy, &eventHandler->mTizenPolicyListener, data );
276 DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window::EventHandler::RegistryGlobalCallback: tizen_policy_add_listener is called.\n" );
278 else if( strcmp( interface, tizen_display_policy_interface.name ) == 0 )
280 eventHandler->mTizenDisplayPolicy = static_cast< tizen_display_policy* >( wl_registry_bind( registry, name, &tizen_display_policy_interface, version ) );
281 if( !eventHandler->mTizenDisplayPolicy )
283 DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window::EventHandler::RegistryGlobalCallback: wl_registry_bind(tizen_display_policy_interface) is failed.\n" );
287 tizen_display_policy_add_listener( eventHandler->mTizenDisplayPolicy, &eventHandler->mTizenDisplayPolicyListener, data );
289 DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window::EventHandler::RegistryGlobalCallback: tizen_display_policy_add_listener is called.\n" );
293 static void RegistryGlobalCallbackRemove( void* data, struct wl_registry* registry, uint32_t id )
295 Window::EventHandler* eventHandler = static_cast< Window::EventHandler* >( data );
296 eventHandler->mTizenPolicy = NULL;
297 eventHandler->mTizenDisplayPolicy = NULL;
300 static void TizenPolicyNotificationChangeDone(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, int32_t level, uint32_t state )
302 Window::EventHandler* eventHandler = static_cast< Window::EventHandler* >( data );
304 eventHandler->mNotificationLevel = level;
305 eventHandler->mNotificationChangeState = state;
306 eventHandler->mNotificationLevelChangeDone = true;
308 DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window::EventHandler::TizenPolicyNotificationChangeDone: level = %d, state = %d\n", level, state );
311 static void TizenPolicyScreenModeChangeDone(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t mode, uint32_t state )
313 Window::EventHandler* eventHandler = static_cast< Window::EventHandler* >( data );
315 eventHandler->mScreenOffMode = mode;
316 eventHandler->mScreenOffModeChangeState = state;
317 eventHandler->mScreenOffModeChangeDone = true;
319 DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window::EventHandler::TizenPolicyScreenModeChangeDone: mode = %d, state = %d\n", mode, state );
322 static void DisplayPolicyBrightnessChangeDone(void* data, struct tizen_display_policy *displayPolicy, struct wl_surface* surface, int32_t brightness, uint32_t state )
324 Window::EventHandler* eventHandler = static_cast< Window::EventHandler* >( data );
326 eventHandler->mBrightness = brightness;
327 eventHandler->mBrightnessChangeState = state;
328 eventHandler->mBrightnessChangeDone = true;
330 DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window::EventHandler::DisplayPolicyBrightnessChangeDone: brightness = %d, state = %d\n", brightness, state );
333 const struct wl_registry_listener mRegistryListener =
335 RegistryGlobalCallback,
336 RegistryGlobalCallbackRemove
339 const struct tizen_policy_listener mTizenPolicyListener =
343 TizenPolicyNotificationChangeDone,
345 TizenPolicyScreenModeChangeDone,
352 const struct tizen_display_policy_listener mTizenDisplayPolicyListener =
354 DisplayPolicyBrightnessChangeDone
359 Dali::Vector< Ecore_Event_Handler* > mEcoreEventHandler;
360 Ecore_Wl_Window* mEcoreWindow;
362 wl_display* mDisplay;
363 wl_event_queue* mEventQueue;
364 tizen_policy* mTizenPolicy;
365 tizen_display_policy* mTizenDisplayPolicy;
367 int mNotificationLevel;
368 uint32_t mNotificationChangeState;
369 bool mNotificationLevelChangeDone;
372 uint32_t mScreenOffModeChangeState;
373 bool mScreenOffModeChangeDone;
376 uint32_t mBrightnessChangeState;
377 bool mBrightnessChangeDone;
380 Window* Window::New( const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent )
382 Window* window = new Window();
383 window->mIsTransparent = isTransparent;
384 window->Initialize( positionSize, name, className );
388 void Window::SetAdaptor(Dali::Adaptor& adaptor)
390 DALI_ASSERT_ALWAYS( !mStarted && "Adaptor already started" );
393 // Only create one overlay per window
394 Internal::Adaptor::Adaptor& adaptorImpl = Internal::Adaptor::Adaptor::GetImplementation(adaptor);
395 Integration::Core& core = adaptorImpl.GetCore();
396 mOverlay = &core.GetSystemOverlay();
398 Dali::RenderTaskList taskList = mOverlay->GetOverlayRenderTasks();
399 taskList.CreateTask();
401 mAdaptor = &adaptorImpl;
402 mAdaptor->AddObserver( *this );
404 // Can only create the detector when we know the Core has been instantiated.
405 mDragAndDropDetector = DragAndDropDetector::New();
406 mAdaptor->SetDragAndDropDetector( &GetImplementation( mDragAndDropDetector ) );
410 mOrientation->SetAdaptor(adaptor);
413 if( mIndicator != NULL )
415 mIndicator->SetAdaptor(mAdaptor);
419 RenderSurface* Window::GetSurface()
424 void Window::ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode )
426 DALI_LOG_TRACE_METHOD_FMT( gWindowLogFilter, "visible : %d\n", visibleMode );
427 DALI_ASSERT_DEBUG(mOverlay);
429 ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
430 DALI_ASSERT_DEBUG(wlSurface);
434 Ecore_Wl_Window* wlWindow = wlSurface->GetWlWindow();
436 mIndicatorVisible = visibleMode;
438 if ( mIndicatorVisible == Dali::Window::VISIBLE )
440 // when the indicator is visible, set proper mode for indicator server according to bg mode
441 if ( mIndicatorOpacityMode == Dali::Window::OPAQUE )
443 ecore_wl_window_indicator_opacity_set(wlWindow, ECORE_WL_INDICATOR_OPAQUE);
445 else if ( mIndicatorOpacityMode == Dali::Window::TRANSLUCENT )
447 ecore_wl_window_indicator_opacity_set(wlWindow, ECORE_WL_INDICATOR_TRANSLUCENT);
449 else if ( mIndicatorOpacityMode == Dali::Window::TRANSPARENT )
451 ecore_wl_window_indicator_opacity_set(wlWindow, ECORE_WL_INDICATOR_OPAQUE);
456 // when the indicator is not visible, set TRANSPARENT mode for indicator server
457 ecore_wl_window_indicator_opacity_set(wlWindow, ECORE_WL_INDICATOR_TRANSPARENT); // it means hidden indicator
461 DoShowIndicator( mIndicatorOrientation );
464 void Window::RotateIndicator( Dali::Window::WindowOrientation orientation )
466 DALI_LOG_TRACE_METHOD_FMT( gWindowLogFilter, "Orientation: %d\n", orientation );
468 DoRotateIndicator( orientation );
471 void Window::SetIndicatorBgOpacity( Dali::Window::IndicatorBgOpacity opacityMode )
473 mIndicatorOpacityMode = opacityMode;
475 if( mIndicator != NULL )
477 mIndicator->SetOpacityMode( opacityMode );
481 void Window::SetClass(std::string name, std::string klass)
483 ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
487 Ecore_Wl_Window* wlWindow = wlSurface->GetWlWindow();
488 ecore_wl_window_title_set( wlWindow, name.c_str() );
489 ecore_wl_window_class_name_set( wlWindow, klass.c_str() );
493 DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window has no surface\n" );
499 mIndicatorVisible( Dali::Window::VISIBLE ),
500 mIndicatorIsShown( false ),
501 mShowRotatedIndicatorOnClose( false ),
503 mIsTransparent( false ),
504 mWMRotationAppSet( false ),
505 mEcoreEventHander( true ),
506 mIsFocusAcceptable( true ),
509 mOpaqueState( false ),
510 mResizeEnabled( false ),
512 mIndicatorOrientation( Dali::Window::PORTRAIT ),
513 mNextIndicatorOrientation( Dali::Window::PORTRAIT ),
514 mIndicatorOpacityMode( Dali::Window::OPAQUE ),
517 mType( Dali::Window::NORMAL ),
518 mEventHandler( NULL ),
519 mPreferredOrientation( Dali::Window::PORTRAIT ),
520 mSupportedAuxiliaryHints(),
522 mIndicatorVisibilityChangedSignal(),
523 mFocusChangedSignal(),
525 mDeleteRequestSignal()
531 delete mEventHandler;
541 mAdaptor->RemoveObserver( *this );
542 mAdaptor->SetDragAndDropDetector( NULL );
548 mSupportedAuxiliaryHints.clear();
549 mAuxiliaryHints.clear();
552 void Window::Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className)
554 // create an Wayland window by default
556 ECore::WindowRenderSurface* windowSurface = new ECore::WindowRenderSurface( positionSize, surface, name, mIsTransparent );
558 mSurface = windowSurface;
560 // create event handler for Wayland window
561 mEventHandler = new EventHandler( this );
563 // get auxiliary hint
564 Eina_List* hints = ecore_wl_window_aux_hints_supported_get( mEventHandler->mEcoreWindow );
570 for( l = hints, ( hint = static_cast< char* >( eina_list_data_get(l) ) ); l; l = eina_list_next(l), ( hint = static_cast< char* >( eina_list_data_get(l) ) ) )
572 mSupportedAuxiliaryHints.push_back( hint );
574 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::Initialize: %s\n", hint );
578 if( !positionSize.IsEmpty() )
580 AddAuxiliaryHint( "wm.policy.win.user.geometry", "1" );
581 mResizeEnabled = true;
584 SetClass( name, className );
585 windowSurface->Map();
587 mOrientation = Orientation::New(this);
590 void Window::DoShowIndicator( Dali::Window::WindowOrientation lastOrientation )
592 if( mIndicator == NULL )
594 if( mIndicatorVisible != Dali::Window::INVISIBLE )
596 mIndicator = new Indicator( mAdaptor, mIndicatorOrientation, this );
597 mIndicator->SetOpacityMode( mIndicatorOpacityMode );
598 Dali::Actor actor = mIndicator->GetActor();
599 SetIndicatorActorRotation();
600 mOverlay->Add(actor);
602 // else don't create a hidden indicator
604 else // Already have indicator
606 if( mIndicatorVisible == Dali::Window::VISIBLE )
608 // If we are resuming, and rotation has changed,
609 if( mIndicatorIsShown == false && mIndicatorOrientation != mNextIndicatorOrientation )
611 // then close current indicator and open new one
612 mShowRotatedIndicatorOnClose = true;
613 mIndicator->Close(); // May synchronously call IndicatorClosed() callback & 1 level of recursion
614 // Don't show actor - will contain indicator for old orientation.
619 // set indicator visible mode
620 if( mIndicator != NULL )
622 mIndicator->SetVisible( mIndicatorVisible );
625 bool show = (mIndicatorVisible != Dali::Window::INVISIBLE );
626 SetIndicatorProperties( show, lastOrientation );
627 mIndicatorIsShown = show;
630 void Window::DoRotateIndicator( Dali::Window::WindowOrientation orientation )
632 if( mIndicatorIsShown )
634 mShowRotatedIndicatorOnClose = true;
635 mNextIndicatorOrientation = orientation;
636 mIndicator->Close(); // May synchronously call IndicatorClosed() callback
640 // Save orientation for when the indicator is next shown
641 mShowRotatedIndicatorOnClose = false;
642 mNextIndicatorOrientation = orientation;
646 void Window::SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation )
648 ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
652 Ecore_Wl_Window* wlWindow = wlSurface->GetWlWindow();
655 ecore_wl_window_indicator_state_set(wlWindow, ECORE_WL_INDICATOR_STATE_ON);
659 ecore_wl_window_indicator_state_set(wlWindow, ECORE_WL_INDICATOR_STATE_OFF);
664 void Window::IndicatorTypeChanged(Indicator::Type type)
666 #if defined(DALI_PROFILE_MOBILE)
667 ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
671 Ecore_Wl_Window* wlWindow = wlSurface->GetWlWindow();
674 case Indicator::INDICATOR_TYPE_1:
675 ecore_wl_indicator_visible_type_set(wlWindow, ECORE_WL_INDICATOR_VISIBLE_TYPE_SHOWN);
678 case Indicator::INDICATOR_TYPE_2:
679 ecore_wl_indicator_visible_type_set(wlWindow, ECORE_WL_INDICATOR_VISIBLE_TYPE_HIDDEN);
682 case Indicator::INDICATOR_TYPE_UNKNOWN:
690 void Window::IndicatorClosed( IndicatorInterface* indicator )
692 DALI_LOG_TRACE_METHOD( gWindowLogFilter );
694 if( mShowRotatedIndicatorOnClose )
696 Dali::Window::WindowOrientation currentOrientation = mIndicatorOrientation;
697 mIndicator->Open(mNextIndicatorOrientation);
698 mIndicatorOrientation = mNextIndicatorOrientation;
699 SetIndicatorActorRotation();
700 DoShowIndicator(currentOrientation);
704 void Window::IndicatorVisibilityChanged(bool isVisible)
706 mIndicatorVisibilityChangedSignal.Emit(isVisible);
709 void Window::SetIndicatorActorRotation()
711 DALI_LOG_TRACE_METHOD( gWindowLogFilter );
712 DALI_ASSERT_DEBUG( mIndicator != NULL );
714 Dali::Actor actor = mIndicator->GetActor();
715 switch( mIndicatorOrientation )
717 case Dali::Window::PORTRAIT:
718 actor.SetParentOrigin( ParentOrigin::TOP_CENTER );
719 actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
720 actor.SetOrientation( Degree(0), Vector3::ZAXIS );
722 case Dali::Window::PORTRAIT_INVERSE:
723 actor.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
724 actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
725 actor.SetOrientation( Degree(180), Vector3::ZAXIS );
727 case Dali::Window::LANDSCAPE:
728 actor.SetParentOrigin( ParentOrigin::CENTER_LEFT );
729 actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
730 actor.SetOrientation( Degree(270), Vector3::ZAXIS );
732 case Dali::Window::LANDSCAPE_INVERSE:
733 actor.SetParentOrigin( ParentOrigin::CENTER_RIGHT );
734 actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
735 actor.SetOrientation( Degree(90), Vector3::ZAXIS );
742 // Use ecore_wl_window_activate to prevent the window shown without rendering
743 ecore_wl_window_activate( mEventHandler->mEcoreWindow );
748 ecore_wl_window_lower( mEventHandler->mEcoreWindow );
751 void Window::Activate()
753 ecore_wl_window_activate( mEventHandler->mEcoreWindow );
756 Dali::DragAndDropDetector Window::GetDragAndDropDetector() const
758 return mDragAndDropDetector;
761 Dali::Any Window::GetNativeHandle() const
765 return mEventHandler->mEcoreWindow;
773 void Window::OnStart()
775 DoShowIndicator( mIndicatorOrientation );
778 void Window::OnPause()
782 void Window::OnResume()
784 // resume indicator status
785 if( mIndicator != NULL )
787 // Restore own indicator opacity
788 // Send opacity mode to indicator service when app resumed
789 mIndicator->SetOpacityMode( mIndicatorOpacityMode );
793 void Window::OnStop()
804 void Window::OnDestroy()
809 void Window::AddAvailableOrientation(Dali::Window::WindowOrientation orientation)
813 for( std::size_t i=0; i<mAvailableOrientations.size(); i++ )
815 if(mAvailableOrientations[i] == orientation)
824 mAvailableOrientations.push_back(orientation);
825 SetAvailableOrientations( mAvailableOrientations );
829 void Window::RemoveAvailableOrientation(Dali::Window::WindowOrientation orientation)
831 for( std::vector<Dali::Window::WindowOrientation>::iterator iter = mAvailableOrientations.begin();
832 iter != mAvailableOrientations.end(); ++iter )
834 if( *iter == orientation )
836 mAvailableOrientations.erase( iter );
840 SetAvailableOrientations( mAvailableOrientations );
843 void Window::SetAvailableOrientations(const std::vector<Dali::Window::WindowOrientation>& orientations)
846 for( std::size_t i = 0; i < mAvailableOrientations.size(); ++i )
848 rotations[i] = static_cast< int >( mAvailableOrientations[i] );
850 ecore_wl_window_rotation_available_rotations_set( mEventHandler->mEcoreWindow, rotations, mAvailableOrientations.size() );
853 const std::vector<Dali::Window::WindowOrientation>& Window::GetAvailableOrientations()
855 return mAvailableOrientations;
858 void Window::SetPreferredOrientation(Dali::Window::WindowOrientation orientation)
860 mPreferredOrientation = orientation;
862 ecore_wl_window_rotation_preferred_rotation_set( mEventHandler->mEcoreWindow, orientation );
865 Dali::Window::WindowOrientation Window::GetPreferredOrientation()
867 return mPreferredOrientation;
870 void Window::SetAcceptFocus( bool accept )
872 mIsFocusAcceptable = accept;
874 ecore_wl_window_focus_skip_set( mEventHandler->mEcoreWindow, !accept );
877 bool Window::IsFocusAcceptable() const
879 return mIsFocusAcceptable;
885 ecore_wl_window_show( mEventHandler->mEcoreWindow );
891 WindowVisibilityObserver* observer( mAdaptor );
892 observer->OnWindowShown();
900 ecore_wl_window_hide( mEventHandler->mEcoreWindow );
906 WindowVisibilityObserver* observer( mAdaptor );
907 observer->OnWindowHidden();
912 bool Window::IsVisible() const
917 void Window::RotationDone( int orientation, int width, int height )
919 ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
922 wlSurface->RequestRotation( orientation, width, height );
925 mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( width, height ) );
928 mResizedSignal.Emit( Dali::Window::WindowSize( width, height ) );
930 mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( width, height ) );
933 void Window::SetIndicatorVisibleMode( Dali::Window::IndicatorVisibleMode mode )
935 mIndicatorVisible = mode;
938 unsigned int Window::GetSupportedAuxiliaryHintCount() const
940 return mSupportedAuxiliaryHints.size();
943 std::string Window::GetSupportedAuxiliaryHint( unsigned int index ) const
945 if( index >= GetSupportedAuxiliaryHintCount() )
947 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetSupportedAuxiliaryHint: Invalid index! [%d]\n", index );
950 return mSupportedAuxiliaryHints[index];
953 unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
955 bool supported = false;
957 // Check if the hint is suppported
958 for( std::vector< std::string >::iterator iter = mSupportedAuxiliaryHints.begin(); iter != mSupportedAuxiliaryHints.end(); ++iter )
969 DALI_LOG_INFO( gWindowLogFilter, Debug::Concise, "Window::AddAuxiliaryHint: Not supported auxiliary hint [%s]\n", hint.c_str() );
973 // Check if the hint is already added
974 for( unsigned int i = 0; i < mAuxiliaryHints.size(); i++ )
976 if( mAuxiliaryHints[i].first == hint )
978 // Just change the value
979 mAuxiliaryHints[i].second = value;
981 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::AddAuxiliaryHint: Change! hint = %s, value = %s, id = %d\n", hint.c_str(), value.c_str(), i + 1 );
983 return i + 1; // id is index + 1
988 mAuxiliaryHints.push_back( std::pair< std::string, std::string >( hint, value ) );
990 unsigned int id = mAuxiliaryHints.size();
992 ecore_wl_window_aux_hint_add( mEventHandler->mEcoreWindow, static_cast< int >( id ), hint.c_str(), value.c_str() );
994 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::AddAuxiliaryHint: hint = %s, value = %s, id = %d\n", hint.c_str(), value.c_str(), id );
999 bool Window::RemoveAuxiliaryHint( unsigned int id )
1001 if( id == 0 || id > mAuxiliaryHints.size() )
1003 DALI_LOG_INFO( gWindowLogFilter, Debug::Concise, "Window::RemoveAuxiliaryHint: Invalid id [%d]\n", id );
1007 mAuxiliaryHints[id - 1].second = std::string();
1009 ecore_wl_window_aux_hint_del( mEventHandler->mEcoreWindow, static_cast< int >( id ) );
1011 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::RemoveAuxiliaryHint: id = %d, hint = %s\n", id, mAuxiliaryHints[id - 1].first.c_str() );
1016 bool Window::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
1018 if( id == 0 || id > mAuxiliaryHints.size() )
1020 DALI_LOG_INFO( gWindowLogFilter, Debug::Concise, "Window::SetAuxiliaryHintValue: Invalid id [%d]\n", id );
1024 mAuxiliaryHints[id - 1].second = value;
1026 ecore_wl_window_aux_hint_change( mEventHandler->mEcoreWindow, static_cast< int >( id ), value.c_str() );
1028 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetAuxiliaryHintValue: id = %d, hint = %s, value = %s\n", id, mAuxiliaryHints[id - 1].first.c_str(), mAuxiliaryHints[id - 1].second.c_str() );
1033 std::string Window::GetAuxiliaryHintValue( unsigned int id ) const
1035 if( id == 0 || id > mAuxiliaryHints.size() )
1037 DALI_LOG_INFO( gWindowLogFilter, Debug::Concise, "Window::GetAuxiliaryHintValue: Invalid id [%d]\n", id );
1038 return std::string();
1041 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetAuxiliaryHintValue: id = %d, hint = %s, value = %s\n", id, mAuxiliaryHints[id - 1].first.c_str(), mAuxiliaryHints[id - 1].second.c_str() );
1043 return mAuxiliaryHints[id - 1].second;
1046 unsigned int Window::GetAuxiliaryHintId( const std::string& hint ) const
1048 for( unsigned int i = 0; i < mAuxiliaryHints.size(); i++ )
1050 if( mAuxiliaryHints[i].first == hint )
1052 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetAuxiliaryHintId: hint = %s, id = %d\n", hint.c_str(), i + 1 );
1057 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetAuxiliaryHintId: Invalid hint! [%s]\n", hint.c_str() );
1062 void Window::SetInputRegion( const Rect< int >& inputRegion )
1064 ecore_wl_window_input_region_set( mEventHandler->mEcoreWindow, inputRegion.x, inputRegion.y, inputRegion.width, inputRegion.height );
1066 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetInputRegion: x = %d, y = %d, w = %d, h = %d\n", inputRegion.x, inputRegion.y, inputRegion.width, inputRegion.height );
1069 void Window::SetType( Dali::Window::Type type )
1071 Ecore_Wl_Window_Type windowType;
1077 case Dali::Window::NORMAL:
1079 windowType = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
1082 case Dali::Window::NOTIFICATION:
1084 windowType = ECORE_WL_WINDOW_TYPE_NOTIFICATION;
1087 case Dali::Window::UTILITY:
1089 windowType = ECORE_WL_WINDOW_TYPE_UTILITY;
1092 case Dali::Window::DIALOG:
1094 windowType = ECORE_WL_WINDOW_TYPE_DIALOG;
1099 windowType = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
1104 ecore_wl_window_type_set( mEventHandler->mEcoreWindow, windowType );
1110 Dali::Window::Type Window::GetType() const
1115 bool Window::SetNotificationLevel( Dali::Window::NotificationLevel::Type level )
1117 if( mType != Dali::Window::NOTIFICATION )
1119 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetNotificationLevel: Not supported window type [%d]\n", mType );
1123 while( !mEventHandler->mTizenPolicy )
1125 wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
1128 int notificationLevel;
1132 case Dali::Window::NotificationLevel::NONE:
1134 notificationLevel = TIZEN_POLICY_LEVEL_NONE;
1137 case Dali::Window::NotificationLevel::BASE:
1139 notificationLevel = TIZEN_POLICY_LEVEL_DEFAULT;
1142 case Dali::Window::NotificationLevel::MEDIUM:
1144 notificationLevel = TIZEN_POLICY_LEVEL_MEDIUM;
1147 case Dali::Window::NotificationLevel::HIGH:
1149 notificationLevel = TIZEN_POLICY_LEVEL_HIGH;
1152 case Dali::Window::NotificationLevel::TOP:
1154 notificationLevel = TIZEN_POLICY_LEVEL_TOP;
1159 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetNotificationLevel: invalid level [%d]\n", level );
1160 notificationLevel = TIZEN_POLICY_LEVEL_DEFAULT;
1165 mEventHandler->mNotificationLevelChangeDone = false;
1166 mEventHandler->mNotificationChangeState = TIZEN_POLICY_ERROR_STATE_NONE;
1168 tizen_policy_set_notification_level( mEventHandler->mTizenPolicy, ecore_wl_window_surface_get( mEventHandler->mEcoreWindow ), notificationLevel );
1172 while( !mEventHandler->mNotificationLevelChangeDone && count < 3 )
1175 wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
1179 if( !mEventHandler->mNotificationLevelChangeDone )
1181 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetNotificationLevel: Level change is failed [%d, %d]\n", level, mEventHandler->mNotificationChangeState );
1184 else if( mEventHandler->mNotificationChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED )
1186 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetNotificationLevel: Permission denied! [%d]\n", level );
1190 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetNotificationLevel: Level is changed [%d]\n", mEventHandler->mNotificationLevel );
1195 Dali::Window::NotificationLevel::Type Window::GetNotificationLevel() const
1197 if( mType != Dali::Window::NOTIFICATION )
1199 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetNotificationLevel: Not supported window type [%d]\n", mType );
1200 return Dali::Window::NotificationLevel::NONE;
1203 while( !mEventHandler->mTizenPolicy )
1205 wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
1210 while( !mEventHandler->mNotificationLevelChangeDone && count < 3 )
1213 wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
1217 if( !mEventHandler->mNotificationLevelChangeDone )
1219 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetNotificationLevel: Error! [%d]\n", mEventHandler->mNotificationChangeState );
1220 return Dali::Window::NotificationLevel::NONE;
1223 Dali::Window::NotificationLevel::Type level;
1225 switch( mEventHandler->mNotificationLevel )
1227 case TIZEN_POLICY_LEVEL_NONE:
1229 level = Dali::Window::NotificationLevel::NONE;
1232 case TIZEN_POLICY_LEVEL_DEFAULT:
1234 level = Dali::Window::NotificationLevel::BASE;
1237 case TIZEN_POLICY_LEVEL_MEDIUM:
1239 level = Dali::Window::NotificationLevel::MEDIUM;
1242 case TIZEN_POLICY_LEVEL_HIGH:
1244 level = Dali::Window::NotificationLevel::HIGH;
1247 case TIZEN_POLICY_LEVEL_TOP:
1249 level = Dali::Window::NotificationLevel::TOP;
1254 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetNotificationLevel: invalid level [%d]\n", mEventHandler->mNotificationLevel );
1255 level = Dali::Window::NotificationLevel::NONE;
1260 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetNotificationLevel: level [%d]\n", mEventHandler->mNotificationLevel );
1265 void Window::SetOpaqueState( bool opaque )
1267 while( !mEventHandler->mTizenPolicy )
1269 wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
1272 tizen_policy_set_opaque_state( mEventHandler->mTizenPolicy, ecore_wl_window_surface_get( mEventHandler->mEcoreWindow ), ( opaque ? 1 : 0 ) );
1274 mOpaqueState = opaque;
1276 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetOpaqueState: opaque = %d\n", opaque );
1279 bool Window::IsOpaqueState() const
1281 return mOpaqueState;
1284 bool Window::SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode)
1286 while( !mEventHandler->mTizenPolicy )
1288 wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
1291 mEventHandler->mScreenOffModeChangeDone = false;
1292 mEventHandler->mScreenOffModeChangeState = TIZEN_POLICY_ERROR_STATE_NONE;
1294 unsigned int mode = 0;
1296 switch( screenOffMode )
1298 case Dali::Window::ScreenOffMode::TIMEOUT:
1303 case Dali::Window::ScreenOffMode::NEVER:
1310 tizen_policy_set_window_screen_mode( mEventHandler->mTizenPolicy, ecore_wl_window_surface_get( mEventHandler->mEcoreWindow ), mode );
1314 while( !mEventHandler->mScreenOffModeChangeDone && count < 3 )
1317 wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
1321 if( !mEventHandler->mScreenOffModeChangeDone )
1323 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetScreenOffMode: Screen mode change is failed [%d, %d]\n", screenOffMode, mEventHandler->mScreenOffModeChangeState );
1326 else if( mEventHandler->mScreenOffModeChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED )
1328 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetScreenOffMode: Permission denied! [%d]\n", screenOffMode );
1332 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetScreenOffMode: Screen mode is changed [%d]\n", mEventHandler->mScreenOffMode );
1337 Dali::Window::ScreenOffMode::Type Window::GetScreenOffMode() const
1339 while( !mEventHandler->mTizenPolicy )
1341 wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
1346 while( !mEventHandler->mScreenOffModeChangeDone && count < 3 )
1349 wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
1353 if( !mEventHandler->mScreenOffModeChangeDone )
1355 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetScreenOffMode: Error! [%d]\n", mEventHandler->mScreenOffModeChangeState );
1356 return Dali::Window::ScreenOffMode::TIMEOUT;
1359 Dali::Window::ScreenOffMode::Type screenMode = Dali::Window::ScreenOffMode::TIMEOUT;
1361 switch( mEventHandler->mScreenOffMode )
1365 screenMode = Dali::Window::ScreenOffMode::TIMEOUT;
1370 screenMode = Dali::Window::ScreenOffMode::NEVER;
1375 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetScreenOffMode: screen mode [%d]\n", mEventHandler->mScreenOffMode );
1380 bool Window::SetBrightness( int brightness )
1382 if( brightness < 0 || brightness > 100 )
1384 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetBrightness: Invalid brightness value [%d]\n", brightness );
1388 while( !mEventHandler->mTizenDisplayPolicy )
1390 wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
1393 mEventHandler->mBrightnessChangeDone = false;
1394 mEventHandler->mBrightnessChangeState = TIZEN_POLICY_ERROR_STATE_NONE;
1396 tizen_display_policy_set_window_brightness( mEventHandler->mTizenDisplayPolicy, ecore_wl_window_surface_get( mEventHandler->mEcoreWindow ), brightness );
1400 while( !mEventHandler->mBrightnessChangeDone && count < 3 )
1403 wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
1407 if( !mEventHandler->mBrightnessChangeDone )
1409 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetBrightness: Brightness change is failed [%d, %d]\n", brightness, mEventHandler->mBrightnessChangeState );
1412 else if( mEventHandler->mBrightnessChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED )
1414 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetBrightness: Permission denied! [%d]\n", brightness );
1418 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::SetBrightness: Brightness is changed [%d]\n", mEventHandler->mBrightness );
1423 int Window::GetBrightness() const
1425 while( !mEventHandler->mTizenDisplayPolicy )
1427 wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
1432 while( !mEventHandler->mBrightnessChangeDone && count < 3 )
1435 wl_display_dispatch_queue( mEventHandler->mDisplay, mEventHandler->mEventQueue );
1439 if( !mEventHandler->mBrightnessChangeDone )
1441 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetBrightness: Error! [%d]\n", mEventHandler->mBrightnessChangeState );
1445 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetBrightness: Brightness [%d]\n", mEventHandler->mBrightness );
1447 return mEventHandler->mBrightness;
1450 void Window::SetSize( Dali::Window::WindowSize size )
1452 if( !mResizeEnabled )
1454 AddAuxiliaryHint( "wm.policy.win.user.geometry", "1" );
1455 mResizeEnabled = true;
1458 PositionSize positionSize = mSurface->GetPositionSize();
1460 if( positionSize.width != size.GetWidth() || positionSize.height != size.GetHeight() )
1462 positionSize.width = size.GetWidth();
1463 positionSize.height = size.GetHeight();
1465 mSurface->MoveResize( positionSize );
1467 mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
1470 mResizedSignal.Emit( Dali::Window::WindowSize( positionSize.width, positionSize.height ) );
1472 mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
1476 Dali::Window::WindowSize Window::GetSize() const
1478 PositionSize positionSize = mSurface->GetPositionSize();
1480 return Dali::Window::WindowSize( positionSize.width, positionSize.height );
1483 void Window::SetPosition( Dali::Window::WindowPosition position )
1485 if( !mResizeEnabled )
1487 AddAuxiliaryHint( "wm.policy.win.user.geometry", "1" );
1488 mResizeEnabled = true;
1491 PositionSize positionSize = mSurface->GetPositionSize();
1493 if( positionSize.x != position.GetX() || positionSize.y != position.GetY() )
1495 positionSize.x = position.GetX();
1496 positionSize.y = position.GetY();
1498 mSurface->MoveResize( positionSize );
1502 Dali::Window::WindowPosition Window::GetPosition() const
1504 PositionSize positionSize = mSurface->GetPositionSize();
1506 return Dali::Window::WindowPosition( positionSize.x, positionSize.y );
1509 void Window::SetTransparency( bool transparent )
1511 ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
1514 wlSurface->SetTransparency( transparent );
1524 #pragma GCC diagnostic pop