X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=adaptors%2Fecore%2Fwayland%2Fkey-grab-ecore-wl.cpp;h=afe3859675822b9b17ffba45062514d57924ef33;hb=078f797faa7cd98afaba6bcebae4ec498461f1e2;hp=12ad210d0a9de1b7b27a66fb88552d91b19e28d6;hpb=dd3daf801d4ce960e17d6b1a86494e6535783206;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/adaptors/ecore/wayland/key-grab-ecore-wl.cpp b/adaptors/ecore/wayland/key-grab-ecore-wl.cpp old mode 100755 new mode 100644 index 12ad210..afe3859 --- a/adaptors/ecore/wayland/key-grab-ecore-wl.cpp +++ b/adaptors/ecore/wayland/key-grab-ecore-wl.cpp @@ -27,7 +27,6 @@ #include #include -#include using namespace std; namespace Dali @@ -82,125 +81,6 @@ bool UngrabKey( Window window, Dali::KEY daliKey ) 0, 0 ); } -Dali::Vector GrabKeyList( Window window, const Dali::Vector daliKeyVector, const Dali::Vector grabModeVector) -{ - Dali::Vector resultVector; - Eina_List *keyList = NULL, *grabList = NULL, *l = NULL, *m = NULL; - void *listData = NULL, *data = NULL; - Dali::Vector::SizeType keyCount = daliKeyVector.Count(); - Dali::Vector::SizeType keyGrabModeCount = grabModeVector.Count(); - - - if(keyCount != keyGrabModeCount || keyCount == 0) - return resultVector; - - eina_init(); - - for( Dali::Vector::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( window.GetNativeHandle() ), keyList); - - for( Dali::Vector::SizeType index = 0; index < keyCount; ++index ) - { - resultVector.PushBack(true); - } - - if( grabList != NULL) - { - EINA_LIST_FOREACH(grabList, m, data) - { - Dali::Vector::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 UngrabKeyList( Window window, const Dali::Vector daliKeyVector ) -{ - Dali::Vector resultVector; - Eina_List *keyList = NULL, *ungrabList = NULL, *l = NULL, *m = NULL; - void *listData = NULL, *data = NULL; - Dali::Vector::SizeType keyCount = daliKeyVector.Count(); - - - if(keyCount == 0) - return resultVector; - - eina_init(); - - for( Dali::Vector::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( window.GetNativeHandle() ), keyList); - - for( Dali::Vector::SizeType index = 0; index < keyCount; ++index ) - { - resultVector.PushBack(true); - } - - if( ungrabList != NULL) - { - EINA_LIST_FOREACH(ungrabList, m, data) - { - Dali::Vector::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