dvi2bitmap  dvi2bitmap1.0
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes | List of all members
DviFileEvent Class Reference

Abstracts the contents of a DVI file. More...

#include <DviFile.h>

Inheritance diagram for DviFileEvent:
DviFileFontChange DviFilePage DviFilePostamble DviFilePreamble DviFileSetChar DviFileSetRule DviFileSpecial

Public Types

enum  eventTypes {
  setchar, setrule, fontchange, special,
  page, preamble, postamble
}
 

Public Member Functions

virtual void debug () const
 Writes a representation of this event on cerr. More...
 
eventTypes type () const
 Gets the type of this event. More...
 
const unsigned char opcode () const
 Gets the underlying opcode which produced this event. More...
 
void release ()
 Release this event. More...
 

Static Public Member Functions

static verbosities verbosity (const verbosities level)
 Sets the verbosity for DviFileEvent and its subclasses. More...
 

Protected Member Functions

 DviFileEvent (unsigned char opcode, eventTypes t, DviFile *dp=0)
 Creates a new event. More...
 

Static Protected Attributes

static verbosities verbosity_ = normal
 

Detailed Description

Abstracts the contents of a DVI file.

All the features of a DVI file which calling code might be interested in are represented by one of the subclasses of this, and these are obtained in order by calling the DviFile#getEvent method on DviFile.

The design here is likely to be adjusted in future releases of this library. Although it is possible now, you should avoid constructing any of the subtypes DviFileEvent yourself, but use only those returned to you by DviFile#getEvent.

The documentation here concentrates on how the methods and variables here relate to the underlying quantities obtained from the DVI file. For fuller information on these, see the DVI standard.

Member Enumeration Documentation

Enumerator
setchar 
setrule 
fontchange 
special 
page 
preamble 
postamble 

Constructor & Destructor Documentation

DviFileEvent::DviFileEvent ( unsigned char  opcode,
eventTypes  t,
DviFile dp = 0 
)
protected

Creates a new event.

Parameters
opcodethe DVI opcode which resulted in this event
tthe type of this event
dpthe DviFile it is associated with

Member Function Documentation

void DviFileEvent::debug ( ) const
virtual

Writes a representation of this event on cerr.

Reimplemented in DviFilePreamble, DviFilePage, DviFileSpecial, DviFileFontChange, DviFileSetRule, and DviFileSetChar.

Referenced by main().

const unsigned char DviFileEvent::opcode ( ) const
inline

Gets the underlying opcode which produced this event.

Returns
the opcode
void DviFileEvent::release ( )

Release this event.

Client code which has been given an event by DviFile#getEvent should call this method on that event when it has no further use for it. This releases or reclaims all resources associated with it. This may call delete on the associated object, so the client code should assume that it has done so, and make no further reference to the object.

Referenced by main().

eventTypes DviFileEvent::type ( ) const
inline

Gets the type of this event.

This information can also be obtained in a more object-oriented style by attempting a cast to the appropriate subtype, using, for example, dynamic_cast<DviFileSetChar *>(event_ptr).

Returns
the type
verbosities DviFileEvent::verbosity ( const verbosities  level)
static

Sets the verbosity for DviFileEvent and its subclasses.

Parameters
levelthe desired verbosity
Returns
the old verbosity

References verbosity_.

Referenced by DviFile::verbosity().

Member Data Documentation

verbosities DviFileEvent::verbosity_ = normal
staticprotected

The documentation for this class was generated from the following files: