yakov pushed a commit to branch master.

http://git.enlightenment.org/tools/erigo.git/commit/?id=6dad98b2e3cb7f04f3dfe4120ba0aac8556b1b24

commit 6dad98b2e3cb7f04f3dfe4120ba0aac8556b1b24
Author: Yakov Goldberg <yako...@samsung.com>
Date:   Sun Mar 6 13:57:15 2016 +0200

    Adapt C-generator to Eo4
---
 src/lib/generator.c | 30 ++++++++++++++----------------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/src/lib/generator.c b/src/lib/generator.c
index b3ea058..2c3fa50 100644
--- a/src/lib/generator.c
+++ b/src/lib/generator.c
@@ -357,8 +357,7 @@ _wdg_prop_add_generate(Gui_Session *session EINA_UNUSED, 
const Gui_Widget *wdg,
      }
    else
      {
-        eina_strbuf_append_printf(buf, "   eo_do(%s, %s(", wdg_name_get(wdg),
-                                  db_op_desc_func_name_get(op_desc));
+        eina_strbuf_append_printf(buf, "   %s(%s, ", 
db_op_desc_func_name_get(op_desc), wdg_name_get(wdg));
      }
 
    /* From callback but not because of item creation */
@@ -399,7 +398,7 @@ finalize:
      }
    else
      {
-        eina_strbuf_append_printf(wdg_ctx->buf, "%s));\n",
+        eina_strbuf_append_printf(wdg_ctx->buf, "%s);\n",
                                   eina_strbuf_string_get(buf));
      }
    eina_strbuf_free(buf);
@@ -445,8 +444,7 @@ _content_set_generate(Gui_Session *session EINA_UNUSED, 
const Gui_Widget *wdg, c
      }
    else
      {
-        eina_strbuf_append_printf(buf, "   eo_do(%s, %s(", wdg_name_get(wdg),
-              db_op_desc_func_name_get(op_desc));
+        eina_strbuf_append_printf(buf, "   %s(%s, ", 
db_op_desc_func_name_get(op_desc), wdg_name_get(wdg));
      }
 
    EINA_LIST_FOREACH(values_lst, itr, gui_value)
@@ -466,7 +464,7 @@ _content_set_generate(Gui_Session *session EINA_UNUSED, 
const Gui_Widget *wdg, c
      }
    else
      {
-        eina_strbuf_append_printf(wdg_ctx->buf, "%s));\n",
+        eina_strbuf_append_printf(wdg_ctx->buf, "%s);\n",
                                   eina_strbuf_string_get(buf));
      }
    eina_strbuf_free(buf);
@@ -528,9 +526,9 @@ _item_iterate(Gui_Session *session, Widget_Context 
*wdg_ctx, const Gui_Widget *w
      }
    else
      {
-        eina_strbuf_append_printf(wdg_ctx->buf, "   eo_do(%s, %s%s%s(",
-              wdg_name_get(wdg), item_name ? item_name : "", item_name?" = 
":"",
-              db_op_desc_func_name_get(op_desc));
+        eina_strbuf_append_printf(wdg_ctx->buf, "   %s%s%s(%s, ",
+              item_name ? item_name : "", item_name?" = ":"",
+              db_op_desc_func_name_get(op_desc), wdg_name_get(wdg));
      }
    if (item_name) wdg_ctx->declarations = 
eina_list_append(wdg_ctx->declarations, wit_id);
 
@@ -555,7 +553,7 @@ _item_iterate(Gui_Session *session, Widget_Context 
*wdg_ctx, const Gui_Widget *w
      }
    else
      {
-        eina_strbuf_append_printf(wdg_ctx->buf, "));\n");
+        eina_strbuf_append_printf(wdg_ctx->buf, ");\n");
      }
 
    /* Handle special case when toolbar's item is separator.
@@ -571,7 +569,7 @@ _item_iterate(Gui_Session *session, Widget_Context 
*wdg_ctx, const Gui_Widget *w
         else
           {
              if (item_name)
-               eina_strbuf_append_printf(wdg_ctx->buf, "  eo_do(%s, 
elm_obj_toolbar_item_separator_set(EINA_TRUE));\n", item_name);
+               eina_strbuf_append_printf(wdg_ctx->buf, "  
elm_obj_toolbar_item_separator_set(%s, EINA_TRUE);\n", item_name);
           }
      }
 
@@ -663,8 +661,8 @@ _wdg_add_generate(Gui_Session *session, const Gui_Widget 
*wdg, void *data)
                }
              else
                {
-                  eina_strbuf_append_printf(wdg_ctx->buf, "   eo_do(%s, %s = 
elm_obj_win_main_menu_get());\n",
-                                            parent_id, wdg_name_get(wdg));
+                  eina_strbuf_append_printf(wdg_ctx->buf, "   %s = 
elm_obj_win_main_menu_get(%s);\n",
+                                            wdg_name_get(wdg), parent_id);
                }
              goto end;
           }
@@ -699,7 +697,7 @@ _wdg_add_generate(Gui_Session *session, const Gui_Widget 
*wdg, void *data)
              if (db_op_desc_is_constructor(op_desc))
                {
                   if (!gl_ctx->generate_legacy)
-                     eina_strbuf_append_printf(constr_buf, "%s(", 
db_op_desc_func_name_get(op_desc));
+                     eina_strbuf_append_printf(constr_buf, "%s(eoid, ", 
db_op_desc_func_name_get(op_desc));
 
                   const Eina_List *values_lst = prop_value_get(prop), *itr2;
                   Gui_Value *gui_value = NULL;
@@ -809,7 +807,7 @@ _wdg_creation_function_generate(Gui_Session *session, 
Gui_Widget *wdg, Widget_Co
    else
      {
         eina_strbuf_append_printf(wdg_ctx->buf,
-              "   eo_do(%s, eo_event_callback_add(EO_BASE_EVENT_DEL, 
_pubs_free_cb, pub_widgets));",
+              "   eo_event_callback_add(%s, EO_BASE_EVENT_DEL, _pubs_free_cb, 
pub_widgets);",
               wdg_name);
      }
 
@@ -928,7 +926,7 @@ _wdg_cb_add_generate(Gui_Session *session, const Gui_Widget 
*wdg, const Gui_Widg
           {
              char *event_name = 
_c_plugin_eo_event_name_get(wdg_class_name_get(wdg), cb_type);
              if (!event_name) goto end;
-             eina_strbuf_append_printf(wdg_ctx->buf, "   eo_do(%s, 
eo_event_callback_add(%s, %s, NULL));\n",
+             eina_strbuf_append_printf(wdg_ctx->buf, "   
eo_event_callback_add(%s, %s, %s, NULL);\n",
                    wdg_name_get(wdg), event_name, _wdg_cb_type_str);
              free(event_name);
           }

-- 


Reply via email to