WebReflection / node-gtk

GNOME Gtk+ bindings for NodeJS
MIT License
74 stars 9 forks source link

Run JS code to build NS from C++ hooks #17

Open magcius opened 8 years ago

magcius commented 8 years ago

When importing an object (or other resource) by pointer, we simply get the class template and construct the object:

https://github.com/WebReflection/node-gtk/blob/master/src/gobject.cc#L243-L251

We need to make sure that if something returns an object that hasn't been imported, we run everything required to build up that class, install methods, etc.

This should also be the class if an object inherits from a parent that's also unimported.

That means we should rewrite this code to call a JS hook. Perhaps we install one when the JS code calls Bootstrap.

https://github.com/WebReflection/node-gtk/blob/master/src/gobject.cc#L163-L182