EAL - Web Engine Abstraction Layer
EAL - the Web Engine Abstraction Layer Library provides an abstract interface to the Web Engine Component. It gives the possibility to develop applications with WEB Engine support without any actual dependency to any particular WEB Engine.
EAL was developed as a part of the Nokia 770 Browser Framework. The library is based on GObject interface model and depends just on GLib.
For more information refer to the Doxygen generated documentation or directly to the header and source files.
The following items describe different aspects of the EAL Library based application development.
The EAL Library contains the interface classes needed to provide an implementation independent interface to the WEB engine functionality. A browser application that uses the EAL interface should also be linked to an "implementation library". The "Implementation library" contains the actual functionality for the EAL Library interface classes. The browser application should never use any of the engine specific functions from the "implementation library". It should completely rely upon the EAL Library interface.
In this approach the module dependences are as follows:
and logical dependences are:
The EAL library itself is useless without the implementation layer. In order to use it in the browser application we need to implement this layer using on some existing web engine. For example, if we want to use the Mozilla Engine as an implementation of our engine interface we need to create a wrapper for it. This wrapper or "implementation library" will embed the Mozilla Engine functions and map them to the relevant functions of the EAL Library.
This figure below will describes the module dependences:
and this logical dependences are:
See also Gtk Mozilla Embedding Widget.
Every "implementation library" should implement g_web_new() function. This function is used to instantiate a structure containing a pool of functions. These functions implement the actual engine support. When application needs to perform some engine specific operation it calls an EAL Library function with the pointer to the object created with g_web_new() function. The EAL Library function just calls the actual engine implementation function from the function pool delivered with this object. This implementation function wraps engine specific internals and hides them from the rest of the application.
Below, there is a call diagram for our Mozilla Engine example:
A typical EAL based application should also include some activation code for the WEB Engine layer.
The list below gives main steps to enable EAL support in your application:
The application should be linked to at least the EAL Library and the Engine EAL Library.
- Include the gweb.h header file.
- Instantiate the global WEB object with the g_web_new() function.
- Perform some global initializations. For example, set the user agent string with the g_web_set_ua_string() function.
- Get global implementation WEB object with g_web_get_global() function.
- Connect some global signals to the global implementation WEB object. For example, set the modal dialog callback with the 'g_signal_connect' function.
- Create a new WEB Engine object with the g_web_new_web_engine_window() function.
- Get a WEB Engine widget object from the WEB Engine object with the g_web_engine_get_engine_widget() function.
- Connect some engine widget signals. For example, set URL changed callback with 'g_signal_connect' function.
- Set the engine widget into the application window.
- Finally, load some URL with the g_web_engine_load_url() function.
In case of the Mozilla engine 'Engine EAL Library' is the 'Mozilla EAL Library'.
The typical EAL based application dependencies are given below:
The following headers are available for use in EAL based applications:
- gweb.h - the GWebIface definition.
- gwebcommon.h - describes common enumerations.
- gwebengine.h - the GWebEngineIface definition.
- gwebhistorylist.h - the GWebHistoryListIface definition.
- gwebpluginlist.h - the GWebPluginListIface definition.
- gwebtransferitem.h - the GWebTransferItemIface definition.
- gwebtransferitemlist.h - the GWebTransferItemListIface.
- gwebwidget.h - contains the engine widget callback prototypes.
The "Implementation library" headers must not be used in an EAL based application directly.
Object-oriented C based on the GObject and GTypeInterface concepts.
The EAL Library introduces following class interfaces:
GWebIface is an application wide object interface. It is used for setting the web engine properties and performing the web engine related operations globally in the application.
GWebEngineIface is the web engine object interface. In the SDI application architecture there is one engine object per application. In the MDI application architecture there is one engine object per page or child window.
Every web engine object has a corresponding rendering widget. The application should implement callbacks for the web engine widget to be able to handle page loading events and so on. See the file gwebwidget.h for details.
The web engine object itself is used for performing operations applied to this particular rendering widget.
GWebHistoryListIface - a list of browsing history objects per engine widget. Used for implementing the "back/forward" functionality.
GWebPluginListIface - a list of installed plugins. This list is an application wide object.
GWebTransferItemIface represents a download item. The application should set object specific callbacks to be able to control downloading.
GWebTransferItemListIface - a list of download items. This list is an application wide object.
In the future library interface classes can be decomposed into smaller instances dedicated to some particular engine related task clusters.
Generated on Tue Sep 25 10:37:04 2007 for browser-eal by