we are using XULRunner 24 embedded in a Java application through Eclipse SWT. We need extended functionality only available through the XPCOM API, and since the old JavaXPCOM binding has vanished, we are migrating all code to C++, which we access from Java through a narrow JNI API. So far, so good.
// create a canvas
var canvas = cwin.document.createElement("canvas");
// get the 2D context and draw everythiong on it
var ctx = canvas.getContext("2d");
ctx.clearRect(0, 0, width, height);
ctx.drawWindow(cwin, 0, position, width, height, "rgb(255,255,255)");
//and then to disk..
Now I would like to rewrite this in C++, and am mighty stuck. Can someone give a hint how to proceed? I have spent a full day browsing the APIs and the web, but am not able to figure out how to get to the 2D context thingy and do the rest. I have found an old post from 2008 regarding a similar issue, but that would not even compile.
On 2/13/2014 12:17 PM, Christian Sell wrote:
> Now I would like to rewrite this in C++, and am mighty stuck.
Why do you want this to be in C++? I strongly recommend writing as much
of this as you can in JS. It's going to be a more stable API surface,
especially if you're using DOM JS calls. I really don't expect this to
be easy or perhaps even possible from C++.