summaryrefslogtreecommitdiff
path: root/src/bin/eolian
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2014-08-13 14:54:54 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2014-08-21 09:26:04 +0100
commit2df5eae338c1e419207ebfe68a476af2eeb0da5b (patch)
treebe3e5a7ab1bf8db6a568daccadb888564f6e8e67 /src/bin/eolian
parent93726c86a3ff0d541d901ea7e0b5a033583b9d9d (diff)
eolian/generator: support for private and protected events
Diffstat (limited to 'src/bin/eolian')
-rw-r--r--src/bin/eolian/eo_generator.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/bin/eolian/eo_generator.c b/src/bin/eolian/eo_generator.c
index cb47c21bf1..02402121a8 100644
--- a/src/bin/eolian/eo_generator.c
+++ b/src/bin/eolian/eo_generator.c
@@ -273,13 +273,25 @@ eo_header_generate(const Eolian_Class *class, Eina_Strbuf *buf)
273 { 273 {
274 const char *evname = eolian_event_name_get(event); 274 const char *evname = eolian_event_name_get(event);
275 const char *evdesc = eolian_event_description_get(event); 275 const char *evdesc = eolian_event_description_get(event);
276 Eolian_Object_Scope scope = eolian_event_scope_get(event);
277
278 if (scope == EOLIAN_SCOPE_PRIVATE)
279 continue;
280
281 if (scope == EOLIAN_SCOPE_PROTECTED)
282 {
283 eina_strbuf_append_printf(str_ev, "\n#ifdef %s_PROTECTED\n", class_env.upper_classname);
284 eina_strbuf_append_printf(str_extrn_ev, "#ifdef %s_PROTECTED\n", class_env.upper_classname);
285 }
286 else
287 eina_strbuf_append_char(str_ev, '\n');
276 288
277 if (!evdesc) evdesc = "No description"; 289 if (!evdesc) evdesc = "No description";
278 eina_strbuf_reset(tmpbuf); 290 eina_strbuf_reset(tmpbuf);
279 eina_strbuf_append(tmpbuf, evdesc); 291 eina_strbuf_append(tmpbuf, evdesc);
280 eina_strbuf_replace_all(tmpbuf, "\n", "\n * "); 292 eina_strbuf_replace_all(tmpbuf, "\n", "\n * ");
281 eina_strbuf_prepend(tmpbuf," * "); 293 eina_strbuf_prepend(tmpbuf," * ");
282 eina_strbuf_append_printf(str_ev, "\n/**\n%s\n */\n", eina_strbuf_string_get(tmpbuf)); 294 eina_strbuf_append_printf(str_ev, "/**\n%s\n */\n", eina_strbuf_string_get(tmpbuf));
283 295
284 eina_strbuf_reset(tmpbuf); 296 eina_strbuf_reset(tmpbuf);
285 eina_strbuf_append_printf(tmpbuf, "%s_EVENT_%s", class_env.upper_classname, evname); 297 eina_strbuf_append_printf(tmpbuf, "%s_EVENT_%s", class_env.upper_classname, evname);
@@ -288,6 +300,12 @@ eo_header_generate(const Eolian_Class *class, Eina_Strbuf *buf)
288 eina_str_toupper(&s); 300 eina_str_toupper(&s);
289 eina_strbuf_append_printf(str_ev, "#define %s (&(_%s))\n", s, s); 301 eina_strbuf_append_printf(str_ev, "#define %s (&(_%s))\n", s, s);
290 eina_strbuf_append_printf(str_extrn_ev, "EOAPI extern const Eo_Event_Description _%s;\n", s); 302 eina_strbuf_append_printf(str_extrn_ev, "EOAPI extern const Eo_Event_Description _%s;\n", s);
303
304 if (scope == EOLIAN_SCOPE_PROTECTED)
305 {
306 eina_strbuf_append(str_ev, "#endif\n");
307 eina_strbuf_append(str_extrn_ev, "#endif\n");
308 }
291 } 309 }
292 310
293 int i; 311 int i;