e_devicemgr: add a API to check blocked event 36/186236/2
authorJengHyun Kang <jhyuni.kang@samsung.com>
Wed, 8 Aug 2018 07:53:46 +0000 (16:53 +0900)
committerJengHyun Kang <jhyuni.kang@samsung.com>
Mon, 13 Aug 2018 08:06:47 +0000 (17:06 +0900)
Change-Id: Idb0db5ef97c130340a5608af1aa92ac06c9d6ff5

src/bin/e_devicemgr.c
src/bin/e_devicemgr.h

index 3d71130..966aab1 100644 (file)
@@ -1,6 +1,8 @@
 #include "e.h"
 #include "e_devicemgr.h"
 
+E_API E_Devicemgr_Info e_devicemgr;
+
 static int _e_devicemgr_intercept_hooks_delete = 0;
 static int _e_devicemgr_intercept_hooks_walking = 0;
 
@@ -78,3 +80,34 @@ e_devicemgr_intercept_hook_call(E_Devicemgr_Intercept_Hook_Point hookpoint, void
 
    return ret;
 }
+
+E_API Eina_Bool
+e_devicemgr_is_blocking_event(Ecore_Device_Class clas)
+{
+   unsigned int res = 0x0;
+   unsigned int dev_clas = 0x0;
+
+   if (!e_devicemgr.get_block_event_type)
+     return EINA_FALSE;
+
+   res = e_devicemgr.get_block_event_type();
+   if (!res) return EINA_FALSE;
+
+   switch (clas)
+     {
+        case ECORE_DEVICE_CLASS_KEYBOARD:
+          dev_clas = TIZEN_INPUT_DEVICE_MANAGER_CLAS_KEYBOARD;
+          break;
+        case ECORE_DEVICE_CLASS_MOUSE:
+          dev_clas = TIZEN_INPUT_DEVICE_MANAGER_CLAS_MOUSE;
+          break;
+        case ECORE_DEVICE_CLASS_TOUCH:
+          dev_clas = TIZEN_INPUT_DEVICE_MANAGER_CLAS_TOUCHSCREEN;
+          break;
+        default:
+          return EINA_FALSE;
+     }
+
+   if (res & dev_clas) return EINA_TRUE;
+   return EINA_FALSE;
+}
index 02cb9b5..c126afe 100644 (file)
@@ -8,11 +8,19 @@ typedef enum _E_Devicemgr_Intercept_Hook_Point
 
 typedef Eina_Bool (*E_Devicemgr_Intercept_Hook_Cb) (void *data, int point, void *event);
 typedef struct _E_Devicemgr_Intercept_Hook E_Devicemgr_Intercept_Hook;
+typedef struct _E_Devicemgr_Info E_Devicemgr_Info;
 
 #else
 #ifndef E_DEVICEMGR_H
 #define E_DEVICEMGR_H
 
+extern E_API E_Devicemgr_Info e_devicemgr;
+
+struct _E_Devicemgr_Info
+{
+   unsigned int (*get_block_event_type)(void);
+};
+
 struct _E_Devicemgr_Intercept_Hook
 {
    EINA_INLIST;
@@ -25,6 +33,7 @@ struct _E_Devicemgr_Intercept_Hook
 E_API E_Devicemgr_Intercept_Hook *e_devicemgr_intercept_hook_add(E_Devicemgr_Intercept_Hook_Point hookpoint, E_Devicemgr_Intercept_Hook_Cb func, const void *data);
 E_API void e_devicemgr_intercept_hook_del(E_Devicemgr_Intercept_Hook *ch);
 E_API Eina_Bool e_devicemgr_intercept_hook_call(E_Devicemgr_Intercept_Hook_Point hookpoint, void *event);
+E_API Eina_Bool e_devicemgr_is_blocking_event(Ecore_Device_Class clas);
 
 #endif
 #endif