typedef enum _Evas_Callback_Type
{
+ /*
+ * The following events are only for use with objects
+ * evas_object_event_callback_add():
+ */
EVAS_CALLBACK_MOUSE_IN, /**< Mouse In Event */
EVAS_CALLBACK_MOUSE_OUT, /**< Mouse Out Event */
EVAS_CALLBACK_MOUSE_DOWN, /**< Mouse Button Down Event */
EVAS_CALLBACK_CHANGED_SIZE_HINTS, /**< Size hints changed event */
EVAS_CALLBACK_IMAGE_PRELOADED, /**< Image as been preloaded */
+
+ /*
+ * The following events are only for use with canvas
+ * evas_event_callback_add():
+ */
+
EVAS_CALLBACK_CANVAS_FOCUS_IN, /**< Canvas got focus as a whole */
EVAS_CALLBACK_CANVAS_FOCUS_OUT, /**< Canvas lost focus as a whole */
EVAS_CALLBACK_RENDER_FLUSH_PRE, /**< Called just before rendering is updated on the canvas target */
EVAS_CALLBACK_RENDER_FLUSH_POST, /**< Called just after rendering is updated on the canvas target */
+
+
+
+ /* the following id no event number, but a sentinel: */
EVAS_CALLBACK_LAST /**< keep as last element/sentinel -- not really an event */
} Evas_Callback_Type; /**< The type of event to trigger the callback */
} Evas_Object_Pointer_Mode;
typedef void (*Evas_Smart_Cb) (void *data, Evas_Object *obj, void *event_info);
-typedef void (*Evas_Event_Cb) (void *data, Evas *e, Evas_Object *obj, void *event_info);
+typedef void (*Evas_Event_Cb) (void *data, Evas *e, void *event_info);
+typedef void (*Evas_Object_Event_Cb) (void *data, Evas *e, Evas_Object *obj, void *event_info);
#ifdef __cplusplus
extern "C" {
EAPI void evas_object_precise_is_inside_set (Evas_Object *obj, Eina_Bool precise) EINA_ARG_NONNULL(1);
EAPI Eina_Bool evas_object_precise_is_inside_get (const Evas_Object *obj) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
- EAPI void evas_object_event_callback_add (Evas_Object *obj, Evas_Callback_Type type, Evas_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
- EAPI void *evas_object_event_callback_del (Evas_Object *obj, Evas_Callback_Type type, Evas_Event_Cb func) EINA_ARG_NONNULL(1, 3);
- EAPI void *evas_object_event_callback_del_full(Evas_Object *obj, Evas_Callback_Type type, Evas_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
+ EAPI void evas_object_event_callback_add (Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
+ EAPI void *evas_object_event_callback_del (Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func) EINA_ARG_NONNULL(1, 3);
+ EAPI void *evas_object_event_callback_del_full(Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
EAPI void evas_event_callback_add (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data) EINA_ARG_NONNULL(1, 3);
EAPI void *evas_event_callback_del (Evas *e, Evas_Callback_Type type, Evas_Event_Cb func) EINA_ARG_NONNULL(1, 3);
evas_event_callback_call(Evas *e, Evas_Callback_Type type, void *event_info)
{
Eina_Inlist **l_mod = NULL, *l;
-
+
_evas_walk(e);
if (e->callbacks)
{
fn = (Evas_Func_Node *)l;
if ((fn->type == type) && (!fn->delete_me))
{
- if (fn->func)
- fn->func(fn->data, e, NULL, event_info);
+ Evas_Event_Cb func = fn->func;
+ if (func)
+ func(fn->data, e, event_info);
}
if (e->delete_me) break;
}
fn = (Evas_Func_Node *)l;
if ((fn->type == type) && (!fn->delete_me))
{
- if (fn->func)
- fn->func(fn->data, obj->layer->evas, obj, event_info);
+ Evas_Object_Event_Cb func = fn->func;
+ if (func)
+ func(fn->data, obj->layer->evas, obj, event_info);
}
if (obj->delete_me) break;
}
* @endcode
*/
EAPI void
-evas_object_event_callback_add(Evas_Object *obj, Evas_Callback_Type type, void (*func) (void *data, Evas *e, Evas_Object *obj, void *event_info), const void *data)
+evas_object_event_callback_add(Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data)
{
/* MEM OK */
Evas_Func_Node *fn;
* @endcode
*/
EAPI void *
-evas_object_event_callback_del(Evas_Object *obj, Evas_Callback_Type type, void (*func) (void *data, Evas *e, Evas_Object *obj, void *event_info))
+evas_object_event_callback_del(Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func)
{
/* MEM OK */
Evas_Func_Node *fn;
* @endcode
*/
EAPI void *
-evas_object_event_callback_del_full(Evas_Object *obj, Evas_Callback_Type type, void (*func) (void *data, Evas *e, Evas_Object *obj, void *event_info), const void *data)
+evas_object_event_callback_del_full(Evas_Object *obj, Evas_Callback_Type type, Evas_Object_Event_Cb func, const void *data)
{
/* MEM OK */
Evas_Func_Node *fn;
}
EAPI void
-evas_event_callback_add(Evas *e, Evas_Callback_Type type, void (*func) (void *data, Evas *e, Evas_Object *obj, void *event_info), const void *data)
+evas_event_callback_add(Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data)
{
/* MEM OK */
Evas_Func_Node *fn;
}
EAPI void *
-evas_event_callback_del(Evas *e, Evas_Callback_Type type, void (*func) (void *data, Evas *e, Evas_Object *obj, void *event_info))
+evas_event_callback_del(Evas *e, Evas_Callback_Type type, Evas_Event_Cb func)
{
/* MEM OK */
Evas_Func_Node *fn;
}
EAPI void *
-evas_event_callback_del_full(Evas *e, Evas_Callback_Type type, void (*func) (void *data, Evas *e, Evas_Object *obj, void *event_info), const void *data)
+evas_event_callback_del_full(Evas *e, Evas_Callback_Type type, Evas_Event_Cb func, const void *data)
{
/* MEM OK */
Evas_Func_Node *fn;