From: suhyung Eom Date: Wed, 10 Aug 2016 08:54:58 +0000 (+0900) Subject: Implement detent event handler for wayland X-Git-Tag: dali_1.2.2~8^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F63%2F83363%2F1;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Implement detent event handler for wayland Signed-off-by: suhyung Eom Change-Id: I4c04e73b6ff5e1331e1dde41f19e59444201b61f --- diff --git a/adaptors/ecore/wayland/event-handler-ecore-wl.cpp b/adaptors/ecore/wayland/event-handler-ecore-wl.cpp index 1d38c49..84a8aa2 100644 --- a/adaptors/ecore/wayland/event-handler-ecore-wl.cpp +++ b/adaptors/ecore/wayland/event-handler-ecore-wl.cpp @@ -193,6 +193,8 @@ struct EventHandler::Impl mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_KEY_DOWN, EcoreEventKeyDown, handler ) ); mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_KEY_UP, EcoreEventKeyUp, handler ) ); + // Register Detent event + mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_DETENT_ROTATE, EcoreEventDetent, handler) ); #ifndef DALI_PROFILE_UBUNTU // Register Vconf notify - font name and size vconf_notify_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontNameChanged, handler ); @@ -649,6 +651,22 @@ struct EventHandler::Impl return ECORE_CALLBACK_PASS_ON; } + /** + * Called when detent event is recevied + */ + static Eina_Bool EcoreEventDetent( void* data, int type, void* event ) + { + DALI_LOG_INFO(gSelectionEventLogFilter, Debug::Concise, "EcoreEventDetent\n" ); + EventHandler* handler( (EventHandler*)data ); + Ecore_Event_Detent_Rotate *e((Ecore_Event_Detent_Rotate *)event); + int direction = (e->direction == ECORE_DETENT_DIRECTION_CLOCKWISE) ? 1 : -1; + int timeStamp = e->timestamp; + + WheelEvent wheelEvent( WheelEvent::CUSTOM_WHEEL, 0, 0, Vector2(0.0f, 0.0f), direction, timeStamp ); + handler->SendWheelEvent( wheelEvent ); + return ECORE_CALLBACK_PASS_ON; + } + ///////////////////////////////////////////////////////////////////////////////////////////////// // Font Callbacks /////////////////////////////////////////////////////////////////////////////////////////////////