davemds pushed a commit to branch master. http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=78d90dd467ddc472e10b72f8ffe9af9dbbc9778b
commit 78d90dd467ddc472e10b72f8ffe9af9dbbc9778b Author: Dave Andreoli <[email protected]> Date: Fri Aug 12 10:00:14 2016 +0200 New 1.18 API: 3 new getters for elm.Photo NOTE: the test for the editable property is failing...need to recheck this! --- efl/elementary/photo.pxi | 41 +++++++++++++++++++++++++++++---------- efl/elementary/photo_cdef.pxi | 3 +++ examples/elementary/test_photo.py | 5 +++++ 3 files changed, 39 insertions(+), 10 deletions(-) diff --git a/efl/elementary/photo.pxi b/efl/elementary/photo.pxi index 9b80d05..3b8b463 100644 --- a/efl/elementary/photo.pxi +++ b/efl/elementary/photo.pxi @@ -84,31 +84,45 @@ cdef class Photo(Object): <const char *>group if group is not None else NULL) property size: - """Set the size that will be used on the photo. + """The size that will be used on the photo. :type: int + .. versionchanged:: 1.18 + This property is now also readable + """ - def __set__(self, size): + def __set__(self, int size): elm_photo_size_set(self.obj, size) + def __get__(self): + return elm_photo_size_get(self.obj) def size_set(self, size): elm_photo_size_set(self.obj, size) + def size_get(self): + return elm_photo_size_get(self.obj) property fill_inside: - """Set if the photo should be completely visible or not. + """If the photo should be completely visible or not. :type: bool + .. versionchanged:: 1.18 + This property is now also readable + """ - def __set__(self, fill): + def __set__(self, bint fill): elm_photo_fill_inside_set(self.obj, fill) + def __get__(self): + return bool(elm_photo_fill_inside_get(self.obj)) - def fill_inside_set(self, fill): + def fill_inside_set(self, bint fill): elm_photo_fill_inside_set(self.obj, fill) + def fill_inside_set(self): + return bool(elm_photo_fill_inside_get(self.obj)) property editable: - """Set editability of the photo. + """Editability of the photo. An editable photo can be dragged to or from, and can be cut or pasted too. Note that pasting an image or dropping an item on the @@ -116,12 +130,19 @@ cdef class Photo(Object): :type: bool + .. versionchanged:: 1.18 + This property is now also readable + """ - def __set__(self, fill): - elm_photo_editable_set(self.obj, fill) + def __set__(self, bint editable): + elm_photo_editable_set(self.obj, editable) + def __get__(self): + return bool(elm_photo_editable_get(self.obj)) - def editable_set(self, fill): - elm_photo_editable_set(self.obj, fill) + def editable_set(self, bint editable): + elm_photo_editable_set(self.obj, editable) + def editable_get(self): + return bool(elm_photo_editable_get(self.obj)) property aspect_fixed: """Whether the original aspect ratio of the photo should be kept on diff --git a/efl/elementary/photo_cdef.pxi b/efl/elementary/photo_cdef.pxi index 86c07ec..5343b0e 100644 --- a/efl/elementary/photo_cdef.pxi +++ b/efl/elementary/photo_cdef.pxi @@ -2,8 +2,11 @@ cdef extern from "Elementary.h": Evas_Object *elm_photo_add(Evas_Object *parent) Eina_Bool elm_photo_file_set(Evas_Object *obj, const char *file) void elm_photo_thumb_set(Evas_Object *obj, const char *file, const char *group) + int elm_photo_size_get(const Evas_Object *obj) void elm_photo_size_set(Evas_Object *obj, int size) + Eina_Bool elm_photo_fill_inside_get(const Evas_Object *obj) void elm_photo_fill_inside_set(Evas_Object *obj, Eina_Bool fill) + Eina_Bool elm_photo_editable_get(const Evas_Object *obj) void elm_photo_editable_set(Evas_Object *obj, Eina_Bool editable) void elm_photo_aspect_fixed_set(Evas_Object *obj, Eina_Bool fixed) Eina_Bool elm_photo_aspect_fixed_get(const Evas_Object *obj) diff --git a/examples/elementary/test_photo.py b/examples/elementary/test_photo.py index 553b23a..dbf9fbb 100644 --- a/examples/elementary/test_photo.py +++ b/examples/elementary/test_photo.py @@ -55,6 +55,11 @@ def photo_clicked(obj): ph.fill_inside = True ph.style = "shadow" + if j == i == 0: + print("Size:", ph.size) + print("Fill Inside:", ph.fill_inside) + print("Editable:", ph.editable) # THIS ONE IS FAILING !! + tb.pack(ph, i, j, 1, 1) ph.show() --
