e_comp_wl: Add a subclass argument in device header and print it using e_info 97/82697/3
authorJengHyun Kang <jhyuni.kang@samsung.com>
Fri, 5 Aug 2016 07:16:02 +0000 (16:16 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Mon, 22 Aug 2016 08:36:08 +0000 (01:36 -0700)
Change-Id: I55c58c44d96ae80ca22cadcda1991a31340d34fd

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

index 2e6cd6913576ff99109358633fd05567445b5b76..a56e3b0c88d8e1ec2cd1077f4d2d9a353fcb1f82 100644 (file)
@@ -154,6 +154,7 @@ struct _E_Comp_Wl_Input_Device
    const char *name;
    const char *identifier;
    Ecore_Device_Class clas;
+   Ecore_Device_Subclass subclas;
 };
 
 struct _E_Comp_Wl_Data
index 8faedcb4133de7d088257da5d9375a6ad5d2ba6c..ebce388945885f2c836d5f6544fc552568be5498 100644 (file)
@@ -43,7 +43,7 @@ typedef struct _E_Win_Info
 #define VALUE_TYPE_FOR_TOPVWINS "uuisiiiiibbiibbbiis"
 #define VALUE_TYPE_REQUEST_RESLIST "ui"
 #define VALUE_TYPE_REPLY_RESLIST "ssi"
-#define VALUE_TYPE_FOR_INPUTDEV "ssi"
+#define VALUE_TYPE_FOR_INPUTDEV "ssii"
 
 static E_Info_Client e_info_client;
 
@@ -178,11 +178,13 @@ _cb_input_device_info_get(const Eldbus_Message *msg)
         char *dev_name;
         char *identifier;
         int clas;
+        int subclas;
         res = eldbus_message_iter_arguments_get(eldbus_msg,
                                                 VALUE_TYPE_FOR_INPUTDEV,
                                                 &dev_name,
                                                 &identifier,
-                                                &clas);
+                                                &clas,
+                                                &subclas);
         if (!res)
           {
              printf("Failed to get device info\n");
@@ -193,6 +195,7 @@ _cb_input_device_info_get(const Eldbus_Message *msg)
         dev->name = strdup(dev_name);
         dev->identifier = strdup(identifier);
         dev->clas = clas;
+        dev->subclas = subclas;
 
         e_info_client.input_dev = eina_list_append(e_info_client.input_dev, dev);
      }
@@ -461,6 +464,44 @@ _e_info_client_proc_topvwins_info(int argc, char **argv)
    E_FREE_LIST(e_info_client.win_list, _e_win_info_free);
 }
 
+static const char *
+_e_info_client_device_subclass_get(Ecore_Device_Subclass subclas)
+{
+   switch (subclas)
+     {
+        case ECORE_DEVICE_SUBCLASS_NONE:
+           return "None";
+        case ECORE_DEVICE_SUBCLASS_FINGER:
+           return "Finger";
+        case ECORE_DEVICE_SUBCLASS_FINGERNAIL:
+           return "Fingernail";
+        case ECORE_DEVICE_SUBCLASS_KNUCKLE:
+           return "Knuckle";
+        case ECORE_DEVICE_SUBCLASS_PALM:
+           return "Palm";
+        case ECORE_DEVICE_SUBCLASS_HAND_SIZE:
+           return "Hand Size";
+        case ECORE_DEVICE_SUBCLASS_HAND_FLAT:
+           return "Hand Flat";
+        case ECORE_DEVICE_SUBCLASS_PEN_TIP:
+           return "Pen Tip";
+        case ECORE_DEVICE_SUBCLASS_TRACKPAD:
+           return "Trackpad";
+        case ECORE_DEVICE_SUBCLASS_TRACKPOINT:
+           return "Trackpoint";
+        case ECORE_DEVICE_SUBCLASS_TRACKBALL:
+           return "Trackball";
+        case ECORE_DEVICE_SUBCLASS_BUILTIN:
+           return "Builtin Device";
+        case ECORE_DEVICE_SUBCLASS_SW_KEYBOARD:
+           return "Software Keyboard";
+        case ECORE_DEVICE_SUBCLASS_HW_KEYBOARD:
+           return "Hardware Keyboard";
+        default:
+           return "Unknown Subclass";
+     }
+}
+
 static void
 _e_info_client_proc_input_device_info(int argc, char **argv)
 {
@@ -472,7 +513,7 @@ _e_info_client_proc_input_device_info(int argc, char **argv)
      return;
 
    printf("--------------------------------------[ input devices ]----------------------------------------------------------\n");
-   printf(" No                               Name                        identifier            Cap\n");
+   printf(" No                     Name              identifier                Class                   Subclass\n");
    printf("-----------------------------------------------------------------------------------------------------------------\n");
 
    if (!e_info_client.input_dev)
@@ -484,11 +525,12 @@ _e_info_client_proc_input_device_info(int argc, char **argv)
    EINA_LIST_FOREACH(e_info_client.input_dev, l, dev)
      {
         i++;
-        printf("%3d %50s %20s         ", i, dev->name, dev->identifier);
-        if (dev->clas == ECORE_DEVICE_CLASS_MOUSE) printf("Mouse | ");
+        printf("%3d %30s %20s         ", i, dev->name, dev->identifier);
+        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);
+        else if (dev->clas == ECORE_DEVICE_CLASS_TOUCH) printf("Touch    | ");
+        printf("(0x%x)          %s", dev->clas, _e_info_client_device_subclass_get(dev->subclas));
+        printf("\n");
      }
 
    E_FREE_LIST(e_info_client.input_dev, free);
index 3f66fbfda64b6bf8d37b69dc69bfa8b74db36c3e..ac0f1851807fcb390c618ff8cf0c4aea4a508a56 100644 (file)
@@ -70,7 +70,7 @@ static Eina_List *module_hook = NULL;
 #define VALUE_TYPE_FOR_TOPVWINS "uuisiiiiibbiibbbiis"
 #define VALUE_TYPE_REQUEST_RESLIST "ui"
 #define VALUE_TYPE_REPLY_RESLIST "ssi"
-#define VALUE_TYPE_FOR_INPUTDEV "ssi"
+#define VALUE_TYPE_FOR_INPUTDEV "ssii"
 
 static E_Info_Transform *_e_info_transform_new(E_Client *ec, int id, int enable, int x, int y, int sx, int sy, int degree, int keep_ratio);
 static E_Info_Transform *_e_info_transform_find(E_Client *ec, int id);
@@ -192,7 +192,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->clas);
+                      dev->name, dev->identifier, dev->clas, dev->subclas);
 
         eldbus_message_iter_container_close(array_of_input, struct_of_input);
      }