-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I'm coding a small program just to learn the Ecore, Evas and Edje libraries. I saw that some callback functions accept additional data as input parameters. For example:
EAPI Ecore_Event *ecore_event_add(int type, void *ev, void (*func_free) (void *data, void *ev), void *data); But other callbacks don't, like the next one: EAPI void ecore_evas_callback_resize_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee)); As I wish to avoid the use of global variables, I set a pointer to the necessary data into the Evas instance with the function: evas_data_attach_set(evas, data); Then, each time I need this data and it's not available as input parameter in the callback function, I do: My_Data *data = (My_Data *)(evas_data_attach_get(ecore_evas_get(ee))); where ee is the Ecore_Evas instance. Is this use of evas_data_attach_get/set correct? Is there a better solution? Whouldn't it be useful to have something like: EAPI void ecore_evas_callback_resize_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee, void *data), void *data); Thanks in advance. - -- Fabio G. Strozzi ~ http://fstrozzi.web.cs.unibo.it -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.3 (GNU/Linux) iD8DBQFGCSPbB3MPiq3KlccRAsNvAJ47W9ZZIdCp6NmaWqryojnyq7KeEACeLKPv MCvl7wqzTnb48Z6YpHUDrvY= =2HSM -----END PGP SIGNATURE----- ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-users mailing list enlightenment-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-users