2 * Copyright (c) 2018 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.
18 // Ecore is littered with C style cast
19 #pragma GCC diagnostic push
20 #pragma GCC diagnostic ignored "-Wold-style-cast"
23 #include <dali/internal/window-system/tizen-wayland/ecore-wl/window-base-ecore-wl.h>
26 #include <dali/internal/window-system/common/window-impl.h>
27 #include <dali/internal/window-system/common/window-system.h>
28 #include <dali/internal/window-system/common/window-render-surface.h>
29 #include <dali/internal/input/common/key-impl.h>
32 #include <dali/public-api/object/any.h>
33 #include <dali/integration-api/debug.h>
34 #include <Ecore_Input.h>
36 #include <vconf-keys.h>
50 #if defined(DEBUG_ENABLED)
51 Debug::Filter* gWindowBaseLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_WINDOW_BASE" );
54 const uint32_t MAX_TIZEN_CLIENT_VERSION = 7;
55 const unsigned int PRIMARY_TOUCH_BUTTON_ID = 1;
57 const char* DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME = "db/setting/accessibility/font_name"; // It will be update at vconf-key.h and replaced.
60 const char* BUS = "org.enlightenment.wm-screen-reader";
61 const char* INTERFACE = "org.tizen.GestureNavigation";
62 const char* PATH = "/org/tizen/GestureNavigation";
65 * Get the device name from the provided ecore key event
67 void GetDeviceName( Ecore_Event_Key* keyEvent, std::string& result )
69 const char* ecoreDeviceName = ecore_device_name_get( keyEvent->dev );
73 result = ecoreDeviceName;
78 * Get the device class from the provided ecore event
80 void GetDeviceClass( Ecore_Device_Class ecoreDeviceClass, Device::Class::Type& deviceClass )
82 switch( ecoreDeviceClass )
84 case ECORE_DEVICE_CLASS_SEAT:
86 deviceClass = Device::Class::USER;
89 case ECORE_DEVICE_CLASS_KEYBOARD:
91 deviceClass = Device::Class::KEYBOARD;
94 case ECORE_DEVICE_CLASS_MOUSE:
96 deviceClass = Device::Class::MOUSE;
99 case ECORE_DEVICE_CLASS_TOUCH:
101 deviceClass = Device::Class::TOUCH;
104 case ECORE_DEVICE_CLASS_PEN:
106 deviceClass = Device::Class::PEN;
109 case ECORE_DEVICE_CLASS_POINTER:
111 deviceClass = Device::Class::POINTER;
114 case ECORE_DEVICE_CLASS_GAMEPAD:
116 deviceClass = Device::Class::GAMEPAD;
121 deviceClass = Device::Class::NONE;
127 void GetDeviceSubclass( Ecore_Device_Subclass ecoreDeviceSubclass, Device::Subclass::Type& deviceSubclass )
129 switch( ecoreDeviceSubclass )
131 case ECORE_DEVICE_SUBCLASS_FINGER:
133 deviceSubclass = Device::Subclass::FINGER;
136 case ECORE_DEVICE_SUBCLASS_FINGERNAIL:
138 deviceSubclass = Device::Subclass::FINGERNAIL;
141 case ECORE_DEVICE_SUBCLASS_KNUCKLE:
143 deviceSubclass = Device::Subclass::KNUCKLE;
146 case ECORE_DEVICE_SUBCLASS_PALM:
148 deviceSubclass = Device::Subclass::PALM;
151 case ECORE_DEVICE_SUBCLASS_HAND_SIZE:
153 deviceSubclass = Device::Subclass::HAND_SIDE;
156 case ECORE_DEVICE_SUBCLASS_HAND_FLAT:
158 deviceSubclass = Device::Subclass::HAND_FLAT;
161 case ECORE_DEVICE_SUBCLASS_PEN_TIP:
163 deviceSubclass = Device::Subclass::PEN_TIP;
166 case ECORE_DEVICE_SUBCLASS_TRACKPAD:
168 deviceSubclass = Device::Subclass::TRACKPAD;
171 case ECORE_DEVICE_SUBCLASS_TRACKPOINT:
173 deviceSubclass = Device::Subclass::TRACKPOINT;
176 case ECORE_DEVICE_SUBCLASS_TRACKBALL:
178 deviceSubclass = Device::Subclass::TRACKBALL;
181 #ifdef OVER_TIZEN_VERSION_4
182 case ECORE_DEVICE_SUBCLASS_REMOCON:
184 deviceSubclass = Device::Subclass::REMOCON;
187 case ECORE_DEVICE_SUBCLASS_VIRTUAL_KEYBOARD:
189 deviceSubclass = Device::Subclass::VIRTUAL_KEYBOARD;
195 deviceSubclass = Device::Subclass::NONE;
201 /////////////////////////////////////////////////////////////////////////////////////////////////
203 /////////////////////////////////////////////////////////////////////////////////////////////////
205 /// Called when the window iconify state is changed.
206 static Eina_Bool EcoreEventWindowIconifyStateChanged( void* data, int type, void* event )
208 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
211 return windowBase->OnIconifyStateChanged( data, type, event );
214 return ECORE_CALLBACK_PASS_ON;
217 /// Called when the window gains focus
218 static Eina_Bool EcoreEventWindowFocusIn( void* data, int type, void* event )
220 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
223 return windowBase->OnFocusIn( data, type, event );
226 return ECORE_CALLBACK_PASS_ON;
229 /// Called when the window loses focus
230 static Eina_Bool EcoreEventWindowFocusOut( void* data, int type, void* event )
232 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
235 return windowBase->OnFocusOut( data, type, event );
238 return ECORE_CALLBACK_PASS_ON;
241 /// Called when the output is transformed
242 static Eina_Bool EcoreEventOutputTransform( void* data, int type, void* event )
244 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
247 return windowBase->OnOutputTransform( data, type, event );
250 return ECORE_CALLBACK_PASS_ON;
253 /// Called when the output transform should be ignored
254 static Eina_Bool EcoreEventIgnoreOutputTransform( void* data, int type, void* event )
256 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
259 return windowBase->OnIgnoreOutputTransform( data, type, event );
262 return ECORE_CALLBACK_PASS_ON;
266 * Called when rotate event is recevied.
268 static Eina_Bool EcoreEventRotate( void* data, int type, void* event )
270 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
273 windowBase->OnRotation( data, type, event );
275 return ECORE_CALLBACK_PASS_ON;
278 /////////////////////////////////////////////////////////////////////////////////////////////////
280 /////////////////////////////////////////////////////////////////////////////////////////////////
283 * Called when a touch down is received.
285 static Eina_Bool EcoreEventMouseButtonDown( void* data, int type, void* event )
287 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
290 windowBase->OnMouseButtonDown( data, type, event );
292 return ECORE_CALLBACK_PASS_ON;
296 * Called when a touch up is received.
298 static Eina_Bool EcoreEventMouseButtonUp( void* data, int type, void* event )
300 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
303 windowBase->OnMouseButtonUp( data, type, event );
305 return ECORE_CALLBACK_PASS_ON;
309 * Called when a touch motion is received.
311 static Eina_Bool EcoreEventMouseButtonMove( void* data, int type, void* event )
313 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
316 windowBase->OnMouseButtonMove( data, type, event );
318 return ECORE_CALLBACK_PASS_ON;
322 * Called when a touch is canceled.
324 static Eina_Bool EcoreEventMouseButtonCancel( void* data, int type, void* event )
326 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
329 windowBase->OnMouseButtonCancel( data, type, event );
331 return ECORE_CALLBACK_PASS_ON;
335 * Called when a mouse wheel is received.
337 static Eina_Bool EcoreEventMouseWheel( void* data, int type, void* event )
339 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
342 windowBase->OnMouseWheel( data, type, event );
344 return ECORE_CALLBACK_PASS_ON;
348 * Called when a detent rotation event is recevied.
350 static Eina_Bool EcoreEventDetentRotation( void* data, int type, void* event )
352 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
355 windowBase->OnDetentRotation( data, type, event );
357 return ECORE_CALLBACK_PASS_ON;
360 /////////////////////////////////////////////////////////////////////////////////////////////////
362 /////////////////////////////////////////////////////////////////////////////////////////////////
365 * Called when a key down is received.
367 static Eina_Bool EcoreEventKeyDown( void* data, int type, void* event )
369 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
372 windowBase->OnKeyDown( data, type, event );
374 return ECORE_CALLBACK_PASS_ON;
378 * Called when a key up is received.
380 static Eina_Bool EcoreEventKeyUp( void* data, int type, void* event )
382 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
385 windowBase->OnKeyUp( data, type, event );
387 return ECORE_CALLBACK_PASS_ON;
390 /////////////////////////////////////////////////////////////////////////////////////////////////
391 // Selection Callbacks
392 /////////////////////////////////////////////////////////////////////////////////////////////////
395 * Called when the source window notifies us the content in clipboard is selected.
397 static Eina_Bool EcoreEventDataSend( void* data, int type, void* event )
399 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
402 windowBase->OnDataSend( data, type, event );
404 return ECORE_CALLBACK_PASS_ON;
408 * Called when the source window sends us about the selected content.
409 * For example, when item is selected in the clipboard.
411 static Eina_Bool EcoreEventDataReceive( void* data, int type, void* event )
413 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
416 windowBase->OnDataReceive( data, type, event );
418 return ECORE_CALLBACK_PASS_ON;
421 /////////////////////////////////////////////////////////////////////////////////////////////////
422 // Indicator Callbacks
423 /////////////////////////////////////////////////////////////////////////////////////////////////
425 #if defined (DALI_PROFILE_MOBILE)
427 * Called when the Ecore indicator event is received.
429 static Eina_Bool EcoreEventIndicator( void* data, int type, void* event )
431 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
434 windowBase->OnIndicatorFlicked( data, type, event );
436 return ECORE_CALLBACK_PASS_ON;
438 #endif // DALI_PROFILE_MOBILE
440 /////////////////////////////////////////////////////////////////////////////////////////////////
442 /////////////////////////////////////////////////////////////////////////////////////////////////
445 * Called when a font name is changed.
447 static void VconfNotifyFontNameChanged( keynode_t* node, void* data )
449 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
452 windowBase->OnFontNameChanged();
457 * Called when a font size is changed.
459 static void VconfNotifyFontSizeChanged( keynode_t* node, void* data )
461 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
464 windowBase->OnFontSizeChanged();
468 /////////////////////////////////////////////////////////////////////////////////////////////////
469 // ElDBus Accessibility Callbacks
470 /////////////////////////////////////////////////////////////////////////////////////////////////
472 #ifdef DALI_ELDBUS_AVAILABLE
473 // Callback for Ecore ElDBus accessibility events.
474 static void EcoreElDBusAccessibilityNotification( void* context, const Eldbus_Message* message )
476 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( context );
479 windowBase->OnEcoreElDBusAccessibilityNotification( context, message );
482 #endif // DALI_ELDBUS_AVAILABLE
484 static void RegistryGlobalCallback( void* data, struct wl_registry *registry, uint32_t name, const char* interface, uint32_t version )
486 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
489 windowBase->RegistryGlobalCallback( data, registry, name, interface, version );
493 static void RegistryGlobalCallbackRemove( void* data, struct wl_registry* registry, uint32_t id )
495 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
498 windowBase->RegistryGlobalCallbackRemove( data, registry, id );
502 static void TizenPolicyConformant( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t isConformant )
506 static void TizenPolicyConformantArea( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t conformantPart, uint32_t state, int32_t x, int32_t y, int32_t w, int32_t h )
510 static void TizenPolicyNotificationChangeDone(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, int32_t level, uint32_t state )
512 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
515 windowBase->TizenPolicyNotificationChangeDone( data, tizenPolicy, surface, level, state );
519 static void TizenPolicyTransientForDone( void* data, struct tizen_policy* tizenPolicy, uint32_t childId )
523 static void TizenPolicyScreenModeChangeDone( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t mode, uint32_t state )
525 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
528 windowBase->TizenPolicyScreenModeChangeDone( data, tizenPolicy, surface, mode, state );
532 static void TizenPolicyIconifyStateChanged( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t iconified, uint32_t force )
536 static void TizenPolicySupportedAuxiliaryHints( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, struct wl_array* hints, uint32_t numNints )
540 static void TizenPolicyAllowedAuxiliaryHint( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, int id )
544 static void TizenPolicyAuxiliaryMessage( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, const char* key, const char* val, struct wl_array* options )
548 static void TizenPolicyConformantRegion( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t conformantPart, uint32_t state, int32_t x, int32_t y, int32_t w, int32_t h, uint32_t serial )
552 static void DisplayPolicyBrightnessChangeDone( void* data, struct tizen_display_policy *displayPolicy, struct wl_surface* surface, int32_t brightness, uint32_t state )
554 WindowBaseEcoreWl* windowBase = static_cast< WindowBaseEcoreWl* >( data );
557 windowBase->DisplayPolicyBrightnessChangeDone( data, displayPolicy, surface, brightness, state );
561 const struct wl_registry_listener registryListener =
563 RegistryGlobalCallback,
564 RegistryGlobalCallbackRemove
567 const struct tizen_policy_listener tizenPolicyListener =
569 TizenPolicyConformant,
570 TizenPolicyConformantArea,
571 TizenPolicyNotificationChangeDone,
572 TizenPolicyTransientForDone,
573 TizenPolicyScreenModeChangeDone,
574 TizenPolicyIconifyStateChanged,
575 TizenPolicySupportedAuxiliaryHints,
576 TizenPolicyAllowedAuxiliaryHint,
577 TizenPolicyAuxiliaryMessage,
578 TizenPolicyConformantRegion
581 const struct tizen_display_policy_listener tizenDisplayPolicyListener =
583 DisplayPolicyBrightnessChangeDone
586 } // unnamed namespace
588 WindowBaseEcoreWl::WindowBaseEcoreWl( Dali::PositionSize positionSize, Any surface, bool isTransparent )
589 : mEcoreEventHandler(),
590 mEcoreWindow( NULL ),
595 mTizenPolicy( NULL ),
596 mTizenDisplayPolicy( NULL ),
597 mSupportedAuxiliaryHints(),
599 mNotificationLevel( -1 ),
600 mNotificationChangeState( 0 ),
601 mNotificationLevelChangeDone( true ),
603 mScreenOffModeChangeState( 0 ),
604 mScreenOffModeChangeDone( true ),
606 mBrightnessChangeState( 0 ),
607 mBrightnessChangeDone( true ),
609 #ifdef DALI_ELDBUS_AVAILABLE
610 , mSystemConnection( NULL )
613 Initialize( positionSize, surface, isTransparent );
616 WindowBaseEcoreWl::~WindowBaseEcoreWl()
618 #ifdef DALI_ELDBUS_AVAILABLE
619 // Close down ElDBus connections.
620 if( mSystemConnection )
622 eldbus_connection_unref( mSystemConnection );
624 #endif // DALI_ELDBUS_AVAILABLE
626 vconf_ignore_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontSizeChanged );
627 vconf_ignore_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, VconfNotifyFontNameChanged );
629 for( Dali::Vector< Ecore_Event_Handler* >::Iterator iter = mEcoreEventHandler.Begin(), endIter = mEcoreEventHandler.End(); iter != endIter; ++iter )
631 ecore_event_handler_del( *iter );
633 mEcoreEventHandler.Clear();
637 wl_event_queue_destroy( mEventQueue );
640 mSupportedAuxiliaryHints.clear();
641 mAuxiliaryHints.clear();
643 if( mEglWindow != NULL )
645 wl_egl_window_destroy( mEglWindow );
651 ecore_wl_window_free( mEcoreWindow );
653 WindowSystem::Shutdown();
657 void WindowBaseEcoreWl::Initialize( PositionSize positionSize, Any surface, bool isTransparent )
659 if( surface.Empty() == false )
661 // check we have a valid type
662 DALI_ASSERT_ALWAYS( ( surface.GetType() == typeid (Ecore_Wl_Window *) ) && "Surface type is invalid" );
664 mEcoreWindow = AnyCast< Ecore_Wl_Window* >( surface );
668 // we own the surface about to created
669 WindowSystem::Initialize();
672 CreateWindow( positionSize );
675 mWlSurface = ecore_wl_window_surface_create( mEcoreWindow );
677 SetTransparency( isTransparent );
679 mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL_EVENT_WINDOW_ICONIFY_STATE_CHANGE, EcoreEventWindowIconifyStateChanged, this ) );
680 mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL_EVENT_FOCUS_IN, EcoreEventWindowFocusIn, this ) );
681 mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL_EVENT_FOCUS_OUT, EcoreEventWindowFocusOut, this ) );
682 mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL_EVENT_OUTPUT_TRANSFORM, EcoreEventOutputTransform, this ) );
683 mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL_EVENT_IGNORE_OUTPUT_TRANSFORM, EcoreEventIgnoreOutputTransform, this ) );
685 // Register Rotate event
686 mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL_EVENT_WINDOW_ROTATE, EcoreEventRotate, this ) );
688 // Register Touch events
689 mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_MOUSE_BUTTON_DOWN, EcoreEventMouseButtonDown, this ) );
690 mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_MOUSE_BUTTON_UP, EcoreEventMouseButtonUp, this ) );
691 mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_MOUSE_MOVE, EcoreEventMouseButtonMove, this ) );
692 mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_MOUSE_BUTTON_CANCEL, EcoreEventMouseButtonCancel, this ) );
694 // Register Mouse wheel events
695 mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_MOUSE_WHEEL, EcoreEventMouseWheel, this ) );
697 // Register Detent event
698 mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_DETENT_ROTATE, EcoreEventDetentRotation, this ) );
700 // Register Key events
701 mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_KEY_DOWN, EcoreEventKeyDown, this ) );
702 mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_KEY_UP, EcoreEventKeyUp, this ) );
704 // Register Selection event - clipboard selection
705 mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL_EVENT_DATA_SOURCE_SEND, EcoreEventDataSend, this ) );
706 mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL_EVENT_SELECTION_DATA_READY, EcoreEventDataReceive, this ) );
708 #if defined (DALI_PROFILE_MOBILE)
709 // Register indicator event
710 mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL_EVENT_INDICATOR_FLICK, EcoreEventIndicator, this ) );
713 // Register Vconf notify - font name and size
714 vconf_notify_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_NAME, VconfNotifyFontNameChanged, this );
715 vconf_notify_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontSizeChanged, this );
717 InitializeEcoreElDBus();
719 mDisplay = ecore_wl_display_get();
723 wl_display* displayWrapper = static_cast< wl_display* >( wl_proxy_create_wrapper( mDisplay ) );
726 mEventQueue = wl_display_create_queue( mDisplay );
729 wl_proxy_set_queue( reinterpret_cast< wl_proxy* >( displayWrapper ), mEventQueue );
731 wl_registry* registry = wl_display_get_registry( displayWrapper );
732 wl_registry_add_listener( registry, ®istryListener, this );
735 wl_proxy_wrapper_destroy( displayWrapper );
739 // get auxiliary hint
740 Eina_List* hints = ecore_wl_window_aux_hints_supported_get( mEcoreWindow );
746 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) ) ) )
748 mSupportedAuxiliaryHints.push_back( hint );
750 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::Initialize: %s\n", hint );
755 Eina_Bool WindowBaseEcoreWl::OnIconifyStateChanged( void* data, int type, void* event )
757 Ecore_Wl_Event_Window_Iconify_State_Change* iconifyChangedEvent( static_cast< Ecore_Wl_Event_Window_Iconify_State_Change* >( event ) );
758 Eina_Bool handled( ECORE_CALLBACK_PASS_ON );
760 if( iconifyChangedEvent->win == static_cast< unsigned int>( ecore_wl_window_id_get( mEcoreWindow ) ) )
762 if( iconifyChangedEvent->iconified == EINA_TRUE )
764 mIconifyChangedSignal.Emit( true );
768 mIconifyChangedSignal.Emit( false );
770 handled = ECORE_CALLBACK_DONE;
776 Eina_Bool WindowBaseEcoreWl::OnFocusIn( void* data, int type, void* event )
778 Ecore_Wl_Event_Focus_In* focusInEvent( static_cast< Ecore_Wl_Event_Focus_In* >( event ) );
780 if( focusInEvent->win == static_cast< unsigned int >( ecore_wl_window_id_get( mEcoreWindow ) ) )
782 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "Window EcoreEventWindowFocusIn\n" );
784 mFocusChangedSignal.Emit( true );
787 return ECORE_CALLBACK_PASS_ON;
790 Eina_Bool WindowBaseEcoreWl::OnFocusOut( void* data, int type, void* event )
792 Ecore_Wl_Event_Focus_Out* focusOutEvent( static_cast< Ecore_Wl_Event_Focus_Out* >( event ) );
794 if( focusOutEvent->win == static_cast< unsigned int >( ecore_wl_window_id_get( mEcoreWindow ) ) )
796 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "Window EcoreEventWindowFocusOut\n" );
798 mFocusChangedSignal.Emit( false );
801 return ECORE_CALLBACK_PASS_ON;
804 Eina_Bool WindowBaseEcoreWl::OnOutputTransform( void* data, int type, void* event )
806 Ecore_Wl_Event_Output_Transform* transformEvent( static_cast< Ecore_Wl_Event_Output_Transform* >( event ) );
808 if( transformEvent->output == ecore_wl_window_output_find( mEcoreWindow ) )
810 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "Window (%p) EcoreEventOutputTransform\n", mEcoreWindow );
812 mOutputTransformedSignal.Emit();
815 return ECORE_CALLBACK_PASS_ON;
818 Eina_Bool WindowBaseEcoreWl::OnIgnoreOutputTransform( void* data, int type, void* event )
820 Ecore_Wl_Event_Ignore_Output_Transform* ignoreTransformEvent( static_cast< Ecore_Wl_Event_Ignore_Output_Transform* >( event ) );
822 if( ignoreTransformEvent->win == mEcoreWindow )
824 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "Window (%p) EcoreEventIgnoreOutputTransform\n", mEcoreWindow );
826 mOutputTransformedSignal.Emit();
829 return ECORE_CALLBACK_PASS_ON;
832 void WindowBaseEcoreWl::OnRotation( void* data, int type, void* event )
834 Ecore_Wl_Event_Window_Rotate* ev( static_cast< Ecore_Wl_Event_Window_Rotate* >( event ) );
836 if( ev->win == static_cast< unsigned int >( ecore_wl_window_id_get( mEcoreWindow ) ) )
838 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl::OnRotation\n" );
840 RotationEvent rotationEvent;
841 rotationEvent.angle = ev->angle;
842 rotationEvent.winResize = 0;
844 if( ev->angle == 0 || ev->angle == 180 )
846 rotationEvent.width = ev->w;
847 rotationEvent.height = ev->h;
851 rotationEvent.width = ev->h;
852 rotationEvent.height = ev->w;
855 mRotationSignal.Emit( rotationEvent );
859 void WindowBaseEcoreWl::OnMouseButtonDown( void* data, int type, void* event )
861 Ecore_Event_Mouse_Button* touchEvent = static_cast< Ecore_Event_Mouse_Button* >( event );
863 if( touchEvent->window == static_cast< unsigned int >( ecore_wl_window_id_get( mEcoreWindow ) ) )
865 PointState::Type state ( PointState::DOWN );
867 // Check if the buttons field is set and ensure it's the primary touch button.
868 // If this event was triggered by buttons other than the primary button (used for touch), then
869 // just send an interrupted event to Core.
870 if( touchEvent->buttons && (touchEvent->buttons != PRIMARY_TOUCH_BUTTON_ID ) )
872 state = PointState::INTERRUPTED;
875 Device::Class::Type deviceClass;
876 Device::Subclass::Type deviceSubclass;
878 GetDeviceClass( ecore_device_class_get( touchEvent->dev ), deviceClass );
879 GetDeviceSubclass( ecore_device_subclass_get( touchEvent->dev ), deviceSubclass );
881 Integration::Point point;
882 point.SetDeviceId( touchEvent->multi.device );
883 point.SetState( state );
884 point.SetScreenPosition( Vector2( touchEvent->x, touchEvent->y ) );
885 point.SetRadius( touchEvent->multi.radius, Vector2( touchEvent->multi.radius_x, touchEvent->multi.radius_y ) );
886 point.SetPressure( touchEvent->multi.pressure );
887 point.SetAngle( Degree( touchEvent->multi.angle ) );
888 point.SetDeviceClass( deviceClass );
889 point.SetDeviceSubclass( deviceSubclass );
891 mTouchEventSignal.Emit( point, touchEvent->timestamp );
895 void WindowBaseEcoreWl::OnMouseButtonUp( void* data, int type, void* event )
897 Ecore_Event_Mouse_Button* touchEvent = static_cast< Ecore_Event_Mouse_Button* >( event );
899 if( touchEvent->window == static_cast< unsigned int >( ecore_wl_window_id_get( mEcoreWindow ) ) )
901 Device::Class::Type deviceClass;
902 Device::Subclass::Type deviceSubclass;
904 GetDeviceClass( ecore_device_class_get( touchEvent->dev ), deviceClass );
905 GetDeviceSubclass( ecore_device_subclass_get( touchEvent->dev ), deviceSubclass );
907 Integration::Point point;
908 point.SetDeviceId( touchEvent->multi.device );
909 point.SetState( PointState::UP );
910 point.SetScreenPosition( Vector2( touchEvent->x, touchEvent->y ) );
911 point.SetRadius( touchEvent->multi.radius, Vector2( touchEvent->multi.radius_x, touchEvent->multi.radius_y ) );
912 point.SetPressure( touchEvent->multi.pressure );
913 point.SetAngle( Degree( touchEvent->multi.angle ) );
914 point.SetDeviceClass( deviceClass );
915 point.SetDeviceSubclass( deviceSubclass );
917 mTouchEventSignal.Emit( point, touchEvent->timestamp );
921 void WindowBaseEcoreWl::OnMouseButtonMove( void* data, int type, void* event )
923 Ecore_Event_Mouse_Move* touchEvent = static_cast< Ecore_Event_Mouse_Move* >( event );
925 if( touchEvent->window == static_cast< unsigned int >( ecore_wl_window_id_get( mEcoreWindow ) ) )
927 Device::Class::Type deviceClass;
928 Device::Subclass::Type deviceSubclass;
930 GetDeviceClass( ecore_device_class_get( touchEvent->dev ), deviceClass );
931 GetDeviceSubclass( ecore_device_subclass_get( touchEvent->dev ), deviceSubclass );
933 Integration::Point point;
934 point.SetDeviceId( touchEvent->multi.device );
935 point.SetState( PointState::MOTION );
936 point.SetScreenPosition( Vector2( touchEvent->x, touchEvent->y ) );
937 point.SetRadius( touchEvent->multi.radius, Vector2( touchEvent->multi.radius_x, touchEvent->multi.radius_y ) );
938 point.SetPressure( touchEvent->multi.pressure );
939 point.SetAngle( Degree( touchEvent->multi.angle ) );
940 point.SetDeviceClass( deviceClass );
941 point.SetDeviceSubclass( deviceSubclass );
943 mTouchEventSignal.Emit( point, touchEvent->timestamp );
947 void WindowBaseEcoreWl::OnMouseButtonCancel( void* data, int type, void* event )
949 Ecore_Event_Mouse_Button* touchEvent = static_cast< Ecore_Event_Mouse_Button* >( event );
951 if( touchEvent->window == static_cast< unsigned int >( ecore_wl_window_id_get( mEcoreWindow ) ) )
953 Integration::Point point;
954 point.SetDeviceId( touchEvent->multi.device );
955 point.SetState( PointState::INTERRUPTED );
956 point.SetScreenPosition( Vector2( 0.0f, 0.0f ) );
958 mTouchEventSignal.Emit( point, touchEvent->timestamp );
960 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnMouseButtonCancel\n" );
964 void WindowBaseEcoreWl::OnMouseWheel( void* data, int type, void* event )
966 Ecore_Event_Mouse_Wheel* mouseWheelEvent = static_cast< Ecore_Event_Mouse_Wheel* >( event );
968 if( mouseWheelEvent->window == static_cast< unsigned int >( ecore_wl_window_id_get( mEcoreWindow ) ) )
970 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnMouseWheel: direction: %d, modifiers: %d, x: %d, y: %d, z: %d\n", mouseWheelEvent->direction, mouseWheelEvent->modifiers, mouseWheelEvent->x, mouseWheelEvent->y, mouseWheelEvent->z );
972 WheelEvent wheelEvent( WheelEvent::MOUSE_WHEEL, mouseWheelEvent->direction, mouseWheelEvent->modifiers, Vector2( mouseWheelEvent->x, mouseWheelEvent->y ), mouseWheelEvent->z, mouseWheelEvent->timestamp );
974 mWheelEventSignal.Emit( wheelEvent );
978 void WindowBaseEcoreWl::OnDetentRotation( void* data, int type, void* event )
980 Ecore_Event_Detent_Rotate* detentEvent = static_cast< Ecore_Event_Detent_Rotate* >( event );
982 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl::OnDetentRotation\n" );
984 int direction = ( detentEvent->direction == ECORE_DETENT_DIRECTION_CLOCKWISE ) ? 1 : -1;
985 int timeStamp = detentEvent->timestamp;
987 WheelEvent wheelEvent( WheelEvent::CUSTOM_WHEEL, 0, 0, Vector2( 0.0f, 0.0f ), direction, timeStamp );
989 mWheelEventSignal.Emit( wheelEvent );
992 void WindowBaseEcoreWl::OnKeyDown( void* data, int type, void* event )
994 Ecore_Event_Key* keyEvent = static_cast< Ecore_Event_Key* >( event );
996 if( keyEvent->window == static_cast< unsigned int >( ecore_wl_window_id_get( mEcoreWindow ) ) )
998 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnKeyDown\n" );
1000 std::string keyName( keyEvent->keyname );
1001 std::string keyString( "" );
1002 std::string compose( "" );
1004 // Ensure key compose string is not NULL as keys like SHIFT or arrow have a null string.
1005 if( keyEvent->compose )
1007 compose = keyEvent->compose;
1010 int keyCode = KeyLookup::GetDaliKeyCode( keyEvent->keyname );
1011 keyCode = ( keyCode == -1 ) ? 0 : keyCode;
1012 int modifier( keyEvent->modifiers );
1013 unsigned long time = keyEvent->timestamp;
1014 if( !strncmp( keyEvent->keyname, "Keycode-", 8 ) )
1016 keyCode = atoi( keyEvent->keyname + 8 );
1019 // Ensure key event string is not NULL as keys like SHIFT have a null string.
1020 if( keyEvent->string )
1022 keyString = keyEvent->string;
1025 std::string deviceName;
1026 Device::Class::Type deviceClass;
1027 Device::Subclass::Type deviceSubclass;
1029 GetDeviceName( keyEvent, deviceName );
1030 GetDeviceClass( ecore_device_class_get( keyEvent->dev ), deviceClass );
1031 GetDeviceSubclass( ecore_device_subclass_get( keyEvent->dev ), deviceSubclass );
1033 Integration::KeyEvent keyEvent( keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Down, compose, deviceName, deviceClass, deviceSubclass );
1035 mKeyEventSignal.Emit( keyEvent );
1039 void WindowBaseEcoreWl::OnKeyUp( void* data, int type, void* event )
1041 Ecore_Event_Key* keyEvent = static_cast< Ecore_Event_Key* >( event );
1043 if( keyEvent->window == static_cast< unsigned int >( ecore_wl_window_id_get( mEcoreWindow ) ) )
1045 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::OnKeyUp\n" );
1047 std::string keyName( keyEvent->keyname );
1048 std::string keyString( "" );
1049 std::string compose( "" );
1051 // Ensure key compose string is not NULL as keys like SHIFT or arrow have a null string.
1052 if( keyEvent->compose )
1054 compose = keyEvent->compose;
1057 int keyCode = KeyLookup::GetDaliKeyCode( keyEvent->keyname );
1058 keyCode = ( keyCode == -1 ) ? 0 : keyCode;
1059 int modifier( keyEvent->modifiers );
1060 unsigned long time = keyEvent->timestamp;
1061 if( !strncmp( keyEvent->keyname, "Keycode-", 8 ) )
1063 keyCode = atoi( keyEvent->keyname + 8 );
1066 // Ensure key event string is not NULL as keys like SHIFT have a null string.
1067 if( keyEvent->string )
1069 keyString = keyEvent->string;
1072 std::string deviceName;
1073 Device::Class::Type deviceClass;
1074 Device::Subclass::Type deviceSubclass;
1076 GetDeviceName( keyEvent, deviceName );
1077 GetDeviceClass( ecore_device_class_get( keyEvent->dev ), deviceClass );
1078 GetDeviceSubclass( ecore_device_subclass_get( keyEvent->dev ), deviceSubclass );
1080 Integration::KeyEvent keyEvent( keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Up, compose, deviceName, deviceClass, deviceSubclass );
1082 mKeyEventSignal.Emit( keyEvent );
1086 void WindowBaseEcoreWl::OnDataSend( void* data, int type, void* event )
1088 mSelectionDataSendSignal.Emit( event );
1091 void WindowBaseEcoreWl::OnDataReceive( void* data, int type, void* event )
1093 mSelectionDataReceivedSignal.Emit( event );
1096 void WindowBaseEcoreWl::OnIndicatorFlicked( void* data, int type, void* event )
1098 mIndicatorFlickedSignal.Emit();
1101 void WindowBaseEcoreWl::OnFontNameChanged()
1103 mStyleChangedSignal.Emit( StyleChange::DEFAULT_FONT_CHANGE );
1106 void WindowBaseEcoreWl::OnFontSizeChanged()
1108 mStyleChangedSignal.Emit( StyleChange::DEFAULT_FONT_SIZE_CHANGE );
1111 void WindowBaseEcoreWl::OnEcoreElDBusAccessibilityNotification( void* context, const Eldbus_Message* message )
1113 #ifdef DALI_ELDBUS_AVAILABLE
1114 AccessibilityInfo info;
1116 // The string defines the arg-list's respective types.
1117 if( !eldbus_message_arguments_get( message, "iiiiiiu", &info.gestureValue, &info.startX, &info.startY, &info.endX, &info.endY, &info.state, &info.eventTime ) )
1119 DALI_LOG_ERROR( "OnEcoreElDBusAccessibilityNotification: Error getting arguments\n" );
1122 mAccessibilitySignal.Emit( info );
1126 void WindowBaseEcoreWl::RegistryGlobalCallback( void* data, struct wl_registry *registry, uint32_t name, const char* interface, uint32_t version )
1128 if( strcmp( interface, tizen_policy_interface.name ) == 0 )
1130 uint32_t clientVersion = std::min( version, MAX_TIZEN_CLIENT_VERSION );
1132 mTizenPolicy = static_cast< tizen_policy* >( wl_registry_bind( registry, name, &tizen_policy_interface, clientVersion ) );
1135 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::RegistryGlobalCallback: wl_registry_bind(tizen_policy_interface) is failed.\n" );
1139 tizen_policy_add_listener( mTizenPolicy, &tizenPolicyListener, data );
1141 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::RegistryGlobalCallback: tizen_policy_add_listener is called.\n" );
1143 else if( strcmp( interface, tizen_display_policy_interface.name ) == 0 )
1145 mTizenDisplayPolicy = static_cast< tizen_display_policy* >( wl_registry_bind( registry, name, &tizen_display_policy_interface, version ) );
1146 if( !mTizenDisplayPolicy )
1148 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::RegistryGlobalCallback: wl_registry_bind(tizen_display_policy_interface) is failed.\n" );
1152 tizen_display_policy_add_listener( mTizenDisplayPolicy, &tizenDisplayPolicyListener, data );
1154 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::RegistryGlobalCallback: tizen_display_policy_add_listener is called.\n" );
1158 void WindowBaseEcoreWl::RegistryGlobalCallbackRemove( void* data, struct wl_registry* registry, uint32_t id )
1160 mTizenPolicy = NULL;
1161 mTizenDisplayPolicy = NULL;
1164 void WindowBaseEcoreWl::TizenPolicyNotificationChangeDone(void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, int32_t level, uint32_t state )
1166 mNotificationLevel = level;
1167 mNotificationChangeState = state;
1168 mNotificationLevelChangeDone = true;
1170 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::TizenPolicyNotificationChangeDone: level = %d, state = %d\n", level, state );
1173 void WindowBaseEcoreWl::TizenPolicyScreenModeChangeDone( void* data, struct tizen_policy* tizenPolicy, struct wl_surface* surface, uint32_t mode, uint32_t state )
1175 mScreenOffMode = mode;
1176 mScreenOffModeChangeState = state;
1177 mScreenOffModeChangeDone = true;
1179 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::TizenPolicyScreenModeChangeDone: mode = %d, state = %d\n", mode, state );
1182 void WindowBaseEcoreWl::DisplayPolicyBrightnessChangeDone( void* data, struct tizen_display_policy *displayPolicy, struct wl_surface* surface, int32_t brightness, uint32_t state )
1184 mBrightness = brightness;
1185 mBrightnessChangeState = state;
1186 mBrightnessChangeDone = true;
1188 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl::DisplayPolicyBrightnessChangeDone: brightness = %d, state = %d\n", brightness, state );
1191 Any WindowBaseEcoreWl::GetNativeWindow()
1193 return mEcoreWindow;
1196 int WindowBaseEcoreWl::GetNativeWindowId()
1198 return ecore_wl_window_id_get( mEcoreWindow );
1201 EGLNativeWindowType WindowBaseEcoreWl::CreateEglWindow( int width, int height )
1203 mEglWindow = wl_egl_window_create( mWlSurface, width, height );
1205 return static_cast< EGLNativeWindowType >( mEglWindow );
1208 void WindowBaseEcoreWl::DestroyEglWindow()
1210 if( mEglWindow != NULL )
1212 wl_egl_window_destroy( mEglWindow );
1217 void WindowBaseEcoreWl::SetEglWindowRotation( int angle )
1219 wl_egl_window_rotation rotation;
1225 rotation = ROTATION_0;
1230 rotation = ROTATION_270;
1235 rotation = ROTATION_180;
1240 rotation = ROTATION_90;
1245 rotation = ROTATION_0;
1250 wl_egl_window_set_rotation( mEglWindow, rotation );
1253 void WindowBaseEcoreWl::SetEglWindowBufferTransform( int angle )
1255 wl_output_transform bufferTransform;
1261 bufferTransform = WL_OUTPUT_TRANSFORM_NORMAL;
1266 bufferTransform = WL_OUTPUT_TRANSFORM_90;
1271 bufferTransform = WL_OUTPUT_TRANSFORM_180;
1276 bufferTransform = WL_OUTPUT_TRANSFORM_270;
1281 bufferTransform = WL_OUTPUT_TRANSFORM_NORMAL;
1286 wl_egl_window_set_buffer_transform( mEglWindow, bufferTransform );
1289 void WindowBaseEcoreWl::SetEglWindowTransform( int angle )
1291 wl_output_transform windowTransform;
1297 windowTransform = WL_OUTPUT_TRANSFORM_NORMAL;
1302 windowTransform = WL_OUTPUT_TRANSFORM_90;
1307 windowTransform = WL_OUTPUT_TRANSFORM_180;
1312 windowTransform = WL_OUTPUT_TRANSFORM_270;
1317 windowTransform = WL_OUTPUT_TRANSFORM_NORMAL;
1322 wl_egl_window_set_window_transform( mEglWindow, windowTransform );
1325 void WindowBaseEcoreWl::ResizeEglWindow( PositionSize positionSize )
1327 wl_egl_window_resize( mEglWindow, positionSize.width, positionSize.height, positionSize.x, positionSize.y );
1330 bool WindowBaseEcoreWl::IsEglWindowRotationSupported()
1333 wl_egl_window_capability capability = static_cast< wl_egl_window_capability >( wl_egl_window_get_capabilities( mEglWindow ) );
1334 if( capability == WL_EGL_WINDOW_CAPABILITY_ROTATION_SUPPORTED )
1342 void WindowBaseEcoreWl::Move( PositionSize positionSize )
1344 ecore_wl_window_position_set( mEcoreWindow, positionSize.x, positionSize.y );
1347 void WindowBaseEcoreWl::Resize( PositionSize positionSize )
1349 ecore_wl_window_update_size( mEcoreWindow, positionSize.width, positionSize.height );
1352 void WindowBaseEcoreWl::MoveResize( PositionSize positionSize )
1354 ecore_wl_window_position_set( mEcoreWindow, positionSize.x, positionSize.y );
1355 ecore_wl_window_update_size( mEcoreWindow, positionSize.width, positionSize.height );
1358 void WindowBaseEcoreWl::ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode, Dali::Window::IndicatorBgOpacity opacityMode )
1360 DALI_LOG_TRACE_METHOD_FMT( gWindowBaseLogFilter, "visible : %d\n", visibleMode );
1362 if( visibleMode == Dali::Window::VISIBLE )
1364 // when the indicator is visible, set proper mode for indicator server according to bg mode
1365 if( opacityMode == Dali::Window::OPAQUE )
1367 ecore_wl_window_indicator_opacity_set( mEcoreWindow, ECORE_WL_INDICATOR_OPAQUE );
1369 else if( opacityMode == Dali::Window::TRANSLUCENT )
1371 ecore_wl_window_indicator_opacity_set( mEcoreWindow, ECORE_WL_INDICATOR_TRANSLUCENT );
1373 else if( opacityMode == Dali::Window::TRANSPARENT )
1375 ecore_wl_window_indicator_opacity_set( mEcoreWindow, ECORE_WL_INDICATOR_OPAQUE );
1380 // when the indicator is not visible, set TRANSPARENT mode for indicator server
1381 ecore_wl_window_indicator_opacity_set( mEcoreWindow, ECORE_WL_INDICATOR_TRANSPARENT); // it means hidden indicator
1385 void WindowBaseEcoreWl::SetIndicatorProperties( bool isShow, Dali::Window::WindowOrientation lastOrientation )
1389 ecore_wl_window_indicator_state_set( mEcoreWindow, ECORE_WL_INDICATOR_STATE_ON );
1393 ecore_wl_window_indicator_state_set( mEcoreWindow, ECORE_WL_INDICATOR_STATE_OFF );
1397 void WindowBaseEcoreWl::IndicatorTypeChanged( IndicatorInterface::Type type )
1399 #if defined(DALI_PROFILE_MOBILE)
1402 case IndicatorInterface::INDICATOR_TYPE_1:
1404 ecore_wl_indicator_visible_type_set( mEcoreWindow, ECORE_WL_INDICATOR_VISIBLE_TYPE_SHOWN );
1407 case IndicatorInterface::INDICATOR_TYPE_2:
1409 ecore_wl_indicator_visible_type_set( mEcoreWindow, ECORE_WL_INDICATOR_VISIBLE_TYPE_HIDDEN );
1412 case IndicatorInterface::INDICATOR_TYPE_UNKNOWN:
1421 void WindowBaseEcoreWl::SetClass( const std::string& name, const std::string& className )
1423 ecore_wl_window_title_set( mEcoreWindow, name.c_str() );
1424 ecore_wl_window_class_name_set( mEcoreWindow, className.c_str() );
1427 void WindowBaseEcoreWl::Raise()
1429 // Use ecore_wl_window_activate to prevent the window shown without rendering
1430 ecore_wl_window_activate( mEcoreWindow );
1433 void WindowBaseEcoreWl::Lower()
1435 ecore_wl_window_lower( mEcoreWindow );
1438 void WindowBaseEcoreWl::Activate()
1440 ecore_wl_window_activate( mEcoreWindow );
1443 void WindowBaseEcoreWl::SetAvailableOrientations( const std::vector< Dali::Window::WindowOrientation >& orientations )
1445 int rotations[4] = { 0 };
1446 for( std::size_t i = 0; i < orientations.size(); ++i )
1448 rotations[i] = static_cast< int >( orientations[i] );
1450 ecore_wl_window_rotation_available_rotations_set( mEcoreWindow, rotations, orientations.size() );
1453 void WindowBaseEcoreWl::SetPreferredOrientation( Dali::Window::WindowOrientation orientation )
1455 ecore_wl_window_rotation_preferred_rotation_set( mEcoreWindow, orientation );
1458 void WindowBaseEcoreWl::SetAcceptFocus( bool accept )
1460 ecore_wl_window_focus_skip_set( mEcoreWindow, !accept );
1463 void WindowBaseEcoreWl::Show()
1465 ecore_wl_window_show( mEcoreWindow );
1468 void WindowBaseEcoreWl::Hide()
1470 ecore_wl_window_hide( mEcoreWindow );
1473 unsigned int WindowBaseEcoreWl::GetSupportedAuxiliaryHintCount() const
1475 return mSupportedAuxiliaryHints.size();
1478 std::string WindowBaseEcoreWl::GetSupportedAuxiliaryHint( unsigned int index ) const
1480 if( index >= GetSupportedAuxiliaryHintCount() )
1482 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::GetSupportedAuxiliaryHint: Invalid index! [%d]\n", index );
1485 return mSupportedAuxiliaryHints[index];
1488 unsigned int WindowBaseEcoreWl::AddAuxiliaryHint( const std::string& hint, const std::string& value )
1490 bool supported = false;
1492 // Check if the hint is suppported
1493 for( std::vector< std::string >::iterator iter = mSupportedAuxiliaryHints.begin(); iter != mSupportedAuxiliaryHints.end(); ++iter )
1504 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl::AddAuxiliaryHint: Not supported auxiliary hint [%s]\n", hint.c_str() );
1508 // Check if the hint is already added
1509 for( unsigned int i = 0; i < mAuxiliaryHints.size(); i++ )
1511 if( mAuxiliaryHints[i].first == hint )
1513 // Just change the value
1514 mAuxiliaryHints[i].second = value;
1516 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::AddAuxiliaryHint: Change! hint = %s, value = %s, id = %d\n", hint.c_str(), value.c_str(), i + 1 );
1518 return i + 1; // id is index + 1
1523 mAuxiliaryHints.push_back( std::pair< std::string, std::string >( hint, value ) );
1525 unsigned int id = mAuxiliaryHints.size();
1527 ecore_wl_window_aux_hint_add( mEcoreWindow, static_cast< int >( id ), hint.c_str(), value.c_str() );
1529 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::AddAuxiliaryHint: hint = %s, value = %s, id = %d\n", hint.c_str(), value.c_str(), id );
1534 bool WindowBaseEcoreWl::RemoveAuxiliaryHint( unsigned int id )
1536 if( id == 0 || id > mAuxiliaryHints.size() )
1538 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl::RemoveAuxiliaryHint: Invalid id [%d]\n", id );
1542 mAuxiliaryHints[id - 1].second = std::string();
1544 ecore_wl_window_aux_hint_del( mEcoreWindow, static_cast< int >( id ) );
1546 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::RemoveAuxiliaryHint: id = %d, hint = %s\n", id, mAuxiliaryHints[id - 1].first.c_str() );
1551 bool WindowBaseEcoreWl::SetAuxiliaryHintValue( unsigned int id, const std::string& value )
1553 if( id == 0 || id > mAuxiliaryHints.size() )
1555 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl::SetAuxiliaryHintValue: Invalid id [%d]\n", id );
1559 mAuxiliaryHints[id - 1].second = value;
1561 ecore_wl_window_aux_hint_change( mEcoreWindow, static_cast< int >( id ), value.c_str() );
1563 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetAuxiliaryHintValue: id = %d, hint = %s, value = %s\n", id, mAuxiliaryHints[id - 1].first.c_str(), mAuxiliaryHints[id - 1].second.c_str() );
1568 std::string WindowBaseEcoreWl::GetAuxiliaryHintValue( unsigned int id ) const
1570 if( id == 0 || id > mAuxiliaryHints.size() )
1572 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Concise, "WindowBaseEcoreWl::GetAuxiliaryHintValue: Invalid id [%d]\n", id );
1573 return std::string();
1576 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::GetAuxiliaryHintValue: id = %d, hint = %s, value = %s\n", id, mAuxiliaryHints[id - 1].first.c_str(), mAuxiliaryHints[id - 1].second.c_str() );
1578 return mAuxiliaryHints[id - 1].second;
1581 unsigned int WindowBaseEcoreWl::GetAuxiliaryHintId( const std::string& hint ) const
1583 for( unsigned int i = 0; i < mAuxiliaryHints.size(); i++ )
1585 if( mAuxiliaryHints[i].first == hint )
1587 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::GetAuxiliaryHintId: hint = %s, id = %d\n", hint.c_str(), i + 1 );
1592 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::GetAuxiliaryHintId: Invalid hint! [%s]\n", hint.c_str() );
1597 void WindowBaseEcoreWl::SetInputRegion( const Rect< int >& inputRegion )
1599 ecore_wl_window_input_region_set( mEcoreWindow, inputRegion.x, inputRegion.y, inputRegion.width, inputRegion.height );
1602 void WindowBaseEcoreWl::SetType( Dali::Window::Type type )
1604 Ecore_Wl_Window_Type windowType;
1608 case Dali::Window::NORMAL:
1610 windowType = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
1613 case Dali::Window::NOTIFICATION:
1615 windowType = ECORE_WL_WINDOW_TYPE_NOTIFICATION;
1618 case Dali::Window::UTILITY:
1620 windowType = ECORE_WL_WINDOW_TYPE_UTILITY;
1623 case Dali::Window::DIALOG:
1625 windowType = ECORE_WL_WINDOW_TYPE_DIALOG;
1630 windowType = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
1635 ecore_wl_window_type_set( mEcoreWindow, windowType );
1638 bool WindowBaseEcoreWl::SetNotificationLevel( Dali::Window::NotificationLevel::Type level )
1640 while( !mTizenPolicy )
1642 wl_display_dispatch_queue( mDisplay, mEventQueue );
1645 int notificationLevel;
1649 case Dali::Window::NotificationLevel::NONE:
1651 notificationLevel = TIZEN_POLICY_LEVEL_NONE;
1654 case Dali::Window::NotificationLevel::BASE:
1656 notificationLevel = TIZEN_POLICY_LEVEL_DEFAULT;
1659 case Dali::Window::NotificationLevel::MEDIUM:
1661 notificationLevel = TIZEN_POLICY_LEVEL_MEDIUM;
1664 case Dali::Window::NotificationLevel::HIGH:
1666 notificationLevel = TIZEN_POLICY_LEVEL_HIGH;
1669 case Dali::Window::NotificationLevel::TOP:
1671 notificationLevel = TIZEN_POLICY_LEVEL_TOP;
1676 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetNotificationLevel: invalid level [%d]\n", level );
1677 notificationLevel = TIZEN_POLICY_LEVEL_DEFAULT;
1682 mNotificationLevelChangeDone = false;
1683 mNotificationChangeState = TIZEN_POLICY_ERROR_STATE_NONE;
1685 tizen_policy_set_notification_level( mTizenPolicy, ecore_wl_window_surface_get( mEcoreWindow ), notificationLevel );
1689 while( !mNotificationLevelChangeDone && count < 3 )
1692 wl_display_dispatch_queue( mDisplay, mEventQueue );
1696 if( !mNotificationLevelChangeDone )
1698 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetNotificationLevel: Level change is failed [%d, %d]\n", level, mNotificationChangeState );
1701 else if( mNotificationChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED )
1703 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetNotificationLevel: Permission denied! [%d]\n", level );
1707 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetNotificationLevel: Level is changed [%d]\n", mNotificationLevel );
1712 Dali::Window::NotificationLevel::Type WindowBaseEcoreWl::GetNotificationLevel() const
1714 while( !mTizenPolicy )
1716 wl_display_dispatch_queue( mDisplay, mEventQueue );
1721 while( !mNotificationLevelChangeDone && count < 3 )
1724 wl_display_dispatch_queue( mDisplay, mEventQueue );
1728 if( !mNotificationLevelChangeDone )
1730 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::GetNotificationLevel: Error! [%d]\n", mNotificationChangeState );
1731 return Dali::Window::NotificationLevel::NONE;
1734 Dali::Window::NotificationLevel::Type level;
1736 switch( mNotificationLevel )
1738 case TIZEN_POLICY_LEVEL_NONE:
1740 level = Dali::Window::NotificationLevel::NONE;
1743 case TIZEN_POLICY_LEVEL_DEFAULT:
1745 level = Dali::Window::NotificationLevel::BASE;
1748 case TIZEN_POLICY_LEVEL_MEDIUM:
1750 level = Dali::Window::NotificationLevel::MEDIUM;
1753 case TIZEN_POLICY_LEVEL_HIGH:
1755 level = Dali::Window::NotificationLevel::HIGH;
1758 case TIZEN_POLICY_LEVEL_TOP:
1760 level = Dali::Window::NotificationLevel::TOP;
1765 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::GetNotificationLevel: invalid level [%d]\n", mNotificationLevel );
1766 level = Dali::Window::NotificationLevel::NONE;
1771 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::GetNotificationLevel: level [%d]\n", mNotificationLevel );
1776 void WindowBaseEcoreWl::SetOpaqueState( bool opaque )
1778 while( !mTizenPolicy )
1780 wl_display_dispatch_queue( mDisplay, mEventQueue );
1783 tizen_policy_set_opaque_state( mTizenPolicy, ecore_wl_window_surface_get( mEcoreWindow ), ( opaque ? 1 : 0 ) );
1786 bool WindowBaseEcoreWl::SetScreenOffMode(Dali::Window::ScreenOffMode::Type screenOffMode)
1788 while( !mTizenPolicy )
1790 wl_display_dispatch_queue( mDisplay, mEventQueue );
1793 mScreenOffModeChangeDone = false;
1794 mScreenOffModeChangeState = TIZEN_POLICY_ERROR_STATE_NONE;
1796 unsigned int mode = 0;
1798 switch( screenOffMode )
1800 case Dali::Window::ScreenOffMode::TIMEOUT:
1805 case Dali::Window::ScreenOffMode::NEVER:
1812 tizen_policy_set_window_screen_mode( mTizenPolicy, ecore_wl_window_surface_get( mEcoreWindow ), mode );
1816 while( !mScreenOffModeChangeDone && count < 3 )
1819 wl_display_dispatch_queue( mDisplay, mEventQueue );
1823 if( !mScreenOffModeChangeDone )
1825 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetScreenOffMode: Screen mode change is failed [%d, %d]\n", screenOffMode, mScreenOffModeChangeState );
1828 else if( mScreenOffModeChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED )
1830 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetScreenOffMode: Permission denied! [%d]\n", screenOffMode );
1834 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetScreenOffMode: Screen mode is changed [%d]\n", mScreenOffMode );
1839 Dali::Window::ScreenOffMode::Type WindowBaseEcoreWl::GetScreenOffMode() const
1841 while( !mTizenPolicy )
1843 wl_display_dispatch_queue( mDisplay, mEventQueue );
1848 while( !mScreenOffModeChangeDone && count < 3 )
1851 wl_display_dispatch_queue( mDisplay, mEventQueue );
1855 if( !mScreenOffModeChangeDone )
1857 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::GetScreenOffMode: Error! [%d]\n", mScreenOffModeChangeState );
1858 return Dali::Window::ScreenOffMode::TIMEOUT;
1861 Dali::Window::ScreenOffMode::Type screenMode = Dali::Window::ScreenOffMode::TIMEOUT;
1863 switch( mScreenOffMode )
1867 screenMode = Dali::Window::ScreenOffMode::TIMEOUT;
1872 screenMode = Dali::Window::ScreenOffMode::NEVER;
1877 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::GetScreenOffMode: screen mode [%d]\n", mScreenOffMode );
1882 bool WindowBaseEcoreWl::SetBrightness( int brightness )
1884 while( !mTizenDisplayPolicy )
1886 wl_display_dispatch_queue( mDisplay, mEventQueue );
1889 mBrightnessChangeDone = false;
1890 mBrightnessChangeState = TIZEN_POLICY_ERROR_STATE_NONE;
1892 tizen_display_policy_set_window_brightness( mTizenDisplayPolicy, ecore_wl_window_surface_get( mEcoreWindow ), brightness );
1896 while( !mBrightnessChangeDone && count < 3 )
1899 wl_display_dispatch_queue( mDisplay, mEventQueue );
1903 if( !mBrightnessChangeDone )
1905 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetBrightness: Brightness change is failed [%d, %d]\n", brightness, mBrightnessChangeState );
1908 else if( mBrightnessChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED )
1910 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetBrightness: Permission denied! [%d]\n", brightness );
1914 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::SetBrightness: Brightness is changed [%d]\n", mBrightness );
1919 int WindowBaseEcoreWl::GetBrightness() const
1921 while( !mTizenDisplayPolicy )
1923 wl_display_dispatch_queue( mDisplay, mEventQueue );
1928 while( !mBrightnessChangeDone && count < 3 )
1931 wl_display_dispatch_queue( mDisplay, mEventQueue );
1935 if( !mBrightnessChangeDone )
1937 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::GetBrightness: Error! [%d]\n", mBrightnessChangeState );
1941 DALI_LOG_INFO( gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl::GetBrightness: Brightness [%d]\n", mBrightness );
1946 bool WindowBaseEcoreWl::GrabKey( Dali::KEY key, KeyGrab::KeyGrabMode grabMode )
1948 Ecore_Wl_Window_Keygrab_Mode mode;
1952 case KeyGrab::TOPMOST:
1954 mode = ECORE_WL_WINDOW_KEYGRAB_TOPMOST;
1957 case KeyGrab::SHARED:
1959 mode = ECORE_WL_WINDOW_KEYGRAB_SHARED;
1962 case KeyGrab::OVERRIDE_EXCLUSIVE:
1964 mode = ECORE_WL_WINDOW_KEYGRAB_OVERRIDE_EXCLUSIVE;
1967 case KeyGrab::EXCLUSIVE:
1969 mode = ECORE_WL_WINDOW_KEYGRAB_EXCLUSIVE;
1978 return ecore_wl_window_keygrab_set( mEcoreWindow, KeyLookup::GetKeyName( key ), 0, 0, 0, mode );
1981 bool WindowBaseEcoreWl::UngrabKey( Dali::KEY key )
1983 return ecore_wl_window_keygrab_unset( mEcoreWindow, KeyLookup::GetKeyName( key ), 0, 0 );
1986 bool WindowBaseEcoreWl::GrabKeyList( const Dali::Vector< Dali::KEY >& key, const Dali::Vector< KeyGrab::KeyGrabMode >& grabMode, Dali::Vector< bool >& result )
1988 int keyCount = key.Count();
1989 int keyGrabModeCount = grabMode.Count();
1991 if( keyCount != keyGrabModeCount || keyCount == 0 )
1998 Eina_List* keyList = NULL;
1999 Ecore_Wl_Window_Keygrab_Info* info = new Ecore_Wl_Window_Keygrab_Info[keyCount];
2001 for( int index = 0; index < keyCount; ++index )
2003 info[index].key = const_cast< char* >( KeyLookup::GetKeyName( key[index] ) );
2005 switch( grabMode[index] )
2007 case KeyGrab::TOPMOST:
2009 info[index].mode = ECORE_WL_WINDOW_KEYGRAB_TOPMOST;
2012 case KeyGrab::SHARED:
2014 info[index].mode = ECORE_WL_WINDOW_KEYGRAB_SHARED;
2017 case KeyGrab::OVERRIDE_EXCLUSIVE:
2019 info[index].mode = ECORE_WL_WINDOW_KEYGRAB_OVERRIDE_EXCLUSIVE;
2022 case KeyGrab::EXCLUSIVE:
2024 info[index].mode = ECORE_WL_WINDOW_KEYGRAB_EXCLUSIVE;
2029 info[index].mode = ECORE_WL_WINDOW_KEYGRAB_UNKNOWN;
2034 keyList = eina_list_append( keyList, &info );
2037 Eina_List* grabList = ecore_wl_window_keygrab_list_set( mEcoreWindow, keyList );
2039 result.Resize( keyCount, true );
2041 Eina_List* l = NULL;
2042 Eina_List* m = NULL;
2043 void* listData = NULL;
2045 if( grabList != NULL )
2047 EINA_LIST_FOREACH( grabList, m, data )
2050 EINA_LIST_FOREACH( keyList, l, listData )
2052 if( static_cast< Ecore_Wl_Window_Keygrab_Info* >( listData )->key == NULL )
2054 DALI_LOG_ERROR( "input key list has null data!" );
2058 if( strcmp( static_cast< char* >( data ), static_cast< Ecore_Wl_Window_Keygrab_Info* >( listData )->key ) == 0 )
2060 result[index] = false;
2069 eina_list_free( keyList );
2070 eina_list_free( grabList );
2076 bool WindowBaseEcoreWl::UngrabKeyList( const Dali::Vector< Dali::KEY >& key, Dali::Vector< bool >& result )
2078 int keyCount = key.Count();
2086 Eina_List* keyList = NULL;
2087 Ecore_Wl_Window_Keygrab_Info* info = new Ecore_Wl_Window_Keygrab_Info[keyCount];
2089 for( int index = 0; index < keyCount; ++index )
2091 info[index].key = const_cast< char* >( KeyLookup::GetKeyName( key[index] ) );
2092 keyList = eina_list_append( keyList, &info );
2095 Eina_List* ungrabList = ecore_wl_window_keygrab_list_unset( mEcoreWindow, keyList );
2097 result.Resize( keyCount, true );
2099 Eina_List* l = NULL;
2100 Eina_List* m = NULL;
2101 void *listData = NULL;
2104 if( ungrabList != NULL )
2106 EINA_LIST_FOREACH( ungrabList, m, data )
2109 EINA_LIST_FOREACH( keyList, l, listData )
2111 if( strcmp( static_cast< char* >( data ), static_cast< Ecore_Wl_Window_Keygrab_Info* >( listData )->key ) == 0 )
2113 result[index] = false;
2122 eina_list_free( keyList );
2123 eina_list_free( ungrabList );
2129 void WindowBaseEcoreWl::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical )
2134 // 1 inch = 25.4 millimeters
2135 xres = ecore_wl_dpi_get();
2136 yres = ecore_wl_dpi_get();
2138 dpiHorizontal = int( xres + 0.5f ); // rounding
2139 dpiVertical = int( yres + 0.5f );
2142 int WindowBaseEcoreWl::GetScreenRotationAngle()
2146 if( ecore_wl_window_ignore_output_transform_get( mEcoreWindow ) )
2152 transform = ecore_wl_output_transform_get( ecore_wl_window_output_find( mEcoreWindow ) );
2155 return transform * 90;
2158 void WindowBaseEcoreWl::SetWindowRotationAngle( int degree )
2160 ecore_wl_window_rotation_set( mEcoreWindow, degree );
2163 void WindowBaseEcoreWl::WindowRotationCompleted( int degree, int width, int height )
2165 ecore_wl_window_rotation_change_done_send( mEcoreWindow );
2168 void WindowBaseEcoreWl::SetTransparency( bool transparent )
2170 ecore_wl_window_alpha_set( mEcoreWindow, transparent );
2173 void WindowBaseEcoreWl::InitializeEcoreElDBus()
2175 #ifdef DALI_ELDBUS_AVAILABLE
2176 Eldbus_Object* object;
2177 Eldbus_Proxy* manager;
2179 if( !( mSystemConnection = eldbus_connection_get( ELDBUS_CONNECTION_TYPE_SYSTEM ) ) )
2181 DALI_LOG_ERROR( "Unable to get system bus\n" );
2184 object = eldbus_object_get( mSystemConnection, BUS, PATH );
2187 DALI_LOG_ERROR( "Getting object failed\n" );
2191 manager = eldbus_proxy_get( object, INTERFACE );
2194 DALI_LOG_ERROR( "Getting proxy failed\n" );
2198 if( !eldbus_proxy_signal_handler_add( manager, "GestureDetected", EcoreElDBusAccessibilityNotification, this ) )
2200 DALI_LOG_ERROR( "No signal handler returned\n" );
2205 void WindowBaseEcoreWl::CreateWindow( PositionSize positionSize )
2207 mEcoreWindow = ecore_wl_window_new( 0, positionSize.x, positionSize.y, positionSize.width, positionSize.height, ECORE_WL_WINDOW_BUFFER_TYPE_EGL_WINDOW );
2209 if ( mEcoreWindow == 0 )
2211 DALI_ASSERT_ALWAYS( 0 && "Failed to create Wayland window" );
2215 } // namespace Adaptor
2217 } // namespace Internal
2221 #pragma GCC diagnostic pop