summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2015-04-12 12:35:57 +0200
committerDave Andreoli <dave@gurumeditation.it>2015-04-12 12:35:57 +0200
commit0190d16c05df5ef48351fadf9a294601aa082bf6 (patch)
tree560f1b796832df4ea630da49dda556fea929c37e
parentf20c56fe1524503a67cc161cd1cbeebfa68e55ed (diff)
New 1.14 property: Evas.Image.orient
with a simple test
-rw-r--r--efl/evas/efl.evas.pyx42
-rw-r--r--efl/evas/efl.evas_object_image.pxi21
-rw-r--r--examples/elementary/test_core_evas_objects.py11
-rw-r--r--include/efl.evas.pxd16
4 files changed, 88 insertions, 2 deletions
diff --git a/efl/evas/efl.evas.pyx b/efl/evas/efl.evas.pyx
index 69c1ca9..d026bc0 100644
--- a/efl/evas/efl.evas.pyx
+++ b/efl/evas/efl.evas.pyx
@@ -668,6 +668,48 @@ Evas_Image_Animated_Loop_Hint
668 Pingpong 668 Pingpong
669 669
670 670
671.. _Evas_Image_Orient:
672
673Evas_Image_Orient
674-------------------------------------
675
676.. data:: EVAS_IMAGE_ORIENT_NONE
677
678 No orientation change
679
680.. data:: EVAS_IMAGE_ORIENT_0
681
682 No orientation change
683
684.. data:: EVAS_IMAGE_ORIENT_90
685
686 Orient 90 degrees clockwise
687
688.. data:: EVAS_IMAGE_ORIENT_180
689
690 Orient 180 degrees clockwise
691
692.. data:: EVAS_IMAGE_ORIENT_270
693
694 Rotate 90 degrees counter-clockwise (i.e. 270 degrees clockwise)
695
696.. data:: EVAS_IMAGE_FLIP_HORIZONTAL
697
698 Flip image horizontally
699
700.. data:: EVAS_IMAGE_FLIP_VERTICAL
701
702 Flip image vertically
703
704.. data:: EVAS_IMAGE_FLIP_TRANSVERSE
705
706 Flip image along the y = (width - x) line (bottom-left to top-right)
707
708.. data:: EVAS_IMAGE_ORIENT
709
710 Flip image along the y = x line (top-left to bottom-right)
711
712
671.. _Evas_Engine_Render_Mode: 713.. _Evas_Engine_Render_Mode:
672 714
673Evas_Engine_Render_Mode 715Evas_Engine_Render_Mode
diff --git a/efl/evas/efl.evas_object_image.pxi b/efl/evas/efl.evas_object_image.pxi
index da9cdb1..928603b 100644
--- a/efl/evas/efl.evas_object_image.pxi
+++ b/efl/evas/efl.evas_object_image.pxi
@@ -903,6 +903,27 @@ cdef class Image(Object):
903 def load_orientation_get(self): 903 def load_orientation_get(self):
904 return bool(evas_object_image_load_orientation_get(self.obj)) 904 return bool(evas_object_image_load_orientation_get(self.obj))
905 905
906 property orient:
907 """The image orientation.
908
909 This allows to rotate or flip the image.
910
911 :type: Evas_Image_Orient
912
913 .. versionadded:: 1.14
914
915 """
916 def __set__(self, value):
917 evas_object_image_orient_set(self.obj, <Evas_Image_Orient>value)
918 def __get__(self):
919 return evas_object_image_orient_get(self.obj)
920
921 def orient_set(self, orient):
922 evas_object_image_orient_set(self.obj, <Evas_Image_Orient>orient)
923
924 def orient_get(self):
925 return evas_object_image_orient_get(self.obj)
926
906 property colorspace: 927 property colorspace:
907 """The colorspace of image data (pixels). 928 """The colorspace of image data (pixels).
908 929
diff --git a/examples/elementary/test_core_evas_objects.py b/examples/elementary/test_core_evas_objects.py
index b51431f..5172170 100644
--- a/examples/elementary/test_core_evas_objects.py
+++ b/examples/elementary/test_core_evas_objects.py
@@ -1,10 +1,15 @@
1#!/usr/bin/env python 1#!/usr/bin/env python
2# encoding: utf-8 2# encoding: utf-8
3 3
4from efl.evas import Rectangle, Line, Text, Polygon 4import os
5from efl.evas import Rectangle, Line, Text, Polygon, FilledImage, \
6 EVAS_IMAGE_ORIENT_180
5from efl import elementary 7from efl import elementary
6from efl.elementary.window import StandardWindow 8from efl.elementary.window import StandardWindow
7 9
10img_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "images")
11ic_file = os.path.join(img_path, "logo.png")
12
8def events_cb1(rect, event_name): 13def events_cb1(rect, event_name):
9 print(event_name + " No data for event") 14 print(event_name + " No data for event")
10 15
@@ -33,6 +38,10 @@ def core_evas_objects_clicked(obj, item=None):
33 poly.point_add(20,30) 38 poly.point_add(20,30)
34 poly.show() 39 poly.show()
35 40
41 image = FilledImage(win.evas, file=ic_file, size=(50,70), pos=(120,70))
42 image.orient = EVAS_IMAGE_ORIENT_180
43 image.show()
44
36 win.resize(320, 320) 45 win.resize(320, 320)
37 win.show() 46 win.show()
38 47
diff --git a/include/efl.evas.pxd b/include/efl.evas.pxd
index 15ccc57..224f53a 100644
--- a/include/efl.evas.pxd
+++ b/include/efl.evas.pxd
@@ -243,6 +243,19 @@ cdef extern from "Evas.h":
243 ctypedef enum Evas_Image_Animated_Loop_Hint: 243 ctypedef enum Evas_Image_Animated_Loop_Hint:
244 pass 244 pass
245 245
246 cpdef enum Evas_Image_Orient:
247 EVAS_IMAGE_ORIENT_NONE
248 EVAS_IMAGE_ORIENT_0
249 EVAS_IMAGE_ORIENT_90
250 EVAS_IMAGE_ORIENT_180
251 EVAS_IMAGE_ORIENT_270
252 EVAS_IMAGE_FLIP_HORIZONTAL
253 EVAS_IMAGE_FLIP_VERTICAL
254 EVAS_IMAGE_FLIP_TRANSPOSE
255 EVAS_IMAGE_FLIP_TRANSVERSE
256 ctypedef enum Evas_Image_Orient:
257 pass
258
246 cpdef enum Evas_Engine_Render_Mode: 259 cpdef enum Evas_Engine_Render_Mode:
247 EVAS_RENDER_MODE_BLOCKING 260 EVAS_RENDER_MODE_BLOCKING
248 EVAS_RENDER_MODE_NONBLOCKING 261 EVAS_RENDER_MODE_NONBLOCKING
@@ -910,7 +923,8 @@ cdef extern from "Evas.h":
910 int evas_object_image_animated_loop_count_get(const Evas_Object *obj) 923 int evas_object_image_animated_loop_count_get(const Evas_Object *obj)
911 double evas_object_image_animated_frame_duration_get(const Evas_Object *obj, int start_frame, int fram_num) 924 double evas_object_image_animated_frame_duration_get(const Evas_Object *obj, int start_frame, int fram_num)
912 void evas_object_image_animated_frame_set(Evas_Object *obj, int frame_num) 925 void evas_object_image_animated_frame_set(Evas_Object *obj, int frame_num)
913 926 Evas_Image_Orient evas_object_image_orient_get(Evas_Object *obj)
927 void evas_object_image_orient_set(Evas_Object *obj, Evas_Image_Orient orient)
914 928
915 #################################################################### 929 ####################################################################
916 # Polygon Object 930 # Polygon Object