EAL - Web Engine Abstraction Layer

1.0

Introduction

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.

Making applications with EAL

The following items describe different aspects of the EAL Library based application development.

1. Implementation Layer

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:

inline_dotgraph_1

and logical dependences are:

inline_dotgraph_2

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:

inline_dotgraph_3

and this logical dependences are:

inline_dotgraph_4

See also Gtk Mozilla Embedding Widget.

2. Functions

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:

inline_dotgraph_5

3. Application Development

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:

  1. Include the gweb.h header file.
  2. Instantiate the global WEB object with the g_web_new() function.
  3. Perform some global initializations. For example, set the user agent string with the g_web_set_ua_string() function.
  4. Get global implementation WEB object with g_web_get_global() function.
  5. Connect some global signals to the global implementation WEB object. For example, set the modal dialog callback with the 'g_signal_connect' function.
  6. Create a new WEB Engine object with the g_web_new_web_engine_window() function.
  7. Get a WEB Engine widget object from the WEB Engine object with the g_web_engine_get_engine_widget() function.
  8. Connect some engine widget signals. For example, set URL changed callback with 'g_signal_connect' function.
  9. Set the engine widget into the application window.
  10. Finally, load some URL with the g_web_engine_load_url() function.

4. Linking

The application should be linked to at least the EAL Library and the Engine EAL Library.

In case of the Mozilla engine 'Engine EAL Library' is the 'Mozilla EAL Library'.

5. Application Dependencies

The typical EAL based application dependencies are given below:

inline_dotgraph_6

6. Headers

The following headers are available for use in EAL based applications:

  1. gweb.h - the GWebIface definition.
  2. gwebcommon.h - describes common enumerations.
  3. gwebengine.h - the GWebEngineIface definition.
  4. gwebhistorylist.h - the GWebHistoryListIface definition.
  5. gwebpluginlist.h - the GWebPluginListIface definition.
  6. gwebtransferitem.h - the GWebTransferItemIface definition.
  7. gwebtransferitemlist.h - the GWebTransferItemListIface.
  8. gwebwidget.h - contains the engine widget callback prototypes.

The "Implementation library" headers must not be used in an EAL based application directly.

7. Language

Object-oriented C based on the GObject and GTypeInterface concepts.

Class Interfaces

The EAL Library introduces following class interfaces:

1. GWebIface

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.

2. GWebEngineIface

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.

3. GWebHistoryListIface

GWebHistoryListIface - a list of browsing history objects per engine widget. Used for implementing the "back/forward" functionality.

4. GWebPluginListIface

GWebPluginListIface - a list of installed plugins. This list is an application wide object.

5. GWebTransferItemIface

GWebTransferItemIface represents a download item. The application should set object specific callbacks to be able to control downloading.

6. GWebTransferItemListIface

GWebTransferItemListIface - a list of download items. This list is an application wide object.

Future development

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  doxygen 1.5.1