diff options
author | Daniel Kolesa <d.kolesa@samsung.com> | 2018-11-22 16:21:52 +0100 |
---|---|---|
committer | Daniel Kolesa <d.kolesa@samsung.com> | 2018-11-23 13:57:07 +0100 |
commit | 14ce54c30321e3b78b979872427b07d9420d5c66 (patch) | |
tree | f5947b26e04a7a162434d9ca250b0cb145bfab03 /src/scripts | |
parent | f3eb8d6441af396e61842cb83b9ac7b3af34f527 (diff) |
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')
-rw-r--r-- | src/scripts/pyolian/eolian.py | 9 | ||||
-rw-r--r-- | src/scripts/pyolian/eolian_lib.py | 10 |
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): | |||
686 | _str_to_bytes(event_name)) | 686 | _str_to_bytes(event_name)) |
687 | return Event(c_event) if c_event else None | 687 | return Event(c_event) if c_event else None |
688 | 688 | ||
689 | @cached_property | ||
690 | def parent(self): | ||
691 | c_class = lib.eolian_class_parent_get(self) | ||
692 | return Class(c_class) if c_class else None | ||
693 | |||
689 | @property | 694 | @property |
690 | def inherits(self): | 695 | def extensions(self): |
691 | return Iterator(Class, lib.eolian_class_inherits_get(self)) | 696 | return Iterator(Class, lib.eolian_class_extensions_get(self)) |
692 | 697 | ||
693 | @cached_property | 698 | @cached_property |
694 | def inherits_full(self): | 699 | 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 | |||
254 | lib.eolian_class_data_type_get.argtypes = (c_void_p,) | 254 | lib.eolian_class_data_type_get.argtypes = (c_void_p,) |
255 | lib.eolian_class_data_type_get.restype = c_char_p | 255 | lib.eolian_class_data_type_get.restype = c_char_p |
256 | 256 | ||
257 | # EAPI Eina_Iterator *eolian_class_inherits_get(const Eolian_Class *klass); | 257 | # EAPI const Eolian_Class *eolian_class_parent_get(const Eolian_Class *klass); |
258 | lib.eolian_class_inherits_get.argtypes = (c_void_p,) | 258 | lib.eolian_class_parent_get.argtypes = (c_void_p,) |
259 | lib.eolian_class_inherits_get.restype = c_void_p | 259 | lib.eolian_class_parent_get.restype = c_void_p |
260 | |||
261 | # EAPI Eina_Iterator *eolian_class_extensions_get(const Eolian_Class *klass); | ||
262 | lib.eolian_class_extensions_get.argtypes = (c_void_p,) | ||
263 | lib.eolian_class_extensions_get.restype = c_void_p | ||
260 | 264 | ||
261 | # EAPI Eina_Iterator *eolian_class_functions_get(const Eolian_Class *klass, Eolian_Function_Type func_type); | 265 | # EAPI Eina_Iterator *eolian_class_functions_get(const Eolian_Class *klass, Eolian_Function_Type func_type); |
262 | lib.eolian_class_functions_get.argtypes = (c_void_p, c_int) | 266 | lib.eolian_class_functions_get.argtypes = (c_void_p, c_int) |