Merge "Set alpha to wayland window by Application::New(..., OPAQUE or Transparent...
[platform/core/uifw/dali-adaptor.git] / adaptors / wayland / event-handler-wl.cpp
index 177cadc..c32bec4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -319,7 +319,7 @@ struct EventHandler::Impl
       Dali::ImfManager imfManager( ImfManager::Get() );
       if ( imfManager )
       {
-        imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
+        imfContext = ImfManager::GetImplementation( imfManager ).GetContext();
       }
 
       if ( imfContext )
@@ -390,16 +390,19 @@ struct EventHandler::Impl
     Ecore_Event_Key *keyEvent( (Ecore_Event_Key*)event );
     bool eventHandled( false );
 
-    // XF86Stop and XF86Send must skip ecore_imf_context_filter_event.
-    if ( strcmp( keyEvent->keyname, "XF86Send" )  &&
-         strcmp( keyEvent->keyname, "XF86Phone" ) &&
-         strcmp( keyEvent->keyname, "XF86Stop" ) )
+    // Menu, home, back button must skip ecore_imf_context_filter_event.
+    static const char* menuKeyName = KeyLookup::GetKeyName( DALI_KEY_MENU );
+    static const char* homeKeyName = KeyLookup::GetKeyName( DALI_KEY_HOME );
+    static const char* backKeyName = KeyLookup::GetKeyName( DALI_KEY_BACK );
+    if ( ( menuKeyName && strcmp( keyEvent->keyname, menuKeyName ) != 0 ) &&
+         ( homeKeyName && strcmp( keyEvent->keyname, homeKeyName ) != 0 ) &&
+         ( backKeyName && strcmp( keyEvent->keyname, backKeyName ) != 0 ) )
     {
       Ecore_IMF_Context* imfContext = NULL;
       Dali::ImfManager imfManager( ImfManager::Get() );
       if ( imfManager )
       {
-        imfContext = reinterpret_cast<Ecore_IMF_Context*>( imfManager.GetContext() );
+        imfContext = ImfManager::GetImplementation( imfManager ).GetContext();
       }
 
       if ( imfContext )
@@ -662,7 +665,7 @@ EventHandler::EventHandler( RenderSurface* surface, CoreEventInterface& coreEven
   mDamageObserver( damageObserver ),
   mRotationObserver( NULL ),
   mDragAndDropDetector( dndDetector ),
-  mAccessibilityManager( AccessibilityManager::Get() ),
+  mAccessibilityAdaptor( AccessibilityAdaptor::Get() ),
   mClipboardEventNotifier( ClipboardEventNotifier::Get() ),
   mClipboard(Clipboard::Get()),
   mImpl( NULL )
@@ -811,6 +814,18 @@ void EventHandler::Reset()
   mCoreEventInterface.ProcessCoreEvents();
 }
 
+void EventHandler::Pause()
+{
+  mPaused = true;
+  Reset();
+}
+
+void EventHandler::Resume()
+{
+  mPaused = false;
+  Reset();
+}
+
 void EventHandler::SetDragAndDropDetector( DragAndDropDetectorPtr detector )
 {
   mDragAndDropDetector = detector;