summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-05-16 15:57:39 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2019-05-16 15:57:39 +0200
commite5c9f5e76fb82a022b13bf9627cc9c00e006e685 (patch)
tree803da015e077d565a980b044153b4ea1f6a5c188
parentb3a870c7bb29461c6478fae9f51c211229b62d9d (diff)
eolian: rename eolian_event_c_name_get
This is for consistency with the new eolian_class_c_macro_get as well as for better clarity, as c_name_get is already provided by Object and refers to something else.
-rw-r--r--src/bin/eolian/headers.c2
-rw-r--r--src/bin/eolian/sources.c2
-rw-r--r--src/bin/eolian_js/main.cc2
-rw-r--r--src/bindings/luajit/eolian.lua6
-rw-r--r--src/lib/eolian/Eolian.h6
-rw-r--r--src/lib/eolian/database_event_api.c2
-rw-r--r--src/lib/eolian_cxx/grammar/klass_def.hpp2
-rw-r--r--src/scripts/pyolian/eolian.py4
-rw-r--r--src/scripts/pyolian/eolian_lib.py6
-rwxr-xr-xsrc/scripts/pyolian/test_eolian.py2
10 files changed, 17 insertions, 17 deletions
diff --git a/src/bin/eolian/headers.c b/src/bin/eolian/headers.c
index 645d694..63f38fe 100644
--- a/src/bin/eolian/headers.c
+++ b/src/bin/eolian/headers.c
@@ -248,7 +248,7 @@ events:
248 itr = eolian_class_events_get(cl); 248 itr = eolian_class_events_get(cl);
249 EINA_ITERATOR_FOREACH(itr, ev) 249 EINA_ITERATOR_FOREACH(itr, ev)
250 { 250 {
251 Eina_Stringshare *evn = eolian_event_c_name_get(ev); 251 Eina_Stringshare *evn = eolian_event_c_macro_get(ev);
252 Eolian_Object_Scope evs = eolian_event_scope_get(ev); 252 Eolian_Object_Scope evs = eolian_event_scope_get(ev);
253 253
254 if (evs == EOLIAN_SCOPE_PRIVATE) 254 if (evs == EOLIAN_SCOPE_PRIVATE)
diff --git a/src/bin/eolian/sources.c b/src/bin/eolian/sources.c
index 37acd7e..d729b63 100644
--- a/src/bin/eolian/sources.c
+++ b/src/bin/eolian/sources.c
@@ -1054,7 +1054,7 @@ eo_gen_source_gen(const Eolian_Class *cl, Eina_Strbuf *buf)
1054 Eolian_Event *ev; 1054 Eolian_Event *ev;
1055 EINA_ITERATOR_FOREACH(itr, ev) 1055 EINA_ITERATOR_FOREACH(itr, ev)
1056 { 1056 {
1057 Eina_Stringshare *evn = eolian_event_c_name_get(ev); 1057 Eina_Stringshare *evn = eolian_event_c_macro_get(ev);
1058 eina_strbuf_append(buf, "EWAPI const Efl_Event_Description _"); 1058 eina_strbuf_append(buf, "EWAPI const Efl_Event_Description _");
1059 eina_strbuf_append(buf, evn); 1059 eina_strbuf_append(buf, evn);
1060 eina_strbuf_append(buf, " =\n EFL_EVENT_DESCRIPTION"); 1060 eina_strbuf_append(buf, " =\n EFL_EVENT_DESCRIPTION");
diff --git a/src/bin/eolian_js/main.cc b/src/bin/eolian_js/main.cc
index 71466a8..378f2bb 100644
--- a/src/bin/eolian_js/main.cc
+++ b/src/bin/eolian_js/main.cc
@@ -1041,7 +1041,7 @@ int main(int argc, char** argv)
1041 { 1041 {
1042 auto tp = eolian_event_type_get(&*first); 1042 auto tp = eolian_event_type_get(&*first);
1043 ss << " {\n"; 1043 ss << " {\n";
1044 ss << " static efl::eo::js::event_information ev_info{&constructor_from_eo, " << eolian_event_c_name_get(&*first); 1044 ss << " static efl::eo::js::event_information ev_info{&constructor_from_eo, " << eolian_event_c_macro_get(&*first);
1045 ss << ", &efl::eo::js::event_callback<"; 1045 ss << ", &efl::eo::js::event_callback<";
1046 ss << (tp ? _eolian_type_cpp_type_named_get(tp, class_name, need_name_getter) : "void"); 1046 ss << (tp ? _eolian_type_cpp_type_named_get(tp, class_name, need_name_getter) : "void");
1047 ss << ">, \"" << type_class_name(tp) << "\"};\n"; 1047 ss << ">, \"" << type_class_name(tp) << "\"};\n";
diff --git a/src/bindings/luajit/eolian.lua b/src/bindings/luajit/eolian.lua
index 7188651..20118af 100644
--- a/src/bindings/luajit/eolian.lua
+++ b/src/bindings/luajit/eolian.lua
@@ -401,7 +401,7 @@ ffi.cdef [[
401 Eina_Bool eolian_event_is_hot(const Eolian_Event *event); 401 Eina_Bool eolian_event_is_hot(const Eolian_Event *event);
402 Eina_Bool eolian_event_is_restart(const Eolian_Event *event); 402 Eina_Bool eolian_event_is_restart(const Eolian_Event *event);
403 Eina_Iterator *eolian_class_parts_get(const Eolian_Class *klass); 403 Eina_Iterator *eolian_class_parts_get(const Eolian_Class *klass);
404 const char *eolian_event_c_name_get(const Eolian_Event *event); 404 const char *eolian_event_c_macro_get(const Eolian_Event *event);
405 const Eolian_Class *eolian_part_class_get(const Eolian_Part *part); 405 const Eolian_Class *eolian_part_class_get(const Eolian_Part *part);
406 const Eolian_Documentation *eolian_part_documentation_get(const Eolian_Part *part); 406 const Eolian_Documentation *eolian_part_documentation_get(const Eolian_Part *part);
407 const Eolian_Event *eolian_class_event_by_name_get(const Eolian_Class *klass, const char *event_name); 407 const Eolian_Event *eolian_class_event_by_name_get(const Eolian_Class *klass, const char *event_name);
@@ -1375,8 +1375,8 @@ ffi.metatype("Eolian_Event", {
1375 return tonumber(eolian.eolian_event_scope_get(self)) 1375 return tonumber(eolian.eolian_event_scope_get(self))
1376 end, 1376 end,
1377 1377
1378 c_name_get = function(self) 1378 c_macro_get = function(self)
1379 local v = eolian.eolian_event_c_name_get(self) 1379 local v = eolian.eolian_event_c_macro_get(self)
1380 if v == nil then return nil end 1380 if v == nil then return nil end
1381 return ffi_stringshare(v) 1381 return ffi_stringshare(v)
1382 end, 1382 end,
diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h
index 3207e16..3715ed1 100644
--- a/src/lib/eolian/Eolian.h
+++ b/src/lib/eolian/Eolian.h
@@ -2214,16 +2214,16 @@ EAPI Eina_Bool eolian_event_is_restart(const Eolian_Event *event);
2214EAPI Eina_Iterator *eolian_class_parts_get(const Eolian_Class *klass); 2214EAPI Eina_Iterator *eolian_class_parts_get(const Eolian_Class *klass);
2215 2215
2216/* 2216/*
2217 * @brief Returns the C name of an event 2217 * @brief Returns the C macro name used to refer to an event
2218 * 2218 *
2219 * @param[in] event the event handle 2219 * @param[in] event the event handle
2220 * @return the event C name 2220 * @return the event C macro
2221 * 2221 *
2222 * You're responsible for deleting the stringshare. 2222 * You're responsible for deleting the stringshare.
2223 * 2223 *
2224 * @ingroup Eolian 2224 * @ingroup Eolian
2225 */ 2225 */
2226EAPI Eina_Stringshare *eolian_event_c_name_get(const Eolian_Event *event); 2226EAPI Eina_Stringshare *eolian_event_c_macro_get(const Eolian_Event *event);
2227 2227
2228/* 2228/*
2229 * @brief A helper function to get the name of a part. 2229 * @brief A helper function to get the name of a part.
diff --git a/src/lib/eolian/database_event_api.c b/src/lib/eolian/database_event_api.c
index 4142c50..2c0647d 100644
--- a/src/lib/eolian/database_event_api.c
+++ b/src/lib/eolian/database_event_api.c
@@ -50,7 +50,7 @@ eolian_event_is_restart(const Eolian_Event *event)
50} 50}
51 51
52EAPI Eina_Stringshare * 52EAPI Eina_Stringshare *
53eolian_event_c_name_get(const Eolian_Event *event) 53eolian_event_c_macro_get(const Eolian_Event *event)
54{ 54{
55 char buf[512]; 55 char buf[512];
56 char *tmp = buf; 56 char *tmp = buf;
diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp b/src/lib/eolian_cxx/grammar/klass_def.hpp
index 60abbb5..c11aba4 100644
--- a/src/lib/eolian_cxx/grammar/klass_def.hpp
+++ b/src/lib/eolian_cxx/grammar/klass_def.hpp
@@ -1059,7 +1059,7 @@ struct event_def
1059 : klass(cls, {attributes::qualifier_info::is_none, std::string()}) 1059 : klass(cls, {attributes::qualifier_info::is_none, std::string()})
1060 , type( ::eolian_event_type_get(event) ? eina::optional<type_def>{{::eolian_event_type_get(event), unit, EOLIAN_C_TYPE_DEFAULT}} : eina::optional<type_def>{}) 1060 , type( ::eolian_event_type_get(event) ? eina::optional<type_def>{{::eolian_event_type_get(event), unit, EOLIAN_C_TYPE_DEFAULT}} : eina::optional<type_def>{})
1061 , name( ::eolian_event_name_get(event)) 1061 , name( ::eolian_event_name_get(event))
1062 , c_name( ::eolian_event_c_name_get(event)) 1062 , c_name( ::eolian_event_c_macro_get(event))
1063 , beta( ::eolian_event_is_beta(event)) 1063 , beta( ::eolian_event_is_beta(event))
1064 , protect( ::eolian_event_scope_get(event) == EOLIAN_SCOPE_PROTECTED) 1064 , protect( ::eolian_event_scope_get(event) == EOLIAN_SCOPE_PROTECTED)
1065 , documentation( ::eolian_event_documentation_get(event)) {} 1065 , documentation( ::eolian_event_documentation_get(event)) {}
diff --git a/src/scripts/pyolian/eolian.py b/src/scripts/pyolian/eolian.py
index 787c9ff..4dce2e6 100644
--- a/src/scripts/pyolian/eolian.py
+++ b/src/scripts/pyolian/eolian.py
@@ -794,8 +794,8 @@ class Event(Object):
794 return "<eolian.Event '{0.name}', c_name='{0.c_name}'>".format(self) 794 return "<eolian.Event '{0.name}', c_name='{0.c_name}'>".format(self)
795 795
796 @cached_property 796 @cached_property
797 def c_name(self): 797 def c_macro(self):
798 s = lib.eolian_event_c_name_get(self) 798 s = lib.eolian_event_c_macro_get(self)
799 ret = _str_to_py(s) 799 ret = _str_to_py(s)
800 lib.eina_stringshare_del(c_void_p(s)) 800 lib.eina_stringshare_del(c_void_p(s))
801 return ret 801 return ret
diff --git a/src/scripts/pyolian/eolian_lib.py b/src/scripts/pyolian/eolian_lib.py
index 15863cf..622486e 100644
--- a/src/scripts/pyolian/eolian_lib.py
+++ b/src/scripts/pyolian/eolian_lib.py
@@ -461,9 +461,9 @@ lib.eolian_constructor_is_optional.restype = c_bool
461 461
462### Eolian_Event ############################################################ 462### Eolian_Event ############################################################
463 463
464# EAPI Eina_Stringshare *eolian_event_c_name_get(const Eolian_Event *event); 464# EAPI Eina_Stringshare *eolian_event_c_macro_get(const Eolian_Event *event);
465lib.eolian_event_c_name_get.argtypes = (c_void_p,) 465lib.eolian_event_c_macro_get.argtypes = (c_void_p,)
466lib.eolian_event_c_name_get.restype = c_void_p # Stringshare TO BE FREED 466lib.eolian_event_c_macro_get.restype = c_void_p # Stringshare TO BE FREED
467 467
468# EAPI const Eolian_Type *eolian_event_type_get(const Eolian_Event *event); 468# EAPI const Eolian_Type *eolian_event_type_get(const Eolian_Event *event);
469lib.eolian_event_type_get.argtypes = (c_void_p,) 469lib.eolian_event_type_get.argtypes = (c_void_p,)
diff --git a/src/scripts/pyolian/test_eolian.py b/src/scripts/pyolian/test_eolian.py
index 0a28cb1..3695330 100755
--- a/src/scripts/pyolian/test_eolian.py
+++ b/src/scripts/pyolian/test_eolian.py
@@ -413,7 +413,7 @@ class TestEolianEvent(unittest.TestCase):
413 ev = cls.event_by_name_get('tick') 413 ev = cls.event_by_name_get('tick')
414 self.assertIsInstance(ev, eolian.Event) 414 self.assertIsInstance(ev, eolian.Event)
415 self.assertEqual(ev.name, 'tick') 415 self.assertEqual(ev.name, 'tick')
416 self.assertEqual(ev.c_name, 'EFL_LOOP_TIMER_EVENT_TIMER_TICK') 416 self.assertEqual(ev.c_macro, 'EFL_LOOP_TIMER_EVENT_TIMER_TICK')
417 self.assertIsNone(ev.type) # TODO is this correct 417 self.assertIsNone(ev.type) # TODO is this correct
418 self.assertIsInstance(ev.documentation, eolian.Documentation) 418 self.assertIsInstance(ev.documentation, eolian.Documentation)
419 self.assertEqual(ev.scope, eolian.Eolian_Object_Scope.PUBLIC) 419 self.assertEqual(ev.scope, eolian.Eolian_Object_Scope.PUBLIC)