On Sun, Nov 18, 2012 at 10:02 AM, Leandro Dorileo <dori...@profusion.mobi>wrote:

> Hi,
>
> On Sat, Nov 17, 2012 at 05:37:42PM +0100, Andreas Volz wrote:
> > Hello,
> >
> > I've just some problem to understand that event_info parameter in Evas
> > callbacks. e.g.:
> >
> >
> http://docs.enlightenment.org/auto/elementary/fileselector_example_c.html
> >
> > ...
> > /* 'selected' cb */
> > static void
> > _fs_selected(void        *data,
> >              Evas_Object *obj,
> >              void        *event_info)
> > {
> >    const char *selected = event_info;
> >    /* event_info contains the full path of the selected file */
> >
> >    printf("There's been a selection: %s\n", selected);
> > }
> > ...
> >  /* the 'done' cb is called when the user presses ok/cancel */
> >    evas_object_smart_callback_add(fs, "done", _fs_done, win);
> > ...
> >
> > In this example the event_info* is casted in sime magic way to a char*.
> > My problem is that event_info* could always be anything and I don't
> > know it without looking into the sources (here e.g. elm_fileselector).
> > It's not written anywhere in the documentation that event_info* is a
> > char*. (Or I didn't find it...)
> >
>
>
> EFL documentation usually tells what event_info is deppending on the object
> and the event you're registering a callback to. For the file selector you
> can check the widget doc[1] in the "detailed description" section.
>
>
> > So is there any way to find out as API user the type of event_info*
> > which I should cast?
> >
> > In my special case (Eflxx C++ wrapper) have the problem to design a
> > type safe interface. I've really no idea to do it. But even using the C
> > interface I don't like it. Or did I miss understood the API?
> >
> > I would really prefer that event_info* would be some structure with a
> > data pointer and some magic identifiers. Then it would be possible to
> > find out the type of an event.
> >
> > What do you think? Am I alone with this problem? Any ideas for a better
> > event_info interface?
>
>
> Smart object events are extremelly arbitrary... you can have totally
> different
> smart object with different objectives handling with different type of
> data and
> event nature.
>
>
Right. That's why event_info type is 'void *'.
Smart object is quite customizable so applications can write their own
smart objects with arbitrary event_info parameters to suit their tastes.

Daniel Juyung Seo (SeoZ)


> [1] -
> http://docs.enlightenment.org/auto/elementary/group__Fileselector.html
>
>
> Regards....
>
> --
> Leandro Dorileo
> ProFUSION embedded systems
> http://profusion.mobi
>
>
> ------------------------------------------------------------------------------
> Monitor your physical, virtual and cloud infrastructure from a single
> web console. Get in-depth insight into apps, servers, databases, vmware,
> SAP, cloud infrastructure, etc. Download 30-day Free Trial.
> Pricing starts from $795 for 25 servers or applications!
> http://p.sf.net/sfu/zoho_dev2dev_nov
> _______________________________________________
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to