aboutsummaryrefslogtreecommitdiffstats
path: root/src/scripts/pyolian
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2018-11-22 16:21:52 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2018-11-23 13:57:07 +0100
commit14ce54c30321e3b78b979872427b07d9420d5c66 (patch)
treef5947b26e04a7a162434d9ca250b0cb145bfab03 /src/scripts/pyolian
parentefl_interpolator: rename subclasses of Efl.Interpolator (diff)
downloadefl-14ce54c30321e3b78b979872427b07d9420d5c66.tar.gz
eolian: implement new inherit behavior
Eolian now separates 'parent' and 'extensions'. For regular classes, parent is the first item in the inherits list and extesions is the rest. For interfaces and mixins, parent is NULL and extends is the inherits list. The reason for this is the separation of them in syntax in near future. It also slightly changes the behavior; since for interfaces and mixins, parent is always NULL now, you can freely inherit from all types of classes without needing to manually put an interface type as the first item of the inherits list.
Diffstat (limited to 'src/scripts/pyolian')
-rw-r--r--src/scripts/pyolian/eolian.py9
-rw-r--r--src/scripts/pyolian/eolian_lib.py10
2 files changed, 14 insertions, 5 deletions
diff --git a/src/scripts/pyolian/eolian.py b/src/scripts/pyolian/eolian.py
index 556f47720d..b87e4fd630 100644
--- a/src/scripts/pyolian/eolian.py
+++ b/src/scripts/pyolian/eolian.py
@@ -686,9 +686,14 @@ class Class(Object):
_str_to_bytes(event_name))
return Event(c_event) if c_event else None
+ @cached_property
+ def parent(self):
+ c_class = lib.eolian_class_parent_get(self)
+ return Class(c_class) if c_class else None
+
@property
- def inherits(self):
- return Iterator(Class, lib.eolian_class_inherits_get(self))
+ def extensions(self):
+ return Iterator(Class, lib.eolian_class_extensions_get(self))
@cached_property
def inherits_full(self):
diff --git a/src/scripts/pyolian/eolian_lib.py b/src/scripts/pyolian/eolian_lib.py
index 3cd7bad285..1f6a2f3d71 100644
--- a/src/scripts/pyolian/eolian_lib.py
+++ b/src/scripts/pyolian/eolian_lib.py
@@ -254,9 +254,13 @@ lib.eolian_class_event_prefix_get.restype = c_char_p
lib.eolian_class_data_type_get.argtypes = (c_void_p,)
lib.eolian_class_data_type_get.restype = c_char_p
-# EAPI Eina_Iterator *eolian_class_inherits_get(const Eolian_Class *klass);
-lib.eolian_class_inherits_get.argtypes = (c_void_p,)
-lib.eolian_class_inherits_get.restype = c_void_p
+# EAPI const Eolian_Class *eolian_class_parent_get(const Eolian_Class *klass);
+lib.eolian_class_parent_get.argtypes = (c_void_p,)
+lib.eolian_class_parent_get.restype = c_void_p
+
+# EAPI Eina_Iterator *eolian_class_extensions_get(const Eolian_Class *klass);
+lib.eolian_class_extensions_get.argtypes = (c_void_p,)
+lib.eolian_class_extensions_get.restype = c_void_p
# EAPI Eina_Iterator *eolian_class_functions_get(const Eolian_Class *klass, Eolian_Function_Type func_type);
lib.eolian_class_functions_get.argtypes = (c_void_p, c_int)