Mnemonic GTK-- based XML+CSS rendering
General Info

Introduction
Screenshots
Mailing Lists and IRC
Alternative Browsers
Special Thanks

FAQ
Understanding Mnemonic
TODO list and ideas
Bug Reports


User Info

Download binaries
Platforms
Compiling Mnemonic
Other useful software


Developer Info

Core
Message modules
Library modules
Object modules
Coding Guidelines
Browse Source
Using CVS


View with any browser

Website questions to:
webmaster@mnemonic.org

Mnemonic questions to:
disc@mnemonic.org

 

Overview

The gtkdisplay oil turns messages originating from the xml/html parser into lib-gtklayout objects (at some point, we should rename this to oil-gtkw3display since we will also need oils that display other structured data).

This is the place that contains the logic which maps css concepts (like `block boxes' or `floating boxes') to the box structures provided by lib-gtklayout.

From CSS to lib-layout

The CSS box model is a bit odd, having evolved from a rather braindead model to start with. The conversion to the conceptually simpler lib-layout box model works as follows.

All css inline boxes always have to be formatted into parboxes. Therefore, whenever a css inline box is encountered and the parent lib-layout box is not a parbox, we automatically insert a parbox.

Block boxes are by default always converted to vboxes. The previous rule ensures that paragraph wrapping occurs as required.

Horizontal margins (left/right) are taken care of by wrapping the box in an hbox and adding glue to the left or the right. Similarly for vertical margins (top/bottom). For collapsing margins between boxes boxes inside a vbox, glue is adjusted appropriately.

Properties of boxes that only affect the visual style, not the layout (for instance boxes which change the font settings) are converted to lib-gtklayout boxes which have their `ignore_geometry' flag set. Boxes that are defined as css inline and have such properties set are mapped to two lib-gtklayout boxes: one for the style and one for the geometry. (We will have to think about the one remaining issue: borders around boxes that are wrapped. But this is typographically so ugly that we might as well forget about that altogether).