Ipelib
|
#include <ipeattributes.h>
Static Public Member Functions | |
static Attribute | Boolean (bool flag) |
static Attribute | BLACK () |
static Attribute | WHITE () |
static Attribute | ONE () |
static Attribute | NORMAL () |
static Attribute | UNDEFINED () |
static Attribute | BACKGROUND () |
static Attribute | SYM_STROKE () |
static Attribute | SYM_FILL () |
static Attribute | SYM_PEN () |
static Attribute | ARROW_NORMAL () |
static Attribute | OPAQUE () |
static Attribute | ARROW_ARC () |
static Attribute | ARROW_FARC () |
static Attribute | ARROW_PTARC () |
static Attribute | ARROW_FPTARC () |
static Attribute | makeColor (String str, Attribute deflt) |
static Attribute | makeScalar (String str, Attribute deflt) |
static Attribute | makeDashStyle (String str) |
static Attribute | makeTextSize (String str) |
static Attribute | normal (Kind kind) |
Friends | |
class | StyleSheet |
An attribute of an Ipe Object.
An attribute is either an absolute value or a symbolic name that has to be looked up in a StyleSheet.
All string values are replaced by indices into a Repository (that applies both to symbolic names and to absolute values that are strings). All other values are stored directly inside the attribute, either as a Fixed or a Color.
There are five different kinds of Attribute objects:
|
inlineexplicit |
Default constructor.
Referenced by ARROW_ARC(), ARROW_FARC(), ARROW_FPTARC(), ARROW_NORMAL(), ARROW_PTARC(), BACKGROUND(), BLACK(), Boolean(), makeColor(), makeDashStyle(), makeScalar(), makeTextSize(), NORMAL(), normal(), ONE(), OPAQUE(), SYM_FILL(), SYM_PEN(), SYM_STROKE(), UNDEFINED(), and WHITE().
|
explicit |
Create an attribute with string value.
References ipe::Repository::get(), index(), and ipe::Repository::toIndex().
|
explicit |
Create an absolute numeric attribute.
References ipe::Fixed::internal().
|
explicit |
Create an attribute with absolute color.
References color(), ipe::Color::iBlue, ipe::Color::iGreen, ipe::Fixed::internal(), and ipe::Color::iRed.
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlinestatic |
References Attribute().
Referenced by ipe::Text::getAttribute(), and ipe::Path::getAttribute().
|
inline |
Is it symbolic?
Referenced by ipe::Object::checkSymbol(), ipe::StyleSheet::find(), ipe::Cascade::findDefinition(), ipe::StyleSheet::findEffect(), ipe::StyleSheet::findGradient(), ipe::StyleSheet::findSymbol(), ipe::StyleSheet::findTiling(), ipe::StyleSheet::has(), isMidArrow(), ipe::Painter::lookup(), ipe::ImlParser::parseStyle(), ipe::Reference::Reference(), ipe::Page::setEffect(), and string().
|
inline |
Is it an absolute string value?
Referenced by ipe::Object::setCustom(), and string().
|
inline |
Is it a color?
Referenced by color(), ipe::ImlParser::parseStyle(), and string().
|
inline |
Is it a number?
Referenced by ipe::Latex::createLatexSource(), number(), ipe::ImlParser::parseStyle(), ipe::PdfWriter::PdfWriter(), ipe::Text::setAttribute(), and string().
|
inline |
Is it an enumeration?
Referenced by isBoolean(), ipe::Object::setAttribute(), ipe::Text::setAttribute(), and ipe::Path::setAttribute().
|
inline |
Is it the symbolic name "normal"?
Referenced by ipe::Path::checkStyle(), ipe::PdfWriter::createPageView(), ipe::PdfPainter::doDrawPath(), ipe::Group::draw(), ipe::Path::draw(), ipe::PdfPainter::drawAttributes(), ipe::Group::saveAsXml(), ipe::Reference::saveAsXml(), ipe::Path::saveAsXml(), ipe::Painter::setGradient(), and ipe::Painter::setTiling().
|
inline |
Return index into Repository.
Referenced by Attribute(), boolean(), ipe::PdfPainter::doDrawPath(), ipe::PdfPainter::doDrawSymbol(), ipe::PdfPainter::drawAttributes(), fillRule(), ipe::StyleSheet::find(), ipe::StyleSheet::findEffect(), ipe::StyleSheet::findGradient(), ipe::StyleSheet::findSymbol(), ipe::StyleSheet::findTiling(), ipe::StyleSheet::has(), horizontalAlignment(), isBoolean(), lineCap(), lineJoin(), pathMode(), pinned(), ipe::StyleSheet::remove(), splineType(), string(), transformations(), and verticalAlignment().
|
inline |
String Attribute::string | ( | ) | const |
Return string representing the attribute.
References color(), ipe::Repository::get(), index(), isColor(), isNumber(), isString(), isSymbolic(), number(), and ipe::Repository::toString().
Referenced by ipe::Latex::createLatexSource(), isMidArrow(), ipe::Reference::Reference(), ipe::AttributeMap::saveAsXml(), ipe::Page::saveAsXml(), ipe::StyleSheet::saveAsXml(), ipe::Group::saveAsXml(), ipe::Reference::saveAsXml(), ipe::Text::saveAsXml(), ipe::Image::saveAsXml(), ipe::Path::saveAsXml(), ipe::Object::saveAttributesAsXml(), ipe::Painter::setDashStyle(), and ipe::Reference::setName().
Fixed Attribute::number | ( | ) | const |
Return value of absolute numeric attribute.
References ipe::Fixed::fromInternal(), and isNumber().
Referenced by ipe::Reference::checkStyle(), ipe::Latex::createLatexSource(), ipe::Reference::draw(), ipe::Path::drawArrow(), ipe::Reference::drawSimple(), ipe::Painter::Painter(), ipe::ImlParser::parseStyle(), ipe::PdfWriter::PdfWriter(), ipe::Text::setAttribute(), ipe::Painter::setOpacity(), ipe::Painter::setPen(), ipe::Painter::setStrokeOpacity(), ipe::Painter::setSymPen(), and string().
Color Attribute::color | ( | ) | const |
Return absolute color.
References ipe::Fixed::fromInternal(), ipe::Color::iBlue, ipe::Color::iGreen, ipe::Color::iRed, and isColor().
Referenced by Attribute(), ipe::Latex::createLatexSource(), ipe::Painter::setFill(), ipe::Painter::setStroke(), ipe::Painter::setSymFill(), ipe::Painter::setSymStroke(), and string().
|
inline |
References index().
Referenced by ipe::Text::setAttribute(), and ipe::Path::setAttribute().
|
inline |
References index().
Referenced by ipe::Text::setAttribute().
|
inline |
References index().
Referenced by ipe::Text::setAttribute().
|
inline |
References index().
Referenced by ipe::Path::setAttribute().
|
inline |
References index().
Referenced by ipe::Path::setAttribute().
|
inline |
References index().
Referenced by ipe::Path::setAttribute().
|
inline |
References index().
Referenced by ipe::Object::setAttribute().
|
inline |
References index().
Referenced by ipe::Object::setAttribute().
|
inline |
References index().
Referenced by ipe::Path::setAttribute().
|
inline |
References index().
|
inline |
Are two values equal (only compares index!)
|
inline |
Are two values different (only compares index!)
|
inlinestatic |
Create absolute black color.
References Attribute().
Referenced by ipe::AllAttributes::AllAttributes(), normal(), ipe::ImlParser::parseStyle(), ipe::Reference::Reference(), ipe::Reference::saveAsXml(), and ipe::Text::Text().
|
inlinestatic |
Create absolute white color.
References Attribute().
Referenced by ipe::Reference::Reference(), and ipe::Reference::saveAsXml().
|
inlinestatic |
Create absolute number one.
References Attribute().
Referenced by normal(), ipe::Reference::Reference(), and ipe::Reference::saveAsXml().
|
inlinestatic |
Create symbolic attribute "normal".
References Attribute().
Referenced by ipe::AllAttributes::AllAttributes(), ipe::Cascade::allNames(), ipe::Group::Group(), makeDashStyle(), makeTextSize(), normal(), ipe::Painter::Painter(), ipe::ImlParser::parseStyle(), ipe::Reference::Reference(), ipe::Text::saveAsXml(), ipe::Text::setAttribute(), ipe::Path::setGradient(), ipe::Painter::setGradient(), ipe::Text::setTextType(), ipe::Path::setTiling(), ipe::Painter::setTiling(), and ipe::Text::Text().
|
inlinestatic |
Create symbolic attribute "undefined".
References Attribute().
Referenced by ipe::StyleSheet::find(), ipe::Cascade::find(), ipe::Object::getAttribute(), ipe::Object::Object(), and ipe::Object::saveAttributesAsXml().
|
inlinestatic |
Create symbolic attribute "Background".
References Attribute().
Referenced by ipe::PdfWriter::createPageView(), ipe::CanvasBase::drawObjects(), and ipe::Thumbnail::saveRender().
|
inlinestatic |
Create symbolic attribute "sym-stroke".
References Attribute().
Referenced by ipe::Painter::setFill(), ipe::Painter::setStroke(), ipe::Painter::setSymFill(), and ipe::Painter::setSymStroke().
|
inlinestatic |
Create symbolic attribute "sym-fill".
References Attribute().
Referenced by ipe::Painter::setFill(), ipe::Painter::setStroke(), ipe::Painter::setSymFill(), and ipe::Painter::setSymStroke().
|
inlinestatic |
Create symbolic attribute "sym-pen".
References Attribute().
Referenced by ipe::Painter::setPen(), and ipe::Painter::setSymPen().
|
inlinestatic |
Create symbolic attribute "arrow/normal(spx)".
References Attribute().
Referenced by ipe::AllAttributes::AllAttributes().
|
inlinestatic |
Create symbolic attribute "opaque".
References Attribute().
Referenced by ipe::AllAttributes::AllAttributes(), ipe::Image::Image(), ipe::Text::saveAsXml(), ipe::Image::saveAsXml(), ipe::Path::saveAsXml(), and ipe::Text::Text().
|
inlinestatic |
Create symbolic attribute "arrow/arc(spx)".
References Attribute().
|
inlinestatic |
Create symbolic attribute "arrow/farc(spx)".
References Attribute().
Referenced by ipe::Path::drawArrow().
|
inlinestatic |
Create symbolic attribute "arrow/ptarc(spx)".
References Attribute().
Referenced by ipe::Path::drawArrow().
|
inlinestatic |
Create symbolic attribute "arrow/fptarc(spx)".
References Attribute().
Referenced by ipe::Path::drawArrow().
|
inline |
Is it one of the symbolic attributes "arrow/*arc(spc)"?
Referenced by ipe::Path::draw().
bool Attribute::isMidArrow | ( | ) | const |
Is it a symbolic arrow name of the form "arrow/mid-*"?
References ipe::String::hasPrefix(), isSymbolic(), and string().
Referenced by ipe::Path::setArrow(), ipe::Path::setAttribute(), and ipe::Path::setRarrow().
Make a color attribute.
If the string starts with a letter, make a symbolic attribute. Otherwise, it's either a single gray value (0.0 to 1.0), or the three red, green, and blue components, separated by spaces. If it's an empty string, return deflt.
References Attribute(), and ipe::String::empty().
Referenced by ipe::ImlParser::parseStyle(), ipe::Reference::Reference(), and ipe::Text::Text().
Make a scalar attribute.
If str is empty, simply return deflt. If str starts with a letter, make a symbolic attribute. Otherwise, must be a number.
References Attribute(), and ipe::String::empty().
Referenced by ipe::ImlParser::parseStyle(), and ipe::Reference::Reference().
Construct dash style attribute from string.
Strings starting with '[' create an absolute dash style. The empty string is equivalent to 'normal'. Any other string creates a symbolic dash style.
References Attribute(), ipe::String::empty(), and NORMAL().
Referenced by ipe::ImlParser::parseStyle().
Construct text size attribute from string.
String starting with digit creates a numeric absolute value, string starting with letter creates symbolic text size, anything else creates absolute (string) text size. The empty string is treated like "normal".
References Attribute(), ipe::String::empty(), and NORMAL().
Referenced by ipe::ImlParser::parseStyle(), and ipe::Text::Text().
Return a standard value for attribute of kind.
The value is used if the stylesheet doesn't define a symbolic attribute used in the document.
References Attribute(), BLACK(), ipe::EAngleSize, ipe::EArrowSize, ipe::EColor, ipe::EDashStyle, ipe::EGridSize, ipe::EOpacity, ipe::EPen, ipe::ESymbolSize, ipe::ETextSize, ipe::ETextStretch, ipe::ETextStyle, NORMAL(), and ONE().
Referenced by ipe::Cascade::find().
|
friend |