27#include <unordered_map>
30#include <glibmm/regex.h>
49#if !GLIB_CHECK_VERSION(2, 64, 0)
50#define g_warning_once g_warning
55static constexpr int BMAX = 8192;
73class SPStylePropHelper {
75#define REGISTER_PROPERTY(id, member, name) \
76 g_assert(decltype(SPStyle::member)::static_id() == id); \
77 _register(reinterpret_cast<SPIBasePtr>(&SPStyle::member), id)
189 SPStylePropHelper(SPStylePropHelper
const&) =
delete;
195 static SPStylePropHelper &instance() {
204 auto it = m_id_map.find(
id);
205 if (it != m_id_map.end()) {
206 return _get(style, it->second);
222 std::vector<SPIBase *> get_vector(
SPStyle *style) {
223 std::vector<SPIBase *>
v;
224 v.reserve(m_vector.size());
225 for (
auto ptr : m_vector) {
226 v.push_back(_get(style, ptr));
235 m_vector.push_back(ptr);
242 std::unordered_map<SPAttr, SPIBasePtr> m_id_map;
243 std::vector<SPIBasePtr> m_vector;
281 font_specification( ),
284 font_variant_ligatures( ),
287 font_variant_numeric( ),
289 font_variant_east_asian(),
290 font_feature_settings( ),
293 font_variation_settings(),
319 text_decoration_line(),
320 text_decoration_style(),
321 text_decoration_color( ),
322 text_decoration_fill( ),
323 text_decoration_stroke( ),
359 stroke_miterlimit( 4),
361 stroke_dashoffset( ),
365 stroke_extensions( ),
425 font.setStylePointer(
this );
441 fill.setStylePointer(
this);
442 stroke.setStylePointer(
this);
443 color.setStylePointer(
this);
452 filter.setStylePointer(
this );
500 g_warning(
"Unimplemented style property %d", (
int)
id);
526 fill.href = std::make_shared<SPPaintServerReference>(
document);
545 g_assert(repr !=
nullptr);
566 gchar
const *val = repr->
attribute(
"style");
567 if( val !=
nullptr && *val ) {
582 p->readAttribute( repr );
591 }
else if( repr->
parent() ) {
612 g_return_if_fail(
object !=
nullptr);
615 g_return_if_fail(repr !=
nullptr);
617 read(
object, repr );
627 g_return_if_fail(!path.empty());
636 std::vector<Inkscape::Preferences::Entry> attrs = prefs->
getAllEntries(path);
637 for (
auto & attr : attrs) {
638 tempnode->
setAttribute(attr.getEntryName(), attr.getString());
641 read(
nullptr, tempnode );
655 g_return_if_fail(val !=
nullptr);
667 g_warning_once(
"attribute 'clip-path' given as CSS");
671 object->setAttribute(
"clip-path", val);
678 g_warning_once(
"attribute 'mask' given as CSS");
682 object->setAttribute(
"mask", val);
686 if( !
filter.inherit )
filter.readIfUnset( val, source );
692 g_warning(
"Inkscape currently only supports color-interpolation = sRGB");
699 p->readIfUnset(val, source);
701 g_warning(
"Unimplemented style property %d", (
int)
id);
727 g_warning(
"Unimplemented style property %d", (
int)
id);
758 Glib::ustring style_string;
759 for(std::vector<SPIBase*>::size_type i = 0; i !=
_properties.size(); ++i) {
760 if( base !=
nullptr ) {
763 style_string +=
_properties[i]->write( flags, style_src_req,
nullptr );
770 style_string += pair.first +
":" + pair.second +
";";
774 if( style_string.size() > 0 ) {
775 style_string.erase( style_string.size() - 1 );
819 for(std::vector<SPIBase*>::size_type i = 0; i !=
_properties.size(); ++i) {
845 for(std::vector<SPIBase*>::size_type i = 0; i !=
_properties.size(); ++i) {
860 Glib::ustring css_str;
894 for(std::vector<SPIBase*>::size_type i = 0; i !=
_properties.size(); ++i) {
920 if (decl_list->
next) {
940 gchar *
const str_value =
reinterpret_cast<gchar *
>(str_value_unsigned);
943 gchar
const *important = decl->
important ?
" !important" :
"";
945 os << str_value << important;
951 gchar
const *
key = decl->property->stryng->str;
954 if (g_str_has_prefix(
key,
"--")) {
955 g_warning(
"Ignoring CSS variable: %s",
key);
956 }
else if (g_str_has_prefix(
key,
"-")) {
959 g_warning(
"Ignoring unrecognized CSS property: %s",
key);
1007 g_return_if_fail(status ==
CR_OK);
1019 std::string feature_string;
1021 feature_string +=
"liga 0, clig 0, ";
1023 feature_string +=
"dlig, ";
1025 feature_string +=
"hlig, ";
1027 feature_string +=
"calt 0, ";
1031 feature_string +=
"subs, ";
1034 feature_string +=
"sups, ";
1039 feature_string +=
"smcp, ";
1042 feature_string +=
"smcp, c2sc, ";
1045 feature_string +=
"pcap, ";
1048 feature_string +=
"pcap, c2pc, ";
1051 feature_string +=
"unic, ";
1054 feature_string +=
"titl, ";
1058 feature_string +=
"lnum, ";
1060 feature_string +=
"onum, ";
1062 feature_string +=
"pnum, ";
1064 feature_string +=
"tnum, ";
1066 feature_string +=
"frac, ";
1068 feature_string +=
"afrc, ";
1070 feature_string +=
"ordn, ";
1072 feature_string +=
"zero, ";
1075 feature_string +=
"jp78, ";
1077 feature_string +=
"jp83, ";
1079 feature_string +=
"jp90, ";
1081 feature_string +=
"jp04, ";
1083 feature_string +=
"smpl, ";
1085 feature_string +=
"trad, ";
1087 feature_string +=
"fwid, ";
1089 feature_string +=
"pwid, ";
1091 feature_string +=
"ruby, ";
1094 if (val[0] && strcmp(val,
"normal")) {
1096 feature_string += val;
1097 feature_string +=
", ";
1100 if (feature_string.empty()) {
1101 feature_string =
"normal";
1104 feature_string.resize(feature_string.size() - 2);
1107 return feature_string;
1128 auto filter =
static_cast<SPFilter*
>(obj);
1132 if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG)) {
1150 static_cast<SPFilter*
>(old_ref)->_refcount--;
1154 if (is<SPFilter>(
ref)) {
1199 if (is<SPPaintServer>(
ref)) {
1216 if (is<SPPaintServer>(
ref)) {
1255 paint->
href = std::make_shared<SPPaintServerReference>(style->
object);
1256 }
else if (document || style->
document) {
1258 paint->
href = std::make_shared<SPPaintServerReference>(document ? document : style->
document);
1260 std::cerr <<
"sp_style_set_ipaint_to_uri: No valid object or document!" << std::endl;
1264 if (paint == &style->
fill) {
1272 if (paint->
href->getObject()){
1273 paint->
href->detach();
1277 paint->
href->attach(*uri);
1279 g_warning(
"%s", e.what());
1280 paint->
href->detach();
1293 g_warning(
"URI failed to parse: %s", uri);
1322 default:
return "px";
1334 double unit_size =
size;
1336 if (font_size == 0) {
1337 g_warning(
"sp_style_get_css_font_size_units: passed in zero font_size");
1338 font_size = SP_CSS_FONT_SIZE_DEFAULT;
1355 g_warning(
"sp_style_get_css_font_size_units conversion to %d not implemented.", unit);
1384 if (repr ==
nullptr)
return;
1388 gchar *val = g_strdup_printf(
"url(#%s)", linked->
getId());
1411 g_return_val_if_fail(style !=
nullptr, NULL);
1415 Glib::ustring style_str = style->
write(flags);
1433 if (object->
style) {
1532 return (g_ascii_strncasecmp(p,
"url(", 4) == 0);
1569 double ex,
bool only_with_units =
false)
1573 gchar *units =
nullptr;
1574 double wd = g_ascii_strtod(
w, &units) * ex;
1578 if (only_with_units && (units ==
nullptr || *units ==
'\0' || *units ==
'%' || *units ==
'e')) {
1599 gchar **a = g_strsplit(
string,
",", 10000);
1601 for (gchar **i = a; i !=
nullptr; i++) {
1605 gchar *units =
nullptr;
1606 double wd = g_ascii_strtod(
w, &units) * ex;
1654 for( Glib::ustring::iterator it = val.begin(); it != val.end(); ++it) {
1655 if(g_ascii_isalnum(*it) || *it==
'-' || *it==
'_' || *it > 0xA0) {
1657 }
else if (*it ==
'\'') {
1668 if( it == val.begin() && !g_ascii_isalpha(*it) ) {
1675 out.insert( out.begin(),
'\'' );
1689 std::vector<Glib::ustring> tokens = Glib::Regex::split_simple(
"\\s*,\\s*", val );
1692 for(
auto & token : tokens) {
1694 val += token +
", ";
1696 if( val.size() > 1 )
1697 val.erase( val.size() - 2 );
1708 if( val.size() > 1 &&
1709 ( (val[0] ==
'"' && val[val.size()-1] ==
'"' ) ||
1710 (val[0] ==
'\'' && val[val.size()-1] ==
'\'' ) ) ) {
1713 val.erase( val.size()-1 );
1726 std::vector<Glib::ustring> tokens = Glib::Regex::split_simple(
"\\s*,\\s*", val );
1729 for(
auto & token : tokens) {
1731 val += token +
", ";
1733 if( val.size() > 1 )
1734 val.erase( val.size() - 2 );
SPAttr sp_attribute_lookup(gchar const *key)
Get attribute id by name.
static SPStyleProp const props[]
Lookup dictionary for attributes/properties.
Lookup dictionary for attributes/properties.
@ FONT_VARIANT_EAST_ASIAN
@ FONT_VARIANT_ALTERNATES
@ INVALID
Must have value 0.
@ COLOR_INTERPOLATION_FILTERS
@ FONT_VARIATION_SETTINGS
TODO: insert short description here.
A thin wrapper around std::ostringstream, but writing floating point numbers in the format required b...
Preference storage class.
std::vector< Entry > getAllEntries(Glib::ustring const &path)
Get all entries from the specified directory.
static Preferences * get()
Access the singleton Preferences object.
Represents an URI as per RFC 2396.
static double convert(double from_dist, Unit const *from, Unit const *to)
Convert distances.
Interface for refcounted XML nodes.
virtual Node * parent()=0
Get the parent of this node.
void setAttribute(Util::const_char_ptr key, Util::const_char_ptr value)
Change an attribute of this node.
virtual char const * attribute(char const *key) const =0
Get the string representation of a node's attribute.
Node * createElement(char const *name) override
Typed SVG document implementation.
SPDocument * get_reference_document()
CRCascade * getStyleCascade()
Virtual base class for all SPStyle internal classes.
Paint type internal to SPStyle.
std::shared_ptr< SPPaintServerReference > href
SPObject is an abstract base class of all of the document nodes at the SVG document level.
void requestModified(unsigned int flags)
Requests that a modification notification signal be emitted later (e.g.
char const * getId() const
Returns the objects current ID string.
SPStyle * style
Represents the style properties, whether from presentation attributes, the style attribute,...
Inkscape::XML::Node * getRepr()
Returns the XML representation of tree.
void requestDisplayUpdate(unsigned int flags)
Queues an deferred update of this object's display.
T< SPAttr::FONT_VARIANT_EAST_ASIAN, SPIEastAsian > font_variant_east_asian
Font variant East Asian.
void merge(SPStyle const *parent)
Combine style and parent style specifications into a single style specification that preserves (as mu...
T< SPAttr::COLOR_INTERPOLATION, SPIEnum< SPColorInterpolation > > color_interpolation
color-interpolation
T< SPAttr::COLOR, SPIColor > color
color
T< SPAttr::SHAPE_PADDING, SPILength > shape_padding
void mergeCSS(SPCSSAttr *css)
sigc::signal< void(SPObject *, SPObject *)> signal_fill_ps_changed
Emitted when the fill paint server changes, meaning it starts pointing to a different object.
Glib::ustring writeIfDiff(SPStyle const *base) const
Get CSS string for set properties which are different from the given base style.
sigc::connection fill_ps_changed_connection
SPPaintServer * getFillPaintServer()
T< SPAttr::FILL, SPIPaint > fill
fill
bool block_filter_bbox_updates
(hack) Temporarily set to true to block filter changes from updating the object's bbox in situations ...
T< SPAttr::STROKE, SPIPaint > stroke
stroke
T< SPAttr::STOP_COLOR, SPIColor > stop_color
gradient-stop
T< SPAttr::LINE_HEIGHT, SPILengthOrNormal > line_height
Line height (css2 10.8.1)
SPPaintServer * getStrokePaintServer()
void _mergeDeclList(CRDeclaration const *decl_list, SPStyleSrc const &source)
SPObject * object
Object we are attached to.
T< SPAttr::FONT_FEATURE_SETTINGS, SPIString > font_feature_settings
Font feature settings (Low level access to TrueType tables)
T< SPAttr::LETTER_SPACING, SPILengthOrNormal > letter_spacing
letter spacing (css2 16.4)
void mergeStatement(CRStatement *statement)
Append an existing css statement into this style, used in css editing always appends declarations as ...
void _mergeProps(CRPropList *props)
void readFromObject(SPObject *object)
Read style properties from object's repr.
T< SPAttr::MARKER_END, SPIString > marker_end
T< SPAttr::STROKE_WIDTH, SPILength > stroke_width
stroke-width
bool cloned
style belongs to a cloned object
std::string getFontFeatureString()
Return a font feature string useful for Pango.
T< SPAttr::TEXT_DECORATION_COLOR, SPIColor > text_decoration_color
T< SPAttr::TEXT_DECORATION, SPITextDecoration > text_decoration
text decoration (css2 16.3.1)
Glib::ustring write(unsigned flags, SPStyleSrc style_src_req, SPStyle const *base=nullptr) const
std::map< std::string, std::string > extended_properties
T< SPAttr::MARKER_START, SPIString > marker_start
SPIPaint * getFillOrStroke(bool fill_)
Get either the fill or the stroke property.
T< SPAttr::WORD_SPACING, SPILengthOrNormal > word_spacing
word spacing (also css2 16.4)
std::vector< SPIBase * > _properties
Pointers to all the properties (for looping through them)
sigc::signal< void(SPObject *, SPObject *)> signal_stroke_ps_changed
Emitted when the stroke paint server changes, meaning it starts pointing to a different object.
sigc::connection filter_modified_connection
void mergeString(char const *p)
Parses a style="..." string and merges it with an existing SPStyle.
T< SPAttr::MARKER_MID, SPIString > marker_mid
void readIfUnset(SPAttr id, char const *val, SPStyleSrc const &source=SPStyleSrc::STYLE_PROP)
T< SPAttr::INLINE_SIZE, SPILength > inline_size
void read(SPObject *object, Inkscape::XML::Node *repr)
T< SPAttr::FONT_VARIANT_NUMERIC, SPINumeric > font_variant_numeric
Font variant numeric (numerical formatting)
T< SPAttr::MARKER, SPIString > marker
Marker list.
SPStyle(SPDocument *document=nullptr, SPObject *object=nullptr)
T< SPAttr::SHAPE_INSIDE, SPIShapes > shape_inside
SVG2 Text Wrapping.
sigc::connection filter_changed_connection
sigc::connection fill_ps_modified_connection
T< SPAttr::FONT_VARIANT_CAPS, SPIEnum< SPCSSFontVariantCaps > > font_variant_caps
Font variant caps (small caps)
void _mergeObjectStylesheet(SPObject const *object)
sigc::connection stroke_ps_changed_connection
T< SPAttr::FILTER, SPIFilter > filter
Filter effect.
T< SPAttr::FONT_VARIANT_POSITION, SPIEnum< SPCSSFontVariantPosition > > font_variant_position
Font variant position (subscript/superscript)
T< SPAttr::FONT, SPIFont > font
Font shorthand.
SPIString * marker_ptrs[SP_MARKER_LOC_QTY]
T< SPAttr::STROKE_DASHOFFSET, SPILength > stroke_dashoffset
stroke-dashoffset
T< SPAttr::SHAPE_MARGIN, SPILength > shape_margin
T< SPAttr::SOLID_COLOR, SPIColor > solid_color
solid-color
T< SPAttr::SHAPE_SUBTRACT, SPIShapes > shape_subtract
bool operator==(SPStyle const &rhs) const
sigc::signal< void(SPObject *, SPObject *)> signal_filter_changed
Emitted when the filter changes, meaning it starts pointing to a different object.
T< SPAttr::TEXT_INDENT, SPILength > text_indent
First line indent of paragraphs (css2 16.1)
void readFromPrefs(Glib::ustring const &path)
Read style properties from preferences.
void _mergeString(char const *p)
sigc::connection stroke_ps_modified_connection
void cascade(SPStyle const *parent)
Sets computed values in style, which may involve inheriting from (or in some other way calculating fr...
T< SPAttr::FONT_VARIANT_LIGATURES, SPILigatures > font_variant_ligatures
Font variant ligatures.
sigc::connection release_connection
SPDocument * document
Document we are associated with.
void _mergeDecl(CRDeclaration const *decl, SPStyleSrc const &source)
T< SPAttr::BASELINE_SHIFT, SPIBaselineShift > baseline_shift
Baseline shift (svg1.1 10.9.2)
CRDeclaration * cr_declaration_parse_list_from_buf(const guchar *a_str, enum CREncoding a_enc)
void cr_declaration_destroy(CRDeclaration *a_this)
void cr_prop_list_destroy(CRPropList *a_this)
typedefG_BEGIN_DECLS struct _CRPropList CRPropList
CRPropList * cr_prop_list_get_next(CRPropList *a_this)
enum CRStatus cr_prop_list_get_decl(CRPropList const *a_this, CRDeclaration **a_decl)
The declaration of the CRSelEng class.
typedefG_BEGIN_DECLS struct _CRSelEng CRSelEng
CRSelEng * cr_sel_eng_new(CRNodeIface const *)
enum CRStatus cr_sel_eng_get_matched_properties_from_cascade(CRSelEng *a_this, CRCascade *a_cascade, CRXMLNodePtr a_node, CRPropList **a_props)
enum CRStatus cr_statement_ruleset_get_declarations(CRStatement *a_this, CRDeclaration **a_decl_list)
guchar * cr_term_to_string(CRTerm const *a_this)
CRStatus
The status type returned by the methods of the croco library.
TODO: insert short description here.
TODO: insert short description here.
std::shared_ptr< Css const > css
static char const *const parent
static InkscapeApplication * _instance
static R & release(R &r)
Decrements the reference count of a anchored object.
T * get(GValue *value)
Returns a borrowed pointer to the T held by a value if it holds one, else nullptr.
CRNodeIface const croco_node_iface
Interface for XML nodes used by libcroco.
static cairo_user_data_key_t key
Singleton class to access the preferences file in a convenient way.
SPCSSAttr * sp_repr_css_attr_new()
Creates an empty SPCSSAttr (a class for manipulating CSS style properties).
void sp_repr_css_write_string(SPCSSAttr *css, Glib::ustring &str)
Write a style attribute string from a list of properties stored in an SPCSAttr object.
void sp_repr_css_change(Node *repr, SPCSSAttr *css, gchar const *attr)
Creates a new SPCSAttr with the values filled from a repr, merges in properties from the given SPCSAt...
void sp_repr_css_attr_unref(SPCSSAttr *css)
Unreferences an SPCSSAttr (will be garbage collected if no references remain).
void sp_repr_css_change_recursive(Node *repr, SPCSSAttr *css, gchar const *attr)
char const * sp_repr_css_property(SPCSSAttr *css, gchar const *name, gchar const *defval)
Returns a character string of the value of a given style property or a default value if the attribute...
void sp_repr_css_unset_property(SPCSSAttr *css, gchar const *name)
Set a style property to "inkscape:unset".
void sp_repr_css_set_property(SPCSSAttr *css, gchar const *name, gchar const *value)
Set a style property to a new value (e.g.
void sp_repr_css_attr_add_from_string(SPCSSAttr *css, gchar const *p)
Use libcroco to parse a string for CSS properties and then merge them into an existing SPCSSAttr.
Inkscape::XML::SimpleDocument - generic XML document implementation.
CRString *CRTerm * value
The property.
The abstraction of css statement as defined in the chapter 4 and appendix D.1 of the css2 spec.
enum CRStatementType type
The type of the statement.
@ SP_CSS_SHAPE_RENDERING_AUTO
@ SP_CSS_TEXT_ANCHOR_START
@ SP_CSS_OVERFLOW_VISIBLE
@ SP_CSS_FONT_VARIANT_LIGATURES_CONTEXTUAL
@ SP_CSS_FONT_VARIANT_LIGATURES_DISCRETIONARY
@ SP_CSS_FONT_VARIANT_LIGATURES_HISTORICAL
@ SP_CSS_FONT_VARIANT_LIGATURES_COMMON
@ SP_CSS_TEXT_RENDERING_AUTO
@ SP_CSS_FONT_VARIANT_NUMERIC_TABULAR_NUMS
@ SP_CSS_FONT_VARIANT_NUMERIC_STACKED_FRACTIONS
@ SP_CSS_FONT_VARIANT_NUMERIC_OLDSTYLE_NUMS
@ SP_CSS_FONT_VARIANT_NUMERIC_SLASHED_ZERO
@ SP_CSS_FONT_VARIANT_NUMERIC_DIAGONAL_FRACTIONS
@ SP_CSS_FONT_VARIANT_NUMERIC_PROPORTIONAL_NUMS
@ SP_CSS_FONT_VARIANT_NUMERIC_ORDINAL
@ SP_CSS_FONT_VARIANT_NUMERIC_LINING_NUMS
@ SP_CSS_BACKGROUND_ACCUMULATE
@ SP_STROKE_LINEJOIN_MITER
@ SP_CSS_COLOR_RENDERING_AUTO
@ SP_CSS_TEXT_ALIGN_START
@ SP_CSS_FONT_VARIANT_NORMAL
@ SP_CSS_FONT_STYLE_NORMAL
@ SP_CSS_IMAGE_RENDERING_AUTO
@ SP_CSS_FONT_STRETCH_NORMAL
@ SP_CSS_FONT_VARIANT_CAPS_ALL_SMALL
@ SP_CSS_FONT_VARIANT_CAPS_SMALL
@ SP_CSS_FONT_VARIANT_CAPS_ALL_PETITE
@ SP_CSS_FONT_VARIANT_CAPS_NORMAL
@ SP_CSS_FONT_VARIANT_CAPS_UNICASE
@ SP_CSS_FONT_VARIANT_CAPS_TITLING
@ SP_CSS_FONT_VARIANT_CAPS_PETITE
@ SP_CSS_COLOR_INTERPOLATION_SRGB
@ SP_CSS_COLOR_INTERPOLATION_LINEARRGB
@ SP_CSS_TEXT_TRANSFORM_NONE
@ SP_CSS_FONT_VARIANT_EAST_ASIAN_RUBY
@ SP_CSS_FONT_VARIANT_EAST_ASIAN_JIS04
@ SP_CSS_FONT_VARIANT_EAST_ASIAN_PROPORTIONAL_WIDTH
@ SP_CSS_FONT_VARIANT_EAST_ASIAN_JIS78
@ SP_CSS_FONT_VARIANT_EAST_ASIAN_JIS90
@ SP_CSS_FONT_VARIANT_EAST_ASIAN_TRADITIONAL
@ SP_CSS_FONT_VARIANT_EAST_ASIAN_FULL_WIDTH
@ SP_CSS_FONT_VARIANT_EAST_ASIAN_JIS83
@ SP_CSS_FONT_VARIANT_EAST_ASIAN_SIMPLIFIED
@ SP_CSS_FONT_VARIANT_ALTERNATES_NORMAL
@ SP_CSS_WRITING_MODE_LR_TB
@ SP_CSS_FONT_VARIANT_POSITION_SUB
@ SP_CSS_FONT_VARIANT_POSITION_SUPER
@ SP_CSS_FONT_VARIANT_POSITION_NORMAL
@ SP_CSS_WHITE_SPACE_NORMAL
@ SP_CSS_TEXT_ORIENTATION_MIXED
@ SP_CSS_FONT_WEIGHT_NORMAL
@ SP_CSS_VISIBILITY_VISIBLE
void sp_style_filter_ref_changed(SPObject *old_ref, SPObject *ref, SPStyle *style)
Gets called when the filter is (re)attached to the style.
void sp_style_fill_paint_server_ref_changed(SPObject *old_ref, SPObject *ref, SPStyle *style)
Gets called when the paintserver is (re)attached to the style.
void sp_style_stroke_paint_server_ref_changed(SPObject *old_ref, SPObject *ref, SPStyle *style)
Gets called when the paintserver is (re)attached to the style.
static const unsigned SP_STYLE_FLAG_IFSET(1<< 0)
static const unsigned SP_STYLE_FLAG_ALWAYS(1<< 2)
static const unsigned SP_STYLE_FLAG_IFSRC(1<< 3)
static const unsigned SP_STYLE_FLAG_IFDIFF(1<< 1)
static CRSelEng * sp_repr_sel_eng()
SPCSSAttr * sp_css_attr_unset_blacklist(SPCSSAttr *css)
Unset properties that should not be set for default tool style.
void sp_style_filter_ref_changed(SPObject *old_ref, SPObject *ref, SPStyle *style)
Gets called when the filter is (re)attached to the style.
void sp_style_set_ipaint_to_uri_string(SPStyle *style, SPIPaint *paint, const gchar *uri)
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...
static void sp_style_filter_ref_modified(SPObject *obj, unsigned flags, SPStyle *style)
Emit style modified signal on style's object if the filter changed.
void sp_style_set_property_url(SPObject *item, gchar const *property, SPObject *linked, bool recursive)
SPCSSAttr * sp_css_attr_from_object(SPObject *object, guint const flags)
SPCSSAttr * sp_css_attr_unset_text(SPCSSAttr *css)
Unset any text-related properties.
static constexpr int BMAX
SPCSSAttr * sp_css_attr_scale(SPCSSAttr *css, double ex)
Scale any properties that may hold <length> by ex.
void css_quote(Glib::ustring &val)
Quote and/or escape string for writing to CSS, changing strings in place.
void sp_style_fill_paint_server_ref_changed(SPObject *old_ref, SPObject *ref, SPStyle *style)
Gets called when the paintserver is (re)attached to the style.
void sp_style_set_to_uri(SPStyle *style, bool isfill, Inkscape::URI const *uri)
double sp_style_css_size_px_to_units(double size, int unit, double font_size)
SPCSSAttr * sp_css_attr_unset_uris(SPCSSAttr *css)
Unset any properties that contain URI values.
void sp_style_stroke_paint_server_ref_changed(SPObject *old_ref, SPObject *ref, SPStyle *style)
Gets called when the paintserver is (re)attached to the style.
static void sp_style_object_release(SPObject *object, SPStyle *style)
Release callback.
static void sp_style_paint_server_ref_modified(SPObject *obj, unsigned, SPStyle *style)
Emit style modified signal on style's object if server is style's fill or stroke paint server.
double sp_style_css_size_units_to_px(double size, int unit, double font_size)
static bool is_url(char const *p)
static void sp_css_attr_scale_property_single(SPCSSAttr *css, gchar const *property, double ex, bool only_with_units=false)
Scale a single-value property.
void css_unquote(Glib::ustring &val)
Remove paired single and double quotes from a string, changing string in place.
void sp_style_set_ipaint_to_uri(SPStyle *style, SPIPaint *paint, const Inkscape::URI *uri, SPDocument *document)
SPCSSAttr * sp_css_attr_from_style(SPStyle const *const style, guint const flags)
static void sp_css_attr_scale_property_list(SPCSSAttr *css, gchar const *property, double ex)
Scale a list-of-values property.
void css_font_family_quote(Glib::ustring &val)
Quote font names in font-family lists, changing string in place.
gchar const * sp_style_get_css_unit_string(int unit)
SPStyle - a style object for SPItem objects.
SPIBase SPStyle::* SPIBasePtr