Getting (web)kitted out

Phil Booth's picture

This week I am making a start on bringing WebKit into LibRender, the rendering component of Sidewinder. When I'm finished, this will leave our reliance on Microsoft's XML parser as the last remaining hurdle before we can start porting Sidewinder to other platforms. The prospect of finally addressing these two tasks is something that I'm rather excited about.

Some key objectives in the design of LibRender were:

  • It should enable dynamic detection and selection of different rendering engines;
  • It should provide a common, agnostic interface to those different engines;
  • Adding support for new rendering engines should be a simple task.

To satisfy these requirements, two classes were written: CRenderer and CRendererFactory. CRenderer is an abstract base class that defines the common interface used to control each rendering engine. CRendererFactory is the class that provides methods for cross-platform detection and instantiation of available engines. Completing the task in hand, then, is simply a matter of deriving a new WebKit-specific class from CRenderer and adding correlating logic to CRendererFactory.

Unfortunately, at the time of writing, the API documentation for WebKit contains one or two omissions (in fact it reads, in its entirety: "Needs to be written."). But the code itself looks pretty straightforward so I'm not anticipating much trouble. Hopefully, a WebKit-enabled release of Sidewinder should be available next week.