Hi,


I have managed to expose C++ APIs to JS using JavaScriptCore and I am able to 
issue callbacks from JavaScript to C++.

Now, I wanted to raise certain events in C++ and hoping them to be received in 
JavaScript.

So, if in JS, someone has added code:

myElement.addEventListener("myEvent", myEventHandler(), ...)

Then, I should somehow be able to raise myEvent from C++ and want it to be 
passed to JavaScript(caught in JS), so that myEventHandler() gets called.

Firstly, I thought of creating callbacks for all event handler functions and 
calling correct event handler them from C++ whenever an event needs to be 
raised.
But, if I do like it, then I need to know beforehand which event handlers are 
associated with which events and I can't register and deregister events on the 
fly.

Also, there might be more than one handler associated with some events.

JavaScript code is not mine, I have to work with already written scripts and 
not allowed to modify them. So, I have to find out some way to do it through 
c++ only.

Can anyone please expain to me, how I can do this.

Thanks,
newbie.
_______________________________________________
webkit-help mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-help

Reply via email to