pdfobjects::StateUpdater Class Reference

#include <stateupdater.h>

List of all members.

Classes

struct  CheckTypes

Static Public Member Functions

static GfxState * unknownUpdate (GfxState *state, boost::shared_ptr< GfxResources >, const boost::shared_ptr< PdfOperator >, const PdfOperator::Operands &, BBox *rc)
static const CheckTypesfindOp (const std::string &name)
static std::string getEndTag (const std::string &name)
template<typename Ftor >
static boost::shared_ptr
< GfxState > 
updatePdfOperators (PdfOperator::Iterator it, boost::shared_ptr< GfxResources > res, GfxState &state, Ftor ftor)
static GfxState * printTextUpdate (GfxState *state, const std::string &txt, BBox *rc)

Static Protected Attributes

static CheckTypes KNOWN_OPERATORS []

Private Types

typedef PdfOperator::BBox BBox

Static Private Attributes

static const size_t MAX_OPERANDS = 6
static const size_t MAX_OPERATOR_NAMELEN = 4

Detailed Description

Graphical state updater.

Content stream is a sequence of operations which alter graphical state. We need to obtain some information after each of these operations and xpdf code is no suitable for this sort of things.

If appropriate functions are defined, this mechanism could be used to display the content stream. E.g. we update op*Update functions to call output device.


Member Typedef Documentation


Member Function Documentation

static const CheckTypes* pdfobjects::StateUpdater::findOp ( const std::string &  name  )  [static]

Find operator specification.

Parameters:
name Name of the operator.

Referenced by updatePdfOperators().

static std::string pdfobjects::StateUpdater::getEndTag ( const std::string &  name  )  [static]

Get end tag of an operator.

Parameters:
name Operator name.
Returns:
Operator end tag. Can be empty.
GfxState * pdfobjects::StateUpdater::printTextUpdate ( GfxState *  state,
const std::string &  txt,
BBox rc 
) [static]
GfxState * pdfobjects::StateUpdater::unknownUpdate ( GfxState *  state,
boost::shared_ptr< GfxResources >  ,
const boost::shared_ptr< PdfOperator ,
const PdfOperator::Operands ,
BBox rc 
) [static]

Referenced by updatePdfOperators().

template<typename Ftor >
static boost::shared_ptr<GfxState> pdfobjects::StateUpdater::updatePdfOperators ( PdfOperator::Iterator  it,
boost::shared_ptr< GfxResources >  res,
GfxState &  state,
Ftor  ftor 
) [inline, static]

Update pdf operators.

REMARK: State is not gfx changed in this function. We can not make it const because of the xpdf code.

Parameters:
it Iterator that will be used to traverse all operators.
res Graphical resources.
state Graphical state.
ftor Functor applied after each update.

References pdfobjects::StateUpdater::CheckTypes::argNum, debug::DBG_CRIT, debug::DBG_DBG, findOp(), iterator::DoubleListIterator< Item >::getCurrent(), iterator::DoubleListIterator< Item >::isEnd(), kernelPrintDbg, iterator::DoubleListIterator< Item >::next(), unknownUpdate(), pdfobjects::StateUpdater::CheckTypes::update, and utilsPrintDbg.

Referenced by pdfobjects::CContentStream::CContentStream(), and pdfobjects::CContentStream::reparse().


Member Data Documentation

All known operators from pdf specification and their update functions.

If an operator does not have any effect on graphical state, default update function is used.

Operator number can be either >0, zero, <0. Zero means no operands are needed. >0 means that exact argNum of operands are needed. <0 means that at most argNum operands are needed.

const size_t pdfobjects::StateUpdater::MAX_OPERANDS = 6 [static, private]

Maximum argument count of an operator. See pdf specfication of all operators.

const size_t pdfobjects::StateUpdater::MAX_OPERATOR_NAMELEN = 4 [static, private]

Maximum operator name length. See pdf specification of all operators.


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