Internals - Presentation Modules

# Presentation Modules

## Generating a Graphic Object

This document describes the methods provided for presentation a graphic object to the user. The implementation in the Library is made for a text oriented browser, so more advanced GUI clients must overwrite some of these modules. See more information on which modules to overwrite. As mentioned in the how to get started guide, the definition of a graphic object is free for the application. Some graphic objects work by storing the whole document. Others work by converting the nested structure into a linear sequence of styled text for display.

Generally, a new platform has a new implementation of the hypertext object. A GUI client must overwrite the graphic object modules in the Library in order to take advantage of a more advanced user-interface. The graphic object as defined in the Library has two interfaces, depending on how much of the Library code the client wants to handle on its own:

SGML Level
  If the client has its own HTML parser then the interface is between the client HTML parser and the Library SGML parser. The SGML parser is a general SGML parser which can be setup with a specific DTD and it feeds the HTML parser with structured data. In this case, you will be emulating the HTML module, and generating a hypertext object from the structured stream. The actual structured stream definition is in the SGML module.
HTML Level
  If the client wants to use the HTML parser in the Library then this is the second interface to the Library. The hypertext object is parsed and the communication with the client is based on a set of call-back functions in the HTML parser. The call-back functions are all defined as prototypes in the HText module but the client must provide the actual code that defines the presentation method used for a specific HTML tag. If you wish to maintain the structure of the SGML file within your object, then the SGML interface will be a better place to connect your code.

You are free to define the structure of the hypertext object declared in the HText module. You may want to define your own styles and font definitions.