Revert "[Tizen] Add key grab list API" 27/132627/1
authorminho.sun <minho.sun@samsung.com>
Wed, 7 Jun 2017 02:20:54 +0000 (11:20 +0900)
committerminho.sun <minho.sun@samsung.com>
Wed, 7 Jun 2017 02:20:56 +0000 (11:20 +0900)
This reverts commit 1b312c1d48fe7574c5257c0bf7801cca47411085.

Change-Id: Ica3155e44d6852e45251f0e5590eeb8f1472aa91

adaptors/ecore/wayland/key-grab-ecore-wl.cpp [changed mode: 0755->0644]
adaptors/tizen/key-grab.h [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 85f92c3..afe3859
@@ -27,7 +27,6 @@
 #include <key-impl.h>
 
 #include <iostream>
-#include <string.h>
 using namespace std;
 
 namespace Dali
@@ -82,125 +81,6 @@ bool UngrabKey( Window window, Dali::KEY daliKey )
                                       0, 0 );
 }
 
-Dali::Vector<bool> GrabKeyList( Window window, const Dali::Vector<Dali::KEY>& daliKeyVector, const Dali::Vector<KeyGrabMode>& grabModeVector)
-{
-  Dali::Vector<bool> resultVector;
-  Eina_List *keyList = NULL, *grabList = NULL, *l = NULL, *m = NULL;
-  void *listData = NULL, *data = NULL;
-  Dali::Vector<Dali::KEY>::SizeType keyCount = daliKeyVector.Count();
-  Dali::Vector<KeyGrabMode>::SizeType keyGrabModeCount = grabModeVector.Count();
-
-
-  if(keyCount != keyGrabModeCount || keyCount == 0)
-    return resultVector;
-
-  eina_init();
-
-  for( Dali::Vector<float>::SizeType index = 0; index < keyCount; ++index )
-  {
-    Ecore_Wl_Window_Keygrab_Info *info = (Ecore_Wl_Window_Keygrab_Info*)malloc(sizeof(Ecore_Wl_Window_Keygrab_Info));
-    info->key = (char*)Dali::Internal::Adaptor::KeyLookup::GetKeyName( daliKeyVector[index] );
-
-    switch(grabModeVector[index])
-    {
-      case TOPMOST:
-        info->mode = ECORE_WL_WINDOW_KEYGRAB_TOPMOST;
-        break;
-      case SHARED:
-        info->mode = ECORE_WL_WINDOW_KEYGRAB_SHARED;
-        break;
-      case OVERRIDE_EXCLUSIVE:
-        info->mode = ECORE_WL_WINDOW_KEYGRAB_EXCLUSIVE;
-        break;
-      case EXCLUSIVE:
-        info->mode = ECORE_WL_WINDOW_KEYGRAB_OVERRIDE_EXCLUSIVE;
-        break;
-      default:
-        info->mode = ECORE_WL_WINDOW_KEYGRAB_UNKNOWN;
-        break;
-    }
-
-    keyList = eina_list_append(keyList, info);
-  }
-
-  grabList = ecore_wl_window_keygrab_list_set(AnyCast<Ecore_Wl_Window*>( window.GetNativeHandle() ), keyList);
-
-  for( Dali::Vector<float>::SizeType index = 0; index < keyCount; ++index )
-  {
-    resultVector.PushBack(true);
-  }
-
-  if( grabList != NULL)
-  {
-    EINA_LIST_FOREACH(grabList, m, data)
-    {
-      Dali::Vector<float>::SizeType index = 0;
-      EINA_LIST_FOREACH(keyList, l, listData)
-      {
-        if(strcmp((char*)data, ((Ecore_Wl_Window_Keygrab_Info*)listData)->key) == 0)
-          resultVector[index] = false;
-
-        ++index;
-      }
-    }
-  }
-
-  eina_list_free(keyList);
-  eina_list_free(grabList);
-  eina_shutdown();
-
-  return resultVector;
-}
-
-Dali::Vector<bool> UngrabKeyList( Window window, const Dali::Vector<Dali::KEY>& daliKeyVector )
-{
-  Dali::Vector<bool> resultVector;
-  Eina_List *keyList = NULL, *ungrabList = NULL, *l = NULL, *m = NULL;
-  void *listData = NULL, *data = NULL;
-  Dali::Vector<Dali::KEY>::SizeType keyCount = daliKeyVector.Count();
-
-
-  if(keyCount == 0)
-    return resultVector;
-
-  eina_init();
-
-  for( Dali::Vector<float>::SizeType index = 0; index < keyCount; ++index )
-  {
-    Ecore_Wl_Window_Keygrab_Info *info = (Ecore_Wl_Window_Keygrab_Info*)malloc(sizeof(Ecore_Wl_Window_Keygrab_Info));
-    info->key = (char*)Dali::Internal::Adaptor::KeyLookup::GetKeyName( daliKeyVector[index] );
-    keyList = eina_list_append(keyList, info);
-  }
-
-  ungrabList = ecore_wl_window_keygrab_list_unset(AnyCast<Ecore_Wl_Window*>( window.GetNativeHandle() ), keyList);
-
-  for( Dali::Vector<float>::SizeType index = 0; index < keyCount; ++index )
-  {
-    resultVector.PushBack(true);
-  }
-
-  if( ungrabList != NULL)
-  {
-    EINA_LIST_FOREACH(ungrabList, m, data)
-    {
-      Dali::Vector<float>::SizeType index = 0;
-      EINA_LIST_FOREACH(keyList, l, listData)
-      {
-        if(strcmp((char*)data, ((Ecore_Wl_Window_Keygrab_Info*)listData)->key) == 0)
-          resultVector[index] = false;
-
-        ++index;
-      }
-    }
-  }
-
-  eina_list_free(keyList);
-  eina_list_free(ungrabList);
-  eina_shutdown();
-
-  return resultVector;
-}
-
 } // namespace KeyGrab
 
 } // namespace Dali
