On Sun, Nov 26, 2017 at 2:08 AM, Carsten Haitzler <ras...@rasterman.com> wrote:
>> You don't need that, just use Efl_Class.. that's it. no need to
>> "type_new", no need to "event_get". Use *any* Efl_Class, then:
>
> Yes - I thought it over more. a @class function can do this type-safely. pass
> in a loop obj and class and get an event type object back:
>
> event_type_obj = efl_loop_event_type_get(loop, MY_EVENT_CLASS);
> efl_event_callback_add(event_type_obj, EFL_LOOP_EVENT_TRIGGERED, mycall, 
> data);
>
> the loop will create the event_type_obj on first use and store it and after
> that just return the same obj to everyone who gets it. so callbacks are 
> managed
> with regular eo event callbacks on the same object.

hum... that works... usage would be something like?

    efl_event_callback_call(event_type_obj, EFL_LOOP_EVENT_TRIGGERED, data);

(that would make event dispatch synchronous), or:

   efl_loop_broadcast(loop, MY_EVENT_CLASS, data);

which internally will queue {MY_EVENT_CLASS->data} and call
efl_event_callback_call() at some specific main loop phase like
before.


I'd not oppose as it will simplify the logic a lot, basically you
don't need to do anything at all -- all done by Eo. Including
"walking/delete_me" logic...

then each loop contains a hash cls -> instance, return the instance
(event_type_obj) or create and return for the first time.

in that case, just be aware that MY_EVENT_CLASS for legacy is a single
one: ECORE_EVENT_LEGACY_CLASS. It will contain "legacy_type: int"
property, which uses the global integers to work on. Then
ecore_event_callback_add() will connect efl_event_callback_call()
using a proxy/wrapper, that will filter by "legacy_type", converting
to the old dispatch system -- those globals still remain.

-- 
Gustavo Sverzut Barbieri
--------------------------------------
Mobile: +55 (16) 99354-9890

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to