gtk-css-engine 与 svg-theme-engine 对比
作者: Robert Staudinger
日期: 2008-10-09
本文来自 gtk-devel 邮件列表,gkt-css-engine 的作者总结了两个主题引擎 (gtk-css-engine 与 svg-theme-engine) 的不同。

简介

关于 GTK+ 的主题引擎 (theme engine),目前有 gtk-css-engine ,基于 CSS 的主题引擎;还有一个是 SVG theme engine,基于 SVG 的主题 引擎,它们有什么区别呢,看看 gtk-css-engine 的作者 Robert Staudinger 的描述。

两个引擎的对比

The Manju project (svg theme engine) aims at creating graphical widget toolkit themes from SVG files in a toolkit independent fashion. It combines the idea of a pixmap theme engine, Jimmac's "One Canvas Workflow", SVG markup features and Inkscape export functionality to fully automate the creation of a scalable and stretchable pixmap theme from an SVG source.

AFAIK Manju is generating a binary theme package [2, 3], from a single SVG file. There is a naming spec for svg elements in place 4, so the package generation tool can create PNGs from the theme components.

The CSS engine was born out of desire for a more powerful non-code theming approach. There is a small enhancement patch against librsvg in the works, once that's in it's just as well possible to design themes in a single SVG canvas. Manju is exporting theme parts at specific sizes to avoid ugly scaling effects, this is not needed in the CSS engine because it relies on CSS-defined borders and will support border-images 5 in the future.

Unlike manju, "GCE" (the gtk-css-engine) did initially focus on delivering a gtk-oriented solution, but work is now underway to add support for clutter and clutter's "Tidy" toolkit to the spun-off "libccss" 6.

To the best of my knowledge it is not yet possible to use a manu-based theme, there is no engine yet. On the other hand it is very well possible to test CSS engine themes in "TheWidgetFactory" 7, the upcoming release will be usable desktop wide.

It would probably be possible to use manju-created themes with GCE, either by changing manju's theme creation process, or by changing the way how themes are loaded in GCE, but I do currently not see any advantage in using a binary theme package. On the contrary, the "CSS-with-single-pixmaps/SVGs" approach lends itself very well to rapid protoyping.

Resources

1. http://labs.imendio.com/?p=21

2. http://groups.google.com/group/manju-project/browse_thread/thread/2a93dbe94e40e1ec

3. http://pages.testbit.eu/manju/package-spec.html

4. http://pages.testbit.eu/manju/theme-spec.html

5. http://ejohn.org/blog/border-image-in-firefox

6. http://lists.o-hand.com/clutter/1904.html

7. http://www.stellingwerff.com/?page_id=10