summaryrefslogtreecommitdiff
path: root/src/bin/eolian/eo_generator.c
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2014-07-24 12:15:55 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2014-07-24 12:15:55 +0100
commit178022ab658511a2ef8a92e6cf0d680557b41442 (patch)
tree5d00bcb7c00f884a3d7515012941042b227d49a8 /src/bin/eolian/eo_generator.c
parenta5ad792780f9d1e5029f215455ba49502a745660 (diff)
eolian/generator: add support for class methods/properties
Diffstat (limited to '')
-rw-r--r--src/bin/eolian/eo_generator.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/bin/eolian/eo_generator.c b/src/bin/eolian/eo_generator.c
index 05e9ec6986..3601640bb0 100644
--- a/src/bin/eolian/eo_generator.c
+++ b/src/bin/eolian/eo_generator.c
@@ -523,7 +523,9 @@ eo_op_desc_generate(const Eolian_Class *class, Eolian_Function *fid, Eolian_Func
523 if (ftype == EOLIAN_PROP_GET) suffix = "_get"; 523 if (ftype == EOLIAN_PROP_GET) suffix = "_get";
524 if (ftype == EOLIAN_PROP_SET) suffix = "_set"; 524 if (ftype == EOLIAN_PROP_SET) suffix = "_set";
525 Eina_Bool is_virtual_pure = eolian_function_is_virtual_pure(fid, ftype); 525 Eina_Bool is_virtual_pure = eolian_function_is_virtual_pure(fid, ftype);
526 eina_strbuf_append_printf(buf, "\n EO_OP_FUNC(%s, ", func_env.lower_eo_func); 526 const char *class_str = "";
527 if (eolian_function_is_class(fid)) class_str = "CLASS_";
528 eina_strbuf_append_printf(buf, "\n EO_OP_%sFUNC(%s, ", class_str, func_env.lower_eo_func);
527 if (!is_virtual_pure) 529 if (!is_virtual_pure)
528 eina_strbuf_append_printf(buf, "_%s_%s%s, \"%s\"),", class_env.lower_classname, funcname, suffix, desc); 530 eina_strbuf_append_printf(buf, "_%s_%s%s, \"%s\"),", class_env.lower_classname, funcname, suffix, desc);
529 else 531 else
@@ -674,26 +676,30 @@ eo_source_end_generate(const Eolian_Class *class, Eina_Strbuf *buf)
674 } 676 }
675 677
676 rets = eolian_function_full_c_name_get(fnid, impl_env.lower_eo_prefix); 678 rets = eolian_function_full_c_name_get(fnid, impl_env.lower_eo_prefix);
679
680 const char *class_str = "";
681 if (eolian_function_is_class(fnid)) class_str = "CLASS_";
682
677 switch (ftype) 683 switch (ftype)
678 { 684 {
679 case EOLIAN_PROP_SET: case EOLIAN_PROP_GET: case EOLIAN_PROPERTY: 685 case EOLIAN_PROP_SET: case EOLIAN_PROP_GET: case EOLIAN_PROPERTY:
680 if (ftype != EOLIAN_PROP_GET) 686 if (ftype != EOLIAN_PROP_GET)
681 { 687 {
682 eina_strbuf_append_printf(str_op, "\n EO_OP_FUNC_OVERRIDE(%s_set, _%s_%s_set),", 688 eina_strbuf_append_printf(str_op, "\n EO_OP_%sFUNC_OVERRIDE(%s_set, _%s_%s_set),",
683 rets, implname, funcname); 689 class_str, rets, implname, funcname);
684 eo_bind_func_generate(class, fnid, EOLIAN_PROP_SET, str_bodyf, &impl_env); 690 eo_bind_func_generate(class, fnid, EOLIAN_PROP_SET, str_bodyf, &impl_env);
685 } 691 }
686 692
687 if (ftype != EOLIAN_PROP_SET) 693 if (ftype != EOLIAN_PROP_SET)
688 { 694 {
689 eina_strbuf_append_printf(str_op, "\n EO_OP_FUNC_OVERRIDE(%s_get, _%s_%s_get),", 695 eina_strbuf_append_printf(str_op, "\n EO_OP_%sFUNC_OVERRIDE(%s_get, _%s_%s_get),",
690 rets, implname, funcname); 696 class_str, rets, implname, funcname);
691 eo_bind_func_generate(class, fnid, EOLIAN_PROP_GET, str_bodyf, &impl_env); 697 eo_bind_func_generate(class, fnid, EOLIAN_PROP_GET, str_bodyf, &impl_env);
692 } 698 }
693 break; 699 break;
694 default: 700 default:
695 eina_strbuf_append_printf(str_op, "\n EO_OP_FUNC_OVERRIDE(%s, _%s_%s),", 701 eina_strbuf_append_printf(str_op, "\n EO_OP_%sFUNC_OVERRIDE(%s, _%s_%s),",
696 rets, implname, funcname); 702 class_str, rets, implname, funcname);
697 eo_bind_func_generate(class, fnid, ftype, str_bodyf, &impl_env); 703 eo_bind_func_generate(class, fnid, ftype, str_bodyf, &impl_env);
698 break; 704 break;
699 } 705 }