Ipelib
|
#include <ipestyle.h>
Classes | |
struct | PageNumberStyle |
struct | TitleStyle |
Static Public Member Functions | |
static StyleSheet * | standard () |
A style sheet maps symbolic names to absolute values.
Ipe documents can use symbolic attributes, such as 'normal', 'fat', or 'thin' for line thickness, or 'red', 'navy', 'turquoise' for color. The mapping to an absolute pen thickness or RGB value is performed by a StyleSheet.
Style sheets are always included when the document is saved, so that an Ipe document is self-contained.
The built-in standard style sheet is minimal, and only needed to provide sane fallbacks for all the "normal" settings.
StyleSheet::StyleSheet | ( | ) |
The default constructor creates an empty style sheet.
References ipe::EDefaultCap, ipe::EDefaultJoin, ipe::EDefaultRule, ipe::StyleSheet::TitleStyle::iDefined, ipe::StyleSheet::PageNumberStyle::iDefined, and ipe::TextPadding::iLeft.
|
static |
Create standard built-in style sheet.
References ipe::ImlParser::parseStyleSheet().
Referenced by ipe::Document::Document(), ipe::PdfThumbnail::PdfThumbnail(), and ipe::PdfViewBase::PdfViewBase().
Find a symbol object with given name.
If attr is not symbolic or if the symbol doesn't exist, returns 0.
References ipe::Attribute::index(), and ipe::Attribute::isSymbolic().
Find gradient in style sheet cascade.
References ipe::Attribute::index(), and ipe::Attribute::isSymbolic().
Find tiling in style sheet cascade.
References ipe::Attribute::index(), and ipe::Attribute::isSymbolic().
References name().
Referenced by ipe::ImlParser::parseStyle().
References ipe::Attribute::index(), and ipe::Attribute::isSymbolic().
Add an attribute.
Does nothing if name is not symbolic.
References name().
Referenced by ipe::ImlParser::parseStyle().
Check whether symbolic attribute is defined.
This method also works for ESymbol, EGradient, ETiling, and EEffect.
Returns true if sym is not symbolic.
References ipe::EEffect, ipe::EGradient, ipe::ESymbol, ipe::ETiling, ipe::Attribute::index(), and ipe::Attribute::isSymbolic().
Find a symbolic attribute.
If sym is not symbolic, returns sym itself. If sym cannot be found, returns the "undefined" attribute. In all other cases, the returned attribute is guaranteed to be absolute.
References ipe::Attribute::index(), ipe::Attribute::isSymbolic(), and ipe::Attribute::UNDEFINED().
Removes definition for a symbolic attribute from this stylesheet.
This method also works for ESymbol, EGradient, ETiling, and EEffect. It is okay if the symbolic attribute is not defined in the stylesheet, nothing happens in this case.
References ipe::EEffect, ipe::EGradient, ipe::ESymbol, ipe::ETiling, and ipe::Attribute::index().
void StyleSheet::saveAsXml | ( | Stream & | stream, |
bool | saveBitmaps = false |
||
) | const |
Save style sheet in XML format.
References ipe::Angle::degrees(), ipe::Gradient::EAxial, ipe::EDefaultCap, ipe::EDefaultJoin, ipe::EDefaultRule, ipe::EEvenOddRule, ipe::ELabelStyle, ipe::String::empty(), ipe::ETextStyle, ipe::ETransformationsRigidMotions, ipe::ETransformationsTranslations, ipe::EWindRule, ipe::String::find(), ipe::Repository::get(), ipe::Tiling::iAngle, ipe::BitmapFinder::iBitmaps, ipe::TextPadding::iBottom, ipe::StyleSheet::TitleStyle::iColor, ipe::StyleSheet::PageNumberStyle::iColor, ipe::Layout::iCrop, ipe::StyleSheet::TitleStyle::iDefined, ipe::StyleSheet::PageNumberStyle::iDefined, ipe::Effect::iDuration, ipe::Effect::iEffect, ipe::Gradient::iExtend, ipe::Layout::iFrameSize, ipe::StyleSheet::TitleStyle::iHorizontalAlignment, ipe::StyleSheet::PageNumberStyle::iHorizontalAlignment, ipe::TextPadding::iLeft, ipe::Gradient::iMatrix, ipe::Layout::iOrigin, ipe::Layout::iPaperSize, ipe::Layout::iParagraphSkip, ipe::StyleSheet::TitleStyle::iPos, ipe::StyleSheet::PageNumberStyle::iPos, ipe::Gradient::iRadius, ipe::TextPadding::iRight, ipe::Matrix::isIdentity(), ipe::StyleSheet::TitleStyle::iSize, ipe::StyleSheet::PageNumberStyle::iSize, ipe::Layout::isNull(), ipe::Tiling::iStep, ipe::Gradient::iStops, ipe::StyleSheet::PageNumberStyle::iText, ipe::TextPadding::iTop, ipe::Effect::iTransitionTime, ipe::Gradient::iType, ipe::Gradient::iV, ipe::StyleSheet::TitleStyle::iVerticalAlignment, ipe::StyleSheet::PageNumberStyle::iVerticalAlignment, ipe::Tiling::iWidth, ipe::kind_names, ipe::Bitmap::objNum(), ipe::Stream::putXmlString(), ipe::Text::saveAlignment(), ipe::Bitmap::saveAsXml(), ipe::size(), ipe::Attribute::string(), ipe::String::substr(), and ipe::Repository::toString().
void StyleSheet::allNames | ( | Kind | kind, |
AttributeSeq & | seq | ||
) | const |
Return all symbolic names in the style sheet cascade.
Names are simply appended from top to bottom of the cascade. Names are inserted only once.
References ipe::EEffect, ipe::EGradient, ipe::ESymbol, and ipe::ETiling.
|
inline |
Return whether this is the standard style sheet built into Ipe.
|
inline |
Set LaTeX preamble.
Referenced by ipe::ImlParser::parseStyle().
const Layout * StyleSheet::layout | ( | ) | const |
Return page layout (or 0 if none defined).
References ipe::Layout::isNull().
Referenced by setLayout().
void StyleSheet::setLayout | ( | const Layout & | margins | ) |
const TextPadding * StyleSheet::textPadding | ( | ) | const |
Return text object padding (for bbox computation).
References ipe::TextPadding::iLeft.
void StyleSheet::setTextPadding | ( | const TextPadding & | pad | ) |
Set padding for text object bbox computation.
Referenced by ipe::ImlParser::parseStyle().
const StyleSheet::TitleStyle * StyleSheet::titleStyle | ( | ) | const |
Return title style (or 0 if none defined).
References ipe::StyleSheet::TitleStyle::iDefined.
void StyleSheet::setTitleStyle | ( | const TitleStyle & | ts | ) |
Set style of page titles.
Referenced by ipe::ImlParser::parseStyle().
const StyleSheet::PageNumberStyle * StyleSheet::pageNumberStyle | ( | ) | const |
Return page number style.
References ipe::StyleSheet::PageNumberStyle::iDefined.
void StyleSheet::setPageNumberStyle | ( | const PageNumberStyle & | pns | ) |
Set style of page numbering.
Referenced by ipe::ImlParser::parseStyle().
void StyleSheet::setLineCap | ( | TLineCap | s | ) |
Set line cap.
Referenced by ipe::ImlParser::parseStyle().
void StyleSheet::setLineJoin | ( | TLineJoin | s | ) |
Set line join.
Referenced by ipe::ImlParser::parseStyle().
void StyleSheet::setFillRule | ( | TFillRule | s | ) |
Set fill rule.
Referenced by ipe::ImlParser::parseStyle().
|
inline |
Return line cap.
|
inline |
Return line join.
|
inline |
Return path fill rule.
|
inline |
Return name of style sheet.
Referenced by add(), addEffect(), addGradient(), addSymbol(), addTiling(), and setName().
|
inline |