[menu-screen] Incorporated Dlog API changes.
[apps/native/menu-screen.git] / src / util.c
index 4326c4f..c5d8434 100644 (file)
  */
 
 #include <Evas.h>
-
+#include <app_common.h>
+#include <system_info.h>
 #include "util.h"
 
+char *util_get_device_profile(void)
+{
+       char *value;
+       int ret;
+       ret = system_info_get_platform_string("http://tizen.org/feature/profile", &value);
+       if (ret != SYSTEM_INFO_ERROR_NONE) {
+               _E("Error: system_info_get_platform_string");
+               return NULL;
+       }
+       _I("Device profile: %s", value);
+       return value;
+}
+
+const char *util_get_file_path(const char *relative)
+{
+       static char buf[PATH_MAX];
+       char *prefix = NULL;
+
+       prefix = app_get_resource_path();
+
+       if (prefix != NULL) {
+               size_t res = eina_file_path_join(buf, sizeof(buf), prefix, relative);
+               snprintf(buf, sizeof(buf), "%s%s", prefix, relative);
+               free(prefix);
+
+               if (res > sizeof(buf)) {
+                       _E("Path exceeded PATH_MAX");
+                       return NULL;
+               }
+       }
+
+       return &buf[0];
+}
+
 
 
 HAPI void _evas_object_resize_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
@@ -34,7 +69,7 @@ HAPI void _evas_object_resize_cb(void *data, Evas *e, Evas_Object *obj, void *ev
        Evas_Coord h;
 
        evas_object_geometry_get(obj, &x, &y, &w, &h);
-       _D("%s is resized to (%d, %d, %d, %d)", data, x, y, w, h);
+       _D("%s is resized to (%d, %d, %d, %d)", (const char* )data, x, y, w, h);
 }