Remove duplicated implementation of IMF Manager
[platform/core/uifw/dali-adaptor.git] / adaptors / x11 / key-grab-x.cpp
index 8fc44fa..e176db4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2016 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.
@@ -19,7 +19,6 @@
 #include <key-grab.h>
 
 // EXTERNAL INCLUDES
-#include <Ecore.h>
 #include <Ecore_X.h>
 #include <utilX.h>
 
@@ -34,10 +33,20 @@ namespace Dali
 namespace KeyGrab
 {
 
+bool GrabKeyTopmost( Window window, Dali::KEY daliKey )
+{
+  return GrabKey( window, daliKey, TOPMOST);
+}
+
+bool UngrabKeyTopmost( Window window, Dali::KEY daliKey )
+{
+  return UngrabKey( window, daliKey );
+}
+
 bool GrabKey( Window window, Dali::KEY daliKey, KeyGrabMode grabMode )
 {
   int xGrabMode;
-  if( grabMode == TOP_POSITION )
+  if( grabMode == TOPMOST )
   {
     xGrabMode = TOP_POSITION_GRAB;
   }
@@ -45,6 +54,14 @@ bool GrabKey( Window window, Dali::KEY daliKey, KeyGrabMode grabMode )
   {
     xGrabMode = SHARED_GRAB;
   }
+  else if( grabMode == OVERRIDE_EXCLUSIVE )
+  {
+    xGrabMode = OR_EXCLUSIVE_GRAB;
+  }
+  else if( grabMode == EXCLUSIVE )
+  {
+    xGrabMode = EXCLUSIVE_GRAB;
+  }
   else
   {
     return false;