davemds pushed a commit to branch master.

http://git.enlightenment.org/bindings/python/python-efl.git/commit/?id=97dadf30da441d91ba46389c9f8b711ad611aca6

commit 97dadf30da441d91ba46389c9f8b711ad611aca6
Author: Dave Andreoli <d...@gurumeditation.it>
Date:   Mon Aug 3 14:09:36 2015 +0200

    New 1.15 API: EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE, with test
    
    Also fixed EVAS_CALLBACK_AXIS_UPDATE that was half implemented
---
 efl/evas/efl.evas.pyx                                  |  4 ++++
 efl/evas/efl.evas_canvas_callbacks.pxi                 | 12 ++++++++++--
 efl/evas/efl.evas_object_callbacks.pxi                 | 15 +++++++++++++--
 examples/elementary/test_core_evas_canvas_callbacks.py |  5 +++++
 include/efl.evas.pxd                                   |  1 +
 5 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/efl/evas/efl.evas.pyx b/efl/evas/efl.evas.pyx
index df557a5..4f0673d 100644
--- a/efl/evas/efl.evas.pyx
+++ b/efl/evas/efl.evas.pyx
@@ -257,6 +257,10 @@ Evas_Callback_Type
 
     Input device changed value on some axis. (since 1.13)
 
+.. data:: EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE
+
+    Canvas viewport resized. (since 1.15)
+
 .. data:: EVAS_CALLBACK_LAST
 
     kept as last element/sentinel – not really an event.
diff --git a/efl/evas/efl.evas_canvas_callbacks.pxi 
b/efl/evas/efl.evas_canvas_callbacks.pxi
index 2901158..064c927 100644
--- a/efl/evas/efl.evas_canvas_callbacks.pxi
+++ b/efl/evas/efl.evas_canvas_callbacks.pxi
@@ -158,10 +158,16 @@ cdef void cb_canvas_render_post(void *data, Evas *e, void 
*e_inf) with gil:
     #cb_canvas_dispatcher(<Canvas>data, o, EVAS_CALLBACK_RENDER_POST)
     cb_canvas_dispatcher2(<Canvas>data, EVAS_CALLBACK_RENDER_POST)
 
+cdef void cb_canvas_axis_update(void *data, Evas *e, void *e_inf) with gil:
+    cb_canvas_dispatcher2(<Canvas>data, EVAS_CALLBACK_AXIS_UPDATE)
+
+cdef void cb_canvas_viewport_resize(void *data, Evas *e, void *e_inf) with gil:
+    cb_canvas_dispatcher2(<Canvas>data, EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE)
+
 
 cdef int evas_canvas_event_callbacks_len
-cdef Evas_Event_Cb evas_canvas_event_callbacks[34]
-evas_canvas_event_callbacks_len = 34
+cdef Evas_Event_Cb evas_canvas_event_callbacks[36]
+evas_canvas_event_callbacks_len = 36
 evas_canvas_event_callbacks[<int>EVAS_CALLBACK_MOUSE_IN] = cb_canvas_mouse_in
 evas_canvas_event_callbacks[<int>EVAS_CALLBACK_MOUSE_OUT] = cb_canvas_mouse_out
 evas_canvas_event_callbacks[<int>EVAS_CALLBACK_MOUSE_DOWN] = 
cb_canvas_mouse_down
@@ -196,3 +202,5 @@ evas_canvas_event_callbacks[<int>EVAS_CALLBACK_RENDER_PRE] 
= cb_canvas_render_pr
 evas_canvas_event_callbacks[<int>EVAS_CALLBACK_RENDER_POST] = 
cb_canvas_render_post
 evas_canvas_event_callbacks[<int>EVAS_CALLBACK_IMAGE_RESIZE] = 
cb_canvas_image_resize
 evas_canvas_event_callbacks[<int>EVAS_CALLBACK_DEVICE_CHANGED] = 
cb_canvas_device_changed
+evas_canvas_event_callbacks[<int>EVAS_CALLBACK_AXIS_UPDATE] = 
cb_canvas_axis_update
+evas_canvas_event_callbacks[<int>EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE] = 
cb_canvas_viewport_resize
diff --git a/efl/evas/efl.evas_object_callbacks.pxi 
b/efl/evas/efl.evas_object_callbacks.pxi
index 3dc7e7b..947f8b0 100644
--- a/efl/evas/efl.evas_object_callbacks.pxi
+++ b/efl/evas/efl.evas_object_callbacks.pxi
@@ -246,9 +246,18 @@ cdef void cb_object_canvas_render_post(void *data, Evas *e,
                                        Evas_Object *obj, void *e_inf) with gil:
     print("EVAS_CALLBACK_RENDER_POST is not supported by object.")
 
