ipe::CairoPainter Class Reference
Ipe Cairo interface

`#include <ipecairopainter.h>`

Inherits ipe::Painter.

## Public Member Functions

| CairoPainter (const Cascade *sheet, Fonts *fonts, cairo_t *cc, double zoom, bool pretty)
virtual | ~CairoPainter ()
void | setDimmed (bool dim)
Public Member Functions inherited from ipe::Painter
| Painter (const Cascade *style)
virtual | ~Painter ()
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 | 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 | setTiling (Attribute til)
void | setGradient (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
Attribute | tiling () const
Attribute | gradient () const
const State & | state () const
void | setState (const State &state)

## Protected Member Functions

virtual void | doPush ()
virtual void | doPop ()
virtual void | doMoveTo (const Vector &v)
virtual void | doLineTo (const Vector &v)
virtual void | doCurveTo (const Vector &v1, const Vector &v2, const Vector &v3)
virtual void | doClosePath ()
virtual void | doDrawArc (const Arc &arc)
virtual void | doAddClipPath ()
virtual void | doDrawPath (TPathMode mode)
virtual void | doDrawBitmap (Bitmap bitmap)
virtual void | doDrawText (const Text *text)
Protected Member Functions inherited from ipe::Painter
virtual void | doNewPath ()
virtual void | doDrawSymbol (Attribute symbol)
void | drawArcAsBezier (double alpha)

## Additional Inherited Members

Protected Attributes inherited from ipe::Painter
std::list< State > | iState
std::list< Matrix > | iMatrix
const Cascade * | iCascade
int | iInPath

## Detailed Description

Ipe Painter using Cairo and Freetype as a backend.

This painter draws to a Cairo surface.

## Constructor & Destructor Documentation

CairoPainter::CairoPainter | ( | const Cascade * | sheet,
|  | Fonts * | fonts,
|  | cairo_t * | cc,
|  | double | zoom,
|  | bool | pretty
| ) |  |

Construct a painter.

zoom one means 72 pixels per inch. Set pretty to true to avoid drawing text without Latex.

virtual ipe::CairoPainter::~CairoPainter | ( |  | ) |

inline virtual

## Member Function Documentation

void ipe::CairoPainter::setDimmed | ( | bool | dim | ) |

inline

References doAddClipPath(), doClosePath(), doCurveTo(), doDrawArc(), doDrawBitmap(), doDrawPath(), doDrawText(), doLineTo(), doMoveTo(), doPop(), doPush(), ipe::Painter::fill(), and ipe::Painter::stroke().

Referenced by ipe::CanvasBase::drawObjects().

void CairoPainter::doPush | ( |  | ) |

protected virtual

Perform graphics state push on output medium.

Reimplemented from ipe::Painter.

Referenced by setDimmed().

void CairoPainter::doPop | ( |  | ) |

protected virtual

Perform graphics state pop on output medium.

Reimplemented from ipe::Painter.

Referenced by setDimmed().

void CairoPainter::doMoveTo | ( | const Vector & | v | ) |

protected virtual

Perform moveto operator.

The transformation matrix has already been applied.

Reimplemented from ipe::Painter.

References ipe::Vector::x, and ipe::Vector::y.

Referenced by setDimmed().

void CairoPainter::doLineTo | ( | const Vector & | v | ) |

protected virtual

Perform lineto operator.

The transformation matrix has already been applied.

Reimplemented from ipe::Painter.

References ipe::Vector::x, and ipe::Vector::y.

Referenced by setDimmed().

void CairoPainter::doCurveTo | ( | const Vector & | v1,
|  | const Vector & | v2,
|  | const Vector & | v3
| ) |  |

protected virtual

Perform curveto operator.

The transformation matrix has already been applied.

Reimplemented from ipe::Painter.

References ipe::Vector::x, and ipe::Vector::y.

Referenced by setDimmed().

void CairoPainter::doClosePath | ( |  | ) |

protected virtual

Perform closepath operator.

Reimplemented from ipe::Painter.

Referenced by setDimmed().

void CairoPainter::doDrawArc | ( | const Arc & | arc | ) |

protected virtual

Draw an elliptic arc.

The default implementations calls drawArcAsBezier(). The transformation matrix has not yet been applied to arc.

Reimplemented from ipe::Painter.

References ipe::Arc::iAlpha, ipe::Arc::iBeta, ipe::Arc::iM, ipe::Arc::isEllipse(), and ipe::Painter::matrix().

Referenced by setDimmed().

void CairoPainter::doAddClipPath | ( |  | ) |

protected virtual

Add a clip path.

Reimplemented from ipe::Painter.

Referenced by setDimmed().

void CairoPainter::doDrawPath | ( | TPathMode | mode | ) |

protected virtual

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::Gradient::ERadial, ipe::ERoundCap, ipe::ERoundJoin, ipe::ESquareCap, ipe::EStrokedAndFilled, ipe::Painter::fill(), ipe::Painter::fillRule(), ipe::Cascade::findGradient(), ipe::Cascade::findTiling(), ipe::Painter::gradient(), ipe::Tiling::iAngle, ipe::Color::iBlue, ipe::Gradient::iExtend, ipe::Color::iGreen, ipe::Gradient::iMatrix, ipe::Gradient::iRadius, ipe::Color::iRed, ipe::Tiling::iStep, ipe::Gradient::iStops, ipe::Gradient::iType, ipe::Gradient::iV, ipe::Tiling::iWidth, ipe::Painter::lineCap(), ipe::Painter::lineJoin(), ipe::Painter::matrix(), ipe::Painter::opacity(), ipe::Painter::pen(), ipe::Painter::stroke(), ipe::Painter::tiling(), ipe::Fixed::toDouble(), ipe::Vector::x, and ipe::Vector::y.

Referenced by setDimmed().

void CairoPainter::doDrawBitmap | ( | Bitmap | bitmap | ) |

protected virtual

Draw a bitmap.

Reimplemented from ipe::Painter.

References ipe::Buffer::data(), ipe::Bitmap::height(), ipe::Painter::matrix(), ipe::Bitmap::pixelData(), ipe::Bitmap::renderData(), ipe::Bitmap::setRenderData(), ipe::Buffer::size(), and ipe::Bitmap::width().

Referenced by setDimmed().

void CairoPainter::doDrawText | ( | const Text * | text | ) |

protected virtual

Draw a text object.

Reimplemented from ipe::Painter.

References ipe::Matrix::a, ipe::Text::align(), ipe::PdfObj::array(), ipe::CIDType0, ipe::CIDType2, ipe::PdfDict::count(), ipe::PdfString::decode(), ipe::PdfToken::EOp, ipe::PdfParser::eos(), ipe::Painter::fill(), ipe::String::find(), ipe::PdfDict::get(), ipe::PdfDict::getNumberArray(), ipe::PdfParser::getObject(), ipe::PdfParser::getToken(), ipe::Text::getXForm(), ipe::Color::iBlue, ipe::Color::iGreen, ipe::Text::XForm::iName, ipe::PdfDict::inflate(), ipe::Color::iRed, ipe::Text::XForm::iStretch, ipe::PdfToken::iString, ipe::Text::XForm::iTranslation, ipe::PdfToken::iType, ipe::PdfDict::key(), ipe::String::left(), ipe::Painter::matrix(), ipe::PdfObj::name(), ipe::PdfObj::number(), ipe::PdfArray::obj(), ipe::Painter::opacity(), ipe::PdfObj::repr(), ipe::Fonts::screenFont(), ipe::String::size(), ipe::PdfObj::string(), ipe::Painter::stroke(), ipe::Text::text(), ipe::Fixed::toDouble(), ipe::PdfParser::token(), ipe::Text::totalHeight(), ipe::Painter::transform(), ipe::Painter::translate(), ipe::Matrix::translation(), ipe::PdfNumber::value(), ipe::PdfName::value(), ipe::PdfDict::value(), ipe::Text::width(), ipe::Vector::x, ipe::Vector::y, ipe::String::z(), and ipe::Vector::ZERO.

Referenced by setDimmed().

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

- ipecairopainter.h
- ipecairopainter.cpp