summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2016-03-03 13:12:00 +0200
committerDaniel Zaoui <daniel.zaoui@samsung.com>2016-03-03 13:12:00 +0200
commit2ff210498cca2083962643c7d8a8de9d184535f8 (patch)
tree897cf3962a05d3c7c6f2bfb0f712f33d5cf25ba4
parent142e65d1f446b761a3e83de0668ff60dd199e089 (diff)
Removing commented code
-rw-r--r--src/bin/ea_cgen/ea_cgen.c206
1 files changed, 0 insertions, 206 deletions
diff --git a/src/bin/ea_cgen/ea_cgen.c b/src/bin/ea_cgen/ea_cgen.c
index b5014f5..2711dd0 100644
--- a/src/bin/ea_cgen/ea_cgen.c
+++ b/src/bin/ea_cgen/ea_cgen.c
@@ -260,13 +260,6 @@ _prop_apply(const Ea *ea_obj, const Ea *ea_func, const Ea *ea_ret_obj, int space
260 params_buf ? eina_strbuf_string_get(params_buf) : ""); 260 params_buf ? eina_strbuf_string_get(params_buf) : "");
261 if (params_buf) eina_strbuf_free(params_buf); 261 if (params_buf) eina_strbuf_free(params_buf);
262 262
263#if 0
264 /* From callback but not because of item creation */
265 if (obj_ctx->inside_cb && !obj_ctx->inside_item_creation)
266 {
267 ADD_TO_LIST(gl_ctx->global_entities, obj_eid_get(obj));
268 }
269#endif
270 return EINA_TRUE; 263 return EINA_TRUE;
271} 264}
272 265
@@ -363,132 +356,6 @@ _ctor_apply(const Ea *ea_obj, int spaces, Object_Context *obj_ctx)
363 } 356 }
364} 357}
365 358
366#if 0
367
368static Eina_Bool
369_content_set_generate(const Gui_Widget *wdg, const Gui_Widget_Property *prop, void *data)
370{
371 Widget_Context *wdg_ctx = data;
372 const Op_Desc *op_desc;
373 Gui_Value *gui_value;
374 const Eina_List *itr;
375
376 Eina_Stringshare *class_id = wdg_class_name_get(wdg);
377 if (!class_id)
378 {
379 ERR("Property \"class\" is missing in widget: \"%s\"\n", wdg_name_get(wdg));
380 return EINA_FALSE;
381 }
382 op_desc = prop_op_desc_get(prop);
383 if (!op_desc)
384 {
385 ERR("Op Desc for property: \"%s\" was not found in hash table.", prop_name_get(prop));
386 return EINA_FALSE;
387 }
388
389 const Eina_List *values_lst = prop_value_get(prop);
390
391 Eina_Strbuf *buf = eina_strbuf_new();
392 eina_strbuf_append_printf(buf, " eo_do(%s, %s(", wdg_name_get(wdg),
393 db_op_desc_func_name_get(op_desc));
394
395 EINA_LIST_FOREACH(values_lst, itr, gui_value)
396 {
397 if (values_lst != itr)
398 eina_strbuf_append_printf(buf, ", ");
399 if (!_format_string_add(gui_value, buf))
400 {
401 eina_strbuf_free(buf);
402 return EINA_TRUE;
403 }
404 }
405 eina_strbuf_append_printf(wdg_ctx->buf, "%s));\n",
406 eina_strbuf_string_get(buf));
407 eina_strbuf_free(buf);
408
409 return EINA_TRUE;
410}
411
412/* Recursively iteration function, generate items creation code. */
413static void
414_item_iterate(Widget_Context *wdg_ctx, const Gui_Widget *wdg, const Item_Container_Item *wit)
415{
416 Global_Gen_Context *gl_ctx = wdg_ctx->gl_ctx;
417 const Gui_Widget_Property *prop = item_container_item_prop_get(wit);
418 Eid *wit_id = item_container_item_eid_get(wit);
419 const Op_Desc *op_desc;
420 const Eina_List *itr;
421
422 const char *item_name = NULL;
423 if (item_container_item_public_get(wit) || item_container_item_subitems_get(wit)) item_name = eid_name_get(wit_id);
424
425 Eina_Stringshare *class_id = wdg_class_name_get(wdg);
426 if (!class_id)
427 {
428 ERR("Property \"class\" is missing in widget: \"%s\"\n", wdg_name_get(wdg));
429 return;
430 }
431 op_desc = prop_op_desc_get(prop);
432 if (!op_desc)
433 {
434 ERR("Op Desc for property: \"%s\" was not found in hash table.", prop_name_get(prop));
435 return;
436 }
437
438 /* Check if item is public or has subitems.
439 * If TRUE, variable need to be declared and assigned. */
440 if (item_name)
441 {
442 eina_strbuf_append_printf(wdg_ctx->buf, " eo_do(%s, %s = %s(",
443 wdg_name_get(wdg), item_name, db_op_desc_func_name_get(op_desc));
444 wdg_ctx->declarations = eina_list_append(wdg_ctx->declarations, wit_id);
445 }
446 else
447 eina_strbuf_append_printf(wdg_ctx->buf, " eo_do(%s, %s(",
448 wdg_name_get(wdg), db_op_desc_func_name_get(op_desc));
449
450 if (wdg_ctx->inside_cb)
451 {
452 ADD_TO_LIST(gl_ctx->global_entities, wdg_eid_get(wdg));
453 }
454
455 const Eina_List *values_lst = prop_value_get(prop);
456 Gui_Value *val;
457 EINA_LIST_FOREACH(values_lst, itr, val)
458 {
459 if (values_lst != itr)
460 eina_strbuf_append_printf(wdg_ctx->buf, ", ");
461 _format_string_add(val, wdg_ctx->buf);
462 }
463 eina_strbuf_append_printf(wdg_ctx->buf, "));\n");
464
465 /* We don't make a widget public if it is created inside a callback, cause we don't have any way to
466 * store it and return it to the upper layer. */
467 if (!wdg_ctx->inside_cb && item_container_item_public_get(wit))
468 {
469 eina_strbuf_append_printf(wdg_ctx->buf, " %s->%s = %s;\n", PUB_WIDGETS, item_name, item_name);
470 eina_strbuf_append_printf(wdg_ctx->pub_widgets_buf, " Elm_Object_Item *%s;\n", item_name);
471 }
472
473 Eid *eid;
474 EINA_LIST_FOREACH(item_container_item_subitems_get(wit), itr, eid)
475 {
476 Item_Container_Item *witr = item_container_item_get_from_id(eid);
477 _item_iterate(wdg_ctx, wdg, witr);
478 }
479}
480
481static Eina_Bool
482_item_add_generate(const Gui_Widget *wdg, const Item_Container_Item *wit, void *data EINA_UNUSED)
483{
484 Widget_Context *wdg_ctx = data;
485
486 _item_iterate(wdg_ctx, wdg, wit);
487
488 return EINA_TRUE;
489}
490#endif
491
492/* Generate string for given callback. */ 359/* Generate string for given callback. */
493static Eina_Bool 360static Eina_Bool
494_callback_generate(const Ea *ea_obj, const Ea *ea_cb, Object_Context *obj_ctx) 361_callback_generate(const Ea *ea_obj, const Ea *ea_cb, Object_Context *obj_ctx)
@@ -704,40 +571,6 @@ _obj_create(const Ea *ea_obj, Object_Context *obj_ctx)
704 return EINA_TRUE; 571 return EINA_TRUE;
705} 572}
706 573
707#if 0
708/* Recursively generate context for widget and its children. */
709static void
710_iter_widget(Global_Gen_Context *gl_ctx, Widget_Context *wdg_ctx, Gui_Widget *wdg)
711{
712 if (session_wdg_exists(session, wdg)) return;
713
714 if (manager_widget_create(wdg, MODE_GENERATOR, wdg_ctx))
715 {
716 manager_widget_configure(wdg, MODE_GENERATOR, wdg_ctx);
717 /* We don't need to check children creations for items containers,
718 * as it will be checked inside item_add.
719 * The reason is that, for e.g naviframe, not all the contents have
720 * to be created when the naviframe is created. */
721 if (!wdg_item_container_root_get(wdg))
722 {
723 const Eina_List *itr;
724 Eid *wid;
725 EINA_LIST_FOREACH(wdg_children_list_get(wdg), itr, wid)
726 {
727 Gui_Widget *w = wdg_get(wid);
728 if (w) _iter_widget(gl_ctx, wdg_ctx, w);
729 }
730 }
731 /* If the widget is a win, we have to apply its visibility property. */
732 if (IS_WIN(wdg))
733 {
734 Gui_Widget_Property *prop = wdg_prop_get(wdg, DB_DEF_EVAS_OBJECT_CLASS, VISIBILITY_SET);
735 _wdg_prop_add_generate(wdg, prop, wdg_ctx);
736 }
737 }
738}
739#endif
740
741/* Generate a creation function for a widget. */ 574/* Generate a creation function for a widget. */
742static void 575static void
743_obj_creation_function_generate(Ea *ea_obj, Object_Context *obj_ctx) 576_obj_creation_function_generate(Ea *ea_obj, Object_Context *obj_ctx)
@@ -1014,45 +847,6 @@ _session_generate()
1014 eina_strbuf_append_printf(session_ctx.buf, "#endif\n"); 847 eina_strbuf_append_printf(session_ctx.buf, "#endif\n");
1015 } 848 }
1016 849
1017#if 0
1018 eina_strbuf_append_printf(gl_ctx->c_buf,
1019 "static %s_Widgets g_%s;\n\n",
1020 gl_ctx->Formatted_Project_Name, PUB_WIDGETS);
1021
1022 /* Append global widgets names */
1023 EINA_LIST_FOREACH(gl_ctx->global_entities, itr, eid)
1024 {
1025 switch (eid_type_get(eid))
1026 {
1027 case EID_TYPE_WIDGET:
1028 {
1029 Gui_Widget *w = wdg_get(eid);
1030 if (w) eina_strbuf_append_printf(gl_ctx->c_buf, "static Eo *%s;\n", wdg_name_get(w));
1031 break;
1032 }
1033 case EID_TYPE_ITEM:
1034 {
1035 Item_Container_Item *it = item_container_item_get_from_id(eid);
1036 if (it) eina_strbuf_append_printf(gl_ctx->c_buf, "static Elm_Object_Item *%s;\n",
1037 eid_name_get(eid));
1038 break;
1039 }
1040 default:
1041 break;
1042 }
1043 }
1044
1045 eina_strbuf_append_printf(gl_ctx->c_buf,"%s", eina_strbuf_string_get(resources_buf));
1046
1047 EINA_LIST_FOREACH((const Eina_List *)wdg_ctxs, itr, wdg_ctx)
1048 {
1049 eina_strbuf_append_printf(gl_ctx->h_buf, "%s\n",
1050 eina_strbuf_string_get(wdg_ctx->pub_widgets_buf));
1051 }
1052
1053 eina_strbuf_append_printf(gl_ctx->h_buf, "#endif\n");
1054#endif
1055
1056 EINA_LIST_FREE(obj_ctxs, obj_ctx) 850 EINA_LIST_FREE(obj_ctxs, obj_ctx)
1057 { 851 {
1058 eina_strbuf_free(obj_ctx->pub_widgets_buf); 852 eina_strbuf_free(obj_ctx->pub_widgets_buf);