+cdef void cb_object_axis_update(void *data, Evas *e,
+                                       Evas_Object *obj, void *e_inf) with gil:
+    print("EVAS_CALLBACK_AXIS_UPDATE is not supported by object.")
+
+cdef void cb_object_viewport_resize(void *data, Evas *e,
+                                       Evas_Object *obj, void *e_inf) with gil:
+    print("EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE is not supported by object.")
+
+
 cdef int evas_object_event_callbacks_len
-cdef Evas_Object_Event_Cb evas_object_event_callbacks[34]
-evas_object_event_callbacks_len = 34
+cdef Evas_Object_Event_Cb evas_object_event_callbacks[36]
+evas_object_event_callbacks_len = 36
 evas_object_event_callbacks[<int>EVAS_CALLBACK_MOUSE_IN] = cb_object_mouse_in
 evas_object_event_callbacks[<int>EVAS_CALLBACK_MOUSE_OUT] = cb_object_mouse_out
 evas_object_event_callbacks[<int>EVAS_CALLBACK_MOUSE_DOWN] = 
cb_object_mouse_down
@@ -283,3 +292,5 @@ evas_object_event_callbacks[<int>EVAS_CALLBACK_RENDER_PRE] 
= cb_object_canvas_re
 evas_object_event_callbacks[<int>EVAS_CALLBACK_RENDER_POST] = 
cb_object_canvas_render_post
 evas_object_event_callbacks[<int>EVAS_CALLBACK_IMAGE_RESIZE] = 
cb_object_image_resize
 evas_object_event_callbacks[<int>EVAS_CALLBACK_DEVICE_CHANGED] = 
cb_object_device_changed
+evas_object_event_callbacks[<int>EVAS_CALLBACK_AXIS_UPDATE] = 
cb_object_axis_update
+evas_object_event_callbacks[<int>EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE] = 
cb_object_viewport_resize
diff --git a/examples/elementary/test_core_evas_canvas_callbacks.py 
b/examples/elementary/test_core_evas_canvas_callbacks.py
index add53ae..e2f418c 100644
--- a/examples/elementary/test_core_evas_canvas_callbacks.py
+++ b/examples/elementary/test_core_evas_canvas_callbacks.py
@@ -7,6 +7,7 @@ from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL, 
EXPAND_BOTH, FILL_BOTH, \
     EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, \
     EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, \
     EVAS_CALLBACK_RENDER_FLUSH_PRE, EVAS_CALLBACK_RENDER_FLUSH_POST, \
+    EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE, \
     Text, Rectangle
 
 # edje is imported because the canvas callbacks point to an edje obj,
@@ -30,6 +31,7 @@ def btn_del_cbs_cb(button):
     canvas.event_callback_del(EVAS_CALLBACK_RENDER_FLUSH_POST, events_cb1)
     canvas.event_callback_del(EVAS_CALLBACK_RENDER_PRE, events_cb1)
     canvas.event_callback_del(EVAS_CALLBACK_RENDER_POST, events_cb1)
+    canvas.event_callback_del(EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE, events_cb1)
 
 
 def events_cb1(rect, event_name):
@@ -70,6 +72,9 @@ def core_evas_canvas_callbacks_clicked(obj, item=None):
     canvas.event_callback_add(EVAS_CALLBACK_RENDER_POST,
         events_cb1, "EVAS_CALLBACK_RENDER_POST")
 
+    canvas.event_callback_add(EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE,
+        events_cb1, "EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE")
+
     r2 = Rectangle(win.evas, size=(120,70), color=(0,100,0,100), pos=(70,70))
     r2.show()
 
diff --git a/include/efl.evas.pxd b/include/efl.evas.pxd
index 224f53a..98d13bd 100644
--- a/include/efl.evas.pxd
+++ b/include/efl.evas.pxd
@@ -100,6 +100,7 @@ cdef extern from "Evas.h":
         EVAS_CALLBACK_IMAGE_RESIZE
         EVAS_CALLBACK_DEVICE_CHANGED
         EVAS_CALLBACK_AXIS_UPDATE
+        EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE
         EVAS_CALLBACK_LAST
     ctypedef enum Evas_Callback_Type:
         pass

-- 


Reply via email to