[Lazarus] TCairoCanvas integration

petr.kristan at epos.cz petr.kristan at epos.cz
Thu Mar 11 16:27:01 CET 2010


On Thu, Mar 11, 2010 at 03:16:24PM +0100, Mattias Gaertner wrote:
> On Thu, 11 Mar 2010 15:08:57 +0100
> petr.kristan at epos.cz wrote:
> 
> > On Thu, Mar 11, 2010 at 03:01:18PM +0100, Mattias Gaertner wrote:
> [...]
> > > > > > Where is recommeded place for cairocanvas.pas and gdkcairocanvas.pas in
> > > > > > lcl? CairoCanvas can work on Windows, Linux and Mac OS X. 
> > > > > 
> > > > > lcl/interfaces/gtk2
> > > > I think this is good place for gdkcairocanvas.pas. But cairocanvas.pas
> > > > needs only libcairo. It do not needs gtk. 
> > > 
> > > Well, it should be added to the fpc sources, but till this is in a
> > > release we have to add this unit to the lazarus sources too.
> > Ok. 
> > 
> > I place it into lcl/ along poscriptcanvas.pas.
> 
> lcl/ only contains platform independent sources (they must use a
> minimum of external libraries). Platform dependent things should be
> placed in lcl/interfaces/...
> I think that non gtk users won't use cairo, so better place it in
> lcl/interfaces/gtk2.
Windows or MacOSX user can use TCairoCanvas for export to pdf, ps, svg or png.
He only needs libcairo which do not depends on gtk. Dependency is
reversed, libgtk depends on libcairo.

For example Firefox 3 (gecko) uses Cairo on all platforms.

If will be interest we can easily make TWin32CairoCanvas,
TX11CairoCanvas or TQuartzCairoCanvas (OSX) and render on screen.
This should establish quite correct multiplatform WYSIWYG.

I myself think about to use it on Linux/gtk2 and Win32 for screen and
printing in our DTP like project.

But if you still prefer lcl/interfaces/gtk2, I place it there.

Petr

-- 
Petr Kristan
.
EPOS PRO s.r.o., Bozeny Nemcove 2625, 530 02 Pardubice
tel: +420 466335223    Czech Republic (Eastern Europe) 
fax: +420 466510709




More information about the Lazarus mailing list