Ipelib

ipe::Attribute Class Reference

An attribute of an Ipe Object. More...

#include <ipeattributes.h>

List of all members.

Public Member Functions

Static Public Member Functions

Friends


Detailed Description

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:

  • if isSymbolic() is true, index() returns the index into the repository, and string() returns the symbolic name.
  • if isColor() is true, color() returns an absolute RGB color.
  • if isNumeric() is true, number() returns an absolute scalar value.
  • if isEnum() is true, the attribute represents an enumeration value.
  • otherwise, isString() is true, and index() returns the index into the repository (for a string expressing the absolute value of the attribute), and string() returns the string itself.

Constructor & Destructor Documentation

ipe::Attribute::Attribute ( ) [inline, explicit]

Default constructor.

Attribute::Attribute ( bool  symbolic,
String  name 
) [explicit]

Create an attribute with string value.

Attribute::Attribute ( Fixed  value) [explicit]

Create an absolute numeric attribute.

Attribute::Attribute ( Color  color) [explicit]

Create an attribute with absolute color.

ipe::Attribute::Attribute ( THorizontalAlignment  align) [inline, explicit]
ipe::Attribute::Attribute ( TVerticalAlignment  align) [inline, explicit]
ipe::Attribute::Attribute ( TLineJoin  join) [inline, explicit]
ipe::Attribute::Attribute ( TLineCap  cap) [inline, explicit]
ipe::Attribute::Attribute ( TFillRule  rule) [inline, explicit]
ipe::Attribute::Attribute ( TPinned  pin) [inline, explicit]
ipe::Attribute::Attribute ( TTransformations  trans) [inline, explicit]
ipe::Attribute::Attribute ( TPathMode  pm) [inline, explicit]

Member Function Documentation

static Attribute ipe::Attribute::Boolean ( bool  flag) [inline, static]
bool ipe::Attribute::isSymbolic ( ) const [inline]

Is it symbolic?

bool ipe::Attribute::isString ( ) const [inline]

Is it an absolute string value?

bool ipe::Attribute::isColor ( ) const [inline]

Is it a color?

bool ipe::Attribute::isNumber ( ) const [inline]

Is it a number?

bool ipe::Attribute::isEnum ( ) const [inline]

Is it an enumeration?

bool ipe::Attribute::isBoolean ( ) const [inline]

Is it a boolean?

bool ipe::Attribute::isNormal ( ) const [inline]

Is it the symbolic name "normal"?

int ipe::Attribute::index ( ) const [inline]

Return index into Repository.

int ipe::Attribute::internal ( ) const [inline]
String Attribute::string ( ) const

Return string representing the attribute.

Fixed Attribute::number ( ) const

Return value of absolute numeric attribute.

Color Attribute::color ( ) const

Return absolute color.

bool ipe::Attribute::boolean ( ) const [inline]
THorizontalAlignment ipe::Attribute::horizontalAlignment ( ) const [inline]
TVerticalAlignment ipe::Attribute::verticalAlignment ( ) const [inline]
TLineJoin ipe::Attribute::lineJoin ( ) const [inline]
TLineCap ipe::Attribute::lineCap ( ) const [inline]
TFillRule ipe::Attribute::fillRule ( ) const [inline]
TPinned ipe::Attribute::pinned ( ) const [inline]
TTransformations ipe::Attribute::transformations ( ) const [inline]
TPathMode ipe::Attribute::pathMode ( ) const [inline]
bool ipe::Attribute::operator== ( const Attribute rhs) const [inline]

Are two values equal (only compares index!)

bool ipe::Attribute::operator!= ( const Attribute rhs) const [inline]

Are two values different (only compares index!)

static Attribute ipe::Attribute::BLACK ( ) [inline, static]

Create absolute black color.

static Attribute ipe::Attribute::WHITE ( ) [inline, static]

Create absolute white color.

static Attribute ipe::Attribute::ONE ( ) [inline, static]

Create absolute number one.

static Attribute ipe::Attribute::NORMAL ( ) [inline, static]

Create symbolic attribute "normal".

static Attribute ipe::Attribute::UNDEFINED ( ) [inline, static]

Create symbolic attribute "undefined".

static Attribute ipe::Attribute::BACKGROUND ( ) [inline, static]

Create symbolic attribute "Background".

static Attribute ipe::Attribute::SYM_STROKE ( ) [inline, static]

Create symbolic attribute "sym-stroke".

static Attribute ipe::Attribute::SYM_FILL ( ) [inline, static]

Create symbolic attribute "sym-fill".

static Attribute ipe::Attribute::SYM_PEN ( ) [inline, static]

Create symbolic attribute "sym-pen".

static Attribute ipe::Attribute::ARROW_NORMAL ( ) [inline, static]

Create symbolic attribute "arrow/normal(spx)".

static Attribute ipe::Attribute::OPAQUE ( ) [inline, static]

Create symbolic attribute "opaque".

static Attribute ipe::Attribute::ARROW_ARC ( ) [inline, static]

Create symbolic attribute "arrow/arc(spx)".

static Attribute ipe::Attribute::ARROW_FARC ( ) [inline, static]

Create symbolic attribute "arrow/farc(spx)".

Attribute Attribute::makeColor ( String  str,
Attribute  deflt 
) [static]

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.

Attribute Attribute::makeScalar ( String  str,
Attribute  deflt 
) [static]

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.

Attribute Attribute::makeDashStyle ( String  str) [static]

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.

Attribute Attribute::makeTextSize ( String  str) [static]

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".

Attribute Attribute::normal ( Kind  kind) [static]

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.


Friends And Related Function Documentation

friend class StyleSheet [friend]

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