2 * Copyright (c) 2015 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 <events/event-handler.h>
23 #include <Ecore_Input.h>
24 #include <ecore-wl-render-surface.h>
29 #ifndef DALI_PROFILE_UBUNTU
31 #include <vconf-keys.h>
32 #endif // DALI_PROFILE_UBUNTU
34 #ifdef DALI_ELDBUS_AVAILABLE
36 #endif // DALI_ELDBUS_AVAILABLE
38 #include <dali/public-api/common/vector-wrapper.h>
39 #include <dali/public-api/events/touch-point.h>
40 #include <dali/public-api/events/key-event.h>
41 #include <dali/public-api/events/wheel-event.h>
42 #include <dali/integration-api/debug.h>
43 #include <dali/integration-api/events/key-event-integ.h>
44 #include <dali/integration-api/events/touch-event-integ.h>
45 #include <dali/integration-api/events/hover-event-integ.h>
46 #include <dali/integration-api/events/wheel-event-integ.h>
47 #include <dali/devel-api/events/key-event-devel.h>
50 #include <events/gesture-manager.h>
51 #include <window-render-surface.h>
52 #include <clipboard-impl.h>
54 #include <physical-keyboard-impl.h>
55 #include <style-monitor-impl.h>
56 #include <base/core-event-interface.h>
57 #include <virtual-keyboard.h>
68 #if defined(DEBUG_ENABLED)
71 Integration::Log::Filter* gTouchEventLogFilter = Integration::Log::Filter::New(Debug::NoLogging, false, "LOG_ADAPTOR_EVENTS_TOUCH");
72 Integration::Log::Filter* gDragAndDropLogFilter = Integration::Log::Filter::New(Debug::NoLogging, false, "LOG_ADAPTOR_EVENTS_DND");
73 Integration::Log::Filter* gImfLogging = Integration::Log::Filter::New(Debug::NoLogging, false, "LOG_ADAPTOR_EVENTS_IMF");
74 Integration::Log::Filter* gSelectionEventLogFilter = Integration::Log::Filter::New(Debug::NoLogging, false, "LOG_ADAPTOR_EVENTS_SELECTION");
75 } // unnamed namespace
83 const char* BUS = "org.enlightenment.wm-screen-reader";
84 const char* INTERFACE = "org.tizen.GestureNavigation";
85 const char* PATH = "/org/tizen/GestureNavigation";
87 const unsigned int PRIMARY_TOUCH_BUTTON_ID( 1 );
89 const unsigned int BYTES_PER_CHARACTER_FOR_ATTRIBUTES = 3;
92 * Ecore_Event_Modifier enums in Ecore_Input.h do not match Ecore_IMF_Keyboard_Modifiers in Ecore_IMF.h.
93 * This function converts from Ecore_Event_Modifier to Ecore_IMF_Keyboard_Modifiers enums.
94 * @param[in] ecoreModifier the Ecore_Event_Modifier input.
95 * @return the Ecore_IMF_Keyboard_Modifiers output.
97 Ecore_IMF_Keyboard_Modifiers EcoreInputModifierToEcoreIMFModifier(unsigned int ecoreModifier)
99 int modifier( ECORE_IMF_KEYBOARD_MODIFIER_NONE ); // If no other matches returns NONE.
102 if ( ecoreModifier & ECORE_EVENT_MODIFIER_SHIFT ) // enums from ecore_input/Ecore_Input.h
104 modifier |= ECORE_IMF_KEYBOARD_MODIFIER_SHIFT; // enums from ecore_imf/ecore_imf.h
107 if ( ecoreModifier & ECORE_EVENT_MODIFIER_ALT )
109 modifier |= ECORE_IMF_KEYBOARD_MODIFIER_ALT;
112 if ( ecoreModifier & ECORE_EVENT_MODIFIER_CTRL )
114 modifier |= ECORE_IMF_KEYBOARD_MODIFIER_CTRL;
117 if ( ecoreModifier & ECORE_EVENT_MODIFIER_WIN )
119 modifier |= ECORE_IMF_KEYBOARD_MODIFIER_WIN;
122 if ( ecoreModifier & ECORE_EVENT_MODIFIER_ALTGR )
124 modifier |= ECORE_IMF_KEYBOARD_MODIFIER_ALTGR;
127 return static_cast<Ecore_IMF_Keyboard_Modifiers>( modifier );
131 // Copied from x server
132 static unsigned int GetCurrentMilliSeconds(void)
137 static clockid_t clockid;
141 #ifdef CLOCK_MONOTONIC_COARSE
142 if (clock_getres(CLOCK_MONOTONIC_COARSE, &tp) == 0 &&
143 (tp.tv_nsec / 1000) <= 1000 && clock_gettime(CLOCK_MONOTONIC_COARSE, &tp) == 0)
145 clockid = CLOCK_MONOTONIC_COARSE;
149 if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
151 clockid = CLOCK_MONOTONIC;
158 if (clockid != ~0L && clock_gettime(clockid, &tp) == 0)
160 return (tp.tv_sec * 1000) + (tp.tv_nsec / 1000000L);
163 gettimeofday(&tv, NULL);
164 return (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
167 #ifndef DALI_PROFILE_UBUNTU
168 const char * DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE = "db/setting/accessibility/font_name"; // It will be update at vconf-key.h and replaced.
169 #endif // DALI_PROFILE_UBUNTU
172 * Get the device name from the provided ecore key event
174 void GetDeviceName( Ecore_Event_Key* keyEvent, std::string& result )
176 const char* ecoreDeviceName = ecore_device_name_get( keyEvent->dev );
178 if ( ecoreDeviceName )
180 result = ecoreDeviceName;
185 * Get the device class from the provided ecore key event
187 void GetDeviceClass( Ecore_Event_Key* keyEvent, DevelKeyEvent::DeviceClass::Type& deviceClass )
189 Ecore_Device_Class ecoreDeviceClass = ecore_device_class_get( keyEvent->dev );
191 switch( ecoreDeviceClass )
193 case ECORE_DEVICE_CLASS_SEAT:
195 deviceClass = DevelKeyEvent::DeviceClass::USER;
198 case ECORE_DEVICE_CLASS_KEYBOARD:
200 deviceClass = DevelKeyEvent::DeviceClass::KEYBOARD;
203 case ECORE_DEVICE_CLASS_MOUSE:
205 deviceClass = DevelKeyEvent::DeviceClass::MOUSE;
208 case ECORE_DEVICE_CLASS_TOUCH:
210 deviceClass = DevelKeyEvent::DeviceClass::TOUCH;
213 case ECORE_DEVICE_CLASS_PEN:
215 deviceClass = DevelKeyEvent::DeviceClass::PEN;
218 case ECORE_DEVICE_CLASS_POINTER:
220 deviceClass = DevelKeyEvent::DeviceClass::POINTER;
223 case ECORE_DEVICE_CLASS_GAMEPAD:
225 deviceClass = DevelKeyEvent::DeviceClass::GAMEPAD;
230 deviceClass = DevelKeyEvent::DeviceClass::NONE;
236 } // unnamed namespace
238 // Impl to hide EFL implementation.
239 struct EventHandler::Impl
241 // Construction & Destruction
246 Impl( EventHandler* handler, Ecore_Wl_Window* window )
247 : mHandler( handler ),
248 mEcoreEventHandler(),
250 #ifdef DALI_ELDBUS_AVAILABLE
251 , mSystemConnection( NULL )
252 #endif // DALI_ELDBUS_AVAILABLE
254 // Only register for touch and key events if we have a window
257 // Register Touch events
258 mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_MOUSE_BUTTON_DOWN, EcoreEventMouseButtonDown, handler ) );
259 mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_MOUSE_BUTTON_UP, EcoreEventMouseButtonUp, handler ) );
260 mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_MOUSE_MOVE, EcoreEventMouseButtonMove, handler ) );
261 mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_MOUSE_OUT, EcoreEventMouseButtonUp, handler ) ); // process mouse out event like up event
262 mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_MOUSE_BUTTON_CANCEL, EcoreEventMouseButtonCancel, handler ) );
264 // Register Mouse wheel events
265 mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_MOUSE_WHEEL, EcoreEventMouseWheel, handler ) );
267 // Register Focus events
268 mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_WL_EVENT_FOCUS_IN, EcoreEventWindowFocusIn, handler ) );
269 mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_WL_EVENT_FOCUS_OUT, EcoreEventWindowFocusOut, handler ) );
271 // Register Key events
272 mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_KEY_DOWN, EcoreEventKeyDown, handler ) );
273 mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_KEY_UP, EcoreEventKeyUp, handler ) );
275 // Register Selection event - clipboard selection
276 mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_WL_EVENT_DATA_SOURCE_SEND, EcoreEventDataSend, handler ) );
277 mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_WL_EVENT_SELECTION_DATA_READY, EcoreEventDataReceive, handler ) );
279 // Register Rotate event
280 mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_WL_EVENT_WINDOW_ROTATE, EcoreEventRotate, handler) );
282 // Register Detent event
283 mEcoreEventHandler.push_back( ecore_event_handler_add( ECORE_EVENT_DETENT_ROTATE, EcoreEventDetent, handler) );
285 #ifndef DALI_PROFILE_UBUNTU
286 // Register Vconf notify - font name and size
287 vconf_notify_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontNameChanged, handler );
288 vconf_notify_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontSizeChanged, handler );
289 #endif // DALI_PROFILE_UBUNTU
291 #ifdef DALI_ELDBUS_AVAILABLE
292 // Initialize ElDBus.
293 DALI_LOG_INFO( gImfLogging, Debug::General, "Starting DBus Initialization\n" );
296 EcoreElDBusInitialisation( handler );
298 DALI_LOG_INFO( gImfLogging, Debug::General, "Finished DBus Initialization\n" );
299 #endif // DALI_ELDBUS_AVAILABLE
308 #ifndef DALI_PROFILE_UBUNTU
309 vconf_ignore_key_changed( VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontSizeChanged );
310 vconf_ignore_key_changed( DALI_VCONFKEY_SETAPPL_ACCESSIBILITY_FONT_SIZE, VconfNotifyFontNameChanged );
311 #endif // DALI_PROFILE_UBUNTU
313 for( std::vector<Ecore_Event_Handler*>::iterator iter = mEcoreEventHandler.begin(), endIter = mEcoreEventHandler.end(); iter != endIter; ++iter )
315 ecore_event_handler_del( *iter );
318 #ifdef DALI_ELDBUS_AVAILABLE
319 // Close down ElDBus connections.
320 if( mSystemConnection )
322 eldbus_connection_unref( mSystemConnection );
324 #endif // DALI_ELDBUS_AVAILABLE
329 /////////////////////////////////////////////////////////////////////////////////////////////////
331 /////////////////////////////////////////////////////////////////////////////////////////////////
334 * Called when a touch down is received.
336 static Eina_Bool EcoreEventMouseButtonDown( void* data, int type, void* event )
338 Ecore_Event_Mouse_Button *touchEvent( (Ecore_Event_Mouse_Button*)event );
339 EventHandler* handler( (EventHandler*)data );
341 if ( touchEvent->window == (unsigned int)ecore_wl_window_id_get(handler->mImpl->mWindow) )
343 PointState::Type state ( PointState::DOWN );
345 // Check if the buttons field is set and ensure it's the primary touch button.
346 // If this event was triggered by buttons other than the primary button (used for touch), then
347 // just send an interrupted event to Core.
348 if ( touchEvent->buttons && (touchEvent->buttons != PRIMARY_TOUCH_BUTTON_ID ) )
350 state = PointState::INTERRUPTED;
353 Integration::Point point;
354 point.SetDeviceId( touchEvent->multi.device );
355 point.SetState( state );
356 point.SetScreenPosition( Vector2( touchEvent->x, touchEvent->y ) );
357 point.SetRadius( touchEvent->multi.radius, Vector2( touchEvent->multi.radius_x, touchEvent->multi.radius_y ) );
358 point.SetPressure( touchEvent->multi.pressure );
359 point.SetAngle( Degree( touchEvent->multi.angle ) );
360 handler->SendEvent( point, touchEvent->timestamp );
363 return ECORE_CALLBACK_PASS_ON;
367 * Called when a touch up is received.
369 static Eina_Bool EcoreEventMouseButtonUp( void* data, int type, void* event )
371 Ecore_Event_Mouse_Button *touchEvent( (Ecore_Event_Mouse_Button*)event );
372 EventHandler* handler( (EventHandler*)data );
374 if ( touchEvent->window == (unsigned int)ecore_wl_window_id_get(handler->mImpl->mWindow) )
376 Integration::Point point;
377 point.SetDeviceId( touchEvent->multi.device );
378 point.SetState( PointState::UP );
379 point.SetScreenPosition( Vector2( touchEvent->x, touchEvent->y ) );
380 point.SetRadius( touchEvent->multi.radius, Vector2( touchEvent->multi.radius_x, touchEvent->multi.radius_y ) );
381 point.SetPressure( touchEvent->multi.pressure );
382 point.SetAngle( Degree( touchEvent->multi.angle ) );
383 handler->SendEvent( point, touchEvent->timestamp );
386 return ECORE_CALLBACK_PASS_ON;
390 * Called when a touch motion is received.
392 static Eina_Bool EcoreEventMouseButtonMove( void* data, int type, void* event )
394 Ecore_Event_Mouse_Move *touchEvent( (Ecore_Event_Mouse_Move*)event );
395 EventHandler* handler( (EventHandler*)data );
397 if ( touchEvent->window == (unsigned int)ecore_wl_window_id_get(handler->mImpl->mWindow) )
399 Integration::Point point;
400 point.SetDeviceId( touchEvent->multi.device );
401 point.SetState( PointState::MOTION );
402 point.SetScreenPosition( Vector2( touchEvent->x, touchEvent->y ) );
403 point.SetRadius( touchEvent->multi.radius, Vector2( touchEvent->multi.radius_x, touchEvent->multi.radius_y ) );
404 point.SetPressure( touchEvent->multi.pressure );
405 point.SetAngle( Degree( touchEvent->multi.angle ) );
406 handler->SendEvent( point, touchEvent->timestamp );
409 return ECORE_CALLBACK_PASS_ON;
413 * Called when a touch is canceled.
415 static Eina_Bool EcoreEventMouseButtonCancel( void* data, int type, void* event )
417 Ecore_Event_Mouse_Button *touchEvent( (Ecore_Event_Mouse_Button*)event );
418 EventHandler* handler( (EventHandler*)data );
420 if( touchEvent->window == (unsigned int)ecore_wl_window_id_get( handler->mImpl->mWindow ) )
422 Integration::Point point;
423 point.SetDeviceId( touchEvent->multi.device );
424 point.SetState( PointState::INTERRUPTED );
425 point.SetScreenPosition( Vector2( 0.0f, 0.0f ) );
426 handler->SendEvent( point, touchEvent->timestamp );
428 DALI_LOG_INFO( gImfLogging, Debug::General, "EVENT EcoreEventMouseButtonCancel\n" );
431 return ECORE_CALLBACK_PASS_ON;
435 * Called when a mouse wheel is received.
437 static Eina_Bool EcoreEventMouseWheel( void* data, int type, void* event )
439 Ecore_Event_Mouse_Wheel *mouseWheelEvent( (Ecore_Event_Mouse_Wheel*)event );
441 DALI_LOG_INFO( gImfLogging, Debug::General, "EVENT Ecore_Event_Mouse_Wheel: direction: %d, modifiers: %d, x: %d, y: %d, z: %d\n", mouseWheelEvent->direction, mouseWheelEvent->modifiers, mouseWheelEvent->x, mouseWheelEvent->y, mouseWheelEvent->z);
443 EventHandler* handler( (EventHandler*)data );
444 if ( mouseWheelEvent->window == (unsigned int)ecore_wl_window_id_get(handler->mImpl->mWindow) )
446 WheelEvent wheelEvent( WheelEvent::MOUSE_WHEEL, mouseWheelEvent->direction, mouseWheelEvent->modifiers, Vector2(mouseWheelEvent->x, mouseWheelEvent->y), mouseWheelEvent->z, mouseWheelEvent->timestamp );
447 handler->SendWheelEvent( wheelEvent );
449 return ECORE_CALLBACK_PASS_ON;
452 /////////////////////////////////////////////////////////////////////////////////////////////////
454 /////////////////////////////////////////////////////////////////////////////////////////////////
457 * Called when a key down is received.
459 static Eina_Bool EcoreEventKeyDown( void* data, int type, void* event )
461 DALI_LOG_INFO( gImfLogging, Debug::General, "EVENT >>EcoreEventKeyDown \n" );
463 EventHandler* handler( (EventHandler*)data );
464 Ecore_Event_Key *keyEvent( (Ecore_Event_Key*)event );
465 bool eventHandled( false );
467 // If a device key then skip ecore_imf_context_filter_event.
468 if ( ! KeyLookup::IsDeviceButton( keyEvent->keyname ) )
470 Ecore_IMF_Context* imfContext = NULL;
471 Dali::ImfManager imfManager( ImfManager::Get() );
474 imfContext = ImfManager::GetImplementation( imfManager ).GetContext();
479 // We're consuming key down event so we have to pass to IMF so that it can parse it as well.
480 Ecore_IMF_Event_Key_Down ecoreKeyDownEvent;
481 ecoreKeyDownEvent.keyname = keyEvent->keyname;
482 ecoreKeyDownEvent.key = keyEvent->key;
483 ecoreKeyDownEvent.string = keyEvent->string;
484 ecoreKeyDownEvent.compose = keyEvent->compose;
485 ecoreKeyDownEvent.timestamp = keyEvent->timestamp;
486 ecoreKeyDownEvent.modifiers = EcoreInputModifierToEcoreIMFModifier ( keyEvent->modifiers );
487 ecoreKeyDownEvent.locks = (Ecore_IMF_Keyboard_Locks) ECORE_IMF_KEYBOARD_LOCK_NONE;
488 ecoreKeyDownEvent.dev_name = "";
489 ecoreKeyDownEvent.dev_class = ECORE_IMF_DEVICE_CLASS_KEYBOARD;
490 ecoreKeyDownEvent.dev_subclass = ECORE_IMF_DEVICE_SUBCLASS_NONE;
492 std::string checkDevice;
493 GetDeviceName( keyEvent, checkDevice );
495 // If the device is IME and the focused key is the direction keys, then we should send a key event to move a key cursor.
496 if( ( checkDevice == "ime" ) && ( ( !strncmp( keyEvent->keyname, "Left", 4 ) ) ||
497 ( !strncmp( keyEvent->keyname, "Right", 5 ) ) ||
498 ( !strncmp( keyEvent->keyname, "Up", 2 ) ) ||
499 ( !strncmp( keyEvent->keyname, "Down", 4 ) ) ) )
505 eventHandled = ecore_imf_context_filter_event( imfContext,
506 ECORE_IMF_EVENT_KEY_DOWN,
507 (Ecore_IMF_Event *) &ecoreKeyDownEvent );
510 // If the event has not been handled by IMF then check if we should reset our IMF context
513 if ( !strcmp( keyEvent->keyname, "Escape" ) ||
514 !strcmp( keyEvent->keyname, "Return" ) ||
515 !strcmp( keyEvent->keyname, "KP_Enter" ) )
517 ecore_imf_context_reset( imfContext );
523 // If the event wasn't handled then we should send a key event.
526 if ( keyEvent->window == (unsigned int)ecore_wl_window_id_get(handler->mImpl->mWindow) )
528 std::string keyName( keyEvent->keyname );
529 std::string keyString( "" );
530 int keyCode = KeyLookup::GetDaliKeyCode( keyEvent->keyname);
531 keyCode = (keyCode == -1) ? 0 : keyCode;
532 int modifier( keyEvent->modifiers );
533 unsigned long time = keyEvent->timestamp;
534 if (!strncmp(keyEvent->keyname, "Keycode-", 8))
535 keyCode = atoi(keyEvent->keyname + 8);
537 // Ensure key event string is not NULL as keys like SHIFT have a null string.
538 if ( keyEvent->string )
540 keyString = keyEvent->string;
543 std::string deviceName;
544 DevelKeyEvent::DeviceClass::Type deviceClass;
546 GetDeviceName( keyEvent, deviceName );
547 GetDeviceClass( keyEvent, deviceClass );
549 DALI_LOG_INFO( gImfLogging, Debug::Verbose, "EVENT EcoreEventKeyDown - >>EcoreEventKeyDown deviceName(%s) deviceClass(%d)\n", deviceName.c_str(), deviceClass );
551 Integration::KeyEvent keyEvent(keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Down, deviceName, deviceClass );
552 handler->SendEvent( keyEvent );
556 return ECORE_CALLBACK_PASS_ON;
560 * Called when a key up is received.
562 static Eina_Bool EcoreEventKeyUp( void* data, int type, void* event )
564 DALI_LOG_INFO( gImfLogging, Debug::General, "EVENT >>EcoreEventKeyUp\n" );
566 EventHandler* handler( (EventHandler*)data );
567 Ecore_Event_Key *keyEvent( (Ecore_Event_Key*)event );
568 bool eventHandled( false );
570 // Device keys like Menu, home, back button must skip ecore_imf_context_filter_event.
571 if ( ! KeyLookup::IsDeviceButton( keyEvent->keyname ) )
573 Ecore_IMF_Context* imfContext = NULL;
574 Dali::ImfManager imfManager( ImfManager::Get() );
577 imfContext = ImfManager::GetImplementation( imfManager ).GetContext();
582 // We're consuming key up event so we have to pass to IMF so that it can parse it as well.
583 Ecore_IMF_Event_Key_Up ecoreKeyUpEvent;
584 ecoreKeyUpEvent.keyname = keyEvent->keyname;
585 ecoreKeyUpEvent.key = keyEvent->key;
586 ecoreKeyUpEvent.string = keyEvent->string;
587 ecoreKeyUpEvent.compose = keyEvent->compose;
588 ecoreKeyUpEvent.timestamp = keyEvent->timestamp;
589 ecoreKeyUpEvent.modifiers = EcoreInputModifierToEcoreIMFModifier ( keyEvent->modifiers );
590 ecoreKeyUpEvent.locks = (Ecore_IMF_Keyboard_Locks) ECORE_IMF_KEYBOARD_LOCK_NONE;
591 ecoreKeyUpEvent.dev_name = "";
592 ecoreKeyUpEvent.dev_class = ECORE_IMF_DEVICE_CLASS_KEYBOARD;
593 ecoreKeyUpEvent.dev_subclass = ECORE_IMF_DEVICE_SUBCLASS_NONE;
595 eventHandled = ecore_imf_context_filter_event( imfContext,
596 ECORE_IMF_EVENT_KEY_UP,
597 (Ecore_IMF_Event *) &ecoreKeyUpEvent );
601 // If the event wasn't handled then we should send a key event.
604 if ( keyEvent->window == (unsigned int)ecore_wl_window_id_get(handler->mImpl->mWindow) )
606 std::string keyName( keyEvent->keyname );
607 std::string keyString( "" );
608 int keyCode = KeyLookup::GetDaliKeyCode( keyEvent->keyname);
609 keyCode = (keyCode == -1) ? 0 : keyCode;
610 int modifier( keyEvent->modifiers );
611 unsigned long time = keyEvent->timestamp;
612 if (!strncmp(keyEvent->keyname, "Keycode-", 8))
613 keyCode = atoi(keyEvent->keyname + 8);
615 // Ensure key event string is not NULL as keys like SHIFT have a null string.
616 if ( keyEvent->string )
618 keyString = keyEvent->string;
621 std::string deviceName;
622 DevelKeyEvent::DeviceClass::Type deviceClass;
624 GetDeviceName( keyEvent, deviceName );
625 GetDeviceClass( keyEvent, deviceClass );
627 Integration::KeyEvent keyEvent(keyName, keyString, keyCode, modifier, time, Integration::KeyEvent::Up, deviceName, deviceClass );
628 handler->SendEvent( keyEvent );
632 return ECORE_CALLBACK_PASS_ON;
635 /////////////////////////////////////////////////////////////////////////////////////////////////
637 /////////////////////////////////////////////////////////////////////////////////////////////////
640 * Called when the window gains focus.
642 static Eina_Bool EcoreEventWindowFocusIn( void* data, int type, void* event )
644 Ecore_Wl_Event_Focus_In* focusInEvent( (Ecore_Wl_Event_Focus_In*)event );
645 EventHandler* handler( (EventHandler*)data );
647 DALI_LOG_INFO( gImfLogging, Debug::General, "EVENT >>EcoreEventWindowFocusIn \n" );
649 // If the window gains focus and we hid the keyboard then show it again.
650 if ( focusInEvent->win == (unsigned int)ecore_wl_window_id_get(handler->mImpl->mWindow) )
652 DALI_LOG_INFO( gImfLogging, Debug::General, "EVENT EcoreEventWindowFocusIn - >>WindowFocusGained \n" );
654 if ( ImfManager::IsAvailable() /* Only get the ImfManager if it's available as we do not want to create it */ )
656 Dali::ImfManager imfManager( ImfManager::Get() );
659 ImfManager& imfManagerImpl( ImfManager::GetImplementation( imfManager ) );
660 if( imfManagerImpl.RestoreAfterFocusLost() )
662 imfManagerImpl.Activate();
666 Dali::Clipboard clipboard = Clipboard::Get();
667 clipboard.HideClipboard();
670 return ECORE_CALLBACK_PASS_ON;
674 * Called when the window loses focus.
676 static Eina_Bool EcoreEventWindowFocusOut( void* data, int type, void* event )
678 Ecore_Wl_Event_Focus_Out* focusOutEvent( (Ecore_Wl_Event_Focus_Out*)event );
679 EventHandler* handler( (EventHandler*)data );
681 DALI_LOG_INFO( gImfLogging, Debug::General, "EVENT >>EcoreEventWindowFocusOut \n" );
683 // If the window loses focus then hide the keyboard.
684 if ( focusOutEvent->win == (unsigned int)ecore_wl_window_id_get(handler->mImpl->mWindow) )
686 if ( ImfManager::IsAvailable() /* Only get the ImfManager if it's available as we do not want to create it */ )
688 Dali::ImfManager imfManager( ImfManager::Get() );
691 ImfManager& imfManagerImpl( ImfManager::GetImplementation( imfManager ) );
692 if( imfManagerImpl.RestoreAfterFocusLost() )
694 imfManagerImpl.Deactivate();
699 // Hiding clipboard event will be ignored once because window focus out event is always received on showing clipboard
700 Dali::Clipboard clipboard = Clipboard::Get();
703 Clipboard& clipBoardImpl( GetImplementation( clipboard ) );
704 clipBoardImpl.HideClipboard(true);
708 return ECORE_CALLBACK_PASS_ON;
712 * Called when the window is damaged.
714 static Eina_Bool EcoreEventWindowDamaged(void *data, int type, void *event)
716 return ECORE_CALLBACK_PASS_ON;
720 * Called when the window properties are changed.
721 * We are only interested in the font change.
725 /////////////////////////////////////////////////////////////////////////////////////////////////
726 // Drag & Drop Callbacks
727 /////////////////////////////////////////////////////////////////////////////////////////////////
730 * Called when a dragged item enters our window's bounds.
731 * This is when items are dragged INTO our window.
733 static Eina_Bool EcoreEventDndEnter( void* data, int type, void* event )
735 DALI_LOG_INFO( gDragAndDropLogFilter, Debug::Concise, "EcoreEventDndEnter\n" );
737 return ECORE_CALLBACK_PASS_ON;
741 * Called when a dragged item is moved within our window.
742 * This is when items are dragged INTO our window.
744 static Eina_Bool EcoreEventDndPosition( void* data, int type, void* event )
746 DALI_LOG_INFO(gDragAndDropLogFilter, Debug::Concise, "EcoreEventDndPosition\n" );
748 return ECORE_CALLBACK_PASS_ON;
752 * Called when a dragged item leaves our window's bounds.
753 * This is when items are dragged INTO our window.
755 static Eina_Bool EcoreEventDndLeave( void* data, int type, void* event )
757 DALI_LOG_INFO(gDragAndDropLogFilter, Debug::Concise, "EcoreEventDndLeave\n" );
759 return ECORE_CALLBACK_PASS_ON;
763 * Called when the dragged item is dropped within our window's bounds.
764 * This is when items are dragged INTO our window.
766 static Eina_Bool EcoreEventDndDrop( void* data, int type, void* event )
768 DALI_LOG_INFO(gDragAndDropLogFilter, Debug::Concise, "EcoreEventDndDrop\n" );
770 return ECORE_CALLBACK_PASS_ON;
774 * Called when a dragged item is moved from our window and the target window has done processing it.
775 * This is when items are dragged FROM our window.
777 static Eina_Bool EcoreEventDndFinished( void* data, int type, void* event )
779 DALI_LOG_INFO(gDragAndDropLogFilter, Debug::Concise, "EcoreEventDndFinished\n" );
780 return ECORE_CALLBACK_PASS_ON;
784 * Called when a dragged item is moved from our window and the target window has sent us a status.
785 * This is when items are dragged FROM our window.
787 static Eina_Bool EcoreEventDndStatus( void* data, int type, void* event )
789 DALI_LOG_INFO(gDragAndDropLogFilter, Debug::Concise, "EcoreEventDndStatus\n" );
790 return ECORE_CALLBACK_PASS_ON;
794 * Called when the client messages (i.e. the accessibility events) are received.
796 static Eina_Bool EcoreEventClientMessage( void* data, int type, void* event )
798 return ECORE_CALLBACK_PASS_ON;
802 /////////////////////////////////////////////////////////////////////////////////////////////////
803 // ElDBus Accessibility Callbacks
804 /////////////////////////////////////////////////////////////////////////////////////////////////
806 #ifdef DALI_ELDBUS_AVAILABLE
807 // Callback for Ecore ElDBus accessibility events.
808 static void OnEcoreElDBusAccessibilityNotification( void *context EINA_UNUSED, const Eldbus_Message *message )
810 EventHandler* handler = static_cast< EventHandler* >( context );
811 // Ignore any accessibility events when paused.
812 if( handler->mPaused )
817 if( !handler->mAccessibilityAdaptor )
819 DALI_LOG_ERROR( "Invalid accessibility adaptor\n" );
823 AccessibilityAdaptor* accessibilityAdaptor( &AccessibilityAdaptor::GetImplementation( handler->mAccessibilityAdaptor ) );
824 if( !accessibilityAdaptor )
826 DALI_LOG_ERROR( "Cannot access accessibility adaptor\n" );
832 int state; // 0 - begin, 1 - ongoing, 2 - ended, 3 - aborted
835 // The string defines the arg-list's respective types.
836 if( !eldbus_message_arguments_get( message, "iiiiiiu", &gestureValue, &xS, &yS, &xE, &yE, &state, &eventTime ) )
838 DALI_LOG_ERROR( "OnEcoreElDBusAccessibilityNotification: Error getting arguments\n" );
841 DALI_LOG_INFO( gImfLogging, Debug::General, "Got gesture: Name: %d Args: %d,%d,%d,%d State: %d\n", gestureValue, xS, yS, xE, yE );
843 // Create a touch point object.
844 TouchPoint::State touchPointState( TouchPoint::Down );
847 touchPointState = TouchPoint::Down; // Mouse down.
849 else if( state == 1 )
851 touchPointState = TouchPoint::Motion; // Mouse move.
853 else if( state == 2 )
855 touchPointState = TouchPoint::Up; // Mouse up.
859 touchPointState = TouchPoint::Interrupted; // Error.
862 // Send touch event to accessibility adaptor.
863 TouchPoint point( 0, touchPointState, (float)xS, (float)yS );
865 // Perform actions based on received gestures.
866 // Note: This is seperated from the reading so we can have other input readers without changing the below code.
867 switch( gestureValue )
869 case 0: // OneFingerHover
872 accessibilityAdaptor->HandleActionReadEvent( (unsigned int)xS, (unsigned int)yS, true /* allow read again */ );
875 case 1: // TwoFingersHover
877 // In accessibility mode, scroll action should be handled when the currently focused actor is contained in scrollable control
878 accessibilityAdaptor->HandleActionScrollEvent( point, GetCurrentMilliSeconds() );
881 case 2: // ThreeFingersHover
883 // Read from top item on screen continuously.
884 accessibilityAdaptor->HandleActionReadFromTopEvent();
887 case 3: // OneFingerFlickLeft
889 // Move to previous item.
890 accessibilityAdaptor->HandleActionReadPreviousEvent();
893 case 4: // OneFingerFlickRight
895 // Move to next item.
896 accessibilityAdaptor->HandleActionReadNextEvent();
899 case 5: // OneFingerFlickUp
901 // Move to previous item.
902 accessibilityAdaptor->HandleActionPreviousEvent();
905 case 6: // OneFingerFlickDown
907 // Move to next item.
908 accessibilityAdaptor->HandleActionNextEvent();
911 case 7: // TwoFingersFlickUp
913 // Scroll up the list.
914 accessibilityAdaptor->HandleActionScrollUpEvent();
917 case 8: // TwoFingersFlickDown
919 // Scroll down the list.
920 accessibilityAdaptor->HandleActionScrollDownEvent();
923 case 9: // TwoFingersFlickLeft
925 // Scroll left to the previous page
926 accessibilityAdaptor->HandleActionPageLeftEvent();
929 case 10: // TwoFingersFlickRight
931 // Scroll right to the next page
932 accessibilityAdaptor->HandleActionPageRightEvent();
935 case 11: // ThreeFingersFlickLeft
940 case 12: // ThreeFingersFlickRight
945 case 13: // ThreeFingersFlickUp
950 case 14: // ThreeFingersFlickDown
955 case 15: // OneFingerSingleTap
958 accessibilityAdaptor->HandleActionReadEvent( (unsigned int)xS, (unsigned int)yS, true /* allow read again */ );
961 case 16: // OneFingerDoubleTap
963 // Activate selected item / active edit mode.
964 accessibilityAdaptor->HandleActionActivateEvent();
967 case 17: // OneFingerTripleTap
970 accessibilityAdaptor->HandleActionZoomEvent();
973 case 18: // TwoFingersSingleTap
975 // Pause/Resume current speech
976 accessibilityAdaptor->HandleActionReadPauseResumeEvent();
979 case 19: // TwoFingersDoubleTap
981 // Start/Stop current action
982 accessibilityAdaptor->HandleActionStartStopEvent();
985 case 20: // TwoFingersTripleTap
987 // Read information from indicator
988 accessibilityAdaptor->HandleActionReadIndicatorInformationEvent();
991 case 21: // ThreeFingersSingleTap
993 // Read from top item on screen continuously.
994 accessibilityAdaptor->HandleActionReadFromTopEvent();
997 case 22: // ThreeFingersDoubleTap
999 // Read from next item continuously.
1000 accessibilityAdaptor->HandleActionReadFromNextEvent();
1003 case 23: // ThreeFingersTripleTap
1008 case 24: // OneFingerFlickLeftReturn
1010 // Scroll up to the previous page
1011 accessibilityAdaptor->HandleActionPageUpEvent();
1014 case 25: // OneFingerFlickRightReturn
1016 // Scroll down to the next page
1017 accessibilityAdaptor->HandleActionPageDownEvent();
1020 case 26: // OneFingerFlickUpReturn
1022 // Move to the first item on screen
1023 accessibilityAdaptor->HandleActionMoveToFirstEvent();
1026 case 27: // OneFingerFlickDownReturn
1028 // Move to the last item on screen
1029 accessibilityAdaptor->HandleActionMoveToLastEvent();
1032 case 28: // TwoFingersFlickLeftReturn
1037 case 29: // TwoFingersFlickRightReturn
1042 case 30: // TwoFingersFlickUpReturn
1047 case 31: // TwoFingersFlickDownReturn
1052 case 32: // ThreeFingersFlickLeftReturn
1057 case 33: // ThreeFingersFlickRightReturn
1062 case 34: // ThreeFingersFlickUpReturn
1067 case 35: // ThreeFingersFlickDownReturn
1075 void EcoreElDBusInitialisation( void *handle )
1077 Eldbus_Object *object;
1078 Eldbus_Proxy *manager;
1080 if( !( mSystemConnection = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SYSTEM) ) )
1082 DALI_LOG_ERROR( "Unable to get system bus\n" );
1085 object = eldbus_object_get( mSystemConnection, BUS, PATH );
1088 DALI_LOG_ERROR( "Getting object failed\n" );
1092 manager = eldbus_proxy_get( object, INTERFACE );
1095 DALI_LOG_ERROR( "Getting proxy failed\n" );
1099 if( !eldbus_proxy_signal_handler_add( manager, "GestureDetected", OnEcoreElDBusAccessibilityNotification, handle ) )
1101 DALI_LOG_ERROR( "No signal handler returned\n" );
1104 #endif // DALI_ELDBUS_AVAILABLE
1107 * Called when the source window notifies us the content in clipboard is selected.
1109 static Eina_Bool EcoreEventSelectionClear( void* data, int type, void* event )
1111 DALI_LOG_INFO(gSelectionEventLogFilter, Debug::Concise, "EcoreEventSelectionClear\n" );
1112 return ECORE_CALLBACK_PASS_ON;
1116 * Called when the source window sends us about the selected content.
1117 * For example, when dragged items are dragged INTO our window or when items are selected in the clipboard.
1119 static Eina_Bool EcoreEventSelectionNotify( void* data, int type, void* event )
1121 DALI_LOG_INFO(gSelectionEventLogFilter, Debug::Concise, "EcoreEventSelectionNotify\n" );
1122 return ECORE_CALLBACK_PASS_ON;
1126 * Called when the source window notifies us the content in clipboard is selected.
1128 static Eina_Bool EcoreEventDataSend( void* data, int type, void* event )
1130 DALI_LOG_INFO(gSelectionEventLogFilter, Debug::Concise, "EcoreEventDataSend\n" );
1132 Dali::Clipboard clipboard = Clipboard::Get();
1135 Clipboard& clipBoardImpl( GetImplementation( clipboard ) );
1136 clipBoardImpl.ExcuteBuffered( true, event );
1138 return ECORE_CALLBACK_PASS_ON;
1142 * Called when the source window sends us about the selected content.
1143 * For example, when item is selected in the clipboard.
1145 static Eina_Bool EcoreEventDataReceive( void* data, int type, void* event )
1147 DALI_LOG_INFO(gSelectionEventLogFilter, Debug::Concise, "EcoreEventDataReceive\n" );
1149 EventHandler* handler( (EventHandler*)data );
1150 Dali::Clipboard clipboard = Clipboard::Get();
1151 char *selectionData = NULL;
1154 Clipboard& clipBoardImpl( GetImplementation( clipboard ) );
1155 selectionData = clipBoardImpl.ExcuteBuffered( false, event );
1157 if ( selectionData && handler->mClipboardEventNotifier )
1159 ClipboardEventNotifier& clipboardEventNotifier( ClipboardEventNotifier::GetImplementation( handler->mClipboardEventNotifier ) );
1160 std::string content( selectionData, strlen(selectionData) );
1162 clipboardEventNotifier.SetContent( content );
1163 clipboardEventNotifier.EmitContentSelectedSignal();
1165 return ECORE_CALLBACK_PASS_ON;
1169 * Called when rotate event is recevied
1171 static Eina_Bool EcoreEventRotate( void* data, int type, void* event )
1173 DALI_LOG_INFO( gSelectionEventLogFilter, Debug::Concise, "EcoreEventRotate\n" );
1175 EventHandler* handler( (EventHandler*)data );
1176 Ecore_Wl_Event_Window_Rotate* ev( (Ecore_Wl_Event_Window_Rotate*)event );
1178 if( ev->win != (unsigned int)ecore_wl_window_id_get( handler->mImpl->mWindow ) )
1180 return ECORE_CALLBACK_PASS_ON;
1183 RotationEvent rotationEvent;
1184 rotationEvent.angle = ev->angle;
1185 rotationEvent.winResize = 0;
1186 rotationEvent.width = ev->w;
1187 rotationEvent.height = ev->h;
1188 handler->SendRotationPrepareEvent( rotationEvent );
1190 return ECORE_CALLBACK_PASS_ON;
1194 * Called when detent event is recevied
1196 static Eina_Bool EcoreEventDetent( void* data, int type, void* event )
1198 DALI_LOG_INFO(gSelectionEventLogFilter, Debug::Concise, "EcoreEventDetent\n" );
1199 EventHandler* handler( (EventHandler*)data );
1200 Ecore_Event_Detent_Rotate *e((Ecore_Event_Detent_Rotate *)event);
1201 int direction = (e->direction == ECORE_DETENT_DIRECTION_CLOCKWISE) ? 1 : -1;
1202 int timeStamp = e->timestamp;
1204 WheelEvent wheelEvent( WheelEvent::CUSTOM_WHEEL, 0, 0, Vector2(0.0f, 0.0f), direction, timeStamp );
1205 handler->SendWheelEvent( wheelEvent );
1206 return ECORE_CALLBACK_PASS_ON;
1209 /////////////////////////////////////////////////////////////////////////////////////////////////
1211 /////////////////////////////////////////////////////////////////////////////////////////////////
1213 * Called when a font name is changed.
1215 static void VconfNotifyFontNameChanged( keynode_t* node, void* data )
1217 EventHandler* handler = static_cast<EventHandler*>( data );
1218 handler->SendEvent( StyleChange::DEFAULT_FONT_CHANGE );
1222 * Called when a font size is changed.
1224 static void VconfNotifyFontSizeChanged( keynode_t* node, void* data )
1226 EventHandler* handler = static_cast<EventHandler*>( data );
1227 handler->SendEvent( StyleChange::DEFAULT_FONT_SIZE_CHANGE );
1231 EventHandler* mHandler;
1232 std::vector<Ecore_Event_Handler*> mEcoreEventHandler;
1233 Ecore_Wl_Window* mWindow;
1234 #ifdef DALI_ELDBUS_AVAILABLE
1235 Eldbus_Connection* mSystemConnection;
1236 #endif // DALI_ELDBUS_AVAILABLE
1239 EventHandler::EventHandler( RenderSurface* surface, CoreEventInterface& coreEventInterface, GestureManager& gestureManager, DamageObserver& damageObserver, DragAndDropDetectorPtr dndDetector )
1240 : mCoreEventInterface( coreEventInterface ),
1241 mGestureManager( gestureManager ),
1242 mStyleMonitor( StyleMonitor::Get() ),
1243 mDamageObserver( damageObserver ),
1244 mRotationObserver( NULL ),
1245 mDragAndDropDetector( dndDetector ),
1246 mAccessibilityAdaptor( AccessibilityAdaptor::Get() ),
1247 mClipboardEventNotifier( ClipboardEventNotifier::Get() ),
1248 mClipboard( Clipboard::Get() ),
1252 Ecore_Wl_Window* window = 0;
1254 // this code only works with the Ecore RenderSurface so need to downcast
1255 ECore::WindowRenderSurface* ecoreSurface = dynamic_cast< ECore::WindowRenderSurface* >( surface );
1258 window = ecoreSurface->GetWlWindow();
1261 mImpl = new Impl(this, window);
1264 EventHandler::~EventHandler()
1271 mGestureManager.Stop();
1274 void EventHandler::SendEvent(Integration::Point& point, unsigned long timeStamp)
1278 timeStamp = GetCurrentMilliSeconds();
1281 Integration::TouchEvent touchEvent;
1282 Integration::HoverEvent hoverEvent;
1283 Integration::TouchEventCombiner::EventDispatchType type = mCombiner.GetNextTouchEvent(point, timeStamp, touchEvent, hoverEvent);
1284 if(type != Integration::TouchEventCombiner::DispatchNone )
1286 DALI_LOG_INFO(gTouchEventLogFilter, Debug::General, "%d: Device %d: Button state %d (%.2f, %.2f)\n", timeStamp, point.GetDeviceId(), point.GetState(), point.GetLocalPosition().x, point.GetLocalPosition().y);
1288 // First the touch and/or hover event & related gesture events are queued
1289 if(type == Integration::TouchEventCombiner::DispatchTouch || type == Integration::TouchEventCombiner::DispatchBoth)
1291 mCoreEventInterface.QueueCoreEvent( touchEvent );
1292 mGestureManager.SendEvent(touchEvent);
1295 if(type == Integration::TouchEventCombiner::DispatchHover || type == Integration::TouchEventCombiner::DispatchBoth)
1297 mCoreEventInterface.QueueCoreEvent( hoverEvent );
1300 // Next the events are processed with a single call into Core
1301 mCoreEventInterface.ProcessCoreEvents();
1305 void EventHandler::SendEvent(Integration::KeyEvent& keyEvent)
1307 Dali::PhysicalKeyboard physicalKeyboard = PhysicalKeyboard::Get();
1308 if ( physicalKeyboard )
1310 if ( ! KeyLookup::IsDeviceButton( keyEvent.keyName.c_str() ) )
1312 GetImplementation( physicalKeyboard ).KeyReceived( keyEvent.time > 1 );
1316 // Create send KeyEvent to Core.
1317 mCoreEventInterface.QueueCoreEvent( keyEvent );
1318 mCoreEventInterface.ProcessCoreEvents();
1321 void EventHandler::SendWheelEvent( WheelEvent& wheelEvent )
1323 // Create WheelEvent and send to Core.
1324 Integration::WheelEvent event( static_cast< Integration::WheelEvent::Type >(wheelEvent.type), wheelEvent.direction, wheelEvent.modifiers, wheelEvent.point, wheelEvent.z, wheelEvent.timeStamp );
1325 mCoreEventInterface.QueueCoreEvent( event );
1326 mCoreEventInterface.ProcessCoreEvents();
1329 void EventHandler::SendEvent( StyleChange::Type styleChange )
1331 DALI_ASSERT_DEBUG( mStyleMonitor && "StyleMonitor Not Available" );
1332 GetImplementation( mStyleMonitor ).StyleChanged(styleChange);
1335 void EventHandler::SendEvent( const DamageArea& area )
1337 mDamageObserver.OnDamaged( area );
1340 void EventHandler::SendRotationPrepareEvent( const RotationEvent& event )
1342 if( mRotationObserver != NULL )
1344 mRotationObserver->OnRotationPrepare( event );
1345 mRotationObserver->OnRotationRequest();
1349 void EventHandler::SendRotationRequestEvent( )
1351 // No need to separate event into prepare and request in wayland
1354 void EventHandler::FeedTouchPoint( TouchPoint& point, int timeStamp)
1356 Integration::Point convertedPoint( point );
1357 SendEvent(convertedPoint, timeStamp);
1360 void EventHandler::FeedWheelEvent( WheelEvent& wheelEvent )
1362 SendWheelEvent( wheelEvent );
1365 void EventHandler::FeedKeyEvent( KeyEvent& event )
1367 Integration::KeyEvent convertedEvent( event );
1368 SendEvent( convertedEvent );
1371 void EventHandler::FeedEvent( Integration::Event& event )
1373 mCoreEventInterface.QueueCoreEvent( event );
1374 mCoreEventInterface.ProcessCoreEvents();
1377 void EventHandler::Reset()
1381 // Any touch listeners should be told of the interruption.
1382 Integration::TouchEvent event;
1383 Integration::Point point;
1384 point.SetState( PointState::INTERRUPTED );
1385 event.AddPoint( point );
1387 // First the touch event & related gesture events are queued
1388 mCoreEventInterface.QueueCoreEvent( event );
1389 mGestureManager.SendEvent( event );
1391 // Next the events are processed with a single call into Core
1392 mCoreEventInterface.ProcessCoreEvents();
1395 void EventHandler::Pause()
1401 void EventHandler::Resume()
1407 void EventHandler::SetDragAndDropDetector( DragAndDropDetectorPtr detector )
1409 mDragAndDropDetector = detector;
1412 void EventHandler::SetRotationObserver( RotationObserver* observer )
1414 mRotationObserver = observer;
1417 } // namespace Adaptor
1419 } // namespace Internal