de.dante.dviware
Interface DviProcessor

All Known Implementing Classes:
DviDisassemble

public interface DviProcessor

This interface describes a callback handler for DVI instructions. This refers to an abstract machine which translates the DVI file into some kind of printed representation.

Version:
$Revision: 1.4 $
Author:
Gerd Neugebauer

Method Summary
 void bop(int off, int[] c, int p)
          A DVI bop instruction has been encountered.
 void down(int off, int a)
          A DVI down instruction has been encountered.
 void eop(int off)
          A DVI eop instruction has been encountered.
 void fnt(int off, int k)
          A DVI fnt instruction has been encountered.
 void fntDef(int off, int k, int c, int s, int d, java.lang.String n)
          A DVI fntDef instruction has been encountered.
 void nop(int off)
          A DVI nop instruction has been encountered.
 void pop(int off)
          A DVI pop instruction has been encountered.
 void post(int off, int p, int num, int den, int mag, int l, int u, int sp, int tp)
          A DVI post instruction has been encountered.
 void postPost(int off, int bop, int id)
          Invoke the callback on a POST_POST instruction.
 void pre(int off, int i, int num, int den, int mag, java.lang.String comment)
          A DVI pre instruction has been encountered.
 void push(int off)
          A DVI push instruction has been encountered.
 void putChar(int off, int c)
          A DVI put_char instruction has been encountered.
 void putRule(int off, int a, int b)
          A DVI put_rule instruction has been encountered.
 void right(int off, int b)
          A DVI right instruction has been encountered.
 void setChar(int off, int c)
          A DVI set_char instruction has been encountered.
 void setRule(int off, int a, int b)
          A DVI set_rule instruction has been encountered.
 void undef(int off, int opcode, java.io.InputStream stream)
          A DVI undefined instruction has been encountered.
 void w(int off, int b)
          A DVI w instruction has been encountered.
 void w0(int off)
          A DVI w0 instruction has been encountered.
 void x(int off, int b)
          A DVI x instruction has been encountered.
 void x0(int ptr)
          A DVI x0 instruction has been encountered.
 void xxx(int off, byte[] x)
          A DVI xxx instruction has been encountered.
 void y(int off, int a)
          A DVI y instruction has been encountered.
 void y0(int ptr)
          A DVI y0 instruction has been encountered.
 void z(int off, int b)
          A DVI z instruction has been encountered.
 void z0(int ptr)
          A DVI z0 instruction has been encountered.
 

Method Detail

bop

public void bop(int off,
                int[] c,
                int p)
A DVI bop instruction has been encountered. This instruction signals the beginning of a new page.

Parameters:
off - the current byte position in the input stream
c - the array of page number indicators. The array has length 10. It is initialized from the count registers 0 to 9 at the time the page is shipped out.
p - the pointer to the previous bop instruction or -1 for the first page

down

public void down(int off,
                 int a)
A DVI down instruction has been encountered.

v ← v + ⟨a⟩

Parameters:
off - the current byte position in the input stream
a - the number of DVI units to move down. If negative then the current position moves upwards.

eop

public void eop(int off)
A DVI eop instruction has been encountered. This instruction signals the end of a page.

Parameters:
off - the current byte position in the input stream

fnt

public void fnt(int off,
                int k)
A DVI fnt instruction has been encountered.

f ← ⟨k⟩

Parameters:
off - the current byte position in the input stream
k - the new font number; this number is not negative

fntDef

public void fntDef(int off,
                   int k,
                   int c,
                   int s,
                   int d,
                   java.lang.String n)
A DVI fntDef instruction has been encountered.

Parameters:
off - the current byte position in the input stream
k - the number of the font
c -
s -
d -
n -

nop

public void nop(int off)
A DVI nop instruction has been encountered. This instruction simply does nothing. It just occupies one byte in the input stream.

Parameters:
off - the current byte position in the input stream

pop

public void pop(int off)
A DVI pop instruction has been encountered.

The registers h, b, w, x, y, z are poped from the stack.

Parameters:
off - the current byte position in the input stream

post

public void post(int off,
                 int p,
                 int num,
                 int den,
                 int mag,
                 int l,
                 int u,
                 int sp,
                 int tp)
A DVI post instruction has been encountered.

Parameters:
off - the current byte position in the input stream
p -
num - the numerator
den - the denominator
mag - the magnification
l -
u -
sp -
tp -

postPost

public void postPost(int off,
                     int bop,
                     int id)
Invoke the callback on a POST_POST instruction. This is the last instruction in a DVI file.

Parameters:
off - the offset in the file of this instruction
bop - the index of the last BOP instruction
id - the id of this DVI version. Usually this is 2.

pre

public void pre(int off,
                int i,
                int num,
                int den,
                int mag,
                java.lang.String comment)
A DVI pre instruction has been encountered.

Parameters:
off - the current byte position in the input stream
i -
num -
den -
mag -
comment -

push

public void push(int off)
A DVI push instruction has been encountered.

Parameters:
off - the current byte position in the input stream

putChar

public void putChar(int off,
                    int c)
A DVI put_char instruction has been encountered.

Parameters:
off - the current byte position
c - the number of the character to set

putRule

public void putRule(int off,
                    int a,
                    int b)
A DVI put_rule instruction has been encountered.

Parameters:
off - the current byte position in the input stream
a - the width
b - the height

right

public void right(int off,
                  int b)
A DVI right instruction has been encountered.

h ← h + ⟨b⟩

The argument b is added to the horizontal position h. If b is positive then the horizontal position is moved rightward by the given number of DVI units. If b is negative this means a movement leftwards.

Parameters:
off - the current byte position in the input stream
b - the distance to move in DVI units

setChar

public void setChar(int off,
                    int c)
A DVI set_char instruction has been encountered.

Parameters:
off - the current byte position
c - the number of the character to set

setRule

public void setRule(int off,
                    int a,
                    int b)
A DVI set_rule instruction has been encountered.

Parameters:
off - the current byte position
a - the width
b - the height

undef

public void undef(int off,
                  int opcode,
                  java.io.InputStream stream)
A DVI undefined instruction has been encountered. This callback is invoked for the op-codes 250–255 which are undefined in TeX.

Parameters:
off - the current byte position
opcode - the opcode encountered
stream - the input stream to read further bytes from

w

public void w(int off,
              int b)
A DVI w instruction has been encountered.

The register w is assigned from the parameter of this instruction. Afterwards the register w is added to the horizontal position h.

Parameters:
off - the current byte position in the input stream
b - the distance to add in DVI units

w0

public void w0(int off)
A DVI w0 instruction has been encountered.

h ← h + w

The register w is added to the horizontal position h.

Parameters:
off - the current byte position in the input stream

x

public void x(int off,
              int b)
A DVI x instruction has been encountered.

x ← ⟨b⟩
h ← h + x

Parameters:
off - the current byte position in the input stream
b - the distance to move in DVI units

x0

public void x0(int ptr)
A DVI x0 instruction has been encountered.

h ← h + x

The register x is added to the horizontal position h.

Parameters:
ptr - the current byte position in the input stream

xxx

public void xxx(int off,
                byte[] x)
A DVI xxx instruction has been encountered. This instruction is used to pass some bytes uninterpreted to the DVI processor. In TeX this is accomplished with the primitive \special.

Parameters:
off - the current byte position in the input stream
x - the array of bytes carrying the content

y

public void y(int off,
              int a)
A DVI y instruction has been encountered.

y ← ⟨a⟩
v ← v + y

Parameters:
off - the current byte position in the input stream
a - the distance to move

y0

public void y0(int ptr)
A DVI y0 instruction has been encountered.

Set v ← v + y; thus the current position is moved down y DVI units.

Parameters:
ptr - the current byte position in the input stream

z

public void z(int off,
              int b)
A DVI z instruction has been encountered.

z ← ⟨a⟩
v ← v + z

Parameters:
off - the current byte position in the input stream
b - the distance to move

z0

public void z0(int ptr)
A DVI z0 instruction has been encountered.

v ← v + z

Parameters:
ptr - the current byte position in the input stream