Lines Matching refs:style

2  * Desktop style management
26 #include "style.h"
47 #include "desktop-style.h"
104 * Apply style on object and children, recursively.
109 // non-items should not have style
115 // 1. tspans with role=line are not regular objects in that they are not supposed to have style of their own,
117 // However, if the line tspan or textPath contains some style (old file?), we reluctantly set our style to it too.
119 // 2. Generally we allow setting style on clones, but when it's inside flowRegion, do not touch
130 && !o->getAttribute("style"))
146 // Scale the style by the inverse of the accumulated parent transform in the paste context.
156 o->changeCSS(css_set,"style");
161 // setting style on child of clone spills into the clone original (via shared repr), don't do it!
182 * Apply style on selection on desktop.
196 prefs->mergeStyle("/desktop/style", css_write);
205 prefs->mergeStyle(Glib::ustring("/desktop/") + descr + "/style", css_write);
224 // 3. If nobody has intercepted the signal, apply the style to the selection
263 * Return the desktop's current style.
292 if (desktop->current && property) { // if there is style and the property in it,
313 css = prefs->getStyle(tool + "/style");
319 if (desktop->current && property) { // if there is style and the property in it,
342 css = prefs->getStyle(tool + "/style");
348 if (desktop->current && property) { // if there is style and the property in it,
371 css = prefs->getStyle(tool + "/style");
377 if (desktop->current && property) { // if there is style and the property in it,
393 * Apply the desktop's current style or the tool style to repr.
402 sp_repr_css_set(repr, css_current, "style");
404 SPCSSAttr *css = prefs->getInheritedStyle(tool_path + "/style");
405 sp_repr_css_set(repr, css, "style");
414 * Returns the font size (in SVG pixels) of the text tool style (if text
415 * tool uses its own style) or desktop style (otherwise).
422 Glib::ustring desktop_style = prefs->getString("/desktop/style");
427 style_str = prefs->getString("/tools/text/style");
432 SPStyle style(SP_ACTIVE_DOCUMENT);
433 style.mergeString(style_str.data());
434 ret = style.font_size.computed;
440 // see TODO in dialogs/stroke-style.cpp on how to get rid of this eventually
458 double width = item->style->stroke_width.computed * i2dt.descrim();
460 if ( item->style->stroke.isNone() || IS_NAN(width)) {
521 SPStyle *style = obj->style;
522 if (!style) {
526 SPIPaint *paint = isfill? &style->fill : &style->stroke;
546 SPPaintServer *server = isfill ? style->getFillPaintServer() : style->getStrokePaintServer();
620 c[3] += SP_SCALE24_TO_FLOAT (isfill? style->fill_opacity.value : style->stroke_opacity.value);
629 gchar const *string = NULL; // memory leak results if style->get* called inside sp_style_set_to_uri_string.
631 string = style->getFillURI();
634 string = style->getStrokeURI();
640 style_res->fill_rule.computed = style->fill_rule.computed; // no averaging on this, just use the last one
705 SPStyle *style = obj->style;
706 if (!style) {
710 double opacity = SP_SCALE24_TO_FLOAT(style->opacity.value);
765 SPStyle *style = obj->style;
766 if (!style) {
770 if ( style->stroke.isNone() && !(
771 style->marker.set || // stroke width affects markers, so if there's no
772 style->marker_start.set || // stroke but only markers then we should
773 style->marker_mid.set || // still calculate the stroke width
774 style->marker_end.set))
779 noneSet &= style->stroke.isNone();
782 double sw = style->stroke_width.computed * i2d.descrim();
835 SPStyle *style = obj->style;
836 if (!style) {
840 if ( style->stroke.isNone() ) {
846 if (prev_ml != -1 && fabs(style->stroke_miterlimit.value - prev_ml) > 1e-3) {
849 prev_ml = style->stroke_miterlimit.value;
851 avgml += style->stroke_miterlimit.value;
893 SPStyle *style = obj->style;
894 if (!style) {
898 if ( style->stroke.isNone() ) {
904 if (prev_cap != -1 && style->stroke_linecap.value != prev_cap)
906 prev_cap = style->stroke_linecap.value;
944 SPStyle *style = obj->style;
945 if (!style) {
949 if ( style->stroke.isNone() ) {
955 if (prev_join != -1 && style->stroke_linejoin.value != prev_join) {
958 prev_join = style->stroke_linejoin.value;
996 SPStyle *style = obj->style;
997 if (!style) {
1001 if ( style->stroke.isNone() ) {
1007 if (style->paint_order.set) {
1008 if (!prev_order.empty() && prev_order.compare( style->paint_order.value ) != 0) {
1011 prev_order = style->paint_order.value;
1068 SPStyle *style = obj->style;
1069 if (!style) {
1081 double dummy = style->font_size.computed * doc_scale;
1088 if (style->letter_spacing.normal) {
1093 letterspacing += style->letter_spacing.computed * doc_scale;; /// \todo FIXME: we assume non-% units here
1097 if (style->word_spacing.normal) {
1102 wordspacing += style->word_spacing.computed * doc_scale; /// \todo FIXME: we assume non-% units here
1112 if (style->line_height.normal) {
1118 } else if (style->line_height.unit == SP_CSS_UNIT_NONE ||
1119 style->line_height.unit == SP_CSS_UNIT_PERCENT ||
1120 style->line_height.unit == SP_CSS_UNIT_EM ||
1121 style->line_height.unit == SP_CSS_UNIT_EX ||
1122 style->font_size.computed == 0) {
1123 lineheight_current = style->line_height.value;
1124 lineheight_unit_current = style->line_height.unit;
1130 lineheight_current = style->line_height.computed;
1131 lineheight_unit_current = style->line_height.unit;
1137 if ((size_prev != 0 && style->font_size.computed != size_prev) ||
1138 (letterspacing_prev != 0 && style->letter_spacing.computed != letterspacing_prev) ||
1139 (wordspacing_prev != 0 && style->word_spacing.computed != wordspacing_prev)) {
1151 size_prev = style->font_size.computed;
1152 letterspacing_prev = style->letter_spacing.computed;
1153 wordspacing_prev = style->word_spacing.computed;
1158 style_res->text_anchor.computed = style->text_anchor.computed;
1159 style_res->writing_mode.computed = style->writing_mode.computed;
1223 * Write to style_res the average font style of objects.
1240 SPStyle *style = obj->style;
1241 if (!style) {
1248 ( ( style_res->font_weight.computed != style->font_weight.computed ) ||
1249 ( style_res->font_style.computed != style->font_style.computed ) ||
1250 ( style_res->font_stretch.computed != style->font_stretch.computed ) ||
1251 ( style_res->font_variant.computed != style->font_variant.computed ) ) ) {
1256 style_res->font_weight.value = style_res->font_weight.computed = style->font_weight.computed;
1257 style_res->font_style.value = style_res->font_style.computed = style->font_style.computed;
1258 style_res->font_stretch.value = style_res->font_stretch.computed = style->font_stretch.computed;
1259 style_res->font_variant.value = style_res->font_variant.computed = style->font_variant.computed;
1260 style_res->text_align.value = style_res->text_align.computed = style->text_align.computed;
1261 style_res->font_size.value = style->font_size.value;
1262 style_res->font_size.unit = style->font_size.unit;
1310 SPStyle *style = obj->style;
1311 if (!style) {
1317 SPILigatures* ligatures_in = &(style->font_variant_ligatures);
1318 SPIEnum* position_in = &(style->font_variant_position);
1319 SPIEnum* caps_in = &(style->font_variant_caps);
1320 SPINumeric* numeric_in = &(style->font_variant_numeric);
1368 * Write to style_res the average writing modes style of objects.
1385 SPStyle *style = obj->style;
1386 if (!style) {
1393 ( ( style_res->writing_mode.computed != style->writing_mode.computed ) ||
1394 ( style_res->text_orientation.computed != style->text_orientation.computed ) ) ) {
1399 style_res->writing_mode.computed = style->writing_mode.computed;
1400 style_res->text_orientation.computed = style->text_orientation.computed;
1437 SPStyle *style = obj->style;
1438 if (!style) {
1444 if (style_res->font_feature_settings.value && style->font_feature_settings.value &&
1445 strcmp (style_res->font_feature_settings.value, style->font_feature_settings.value)) {
1455 style_res->font_feature_settings.value = g_strdup(style->font_feature_settings.value);
1504 SPStyle *style = obj->style;
1505 if (!style) {
1512 if(style->baseline_shift.set) {
1514 current.set = style->baseline_shift.set;
1515 current.inherit = style->baseline_shift.inherit;
1516 current.type = style->baseline_shift.type;
1517 current.literal = style->baseline_shift.literal;
1518 current.value = style->baseline_shift.value;
1519 current.computed = style->baseline_shift.computed;
1593 SPStyle *style = obj->style;
1594 if (!style) {
1600 if (style_res->font_family.value && style->font_family.value &&
1601 strcmp (style_res->font_family.value, style->font_family.value)) {
1611 style_res->font_family.value = g_strdup(style->font_family.value);
1649 SPStyle *style = obj->style;
1650 if (!style) {
1657 style->font_specification.value && style->font_specification.set &&
1658 strcmp (style_res->font_specification.value, style->font_specification.value)) {
1662 if (style->font_specification.set) {
1670 style_res->font_specification.value = g_strdup(style->font_specification.value);
1704 SPStyle *style = obj->style;
1705 if (!style || !dynamic_cast<SPItem *>(obj)) {
1712 if (style->filter.set && style->getFilter()) {
1717 for(SPObject *primitive_obj = style->getFilter()->children;
1733 for(SPObject *primitive_obj = style->getFilter()->children;
1794 SPStyle *style = obj->style;
1795 if (!style) {
1808 if (style->filter.set && style->getFilter()) {
1810 SPObject *primitive_obj = style->getFilter()->children;
1855 * the result to style, return appropriate flag.
1858 sp_desktop_query_style_from_list (const std::vector<SPItem*> &list, SPStyle *style, int property)
1861 return objects_query_fillstroke (list, style, true);
1863 return objects_query_fillstroke (list, style, false);
1866 return objects_query_strokewidth (list, style);
1868 return objects_query_miterlimit (list, style);
1870 return objects_query_strokecap (list, style);
1872 return objects_query_strokejoin (list, style);
1875 return objects_query_paintorder (list, style);
1877 return objects_query_opacity (list, style);
1880 return objects_query_fontspecification (list, style);
1882 return objects_query_fontfamily (list, style);
1884 return objects_query_fontstyle (list, style);
1886 return objects_query_fontvariants (list, style);
1888 return objects_query_fontfeaturesettings (list, style);
1890 return objects_query_fontnumbers (list, style);
1892 return objects_query_writing_modes (list, style);
1894 return objects_query_baselines (list, style);
1897 return objects_query_blend (list, style);
1899 return objects_query_blur (list, style);
1907 * the result to style, return appropriate flag.
1910 sp_desktop_query_style(SPDesktop *desktop, SPStyle *style, int property)
1913 int ret = desktop->_query_style_signal.emit(style, property);
1916 return ret; // subselection returned a style, pass it on
1920 return sp_desktop_query_style_from_list (desktop->selection->itemList(), style, property);
1927 * Do the same as sp_desktop_query_style for all (defined) style properties, return true if at
1966 c-file-style:"stroustrup"