summaryrefslogtreecommitdiff
path: root/src/scripts
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2019-09-09 18:26:49 +0200
committerDaniel Kolesa <d.kolesa@samsung.com>2019-09-09 18:26:49 +0200
commit267c57d0f10d4b1577181c8f7157b7bc2f8053a6 (patch)
tree7e41546452c4ad6c6aa93664e3e2a858fd01bf9d /src/scripts
parent165921ec040f427875fc0b32b1f03d4a45efd25e (diff)
eolian: remove second parameter for eolian_type_c_type_get
This has been replaced by newer APIs.
Diffstat (limited to 'src/scripts')
-rw-r--r--src/scripts/pyolian/eolian.py21
-rw-r--r--src/scripts/pyolian/eolian_lib.py4
-rwxr-xr-xsrc/scripts/pyolian/test_eolian.py12
3 files changed, 4 insertions, 33 deletions
diff --git a/src/scripts/pyolian/eolian.py b/src/scripts/pyolian/eolian.py
index 22e84e556f..e231d2b579 100644
--- a/src/scripts/pyolian/eolian.py
+++ b/src/scripts/pyolian/eolian.py
@@ -142,11 +142,6 @@ class Eolian_Type_Builtin_Type(IntEnum):
142 VOID_PTR = 48 142 VOID_PTR = 48
143 FREE_CB = 49 143 FREE_CB = 49
144 144
145class Eolian_C_Type_Type(IntEnum):
146 DEFAULT = 0
147 PARAM = 1
148 RETURN = 2
149
150class Eolian_Expression_Type(IntEnum): 145class Eolian_Expression_Type(IntEnum):
151 UNKNOWN = 0 146 UNKNOWN = 0
152 INT = 1 147 INT = 1
@@ -1053,25 +1048,13 @@ class Type(Object):
1053 def builtin_type(self): 1048 def builtin_type(self):
1054 return Eolian_Type_Builtin_Type(lib.eolian_type_builtin_type_get(self)) 1049 return Eolian_Type_Builtin_Type(lib.eolian_type_builtin_type_get(self))
1055 1050
1056 def c_type_get(self, ctype): 1051 def c_type_get(self):
1057 s = lib.eolian_type_c_type_get(self, ctype) 1052 s = lib.eolian_type_c_type_get(self)
1058 ret = _str_to_py(s) 1053 ret = _str_to_py(s)
1059 lib.eina_stringshare_del(c_void_p(s)) 1054 lib.eina_stringshare_del(c_void_p(s))
1060 return ret 1055 return ret
1061 1056
1062 @cached_property 1057 @cached_property
1063 def c_type_default(self):
1064 return self.c_type_get(Eolian_C_Type_Type.DEFAULT)
1065
1066 @cached_property
1067 def c_type_param(self):
1068 return self.c_type_get(Eolian_C_Type_Type.PARAM)
1069
1070 @cached_property
1071 def c_type_return(self):
1072 return self.c_type_get(Eolian_C_Type_Type.RETURN)
1073
1074 @cached_property
1075 def typedecl(self): 1058 def typedecl(self):
1076 c_tdecl = lib.eolian_type_typedecl_get(self) 1059 c_tdecl = lib.eolian_type_typedecl_get(self)
1077 return Typedecl(c_tdecl) if c_tdecl else None 1060 return Typedecl(c_tdecl) if c_tdecl else None
diff --git a/src/scripts/pyolian/eolian_lib.py b/src/scripts/pyolian/eolian_lib.py
index b532e98197..b9ee5d39a1 100644
--- a/src/scripts/pyolian/eolian_lib.py
+++ b/src/scripts/pyolian/eolian_lib.py
@@ -603,8 +603,8 @@ lib.eolian_type_is_const.restype = c_bool
603lib.eolian_type_is_ptr.argtypes = (c_void_p,) 603lib.eolian_type_is_ptr.argtypes = (c_void_p,)
604lib.eolian_type_is_ptr.restype = c_bool 604lib.eolian_type_is_ptr.restype = c_bool
605 605
606# EAPI Eina_Stringshare *eolian_type_c_type_get(const Eolian_Type *tp, Eolian_C_Type_Type ctype); 606# EAPI Eina_Stringshare *eolian_type_c_type_get(const Eolian_Type *tp);
607lib.eolian_type_c_type_get.argtypes = (c_void_p, c_int) 607lib.eolian_type_c_type_get.argtypes = (c_void_p)
608lib.eolian_type_c_type_get.restype = c_void_p # Stringshare TO BE FREED 608lib.eolian_type_c_type_get.restype = c_void_p # Stringshare TO BE FREED
609 609
610### Eolian_Expression ####################################################### 610### Eolian_Expression #######################################################
diff --git a/src/scripts/pyolian/test_eolian.py b/src/scripts/pyolian/test_eolian.py
index 5313e4cbba..36c19ea1ae 100755
--- a/src/scripts/pyolian/test_eolian.py
+++ b/src/scripts/pyolian/test_eolian.py
@@ -582,10 +582,6 @@ class TestEolianType(unittest.TestCase):
582 self.assertIsNone(t.class_) 582 self.assertIsNone(t.class_)
583 self.assertEqual(t, t.aliased_base) # TODO find a better test 583 self.assertEqual(t, t.aliased_base) # TODO find a better test
584 584
585 self.assertEqual(t.c_type_default, 'double') # TODO find a better test
586 self.assertEqual(t.c_type_param, 'double')
587 self.assertEqual(t.c_type_return, 'double')
588
589 def test_type_regular(self): 585 def test_type_regular(self):
590 cls = eolian_db.class_by_name_get('Efl.Gfx.Entity') 586 cls = eolian_db.class_by_name_get('Efl.Gfx.Entity')
591 func = cls.function_by_name_get('geometry') 587 func = cls.function_by_name_get('geometry')
@@ -601,10 +597,6 @@ class TestEolianType(unittest.TestCase):
601 self.assertIsNone(t.class_) 597 self.assertIsNone(t.class_)
602 self.assertEqual(t, t.aliased_base) 598 self.assertEqual(t, t.aliased_base)
603 599
604 self.assertEqual(t.c_type_default, 'Eina_Rect') # TODO find a better test
605 self.assertEqual(t.c_type_param, 'Eina_Rect')
606 self.assertEqual(t.c_type_return, 'Eina_Rect')
607
608 td = t.typedecl 600 td = t.typedecl
609 self.assertIsInstance(td, eolian.Typedecl) 601 self.assertIsInstance(td, eolian.Typedecl)
610 self.assertEqual(td.name, 'Eina.Rect') 602 self.assertEqual(td.name, 'Eina.Rect')
@@ -623,10 +615,6 @@ class TestEolianType(unittest.TestCase):
623 self.assertEqual(list(t.namespaces), ['Efl', 'Gfx']) 615 self.assertEqual(list(t.namespaces), ['Efl', 'Gfx'])
624 self.assertEqual(t, t.aliased_base) 616 self.assertEqual(t, t.aliased_base)
625 617
626 self.assertEqual(t.c_type_default, 'Efl_Gfx_Entity *') # TODO find a better test
627 self.assertEqual(t.c_type_param, 'Efl_Gfx_Entity *')
628 self.assertEqual(t.c_type_return, 'Efl_Gfx_Entity *')
629
630 cls = t.class_ 618 cls = t.class_
631 self.assertIsInstance(cls, eolian.Class) 619 self.assertIsInstance(cls, eolian.Class)
632 self.assertEqual(cls.name, 'Efl.Gfx.Entity') 620 self.assertEqual(cls.name, 'Efl.Gfx.Entity')