Question Doubts regarding the embedding of Gecko

2012-01-09 Thread Leander Bessa
Hello,

I'm trying to build an application which'll use html5 and css3 to
display its interface and a set of C++ apis to introduce features
beyond the scope of html.

I have the following questions regarding the embedding process of
Gecko:

1) Does embedding gecko only give me access to the html renderer or
does it also include the javascript engine?

2) Regarding the new embed api with Qt, how does gecko render html?
Does it use cairo's or Qt's api? This aspect is important, since
rendering performance is a must.

3) How easy is it to make my c++ apis available to the javascript
context? In the case of the Qt port, can i use QObject derived classes
such as in QtWebkit?

4) How difficult is it to extend/alter Gecko?  For instance: adding a c
++ scene graph to the canvas layer or hooking up a driver to support
muti-touch input with a touch screen on a desktop pc?

Regards,

Leander
___
dev-embedding mailing list
dev-embedding@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-embedding


Re: Question Doubts regarding the embedding of Gecko

2012-01-09 Thread Benjamin Smedberg

On 1/9/2012 6:34 AM, Leander Bessa wrote:


I'm trying to build an application which'll use html5 and css3 to
display its interface and a set of C++ apis to introduce features
beyond the scope of html.
It sounds like you really want XULRunner, not embedding in the 
traditional sense. You can write XULRunner apps using HTML (instead of 
XUL), and this is actually recommended because it will insulate you from 
any changes we might make to the (unstable) XUL language itself. And 
most of the special features you need can be implemented as JS modules 
or XPCOM components.

1) Does embedding gecko only give me access to the html renderer or
does it also include the javascript engine?
Our platform is a complete platform including layout, JS, networking, 
and pretty much everything else you need for a complete web experience.


2) Regarding the new embed api with Qt, how does gecko render html?
Does it use cairo's or Qt's api? This aspect is important, since
rendering performance is a must.
I can't answer this question because I don't know what embed API you're 
discussing.


3) How easy is it to make my c++ apis available to the javascript
context? In the case of the Qt port, can i use QObject derived classes
such as in QtWebkit?
No, you cannot. Typically you interface with C++ code using either XPCOM 
interfaces declared in XPIDL, or by writing a glue layer in JavaScript 
and using JS-ctypes. XPCOM is more powerful but you may need to update 
or recompile your code for each release cycle. JS-ctypes is more stable 
although it may require additional work and care to get the interface 
right, especially if you have complex callback mechanisms.


4) How difficult is it to extend/alter Gecko?  For instance: adding a c
++ scene graph to the canvas layer or hooking up a driver to support
muti-touch input with a touch screen on a desktop pc?
Assuming that you can't just translate your scene graph to SVG or some 
web technology, the best way to implement something like that would 
probably be as an NPAPI plugin.


Gecko already supports multi-touch input natively using DOM events, so 
that probably doesn't require any additional code on your part except 
for JS to react to the multitouch events.


--BDS

___
dev-embedding mailing list
dev-embedding@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-embedding


Re: Question Doubts regarding the embedding of Gecko

2012-01-09 Thread Leander Bessa
Thanks for the reply, i stil have some questions though:

1) Are XPCOM componentes accessible through javascript?

2) Do any new JS modules or XPCOM components need to be integrated at build
time or are they loaded at run-time (dll/dylib/so)?

3) Regarding 4), i'm aware the mozilla supports multi-touch events. What
i'm trying to accomplish is to hook the events from a touch screen driver
on the desktop to the mechanism which launches the touch events. Do i need
to alter the mozilla source code to enable this or can it be achieved with
a XPCOM component?

Regards,

Leander

On Mon, Jan 9, 2012 at 4:50 PM, Benjamin Smedberg benja...@smedbergs.uswrote:

 On 1/9/2012 6:34 AM, Leander Bessa wrote:


 I'm trying to build an application which'll use html5 and css3 to
 display its interface and a set of C++ apis to introduce features
 beyond the scope of html.

 It sounds like you really want XULRunner, not embedding in the
 traditional sense. You can write XULRunner apps using HTML (instead of
 XUL), and this is actually recommended because it will insulate you from
 any changes we might make to the (unstable) XUL language itself. And most
 of the special features you need can be implemented as JS modules or XPCOM
 components.

  1) Does embedding gecko only give me access to the html renderer or
 does it also include the javascript engine?

 Our platform is a complete platform including layout, JS, networking, and
 pretty much everything else you need for a complete web experience.


 2) Regarding the new embed api with Qt, how does gecko render html?
 Does it use cairo's or Qt's api? This aspect is important, since
 rendering performance is a must.

 I can't answer this question because I don't know what embed API you're
 discussing.


 3) How easy is it to make my c++ apis available to the javascript
 context? In the case of the Qt port, can i use QObject derived classes
 such as in QtWebkit?

 No, you cannot. Typically you interface with C++ code using either XPCOM
 interfaces declared in XPIDL, or by writing a glue layer in JavaScript and
 using JS-ctypes. XPCOM is more powerful but you may need to update or
 recompile your code for each release cycle. JS-ctypes is more stable
 although it may require additional work and care to get the interface
 right, especially if you have complex callback mechanisms.


 4) How difficult is it to extend/alter Gecko?  For instance: adding a c
 ++ scene graph to the canvas layer or hooking up a driver to support
 muti-touch input with a touch screen on a desktop pc?

 Assuming that you can't just translate your scene graph to SVG or some web
 technology, the best way to implement something like that would probably be
 as an NPAPI plugin.

 Gecko already supports multi-touch input natively using DOM events, so
 that probably doesn't require any additional code on your part except for
 JS to react to the multitouch events.

 --BDS


___
dev-embedding mailing list
dev-embedding@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-embedding


Re: Question Doubts regarding the embedding of Gecko

2012-01-09 Thread Leander Bessa
Ok. Thanks for the quick reply!

Regards,

Leander
On Monday, January 9, 2012, Benjamin Smedberg benja...@smedbergs.us wrote:
 On 1/9/2012 12:25 PM, Leander Bessa wrote:

 Thanks for the reply, i stil have some questions though:

 1) Are XPCOM componentes accessible through javascript?

 Yes. See https://developer.mozilla.org/en/XPConnect for details.

 2) Do any new JS modules or XPCOM components need to be integrated at
build
 time or are they loaded at run-time (dll/dylib/so)?

 They are loaded at runtime.

 3) Regarding 4), i'm aware the mozilla supports multi-touch events. What
 i'm trying to accomplish is to hook the events from a touch screen driver
 on the desktop to the mechanism which launches the touch events. Do i
need
 to alter the mozilla source code to enable this or can it be achieved
with
 a XPCOM component?

 On what OS? I believe that this is already hooked up on Mac, and on
Windows as long as the driver uses the standard Windows touchscreen
framework. You'd have to do that work on Linux, and it would involve
hacking our core event processing systems (it probably could not be
accomplished by just a component loaded at runtime.

 --BDS


___
dev-embedding mailing list
dev-embedding@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-embedding