#include <stateupdater.h>
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 CheckTypes * | findOp (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 |
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.
typedef PdfOperator::BBox pdfobjects::StateUpdater::BBox [private] |
| static const CheckTypes* pdfobjects::StateUpdater::findOp | ( | const std::string & | name | ) | [static] |
Find operator specification.
| 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.
| name | Operator name. |
| 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().
| 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.
| 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().
StateUpdater::CheckTypes pdfobjects::StateUpdater::KNOWN_OPERATORS [static, protected] |
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.