org.extex.dviware.type
Class DviPostamble

java.lang.Object
  extended by org.extex.dviware.type.AbstractDviCode
      extended by org.extex.dviware.type.DviPostamble
All Implemented Interfaces:
DviCode

public class DviPostamble
extends AbstractDviCode

This class represents the DVI instruction post and the contents up to the terminating post_post.

Version:
$Revision:4704 $
Author:
Gerd Neugebauer

Field Summary
 
Fields inherited from class org.extex.dviware.type.AbstractDviCode
ONE_BYTE_MASK, THREE_BYTE_MASK, TWO_BYTE_MASK
 
Fields inherited from interface org.extex.dviware.type.DviCode
POP, PUSH, W0, X0, Y0, Z0
 
Constructor Summary
DviPostamble(int mag)
          Creates a new object.
 
Method Summary
 int mapFont(Font fnt, java.util.List<DviCode> list)
          Determine the font index and insert a font definition into the output list if required.
 void recognizePage(FixedDimen height, FixedDimen depth, FixedDimen width, int stacksize)
          See a page and remember everything needed to be written out at the end.
 void setBop(int bopPointer)
          Setter for the bop index.
 void setOffset(int pointer)
          Setter for the offset of the last bop instruction.
 int write(java.io.OutputStream stream)
          Write the code to the output stream.
 
Methods inherited from class org.extex.dviware.type.AbstractDviCode
getName, opcode, opcodeSigned, variant, write2, write3, write4
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DviPostamble

public DviPostamble(int mag)
Creates a new object.

Parameters:
mag - the magnification factor in permille
Method Detail

mapFont

public int mapFont(Font fnt,
                   java.util.List<DviCode> list)
Determine the font index and insert a font definition into the output list if required. As a side effect the font is remembered for writing the postamble.

Parameters:
fnt - the font to resolve
list - the list to add the font definition to
Returns:
the index in the font table to use

recognizePage

public void recognizePage(FixedDimen height,
                          FixedDimen depth,
                          FixedDimen width,
                          int stacksize)
See a page and remember everything needed to be written out at the end.

Parameters:
height - the height of the page
depth - the depth of the page
width - the width of the page
stacksize - the stack size needed to process the push and pop operations of the current page

setBop

public void setBop(int bopPointer)
Setter for the bop index.

Parameters:
bopPointer - the pointer to the last BOP

setOffset

public void setOffset(int pointer)
Setter for the offset of the last bop instruction.

Parameters:
pointer - the offset for the last bop instruction

write

public int write(java.io.OutputStream stream)
          throws java.io.IOException
Write the code to the output stream.

Parameters:
stream - the target stream
Returns:
the number of bytes actually written
Throws:
java.io.IOException - in case of an error
See Also:
DviCode.write(java.io.OutputStream)