pyolian: add support for object retrieval
authorDaniel Kolesa <d.kolesa@osg.samsung.com>
Thu, 8 Mar 2018 22:07:01 +0000 (23:07 +0100)
committerWonki Kim <wonki_.kim@samsung.com>
Tue, 10 Apr 2018 11:10:51 +0000 (20:10 +0900)
src/scripts/pyolian/eolian.py
src/scripts/pyolian/eolian_lib.py

index db4b35f..e3ce9d6 100644 (file)
@@ -351,6 +351,14 @@ class Eolian_Unit(EolianBaseObject):
         return _str_to_py(lib.eolian_unit_file_get(self._obj))
 
     @property
+    def objects(self):
+        return Iterator(Object, lib.eolian_unit_objects_get(self._obj))
+
+    def object_by_name_get(self, name):
+        c_obj = lib.eolian_unit_object_by_name_get(self._obj, _str_to_bytes(name))
+        return Object(c_obj) if c_obj else None
+
+    @property
     def classes(self):
         return Iterator(Class, lib.eolian_unit_classes_get(self._obj))
 
@@ -465,6 +473,18 @@ class Eolian_State(Eolian_Unit):
         return Iterator(Eolian_Unit, lib.eolian_state_units_get(self._obj))
 
     @property
+    def objects(self):
+        return Iterator(Object, lib.eolian_state_objects_get(self._obj))
+
+    def object_by_name_get(self, name):
+        c_obj = lib.eolian_state_object_by_name_get(self._obj, _str_to_bytes(name))
+        return Object(c_obj) if c_obj else None
+
+    def objects_by_file_get(self, file_name):
+        return Iterator(Object,
+            lib.eolian_state_objects_by_file_get(self._obj, _str_to_bytes(file_name)))
+
+    @property
     def classes(self):
         return Iterator(Class, lib.eolian_state_classes_get(self._obj))
 
index 26d6312..e226bc1 100644 (file)
@@ -93,6 +93,18 @@ lib.eolian_state_unit_by_file_get.restype = c_void_p
 lib.eolian_state_units_get.argtypes = [c_void_p,]
 lib.eolian_state_units_get.restype = c_void_p
 
+# EAPI const Eolian_Object *eolian_state_object_by_name_get(const Eolian_State *state, const char *name);
+lib.eolian_state_object_by_name_get.argtypes = [c_void_p, c_char_p]
+lib.eolian_state_object_by_name_get.restype = c_void_p
+
+# EAPI Eina_Iterator *eolian_state_objects_by_file_get(const Eolian_State *state, const char *file_name);
+lib.eolian_state_object_by_file_get.argtypes = [c_void_p, c_char_p]
+lib.eolian_state_object_by_file_get.restype = c_void_p
+
+# EAPI Eina_Iterator *eolian_state_objects_get(const Eolian_State *state);
+lib.eolian_state_objects_get.argtypes = [c_void_p]
+lib.eolian_state_objects_get.restype = c_void_p
+
 # EAPI const Eolian_Class *eolian_state_class_by_name_get(const Eolian_State *state, const char *class_name);
 lib.eolian_state_class_by_name_get.argtypes = [c_void_p, c_char_p]
 lib.eolian_state_class_by_name_get.restype = c_void_p
@@ -175,6 +187,14 @@ lib.eolian_unit_children_get.restype = c_void_p
 lib.eolian_unit_file_get.argtypes = [c_void_p,]
 lib.eolian_unit_file_get.restype = c_char_p
 
+# EAPI const Eolian_Object *eolian_unit_object_by_name_get(const Eolian_Unit *unit, const char *name);
+lib.eolian_unit_object_by_name_get.argtypes = [c_void_p, c_char_p]
+lib.eolian_unit_object_by_name_get.restype = c_void_p
+
+# EAPI Eina_Iterator *eolian_unit_objects_get(const Eolian_Unit *unit);
+lib.eolian_unit_objects_get.argtypes = [c_void_p]
+lib.eolian_unit_objects_get.restype = c_void_p
+
 # EAPI const Eolian_Class *eolian_unit_class_by_name_get(const Eolian_Unit *unit, const char *class_name);
 lib.eolian_unit_class_by_name_get.argtypes = [c_void_p, c_char_p]
 lib.eolian_unit_class_by_name_get.restype = c_void_p