make it easy to write bindings for box.
authorbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 14 Nov 2008 23:10:29 +0000 (23:10 +0000)
committerbarbieri <barbieri@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 14 Nov 2008 23:10:29 +0000 (23:10 +0000)
commiteeb7d255c10b627820b6cfae925e7843659bf45a
treeca6e8e2ac99691a1a0ffaacfff2bdab95d90eaac
parent628219f4656fe9042d2abfbb3e5afaa6ffc4fe47
make it easy to write bindings for box.

giving an extra void *user_data to layout function is now easy to
write bindings, just give the callback to be a generic function that
will call the language/binding specific function handled as user_data.

Example, for python we can use:

   void _layout_dispatcher(Evas_Object *o, Evas_Object_Box_Data *priv, void *data) {
       PyObject *pyobj = data, *args;

       args = PyTyple_New(1);
       PyTuple_SET_ITEM(args, 0, Evas_object_from_instance(o));
       PyObject_Call(pyobj, args, NULL);
       Py_DECREF(args);
   }

   evas_object_box_layout_set(o, _layout_dispatcher, pyobj, Py_DecRef);

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@37640 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33
src/lib/Evas.h
src/lib/canvas/evas_object_box.c