diff options
author | Daniel Zaoui <daniel.zaoui@samsung.com> | 2014-03-20 17:33:25 +0200 |
---|---|---|
committer | Daniel Zaoui <daniel.zaoui@samsung.com> | 2014-03-24 08:14:30 +0200 |
commit | 0987b31247b99fcd78eaaddd60072279a9dc9be4 (patch) | |
tree | 362950c5b61675cd43bff07fad5e513f10bb0a2d /src/bin/eolian/eo1_generator.c | |
parent | 2be615916a019b82f772203ffd35aed4ff21732e (diff) |
Eolian/Generator: detach Eo1 from Legacy generator.
This step is needed to clean the code and to prepare the integration of
Eo2 inside Eolian.
Except the eo_do invocation, there is no reason why legacy has to know
about Eo.
Diffstat (limited to 'src/bin/eolian/eo1_generator.c')
-rw-r--r-- | src/bin/eolian/eo1_generator.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/bin/eolian/eo1_generator.c b/src/bin/eolian/eo1_generator.c index 6573d7f311..b6f61ef63f 100644 --- a/src/bin/eolian/eo1_generator.c +++ b/src/bin/eolian/eo1_generator.c | |||
@@ -854,3 +854,49 @@ end: | |||
854 | return ret; | 854 | return ret; |
855 | } | 855 | } |
856 | 856 | ||
857 | Eina_Bool | ||
858 | eo_source_generate(const char *classname, int eo_version EINA_UNUSED, Eina_Strbuf *buf) | ||
859 | { | ||
860 | Eina_Bool ret = EINA_FALSE; | ||
861 | const Eina_List *itr; | ||
862 | Eolian_Function fn; | ||
863 | |||
864 | Eina_Strbuf *str_bodyf = eina_strbuf_new(); | ||
865 | |||
866 | if (!eo1_source_beginning_generate(classname, buf)) goto end; | ||
867 | |||
868 | //Properties | ||
869 | EINA_LIST_FOREACH(eolian_class_functions_list_get(classname, PROPERTY_FUNC), itr, fn) | ||
870 | { | ||
871 | const Eolian_Function_Type ftype = eolian_function_type_get(fn); | ||
872 | |||
873 | Eina_Bool prop_read = ( ftype == SET ) ? EINA_FALSE : EINA_TRUE; | ||
874 | Eina_Bool prop_write = ( ftype == GET ) ? EINA_FALSE : EINA_TRUE; | ||
875 | |||
876 | if (prop_write) | ||
877 | { | ||
878 | if (!eo1_bind_func_generate(classname, fn, SET, str_bodyf, NULL)) goto end; | ||
879 | } | ||
880 | if (prop_read) | ||
881 | { | ||
882 | if (!eo1_bind_func_generate(classname, fn, GET, str_bodyf, NULL)) goto end; | ||
883 | } | ||
884 | } | ||
885 | |||
886 | //Methods | ||
887 | EINA_LIST_FOREACH(eolian_class_functions_list_get(classname, METHOD_FUNC), itr, fn) | ||
888 | { | ||
889 | if (!eo1_bind_func_generate(classname, fn, UNRESOLVED, str_bodyf, NULL)) goto end; | ||
890 | } | ||
891 | |||
892 | eina_strbuf_append(buf, eina_strbuf_string_get(str_bodyf)); | ||
893 | eina_strbuf_reset(str_bodyf); | ||
894 | |||
895 | if (!eo1_source_end_generate(classname, buf)) goto end; | ||
896 | |||
897 | ret = EINA_TRUE; | ||
898 | end: | ||
899 | eina_strbuf_free(str_bodyf); | ||
900 | return ret; | ||
901 | } | ||
902 | |||