On Tue, Jun 18, 2013 at 1:39 AM, Cedric BAIL <[email protected]> wrote:
> Hello,
Hello,
> That is a really interesting idea. Why not just play with undefining
> EO_TYPECHECK in your case ? I like the trick of reusing cpp to
> generate binding. I am not sure how to use it in other case than C++,
> but worth thinking about it.
As a proof of concept, this runs:
#include <eflcxx/eo/eo_class_test.hpp>
#include <Elementary.h>
#undef EO_TYPECHECK
#define EO_TYPECHECK(TYPE, ARG) TYPE
EFLCXX_EO_CLASS_C
(evas_object // class name
, regular // regular type
, :: EVAS_OBJ_CLASS
, evas_obj_ // prefix
, (position_set, 2)
(size_set, 2)
(visibility_set, 1)
, () // constructors (TODO)
, () // bases
)
EFLCXX_EO_CLASS_C
(window // class name
, regular // regular type
, :: ELM_OBJ_WIN_CLASS
, elm_obj_win_ // prefix
, (title_set, 1)
, () // constructors (TODO)
, (evas_object) // bases
)
#undef EO_TYPECHECK
#define EO_TYPECHECK(type, x) \
({ \
type __x; \
__x = x; \
(type) __x; \
})
static void on_done(void *data, Evas_Object *obj, void *event_info)
{
std::cout << "on_done " << std::endl;
elm_exit();
}
int main(int argc, char* argv[])
{
::elm_init(argc, argv);
window win
( eo_add_custom(ELM_OBJ_WIN_CLASS, NULL,
elm_obj_win_constructor("Name", ELM_WIN_BASIC)) );
win.position_set(100, 100);
win.size_set(500, 500);
win.visibility_set(true);
win.title_set("Titulo");
evas_object_smart_callback_add(win._eflcxx_raw(), "delete,request",
on_done, 0);
elm_run();
::elm_shutdown();
}
I couldn't avoid passing the number of parameters the function has, because
I need to expand the macro with the correct number of arguments. I have to
#undef EO_TYPECHECK and later redef it back so elm_obj_win_constructor
works.
> Thanks,
> --
> Cedric BAIL
Regards,
--
Felipe Magno de Almeida
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel