org.extex.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: 6354 $
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 bop, 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 id, 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

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

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

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

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

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 - length of the font area
s - length of the font name
d - the font area
n - the name of the font

nop

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

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

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

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

post

void post(int off,
          int bop,
          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
bop - the index of the last BOP instruction
num - the numerator
den - the denominator
mag - the magnification
l - the maximum page height
u - the maximum page width
sp - stack depth
tp - number of pages

postPost

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

void pre(int off,
         int id,
         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
id - the id of this DVI version. Usually this is 2.
num - the numerator
den - the denominator
mag - the magnification in permille
comment - the comment string

push

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

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

putChar

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

v ← v + z

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