summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2016-03-01 17:34:19 +0200
committerDaniel Zaoui <daniel.zaoui@samsung.com>2016-03-01 17:34:19 +0200
commit93e69739b2a9cbc32eb43fd90aa8da0ca6d8854f (patch)
tree78f2aaa5eb03a227f118bd1522a6e37535faa3c7
parent4dab4f9f517c1657aca65b1a90ba5711a187744b (diff)
Support hoversel item
-rw-r--r--src/lib/ea_json_generator.c4
-rw-r--r--src/lib/ea_json_parser.c6
2 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/ea_json_generator.c b/src/lib/ea_json_generator.c
index 38b36d1..26db7cc 100644
--- a/src/lib/ea_json_generator.c
+++ b/src/lib/ea_json_generator.c
@@ -110,12 +110,14 @@ _containee_json_generate(Ea *ea_obj, Ea *ea_func, json_object **js_contains, jso
110 static const Eolian_Function *win_resize = NULL; 110 static const Eolian_Function *win_resize = NULL;
111 static const Eolian_Function *nv_it_push = NULL; 111 static const Eolian_Function *nv_it_push = NULL;
112 static const Eolian_Function *tb_it_add = NULL; 112 static const Eolian_Function *tb_it_add = NULL;
113 static const Eolian_Function *hs_it_add = NULL;
113 114
114 if (!box_pack) box_pack = FIND_EOLIAN_FUNC("Elm.Box", "pack_end"); 115 if (!box_pack) box_pack = FIND_EOLIAN_FUNC("Elm.Box", "pack_end");
115 if (!container_content) container_content = FIND_EOLIAN_FUNC("Elm.Container", "content_set"); 116 if (!container_content) container_content = FIND_EOLIAN_FUNC("Elm.Container", "content_set");
116 if (!win_resize) win_resize = FIND_EOLIAN_FUNC("Elm.Win", "resize_object_add"); 117 if (!win_resize) win_resize = FIND_EOLIAN_FUNC("Elm.Win", "resize_object_add");
117 if (!nv_it_push) nv_it_push = FIND_EOLIAN_FUNC("Elm.Naviframe", "item_push"); 118 if (!nv_it_push) nv_it_push = FIND_EOLIAN_FUNC("Elm.Naviframe", "item_push");
118 if (!tb_it_add) tb_it_add = FIND_EOLIAN_FUNC("Elm.Toolbar", "item_append"); 119 if (!tb_it_add) tb_it_add = FIND_EOLIAN_FUNC("Elm.Toolbar", "item_append");
120 if (!hs_it_add) hs_it_add = FIND_EOLIAN_FUNC("Elm.Hoversel", "item_add");
119 121
120 if (eo_foo == win_resize) 122 if (eo_foo == win_resize)
121 { 123 {
@@ -149,7 +151,7 @@ _containee_json_generate(Ea *ea_obj, Ea *ea_func, json_object **js_contains, jso
149 if (!*js_contains) *js_contains = json_object_new_object(); 151 if (!*js_contains) *js_contains = json_object_new_object();
150 json_object_object_add(*js_contains, obj_name, js_val); 152 json_object_object_add(*js_contains, obj_name, js_val);
151 } 153 }
152 if (eo_foo == nv_it_push || eo_foo == tb_it_add) 154 if (eo_foo == nv_it_push || eo_foo == tb_it_add || eo_foo == hs_it_add)
153 { 155 {
154 if (!*js_items) *js_items = json_object_new_array(); 156 if (!*js_items) *js_items = json_object_new_array();
155 json_object_array_add(*js_items, json_object_new_string(ea_object_name_get(ea_obj))); 157 json_object_array_add(*js_items, json_object_new_string(ea_object_name_get(ea_obj)));
diff --git a/src/lib/ea_json_parser.c b/src/lib/ea_json_parser.c
index ca726f9..a8a5d9d 100644
--- a/src/lib/ea_json_parser.c
+++ b/src/lib/ea_json_parser.c
@@ -20,6 +20,7 @@ static const Eolian_Function *_table_pack_function = NULL;
20static const Eolian_Function *_content_set_function = NULL; 20static const Eolian_Function *_content_set_function = NULL;
21static const Eolian_Function *_nv_item_push_function = NULL; 21static const Eolian_Function *_nv_item_push_function = NULL;
22static const Eolian_Function *_tb_item_add_function = NULL; 22static const Eolian_Function *_tb_item_add_function = NULL;
23static const Eolian_Function *_hs_item_add_function = NULL;
23 24
24static json_object * 25static json_object *
25_json_get(json_object *obj, ...) 26_json_get(json_object *obj, ...)
@@ -610,6 +611,11 @@ _json_parse(Ea_Session *ea_session, const char *buffer)
610 if (!_tb_item_add_function) _tb_item_add_function = _find_function_by_full_name("Elm.Toolbar.item_append"); 611 if (!_tb_item_add_function) _tb_item_add_function = _find_function_by_full_name("Elm.Toolbar.item_append");
611 ea_func = _function_parse(ea_session, _tb_item_add_function, jobj); 612 ea_func = _function_parse(ea_session, _tb_item_add_function, jobj);
612 } 613 }
614 else if (_class_is_of_type(kl, "Hoversel"))
615 {
616 if (!_hs_item_add_function) _hs_item_add_function = _find_function_by_full_name("Elm.Hoversel.item_add");
617 ea_func = _function_parse(ea_session, _hs_item_add_function, jobj);
618 }
613 if (ea_func) ea_item_create_function_set(ea_obj, ea_func); 619 if (ea_func) ea_item_create_function_set(ea_obj, ea_func);
614 } 620 }
615 /* Properties */ 621 /* Properties */