Canvas

From Apache OpenOffice Wiki
Revision as of 22:37, 3 March 2008 by Thorsten (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Introduction

Starting for OOo 2.0, the Canvas effort tries to modernize OOo's graphical output layer - its predecessor, VCL's OutputDevice, carries the burden of being designed as a shallow wrapper around Win16 GDI. Back in the day, everything was integer coordinates, bezier curves didn't exist, nor a notion of alpha.

In contrast, the Canvas offers a contemporary set of features useful for rendering application content, including ubiquituous alpha, floating point coordinates, texturing, and advanced text layouting facilities. Where VCL OutputDevice is a concrete class (without any virtual methods), the Canvas consists of a set of UNO interfaces grouped around the central com::sun::star::rendering::XCanvas interface.

The future rendering framework in OpenOffice.org (OOo) is UNO XCanvas rendering framework. The benefits include a well designed API (easier to port, easier to use) and a more strong isolation of the API from the rest of the OOo (One of the big problems of the current VCL is that also the internals of the VCL are used from many places in the OOo code).

To facilitate easier migration, one of the OOo XCanvas API implementations is based on VCL. This means that once the VCL part of OOo has been ported, also the XCanvas API works for that platform. This approach has made it possible to start the conversion from VCL to XCanvas, even though some of the non-VCL XCanvas implementations are missing.

Canvas_architecture.png

XCanvas is part of bigger module in OpenOffice, called Drawing Layer. There is initiative to improve the whole module: Drawing Layer/Drawing Primitives

For XCanvas information, see presentations at OOoCon 2006 (PDF, ODP, video/ogg) and OOoCon 2005 (PDF)

Of the OOo applications using VCL, currently (September 2006) OOo Impress slideshow has been converted to XCanvas, with prototypes working in Draw and Impress. Future work will include converting Calc and Writer.

Personal tools