|
Ipelib
|
#include <ipecairopainter.h>
Inherits ipe::Painter.
Inherited by JsonPainter.
Classes | |
| struct | PdfState |
Public Member Functions | |
| CairoPainter (const Cascade *sheet, Fonts *fonts, cairo_t *cc, double zoom, bool pretty, bool filterBest) | |
| virtual | ~CairoPainter () |
| void | setDimmed (bool dim) |
| void | executeStream (const PdfDict *stream, const PdfDict *resources) |
| bool | type3Font () const |
Public Member Functions inherited from ipe::Painter | |
| Painter (const Cascade *style) | |
| virtual | ~Painter () |
| void | setAttributeMap (const AttributeMap *map) |
| Attribute | lookup (Kind kind, Attribute sym) const |
| void | setBitmapCache (BitmapCache *bmc) |
| void | transform (const Matrix &m) |
| void | untransform (TTransformations trans) |
| void | translate (const Vector &v) |
| void | push () |
| void | pop () |
| void | pushMatrix () |
| void | popMatrix () |
| void | newPath () |
| void | moveTo (const Vector &v) |
| void | lineTo (const Vector &v) |
| void | curveTo (const Vector &v1, const Vector &v2, const Vector &v3) |
| void | curveTo (const Bezier &bezier) |
| void | rect (const Rect &re) |
| void | drawEllipse () |
| void | drawArc (const Arc &arc) |
| void | closePath () |
| void | drawPath (TPathMode mode) |
| void | drawBitmap (Bitmap bitmap) |
| void | drawExternalBitmap (String path) |
| void | drawText (const Text *text) |
| void | drawSymbol (Attribute symbol) |
| void | addClipPath () |
| void | setStroke (Attribute color) |
| void | setFill (Attribute color) |
| void | setPen (Attribute pen) |
| void | setDashStyle (Attribute dash) |
| void | setLineCap (TLineCap cap) |
| void | setLineJoin (TLineJoin join) |
| void | setFillRule (TFillRule rule) |
| void | setSymStroke (Attribute color) |
| void | setSymFill (Attribute color) |
| void | setSymPen (Attribute wid) |
| void | setOpacity (Attribute opaq) |
| void | setStrokeOpacity (Attribute opaq) |
| void | setTiling (Attribute til) |
| void | setGradient (Attribute grad) |
| void | setStrokeGradient (Attribute grad) |
| const Cascade * | cascade () const |
| Color | stroke () const |
| Color | fill () const |
| const Matrix & | matrix () const |
| Fixed | pen () const |
| String | dashStyle () const |
| void | dashStyle (std::vector< double > &dashes, double &offset) const |
| TLineCap | lineCap () const |
| TLineJoin | lineJoin () const |
| TFillRule | fillRule () const |
| Color | symStroke () const |
| Color | symFill () const |
| Fixed | symPen () const |
| Fixed | opacity () const |
| Fixed | strokeOpacity () const |
| Attribute | tiling () const |
| Attribute | gradient () const |
| Attribute | strokeGradient () const |
| const State & | state () const |
| void | setState (const State &state) |
Protected Member Functions | |
| virtual void | doPush () override |
| virtual void | doPop () override |
| virtual void | doMoveTo (const Vector &v) override |
| virtual void | doLineTo (const Vector &v) override |
| virtual void | doCurveTo (const Vector &v1, const Vector &v2, const Vector &v3) override |
| virtual void | doClosePath () override |
| virtual void | doDrawArc (const Arc &arc) override |
| virtual void | doAddClipPath () override |
| virtual void | doDrawPath (TPathMode mode) override |
| virtual void | doDrawBitmap (Bitmap bitmap) override |
| virtual void | doDrawText (const Text *text) override |
| virtual void | drawGlyphs (std::vector< cairo_glyph_t > &glyphs) |
| const PdfDict * | findResource (String kind, String name) |
| void | collectGlyphs (String s, std::vector< cairo_glyph_t > &glyphs, Vector &textPos) |
| void | execute (const PdfDict *stream, const PdfDict *resources, bool applyMatrix=true) |
| void | clearArgs () |
| void | opcm () |
| void | opBT () |
| void | opET () |
| void | opTf () |
| void | opTm () |
| void | opTd (bool setLeading) |
| void | opTstar () |
| void | opTc (double *p) |
| void | opTz () |
| void | opTJ () |
| void | opTj (bool nextLine, bool setSpacing) |
| void | opk (bool stroke) |
| void | opg (bool stroke) |
| void | oprg (bool stroke) |
| void | opscn (bool stroke) |
| void | opw () |
| void | opd () |
| void | opDo () |
| void | opi () |
| void | opj () |
| void | opJ () |
| void | opM () |
| void | opW (bool eofill) |
| void | opgs () |
| void | opm () |
| void | opl () |
| void | opc () |
| void | opy () |
| void | opv () |
| void | oph () |
| void | opq () |
| void | opQ () |
| void | opre () |
| void | opn () |
| virtual void | opStrokeFill (bool close, bool fill, bool stroke, bool eofill) |
| void | opsh () |
| void | createPattern () |
| void | setGradientPattern (const Gradient *g, double opacity) |
Protected Member Functions inherited from ipe::Painter | |
| virtual void | doNewPath () |
| virtual void | doDrawSymbol (Attribute symbol) |
| void | drawArcAsBezier (double alpha) |
Static Protected Member Functions | |
| static void | cairoMatrix (cairo_matrix_t &cm, const Matrix &m) |
| static void | cairoTransform (cairo_t *cr, const Matrix &m) |
| static void | drawImage (cairo_t *cr, const PdfDict *d, const PdfResourceBase *r, double opacity, bool filterBest) |
Protected Attributes | |
| Fonts * | iFonts |
| cairo_t * | iCairo |
| double | iZoom |
| bool | iPretty |
| bool | iDimmed |
| bool | iAfterMoveTo |
| bool | iFilterBest |
| bool | iType3Font |
| std::vector< const PdfObj * > | iArgs |
| std::vector< const PdfDict * > | iResourceStack |
| std::vector< PdfState > | iPdfState |
| Matrix | iTextMatrix |
| Matrix | iTextLineMatrix |
Protected Attributes inherited from ipe::Painter | |
| std::list< State > | iState |
| std::list< Matrix > | iMatrix |
| const Cascade * | iCascade |
| const AttributeMap * | iAttributeMap |
| BitmapCache * | iBitmapCache |
| int | iInPath |
Ipe Painter using Cairo and Freetype as a backend.
This painter draws to a Cairo surface.
|
inlinevirtual |
|
inline |
References iDimmed.
Referenced by ipe::CanvasBase::drawObjects().
References cairoTransform(), execute(), iCairo, ipe::CairoPainter::PdfState::iCharacterSpacing, ipe::CairoPainter::PdfState::iFillOpacity, ipe::CairoPainter::PdfState::iFillRgb, ipe::CairoPainter::PdfState::iFont, ipe::CairoPainter::PdfState::iHorizontalScaling, ipe::CairoPainter::PdfState::iLeading, iPdfState, ipe::CairoPainter::PdfState::iStrokeOpacity, ipe::CairoPainter::PdfState::iStrokeRgb, ipe::CairoPainter::PdfState::iTextRise, ipe::CairoPainter::PdfState::iWordSpacing, ipe::Painter::matrix(), ipe::Painter::opacity(), and ipe::Fixed::toDouble().
Referenced by doDrawText(), ipe::PdfViewBase::refreshSurface(), and ipe::PdfThumbnail::render().
|
inline |
References iType3Font.
Referenced by ipe::CanvasBase::drawObjects().
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
Perform moveto operator.
The transformation matrix has already been applied.
Reimplemented from ipe::Painter.
References iAfterMoveTo, iCairo, ipe::Vector::x, and ipe::Vector::y.
|
overrideprotectedvirtual |
Perform lineto operator.
The transformation matrix has already been applied.
Reimplemented from ipe::Painter.
References iAfterMoveTo, iCairo, ipe::Vector::x, and ipe::Vector::y.
|
overrideprotectedvirtual |
Perform curveto operator.
The transformation matrix has already been applied.
Reimplemented from ipe::Painter.
References iAfterMoveTo, iCairo, ipe::Vector::x, and ipe::Vector::y.
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
Draw an elliptic arc.
The default implementations calls drawArcAsBezier(). The transformation matrix has not yet been applied to arc.
Reimplemented from ipe::Painter.
References cairoTransform(), iAfterMoveTo, ipe::Arc::iAlpha, ipe::Arc::iBeta, iCairo, ipe::Arc::iM, ipe::Arc::isEllipse(), and ipe::Painter::matrix().
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
Actually draw the path.
Reimplemented from ipe::Painter.
References ipe::Painter::cascade(), ipe::Painter::dashStyle(), ipe::EBevelJoin, ipe::EButtCap, ipe::EDefaultCap, ipe::EDefaultJoin, ipe::EEvenOddRule, ipe::EMiterJoin, ipe::ERoundCap, ipe::ERoundJoin, ipe::ESquareCap, ipe::EStrokedAndFilled, ipe::Painter::fill(), ipe::Painter::fillRule(), ipe::Cascade::findGradient(), ipe::Cascade::findTiling(), ipe::Painter::gradient(), ipe::Color::iBlue, iCairo, iFilterBest, ipe::Color::iGreen, ipe::Color::iRed, ipe::Attribute::isNormal(), ipe::Painter::lineCap(), ipe::Painter::lineJoin(), ipe::Painter::opacity(), ipe::Painter::pen(), setGradientPattern(), ipe::Painter::stroke(), ipe::Painter::strokeGradient(), ipe::Painter::strokeOpacity(), ipe::Painter::tiling(), and ipe::Fixed::toDouble().
|
overrideprotectedvirtual |
Draw a bitmap.
Reimplemented from ipe::Painter.
References cairoTransform(), ipe::Buffer::data(), ipe::Bitmap::height(), iCairo, iFilterBest, ipe::Painter::matrix(), ipe::Painter::opacity(), ipe::Bitmap::pixelData(), ipe::Buffer::size(), and ipe::Bitmap::width().
|
overrideprotectedvirtual |
Draw a text object.
Reimplemented from ipe::Painter.
References ipe::Text::align(), executeStream(), ipe::String::find(), findResource(), ipe::Text::getXForm(), ipe::Color::iBlue, iCairo, iDimmed, iFonts, ipe::Color::iGreen, ipe::Text::XForm::iName, iPretty, ipe::Color::iRed, ipe::Text::XForm::iStretch, ipe::Text::XForm::iTranslation, iZoom, ipe::String::left(), ipe::Painter::matrix(), ipe::Painter::opacity(), ipe::Fonts::screenFont(), ipe::String::size(), ipe::Painter::stroke(), ipe::Text::text(), ipe::Fixed::toDouble(), ipe::Text::totalHeight(), ipe::Painter::transform(), ipe::Painter::translate(), ipe::Matrix::translation(), ipe::Text::width(), ipe::Vector::x, ipe::Vector::y, ipe::String::z(), and ipe::Vector::ZERO.
|
protectedvirtual |
Draw a glyph.
Glyph is drawn with hotspot at position pos.
References ipe::Face::cairoFont(), cairoMatrix(), iCairo, ipe::CairoPainter::PdfState::iFillOpacity, ipe::CairoPainter::PdfState::iFillRgb, ipe::CairoPainter::PdfState::iFont, ipe::CairoPainter::PdfState::iFontSize, ipe::CairoPainter::PdfState::iHorizontalScaling, iPdfState, ipe::IPE_PI, iTextMatrix, ipe::CairoPainter::PdfState::iTextRise, ipe::Painter::matrix(), ipe::Fonts::screenFont(), ipe::size(), ipe::Face::type(), and ipe::Type3.
References ipe::PdfResourceBase::findResource(), iFonts, iResourceStack, and ipe::Fonts::resources().
Referenced by createPattern(), doDrawText(), opDo(), opgs(), opsh(), and opTf().
|
protected |
References ipe::CIDType0, ipe::CIDType2, ipe::Face::glyphIndex(), ipe::CairoPainter::PdfState::iCharacterSpacing, ipe::CairoPainter::PdfState::iFont, ipe::CairoPainter::PdfState::iFontSize, ipe::CairoPainter::PdfState::iHorizontalScaling, iPdfState, iTextMatrix, ipe::CairoPainter::PdfState::iWordSpacing, ipe::Matrix::linear(), ipe::String::size(), ipe::Face::type(), ipe::Face::width(), ipe::Vector::x, and ipe::Vector::y.
|
protected |
References ipe::Matrix::a, cairoTransform(), ipe::Painter::cascade(), clearArgs(), ipe::PdfToken::EOp, ipe::PdfParser::eos(), ipe::PdfDict::get(), ipe::PdfDict::getNumberArray(), ipe::PdfParser::getObject(), ipe::PdfParser::getToken(), iArgs, iCairo, ipe::PdfDict::inflate(), iPdfState, iResourceStack, ipe::PdfToken::iString, ipe::PdfToken::iType, opBT(), opc(), opcm(), opd(), opDo(), opET(), opg(), opgs(), oph(), opi(), opj(), opJ(), opk(), opl(), opM(), opm(), opn(), opq(), opQ(), opre(), oprg(), opscn(), opsh(), opStrokeFill(), opTc(), opTd(), opTf(), opTJ(), opTj(), opTm(), opTstar(), opTz(), opv(), opw(), opW(), opy(), ipe::PdfParser::token(), ipe::Vector::x, and ipe::String::z().
Referenced by createPattern(), executeStream(), and opDo().
|
protected |
|
protected |
References ipe::Matrix::a, cairoTransform(), iArgs, and iCairo.
Referenced by execute().
|
protected |
References iTextLineMatrix, and iTextMatrix.
Referenced by execute().
|
protected |
Referenced by execute().
|
protected |
References findResource(), ipe::Fonts::getFace(), iArgs, iFonts, iPdfState, iType3Font, ipe::Face::type(), and ipe::Type3.
Referenced by execute().
|
protected |
References ipe::Matrix::a, iArgs, iTextLineMatrix, and iTextMatrix.
Referenced by execute().
|
protected |
References iArgs, iPdfState, iTextLineMatrix, iTextMatrix, and ipe::Vector::y.
Referenced by execute().
|
protected |
References iArgs, iPdfState, iTextLineMatrix, and iTextMatrix.
Referenced by execute().
|
protected |
References ipe::PdfObj::array(), collectGlyphs(), ipe::PdfString::decode(), drawGlyphs(), iArgs, ipe::CairoPainter::PdfState::iFont, ipe::CairoPainter::PdfState::iFontSize, ipe::CairoPainter::PdfState::iHorizontalScaling, iPdfState, iTextMatrix, ipe::PdfObj::number(), ipe::PdfArray::obj(), ipe::PdfObj::string(), ipe::PdfNumber::value(), and ipe::Vector::x.
Referenced by execute().
|
protected |
|
protected |
References iArgs, iPdfState, and ipe::Painter::stroke().
Referenced by execute().
|
protected |
References iArgs, iPdfState, and ipe::Painter::stroke().
Referenced by execute().
|
protected |
References iArgs, iPdfState, and ipe::Painter::stroke().
Referenced by execute().
|
protected |
References iArgs, iPdfState, ipe::Painter::stroke(), and ipe::String::z().
Referenced by execute().
|
protected |
References ipe::PdfObj::array(), iArgs, iCairo, ipe::PdfObj::number(), ipe::PdfArray::obj(), and ipe::PdfNumber::value().
Referenced by execute().
|
protected |
References drawImage(), execute(), findResource(), ipe::PdfDict::get(), iArgs, iCairo, iFilterBest, iFonts, iPdfState, ipe::PdfObj::name(), ipe::Fonts::resources(), ipe::PdfName::value(), and ipe::String::z().
Referenced by execute().
|
protected |
References ipe::PdfDict::count(), findResource(), iArgs, iPdfState, ipe::PdfDict::key(), ipe::PdfObj::number(), ipe::PdfObj::repr(), ipe::PdfNumber::value(), ipe::PdfDict::value(), and ipe::String::z().
Referenced by execute().
|
protected |
References iArgs, iCairo, ipe::Vector::x, and ipe::Vector::y.
Referenced by execute().
|
protected |
References iArgs, iCairo, ipe::Vector::x, and ipe::Vector::y.
Referenced by execute().
|
protected |
References iArgs, iCairo, ipe::Vector::x, and ipe::Vector::y.
Referenced by execute().
|
protected |
References iArgs, iCairo, ipe::Vector::x, and ipe::Vector::y.
Referenced by execute().
|
protected |
References iArgs, iCairo, ipe::Vector::x, and ipe::Vector::y.
Referenced by execute().
|
protected |
|
protected |
|
protected |
References iArgs, iCairo, ipe::Vector::x, and ipe::Vector::y.
Referenced by execute().
|
protectedvirtual |
References createPattern(), ipe::String::empty(), ipe::Painter::fill(), iCairo, ipe::CairoPainter::PdfState::iFillOpacity, ipe::CairoPainter::PdfState::iFillPattern, ipe::CairoPainter::PdfState::iFillRgb, iPdfState, ipe::CairoPainter::PdfState::iStrokeOpacity, ipe::CairoPainter::PdfState::iStrokeRgb, and ipe::Painter::stroke().
Referenced by execute().
|
protected |
References findResource(), iArgs, iCairo, iFonts, and ipe::Fonts::resources().
Referenced by execute().
|
protected |
References ipe::Matrix::a, cairoMatrix(), execute(), findResource(), ipe::PdfDict::get(), ipe::PdfDict::getInteger(), ipe::PdfDict::getNumber(), ipe::PdfDict::getNumberArray(), iCairo, ipe::Painter::iCascade, ipe::CairoPainter::PdfState::iCharacterSpacing, ipe::CairoPainter::PdfState::iFillOpacity, ipe::CairoPainter::PdfState::iFillRgb, ipe::CairoPainter::PdfState::iFont, iFonts, ipe::CairoPainter::PdfState::iHorizontalScaling, ipe::CairoPainter::PdfState::iLeading, ipe::Matrix::inverse(), iPdfState, ipe::CairoPainter::PdfState::iStrokeOpacity, ipe::CairoPainter::PdfState::iStrokeRgb, ipe::CairoPainter::PdfState::iTextRise, and ipe::CairoPainter::PdfState::iWordSpacing.
Referenced by opStrokeFill().
|
protected |
References cairoMatrix(), ipe::Gradient::ERadial, iCairo, ipe::Gradient::iExtend, ipe::Gradient::iMatrix, ipe::Gradient::iRadius, ipe::Gradient::iStops, ipe::Gradient::iType, ipe::Gradient::iV, ipe::Painter::matrix(), ipe::Painter::opacity(), ipe::Vector::x, and ipe::Vector::y.
Referenced by doDrawPath().
|
staticprotected |
References ipe::Matrix::a.
Referenced by cairoTransform(), createPattern(), drawGlyphs(), and setGradientPattern().
|
staticprotected |
References cairoMatrix().
Referenced by doDrawArc(), doDrawBitmap(), drawImage(), execute(), executeStream(), and opcm().
|
staticprotected |
References cairoTransform(), ipe::Buffer::data(), ipe::PdfObj::dict(), ipe::PdfDict::dictRepr(), ipe::PdfDict::get(), ipe::PdfResourceBase::getDict(), ipe::PdfDict::getInteger(), ipe::PdfDict::getNumberArray(), ipe::PdfDict::inflate(), ipe::PdfObj::name(), ipe::Painter::opacity(), ipe::Buffer::size(), ipe::size(), ipe::PdfName::value(), and ipe::String::z().
Referenced by opDo().
|
protected |
Referenced by createPattern(), doDrawText(), findResource(), opDo(), opsh(), and opTf().
|
protected |
Referenced by createPattern(), doAddClipPath(), doClosePath(), doCurveTo(), doDrawArc(), doDrawBitmap(), doDrawPath(), doDrawText(), doLineTo(), doMoveTo(), doPop(), doPush(), drawGlyphs(), execute(), executeStream(), opc(), opcm(), opd(), opDo(), oph(), opj(), opJ(), opl(), opM(), opm(), opn(), opq(), opQ(), opre(), opsh(), opStrokeFill(), opv(), opw(), opW(), opy(), and setGradientPattern().
|
protected |
Referenced by doDrawText().
|
protected |
Referenced by doDrawText().
|
protected |
Referenced by CairoPainter(), doDrawText(), and setDimmed().
|
protected |
Referenced by doCurveTo(), doDrawArc(), doLineTo(), and doMoveTo().
|
protected |
Referenced by doDrawBitmap(), doDrawPath(), and opDo().
|
protected |
Referenced by opTf(), and type3Font().
|
protected |
|
protected |
Referenced by execute(), and findResource().
|
protected |
Referenced by collectGlyphs(), createPattern(), drawGlyphs(), execute(), executeStream(), opDo(), opg(), opgs(), opk(), opq(), opQ(), oprg(), opscn(), opStrokeFill(), opTd(), opTf(), opTJ(), opTj(), opTstar(), and opTz().
|
protected |
Referenced by collectGlyphs(), drawGlyphs(), opBT(), opTd(), opTJ(), opTj(), opTm(), and opTstar().
|
protected |