old mode 100755 (executable)
new mode 100644 (file)
index 898779b..43090f5
@@ -20,7 +20,6 @@
 
 // INTERNAL INCLUDES
 #include <dali/public-api/common/dali-common.h>
-#include <dali/public-api/common/dali-vector.h>
 #include "key.h"
 
 namespace Dali
@@ -110,43 +109,6 @@ DALI_IMPORT_API bool GrabKey( Window window, Dali::KEY daliKey, KeyGrabMode grab
  */
 DALI_IMPORT_API bool UngrabKey( Window window, Dali::KEY daliKey );
 
-
-/**
- * @PLATFORM
- * @brief Grabs the list of keys specfied by @Dali::Vector of keys for @a window in @Vector of grabModes.
- *
- * @details This function can be used for following example scenarios:
- * - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app.
- * - Mobile - When a user presses Home key, the homescreen appears regardless of current foreground app.
- * - Mobile - Using volume up/down as zoom up/down in camera apps.
- *
- * @SINCE_1_2.0
- * @PRIVLEVEL_PLATFORM
- * @PRIVILEGE_KEYGRAB
- * @param[in] window The window to set
- * @param[in] daliKeyVector The Dali::Vector of key codes to grab (defined in key.h)
- * @param[in] grabModeVector The Dali::Vector of grab modes for the keys
- * @return Dali::Vector Size is zero when error occurs, true/false if the grab succeeds/fails.
- */
-DALI_IMPORT_API Dali::Vector<bool> GrabKeyList( Window window, const Dali::Vector<Dali::KEY>& daliKeyVector, const Dali::Vector<KeyGrabMode>& grabModeVector);
-
-
-/**
- * @PLATFORM
- * @brief Ungrabs the list of keys specfied by @Dali::Vector of keys for @a window.
- *
- * @SINCE_1_2.0
- * @PRIVLEVEL_PLATFORM
- * @PRIVILEGE_KEYGRAB
- * @param[in] window The window to set
- * @param[in] daliKeyVector The Dali::Vector of key codes to ungrab (defined in key.h)
- * @return Dali::Vector Size is zero when error occurs, true/false if the ungrab succeeds/fails.
- * @note If this function is called between key down and up events of a grabbed key,
- * an application doesn't receive the key up event.
- */
-DALI_IMPORT_API Dali::Vector<bool> UngrabKeyList( Window window, const Dali::Vector<Dali::KEY>& daliKeyVector );
-
-
 } // namespace KeyGrab
 
 /**