e_devicemgr: remove the hook 36/321636/1
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 25 Mar 2025 07:20:49 +0000 (16:20 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 26 Mar 2025 03:43:55 +0000 (12:43 +0900)
remove code related to the hook

Change-Id: I174e8d8d7b19d43647682bb8900fc660f1d3108d

src/bin/inputmgr/e_devicemgr.c
src/bin/inputmgr/e_devicemgr_input.c
src/bin/inputmgr/e_devicemgr_intern.h

index 7f4a09a499521b52b93a794dfd4cb39eec4ad5a4..d099fc8b3edc4e3be79b81b5ac78ad0b2063d2d6 100644 (file)
@@ -8,86 +8,8 @@
 
 E_API E_Devicemgr *e_devicemgr;
 
-static int _e_devicemgr_intercept_hooks_delete = 0;
-static int _e_devicemgr_intercept_hooks_walking = 0;
-
-static Eina_Inlist *_e_devicemgr_intercept_hooks[] =
-{
-   [E_DEVICEMGR_INTERCEPT_HOOK_DETENT] = NULL,
-};
-
 int _devicemgr_log_dom = -1;
 
-EINTERN 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_Devicemgr_Intercept_Hook *ch;
-
-   EINA_SAFETY_ON_TRUE_RETURN_VAL(hookpoint < 0 || hookpoint >= E_DEVICEMGR_INTERCEPT_HOOK_LAST,
-                                  EINA_FALSE);
-
-   ch = E_NEW(E_Devicemgr_Intercept_Hook, 1);
-   if (!ch) return NULL;
-   ch->hookpoint = hookpoint;
-   ch->func = func;
-   ch->data = (void*)data;
-   _e_devicemgr_intercept_hooks[hookpoint] = eina_inlist_append(_e_devicemgr_intercept_hooks[hookpoint], EINA_INLIST_GET(ch));
-   return ch;
-}
-
-EINTERN void
-e_devicemgr_intercept_hook_del(E_Devicemgr_Intercept_Hook *ch)
-{
-   EINA_SAFETY_ON_NULL_RETURN(ch);
-
-   ch->delete_me = 1;
-   if (_e_devicemgr_intercept_hooks_walking == 0)
-     {
-        _e_devicemgr_intercept_hooks[ch->hookpoint] = eina_inlist_remove(_e_devicemgr_intercept_hooks[ch->hookpoint], EINA_INLIST_GET(ch));
-        free(ch);
-     }
-   else
-     _e_devicemgr_intercept_hooks_delete++;
-}
-
-static void
-_e_devicemgr_intercept_hooks_clean(void)
-{
-   Eina_Inlist *l;
-   E_Devicemgr_Intercept_Hook *ch;
-   unsigned int x;
-   for (x = 0; x < E_DEVICEMGR_INTERCEPT_HOOK_LAST; x++)
-     EINA_INLIST_FOREACH_SAFE(_e_devicemgr_intercept_hooks[x], l, ch)
-       {
-          if (!ch->delete_me) continue;
-          _e_devicemgr_intercept_hooks[x] = eina_inlist_remove(_e_devicemgr_intercept_hooks[x], EINA_INLIST_GET(ch));
-         free(ch);
-       }
-}
-
-EINTERN Eina_Bool
-e_devicemgr_intercept_hook_call(E_Devicemgr_Intercept_Hook_Point hookpoint, void *event)
-{
-   E_Devicemgr_Intercept_Hook *ch;
-   Eina_Bool res = EINA_TRUE, ret = EINA_TRUE;
-
-   EINA_SAFETY_ON_TRUE_RETURN_VAL(hookpoint < 0 || hookpoint >= E_DEVICEMGR_INTERCEPT_HOOK_LAST,
-                                  EINA_FALSE);
-
-   _e_devicemgr_intercept_hooks_walking++;
-   EINA_INLIST_FOREACH(_e_devicemgr_intercept_hooks[hookpoint], ch)
-     {
-        if (ch->delete_me) continue;
-        res = ch->func(ch->data, hookpoint, event);
-        if (!res) ret = EINA_FALSE;
-     }
-   _e_devicemgr_intercept_hooks_walking--;
-   if ((_e_devicemgr_intercept_hooks_walking == 0) && (_e_devicemgr_intercept_hooks_delete > 0))
-     _e_devicemgr_intercept_hooks_clean();
-
-   return ret;
-}
-
 EINTERN int
 e_devicemgr_init(void)
 {
index a3352460826a617dc8edada80fee51917e1d1d13..0b564537a76c9590e7842b3e3448a9cf84da35ac 100644 (file)
@@ -468,11 +468,6 @@ _e_devicemgr_input_cb_mouse_wheel(void *data, int type, void *event)
    if (detent == 1 || detent == -1)
      {
         detent = detent * (-1);
-        if (!e_devicemgr_intercept_hook_call(E_DEVICEMGR_INTERCEPT_HOOK_DETENT, &detent))
-          {
-             DMDBG("Stop propagate detent event. value: %d\n", detent);
-             return ECORE_CALLBACK_DONE;
-          }
         e_devicemgr_wl_detent_send_event(detent);
      }
 
index a1b9355b1af004a8b680ac4f118bac6ddec6d7ad..5dd9960bf3c80348213c426f4f8b4ca48721cf3b 100644 (file)
 #define TRACE_INPUT_DEVICE_END()
 #endif
 
-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 enum _E_Devicemgr_Intercept_Hook_Point
-{
-   E_DEVICEMGR_INTERCEPT_HOOK_DETENT,
-   E_DEVICEMGR_INTERCEPT_HOOK_LAST
-} E_Devicemgr_Intercept_Hook_Point;
-
-struct _E_Devicemgr_Intercept_Hook
-{
-   EINA_INLIST;
-   E_Devicemgr_Intercept_Hook_Point hookpoint;
-   E_Devicemgr_Intercept_Hook_Cb func;
-   void *data;
-   unsigned char delete_me : 1;
-};
-
 EINTERN int e_devicemgr_init(void);
 EINTERN int e_devicemgr_shutdown(void);
 
 EINTERN Eina_Bool e_devicemgr_strcmp(const char *dst, const char *src);
 
-EINTERN E_Devicemgr_Intercept_Hook *e_devicemgr_intercept_hook_add(E_Devicemgr_Intercept_Hook_Point hookpoint, E_Devicemgr_Intercept_Hook_Cb func, const void *data);
-EINTERN void                        e_devicemgr_intercept_hook_del(E_Devicemgr_Intercept_Hook *ch);
-EINTERN Eina_Bool                   e_devicemgr_intercept_hook_call(E_Devicemgr_Intercept_Hook_Point hookpoint, void *event);
-
 #endif