e_info: add version infomation 98/136498/2
authorSangjin Lee <lsj119@samsung.com>
Fri, 30 Jun 2017 03:44:46 +0000 (12:44 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Tue, 4 Jul 2017 10:24:39 +0000 (10:24 +0000)
Change-Id: I4ac7481f473962646f6246e75ba901eb753e7729

configure.ac
packaging/enlightenment.spec
src/bin/e_info_client.c
src/bin/e_info_server.c

index 4767cf2..ff856ca 100755 (executable)
@@ -62,6 +62,14 @@ AC_SUBST([release_info])
 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
 ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
 
+AC_ARG_VAR([TIZEN_REL_VERSION], [Tizen release version])
+if test x"${TIZEN_REL_VERSION}" != x""; then
+       AC_DEFINE_UNQUOTED([TIZEN_REL_VERSION], ["${TIZEN_REL_VERSION}"], [Tizen release version])
+       AC_SUBST(TIZEN_REL_VERSION)
+else
+       echo "TIZEN_REL_VERSION is empty !"
+fi
+
 release=relname
 AC_SUBST([release])
 
index 518e28a..ea13160 100755 (executable)
@@ -8,6 +8,8 @@ Group:          Graphics/EFL
 Source0:        enlightenment-%{version}.tar.bz2
 Source1001:     enlightenment.manifest
 
+%define TIZEN_REL_VERSION 1
+
 %ifarch %{arm}
 %define LIBGOMP use
 %endif
@@ -74,6 +76,7 @@ export CFLAGS+=" -fPIE "
 export LDFLAGS+=" -pie "
 %endif
 %autogen \
+      TIZEN_REL_VERSION="%{release}-%{TIZEN_REL_VERSION}" \
       --enable-function-trace \
       --enable-wayland \
       --enable-quick-init \
index ee89d00..31ad8ed 100644 (file)
@@ -3675,6 +3675,33 @@ usage:
    printf("Usage: enlightenment_info -wininfo %s", WININFO_USAGE);
 }
 
+static void
+_cb_window_proc_version_get(const Eldbus_Message *msg)
+{
+   const char *name = NULL, *text = NULL;
+   char *ver, *rel;
+   Eina_Bool res;
+
+   res = eldbus_message_error_get(msg, &name, &text);
+   EINA_SAFETY_ON_TRUE_RETURN(res);
+
+   res = eldbus_message_arguments_get(msg, "ss", &ver, &rel);
+   EINA_SAFETY_ON_FALSE_RETURN(res);
+
+   printf("Version: %s\n", ver);
+   printf("Release: %s\n", rel);
+}
+
+static void
+_e_info_client_proc_version(int argc, char **argv)
+{
+   if (!_e_info_client_eldbus_message("get_version", _cb_window_proc_version_get))
+     {
+        printf("_e_info_client_eldbus_message error:%s\n", "get_einfo");
+        return;
+     }
+}
+
 static struct
 {
    const char *option;
@@ -3684,6 +3711,12 @@ static struct
 } procs[] =
 {
    {
+      "version",
+      NULL,
+      "print version of enlightenment",
+      _e_info_client_proc_version
+   },
+   {
       "protocol_trace", "[console|file_path|disable]",
       "Enable/disable wayland protocol trace",
       _e_info_client_proc_protocol_trace
index 12f483d..8916812 100644 (file)
@@ -4858,6 +4858,16 @@ _e_info_server_cb_wininfo_shape(const Eldbus_Service_Interface *iface EINA_UNUSE
    return reply;
 }
 
+static Eldbus_Message *
+_e_info_server_cb_version_get(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
+{
+   Eldbus_Message *reply = eldbus_message_method_return_new(msg);
+
+   eldbus_message_arguments_append(reply, "ss", VERSION, TIZEN_REL_VERSION);
+
+   return reply;
+}
+
 //{ "method_name", arguments_from_client, return_values_to_client, _method_cb, ELDBUS_METHOD_FLAG },
 static const Eldbus_Method methods[] = {
    { "get_window_info", NULL, ELDBUS_ARGS({"iiiisa("VALUE_TYPE_FOR_TOPVWINS")", "array of ec"}), _e_info_server_cb_window_info_get, 0 },
@@ -4910,6 +4920,7 @@ static const Eldbus_Method methods[] = {
    { "wininfo_tree", ELDBUS_ARGS({VALUE_TYPE_REQUEST_FOR_WININFO_TREE, "wininfo_tree"}), ELDBUS_ARGS({VALUE_TYPE_REPLY_WININFO_TREE, "window tree info"}), _e_info_server_cb_wininfo_tree, 0 },
    { "wininfo_hints", ELDBUS_ARGS({"it", "mode, window"}), ELDBUS_ARGS({"as", "window hints"}), _e_info_server_cb_wininfo_hints, 0 },
    { "wininfo_shape", ELDBUS_ARGS({"t", "window"}), ELDBUS_ARGS({"ia(iiii)ia(iiii)", "window shape"}), _e_info_server_cb_wininfo_shape, 0 },
+   { "get_version", NULL, ELDBUS_ARGS({"ss", "version of E20"}), _e_info_server_cb_version_get, 0 },
    { NULL, NULL, NULL, NULL, 0 }
 };