21#include <glibmm/i18n.h>
22#include <glibmm/regex.h>
57 char *lpe_desc = g_strdup(
"");
63 for (
auto & it : effect_list)
67 if (!lpeobj || !lpeobj->
get_lpe()) {
77 lpe_desc = g_strdup_printf(_(
", path effect: %s"), s.c_str());
79 char *ret = g_strdup_printf(ngettext(
80 "%i node%s",
"%i nodes%s", count), count, lpe_desc);
90 std::list<std::pair<Geom::Point, Geom::Point> > pts;
95 for(
const auto & pit : pv) {
100 pts.emplace_back(cit->initialPoint() * i2dt, cit->finalPoint() * i2dt);
134 if (
char const *d_val =
style->
d.value()) {
141 Glib::ustring input = d_val;
142 Glib::ustring expression = R
"A(path\("(.*)"\))A";
143 Glib::RefPtr<Glib::Regex> regex = Glib::Regex::create(expression);
144 Glib::MatchInfo matchInfo;
145 regex->match(input, matchInfo);
147 if (matchInfo.matches()) {
148 Glib::ustring value = matchInfo.fetch(1);
242 if ((flags & SP_OBJECT_WRITE_BUILD) && !
repr) {
247g_message(
"sp_path_write writes 'd' attribute");
256 if (flags & SP_OBJECT_WRITE_EXT) {
276 if (flags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG | SP_OBJECT_VIEWPORT_MODIFIED_FLAG)) {
277 flags &= ~SP_OBJECT_USER_MODIFIED_FLAG_B;
SPAttr sp_attribute_lookup(gchar const *key)
Get attribute id by name.
Lookup dictionary for attributes/properties.
3x3 matrix representing an affine transformation.
Coord descrim() const
Calculate the descriminant.
Affine inverse() const
Compute the inverse matrix.
Glib::ustring getName() const
Interface for refcounted XML nodes.
void setAttribute(Util::const_char_ptr key, Util::const_char_ptr value)
Change an attribute of this node.
void removeAttribute(Inkscape::Util::const_char_ptr key)
Remove an attribute of this node.
Inkscape::LivePathEffect::Effect * get_lpe()
void writeRepr(Inkscape::XML::Node *const repr) const
void setAttr(const SPAttr key, char const *const value)
Wrapper around a Geom::PathVector object.
Typed SVG document implementation.
Geom::Affine i2dt_affine() const
Returns the transformation from item to desktop coords.
void adjust_gradient(Geom::Affine const &postmul, bool set=false)
void adjust_pattern(Geom::Affine const &postmul, bool set=false, PaintServerTransform=TRANSFORM_BOTH)
void adjust_stroke(double ex)
void remove_clip_transforms()
void adjust_clip(Geom::Affine const &postmul, bool set=false)
bool hasPathEffect() const
PathEffectList getEffectList()
bool hasPathEffectRecursive() const
bool pathEffectsEnabled() const
bool optimizeTransforms()
returns false when LPE write unoptimiced
SPObject is an abstract base class of all of the document nodes at the SVG document level.
Inkscape::XML::Node * repr
void setAttributeOrRemoveIfEmpty(Inkscape::Util::const_char_ptr key, Inkscape::Util::const_char_ptr value)
void setAttribute(Inkscape::Util::const_char_ptr key, Inkscape::Util::const_char_ptr value)
void removeAttribute(char const *key)
void setKeyValue(SPAttr key, char const *value)
Call virtual set() function of object.
SPStyle * style
Represents the style properties, whether from presentation attributes, the style attribute,...
void readAttr(char const *key)
Read value of key attribute from XML node into object.
Inkscape::XML::Node * getRepr()
Returns the XML representation of tree.
char const * getAttribute(char const *name) const
void requestDisplayUpdate(unsigned int flags)
Queues an deferred update of this object's display.
SPConnEndPair connEndPair
void removeTransformsRecursively(SPObject const *root) override
Geom::Affine set_transform(Geom::Affine const &transform) override
const char * typeName() const override
The item's type name, not node tag name.
char * description() const override
void update_patheffect(bool write) override
const char * displayName() const override
The item's type name as a translated human string.
void convert_to_guides() const override
Inkscape::XML::Node * write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, unsigned int flags) override
void set(SPAttr key, char const *value) override
void update(SPCtx *ctx, unsigned int flags) override
void build(SPDocument *document, Inkscape::XML::Node *repr) override
Base class for shapes, including <path> element.
void update(SPCtx *ctx, unsigned int flags) override
void setCurveInsync(SPCurve const *)
std::optional< SPCurve > _curve_before_lpe
void release() override
Removes, releases and unrefs all children of object.
void set(SPAttr key, char const *value) override
void setCurveBeforeLPE(SPCurve const *)
void build(SPDocument *document, Inkscape::XML::Node *repr) override
void set_marker(unsigned key, char const *value)
Adds a new marker to shape object at the location indicated by key.
void update_patheffect(bool write) override
std::shared_ptr< SPCurve const > _curve
Inkscape::XML::Node * write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, unsigned int flags) override
void setCurve(SPCurve const *)
T< SPAttr::D, SPIString > d
Path data.
std::shared_ptr< Css const > css
Specific curve type functions for Inkscape, not provided by lib2geom.
bool is_straight_curve(Geom::BezierCurve const &c)
Affine identity()
Create an identity matrix.
static cairo_user_data_key_t key
void sp_repr_css_set(Node *repr, SPCSSAttr *css, gchar const *attr)
Sets an attribute (e.g.
void sp_repr_css_attr_unref(SPCSSAttr *css)
Unreferences an SPCSSAttr (will be garbage collected if no references remain).
SPCSSAttr * sp_repr_css_attr(Node const *repr, gchar const *attr)
Creates a new SPCSSAttr with one attribute (i.e.
void sp_repr_css_unset_property(SPCSSAttr *css, gchar const *name)
Set a style property to "inkscape:unset".
C facade to Inkscape::XML::Node.
void sp_conn_end_pair_build(SPObject *object)
void sp_guide_pt_pairs_to_guides(SPDocument *doc, std::list< std::pair< Geom::Point, Geom::Point > > &pts)
Geom::Affine i2i_affine(SPObject const *src, SPObject const *dest)
void sp_lpe_item_update_patheffect(SPLPEItem *lpeitem, bool wholetree, bool write, bool with_satellites)
Calls any registered handlers for the update_patheffect action.
Base class for live path effect items.
std::list< PathEffectSharedPtr > PathEffectList
Interface for XML documents.
virtual Node * createElement(char const *name)=0
SPStyle - a style object for SPItem objects.
Geom::PathVector sp_svg_read_pathv(char const *str)
static void sp_svg_write_path(Inkscape::SVG::PathString &str, Geom::Path const &p, bool normalize=false)