summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2016-09-21 17:20:52 +0200
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2016-10-07 11:54:23 +0200
commitf8ede73bf970dfda8273e65da75d9cba1a8a6450 (patch)
tree9f21fe1ff56568e5d4ff76e9130d523b09cfa6c5
parentdcda40215cdccf09d1c1ee30bcbda3b5e21cc865 (diff)
eolian gen2: generate docs for funcs/events
-rw-r--r--src/bin/eolian2/headers.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/bin/eolian2/headers.c b/src/bin/eolian2/headers.c
index f9313b4a94..0b1247d3fc 100644
--- a/src/bin/eolian2/headers.c
+++ b/src/bin/eolian2/headers.c
@@ -1,4 +1,5 @@
1#include "main.h" 1#include "main.h"
2#include "docs.h"
2 3
3static const char * 4static const char *
4_cl_type_str_get(const Eolian_Class *cl, Eina_Bool uc) 5_cl_type_str_get(const Eolian_Class *cl, Eina_Bool uc)
@@ -58,6 +59,15 @@ _gen_func(const Eolian_Function *fid, Eolian_Function_Type ftype,
58 if (!legacy && (fsc == EOLIAN_SCOPE_PROTECTED)) 59 if (!legacy && (fsc == EOLIAN_SCOPE_PROTECTED))
59 eina_strbuf_append_printf(buf, "#ifdef %s_PROTECTED\n", cnameu); 60 eina_strbuf_append_printf(buf, "#ifdef %s_PROTECTED\n", cnameu);
60 61
62 Eina_Bool hasdoc = eolian_function_documentation_get(fid, EOLIAN_UNRESOLVED) ||
63 eolian_function_documentation_get(fid, ftype);
64 if (hasdoc)
65 {
66 Eina_Strbuf *dbuf = eo_gen_docs_func_gen(fid, ftype, 0, legacy);
67 eina_strbuf_append(buf, eina_strbuf_string_get(dbuf));
68 eina_strbuf_append_char(buf, '\n');
69 eina_strbuf_free(dbuf);
70 }
61 eina_strbuf_append(buf, legacy ? "EAPI " : "EOAPI "); 71 eina_strbuf_append(buf, legacy ? "EAPI " : "EOAPI ");
62 if (rtp) 72 if (rtp)
63 { 73 {
@@ -208,6 +218,18 @@ eo_gen_header_gen(const Eolian_Class *cl, Eina_Strbuf *buf, Eina_Bool legacy)
208 218
209 if (!legacy) 219 if (!legacy)
210 { 220 {
221 const Eolian_Documentation *doc = eolian_class_documentation_get(cl);
222 if (doc)
223 {
224 Eina_Strbuf *cdoc = eo_gen_docs_full_gen(doc,
225 eolian_class_full_name_get(cl), 0, EINA_FALSE);
226 if (cdoc)
227 {
228 eina_strbuf_append(buf, eina_strbuf_string_get(cdoc));
229 eina_strbuf_append_char(buf, '\n');
230 eina_strbuf_free(cdoc);
231 }
232 }
211 eina_strbuf_append_printf(buf, "#define %s_%s %s_%s_get()\n\n", 233 eina_strbuf_append_printf(buf, "#define %s_%s %s_%s_get()\n\n",
212 cnameu, _cl_type_str_get(cl, EINA_TRUE), 234 cnameu, _cl_type_str_get(cl, EINA_TRUE),
213 cnamel, _cl_type_str_get(cl, EINA_FALSE)); 235 cnamel, _cl_type_str_get(cl, EINA_FALSE));
@@ -278,7 +300,13 @@ events:
278 eina_strbuf_append_char(buf, '\n'); 300 eina_strbuf_append_char(buf, '\n');
279 301
280 eina_strbuf_append_printf(buf, "EOAPI extern const " 302 eina_strbuf_append_printf(buf, "EOAPI extern const "
281 "Efl_Event_Description _%s;\n", evn); 303 "Efl_Event_Description _%s;\n\n", evn);
304
305 Eina_Strbuf *evdbuf = eo_gen_docs_event_gen(ev,
306 eolian_class_full_name_get(cl));
307 eina_strbuf_append(buf, eina_strbuf_string_get(evdbuf));
308 eina_strbuf_append_char(buf, '\n');
309 eina_strbuf_free(evdbuf);
282 eina_strbuf_append_printf(buf, "#define %s (&(_%s))\n", evn, evn); 310 eina_strbuf_append_printf(buf, "#define %s (&(_%s))\n", evn, evn);
283 311
284 if (evs == EOLIAN_SCOPE_PROTECTED) 312 if (evs == EOLIAN_SCOPE_PROTECTED)