summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/eolian/eo_generator.c13
-rw-r--r--src/bin/eolian_cxx/eolian_wrappers.hh6
-rw-r--r--src/lib/eolian/Eolian.h33
-rw-r--r--src/lib/eolian/database_event_api.c27
-rw-r--r--src/lib/eolian/database_print.c10
5 files changed, 56 insertions, 33 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}
diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h
index e5c72f30e4..c57f3df482 100644
--- a/src/lib/eolian/Eolian.h
+++ b/src/lib/eolian/Eolian.h
@@ -873,17 +873,34 @@ EAPI Eina_Iterator *eolian_class_implements_get(const Eolian_Class *klass);
873EAPI Eina_Iterator *eolian_class_events_get(const Eolian_Class *klass); 873EAPI Eina_Iterator *eolian_class_events_get(const Eolian_Class *klass);
874 874
875/* 875/*
876 * @brief Get information about an event. 876 * @brief Get the name of an event.
877 * 877 *
878 * @param[in] event handle of the event 878 * @param[in] event the event handle
879 * @param[out] event_name name of the event 879 * @return the name or NULL
880 * @param[out] event_type type of the event 880 *
881 * @param[out] event_desc description of the event 881 * @ingroup Eolian
882 * @return EINA_TRUE on success, EINA_FALSE otherwise. 882 */
883EAPI Eina_Stringshare *eolian_event_name_get(const Eolian_Event *event);
884
885/*
886 * @brief Get the type of an event.
887 *
888 * @param[in] event the event handle
889 * @return the type or NULL
890 *
891 * @ingroup Eolian
892 */
893EAPI Eolian_Type *eolian_event_type_get(const Eolian_Event *event);
894
895/*
896 * @brief Get the description of an event.
897 *
898 * @param[in] event the event handle
899 * @return the description or NULL
883 * 900 *
884 * @ingroup Eolian 901 * @ingroup Eolian
885 */ 902 */
886EAPI Eina_Bool eolian_class_event_information_get(const Eolian_Event *event, const char **event_name, const Eolian_Type **event_type, const char **event_desc); 903EAPI Eina_Stringshare *eolian_event_description_get(const Eolian_Event *event);
887 904
888/* 905/*
889 * @brief Returns the scope of an event 906 * @brief Returns the scope of an event
@@ -893,7 +910,7 @@ EAPI Eina_Bool eolian_class_event_information_get(const Eolian_Event *event, con
893 * 910 *
894 * @ingroup Eolian 911 * @ingroup Eolian
895 */ 912 */
896EAPI Eolian_Object_Scope eolian_class_event_scope_get(const Eolian_Event *event); 913EAPI Eolian_Object_Scope eolian_event_scope_get(const Eolian_Event *event);
897 914
898/* 915/*
899 * @brief Indicates if the class constructor has to invoke 916 * @brief Indicates if the class constructor has to invoke
diff --git a/src/lib/eolian/database_event_api.c b/src/lib/eolian/database_event_api.c
index 877932e1f8..29169786cf 100644
--- a/src/lib/eolian/database_event_api.c
+++ b/src/lib/eolian/database_event_api.c
@@ -1,18 +1,29 @@
1#include <Eina.h> 1#include <Eina.h>
2#include "eolian_database.h" 2#include "eolian_database.h"
3 3
4EAPI Eina_Bool 4EAPI Eina_Stringshare *
5eolian_class_event_information_get(const Eolian_Event *event, const char **event_name, const Eolian_Type **event_type, const char **event_comment) 5eolian_event_name_get(const Eolian_Event *event)
6{ 6{
7 EINA_SAFETY_ON_NULL_RETURN_VAL(event, EINA_FALSE); 7 EINA_SAFETY_ON_NULL_RETURN_VAL(event, NULL);
8 if (event_name) *event_name = event->name; 8 return event->name;
9 if (event_type) *event_type = event->type; 9}
10 if (event_comment) *event_comment = event->comment; 10
11 return EINA_TRUE; 11EAPI Eolian_Type *
12eolian_event_type_get(const Eolian_Event *event)
13{
14 EINA_SAFETY_ON_NULL_RETURN_VAL(event, NULL);
15 return event->type;
16}
17
18EAPI Eina_Stringshare *
19eolian_event_description_get(const Eolian_Event *event)
20{
21 EINA_SAFETY_ON_NULL_RETURN_VAL(event, NULL);
22 return event->comment;
12} 23}
13 24
14EAPI Eolian_Object_Scope 25EAPI Eolian_Object_Scope
15eolian_class_event_scope_get(const Eolian_Event *event) 26eolian_event_scope_get(const Eolian_Event *event)
16{ 27{
17 EINA_SAFETY_ON_NULL_RETURN_VAL(event, EOLIAN_SCOPE_PUBLIC); 28 EINA_SAFETY_ON_NULL_RETURN_VAL(event, EOLIAN_SCOPE_PUBLIC);
18 return event->scope; 29 return event->scope;
diff --git a/src/lib/eolian/database_print.c b/src/lib/eolian/database_print.c
index 7b110d8e65..8addd8d746 100644
--- a/src/lib/eolian/database_print.c
+++ b/src/lib/eolian/database_print.c
@@ -29,13 +29,11 @@ _implements_print(Eolian_Implement *impl, int nb_spaces)
29static void 29static void
30_event_print(Eolian_Event *ev, int nb_spaces) 30_event_print(Eolian_Event *ev, int nb_spaces)
31{ 31{
32 const char *name, *comment; 32 const Eolian_Type *type = eolian_event_type_get(ev);
33 const Eolian_Type *type; 33 const char *desc = eolian_event_description_get(ev);
34 34 printf("%*s <%s> <", nb_spaces + 5, "", eolian_event_name_get(ev));
35 eolian_class_event_information_get(ev, &name, &type, &comment);
36 printf("%*s <%s> <", nb_spaces + 5, "", name);
37 if (type) database_type_print((Eolian_Type*)type); 35 if (type) database_type_print((Eolian_Type*)type);
38 printf("> <%s>\n", comment); 36 printf("> <%s>\n", desc ? desc : "");
39} 37}
40 38
41static Eina_Bool _function_print(const Eolian_Function *fid, int nb_spaces) 39static Eina_Bool _function_print(const Eolian_Function *fid, int nb_spaces)