e_comp_wl: Add input logs 00/112300/4 accepted/tizen/3.0/common/20170201.164015 accepted/tizen/3.0/ivi/20170201.035555 accepted/tizen/3.0/mobile/20170201.035432 accepted/tizen/3.0/tv/20170201.035504 accepted/tizen/3.0/wearable/20170201.035525 accepted/tizen/common/20170131.163049 accepted/tizen/ivi/20170201.004433 accepted/tizen/mobile/20170201.004325 accepted/tizen/tv/20170201.004345 accepted/tizen/wearable/20170201.004415 submit/tizen/20170131.094208 submit/tizen_3.0/20170131.090125
authorJengHyun Kang <jhyuni.kang@samsung.com>
Tue, 31 Jan 2017 05:16:28 +0000 (14:16 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Tue, 31 Jan 2017 07:55:12 +0000 (23:55 -0800)
Change-Id: I0331965bba0ba5e31d553c5ef899df939102a3be

src/bin/e_comp_cfdata.c
src/bin/e_comp_cfdata.h
src/bin/e_comp_wl.c

index ce302b1..2b66a7b 100644 (file)
@@ -80,6 +80,7 @@ e_comp_cfdata_edd_init(E_Config_DD **conf_edd, E_Config_DD **match_edd)
    E_CONFIG_LIST(D, T, match.objects, *match_edd);
    E_CONFIG_VAL(D, T, dim_rect_effect, UCHAR);
    E_CONFIG_VAL(D, T, dim_rect_enable, UCHAR);
+   E_CONFIG_VAL(D, T, input_log_enable, UCHAR);
 }
 
 E_API E_Comp_Config *
@@ -215,6 +216,8 @@ e_comp_cfdata_config_new(void)
    cfg->dim_rect_effect = 0;
    cfg->dim_rect_enable = 0;
 
+   cfg->input_log_enable = 0;
+
    return cfg;
 }
 
index 1f7aac2..9c316f1 100644 (file)
@@ -63,6 +63,7 @@ struct _E_Comp_Config
 
    unsigned char dim_rect_enable;
    unsigned char dim_rect_effect;
+   Eina_Bool input_log_enable;
 };
 
 struct _E_Comp_Match
index 5012771..b31033a 100644 (file)
@@ -1114,6 +1114,7 @@ _e_comp_wl_send_touch(E_Client *ec, int idx, int canvas_x, int canvas_y, uint32_
    struct wl_resource *res;
    wl_fixed_t x, y;
    uint32_t serial;
+   E_Comp_Config *comp_conf = NULL;
 
    if (!ec) return;
    if (e_object_is_del(E_OBJECT(ec))) return;
@@ -1128,15 +1129,27 @@ _e_comp_wl_send_touch(E_Client *ec, int idx, int canvas_x, int canvas_y, uint32_
         y = wl_fixed_from_int(canvas_y - ec->client.y);
      }
 
+   comp_conf = e_comp_config_get();
+
    EINA_LIST_FOREACH(e_comp_wl->touch.resources, l, res)
      {
         if (wl_resource_get_client(res) != wc) continue;
         if (!e_comp_wl_input_touch_check(res)) continue;
         TRACE_INPUT_BEGIN(_e_comp_wl_send_touch);
         if (pressed)
-          wl_touch_send_down(res, serial, timestamp, ec->comp_data->surface, idx, x, y); //id 0 for the 1st finger
+          {
+             if (comp_conf && comp_conf->input_log_enable)
+               INF("[Server] Touch Down (id: %d, time: %d)\n", idx, timestamp);
+
+             wl_touch_send_down(res, serial, timestamp, ec->comp_data->surface, idx, x, y); //id 0 for the 1st finger
+          }
         else
-          wl_touch_send_up(res, serial, timestamp, idx);
+          {
+             if (comp_conf && comp_conf->input_log_enable)
+               INF("[Server] Touch Up (id: %d, time: %d)\n", idx, timestamp);
+
+             wl_touch_send_up(res, serial, timestamp, idx);
+          }
         TRACE_INPUT_END();
      }
 }
