Hi all,

Im trying to integrate nekovm into a project im doing, but i have some
problems, i hope someone can help me out :)

Basically the idea is that i have a library in C with some kind of
object abstraction similar to what gobject is. For that i've written
some neko "bindings", some .c (.ndll) and .neko files, similar to what
http://lists.motion-twin.com/pipermail/neko/2007-March/001653.html
explains. Then i have a library in C,  which uses this object
abstraction library, loads xml based files and calls neko exported
functions, in a similar form as html+js. the problem i have is that
for example on the following xml,

<script file="myscript.n"/>
<object onmouseclick="myfun()">

I have a callback in c that whenever that event is triggered i should
call the myfun() neko function on myscript.n, that part is working
correctly but now i want that the "this" value on the neko callback be
the object that triggered the event. So basically the object is
already created  (i can't use my neko bindings to create a new
object), i need to just wrap that object and pass it to val_CallEx as
the first argument, the logic way would be to create a new abstract
value and assing the object's kind, i.e

static value object_ref(Object *o)
{
        value i;

        i = alloc_abstract(k_object, o);
        val_gc(i, object_delete);

        return i;
}

But the above k_object and object_delete are part of my bindings, not
this library. How to handle that situation? specially the k_object
thing, i dont mind duplicating the code, but is there a better way to
handle this situation? link my c lib against the .nddl too and export
the k_object? kind of a hack tho ...

Regards

-- 
Neko : One VM to run them all
(http://nekovm.org)

Reply via email to