Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
style.h File Reference

SPStyle - a style object for SPItem objects. More...

Go to the source code of this file.

Classes

class  SPStyle
 An SVG style object. More...
 

Namespaces

namespace  Inkscape
 Helper class to stream background task notifications as a series of messages.
 
namespace  Inkscape::XML
 @Inkscape XML tree.
 

Typedefs

typedef SPIBase SPStyle::* SPIBasePtr
 

Functions

void sp_style_set_to_uri (SPStyle *style, bool isfill, Inkscape::URI const *uri)
 
char const * sp_style_get_css_unit_string (int unit)
 
double sp_style_css_size_px_to_units (double size, int unit, double font_size=SP_CSS_FONT_SIZE_DEFAULT)
 
double sp_style_css_size_units_to_px (double size, int unit, double font_size=SP_CSS_FONT_SIZE_DEFAULT)
 
SPCSSAttrsp_css_attr_from_style (SPStyle const *const style, unsigned int flags)
 
SPCSSAttrsp_css_attr_from_object (SPObject *object, unsigned int flags=SP_STYLE_FLAG_IFSET)
 
SPCSSAttrsp_css_attr_unset_text (SPCSSAttr *css)
 Unset any text-related properties.
 
SPCSSAttrsp_css_attr_unset_blacklist (SPCSSAttr *css)
 Unset properties that should not be set for default tool style.
 
SPCSSAttrsp_css_attr_unset_uris (SPCSSAttr *css)
 Unset any properties that contain URI values.
 
SPCSSAttrsp_css_attr_scale (SPCSSAttr *css, double ex)
 Scale any properties that may hold <length> by ex.
 
void sp_style_unset_property_attrs (SPObject *o)
 
void sp_style_set_property_url (SPObject *item, char const *property, SPObject *linked, bool recursive)
 
void css_quote (Glib::ustring &val)
 Quote and/or escape string for writing to CSS, changing strings in place.
 
void css_unquote (Glib::ustring &val)
 Remove paired single and double quotes from a string, changing string in place.
 
void css_font_family_quote (Glib::ustring &val)
 Quote font names in font-family lists, changing string in place.
 
void css_font_family_unquote (Glib::ustring &val)
 Remove paired single and double quotes from font names in font-family lists, changing string in place.
 
Glib::ustring css2_escape_quote (char const *val)
 

Detailed Description

SPStyle - a style object for SPItem objects.

Definition in file style.h.

Typedef Documentation

◆ SPIBasePtr

typedef SPIBase SPStyle::* SPIBasePtr

Definition at line 35 of file style.h.

Function Documentation

◆ css2_escape_quote()

Glib::ustring css2_escape_quote ( char const *  val)

◆ css_font_family_quote()

void css_font_family_quote ( Glib::ustring &  val)

Quote font names in font-family lists, changing string in place.

We use unquoted names internally but some need to be quoted in CSS.

Definition at line 1687 of file style.cpp.

References css_quote().

Referenced by Inkscape::FontLister::fill_css(), and SPIString::get_value().

◆ css_font_family_unquote()

void css_font_family_unquote ( Glib::ustring &  val)

Remove paired single and double quotes from font names in font-family lists, changing string in place.

We use unquoted family names internally but CSS sometimes uses quoted names.

Definition at line 1724 of file style.cpp.

References css_unquote().

Referenced by Inkscape::UI::Toolbar::TextToolbar::fontfamily_value_changed(), and SPIString::read().

◆ css_quote()

void css_quote ( Glib::ustring &  val)

Quote and/or escape string for writing to CSS, changing strings in place.

See: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier

Definition at line 1648 of file style.cpp.

Referenced by css_font_family_quote(), Inkscape::FontLister::fill_css(), and SPIString::get_value().

◆ css_unquote()

void css_unquote ( Glib::ustring &  val)

Remove paired single and double quotes from a string, changing string in place.

Definition at line 1706 of file style.cpp.

Referenced by css_font_family_unquote(), and SPIString::read().

◆ sp_css_attr_from_object()

SPCSSAttr * sp_css_attr_from_object ( SPObject object,
unsigned int  flags = SP_STYLE_FLAG_IFSET 
)

◆ sp_css_attr_from_style()

SPCSSAttr * sp_css_attr_from_style ( SPStyle const *const  style,
unsigned int  flags 
)

◆ sp_css_attr_scale()

◆ sp_css_attr_unset_blacklist()

SPCSSAttr * sp_css_attr_unset_blacklist ( SPCSSAttr css)

Unset properties that should not be set for default tool style.

This list needs to be reviewed.

Definition at line 1498 of file style.cpp.

References css, and sp_repr_css_set_property().

Referenced by Inkscape::UI::Dialog::StyleFromSelectionToTool(), and take_style_from_item().

◆ sp_css_attr_unset_text()

SPCSSAttr * sp_css_attr_unset_text ( SPCSSAttr css)

Unset any text-related properties.

Definition at line 1444 of file style.cpp.

References css, and sp_repr_css_set_property().

Referenced by sp_desktop_get_style(), sp_desktop_set_style(), Inkscape::UI::Dialog::StyleFromSelectionToTool(), and take_style_from_item().

◆ sp_css_attr_unset_uris()

SPCSSAttr * sp_css_attr_unset_uris ( SPCSSAttr css)

Unset any properties that contain URI values.

Used for storing style that will be reused across documents when carrying the referenced defs is impractical.

Definition at line 1543 of file style.cpp.

References css, is_url(), sp_repr_css_property(), and sp_repr_css_set_property().

Referenced by Inkscape::UI::Tools::TweakTool::set_style(), sp_desktop_set_style(), and Inkscape::UI::Dialog::StyleFromSelectionToTool().

◆ sp_style_css_size_px_to_units()

◆ sp_style_css_size_units_to_px()

double sp_style_css_size_units_to_px ( double  size,
int  unit,
double  font_size = SP_CSS_FONT_SIZE_DEFAULT 
)

◆ sp_style_get_css_unit_string()

◆ sp_style_set_property_url()

void sp_style_set_property_url ( SPObject item,
char const *  property,
SPObject linked,
bool  recursive 
)

◆ sp_style_set_to_uri()

void sp_style_set_to_uri ( SPStyle style,
bool  isfill,
Inkscape::URI const *  uri 
)

◆ sp_style_unset_property_attrs()

void sp_style_unset_property_attrs ( SPObject o)