EWAPI const Efl_Event_Description _EVAS_CANVAS_EVENT_VIEWPORT_RESIZE =
EFL_EVENT_DESCRIPTION("viewport,resize");
+#define CHECK_ADD(var, ev, member) \
+ if ((var) == (ev)) \
+ { \
+ e->member = EINA_TRUE; \
+ }
+
+
+EOLIAN static Eina_Bool
+_evas_canvas_efl_object_event_callback_priority_add(Eo *obj, Evas_Public_Data *e, const Efl_Event_Description *desc, Efl_Callback_Priority priority, Efl_Event_Cb func, const void *user_data)
+{
+ CHECK_ADD(desc, EVAS_CANVAS_EVENT_RENDER_FLUSH_PRE, cb_render_flush_pre)
+ else CHECK_ADD(desc, EVAS_CANVAS_EVENT_RENDER_FLUSH_POST, cb_render_flush_post)
+ else CHECK_ADD(desc, EFL_CANVAS_SCENE_EVENT_RENDER_PRE, cb_render_pre)
+ else CHECK_ADD(desc, EFL_CANVAS_SCENE_EVENT_RENDER_POST, cb_render_post)
+
+ return efl_event_callback_priority_add(efl_super(obj, MY_CLASS), desc, priority, func, user_data);
+}
+
+EOLIAN static Eina_Bool
+_evas_canvas_efl_object_event_callback_array_priority_add(Eo *obj, Evas_Public_Data *e, const Efl_Callback_Array_Item *array, Efl_Callback_Priority priority, const void *user_data)
+{
+ for (int i = 0; array[i].desc; ++i)
+ {
+ CHECK_ADD(array[i].desc, EVAS_CANVAS_EVENT_RENDER_FLUSH_PRE, cb_render_flush_pre)
+ else CHECK_ADD(array[i].desc, EVAS_CANVAS_EVENT_RENDER_FLUSH_POST, cb_render_flush_post)
+ else CHECK_ADD(array[i].desc, EFL_CANVAS_SCENE_EVENT_RENDER_PRE, cb_render_pre)
+ else CHECK_ADD(array[i].desc, EFL_CANVAS_SCENE_EVENT_RENDER_POST, cb_render_post)
+ }
+ return efl_event_callback_array_priority_add(efl_super(obj, MY_CLASS), array, priority, user_data);
+}
+#undef CHECK_ADD
+#define EVAS_CANVAS_EXTRA_OPS \
+ EFL_OBJECT_OP_FUNC(efl_event_callback_priority_add, _evas_canvas_efl_object_event_callback_priority_add), \
+ EFL_OBJECT_OP_FUNC(efl_event_callback_array_priority_add, _evas_canvas_efl_object_event_callback_array_priority_add)
+
+
#include "evas_stack.x"
#include "canvas/evas_canvas_eo.c"
}
static void
-_cb_always_call(Evas *eo_e, Evas_Callback_Type type, void *event_info)
+_cb_always_call(Evas *eo_e, Evas_Public_Data *e, Evas_Callback_Type type, void *event_info)
{
int freeze_num = 0, i;
+ switch (type)
+ {
+ case EVAS_CALLBACK_RENDER_PRE:
+ if (!e->cb_render_pre) return;
+ break;
+ case EVAS_CALLBACK_RENDER_POST:
+ if (!e->cb_render_post) return;
+ break;
+ case EVAS_CALLBACK_RENDER_FLUSH_PRE:
+ if (!e->cb_render_flush_pre) return;
+ break;
+ case EVAS_CALLBACK_RENDER_FLUSH_POST:
+ if (!e->cb_render_flush_post) return;
+ break;
+ default: break;
+ }
freeze_num = efl_event_freeze_count_get(eo_e);
for (i = 0; i < freeze_num; i++) efl_event_thaw(eo_e);
evas_event_callback_call(eo_e, type, event_info);
RD(0, "[--- RENDER EVAS (size: %ix%i): %p (eo %p)\n", e->viewport.w, e->viewport.h, e, eo_e);
- _cb_always_call(eo_e, EVAS_CALLBACK_RENDER_PRE, NULL);
+ _cb_always_call(eo_e, e, EVAS_CALLBACK_RENDER_PRE, NULL);
/* Check if the modified object mean recalculating every thing */
if (!e->invalidate)
efl_ref(eo_e);
_rendering_evases = eina_list_prepend(_rendering_evases, e);
e->rendering = _rendering_evases;
- _cb_always_call(eo_e, EVAS_CALLBACK_RENDER_FLUSH_PRE, NULL);
+ _cb_always_call(eo_e, e, EVAS_CALLBACK_RENDER_FLUSH_PRE, NULL);
evas_thread_queue_flush((Evas_Thread_Command_Cb)evas_render_pipe_wakeup, e);
eina_evlog("-render_output_async_flush", eo_e, 0.0, NULL);
}
{
_evas_object_image_video_overlay_do(eo_obj);
}
- _cb_always_call(eo_e, EVAS_CALLBACK_RENDER_FLUSH_PRE, NULL);
+ _cb_always_call(eo_e, e, EVAS_CALLBACK_RENDER_FLUSH_PRE, NULL);
EINA_LIST_FOREACH(e->outputs, l, out)
if (out->output)
ENFN->output_flush(ENC, out->output, EVAS_RENDER_MODE_SYNC);
- _cb_always_call(eo_e, EVAS_CALLBACK_RENDER_FLUSH_POST, NULL);
+ _cb_always_call(eo_e, e, EVAS_CALLBACK_RENDER_FLUSH_POST, NULL);
_deferred_callbacks_process(eo_e, evas);
eina_evlog("-render_output_flush", eo_e, 0.0, NULL);
}
}
eina_spinlock_take(&(e->render.lock));
e->inside_post_render = EINA_TRUE;
- _cb_always_call(eo_e, EVAS_CALLBACK_RENDER_POST, &post);
+ _cb_always_call(eo_e, e, EVAS_CALLBACK_RENDER_POST, &post);
e->inside_post_render = EINA_FALSE;
eina_spinlock_release(&(e->render.lock));
if (post.updated_area) eina_list_free(post.updated_area);
{
_evas_object_image_video_overlay_do(eo_obj);
}
- _cb_always_call(eo_e, EVAS_CALLBACK_RENDER_FLUSH_POST, NULL);
+ _cb_always_call(eo_e, evas, EVAS_CALLBACK_RENDER_FLUSH_POST, NULL);
}
/* clear redraws */
evas->rendering = NULL;
post.updated_area = ret_updates;
- _cb_always_call(eo_e, EVAS_CALLBACK_RENDER_POST, &post);
+ _cb_always_call(eo_e, evas, EVAS_CALLBACK_RENDER_POST, &post);
evas->inside_post_render = EINA_FALSE;
_deferred_callbacks_process(eo_e, evas);