summaryrefslogtreecommitdiff
path: root/src/scripts
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-05-16 15:31:37 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2019-05-16 15:43:52 +0200
commit4ab1f2388eb303f8e5d9eae31cdcf39df683c736 (patch)
tree9dc1d113f199f97b1025e38a6c1479303b833a70 /src/scripts
parent7f45f94af0201d48f7fcae14c6320ce3b9bcab71 (diff)
eolian: add API to retrieve the C name of an object
This is to prepare for type/class renaming support. This adds the necessary API to retrieve C-specific names. Other refactoring is necessary elsewhere for now. This also renames the old API eolian_class_c_name_get to eolian_class_c_macro_get to avoid conflict as well as clarify the intention.
Diffstat (limited to 'src/scripts')
-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
3 files changed, 6 insertions, 6 deletions
diff --git a/src/scripts/pyolian/eolian.py b/src/scripts/pyolian/eolian.py
index 84e3f480ed..502c658971 100644
--- a/src/scripts/pyolian/eolian.py
+++ b/src/scripts/pyolian/eolian.py
@@ -636,8 +636,8 @@ class Class(Object):
636 return "<eolian.Class '{0.name}', {0.type!s}>".format(self) 636 return "<eolian.Class '{0.name}', {0.type!s}>".format(self)
637 637
638 @cached_property 638 @cached_property
639 def c_name(self): 639 def c_macro(self):
640 s = lib.eolian_class_c_name_get(self) 640 s = lib.eolian_class_c_macro_get(self)
641 ret = _str_to_py(s) 641 ret = _str_to_py(s)
642 lib.eina_stringshare_del(c_void_p(s)) 642 lib.eina_stringshare_del(c_void_p(s))
643 return ret 643 return ret
diff --git a/src/scripts/pyolian/eolian_lib.py b/src/scripts/pyolian/eolian_lib.py
index 6e9f9cb1a6..655684b66b 100644
--- a/src/scripts/pyolian/eolian_lib.py
+++ b/src/scripts/pyolian/eolian_lib.py
@@ -306,9 +306,9 @@ lib.eolian_class_dtor_enable_get.restype = c_bool
306lib.eolian_class_c_get_function_name_get.argtypes = (c_void_p,) 306lib.eolian_class_c_get_function_name_get.argtypes = (c_void_p,)
307lib.eolian_class_c_get_function_name_get.restype = c_void_p # Stringshare TO BE FREED 307lib.eolian_class_c_get_function_name_get.restype = c_void_p # Stringshare TO BE FREED
308 308
309# EAPI Eina_Stringshare *eolian_class_c_name_get(const Eolian_Class *klass); 309# EAPI Eina_Stringshare *eolian_class_c_macro_get(const Eolian_Class *klass);
310lib.eolian_class_c_name_get.argtypes = (c_void_p,) 310lib.eolian_class_c_macro_get.argtypes = (c_void_p,)
311lib.eolian_class_c_name_get.restype = c_void_p # Stringshare TO BE FREED 311lib.eolian_class_c_macro_get.restype = c_void_p # Stringshare TO BE FREED
312 312
313# EAPI Eina_Stringshare *eolian_class_c_data_type_get(const Eolian_Class *klass); 313# EAPI Eina_Stringshare *eolian_class_c_data_type_get(const Eolian_Class *klass);
314lib.eolian_class_c_data_type_get.argtypes = (c_void_p,) 314lib.eolian_class_c_data_type_get.argtypes = (c_void_p,)
diff --git a/src/scripts/pyolian/test_eolian.py b/src/scripts/pyolian/test_eolian.py
index 990fcfc6c9..b394c502cf 100755
--- a/src/scripts/pyolian/test_eolian.py
+++ b/src/scripts/pyolian/test_eolian.py
@@ -333,7 +333,7 @@ class TestEolianClass(unittest.TestCase):
333 self.assertFalse(cls.ctor_enable) 333 self.assertFalse(cls.ctor_enable)
334 self.assertFalse(cls.dtor_enable) 334 self.assertFalse(cls.dtor_enable)
335 self.assertEqual(cls.c_get_function_name, 'efl_loop_timer_class_get') 335 self.assertEqual(cls.c_get_function_name, 'efl_loop_timer_class_get')
336 self.assertEqual(cls.c_name, 'EFL_LOOP_TIMER_CLASS') 336 self.assertEqual(cls.c_macro, 'EFL_LOOP_TIMER_CLASS')
337 self.assertEqual(cls.c_data_type, 'Efl_Loop_Timer_Data') 337 self.assertEqual(cls.c_data_type, 'Efl_Loop_Timer_Data')
338 self.assertEqual([f.name for f in cls.methods], ['reset','loop_reset','delay']) 338 self.assertEqual([f.name for f in cls.methods], ['reset','loop_reset','delay'])
339 self.assertEqual([f.name for f in cls.properties], ['interval','pending']) 339 self.assertEqual([f.name for f in cls.properties], ['interval','pending'])