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>
23 #include <Ecore_Wayland.h>
25 #include <dali/integration-api/core.h>
26 #include <dali/integration-api/system-overlay.h>
27 #include <dali/public-api/render-tasks/render-task.h>
28 #include <dali/public-api/render-tasks/render-task-list.h>
29 #include <orientation.h>
32 #include <window-render-surface.h>
33 #include <drag-and-drop-detector-impl.h>
34 #include <ecore-indicator-impl.h>
35 #include <window-visibility-observer.h>
36 #include <orientation-impl.h>
40 const float INDICATOR_ANIMATION_DURATION( 0.18f ); // 180 milli seconds
41 const float INDICATOR_SHOW_Y_POSITION( 0.0f );
42 const float INDICATOR_HIDE_Y_POSITION( -52.0f );
51 #if defined(DEBUG_ENABLED)
52 Debug::Filter* gWindowLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_WINDOW");
56 * TODO: Abstract Window class out and move this into a window implementation for Ecore
58 struct Window::EventHandler
62 * @param[in] window A pointer to the window class.
64 EventHandler( Window* window )
66 mWindowPropertyHandler( NULL ),
67 mWindowIconifyStateHandler( NULL ),
68 mWindowFocusInHandler( NULL ),
69 mWindowFocusOutHandler( NULL ),
72 // store ecore window handle
73 ECore::WindowRenderSurface* wlWindow( dynamic_cast< ECore::WindowRenderSurface * >( mWindow->mSurface ) );
76 mEcoreWindow = wlWindow->GetWlWindow();
78 DALI_ASSERT_ALWAYS( mEcoreWindow != 0 && "There is no ecore Wl window");
80 if( mWindow->mEcoreEventHander )
82 mWindowIconifyStateHandler = ecore_event_handler_add( ECORE_WL_EVENT_WINDOW_ICONIFY_STATE_CHANGE, EcoreEventWindowIconifyStateChanged, this );
83 mWindowFocusInHandler = ecore_event_handler_add( ECORE_WL_EVENT_FOCUS_IN, EcoreEventWindowFocusIn, this );
84 mWindowFocusOutHandler = ecore_event_handler_add( ECORE_WL_EVENT_FOCUS_OUT, EcoreEventWindowFocusOut, this );
93 if ( mWindowPropertyHandler )
95 ecore_event_handler_del( mWindowPropertyHandler );
97 if ( mWindowIconifyStateHandler )
99 ecore_event_handler_del( mWindowIconifyStateHandler );
101 if( mWindowFocusInHandler )
103 ecore_event_handler_del( mWindowFocusInHandler );
105 if( mWindowFocusOutHandler )
107 ecore_event_handler_del( mWindowFocusOutHandler );
113 /// Called when the window properties are changed.
114 static Eina_Bool EcoreEventWindowPropertyChanged( void* data, int type, void* event )
119 /// Called when the window iconify state is changed.
120 static Eina_Bool EcoreEventWindowIconifyStateChanged( void* data, int type, void* event )
122 Ecore_Wl_Event_Window_Iconify_State_Change* iconifyChangedEvent( static_cast< Ecore_Wl_Event_Window_Iconify_State_Change* >( event ) );
123 EventHandler* handler( static_cast< EventHandler* >( data ) );
124 Eina_Bool handled( ECORE_CALLBACK_PASS_ON );
126 if ( handler && handler->mWindow )
128 WindowVisibilityObserver* observer( handler->mWindow->mAdaptor );
129 if ( observer && ( iconifyChangedEvent->win == static_cast< unsigned int> ( ecore_wl_window_id_get( handler->mEcoreWindow ) ) ) )
131 if( iconifyChangedEvent->iconified == EINA_TRUE )
133 observer->OnWindowHidden();
134 DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%d) Iconfied\n", handler->mEcoreWindow );
138 observer->OnWindowShown();
139 DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%d) Shown\n", handler->mEcoreWindow );
141 handled = ECORE_CALLBACK_DONE;
148 /// Called when the window gains focus
149 static Eina_Bool EcoreEventWindowFocusIn( void* data, int type, void* event )
151 Ecore_Wl_Event_Focus_In* focusInEvent( static_cast< Ecore_Wl_Event_Focus_In* >( event ) );
152 EventHandler* handler( static_cast< EventHandler* >( data ) );
154 if ( handler && handler->mWindow && focusInEvent->win == static_cast< unsigned int >( ecore_wl_window_id_get( handler->mEcoreWindow ) ) )
156 DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window EcoreEventWindowFocusIn\n" );
158 handler->mWindow->mFocusChangedSignal.Emit( true );
161 return ECORE_CALLBACK_PASS_ON;
164 /// Called when the window loses focus
165 static Eina_Bool EcoreEventWindowFocusOut( void* data, int type, void* event )
167 Ecore_Wl_Event_Focus_Out* focusOutEvent( static_cast< Ecore_Wl_Event_Focus_Out* >( event ) );
168 EventHandler* handler( static_cast< EventHandler* >( data ) );
170 if ( handler && handler->mWindow && focusOutEvent->win == static_cast< unsigned int >(ecore_wl_window_id_get( handler->mEcoreWindow ) ) )
172 DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window EcoreEventWindowFocusOut\n" );
174 handler->mWindow->mFocusChangedSignal.Emit( false );
177 return ECORE_CALLBACK_PASS_ON;
182 Ecore_Event_Handler* mWindowPropertyHandler;
183 Ecore_Event_Handler* mWindowIconifyStateHandler;
184 Ecore_Event_Handler* mWindowFocusInHandler;
185 Ecore_Event_Handler* mWindowFocusOutHandler;
186 Ecore_Wl_Window* mEcoreWindow;
189 Window* Window::New(const PositionSize& posSize, const std::string& name, const std::string& className, bool isTransparent)
191 Window* window = new Window();
192 window->mIsTransparent = isTransparent;
193 window->Initialize(posSize, name, className);
197 void Window::SetAdaptor(Dali::Adaptor& adaptor)
199 DALI_ASSERT_ALWAYS( !mStarted && "Adaptor already started" );
202 // Only create one overlay per window
203 Internal::Adaptor::Adaptor& adaptorImpl = Internal::Adaptor::Adaptor::GetImplementation(adaptor);
204 Integration::Core& core = adaptorImpl.GetCore();
205 mOverlay = &core.GetSystemOverlay();
207 Dali::RenderTaskList taskList = mOverlay->GetOverlayRenderTasks();
208 taskList.CreateTask();
210 mAdaptor = &adaptorImpl;
211 mAdaptor->AddObserver( *this );
213 // Can only create the detector when we know the Core has been instantiated.
214 mDragAndDropDetector = DragAndDropDetector::New();
215 mAdaptor->SetDragAndDropDetector( &GetImplementation( mDragAndDropDetector ) );
219 mOrientation->SetAdaptor(adaptor);
222 if( mIndicator != NULL )
224 mIndicator->SetAdaptor(mAdaptor);
228 RenderSurface* Window::GetSurface()
233 void Window::ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode )
235 DALI_LOG_TRACE_METHOD_FMT( gWindowLogFilter, "visible : %d\n", visibleMode );
236 DALI_ASSERT_DEBUG(mOverlay);
238 ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
239 DALI_ASSERT_DEBUG(wlSurface);
243 Ecore_Wl_Window* wlWindow = wlSurface->GetWlWindow();
245 mIndicatorVisible = visibleMode;
247 if ( mIndicatorVisible == Dali::Window::VISIBLE )
249 // when the indicator is visible, set proper mode for indicator server according to bg mode
250 if ( mIndicatorOpacityMode == Dali::Window::OPAQUE )
252 ecore_wl_window_indicator_opacity_set(wlWindow, ECORE_WL_INDICATOR_OPAQUE);
254 else if ( mIndicatorOpacityMode == Dali::Window::TRANSLUCENT )
256 ecore_wl_window_indicator_opacity_set(wlWindow, ECORE_WL_INDICATOR_TRANSLUCENT);
258 else if ( mIndicatorOpacityMode == Dali::Window::TRANSPARENT )
260 ecore_wl_window_indicator_opacity_set(wlWindow, ECORE_WL_INDICATOR_OPAQUE);
265 // when the indicator is not visible, set TRANSPARENT mode for indicator server
266 ecore_wl_window_indicator_opacity_set(wlWindow, ECORE_WL_INDICATOR_TRANSPARENT); // it means hidden indicator
270 DoShowIndicator( mIndicatorOrientation );
273 void Window::RotateIndicator( Dali::Window::WindowOrientation orientation )
275 DALI_LOG_TRACE_METHOD_FMT( gWindowLogFilter, "Orientation: %d\n", orientation );
277 DoRotateIndicator( orientation );
280 void Window::SetIndicatorBgOpacity( Dali::Window::IndicatorBgOpacity opacityMode )
282 mIndicatorOpacityMode = opacityMode;
284 if( mIndicator != NULL )
286 mIndicator->SetOpacityMode( opacityMode );
290 void Window::SetClass(std::string name, std::string klass)
292 ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
296 Ecore_Wl_Window* wlWindow = wlSurface->GetWlWindow();
297 ecore_wl_window_title_set( wlWindow, name.c_str() );
298 ecore_wl_window_class_name_set( wlWindow, klass.c_str() );
302 DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window has no surface\n" );
308 mIndicatorVisible( Dali::Window::VISIBLE ),
309 mIndicatorIsShown( false ),
310 mShowRotatedIndicatorOnClose( false ),
312 mIsTransparent( false ),
313 mWMRotationAppSet( false ),
314 mEcoreEventHander( true ),
315 mIsFocusAcceptable( true ),
318 mIndicatorOrientation( Dali::Window::PORTRAIT ),
319 mNextIndicatorOrientation( Dali::Window::PORTRAIT ),
320 mIndicatorOpacityMode( Dali::Window::OPAQUE ),
323 mEventHandler( NULL ),
324 mPreferredOrientation( Dali::Window::PORTRAIT ),
325 mSupportedAuxiliaryHints(),
332 delete mEventHandler;
342 mAdaptor->RemoveObserver( *this );
343 mAdaptor->SetDragAndDropDetector( NULL );
349 mSupportedAuxiliaryHints.clear();
350 mAuxiliaryHints.clear();
353 void Window::Initialize(const PositionSize& windowPosition, const std::string& name, const std::string& className)
355 // create an Wayland window by default
357 ECore::WindowRenderSurface* windowSurface = new ECore::WindowRenderSurface( windowPosition, surface, name, mIsTransparent );
359 mSurface = windowSurface;
360 SetClass( name, className );
361 windowSurface->Map();
363 mOrientation = Orientation::New(this);
365 // create event handler for Wayland window
366 mEventHandler = new EventHandler( this );
368 // get auxiliary hint
369 Eina_List* hints = ecore_wl_window_aux_hints_supported_get( mEventHandler->mEcoreWindow );
375 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) ) ) )
377 mSupportedAuxiliaryHints.push_back( hint );
379 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::Initialize: %s\n", hint );
384 void Window::DoShowIndicator( Dali::Window::WindowOrientation lastOrientation )
386 if( mIndicator == NULL )
388 if( mIndicatorVisible != Dali::Window::INVISIBLE )
390 mIndicator = new Indicator( mAdaptor, mIndicatorOrientation, this );
391 mIndicator->SetOpacityMode( mIndicatorOpacityMode );
392 Dali::Actor actor = mIndicator->GetActor();
393 SetIndicatorActorRotation();
394 mOverlay->Add(actor);
396 // else don't create a hidden indicator
398 else // Already have indicator
400 if( mIndicatorVisible == Dali::Window::VISIBLE )
402 // If we are resuming, and rotation has changed,
403 if( mIndicatorIsShown == false && mIndicatorOrientation != mNextIndicatorOrientation )
405 // then close current indicator and open new one
406 mShowRotatedIndicatorOnClose = true;
407 mIndicator->Close(); // May synchronously call IndicatorClosed() callback & 1 level of recursion
408 // Don't show actor - will contain indicator for old orientation.
413 // set indicator visible mode
414 if( mIndicator != NULL )
416 mIndicator->SetVisible( mIndicatorVisible );
419 bool show = (mIndicatorVisible != Dali::Window::INVISIBLE );
420 SetIndicatorProperties( show, lastOrientation );
421 mIndicatorIsShown = show;
424 void Window::DoRotateIndicator( Dali::Window::WindowOrientation orientation )
426 if( mIndicatorIsShown )
428 mShowRotatedIndicatorOnClose = true;
429 mNextIndicatorOrientation = orientation;
430 mIndicator->Close(); // May synchronously call IndicatorClosed() callback
434 // Save orientation for when the indicator is next shown
435 mShowRotatedIndicatorOnClose = false;
436 mNextIndicatorOrientation = orientation;
440 void Window::SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation )
442 ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
446 Ecore_Wl_Window* wlWindow = wlSurface->GetWlWindow();
449 ecore_wl_window_indicator_state_set(wlWindow, ECORE_WL_INDICATOR_STATE_ON);
453 ecore_wl_window_indicator_state_set(wlWindow, ECORE_WL_INDICATOR_STATE_OFF);
458 void Window::IndicatorTypeChanged(Indicator::Type type)
460 #if defined(DALI_PROFILE_MOBILE)
461 ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
465 Ecore_Wl_Window* wlWindow = wlSurface->GetWlWindow();
468 case Indicator::INDICATOR_TYPE_1:
469 ecore_wl_indicator_visible_type_set(wlWindow, ECORE_WL_INDICATOR_VISIBLE_TYPE_SHOWN);
472 case Indicator::INDICATOR_TYPE_2:
473 ecore_wl_indicator_visible_type_set(wlWindow, ECORE_WL_INDICATOR_VISIBLE_TYPE_HIDDEN);
476 case Indicator::INDICATOR_TYPE_UNKNOWN:
484 void Window::IndicatorClosed( IndicatorInterface* indicator )
486 DALI_LOG_TRACE_METHOD( gWindowLogFilter );
488 if( mShowRotatedIndicatorOnClose )
490 Dali::Window::WindowOrientation currentOrientation = mIndicatorOrientation;
491 mIndicator->Open(mNextIndicatorOrientation);
492 mIndicatorOrientation = mNextIndicatorOrientation;
493 SetIndicatorActorRotation();
494 DoShowIndicator(currentOrientation);
498 void Window::IndicatorVisibilityChanged(bool isVisible)
500 mIndicatorVisibilityChangedSignal.Emit(isVisible);
503 void Window::SetIndicatorActorRotation()
505 DALI_LOG_TRACE_METHOD( gWindowLogFilter );
506 DALI_ASSERT_DEBUG( mIndicator != NULL );
508 Dali::Actor actor = mIndicator->GetActor();
509 switch( mIndicatorOrientation )
511 case Dali::Window::PORTRAIT:
512 actor.SetParentOrigin( ParentOrigin::TOP_CENTER );
513 actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
514 actor.SetOrientation( Degree(0), Vector3::ZAXIS );
516 case Dali::Window::PORTRAIT_INVERSE:
517 actor.SetParentOrigin( ParentOrigin::BOTTOM_CENTER );
518 actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
519 actor.SetOrientation( Degree(180), Vector3::ZAXIS );
521 case Dali::Window::LANDSCAPE:
522 actor.SetParentOrigin( ParentOrigin::CENTER_LEFT );
523 actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
524 actor.SetOrientation( Degree(270), Vector3::ZAXIS );
526 case Dali::Window::LANDSCAPE_INVERSE:
527 actor.SetParentOrigin( ParentOrigin::CENTER_RIGHT );
528 actor.SetAnchorPoint( AnchorPoint::TOP_CENTER );
529 actor.SetOrientation( Degree(90), Vector3::ZAXIS );
536 ecore_wl_window_raise( mEventHandler->mEcoreWindow );
541 ecore_wl_window_lower( mEventHandler->mEcoreWindow );
544 void Window::Activate()
546 ecore_wl_window_activate( mEventHandler->mEcoreWindow );
549 Dali::DragAndDropDetector Window::GetDragAndDropDetector() const
551 return mDragAndDropDetector;
554 Dali::Any Window::GetNativeHandle() const
558 return mEventHandler->mEcoreWindow;
566 void Window::OnStart()
568 DoShowIndicator( mIndicatorOrientation );
571 void Window::OnPause()
575 void Window::OnResume()
577 // resume indicator status
578 if( mIndicator != NULL )
580 // Restore own indicator opacity
581 // Send opacity mode to indicator service when app resumed
582 mIndicator->SetOpacityMode( mIndicatorOpacityMode );
586 void Window::OnStop()
597 void Window::OnDestroy()
602 void Window::AddAvailableOrientation(Dali::Window::WindowOrientation orientation)
606 for( std::size_t i=0; i<mAvailableOrientations.size(); i++ )
608 if(mAvailableOrientations[i] == orientation)
617 mAvailableOrientations.push_back(orientation);
618 SetAvailableOrientations( mAvailableOrientations );
622 void Window::RemoveAvailableOrientation(Dali::Window::WindowOrientation orientation)
624 for( std::vector<Dali::Window::WindowOrientation>::iterator iter = mAvailableOrientations.begin();
625 iter != mAvailableOrientations.end(); ++iter )
627 if( *iter == orientation )
629 mAvailableOrientations.erase( iter );
633 SetAvailableOrientations( mAvailableOrientations );
636 void Window::SetAvailableOrientations(const std::vector<Dali::Window::WindowOrientation>& orientations)
639 for( std::size_t i = 0; i < mAvailableOrientations.size(); ++i )
641 rotations[i] = static_cast< int >( mAvailableOrientations[i] );
643 ecore_wl_window_rotation_available_rotations_set( mEventHandler->mEcoreWindow, rotations, mAvailableOrientations.size() );
646 const std::vector<Dali::Window::WindowOrientation>& Window::GetAvailableOrientations()
648 return mAvailableOrientations;
651 void Window::SetPreferredOrientation(Dali::Window::WindowOrientation orientation)
653 mPreferredOrientation = orientation;
655 ecore_wl_window_rotation_preferred_rotation_set( mEventHandler->mEcoreWindow, orientation );
658 Dali::Window::WindowOrientation Window::GetPreferredOrientation()
660 return mPreferredOrientation;
663 void Window::SetAcceptFocus( bool accept )
665 mIsFocusAcceptable = accept;
667 ecore_wl_window_focus_skip_set( mEventHandler->mEcoreWindow, !accept );
670 bool Window::IsFocusAcceptable()
672 return mIsFocusAcceptable;
678 ecore_wl_window_show( mEventHandler->mEcoreWindow );
680 // Need an update request
683 mAdaptor->RequestUpdateOnce();
690 ecore_wl_window_hide( mEventHandler->mEcoreWindow );
693 bool Window::IsVisible() const
698 void Window::RotationDone( int orientation, int width, int height )
700 ecore_wl_window_rotation_change_done_send( mEventHandler->mEcoreWindow );
703 unsigned int Window::GetSupportedAuxiliaryHintCount()
705 return mSupportedAuxiliaryHints.size();
708 std::string Window::GetSupportedAuxiliaryHint( unsigned int index )
710 if( index >= GetSupportedAuxiliaryHintCount() )
712 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetSupportedAuxiliaryHint: Invalid index! [%d]\n", index );
715 return mSupportedAuxiliaryHints[index];
718 unsigned int Window::AddAuxiliaryHint( const std::string& hint, const std::string& value )
720 bool supported = false;
722 // Check if the hint is suppported
723 for( std::vector< std::string >::iterator iter = mSupportedAuxiliaryHints.begin(); iter != mSupportedAuxiliaryHints.end(); ++iter )
734 DALI_LOG_INFO( gWindowLogFilter, Debug::Concise, "Window::AddAuxiliaryHint: Not supported auxiliary hint [%s]\n", hint.c_str() );
738 // Check if the hint is already added
739 for( unsigned int i = 0; i < mAuxiliaryHints.size(); i++ )
741 if( mAuxiliaryHints[i].first == hint )
743 // Just change the value
744 mAuxiliaryHints[i].second = value;
746 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::AddAuxiliaryHint: Change! hint = %s, value = %s, id = %d\n", hint.c_str(), value.c_str(), i + 1 );
748 return i + 1; // id is index + 1
753 mAuxiliaryHints.push_back( std::pair< std::string, std::string >( hint, value ) );
755 unsigned int id = mAuxiliaryHints.size();
757 ecore_wl_window_aux_hint_add( mEventHandler->mEcoreWindow, static_cast< int >( id ), hint.c_str(), value.c_str() );
759 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::AddAuxiliaryHint: hint = %s, value = %s, id = %d\n", hint.c_str(), value.c_str(), id );
764 bool Window::RemoveAuxiliaryHint( unsigned int id )
766 if( id == 0 || id > mAuxiliaryHints.size() )
768 DALI_LOG_INFO( gWindowLogFilter, Debug::Concise, "Window::RemoveAuxiliaryHint: Invalid id [%d]\n", id );
772 mAuxiliaryHints[id - 1].second = std::string();
774 ecore_wl_window_aux_hint_del( mEventHandler->mEcoreWindow, static_cast< int >( id ) );
776 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::RemoveAuxiliaryHint: id = %d, hint = %s\n", id, mAuxiliaryHints[id - 1].first.c_str() );
781 bool Window::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
783 if( id == 0 || id > mAuxiliaryHints.size() )
785 DALI_LOG_INFO( gWindowLogFilter, Debug::Concise, "Window::SetAuxiliaryHintValue: Invalid id [%d]\n", id );
789 mAuxiliaryHints[id - 1].second = value;
791 ecore_wl_window_aux_hint_change( mEventHandler->mEcoreWindow, static_cast< int >( id ), value.c_str() );
793 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() );
798 std::string Window::GetAuxiliaryHintValue( unsigned int id ) const
800 if( id == 0 || id > mAuxiliaryHints.size() )
802 DALI_LOG_INFO( gWindowLogFilter, Debug::Concise, "Window::GetAuxiliaryHintValue: Invalid id [%d]\n", id );
803 return std::string();
806 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() );
808 return mAuxiliaryHints[id - 1].second;
811 unsigned int Window::GetAuxiliaryHintId( const std::string& hint ) const
813 for( unsigned int i = 0; i < mAuxiliaryHints.size(); i++ )
815 if( mAuxiliaryHints[i].first == hint )
817 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetAuxiliaryHintId: hint = %s, id = %d\n", hint.c_str(), i + 1 );
822 DALI_LOG_INFO( gWindowLogFilter, Debug::Verbose, "Window::GetAuxiliaryHintId: Invalid hint! [%s]\n", hint.c_str() );
827 void Window::SetInputRegion( const Rect< int >& inputRegion )
829 ecore_wl_window_input_region_set( mEventHandler->mEcoreWindow, inputRegion.x, inputRegion.y, inputRegion.width, inputRegion.height );
831 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 );