aboutsummaryrefslogtreecommitdiffstats
path: root/src/json_helper.cpp
diff options
context:
space:
mode:
authorYuta Doi <yuta-d@witz-inc.co.jp>2018-06-29 09:31:46 +0900
committerYuta Doi <yuta-d@witz-inc.co.jp>2018-07-09 10:04:53 +0900
commitdd72b1c91895058d14bd13c3aa9a50bd75f633b6 (patch)
treecc15ad1a3c7078bdb8f6cec08ff1b5b5c4e497d7 /src/json_helper.cpp
parentcf05c2b5c92b9a79635aa2277a9d55449e14fab6 (diff)
Add configuration file for each area sizes
Add areas.db which has each area sizes. less-than-0 values refer to (MAX + 1 - $VALUE) and MAX is either screen width or height. layers.json had each area sizes until now, so removed the sizes from it. Change-Id: I5cf283581daaca41e2b9e3ee6e947478bff1189c Signed-off-by: Yuta Doi <yuta-d@witz-inc.co.jp>
Diffstat (limited to 'src/json_helper.cpp')
-rw-r--r--src/json_helper.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/json_helper.cpp b/src/json_helper.cpp
index 43440db..c2f4173 100644
--- a/src/json_helper.cpp
+++ b/src/json_helper.cpp
@@ -124,6 +124,18 @@ const char* getStringFromJson(json_object* obj, const char* key)
return json_object_get_string(tmp);
}
+int getIntFromJson(json_object *obj, const char *key)
+{
+ json_object *tmp;
+ if (!json_object_object_get_ex(obj, key, &tmp))
+ {
+ HMI_DEBUG("wm:jh", "Not found key \"%s\"", key);
+ return 0;
+ }
+
+ return json_object_get_int(tmp);
+}
+
int inputJsonFilie(const char* file, json_object** obj)
{
const int input_size = 128;