Ipelib: ipe::Cascade Class Reference

Ipelib

Public Member Functions | List of all members
ipe::Cascade Class Reference
Ipe Document

`#include <ipestyle.h>`

## Public Member Functions
| Cascade ()
| Cascade (const Cascade &rhs)
Cascade & | operator= (const Cascade &rhs)
| ~Cascade ()
int | count () const
StyleSheet * | sheet (int index)
const StyleSheet * | sheet (int index) const
void | insert (int index, StyleSheet *sheet)
void | remove (int index)
void | saveAsXml (Stream &stream) const
bool | has (Kind kind, Attribute sym) const
Attribute | find (Kind, Attribute sym) const
const Symbol * | findSymbol (Attribute sym) const
const Gradient * | findGradient (Attribute sym) const
const Tiling * | findTiling (Attribute sym) const
const Effect * | findEffect (Attribute sym) const
const Layout * | findLayout () const
const TextPadding * | findTextPadding () const
const StyleSheet::TitleStyle * | findTitleStyle () const
const StyleSheet::PageNumberStyle * | findPageNumberStyle () const
String | findPreamble () const
TLineCap | lineCap () const
TLineJoin | lineJoin () const
TFillRule | fillRule () const
void | allNames (Kind kind, AttributeSeq &seq) const
int | findDefinition (Kind kind, Attribute sym) const

## Detailed Description

A cascade of style sheets.

The StyleSheets of a document cascade in the sense that a document can refer to several StyleSheets, which are arranged in a stack. A lookup is done from top to bottom, and returns as soon as a match is found. Ipe always appends the built-in "standard" style sheet at the bottom of the cascade.

## Constructor & Destructor Documentation

## ◆ Cascade() [1/2]

Cascade::Cascade | ( |  | ) |

Create an empty cascade.

This does not add the standard style sheet.

## ◆ Cascade() [2/2]

Cascade::Cascade | ( | const Cascade & | rhs | ) |

Copy constructor.

References count().

## ◆ ~Cascade()

Cascade::~Cascade | ( |  | ) |

Destructor.

## Member Function Documentation

## ◆ operator=()

Cascade & Cascade::operator= | ( | const Cascade & | rhs | ) |

Assignment operator.

References count().

## ◆ count()

int ipe::Cascade::count | ( |  | ) | const
| inline

Return number of style sheets.

Referenced by Cascade(), and operator=().

## ◆ sheet() [1/2]

StyleSheet* ipe::Cascade::sheet | ( | int | index | ) |
| inline

Return StyleSheet at index.

## ◆ sheet() [2/2]

const StyleSheet* ipe::Cascade::sheet | ( | int | index | ) | const
| inline

Return StyleSheet at index.

## ◆ insert()

void Cascade::insert | ( | int | index,
|  | StyleSheet * | sheet
| ) |  |

Insert a style sheet into the cascade.

Takes ownership of sheet.

Referenced by ipe::Document::Document(), and ipe::ImlParser::parseDocument().

## ◆ remove()

void Cascade::remove | ( | int | index | ) |

Remove a style sheet from the cascade.

The old sheet is deleted.

## ◆ saveAsXml()

void Cascade::saveAsXml | ( | Stream & | stream | ) | const

## ◆ has()

bool Cascade::has | ( | Kind | kind,
|  | Attribute | sym
| ) |  | const

## ◆ find()

Attribute Cascade::find | ( | Kind | kind,
|  | Attribute | sym
| ) |  | const

References ipe::Attribute::normal(), and ipe::Attribute::UNDEFINED().

Referenced by ipe::Reference::draw(), ipe::Path::drawArrow(), ipe::Painter::Painter(), ipe::Painter::setDashStyle(), ipe::Painter::setFill(), ipe::Painter::setOpacity(), ipe::Painter::setPen(), ipe::Painter::setStroke(), ipe::Painter::setSymFill(), ipe::Painter::setSymPen(), and ipe::Painter::setSymStroke().

## ◆ findSymbol()

const Symbol * Cascade::findSymbol | ( | Attribute | sym | ) | const

Referenced by ipe::Reference::checkStyle(), ipe::PdfPainter::doDrawSymbol(), ipe::Painter::doDrawSymbol(), ipe::Reference::draw(), ipe::Path::drawArrow(), ipe::Document::runLatex(), and ipe::Thumbnail::saveRender().

## ◆ findGradient()

const Gradient * Cascade::findGradient | ( | Attribute | sym | ) | const

Referenced by ipe::PdfPainter::doDrawPath(), and ipe::CairoPainter::doDrawPath().

## ◆ findTiling()

const Tiling * Cascade::findTiling | ( | Attribute | sym | ) | const

Referenced by ipe::CairoPainter::doDrawPath().

## ◆ findEffect()

const Effect * Cascade::findEffect | ( | Attribute | sym | ) | const

## ◆ findLayout()

const Layout * Cascade::findLayout | ( |  | ) | const

Find page layout (such as text margins).

Referenced by ipe::PanTool::draw(), and ipe::Thumbnail::Thumbnail().

## ◆ findTextPadding()

const TextPadding * Cascade::findTextPadding | ( |  | ) | const

Find text padding (for text bbox computation).

Referenced by ipe::BBoxPainter::doDrawText().

## ◆ findTitleStyle()

const StyleSheet::TitleStyle * Cascade::findTitleStyle | ( |  | ) | const

Get style of page titles (or 0 if none defined).

Referenced by ipe::Page::applyTitleStyle().

## ◆ findPageNumberStyle()

const StyleSheet::PageNumberStyle * Cascade::findPageNumberStyle | ( |  | ) | const

Return style of page numbering (or 0 if none defined).

## ◆ findPreamble()

String Cascade::findPreamble | ( |  | ) | const

Return total LaTeX preamble (of the whole cascade).

## ◆ lineCap()

TLineCap Cascade::lineCap | ( |  | ) | const

References ipe::EButtCap, and ipe::EDefaultCap.

Referenced by ipe::Painter::Painter(), and ipe::PdfPainter::PdfPainter().

## ◆ lineJoin()

TLineJoin Cascade::lineJoin | ( |  | ) | const

References ipe::EDefaultJoin, and ipe::ERoundJoin.

Referenced by ipe::Painter::Painter(), and ipe::PdfPainter::PdfPainter().

## ◆ fillRule()

TFillRule Cascade::fillRule | ( |  | ) | const

References ipe::EDefaultRule, and ipe::EEvenOddRule.

Referenced by ipe::Painter::Painter().

## ◆ allNames()

void Cascade::allNames | ( | Kind | kind,
|  | AttributeSeq & | seq
| ) |  | const

References ipe::Attribute::NORMAL().

Referenced by ipe::Document::runLatex().

## ◆ findDefinition()

int Cascade::findDefinition | ( | Kind | kind,
|  | Attribute | sym
| ) |  | const

Find stylesheet defining the attribute.

This method goes through the cascade looking for a definition of the symbolic attribute sym. It returns the index of the stylesheet defining the attribute, or -1 if the attribute is not defined.

The method panics if sym is not symbolic. It also works for ESymbol, EGradient, ETiling, and EEffect.

References ipe::Attribute::isSymbolic().

Referenced by ipe::Object::checkSymbol().

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

- ipestyle.h
- ipestyle.cpp