summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Andreoli <dave@gurumeditation.it>2015-08-03 14:09:36 +0200
committerDave Andreoli <dave@gurumeditation.it>2015-08-03 14:09:36 +0200
commit97dadf30da441d91ba46389c9f8b711ad611aca6 (patch)
treef8c40b5efc60f107499235e932cdb905e578a251
parent5e138dcdf23b5a56a57f7413031f94e6649abb84 (diff)
New 1.15 API: EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE, with test
Also fixed EVAS_CALLBACK_AXIS_UPDATE that was half implemented
-rw-r--r--efl/evas/efl.evas.pyx4
-rw-r--r--efl/evas/efl.evas_canvas_callbacks.pxi12
-rw-r--r--efl/evas/efl.evas_object_callbacks.pxi15
-rw-r--r--examples/elementary/test_core_evas_canvas_callbacks.py5
-rw-r--r--include/efl.evas.pxd1
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
257 257
258 Input device changed value on some axis. (since 1.13) 258 Input device changed value on some axis. (since 1.13)
259 259
260.. data:: EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE
261
262 Canvas viewport resized. (since 1.15)
263
260.. data:: EVAS_CALLBACK_LAST 264.. data:: EVAS_CALLBACK_LAST
261 265
262 kept as last element/sentinel – not really an event. 266 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:
158 #cb_canvas_dispatcher(<Canvas>data, o, EVAS_CALLBACK_RENDER_POST) 158 #cb_canvas_dispatcher(<Canvas>data, o, EVAS_CALLBACK_RENDER_POST)
159 cb_canvas_dispatcher2(<Canvas>data, EVAS_CALLBACK_RENDER_POST) 159 cb_canvas_dispatcher2(<Canvas>data, EVAS_CALLBACK_RENDER_POST)
160 160
161cdef void cb_canvas_axis_update(void *data, Evas *e, void *e_inf) with gil:
162 cb_canvas_dispatcher2(<Canvas>data, EVAS_CALLBACK_AXIS_UPDATE)
163
164cdef void cb_canvas_viewport_resize(void *data, Evas *e, void *e_inf) with gil:
165 cb_canvas_dispatcher2(<Canvas>data, EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE)
166
161 167
162cdef int evas_canvas_event_callbacks_len 168cdef int evas_canvas_event_callbacks_len
163cdef Evas_Event_Cb evas_canvas_event_callbacks[34] 169cdef Evas_Event_Cb evas_canvas_event_callbacks[36]
164evas_canvas_event_callbacks_len = 34 170evas_canvas_event_callbacks_len = 36
165evas_canvas_event_callbacks[<int>EVAS_CALLBACK_MOUSE_IN] = cb_canvas_mouse_in 171evas_canvas_event_callbacks[<int>EVAS_CALLBACK_MOUSE_IN] = cb_canvas_mouse_in
166evas_canvas_event_callbacks[<int>EVAS_CALLBACK_MOUSE_OUT] = cb_canvas_mouse_out 172evas_canvas_event_callbacks[<int>EVAS_CALLBACK_MOUSE_OUT] = cb_canvas_mouse_out
167evas_canvas_event_callbacks[<int>EVAS_CALLBACK_MOUSE_DOWN] = cb_canvas_mouse_down 173evas_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
196evas_canvas_event_callbacks[<int>EVAS_CALLBACK_RENDER_POST] = cb_canvas_render_post 202evas_canvas_event_callbacks[<int>EVAS_CALLBACK_RENDER_POST] = cb_canvas_render_post
197evas_canvas_event_callbacks[<int>EVAS_CALLBACK_IMAGE_RESIZE] = cb_canvas_image_resize 203evas_canvas_event_callbacks[<int>EVAS_CALLBACK_IMAGE_RESIZE] = cb_canvas_image_resize
198evas_canvas_event_callbacks[<int>EVAS_CALLBACK_DEVICE_CHANGED] = cb_canvas_device_changed 204evas_canvas_event_callbacks[<int>EVAS_CALLBACK_DEVICE_CHANGED] = cb_canvas_device_changed
205evas_canvas_event_callbacks[<int>EVAS_CALLBACK_AXIS_UPDATE] = cb_canvas_axis_update
206evas_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,
246 Evas_Object *obj, void *e_inf) with gil: 246 Evas_Object *obj, void *e_inf) with gil:
247 print("EVAS_CALLBACK_RENDER_POST is not supported by object.") 247 print("EVAS_CALLBACK_RENDER_POST is not supported by object.")
248 248
249cdef void cb_object_axis_update(void *data, Evas *e,
250 Evas_Object *obj, void *e_inf) with gil:
251 print("EVAS_CALLBACK_AXIS_UPDATE is not supported by object.")
252
253cdef void cb_object_viewport_resize(void *data, Evas *e,
254 Evas_Object *obj, void *e_inf) with gil:
255 print("EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE is not supported by object.")
256
257
249cdef int evas_object_event_callbacks_len 258cdef int evas_object_event_callbacks_len
250cdef Evas_Object_Event_Cb evas_object_event_callbacks[34] 259cdef Evas_Object_Event_Cb evas_object_event_callbacks[36]
251evas_object_event_callbacks_len = 34 260evas_object_event_callbacks_len = 36
252evas_object_event_callbacks[<int>EVAS_CALLBACK_MOUSE_IN] = cb_object_mouse_in 261evas_object_event_callbacks[<int>EVAS_CALLBACK_MOUSE_IN] = cb_object_mouse_in
253evas_object_event_callbacks[<int>EVAS_CALLBACK_MOUSE_OUT] = cb_object_mouse_out 262evas_object_event_callbacks[<int>EVAS_CALLBACK_MOUSE_OUT] = cb_object_mouse_out
254evas_object_event_callbacks[<int>EVAS_CALLBACK_MOUSE_DOWN] = cb_object_mouse_down 263evas_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
283evas_object_event_callbacks[<int>EVAS_CALLBACK_RENDER_POST] = cb_object_canvas_render_post 292evas_object_event_callbacks[<int>EVAS_CALLBACK_RENDER_POST] = cb_object_canvas_render_post
284evas_object_event_callbacks[<int>EVAS_CALLBACK_IMAGE_RESIZE] = cb_object_image_resize 293evas_object_event_callbacks[<int>EVAS_CALLBACK_IMAGE_RESIZE] = cb_object_image_resize
285evas_object_event_callbacks[<int>EVAS_CALLBACK_DEVICE_CHANGED] = cb_object_device_changed 294evas_object_event_callbacks[<int>EVAS_CALLBACK_DEVICE_CHANGED] = cb_object_device_changed
295evas_object_event_callbacks[<int>EVAS_CALLBACK_AXIS_UPDATE] = cb_object_axis_update
296evas_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, \
7 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, \ 7 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, \
8 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, \ 8 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, \
9 EVAS_CALLBACK_RENDER_FLUSH_PRE, EVAS_CALLBACK_RENDER_FLUSH_POST, \ 9 EVAS_CALLBACK_RENDER_FLUSH_PRE, EVAS_CALLBACK_RENDER_FLUSH_POST, \
10 EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE, \
10 Text, Rectangle 11 Text, Rectangle
11 12
12# edje is imported because the canvas callbacks point to an edje obj, 13# edje is imported because the canvas callbacks point to an edje obj,
@@ -30,6 +31,7 @@ def btn_del_cbs_cb(button):
30 canvas.event_callback_del(EVAS_CALLBACK_RENDER_FLUSH_POST, events_cb1) 31 canvas.event_callback_del(EVAS_CALLBACK_RENDER_FLUSH_POST, events_cb1)
31 canvas.event_callback_del(EVAS_CALLBACK_RENDER_PRE, events_cb1) 32 canvas.event_callback_del(EVAS_CALLBACK_RENDER_PRE, events_cb1)
32 canvas.event_callback_del(EVAS_CALLBACK_RENDER_POST, events_cb1) 33 canvas.event_callback_del(EVAS_CALLBACK_RENDER_POST, events_cb1)
34 canvas.event_callback_del(EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE, events_cb1)
33 35
34 36
35def events_cb1(rect, event_name): 37def events_cb1(rect, event_name):
@@ -70,6 +72,9 @@ def core_evas_canvas_callbacks_clicked(obj, item=None):
70 canvas.event_callback_add(EVAS_CALLBACK_RENDER_POST, 72 canvas.event_callback_add(EVAS_CALLBACK_RENDER_POST,
71 events_cb1, "EVAS_CALLBACK_RENDER_POST") 73 events_cb1, "EVAS_CALLBACK_RENDER_POST")
72 74
75 canvas.event_callback_add(EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE,
76 events_cb1, "EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE")
77
73 r2 = Rectangle(win.evas, size=(120,70), color=(0,100,0,100), pos=(70,70)) 78 r2 = Rectangle(win.evas, size=(120,70), color=(0,100,0,100), pos=(70,70))
74 r2.show() 79 r2.show()
75 80
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":
100 EVAS_CALLBACK_IMAGE_RESIZE 100 EVAS_CALLBACK_IMAGE_RESIZE
101 EVAS_CALLBACK_DEVICE_CHANGED 101 EVAS_CALLBACK_DEVICE_CHANGED
102 EVAS_CALLBACK_AXIS_UPDATE 102 EVAS_CALLBACK_AXIS_UPDATE
103 EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE
103 EVAS_CALLBACK_LAST 104 EVAS_CALLBACK_LAST
104 ctypedef enum Evas_Callback_Type: 105 ctypedef enum Evas_Callback_Type:
105 pass 106 pass