e_comp_wl: tizen_input_device uses device's clas variable of the Ecore_Device_Class... 99/71999/8
authorDuna Oh <duna.oh@samsung.com>
Mon, 30 May 2016 06:45:54 +0000 (15:45 +0900)
committerDuna Oh <duna.oh@samsung.com>
Fri, 1 Jul 2016 03:55:11 +0000 (12:55 +0900)
Signed-off-by: Duna Oh <duna.oh@samsung.com>
Change-Id: Ia38104134d20f70604195b0a6c9d861857d7124b

src/bin/e_comp_wl.c
src/bin/e_comp_wl.h
src/bin/e_info_client.c
src/bin/e_info_server.c

index f0b3eb2..1438823 100644 (file)
@@ -660,23 +660,6 @@ _e_comp_wl_evas_cb_restack(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EIN
      }
 }
 
-static short
-_e_comp_wl_device_cap_to_class(int cap)
-{
-   switch(cap)
-     {
-      case ECORE_DEVICE_POINTER:
-         return EVAS_DEVICE_CLASS_MOUSE;
-      case ECORE_DEVICE_KEYBOARD:
-         return EVAS_DEVICE_CLASS_KEYBOARD;
-      case ECORE_DEVICE_TOUCH:
-         return EVAS_DEVICE_CLASS_TOUCH;
-      default:
-         return EVAS_DEVICE_CLASS_NONE;
-     }
-   return EVAS_DEVICE_CLASS_NONE;
-}
-
 static void
 _e_comp_wl_device_send_event_device(const char *dev_name, Evas_Device_Class dev_class, E_Client *ec, uint32_t timestamp)
 {
@@ -707,8 +690,8 @@ _e_comp_wl_device_send_event_device(const char *dev_name, Evas_Device_Class dev_
 
         EINA_LIST_FOREACH(e_comp_wl->input_device_manager.device_list, l, input_dev)
           {
-             if ((strcmp(input_dev->identifier, dev_name)) || (_e_comp_wl_device_cap_to_class(input_dev->capability) != dev_class)) continue;
-             e_comp_wl->input_device_manager.last_device_cap = input_dev->capability;
+             if ((strcmp(input_dev->identifier, dev_name)) || (input_dev->clas != (Ecore_Device_Class)dev_class)) continue;
+             e_comp_wl->input_device_manager.last_device_clas = input_dev->clas;
              EINA_LIST_FOREACH(input_dev->resources, ll, dev_res)
                {
                   if (wl_resource_get_client(dev_res) != wc) continue;
@@ -735,7 +718,7 @@ _e_comp_wl_device_send_last_event_device(E_Client *ec, uint32_t timestamp)
    EINA_LIST_FOREACH(e_comp_wl->input_device_manager.device_list, l, input_dev)
      {
         if ((strcmp(input_dev->identifier, e_comp_wl->input_device_manager.last_device_name)) ||
-             (input_dev->capability != e_comp_wl->input_device_manager.last_device_cap))
+             (input_dev->clas != e_comp_wl->input_device_manager.last_device_clas))
           continue;
 
         EINA_LIST_FOREACH(input_dev->resources, ll, dev_res)
@@ -826,7 +809,7 @@ _e_comp_wl_device_send_axis(const char *dev_name, Evas_Device_Class dev_class, E
 
    EINA_LIST_FOREACH(e_comp_wl->input_device_manager.device_list, l, input_dev)
      {
-        if ((strcmp(input_dev->identifier, dev_name)) || (_e_comp_wl_device_cap_to_class(input_dev->capability) != dev_class)) continue;
+        if ((strcmp(input_dev->identifier, dev_name)) || (input_dev->clas != (Ecore_Device_Class)dev_class)) continue;
         EINA_LIST_FOREACH(input_dev->resources, ll, dev_res)
           {
              if (wl_resource_get_client(dev_res) != wc) continue;
@@ -893,8 +876,8 @@ _e_comp_wl_evas_cb_mouse_in(void *data, Evas *evas EINA_UNUSED, Evas_Object *obj
         e_comp_wl->ptr.hide_tmr = ecore_timer_add(e_config->cursor_timer_interval, _e_comp_wl_cursor_timer, ec);
      }
 
-   if ((_e_comp_wl_device_cap_to_class(e_comp_wl->input_device_manager.last_device_cap) == EVAS_DEVICE_CLASS_MOUSE) ||
-       (_e_comp_wl_device_cap_to_class(e_comp_wl->input_device_manager.last_device_cap) == EVAS_DEVICE_CLASS_TOUCH))
+   if ((e_comp_wl->input_device_manager.last_device_clas == ECORE_DEVICE_CLASS_MOUSE) ||
+       (e_comp_wl->input_device_manager.last_device_clas == ECORE_DEVICE_CLASS_TOUCH))
      _e_comp_wl_device_send_last_event_device(ec, ev->timestamp);
 
    if (!eina_list_count(e_comp_wl->ptr.resources)) return;
@@ -1465,7 +1448,7 @@ _e_comp_wl_evas_cb_focus_in_timer(E_Client *ec)
    if (!e_comp_wl->kbd.focused) return EINA_FALSE;
    serial = wl_display_next_serial(e_comp_wl->wl.disp);
    t = ecore_time_unix_get();
-   if (_e_comp_wl_device_cap_to_class(e_comp_wl->input_device_manager.last_device_cap) == EVAS_DEVICE_CLASS_KEYBOARD)
+   if (e_comp_wl->input_device_manager.last_device_clas == ECORE_DEVICE_CLASS_KEYBOARD)
      _e_comp_wl_device_send_last_event_device(ec, t);
 
    EINA_LIST_FOREACH(e_comp_wl->kbd.focused, l, res)
@@ -1537,7 +1520,7 @@ _e_comp_wl_evas_cb_focus_out(void *data, Evas *evas EINA_UNUSED, Evas_Object *ob
    /* send keyboard_leave to all keyboard resources */
    serial = wl_display_next_serial(e_comp_wl->wl.disp);
    t = ecore_time_unix_get();
-   if (_e_comp_wl_device_cap_to_class(e_comp_wl->input_device_manager.last_device_cap) == EVAS_DEVICE_CLASS_KEYBOARD)
+   if (e_comp_wl->input_device_manager.last_device_clas == ECORE_DEVICE_CLASS_KEYBOARD)
      _e_comp_wl_device_send_last_event_device(ec, t);
 
    EINA_LIST_FOREACH_SAFE(e_comp_wl->kbd.focused, l, ll, res)
@@ -5172,9 +5155,9 @@ _e_comp_wl_send_event_device(struct wl_client *wc, uint32_t timestamp, const cha
         EINA_LIST_FOREACH(e_comp_wl->input_device_manager.device_list, l, input_dev)
           {
              if ((strcmp(input_dev->identifier, dev_name)) ||
-                 (input_dev->capability != ECORE_DEVICE_KEYBOARD))
+                 (input_dev->clas != ECORE_DEVICE_CLASS_KEYBOARD))
                continue;
-             e_comp_wl->input_device_manager.last_device_cap = input_dev->capability;
+             e_comp_wl->input_device_manager.last_device_clas = input_dev->clas;
              EINA_LIST_FOREACH(input_dev->resources, ll, dev_res)
                {
                   if (wl_resource_get_client(dev_res) != wc) continue;
index d4a9d24..01312e9 100644 (file)
@@ -153,7 +153,7 @@ struct _E_Comp_Wl_Input_Device
    Eina_List *resources;
    const char *name;
    const char *identifier;
-   unsigned int capability;
+   Ecore_Device_Class clas;
 };
 
 struct _E_Comp_Wl_Data
@@ -205,7 +205,7 @@ struct _E_Comp_Wl_Data
         Eina_List *resources;
         Eina_List *device_list;
         const char *last_device_name;
-        unsigned int last_device_cap;
+        Ecore_Device_Class last_device_clas;
         struct
           {
              double radius_x;
index a6ac942..5f21f06 100644 (file)
@@ -173,12 +173,12 @@ _cb_input_device_info_get(const Eldbus_Message *msg)
      {
         char *dev_name;
         char *identifier;
-        int capability;
+        int clas;
         res = eldbus_message_iter_arguments_get(eldbus_msg,
                                                 VALUE_TYPE_FOR_INPUTDEV,
                                                 &dev_name,
                                                 &identifier,
-                                                &capability);
+                                                &clas);
         if (!res)
           {
              printf("Failed to get device info\n");
@@ -188,7 +188,7 @@ _cb_input_device_info_get(const Eldbus_Message *msg)
         dev = E_NEW(E_Comp_Wl_Input_Device, 1);
         dev->name = strdup(dev_name);
         dev->identifier = strdup(identifier);
-        dev->capability = capability;
+        dev->clas = clas;
 
         e_info_client.input_dev = eina_list_append(e_info_client.input_dev, dev);
      }
@@ -481,10 +481,10 @@ _e_info_client_proc_input_device_info(int argc, char **argv)
      {
         i++;
         printf("%3d %50s %20s         ", i, dev->name, dev->identifier);
-        if (dev->capability & ECORE_DEVICE_POINTER) printf("Pointer | ");
-        if (dev->capability & ECORE_DEVICE_KEYBOARD) printf("Keyboard | ");
-        if (dev->capability & ECORE_DEVICE_TOUCH) printf("Touch | ");
-        printf("(0x%x)\n", dev->capability);
+        if (dev->clas == ECORE_DEVICE_CLASS_MOUSE) printf("Mouse | ");
+        else if (dev->clas == ECORE_DEVICE_CLASS_KEYBOARD) printf("Keyboard | ");
+        else if (dev->clas == ECORE_DEVICE_CLASS_TOUCH) printf("Touch | ");
+        printf("(0x%x)\n", dev->clas);
      }
 
    E_FREE_LIST(e_info_client.input_dev, free);
index e41a13f..c20205d 100644 (file)
@@ -191,7 +191,7 @@ _input_msg_clients_append(Eldbus_Message_Iter *iter)
 
         eldbus_message_iter_arguments_append
                      (struct_of_input, VALUE_TYPE_FOR_INPUTDEV,
-                      dev->name, dev->identifier, dev->capability);
+                      dev->name, dev->identifier, dev->clas);
 
         eldbus_message_iter_container_close(array_of_input, struct_of_input);
      }