@@ -5382,11 +5395,14 @@ _e_comp_wl_key_send(Ecore_Event_Key *ev, enum wl_keyboard_key_state state, Eina_
    uint32_t serial, keycode;
    struct wl_client *wc;
    Ecore_Device *last_dev;
+   E_Comp_Config *comp_conf = NULL;
 
    keycode = (ev->keycode - 8);
 
    serial = wl_display_next_serial(e_comp_wl->wl.disp);
 
+   comp_conf = e_comp_config_get();
+
    EINA_LIST_FOREACH(key_list, l, res)
      {
         wc = wl_resource_get_client(res);
@@ -5405,6 +5421,9 @@ _e_comp_wl_key_send(Ecore_Event_Key *ev, enum wl_keyboard_key_state state, Eina_
              _e_comp_wl_send_event_device(ev->data, ev->timestamp, ev->dev, serial);
           }
 
+        if (comp_conf && comp_conf->input_log_enable)
+          INF("[Server] Key %s (time: %d)\n", (state ? "Down" : "Up"), ev->timestamp);
+
         wl_keyboard_send_key(res, serial, ev->timestamp,
                              keycode, state);
         TRACE_INPUT_END();
@@ -5635,6 +5654,7 @@ e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t bu
    struct wl_client *wc;
    uint32_t serial, btn;
    struct wl_resource *res;
+   E_Comp_Config *comp_conf = NULL;
 
    if (ec->cur_mouse_action || e_comp_wl->drag)
      return EINA_FALSE;
@@ -5659,11 +5679,17 @@ e_comp_wl_evas_handle_mouse_button(E_Client *ec, uint32_t timestamp, uint32_t bu
    wc = wl_resource_get_client(ec->comp_data->surface);
    serial = wl_display_next_serial(e_comp_wl->wl.disp);
 
+   comp_conf = e_comp_config_get();
+
    EINA_LIST_FOREACH(e_comp_wl->ptr.resources, l, res)
      {
         if (wl_resource_get_client(res) != wc) continue;
         if (!e_comp_wl_input_pointer_check(res)) continue;
         TRACE_INPUT_BEGIN(e_comp_wl_evas_handle_mouse_button);
+
+        if (comp_conf && comp_conf->input_log_enable)
+          INF("[Server] Mouse Button %s (btn: %d, time: %d)\n", (state ? "Down" : "Up"), btn, timestamp);
+
         wl_pointer_send_button(res, serial, timestamp, btn, state);
         TRACE_INPUT_END();
      }
@@ -5740,6 +5766,7 @@ e_comp_wl_key_send(E_Client *ec, int keycode, Eina_Bool pressed, Ecore_Device *d
    Eina_List *l;
    uint32_t serial, wl_keycode;
    enum wl_keyboard_key_state state;
+   E_Comp_Config *comp_conf = NULL;
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
    EINA_SAFETY_ON_NULL_RETURN_VAL(ec->comp_data, EINA_FALSE);
@@ -5754,11 +5781,17 @@ e_comp_wl_key_send(E_Client *ec, int keycode, Eina_Bool pressed, Ecore_Device *d
    if (pressed) state = WL_KEYBOARD_KEY_STATE_PRESSED;
    else state = WL_KEYBOARD_KEY_STATE_RELEASED;
 
+   comp_conf = e_comp_config_get();
+
    EINA_LIST_FOREACH(e_comp_wl->kbd.resources, l, res)
      {
         if (wl_resource_get_client(res) != wc) continue;
         if (dev) _e_comp_wl_send_event_device(wc, time, dev, serial);
         else _e_comp_wl_device_send_last_event_device(ec, ECORE_DEVICE_CLASS_KEYBOARD, time);
+
+        if (comp_conf && comp_conf->input_log_enable)
+          INF("[Server] Key %s (time: %d)\n", (state ? "Down" : "Up"), time);
+
         wl_keyboard_send_key(res, serial, time,
                              wl_keycode, state);
      }