Developers' Guide

Relating XSL to GObjects
FoObject, FoNode
Formatting Object --> FoFo
Formatting Object property --> FoProperty
XSL datatype --> FoDatatype
Other Objects
Rules of the Code
Abbreviations
Compare pointers to NULL
Directory Structure
Directory structure
xmlroff
Anatomy of a Formatting Object header file
Initial comment
Initial housekeeping
GObject typedefs
GObject #defines
GObject functions
Non-property functions
Property functions
Final housekeeping
Anatomy of a Formatting Object C source code file
Abbreviations
Initial comment
#includes
Property enumeration
Static function prototypes
GObject _get_type() function
GObject class initializer
GObject _new()
FoFo _validate_content()
FoFo _validate()
FoFo _update_from_context()
FoFo _debug_dump_properties()
GObject _get() and _set() for properties
Anatomy of a Formatting Object area source code file
Initial comment
#includes
FoFo _area_new2()
Generating Source
Generating Source
Files
Make targets
Debugging xmlroff
Command Line
Using GDB or other debugger
Basic Interface
Overview
Lifecycle
FoLibfoContext
FoDoc and xmlroff Backends
Backends
FoDoc is YAPC (Yet Another PostScript Clone)

Relating XSL to GObjects

Abstract

XSL defines formatting objects and their properties. GObject -- the GLib Object System -- is an object oriented framework for C for where you define objects and their properties. This section is a summary of how formatting objects and their properties map to GOjects and their properties.

FoObject, FoNode

The libfo object hierarchy starts at FoObject, which is an extension of GObject that adds some common debugging and logging functions.

FoNode is a subtype of FoObject that has additional properties and functions for making trees of FoNode objects. FoNode is the parent type of both FoFo and FoArea, since XSL operates in terms of FO and area trees.

Formatting Object --> FoFo

Each XSL formatting object maps to a subtype of the FoFo GObject object type.

Each XSL property of an XSL formatting object maps to a property of the corresponding FoFo subtype.

Functions that return or use formatting object generally use FoFo objects rather than subtypes.

The GObject object type name is "Fo" and the camel-case form of the XSL formatting object name. For example, fo:page-sequence maps to FoPageSequence.

Formatting Object property --> FoProperty

Each XSL property maps to a subtype of the FoProperty GObject object type.

An FoProperty has a value, which is a FoDatatype.

Functions that return or use XSL properties generally use FoProperty objects rather than specific subtypes.

The GObject object type name is "FoProperty" and the camel-case form of the XSL property name. For example, writing-mode maps to FoPropertyWritingMode.

XSL datatype --> FoDatatype

Each XSL dataype maps to a subtype of the FoDatatype GObject object type.

An FoDatatype has a value. The value is set when the FoDatatype is created, and it cannot be changed.

Functions that return or use XSL datatypes generally use FoDatatype objects rather than specific subtypes.

The GObject object type name is the camel-case form of the XSL datatype name. For example, color maps to FoColor.

Other Objects

Other parts of libfo, including FoXslFormatter, are implemented as subtypes of FoObject where it makes sense to do so.