A place in a document where pictures occure is called a graphics
frame. The first node in the frame is a
box item node with a $Graphics ItemClass. Such and item node has the following structure:
item.next --Ref to next node at this level. Probably the following paragraph
item.date --frame related data
item.contents --Ref to objects in the frame. Usually basic nodes. May be items or branches.
Contents
The contents field of a graphics frame points to a tree of nodes. Basic nodes are graphics objects such as paths, images, and clipping regions. Basic nodes may be nested. Basic nodes have the following structure:
basic.next --Ref to next node at this level. Another object in the frame
basic.contents --Ref to "children" of this basic node, if any
basic.data --actual representation for the graphics
The basic.data for all objects includes a bounding box and a transformation. All objects are defined relative to their bounding box.
I can think of the following basic classes. This will undoubtedly expand as I work on this project
Simple objects: paths, images, and clipping regions. Data is primitive types, contents is NIL.
Symbols: nested objects. Data is list of instances, contents is objects in the symbol
Symbol instances: Contents is NIL. Data is a ref to a symbol
The contents of a graphics frame may include text items. I assume that text may include branches, so I should deal with that as well.