{
Filter *f;
Ecore_Event_Message_Handler_Data *eemhd;
- Eo *ecore_event_handler = efl_loop_message_handler_get
- (obj, ECORE_EVENT_MESSAGE_HANDLER_CLASS);
-
+ Eo *ecore_event_handler = efl_provider_find(obj, ECORE_EVENT_MESSAGE_HANDLER_CLASS);
+ /* If this is not != NULL, then _ecore_event_init was not called yet, which means,
+ there cannot be any registered events yet
+ */
if (!ecore_event_handler) return;
+
eemhd = efl_data_scope_get(ecore_event_handler, MY_CLASS);
if (!eemhd) return;
if (!eemhd->filters) return;
const char *choice = getenv("EINA_MEMPOOL");
if ((!choice) || (!choice[0])) choice = "chained_mempool";
- _event_msg_handler =
- efl_loop_message_handler_get(_mainloop_singleton,
- ECORE_EVENT_MESSAGE_HANDLER_CLASS);
+ _event_msg_handler = efl_add(ECORE_EVENT_MESSAGE_HANDLER_CLASS, _mainloop_singleton);
+ efl_loop_register(_mainloop_singleton, ECORE_EVENT_MESSAGE_HANDLER_CLASS, _event_msg_handler);
+
if (!_event_msg_handler)
{
ERR("Cannot create legacy ecore event message handler");
typedef struct _Efl_Task_Data Efl_Task_Data;
typedef struct _Efl_Appthread_Data Efl_Appthread_Data;
-typedef struct _Message_Handler Message_Handler;
typedef struct _Message Message;
-struct _Message_Handler
-{
- Eo *handler;
- const Eo *klass;
-};
-
struct _Message
{
EINA_INLIST;
Eina_List *win32_handlers_to_delete;
# endif
- Eina_Inarray *message_handlers;
Eina_Inlist *message_queue;
unsigned int message_walking;
};
GENERIC_ALLOC_SIZE_DECLARE(Efl_Loop_Promise_Simple_Data);
-EOLIAN static Efl_Loop_Message_Handler *
-_efl_loop_message_handler_get(Eo *obj, Efl_Loop_Data *pd EINA_UNUSED, const Efl_Class *klass)
-{
- Message_Handler mh = { 0 }, *mh2;
- unsigned int i, n;
-
- n = eina_inarray_count(pd->message_handlers);
- for (i = 0; i < n; i++)
- {
- mh2 = eina_inarray_nth(pd->message_handlers, i);
- if (mh2->klass == klass) return mh2->handler;
- }
- mh.klass = klass;
- mh.handler = efl_add(klass, obj);
- eina_inarray_push(pd->message_handlers, &mh);
- return mh.handler;
-}
-
Eo *_mainloop_singleton = NULL;
Efl_Loop_Data *_mainloop_singleton_data = NULL;
pd->loop_time = ecore_time_get();
pd->providers = eina_hash_pointer_new(EINA_FREE_CB(efl_unref));
- pd->message_handlers = eina_inarray_new(sizeof(Message_Handler), 32);
pd->epoll_fd = -1;
pd->timer_fd = -1;
- pd->future_message_handler = efl_loop_message_handler_get
- (obj, EFL_LOOP_MESSAGE_FUTURE_HANDLER_CLASS);
+ pd->future_message_handler = efl_add(EFL_LOOP_MESSAGE_FUTURE_HANDLER_CLASS, obj);
+ efl_loop_register(obj, EFL_LOOP_MESSAGE_FUTURE_HANDLER_CLASS, pd->future_message_handler);
+
return obj;
}
pd->poll_medium = NULL;
pd->poll_high = NULL;
- if (pd->message_handlers)
- {
- eina_inarray_free(pd->message_handlers);
- pd->message_handlers = NULL;
- }
-
// After invalidate, it won't be possible to parent to the singleton anymore
if (obj == _mainloop_singleton)
{
}
return: bool; [[$true if successfully unregistered, $false otherwise.]]
}
- message_handler_get {
- [[Get a message handler object that is created by and owned by
- the Efl.Loop object, so you can listen to this message type by
- listening to message events on the handler as well as send
- objects as events.]]
- params {
- @in klass: const(Efl.Class); [[The class of the message object.]]
- }
- return: Efl.Loop_Message_Handler; [[The message handler to use.]]
- }
}
events {
idle,enter @restart: void; [[Event occurs once the main loop enters the idle state.]]