Confirmed users
180
edits
| Line 9: | Line 9: | ||
== New embedding expected initialization sequence == | == New embedding expected initialization sequence == | ||
1. Native UI startup (android UI thread view or Gtk/Qt event loop) | 1. Native UI startup (android UI thread view or Gtk/Qt/UIKit event loop) | ||
2. | 2. Load EmbedLite library and start point API (can be called in parallel thread) | ||
3. | LoadEmbedLite(argc, argv); | ||
4. | 3. Get EmbedLite application object, which allow to start Gecko in Child-Thread/Process, and create rendering views | ||
EmbedLiteApp* embedapp = XRE_GetEmbedLite(); | |||
4. Setup EmbedLite application listener (Some notifications about main app lifecycle) | |||
EmbedLiteAppListener[Derived]* listener = new EmbedLiteAppListener[Derived](); | |||
embedapp->SetListener(listener); | |||
5. Startup Embedding, blocking call, better to start UI first, and call this in some main loop event | |||
EmbedLite will not freeze application here, and continue native events processing along with Chromium Messages. | |||
embedapp->Start(EmbedLiteApp::EMBED_THREAD/PROCESS); | |||
[https://github.com/romaxa/mozilla-central/blob/embedlite/embedding/embedlite/tests/embedLiteCoreInitTest.cpp Core Embed Initialization example] | |||
6. After EmbedLiteAppListener[Derived] received "Initialized" notification, new EmbedLiteView can be created with: | |||
EmbedLiteView* view = embedapp->CreateView(); | |||
And setup related EmbedLiteViewListener in order to receive notifications from View actions (title,progress,invalidate et.c.) | |||
view->SetListener(MyEmbedLiteViewListener); | |||
[https://github.com/romaxa/mozilla-central/blob/embedlite/embedding/embedlite/tests/embedLiteViewInitTest.cpp View Embed Initialization example] | |||
=== Communication between UI and content process === | === Communication between UI and content process === | ||
* Load remote content JS (privileged script with full access) and interact using MessageMessenger (send/receive JSON messages) | * Load remote content JS (privileged script with full access) and interact using MessageMessenger (send/receive JSON messages) | ||
* Use embed messaging API (observe broadcast messages) | * Use embed messaging API (observe broadcast messages) | ||
* Build | * Build Custom Gecko C++/JS extensions | ||
== [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] == | ||