Embedding/IPCLiteAPI: Difference between revisions

 
(15 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Lite-weight Embedding API for Mozilla based applications with native UI. ==
== Lite-weight Embedding API for Mozilla based applications with native UI. ==
<p>Basic architecture is very close to [http://trac.webkit.org/wiki/WebKit2 WebKit2], and [http://browser.garage.maemo.org/docs/browser_paper.html MicroB]
<p>Basic architecture is very close to [http://trac.webkit.org/wiki/WebKit2 WebKit2], and [http://browser.garage.maemo.org/docs/browser_paper.html MicroB]
== Story ==
=== Mozilla has bunch of technologies integrated recently: ===
* [https://wiki.mozilla.org/Platform/GFX/OffMainThreadCompositing OMTC - Off Main thread compositing - keeping Gecko/XPCOM and Compositor in separate threads (Android Firefox)]
* [https://wiki.mozilla.org/Electrolysis IPC - Multiprocess rendering - keeping Gecko/XPCOM and Compositor in separate processes (Firefox OS, Desktop Firefox Plugins)]
In order to build Simple browser with native UI (Gtk/Qt/UiKit) similar to Android Firefox with Java UI, some internal API need to be exposed.
Goal of this project to provide Generic embedding API which could be easily wrapped without bunch of extra code into Toolkit specific Widgets, and embed these widgets into platform UI applications.
</p><p>Benefits of new architecture comparing to default [https://wiki.mozilla.org/Embedding/NewApi mozilla embedding]:</p>
</p><p>Benefits of new architecture comparing to default [https://wiki.mozilla.org/Embedding/NewApi mozilla embedding]:</p>
<pre class="_fck_mw_lspace">* No XUL/XPCOM heavy content in UI process/Thread (Best memory footprint (process case), fast startup)
<pre class="_fck_mw_lspace">* No XUL/XPCOM heavy content in UI process/Thread (Best memory footprint (process case), fast startup)
Line 22: Line 31:
     embedapp->Start(EmbedLiteApp::EMBED_THREAD/PROCESS);
     embedapp->Start(EmbedLiteApp::EMBED_THREAD/PROCESS);


   [https://github.com/romaxa/mozilla-central/blob/embedlite/embedding/embedlite/tests/embedLiteCoreInitTest.cpp Core Embed Initialization example]
   [https://github.com/tmeshkova/gecko-dev/blob/embedlite/embedding/embedlite/tests/embedLiteCoreInitTest.cpp Core Embed Initialization example]


  6. After EmbedLiteAppListener[Derived] received "Initialized" notification, new EmbedLiteView can be created with:
  6. After EmbedLiteAppListener[Derived] received "Initialized" notification, new EmbedLiteView can be created with:
Line 29: Line 38:
     view->SetListener(MyEmbedLiteViewListener);
     view->SetListener(MyEmbedLiteViewListener);
   
   
   [https://github.com/romaxa/mozilla-central/blob/embedlite/embedding/embedlite/tests/embedLiteViewInitTest.cpp View Embed Initialization example]
   [https://github.com/tmeshkova/gecko-dev/blob/embedlite/embedding/embedlite/tests/embedLiteViewInitTest.cpp View Embed Initialization example]


   
   
Line 39: Line 48:


== [http://hg.mozilla.org/users/romaxa_gmail.com/embedipc_queue Source code path queue] ==
== [http://hg.mozilla.org/users/romaxa_gmail.com/embedipc_queue Source code path queue] ==
== [https://bugzilla.mozilla.org/show_bug.cgi?id=713681 BMO Bug 713681] ==
== [https://bugzilla.mozilla.org/show_bug.cgi?id=713681 BMO Bug 713681(IPC)] ==
== [https://bugzilla.mozilla.org/show_bug.cgi?id=746800 BMO Bug 746800(OMTC)]  ==
 
== Development Build instructions: ==
 
Clone repository with submodules structure
 
<pre>
git clone git://github.com/tmeshkova/xulrunner-package.git
</pre>


== Build instructions: ==
Build it with simple script run:
<pre>
<pre>
git clone git://github.com/tmeshkova/mozilla-central.git
cd xulrunner-package
cd mozilla-central
 
git checkout embedlite
# Pull all latest changes
./pull.all.sh
 
# Not after each pull.all especially after major engine updates it make sense to do rm -f objdir-xxxx-xxx/full_*
 
# Check list of available options
./build.sh -h
 
# Haramttan
./build.sh -t harmattan
 
# Fremantle
./build.sh -t fremantle
 
# Desktop - Qt is default
./build.sh -t desktop
 
# For debug builds add -d argument
 
After build is finished you fill see inline message about how to run test UI
You can also export SWRENDER=1 - if your desktop or device does not support HW acceleration
 


cp embedding/embedlite/config/mozconfig.gtkdesktop  mozconfig
# or
# for harmattan
# cp embedding/embedlite/config/mozconfig.qtN9-qt mozconfig
MOZCONFIG=$(pwd)/mozconfig make -f client.mk build_all
</pre>
</pre>
== Packaged Build instructions (debian desktop, N9): ==
Clone repositories
<pre>
mkdir ~/mozembed
cd ~/mozembed
# Gecko Engine with EmbedLite API
git clone git://github.com/tmeshkova/gecko-dev.git
# Embedlite toolkit independent components (History,prompt et.c.)
git clone git@github.com:tmeshkova/embedlite-components.git
# qtmozembed - Qt wrapper library around EmbedLite API for quick integration into QML.
git clone git@github.com:tmeshkova/qtmozembed.git
# qmlmozbrowser UI application which works as simple reference UI
git clone git@github.com:tmeshkova/qmlmozbrowser.git
</pre>
Build with dpkg-buildpackage
<pre>
cd ~/mozembed/mozilla-central
dpkg-buildpackage -us -uc -b -nc
dpkg -i ../xulrunner*.deb
cd ~/mozembed/embedlite-components
dpkg-buildpackage -us -uc -b -nc
dpkg -i ../embedlite-components*.deb
cd ~/mozembed/qtmozembed
dpkg-buildpackage -us -uc -b -nc
dpkg -i ../libqtmozembed*.deb
cd ~/mozembed/qmlmozbrowser
dpkg-buildpackage -us -uc -b -nc
dpkg -i ../qmlmozbrowser*.deb
</pre>
# Simple test to check
<pre>
/usr/lib/xulrunner-21.0a1/embedLiteCoreInitTest
</pre>
# For development it is better to link xulrunner objdir to system (on desktop or on device with ~/mozembed mounted via NFS)
<pre>
cd ~/mozembed/mozilla-central
./link_to_system.sh obj-xr-qt /usr
# for embedlite-components, qtmozembed, qmlmozbrowser just run
./link_to_system.sh
</pre>
Finally run test example:
<pre>
qmlMozEmbedTest -url about:license
</pre>
== Try, Test, Report, Contribute: ==
Fell free to test it, submit issues to github issue tracker, or even better fork it, fix it, contribute changes via Pull Requests.


== Pre compiled binaries: ==
== Pre compiled binaries: ==
Line 76: Line 171:
./qmlMozEmbedTest -url linux.org.ru
./qmlMozEmbedTest -url linux.org.ru


</pre>
=== Troubleshooting: ===
* If embedding does not start and libxul.so location differs from what has been used while building QtMozEmbed, then export path to GRE_HOME (path to folder with libxul.so)
<pre>
ex: export GRE_HOME=/opt/mozilla/xulrunner
</pre>
</pre>


Confirmed users
180

edits