summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2014-08-13 12:06:48 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2014-08-21 09:26:04 +0100
commit057e01d67fdcbb715580a4e34af52f09de4e0e29 (patch)
treeb737b6d6d48d26136defe6d421601add3a42bec9 /src/bin
parentffbf149da16962b4c1540aa261c46d7e6b455021 (diff)
eolian: API refactoring
Start getting rid of the terrible _information_get APIs, starting with events.
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/eolian/eo_generator.c13
-rw-r--r--src/bin/eolian_cxx/eolian_wrappers.hh6
2 files changed, 8 insertions, 11 deletions
diff --git a/src/bin/eolian/eo_generator.c b/src/bin/eolian/eo_generator.c
index 505072ef77..3e34e24bf0 100644
--- a/src/bin/eolian/eo_generator.c
+++ b/src/bin/eolian/eo_generator.c
@@ -275,9 +275,8 @@ eo_header_generate(const Eolian_Class *class, Eina_Strbuf *buf)
275 itr = eolian_class_events_get(class); 275 itr = eolian_class_events_get(class);
276 EINA_ITERATOR_FOREACH(itr, event) 276 EINA_ITERATOR_FOREACH(itr, event)
277 { 277 {
278 const char *evname = NULL; 278 const char *evname = eolian_event_name_get(event);
279 const char *evdesc = NULL; 279 const char *evdesc = eolian_event_description_get(event);
280 eolian_class_event_information_get(event, &evname, NULL, &evdesc);
281 280
282 if (!evdesc) evdesc = "No description"; 281 if (!evdesc) evdesc = "No description";
283 eina_strbuf_reset(tmpbuf); 282 eina_strbuf_reset(tmpbuf);
@@ -556,13 +555,12 @@ eo_source_beginning_generate(const Eolian_Class *class, Eina_Strbuf *buf)
556 itr = eolian_class_events_get(class); 555 itr = eolian_class_events_get(class);
557 EINA_ITERATOR_FOREACH(itr, event) 556 EINA_ITERATOR_FOREACH(itr, event)
558 { 557 {
559 const char *evname; 558 const char *evname = eolian_event_name_get(event);
560 const char *evdesc; 559 const char *evdesc = eolian_event_description_get(event);
561 char *evdesc_line1; 560 char *evdesc_line1;
562 char *p; 561 char *p;
563 562
564 eina_strbuf_reset(str_ev); 563 eina_strbuf_reset(str_ev);
565 eolian_class_event_information_get(event, &evname, NULL, &evdesc);
566 evdesc_line1 = _source_desc_get(evdesc); 564 evdesc_line1 = _source_desc_get(evdesc);
567 eina_strbuf_append_printf(str_ev, "%s_EVENT_%s", class_env.upper_classname, evname); 565 eina_strbuf_append_printf(str_ev, "%s_EVENT_%s", class_env.upper_classname, evname);
568 p = (char *)eina_strbuf_string_get(str_ev); 566 p = (char *)eina_strbuf_string_get(str_ev);
@@ -776,11 +774,10 @@ eo_source_end_generate(const Eolian_Class *class, Eina_Strbuf *buf)
776 itr = eolian_class_events_get(class); 774 itr = eolian_class_events_get(class);
777 EINA_ITERATOR_FOREACH(itr, event) 775 EINA_ITERATOR_FOREACH(itr, event)
778 { 776 {
779 const char *evname; 777 const char *evname = eolian_event_name_get(event);
780 char *p; 778 char *p;
781 779
782 eina_strbuf_reset(tmpbuf); 780 eina_strbuf_reset(tmpbuf);
783 eolian_class_event_information_get(event, &evname, NULL, NULL);
784 eina_strbuf_append_printf(tmpbuf, "%s_EVENT_%s", class_env.upper_classname, evname); 781 eina_strbuf_append_printf(tmpbuf, "%s_EVENT_%s", class_env.upper_classname, evname);
785 p = (char *)eina_strbuf_string_get(tmpbuf); 782 p = (char *)eina_strbuf_string_get(tmpbuf);
786 eina_str_toupper(&p); 783 eina_str_toupper(&p);
diff --git a/src/bin/eolian_cxx/eolian_wrappers.hh b/src/bin/eolian_cxx/eolian_wrappers.hh
index 6269f37fef..7f10b49e0d 100644
--- a/src/bin/eolian_cxx/eolian_wrappers.hh
+++ b/src/bin/eolian_cxx/eolian_wrappers.hh
@@ -351,8 +351,8 @@ inline efl::eolian::eo_event
351event_create(Eolian_Class const& klass, const Eolian_Event *event_) 351event_create(Eolian_Class const& klass, const Eolian_Event *event_)
352{ 352{
353 efl::eolian::eo_event event; 353 efl::eolian::eo_event event;
354 const char *name, *comment; 354 const char *name = ::eolian_event_name_get(event_);
355 if(::eolian_class_event_information_get(event_, &name, NULL, &comment)) 355 if (name)
356 { 356 {
357 std::string name_ = safe_str(name); 357 std::string name_ = safe_str(name);
358 std::transform(name_.begin(), name_.end(), name_.begin(), 358 std::transform(name_.begin(), name_.end(), name_.begin(),
@@ -360,7 +360,7 @@ event_create(Eolian_Class const& klass, const Eolian_Event *event_)
360 event.name = normalize_spaces(name_); 360 event.name = normalize_spaces(name_);
361 event.eo_name = safe_upper 361 event.eo_name = safe_upper
362 (find_replace(class_full_name(klass), ".", "_") + "_EVENT_" + event.name); 362 (find_replace(class_full_name(klass), ".", "_") + "_EVENT_" + event.name);
363 event.comment = safe_str(comment); 363 event.comment = safe_str(eolian_event_description_get(event_));
364 } 364 }
365 return event; 365 return event;
366} 366}