[webkit-help] JavaScript C++ bindings in webkit

Brent Fulgham bfulgham at gmail.com
Thu Jun 10 07:45:52 PDT 2010


You can see good working examples of this by examining the inspector  
code in the WebKit tree.

Basically, the JSC engine only knows about C calls, so you have to  
write C functions that in turn call your C++ constructor, methods,  
etc.  You then populate the JavaScript structure used by JSC with  
function pointers to these methods.

I think if you look over the inspector code most of your questions  
will be answered.


Sent from my iPhone

On Jun 10, 2010, at 1:43 AM, Wadii Guedria <wadii.gd at gmail.com> wrote:

> Hi,
> I have a question about javascript/C++ bindings in webkit.
> For example, I have an extern C++ class (attributes+methodes)
> My objective is to access to this class from javascript like this:
> var object = new mycpluplusclass();
> object.getattribute;
> object.mycplusplusfunction;
> ....
> I know that I need to use JSClassDefinition and set the  
> JSStaticFunction. But I dont know how to define my C++ constructor  
> in JSObjectCallAsConstructorCallback
> Same thing for get/set  Property(C++ attribute).
> Any suggestions are welcome.
> Regards,
> Wadii
> _______________________________________________
> webkit-help mailing list
> webkit-help at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-help

More information about the webkit-help mailing list