Re: [Vala] Problem converting c to vala/genie



Hi Jamie,

Thanks for your response.
I'm trying to create the vapi for the Elementary library from E17 (only widget creation part, the rest is already done).

I have another question, how to do this:

How can i pass my struct "Widget_Data" to "void* data" ?
elm_widget_data_set(Evas_Object *obj, void *data);

How can i create in the vapi this: "void (*func) (Evas_Object *obj)" ?
elm_widget_del_hook_set(Evas_Object *obj, void (*func) (Evas_Object *obj));

C sample:
elm_widget_del_hook_set(obj, _del_hook)

static void
 _del_hook(Evas_Object *obj)
 {
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
    // delete hook - on delete of object delete object struct etc.
    free(wd);
 }

Thanks to everyone in advance,
Nicolas.


Im not sure what you mean - are you using or porting the code in the c
library?

If you are using a c library in Genie/vala then you need to create a
vapi file for it

if you are porting a c library to genie/vala then you dont need to
specify ELM_NEW as construction is done for you :

var wd = new Widget_Data

hope that helps

jamie





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]