Embedding/NewApi: Difference between revisions
(→Design) |
|||
Line 8: | Line 8: | ||
Having the common layer also makes it a lot easier to add support for additional toolkits as this should only require a relative thin wrapper. | Having the common layer also makes it a lot easier to add support for additional toolkits as this should only require a relative thin wrapper. | ||
== Common Layer == | |||
There are 2 main classes for embedding. | |||
=== MozView === | |||
=== MozApp === | |||
This is a singleton, giving access to things like preferences. '''NOTE:''' it is optional to use this, i.e. if you don't need the functionality provided by MozApp you don't need to use it. | |||
== Getting the code == | == Getting the code == |
Revision as of 10:17, 26 June 2008
Motivation
The idea with the new embedding API is to provide an easier way to embed Mozilla in other applications. The existing API using XPCOM has quite a steep learning curve for new-comers. We would like to improve this with the new API.
Structure
The new API has a common C++ layer built on top of the existing API. The new API thus encapsulates many of the complexities of setting up and using XPCOM.
The common layer is then used by platform/toolkit specific APIs. This will allow embedders to use component that fit well into their application, e.g. GTK or Qt widgets.
Having the common layer also makes it a lot easier to add support for additional toolkits as this should only require a relative thin wrapper.
Common Layer
There are 2 main classes for embedding.
MozView
MozApp
This is a singleton, giving access to things like preferences. NOTE: it is optional to use this, i.e. if you don't need the functionality provided by MozApp you don't need to use it.
Getting the code
The code currently lives outside the main tree in a separate Mercurial repository (http://hg.mozilla.org/users/blassey_mozilla.com/embedding/). Here is how to get it:
hg clone http://hg.mozilla.org/users/blassey_mozilla.com/embedding/ mozembed
Build
- windows/win32
- windows/qt
- linux/qt
- linux/gtk
To Do
- prompts
- access to JS
- streaming data in
- access to underlying API for more advanced features
- support more platforms/toolkits