Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
SPIColor Class Reference

#include <style-internal.h>

Inheritance diagram for SPIColor:
SPIBase TypedSPI< SPAttr::TEXT_DECORATION_COLOR, SPIColor > TypedSPI< SPAttr::COLOR, SPIColor > TypedSPI< SPAttr::SOLID_COLOR, SPIColor > TypedSPI< SPAttr::STOP_COLOR, SPIColor >

Public Member Functions

 SPIColor (bool inherits=true)
 
 ~SPIColor () override=default
 
void read (gchar const *str) override
 
void read (gchar const *str, SPStyle &style)
 
const Glib::ustring get_value () const override
 
void clear () override
 
void cascade (const SPIBase *const parent) override
 
void merge (const SPIBase *const parent) override
 
SPIColoroperator= (const SPIColor &rhs)
 
SPIColoroperator= (const Colors::Color &rhs)
 
bool equals (const SPIBase &rhs) const override
 
void setColor (Colors::Color const &other)
 
Colors::Color const & getColor () const
 
bool canHaveCMS () const
 
Colors::DocumentCMS const & getCMS () const
 
- Public Member Functions inherited from SPIBase
 SPIBase (bool inherits_=true)
 
virtual ~SPIBase ()=default
 
void readIfUnset (gchar const *str, SPStyleSrc source=SPStyleSrc::STYLE_PROP)
 
void readAttribute (Inkscape::XML::Node *repr)
 
bool shall_write (guint const flags=SP_STYLE_FLAG_IFSET, SPStyleSrc const &style_src_req=SPStyleSrc::STYLE_PROP, SPIBase const *const base=nullptr) const
 Check if this property should be written.
 
virtual const Glib::ustring write (guint const flags=SP_STYLE_FLAG_IFSET, SPStyleSrc const &style_src_req=SPStyleSrc::STYLE_PROP, SPIBase const *const base=nullptr) const
 Compile this style conditionally into a 'name: value' string suitable for css attrs.
 
void overwrite (const SPIBase *const other)
 
void setStylePointer (SPStyle *style_in)
 
SPIBaseoperator= (const SPIBase &rhs)=default
 
bool operator== (const SPIBase &rhs) const
 
virtual SPAttr id () const
 
Glib::ustring const & name () const
 

Public Attributes

bool currentcolor = false
 
- Public Attributes inherited from SPIBase
bool inherits: 1
 
bool set: 1
 
bool inherit: 1
 
bool important: 1
 
SPStyleSrc style_src
 

Private Attributes

std::optional< Colors::Color_color
 

Additional Inherited Members

- Protected Member Functions inherited from SPIBase
char const * important_str () const
 
- Protected Attributes inherited from SPIBase
SPStylestyle
 

Detailed Description

Definition at line 674 of file style-internal.h.

Constructor & Destructor Documentation

◆ SPIColor()

SPIColor::SPIColor ( bool  inherits = true)

Definition at line 1453 of file style-internal.cpp.

◆ ~SPIColor()

SPIColor::~SPIColor ( )
overridedefault

Member Function Documentation

◆ canHaveCMS()

bool SPIColor::canHaveCMS ( ) const

Definition at line 1457 of file style-internal.cpp.

References SPStyle::document, and SPIBase::style.

Referenced by read().

◆ cascade()

void SPIColor::cascade ( const SPIBase *const  parent)
overridevirtual

Implements SPIBase.

Definition at line 1545 of file style-internal.cpp.

References _color, currentcolor, SPIBase::inherit, SPIBase::inherits, parent, and SPIBase::set.

◆ clear()

void SPIColor::clear ( )
inlineoverridevirtual

Reimplemented from SPIBase.

Definition at line 685 of file style-internal.h.

References _color, and SPIBase::clear().

◆ equals()

bool SPIColor::equals ( const SPIBase rhs) const
overridevirtual

Reimplemented from SPIBase.

Definition at line 1575 of file style-internal.cpp.

References _color, currentcolor, and SPIBase::equals().

◆ get_value()

const Glib::ustring SPIColor::get_value ( ) const
overridevirtual

Implements SPIBase.

Definition at line 1536 of file style-internal.cpp.

References _color, currentcolor, and SPIBase::inherit.

◆ getCMS()

Colors::DocumentCMS const & SPIColor::getCMS ( ) const

Definition at line 1462 of file style-internal.cpp.

References SPStyle::document, SPDocument::getDocumentCMS(), and SPIBase::style.

Referenced by read().

◆ getColor()

Colors::Color const & SPIColor::getColor ( ) const

Definition at line 1492 of file style-internal.cpp.

References _color, and default_color().

◆ merge()

void SPIColor::merge ( const SPIBase *const  parent)
overridevirtual

Implements SPIBase.

Definition at line 1561 of file style-internal.cpp.

References _color, currentcolor, SPIBase::inherit, SPIBase::inherits, parent, and SPIBase::set.

◆ operator=() [1/2]

SPIColor & SPIColor::operator= ( const Colors::Color &  rhs)

Definition at line 1478 of file style-internal.cpp.

References setColor().

◆ operator=() [2/2]

SPIColor & SPIColor::operator= ( const SPIColor rhs)

Definition at line 1470 of file style-internal.cpp.

References _color, currentcolor, and SPIBase::operator=().

◆ read() [1/2]

void SPIColor::read ( gchar const *  str)
overridevirtual

◆ read() [2/2]

void SPIColor::read ( gchar const *  str,
SPStyle style 
)

◆ setColor()

void SPIColor::setColor ( Colors::Color const &  other)

Definition at line 1485 of file style-internal.cpp.

References _color, currentcolor, and SPIBase::set.

Referenced by operator=().

Member Data Documentation

◆ _color

std::optional<Colors::Color> SPIColor::_color
private

Definition at line 706 of file style-internal.h.

Referenced by cascade(), clear(), equals(), get_value(), getColor(), merge(), operator=(), read(), and setColor().

◆ currentcolor

bool SPIColor::currentcolor = false

Definition at line 704 of file style-internal.h.

Referenced by cascade(), equals(), get_value(), merge(), operator=(), read(), and setColor().


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