29#include <sigc++/bind.h>
30#include <glibmm/regex.h>
31#include <glibmm/ustring.h>
70 auto &
name = names[(int)
id()];
73 name = namecstr ? namecstr :
"anonymous";
110 if (base &&
inherits && *base == *
this) {
131 if ( !value.empty() ) {
135 return Glib::ustring(
"");
145 assert(str !=
nullptr);
147 constexpr size_t N = 10;
148 auto pos = strlen(str);
150 if (pos >=
N && strncmp(str + pos -
N,
"!important",
N) == 0) {
154 while (pos > 0 && g_ascii_isspace(str[pos - 1])) {
158 stripped.assign(str, pos);
174 bool has_important =
false;
175 std::string stripped;
181 str = stripped.c_str();
204 if ( !strcmp(str,
"inherit") ) {
219 if (this->
inherit)
return Glib::ustring(
"inherit");
228 std::cerr <<
"SPIFloat::cascade(): Incorrect parent type" << std::endl;
236 if( (!
set ||
inherit) && p->set && !(p->inherit) ) {
243 std::cerr <<
"SPIFloat::merge(): Incorrect parent type" << std::endl;
265 if ( !strcmp(str,
"inherit") ) {
273 value_in = CLAMP(value_in, 0.0, 1.0);
274 value = SP_SCALE24_FROM_FLOAT( value_in );
281 if (this->
inherit)
return Glib::ustring(
"inherit");
290 std::cerr <<
"SPIScale24::cascade(): Incorrect parent type" << std::endl;
298 if( (!
set ||
inherit) && p->set && !(p->inherit) ) {
306 std::cerr <<
"SPIScale24::merge: unhandled property: " <<
name().raw() << std::endl;
318 std::cerr <<
"SPIScale24::merge(): Incorrect parent type" << std::endl;
340 if (!strcmp(str,
"inherit")) {
349 value_tmp = g_ascii_strtod(str, &e);
350 if ( !std::isfinite(value_tmp) ) {
353 if ((gchar
const *) e != str) {
360 }
else if (!strcmp(e,
"px")) {
364 }
else if (!strcmp(e,
"pt")) {
368 }
else if (!strcmp(e,
"pc")) {
371 }
else if (!strcmp(e,
"mm")) {
374 }
else if (!strcmp(e,
"cm")) {
377 }
else if (!strcmp(e,
"in")) {
380 }
else if (!strcmp(e,
"em")) {
388 }
else if (!strcmp(e,
"ex")) {
396 }
else if (!strcmp(e,
"%")) {
420 if (this->
inherit)
return Glib::ustring(
"inherit");
422 auto unit_out = Glib::ustring(
"");
423 switch (this->
unit) {
474 std::cerr <<
"SPILength::cascade(): Incorrect parent type" << std::endl;
482 if( (!
set ||
inherit) && p->set && !(p->inherit) ) {
498 if (!std::isfinite(
value)) {
510 std::cerr <<
"SPIFloat::merge(): Incorrect parent type" << std::endl;
541 if(
unit != r->unit )
return false;
564 if ( !strcmp(str,
"normal") ) {
578 if (this->
normal)
return Glib::ustring(
"normal");
590 std::cerr <<
"SPILengthOrNormal::cascade(): Incorrect parent type" << std::endl;
598 if( (!
set ||
inherit) && p->set && !(p->inherit) ) {
609 if(
normal && r->normal ) {
return true; }
610 if(
normal != r->normal ) {
return false; }
625 if ( !strcmp(str,
"normal") ) {
634 std::vector<Glib::ustring> tokens = Glib::Regex::split_simple(
",", str);
642 Glib::RefPtr<Glib::Regex> regex = Glib::Regex::create(
644 "\\s+([-+]?\\d*\\.?\\d+([eE][-+]?\\d+)?)");
645 Glib::MatchInfo matchInfo;
647 for (
auto token: tokens) {
648 regex->match(token, matchInfo);
649 if (matchInfo.matches()) {
650 float value = std::stod(matchInfo.fetch(2));
651 axes.insert(std::pair<Glib::ustring,float>(matchInfo.fetch(1), value));
664 if (this->
normal)
return Glib::ustring(
"normal");
665 auto ret = Glib::ustring(
"");
669 if (!ret.empty()) ret.erase(ret.size() - 2);
682 std::cerr <<
"SPIFontVariationSettings::cascade(): Incorrect parent type" << std::endl;
690 if( (!
set ||
inherit) && p->set && !(p->inherit) ) {
702 if(
normal && r->normal ) {
return true; }
703 if(
normal != r->normal ) {
return false; }
704 return axes == r->axes;
715 for (
const auto & axe :
axes){
716 os << axe.first <<
"=" << axe.second <<
",";
719 std::string
string = os.
str();
720 if (!
string.empty()) {
789 if( !strcmp(str,
"inherit") ) {
793 auto const *enums = get_enums<T>();
794 for (
unsigned i = 0; enums[i].key; i++) {
795 if (!strcmp(str, enums[i].
key)) {
798 value =
static_cast<T
>(enums[i].value);
815 if (!strcmp(str,
"inherit")) {
820 bool translated =
false;
821 for (
unsigned i = 0; enums[i].key; i++) {
822 if (!strcmp(str, enums[i].
key)) {
832 if (!translated && isdigit(*str)) {
849 if (this->inherit)
return Glib::ustring(
"inherit");
851 auto val =
static_cast<int>(value);
852 for (
unsigned i = 0; enums[i].key; ++i) {
853 if (enums[i].value == val) {
854 return Glib::ustring(enums[i].
key);
857 if (val > 0 && val <= 1000) {
858 return Glib::ustring::format(val);
860 return Glib::ustring(
"");
867 if (this->inherit)
return Glib::ustring(
"inherit");
868 auto const *enums = get_enums<T>();
869 for (
unsigned i = 0; enums[i].key; ++i) {
870 if (enums[i].value ==
static_cast< gint
> (this->value) ) {
871 return Glib::ustring(enums[i].
key);
874 return Glib::ustring(
"");
905 if( inherits && (!
set || inherit) ) {
906 computed = p->computed;
909 update_computed_cascade(p->computed);
912 std::cerr <<
"SPIEnum<T>::cascade(): Incorrect parent type" << std::endl;
922 if (value == p.
value) {
924 }
else if ((value == smaller && p.
value == larger) ||
925 (value == larger && p.
value == smaller)) {
928 }
else if (value == smaller || value == larger) {
951 if( p->set && !p->inherit ) {
952 if( !
set || inherit ) {
954 inherit = p->inherit;
956 computed = p->computed;
959 update_value_merge(*p);
969 if (
auto *r =
dynamic_cast<const SPIEnum<T> *
>(&rhs)) {
984 if( !strcmp(str,
"inherit") ) {
988 for (
unsigned i = 0; enums[i].key; i++) {
989 if (!strcmp(str, enums[i].
key)) {
992 value |= enums[i].value;
1002 if (this->
inherit)
return Glib::ustring(
"inherit");
1003 if (this->
value == 0)
return Glib::ustring(
"normal");
1004 auto ret = Glib::ustring(
"");
1005 for (
unsigned i = 0; enums[i].key; ++i) {
1007 if (!ret.empty()) ret +=
" ";
1008 ret += enums[i].key;
1023 if( !strcmp(str,
"inherit") ) {
1026 }
else if (!strcmp(str,
"normal" )) {
1030 }
else if (!strcmp(str,
"none" )) {
1036 std::vector<Glib::ustring> tokens = Glib::Regex::split_simple(
"\\s+", str );
1038 for(
auto & token : tokens) {
1039 for (
unsigned j = 0; enums[j].key; ++j ) {
1040 if (token.compare( enums[j].key ) == 0 ) {
1048 value &= ~(enums[j].value >> 4);
1061 if (this->
inherit)
return Glib::ustring(
"inherit");
1064 auto ret = Glib::ustring(
"");
1066 ret +=
"no-common-ligatures ";
1068 ret +=
"discretionary-ligatures ";
1070 ret +=
"historical-ligatures ";
1072 ret +=
"no-contextual ";
1073 ret.erase(ret.size() - 1);
1085 if( !strcmp(str,
"inherit") ) {
1088 }
else if (!strcmp(str,
"normal" )) {
1094 std::vector<Glib::ustring> tokens = Glib::Regex::split_simple(
"\\s+", str );
1096 for(
auto & token : tokens) {
1097 for (
unsigned j = 0; enums[j].key; ++j ) {
1098 if (token.compare( enums[j].key ) == 0 ) {
1104 switch (enums[j].
value ) {
1106 value &= ~SP_CSS_FONT_VARIANT_NUMERIC_OLDSTYLE_NUMS;
1109 value &= ~SP_CSS_FONT_VARIANT_NUMERIC_LINING_NUMS;
1113 value &= ~SP_CSS_FONT_VARIANT_NUMERIC_TABULAR_NUMS;
1116 value &= ~SP_CSS_FONT_VARIANT_NUMERIC_PROPORTIONAL_NUMS;
1120 value &= ~SP_CSS_FONT_VARIANT_NUMERIC_STACKED_FRACTIONS;
1123 value &= ~SP_CSS_FONT_VARIANT_NUMERIC_DIAGONAL_FRACTIONS;
1133 std::cerr <<
"SPINumeric::read(): Invalid value." << std::endl;
1146 if (this->
inherit)
return Glib::ustring(
"inherit");
1147 if (this->
value == 0)
return Glib::ustring(
"normal");
1148 auto ret = Glib::ustring(
"");
1150 for (
unsigned i = 1; enums[i].key; ++i) {
1152 if (this->
value & (1 << (i - 1))) {
1153 if (!ret.empty()) ret +=
" ";
1154 ret += enums[i].
key;
1168 if( !strcmp(str,
"inherit") ) {
1171 }
else if (!strcmp(str,
"normal" )) {
1177 std::vector<Glib::ustring> tokens = Glib::Regex::split_simple(
"\\s+", str );
1179 for(
auto & token : tokens) {
1180 for (
unsigned j = 0; enums[j].key; ++j ) {
1181 if (token.compare( enums[j].key ) == 0 ) {
1186 switch (enums[j].
value ) {
1193 value &= ~SP_CSS_FONT_VARIANT_EAST_ASIAN_JIS78;
1194 value &= ~SP_CSS_FONT_VARIANT_EAST_ASIAN_JIS83;
1195 value &= ~SP_CSS_FONT_VARIANT_EAST_ASIAN_JIS90;
1196 value &= ~SP_CSS_FONT_VARIANT_EAST_ASIAN_JIS04;
1197 value &= ~SP_CSS_FONT_VARIANT_EAST_ASIAN_SIMPLIFIED;
1198 value &= ~SP_CSS_FONT_VARIANT_EAST_ASIAN_TRADITIONAL;
1202 value &= ~SP_CSS_FONT_VARIANT_EAST_ASIAN_PROPORTIONAL_WIDTH;
1205 value &= ~SP_CSS_FONT_VARIANT_EAST_ASIAN_FULL_WIDTH;
1214 std::cerr <<
"SPIEastasian::read(): Invalid value." << std::endl;
1228 if (this->
inherit)
return Glib::ustring(
"inherit");
1229 if (this->
value == 0)
return Glib::ustring(
"normal");
1230 auto ret = Glib::ustring(
"");
1232 for (
unsigned i = 0; enums[i].key; ++i) {
1233 if (this->
value & (1 << i)) {
1234 if (!ret.empty()) ret +=
" ";
1235 ret += enums[i].
key;
1250 if (!strcmp(str,
"inherit")) {
1257 Glib::ustring str_temp;
1263 str = str_temp.c_str();
1267 str = str_temp.c_str();
1285 }
else if (
auto *v =
value()) {
1307 return "sans-serif";
1328 _value = g_strdup(p->_value);
1331 std::cerr <<
"SPIString::cascade(): Incorrect parent type" << std::endl;
1339 if( (!
set ||
inherit) && p->set && !(p->inherit) ) {
1343 _value = g_strdup(p->_value);
1381 if (
set->includes(
ref->getObject())) {
1396 std::cerr <<
"SPIShapes::read: no style!" << std::endl;
1408 std::cerr <<
" No object" << std::endl;
1415 std::vector<Glib::ustring> shapes_url = Glib::Regex::split_simple(
" ", str);
1416 for (
auto shape_url : shapes_url) {
1417 if ( shape_url.compare(0,5,
"url(#") != 0 || shape_url.compare(shape_url.size()-1,1,
")") != 0 ){
1418 std::cerr <<
"SPIShapes::read: Invalid shape value: " << shape_url.raw() << std::endl;
1427 hrefs.emplace_back(href);
1445 for (
auto href :
hrefs) {
1465 g_error(
"Can not get Document CMS manager.");
1508 if ( !strcmp(str,
"inherit") ) {
1511 }
else if ( !strcmp(str,
"currentColor") ) {
1519 std::cerr <<
"SPIColor::read(): value is 'currentColor' but 'color' not available." << std::endl;
1526 if (std::string(str).find(
"icc") != std::string::npos) {
1527 g_error(
"CMS color '%s' not parsed, no CMS document available.", str);
1530 _color = Colors::Color::parse(str);
1539 if (this->
currentcolor)
return Glib::ustring(
"currentColor");
1540 if (this->
inherit)
return Glib::ustring(
"inherit");
1555 std::cerr <<
"SPIColor::cascade(): Incorrect parent type" << std::endl;
1564 if( (!
set ||
inherit) && p->set && !(p->inherit) ) {
1581 if ((
_color && !r->_color) || (!
_color && r->_color)) {
1617 g_error(
"Can not get Document CMS manager.");
1644 while (g_ascii_isspace(*str)) {
1648 if (
streq(str,
"inherit")) {
1654 if (
strneq(str,
"url", 3) ) {
1660 std::cerr <<
"SPIPaint::read: url is invalid" << std::endl;
1663 std::cerr <<
"SPIPaint::read: url is empty" << std::endl;
1665 }
else if (!
style ) {
1666 std::cerr <<
"SPIPaint::read: url with empty SPStyle pointer" << std::endl;
1676 }
else if (document) {
1677 href = std::make_shared<SPPaintServerReference>(document);
1679 std::cerr <<
"SPIPaint::read: No valid object or document!" << std::endl;
1696 while ( g_ascii_isspace(*str) ) {
1700 if (
streq(str,
"currentColor")) {
1711 std::cerr <<
"SPIPaint::read(): value is 'currentColor' but 'color' not available." << std::endl;
1714 }
else if (
streq(str,
"context-fill")) {
1718 }
else if (
streq(str,
"context-stroke")) {
1722 }
else if (
streq(str,
"none")) {
1725 }
else if (
auto color =
canHaveCMS() ?
getCMS().parse(str) : Colors::Color::parse(str)) {
1734 if (this->
inherit)
return Glib::ustring(
"inherit");
1735 if (this->
noneSet)
return Glib::ustring(
"none");
1737 auto ret = Glib::ustring(
"");
1738 if (this->
href && this->
href->getURI()) {
1739 ret += this->
href->getURI()->cssStr();
1743 if (!ret.empty()) ret +=
" ";
1744 ret +=
"currentColor";
1747 if (!ret.empty()) ret +=
" ";
1748 ret +=
"context-fill";
1751 if (!ret.empty()) ret +=
" ";
1752 ret +=
"context-stroke";
1756 if (!ret.empty()) ret +=
" ";
1757 ret +=
_color->toString();
1810 if( p->isPaintserver() ) {
1815 std::cerr <<
"SPIPaint::cascade: Expected paint server not found." << std::endl;
1817 }
else if( p->isColor() ) {
1819 }
else if( p->isNoneSet() ) {
1829 g_assert_not_reached();
1839 std::cerr <<
"SPIPaint::cascade(): Incorrect parent type" << std::endl;
1848 if( (!
set ||
inherit) && p->set && !(p->inherit) ) {
1861 if ( (this->
isColor() != r->isColor() ) ||
1862 (this->isPaintserver() != r->isPaintserver() ) ||
1863 (this->paintOrigin != r->paintOrigin ) ||
1864 (this->paintSource != r->paintSource )) {
1869 if( this->
href ==
nullptr || r->href ==
nullptr ||
1870 this->href->getObject() != r->href->getObject() ) {
1899 if (!strcmp(str,
"inherit")) {
1904 value = g_strdup(str);
1906 if (!strcmp(
value,
"normal")) {
1912 bool used[3] = {
false,
false,
false};
1917 if( !strcmp(
c[i],
"fill")) {
1921 }
else if( !strcmp(
c[i],
"stroke")) {
1925 }
else if( !strcmp(
c[i],
"markers")) {
1930 std::cerr <<
"sp_style_read_ipaintorder: illegal value: " <<
c[i] << std::endl;
1964 if (
layer[i] == paint_order)
1968 return paint_order - 1;
1977 for (
unsigned i = 0; i < 3; i++) {
1987 if (this->
inherit)
return Glib::ustring(
"inherit");
1988 auto ret = Glib::ustring(
"");
1991 if (!ret.empty()) ret +=
" ";
1992 switch (this->
layer[i]) {
2019 layer[i] = p->layer[i];
2023 value = g_strdup(p->value);
2026 std::cerr <<
"SPIPaintOrder::cascade(): Incorrect parent type" << std::endl;
2034 if( (!
set ||
inherit) && p->set && !(p->inherit) ) {
2048 if(
layer[i] != r->layer[i] )
return false;
2075 if (
streq(str,
"inherit") ) {
2078 }
else if (
streq(str,
"none")) {
2080 }
else if (
strneq(str,
"url", 3)) {
2083 std::cerr <<
"SPIFilter::read: url is empty or invalid" << std::endl;
2085 }
else if (!
style) {
2086 std::cerr <<
"SPIFilter::read: url with empty SPStyle pointer" << std::endl;
2100 std::cerr <<
"SPIFilter::read(): Could not allocate 'href'" << std::endl;
2109 std::cerr <<
"SPIFilter::read() " << e.what() << std::endl;
2115 std::cerr <<
"SPIFilter::read(): malformed value: " << str << std::endl;
2121 if (this->
inherit)
return Glib::ustring(
"inherit");
2123 return Glib::ustring(
"");
2143 std::cerr <<
"SPIFilter::cascade: value 'inherit' not supported." << std::endl;
2148 std::cerr <<
"SPIFilter::cascade(): Incorrect parent type" << std::endl;
2158 if( (!
set ||
inherit) && p->href && p->href->getObject() ) {
2180 std::cerr <<
"SPIFilter::merge: " << e.what() << std::endl;
2210 if( strcmp( str,
"inherit") == 0 ) {
2217 if( strcmp(str,
"none") == 0) {
2221 std::vector<Glib::ustring> tokens = Glib::Regex::split_simple(
"[(,\\s|\\s)]+", str);
2223 bool LineSolid =
true;
2225 for (
auto token : tokens) {
2227 spilength.
read(token.c_str());
2228 if (spilength.
value > 0.00000001)
2230 values.push_back(spilength);
2241 if (this->
inherit)
return Glib::ustring(
"inherit");
2242 if (this->
values.empty())
return Glib::ustring(
"none");
2243 auto ret = Glib::ustring(
"");
2244 for(
auto value: this->
values) {
2245 if (!ret.empty()) ret +=
", ";
2246 ret += value.toString();
2256 std::cerr <<
"SPIDashArray::cascade(): Incorrect parent type" << std::endl;
2264 if( (!
set ||
inherit) && p->set && !(p->inherit) ) {
2271 std::cerr <<
"SPIDashArray::merge(): Incorrect parent type" << std::endl;
2278 if (
values.size() != r->values.size()) {
2281 for (
int i = 0; i <
values.size(); i++) {
2282 if (
values[i] != r->values[i]) {
2295 return len.value < 0 || !std::isfinite(len.value);
2311 if (!strcmp(str,
"inherit")) {
2314 }
else if ((*str ==
'x') || (*str ==
's') || (*str ==
'm') || (*str ==
'l')) {
2335 value = length.value;
2354 if (this->
inherit)
return Glib::ustring(
"inherit");
2357 auto ret = Glib::ustring(
"");
2358 switch (this->
type) {
2362 if (!ret.empty()) ret +=
" ";
2368 if (prefs->
getBool(
"/options/font/textOutputPx",
true)) {
2377 g_error(
"Invalid FontSize value, not writing it.");
2398 std::cerr <<
"SPIFontSize::cascade: Illegal literal value" << std::endl;
2424 std::cerr <<
"SPIFontSize::cascade(): Incorrect parent type" << std::endl;
2441 g_assert_not_reached();
2457 g_assert_not_reached();
2461 g_assert_not_reached();
2468 if( p->set && !(p->inherit) ) {
2493 computed = p->computed * child_frac;
2505 double const parent_frac( p->relative_fraction() );
2508 value *= parent_frac;
2510 value = parent_frac * child_frac;
2522 std::cerr <<
"SPIFontSize::merge(): Incorrect parent type" << std::endl;
2530 if(
type != r->type ) {
return false;}
2532 if(
computed != r->computed ) {
return false;}
2534 if(
literal != r->literal ) {
return false;}
2536 if(
value != r->value ) {
return false;}
2554 std::cerr <<
"SPIFont::read(): style is void" << std::endl;
2558 if ( !strcmp(str,
"inherit") ) {
2564 std::stringstream os( str );
2565 Glib::ustring param;
2567 while (os >> param) {
2570 Glib::ustring lparam = param.lowercase();
2572 if (lparam ==
"/" ) {
2576 lparam = param.lowercase();
2583 test_style.read( lparam.c_str() );
2584 if( test_style.set ) {
2591 test_variant.read( lparam.c_str() );
2592 if( test_variant.set ) {
2599 test_weight.read( lparam.c_str() );
2600 if( test_weight.set ) {
2607 test_stretch.read( lparam.c_str() );
2608 if( test_stretch.set ) {
2615 test_size.read( lparam.c_str() );
2616 if( test_size.set ) {
2627 std::string str_s = str;
2628 std::string family = str_s.substr( str_s.find( param ) );
2649 if (this->
inherit)
return Glib::ustring(
"inherit");
2660 return Glib::ustring(
"");
2674 if(
dynamic_cast<const SPIFont*
>(&rhs) ) {
2690 if (!strcmp(str,
"inherit")) {
2693 }
else if ((*str ==
'b') || (*str ==
's')) {
2712 value = length.value;
2725 if (this->
inherit)
return Glib::ustring(
"inherit");
2726 auto ret = Glib::ustring(
"");
2727 switch (this->
type) {
2731 if (!ret.empty()) ret +=
" ";
2755 g_assert( pfont_size !=
nullptr );
2794 std::cerr <<
"SPIBaselineShift::cascade(): Incorrect parent type" << std::endl;
2803 if( (!
set ||
inherit) && p->set && !(p->inherit) ) {
2809 std::cerr <<
"SPIBaselineShift::merge(): Incorrect parent type" << std::endl;
2817 if(
type != r->type )
return false;
2819 if(
computed != r->computed )
return false;
2821 if(
literal != r->literal )
return false;
2823 if(
value != r->value )
return false;
2836 if(
value == 0.0 )
return true;
2850 if (!strcmp(str,
"inherit")) {
2853 }
else if (!strcmp(str,
"none")) {
2861 bool found_one =
false;
2862 bool hit_one =
false;
2865 bool found_underline =
false;
2866 bool found_overline =
false;
2867 bool found_line_through =
false;
2868 bool found_blink =
false;
2872 const gchar *hstr = str;
2874 if (*str ==
' ' || *str ==
',' || *str ==
'\0'){
2875 int slen = str - hstr;
2879 if ((slen == 9) &&
strneq(hstr,
"underline", slen)){ found_underline =
true;
break; }
2880 if ((slen == 8) &&
strneq(hstr,
"overline", slen)){ found_overline =
true;
break; }
2881 if ((slen == 12) &&
strneq(hstr,
"line-through", slen)){ found_line_through =
true;
break; }
2882 if ((slen == 5) &&
strneq(hstr,
"blink", slen)){ found_blink =
true;
break; }
2883 if ((slen == 4) &&
strneq(hstr,
"none", slen)){
break; }
2888 found_one |= hit_one;
2889 if(*str ==
'\0')
break;
2900 blink = found_blink;
2911 if (this->
inherit)
return Glib::ustring(
"inherit");
2912 auto ret = Glib::ustring(
"");
2916 if (
blink) ret +=
"blink ";
2920 assert(ret.raw().back() ==
' ');
2921 ret.resize(ret.size() - 1);
2936 std::cerr <<
"SPITextDecorationLine::cascade(): Incorrect parent type" << std::endl;
2944 if( (!
set ||
inherit) && p->set && !(p->inherit) ) {
2963 (
blink == r->blink ) &&
2988 if (!strcmp(str,
"inherit")) {
2994 bool found_solid =
false;
2995 bool found_double =
false;
2996 bool found_dotted =
false;
2997 bool found_dashed =
false;
2998 bool found_wavy =
false;
2999 bool found_one =
false;
3003 const gchar *hstr = str;
3005 if (*str ==
' ' || *str ==
',' || *str ==
'\0'){
3006 int slen = str - hstr;
3007 if ( (slen == 5) &&
strneq(hstr,
"solid", slen)){ found_solid =
true; found_one =
true;
break; }
3008 else if ((slen == 6) &&
strneq(hstr,
"double", slen)){ found_double =
true; found_one =
true;
break; }
3009 else if ((slen == 6) &&
strneq(hstr,
"dotted", slen)){ found_dotted =
true; found_one =
true;
break; }
3010 else if ((slen == 6) &&
strneq(hstr,
"dashed", slen)){ found_dashed =
true; found_one =
true;
break; }
3011 else if ((slen == 4) &&
strneq(hstr,
"wavy", slen)){ found_wavy =
true; found_one =
true;
break; }
3012 if(*str ==
'\0')
break;
3019 solid = found_solid;
3034 if (this->
inherit)
return Glib::ustring(
"inherit");
3035 if (this->
solid)
return Glib::ustring(
"solid");
3036 if (this->
isdouble)
return Glib::ustring(
"double");
3037 if (this->
dotted)
return Glib::ustring(
"dotted");
3038 if (this->
dashed)
return Glib::ustring(
"dashed");
3039 if (this->
wavy)
return Glib::ustring(
"wavy");
3040 g_error(
"SPITextDecorationStyle::write(): No valid value for property");
3041 return Glib::ustring(
"");
3055 std::cerr <<
"SPITextDecorationStyle::cascade(): Incorrect parent type" << std::endl;
3063 if( (!
set ||
inherit) && p->set && !(p->inherit) ) {
3080 (
solid == r->solid ) &&
3082 (
dotted == r->dotted ) &&
3083 (
dashed == r->dashed ) &&
3084 (
wavy == r->wavy ) &&
3105 bool is_css3 =
false;
3108 test_line.read( str );
3109 if( test_line.set ) {
3117 test_style.read( str );
3118 if( test_style.set ) {
3128 test_color.setStylePointer(
style );
3129 test_color.read(
"currentColor" );
3130 test_color.set =
false;
3131 const gchar *hstr = str;
3133 if (*str ==
' ' || *str ==
',' || *str ==
'\0'){
3134 int slen = str - hstr;
3135 gchar *frag = g_strndup(hstr,slen+1);
3137 if( strcmp( frag,
"none" ) != 0 ) {
3138 test_color.read( frag );
3142 if( test_color.set ) {
3147 test_color.read(
"currentColor" );
3148 test_color.set =
false;
3149 if( *str ==
'\0' )
break;
3174 if (this->
inherit)
return Glib::ustring(
"inherit");
3180 assert(!base || my_base);
3187 return Glib::ustring(
"");
3197 std::cerr <<
"SPITextDecoration::cascade(): Incorrect parent type" << std::endl;
3209 std::cerr <<
"SPITextDecoration::merge(): Incorrect parent type" << std::endl;
3232 if (!strcmp(str,
"none")) {
3239 bool found_one =
false;
3240 bool hit_one =
false;
3242 bool found_stroke =
false;
3243 bool found_size =
false;
3244 bool found_rotate =
false;
3245 bool found_fixed =
false;
3247 const gchar *hstr = str;
3249 if (*str ==
' ' || *str ==
',' || *str ==
'\0'){
3250 int slen = str - hstr;
3254 if ((slen == 18) &&
strneq(hstr,
"non-scaling-stroke", slen)){ found_stroke =
true;
break; }
3255 if ((slen == 16) &&
strneq(hstr,
"non-scaling-size", slen)){ found_size =
true;
break; }
3256 if ((slen == 12) &&
strneq(hstr,
"non-rotation", slen)){ found_rotate =
true;
break; }
3257 if ((slen == 14) &&
strneq(hstr,
"fixed-position", slen)){ found_fixed =
true;
break; }
3258 if ((slen == 4) &&
strneq(hstr,
"none", slen)){
break; }
3263 found_one |= hit_one;
3264 if(*str ==
'\0')
break;
3274 fixed = found_fixed;
3290 if (this->
inherit)
return Glib::ustring(
"inherit");
3291 auto ret = Glib::ustring(
"");
3292 if (this->
stroke) ret +=
" non-scaling-stroke";
3293 if (this->
size) ret +=
" non-scaling-size";
3294 if (this->
rotate) ret +=
" non-rotation";
3295 if (this->
fixed) ret +=
" fixed-position";
3318 (
size == r->size ) &&
3320 (
fixed == r->fixed ) &&
3336 if (!strcmp(str,
"none")) {
3338 }
else if (!strcmp(str,
"hairline")) {
3346 if (this->
inherit)
return Glib::ustring(
"inherit");
3347 if (this->
hairline)
return Glib::ustring(
"hairline");
3348 return Glib::ustring(
"none");
gchar const * sp_attribute_name(SPAttr id)
Get attribute name by id.
TODO: insert short description here.
A thin wrapper around std::ostringstream, but writing floating point numbers in the format required b...
Preference storage class.
bool getBool(Glib::ustring const &pref_path, bool def=false)
Retrieve a Boolean value.
static Preferences * get()
Access the singleton Preferences object.
int getInt(Glib::ustring const &pref_path, int def=0)
Retrieve an integer.
URI const * getURI() const
Returns a pointer to a URI containing the currently attached URI, or NULL if no URI is currently atta...
void detach()
Detaches from the currently attached URI target, if any; the current referrent is signaled as NULL.
bool try_attach(char const *uri)
Try to attach to a URI.
sigc::signal< void(SPObject *, SPObject *)> changedSignal()
Accessor for the referrent change notification signal; this signal is emitted whenever the URIReferen...
void attach(URI const &uri)
Attaches to a URI, relative to the specified document.
Represents an URI as per RFC 2396.
std::string cssStr(char const *baseuri=nullptr) const
Return a CSS formatted url value.
static double convert(double from_dist, Unit const *from, Unit const *to)
Convert distances.
Typed SVG document implementation.
Inkscape::Colors::DocumentCMS & getDocumentCMS()
SPFilter * getObject() const
Virtual base class for all SPStyle internal classes.
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.
Glib::ustring const & name() const
SPIBase & operator=(const SPIBase &rhs)=default
char const * important_str() const
virtual bool equals(const SPIBase &rhs) const
virtual void read(gchar const *str)=0
void readIfUnset(gchar const *str, SPStyleSrc source=SPStyleSrc::STYLE_PROP)
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 get_value() const =0
Baseline shift type internal to SPStyle. (This is actually just like SPIFontSize)
void cascade(const SPIBase *const parent) override
const Glib::ustring get_value() const override
bool equals(const SPIBase &rhs) const override
void merge(const SPIBase *const parent) override
void read(gchar const *str) override
std::optional< Colors::Color > _color
Colors::DocumentCMS const & getCMS() const
SPIColor(bool inherits=true)
void setColor(Colors::Color const &other)
void read(gchar const *str) override
Colors::Color const & getColor() const
void cascade(const SPIBase *const parent) override
SPIColor & operator=(const SPIColor &rhs)
void merge(const SPIBase *const parent) override
const Glib::ustring get_value() const override
bool equals(const SPIBase &rhs) const override
Filter type internal to SPStyle.
const Glib::ustring get_value() const override
bool equals(const SPIBase &rhs) const override
std::vector< SPILength > values
void cascade(const SPIBase *const parent) override
void merge(const SPIBase *const parent) override
void read(gchar const *str) override
void read(gchar const *str) override
const Glib::ustring get_value() const override
void read(gchar const *str) override
const Glib::ustring get_value() const override
Enum type internal to SPStyle.
void update_computed()
Update computed from value.
void merge(const SPIBase *const parent) override
void cascade(const SPIBase *const parent) override
const Glib::ustring get_value() const override
bool equals(const SPIBase &rhs) const override
void update_computed_cascade(T const &parent_computed)
Update computed from parent computed.
void read(gchar const *str) override
void update_value_merge(SPIEnum< T > const &)
Update value from parent.
Filter type internal to SPStyle.
void cascade(const SPIBase *const parent) override
void merge(const SPIBase *const parent) override
const Glib::ustring get_value() const override
void read(gchar const *str) override
bool equals(const SPIBase &rhs) const override
Float type internal to SPStyle. (Only 'stroke-miterlimit')
void read(gchar const *str) override
const Glib::ustring get_value() const override
void merge(const SPIBase *const parent) override
bool equals(const SPIBase &rhs) const override
void cascade(const SPIBase *const parent) override
Fontsize type internal to SPStyle (also used by libnrtype/Layout-TNG-Input.cpp).
void cascade(const SPIBase *const parent) override
void read(gchar const *str) override
double relative_fraction() const
static float const font_size_default
bool equals(const SPIBase &rhs) const override
const Glib::ustring get_value() const override
static float const font_size_table[]
Indexed by SP_CSS_FONT_SIZE_blah.
void merge(const SPIBase *const parent) override
Extended length type internal to SPStyle.
void read(gchar const *str) override
bool equals(const SPIBase &rhs) const override
virtual const Glib::ustring toString() const
void merge(const SPIBase *const parent) override
const Glib::ustring get_value() const override
void cascade(const SPIBase *const parent) override
std::map< Glib::ustring, float > axes
Font type internal to SPStyle ('font' shorthand)
void read(gchar const *str) override
const Glib::ustring get_value() const override
bool equals(const SPIBase &rhs) const override
Extended length type internal to SPStyle.
void cascade(const SPIBase *const parent) override
bool equals(const SPIBase &rhs) const override
void read(gchar const *str) override
const Glib::ustring get_value() const override
void merge(const SPIBase *const parent) override
Length type internal to SPStyle.
void cascade(const SPIBase *const parent) override
const Glib::ustring get_value() const override
void read(gchar const *str) override
virtual const Glib::ustring toString(bool wname=false) const
void merge(const SPIBase *const parent) override
bool equals(const SPIBase &rhs) const override
void read(gchar const *str) override
const Glib::ustring get_value() const override
void read(gchar const *str) override
const Glib::ustring get_value() const override
Paint order type internal to SPStyle.
unsigned get_order(SPPaintOrderLayer paint_order) const
Return the index of the given paint order.
void read(gchar const *str) override
void cascade(const SPIBase *const parent) override
std::array< SPPaintOrderLayer, PAINT_ORDER_LAYERS > get_layers() const
Get the actual layer order, converting "normal" to layers.
bool layer_set[PAINT_ORDER_LAYERS]
bool equals(const SPIBase &rhs) const override
const Glib::ustring get_value() const override
SPPaintOrderLayer layer[PAINT_ORDER_LAYERS]
void merge(const SPIBase *const parent) override
Paint type internal to SPStyle.
bool equals(const SPIBase &rhs) const override
void merge(const SPIBase *const parent) override
bool isPaintserver() const
const Glib::ustring get_value() const override
std::optional< Colors::Color > _color
void cascade(const SPIBase *const parent) override
virtual void reset(bool init)
std::shared_ptr< SPPaintServerReference > href
Colors::DocumentCMS const & getCMS() const
SPPaintOrigin paintSource
SPPaintOrigin paintOrigin
void read(gchar const *str) override
Set SPIPaint object from string.
void setColor(Colors::Color const &other)
Colors::Color const & getColor() const
24 bit data type internal to SPStyle.
const Glib::ustring get_value() const override
void read(gchar const *str) override
bool equals(const SPIBase &rhs) const override
void merge(const SPIBase *const parent) override
void cascade(const SPIBase *const parent) override
bool containsAnyShape(Inkscape::ObjectSet *set)
Check if a Shape object exists in the selection Needed for when user selects multiple objects and.
std::vector< SPShapeReference * > hrefs
void read(gchar const *str) override
String type internal to SPStyle.
char const * get_default_value() const
const Glib::ustring get_value() const override
Value as it should be written to CSS representation, including quotes if needed.
void merge(const SPIBase *const parent) override
void read(gchar const *str) override
bool equals(const SPIBase &rhs) const override
void cascade(const SPIBase *const parent) override
char const * value() const
Get value if set, or inherited value, or default value (may be NULL)
Custom stroke properties. Only used for -inkscape-stroke: hairline.
const Glib::ustring get_value() const override
void read(gchar const *str) override
bool equals(const SPIBase &rhs) const override
Text decoration line type internal to SPStyle. THIS SHOULD BE A GENERIC CLASS.
void read(gchar const *str) override
void cascade(const SPIBase *const parent) override
const Glib::ustring get_value() const override
void merge(const SPIBase *const parent) override
bool equals(const SPIBase &rhs) const override
Text decoration style type internal to SPStyle. THIS SHOULD JUST BE SPIEnum!
void cascade(const SPIBase *const parent) override
const Glib::ustring get_value() const override
bool equals(const SPIBase &rhs) const override
void merge(const SPIBase *const parent) override
void read(gchar const *str) override
Text decoration type internal to SPStyle.
void cascade(const SPIBase *const parent) override
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 override
Compile this style conditionally into a 'name: value' string suitable for css attrs.
void read(gchar const *str) override
bool equals(const SPIBase &rhs) const override
const Glib::ustring get_value() const override
void merge(const SPIBase *const parent) override
Vector Effects. THIS SHOULD BE A GENERIC CLASS.
const Glib::ustring get_value() const override
bool equals(const SPIBase &rhs) const override
void read(gchar const *str) override
SPObject is an abstract base class of all of the document nodes at the SVG document level.
T< SPAttr::TEXT_DECORATION_LINE, SPITextDecorationLine > text_decoration_line
CSS 3 2.1, 2.2, 2.3.
T< SPAttr::COLOR, SPIColor > color
color
T< SPAttr::FONT_WEIGHT, SPIEnum< SPCSSFontWeight > > font_weight
Weight of the font.
T< SPAttr::TEXT_DECORATION_STYLE, SPITextDecorationStyle > text_decoration_style
sigc::connection fill_ps_changed_connection
T< SPAttr::FILL, SPIPaint > fill
fill
T< SPAttr::LINE_HEIGHT, SPILengthOrNormal > line_height
Line height (css2 10.8.1)
SPObject * object
Object we are attached to.
T< SPAttr::FONT_FAMILY, SPIString > font_family
Font family.
T< SPAttr::TEXT_DECORATION_COLOR, SPIColor > text_decoration_color
T< SPAttr::FONT_STYLE, SPIEnum< SPCSSFontStyle > > font_style
Font style.
T< SPAttr::FONT_VARIANT, SPIEnum< SPCSSFontVariant > > font_variant
Which substyle of the font (CSS 2.
T< SPAttr::FONT_STRETCH, SPIEnum< SPCSSFontStretch > > font_stretch
Stretch of the font.
sigc::connection filter_changed_connection
sigc::connection stroke_ps_changed_connection
T< SPAttr::FONT_SIZE, SPIFontSize > font_size
Size of the font.
SPDocument * document
Document we are associated with.
TODO: insert short description here.
static char const *const parent
Glib::ustring format_classic(T const &... args)
static cairo_user_data_key_t key
Singleton class to access the preferences file in a convenient way.
static Inkscape::Colors::Color default_color(SPItem *item)
Find default color based on colors in existing fill.
TODO: insert short description here.
bool streq(char const *a, char const *b)
Convenience/readability wrapper for strcmp(a,b)==0.
TODO: insert short description here.
bool strneq(char const *a, char const *b, size_t n)
Convenience/readability wrapper for strncmp(a,b,n)==0.
SPStyle enums: named public enums that correspond to SVG property values.
static SPStyleEnum const enum_writing_mode[]
static SPStyleEnum const enum_baseline_shift[]
static SPStyleEnum const enum_font_variant_position[]
static SPStyleEnum const enum_font_variant_east_asian[]
static SPStyleEnum const enum_font_size[]
static SPStyleEnum const enum_direction[]
@ SP_CSS_FONT_VARIANT_LIGATURES_NORMAL
@ 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_FONT_VARIANT_LIGATURES_NONE
@ SP_CSS_FONT_VARIANT_LIGATURES_NOCOMMON
@ SP_CSS_BASELINE_SHIFT_BASELINE
@ SP_CSS_BASELINE_SHIFT_SUPER
@ SP_CSS_BASELINE_SHIFT_SUB
@ SP_CSS_FONT_SIZE_SMALLER
@ SP_CSS_FONT_SIZE_LARGER
static SPStyleEnum const enum_overflow[]
static SPStyleEnum const enum_shape_rendering[]
@ SP_CSS_FONT_VARIANT_NUMERIC_TABULAR_NUMS
@ SP_CSS_FONT_VARIANT_NUMERIC_NORMAL
@ 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
static SPStyleEnum const enum_color_rendering[]
static SPStyleEnum const enum_visibility[]
static SPStyleEnum const enum_stroke_linecap[]
static SPStyleEnum const enum_image_rendering[]
static SPStyleEnum const enum_font_variant_alternates[]
static SPStyleEnum const enum_white_space[]
static SPStyleEnum const enum_display[]
static SPStyleEnum const enum_stroke_linejoin[]
static SPStyleEnum const enum_clip_rule[]
static SPStyleEnum const enum_font_variant_ligatures[]
static SPStyleEnum const enum_blend_mode[]
static SPStyleEnum const enum_isolation[]
@ SP_CSS_FONT_STRETCH_ULTRA_EXPANDED
@ SP_CSS_FONT_STRETCH_NARROWER
@ SP_CSS_FONT_STRETCH_WIDER
@ SP_CSS_FONT_STRETCH_ULTRA_CONDENSED
static SPStyleEnum const enum_baseline[]
static SPStyleEnum const enum_text_align[]
static SPStyleEnum const enum_enable_background[]
static SPStyleEnum const enum_font_variant_caps[]
@ 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_NORMAL
@ SP_CSS_FONT_VARIANT_EAST_ASIAN_FULL_WIDTH
@ SP_CSS_FONT_VARIANT_EAST_ASIAN_JIS83
@ SP_CSS_FONT_VARIANT_EAST_ASIAN_SIMPLIFIED
static SPStyleEnum const enum_font_style[]
static SPStyleEnum const enum_font_variant_numeric[]
static SPStyleEnum const enum_text_rendering[]
static SPStyleEnum const enum_font_weight[]
static SPStyleEnum const enum_text_orientation[]
static SPStyleEnum const enum_color_interpolation[]
static SPStyleEnum const enum_font_stretch[]
static SPStyleEnum const enum_text_anchor[]
static SPStyleEnum const enum_text_transform[]
@ SP_CSS_FONT_WEIGHT_LIGHTER
@ SP_CSS_FONT_WEIGHT_NORMAL
@ SP_CSS_FONT_WEIGHT_BOLD
@ SP_CSS_FONT_WEIGHT_BOLDER
static SPStyleEnum const enum_font_variant[]
SPStyleEnum const * get_enums< SPIsolation >()
SPStyleEnum const * get_enums< SPOverflow >()
void sp_style_filter_ref_changed(SPObject *old_ref, SPObject *ref, SPStyle *style)
Gets called when the filter is (re)attached to the style.
SPStyleEnum const * get_enums< SPCSSDirection >()
void sp_style_set_ipaint_to_uri_string(SPStyle *style, SPIPaint *paint, const gchar *uri)
SPStyleEnum const * get_enums< SPCSSFontStretch >()
SPStyleEnum const * get_enums< SPImageRendering >()
SPStyleEnum const * get_enums< SPCSSFontVariantPosition >()
SPStyleEnum const * get_enums< SPStrokeCapType >()
SPStyleEnum const * get_enums< SPCSSFontVariantCaps >()
SPStyleEnum const * get_enums< SPStrokeJoinType >()
SPStyleEnum const * get_enums< SPVisibility >()
SPStyleEnum const * get_enums< SPBlendMode >()
SPStyleEnum const * get_enums< SPCSSBaseline >()
SPStyleEnum const * get_enums< SPCSSDisplay >()
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.
SPStyleEnum const * get_enums< SPCSSFontVariant >()
SPStyleEnum const * get_enums< SPCSSTextOrientation >()
SPStyleEnum const * get_enums< SPCSSFontStyle >()
SPStyleEnum const * get_enums< SPCSSFontVariantAlternates >()
SPStyleEnum const * get_enums< SPCSSTextAlign >()
SPStyleEnum const * get_enums< SPCSSTextTransform >()
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 SPStyleEnum const * get_enums()
SPStyleEnum const * get_enums< SPShapeRendering >()
SPStyleEnum const * get_enums< SPWindRule >()
SPStyleEnum const * get_enums< SPEnableBackground >()
SPStyleEnum const * get_enums< SPTextRendering >()
SPStyleEnum const * get_enums< SPCSSWritingMode >()
SPStyleEnum const * get_enums< SPTextAnchor >()
void sp_style_set_ipaint_to_uri(SPStyle *style, SPIPaint *paint, const Inkscape::URI *uri, SPDocument *document)
SPStyleEnum const * get_enums< SPColorRendering >()
SPStyleEnum const * get_enums< SPCSSFontWeight >()
static bool strip_important(gchar const *str, std::string &stripped)
If str.endswith("!important") then assign stripped = str[:-10].rstrip() and return true.
SPStyleEnum const * get_enums< SPColorInterpolation >()
SPStyleEnum const * get_enums< SPWhiteSpace >()
SPStyle internal: classes that are internal to SPStyle.
@ SP_FONT_SIZE_PERCENTAGE
constexpr size_t PAINT_ORDER_LAYERS
@ SP_CSS_PAINT_ORIGIN_CONTEXT_STROKE
@ SP_CSS_PAINT_ORIGIN_CURRENT_COLOR
@ SP_CSS_PAINT_ORIGIN_NORMAL
@ SP_CSS_PAINT_ORIGIN_CONTEXT_FILL
static const unsigned SP_SCALE24_MAX
@ SP_CSS_PAINT_ORDER_STROKE
@ SP_CSS_PAINT_ORDER_MARKER
@ SP_CSS_PAINT_ORDER_FILL
@ SP_CSS_PAINT_ORDER_NORMAL
@ SP_BASELINE_SHIFT_PERCENTAGE
@ SP_BASELINE_SHIFT_LENGTH
@ SP_BASELINE_SHIFT_LITERAL
static const unsigned SP_STYLE_FLAG_ALWAYS(1<< 2)
static const unsigned SP_STYLE_FLAG_IFSRC(1<< 3)
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...
void css_quote(Glib::ustring &val)
Quote and/or escape string for writing to CSS, changing strings in place.
double sp_style_css_size_px_to_units(double size, int unit, double font_size)
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.
gchar const * sp_style_get_css_unit_string(int unit)
SPStyle - a style object for SPItem objects.
unsigned int sp_svg_number_read_f(gchar const *str, float *val)
void init(int argc, char **argv, Toy *t, int width=600, int height=600)