mEcoreEventHandler(),
mWindow( window ),
mXiDeviceId( 0 )
+#ifdef DALI_ELDBUS_AVAILABLE
+ , mSessionConnection( NULL ),
+ mA11yConnection( NULL )
+#endif
{
// Only register for touch and key events if we have a window
if ( window != 0 )
mXiDeviceId = xiEventMask.deviceid;
// SelectXi2Event
- xiEventMask.mask = (unsigned char*)(calloc( 1, XIMaskLen( XI_LASTEVENT ) ) );
+ Dali::Vector< unsigned char > mask;
+ std::size_t xiMaskLen = XIMaskLen( XI_LASTEVENT );
+ mask.Reserve( xiMaskLen );
+ xiEventMask.mask = mask.Begin();
+
XISetMask( xiEventMask.mask, XI_RawMotion );
- xiEventMask.mask_len = sizeof( xiEventMask.mask );
+ xiEventMask.mask_len = xiMaskLen * sizeof( unsigned char );
int ret = XISelectEvents( display, rootWindow, &xiEventMask, 1 );
if( ret == 0 )
{
DALI_LOG_INFO( gImfLogging, Debug::General, "Failed to Select Events\n" );
}
-
- free( xiEventMask.mask );
}
if( deviceInfo != NULL )
DALI_LOG_INFO( gImfLogging, Debug::General, "Starting DBus Initialization" );
eldbus_init();
- Eldbus_Connection *sessionConnection;
- sessionConnection = eldbus_connection_get( ELDBUS_CONNECTION_TYPE_SESSION );
+ mSessionConnection = eldbus_connection_get( ELDBUS_CONNECTION_TYPE_SESSION );
- Eldbus_Object *a11yObject = eldbus_object_get( sessionConnection, A11Y_BUS, A11Y_PATH );
+ Eldbus_Object *a11yObject = eldbus_object_get( mSessionConnection, A11Y_BUS, A11Y_PATH );
Eldbus_Proxy *elDBusManager = eldbus_proxy_get( a11yObject, A11Y_INTERFACE );
// Pass in handler in the cb_data field so we can access the accessibility adaptor within the callback.
#ifdef DALI_ELDBUS_AVAILABLE
// Close down ElDBus
+ if( mA11yConnection )
+ {
+ eldbus_connection_unref( mA11yConnection );
+ }
+
+ if( mSessionConnection )
+ {
+ eldbus_connection_unref( mSessionConnection );
+ }
+
eldbus_shutdown();
#endif // DALI_ELDBUS_AVAILABLE
}
Dali::ImfManager imfManager( ImfManager::Get() );
if ( imfManager )
{
- imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
+ imfContext = ImfManager::GetImplementation( imfManager ).GetContext();
}
if ( imfContext )
ecoreKeyDownEvent.timestamp = keyEvent->timestamp;
ecoreKeyDownEvent.modifiers = EcoreInputModifierToEcoreIMFModifier ( keyEvent->modifiers );
ecoreKeyDownEvent.locks = (Ecore_IMF_Keyboard_Locks) ECORE_IMF_KEYBOARD_LOCK_NONE;
+#ifdef ECORE_IMF_1_13
+ ecoreKeyDownEvent.dev_name = "";
+#endif // ECORE_IMF_1_13
eventHandled = ecore_imf_context_filter_event( imfContext,
ECORE_IMF_EVENT_KEY_DOWN,
Dali::ImfManager imfManager( ImfManager::Get() );
if ( imfManager )
{
- imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
+ imfContext = ImfManager::GetImplementation( imfManager ).GetContext();
}
if ( imfContext )
ecoreKeyUpEvent.timestamp = keyEvent->timestamp;
ecoreKeyUpEvent.modifiers = EcoreInputModifierToEcoreIMFModifier ( keyEvent->modifiers );
ecoreKeyUpEvent.locks = (Ecore_IMF_Keyboard_Locks) ECORE_IMF_KEYBOARD_LOCK_NONE;
+#ifdef ECORE_IMF_1_13
+ ecoreKeyUpEvent.dev_name = "";
+#endif // ECORE_IMF_1_13
eventHandled = ecore_imf_context_filter_event( imfContext,
ECORE_IMF_EVENT_KEY_UP,
// Callback for Ecore ElDBus accessibility events.
static void OnEcoreElDBusAccessibilityNotification( void *context EINA_UNUSED, const Eldbus_Message *message )
{
- EventHandler* handler( (EventHandler*)context );
+ EventHandler* handler = static_cast< EventHandler* >( context );
+ // Ignore any accessibility events when paused.
+ if( handler->mPaused )
+ {
+ return;
+ }
if ( !handler->mAccessibilityAdaptor )
{
Eldbus_Object *object;
Eldbus_Proxy *manager;
const char *a11yBusAddress = NULL;
+ EventHandler* handler = static_cast< EventHandler* >( handle );
// The string defines the arg-list's respective types.
if( !eldbus_message_arguments_get( message, "s", &a11yBusAddress ) )
DALI_LOG_INFO( gImfLogging, Debug::General, "Ecore ElDBus Accessibility address: %s\n", a11yBusAddress );
- Eldbus_Connection *a11yConnection = eldbus_address_connection_get( a11yBusAddress );
+ handler->mImpl->mA11yConnection = eldbus_address_connection_get( a11yBusAddress );
- object = eldbus_object_get( a11yConnection, BUS, PATH );
+ object = eldbus_object_get( handler->mImpl->mA11yConnection, BUS, PATH );
manager = eldbus_proxy_get( object, INTERFACE );
// Pass the callback data through to the signal handler.
*/
static void VconfNotifyFontSizeChanged( keynode_t* node, void* data )
{
+ DALI_LOG_INFO(gTouchEventLogFilter, Debug::Verbose, "VconfNotifyFontSizeChanged\n" );
EventHandler* handler = static_cast<EventHandler*>( data );
handler->SendEvent( StyleChange::DEFAULT_FONT_SIZE_CHANGE );
}
std::vector<Ecore_Event_Handler*> mEcoreEventHandler;
Ecore_X_Window mWindow;
int mXiDeviceId;
+
+#ifdef DALI_ELDBUS_AVAILABLE
+ Eldbus_Connection* mSessionConnection;
+ Eldbus_Connection* mA11yConnection;
+#endif
};
EventHandler::EventHandler( RenderSurface* surface, CoreEventInterface& coreEventInterface, GestureManager& gestureManager, DamageObserver& damageObserver, DragAndDropDetectorPtr dndDetector )
-: mCoreEventInterface(coreEventInterface),
+: mCoreEventInterface( coreEventInterface ),
mGestureManager( gestureManager ),
mStyleMonitor( StyleMonitor::Get() ),
mDamageObserver( damageObserver ),
mDragAndDropDetector( dndDetector ),
mAccessibilityAdaptor( AccessibilityAdaptor::Get() ),
mClipboardEventNotifier( ClipboardEventNotifier::Get() ),
- mClipboard(Clipboard::Get()),
- mImpl( NULL )
+ mClipboard( Clipboard::Get() ),
+ mImpl( NULL ),
+ mPaused( false )
{
Ecore_X_Window window = 0;
EventHandler::~EventHandler()
{
- if(mImpl)
- {
- delete mImpl;
- }
+ delete mImpl;
mGestureManager.Stop();
}
mCoreEventInterface.ProcessCoreEvents();
}
+void EventHandler::Pause()
+{
+ mPaused = true;
+ Reset();
+}
+
+void EventHandler::Resume()
+{
+ mPaused = false;
+ Reset();
+}
+
void EventHandler::SetDragAndDropDetector( DragAndDropDetectorPtr detector )
{
mDragAndDropDetector = detector;