/*
10 * Authors: see git history
12 * Copyright (C) 2018 Authors
13 * Released under GNU GPL v2+, read the file
'COPYING' for more information.
15#ifndef INKSCAPE_TEXT_TAG_ATTRIBUTES_H
16#define INKSCAPE_TEXT_TAG_ATTRIBUTES_H
48 void update(
double em,
double ex,
double w,
double h );
74 void erase(
unsigned start_index,
unsigned n);
83 void insert(
unsigned start_index,
unsigned n);
102 void transform(
Geom::Affine const &matrix,
double scale_x,
double scale_y,
bool extend_zero_length =
false);
166 static void mergeSingleAttribute(std::vector<SVGLength> *output_list, std::vector<SVGLength>
const &parent_list,
unsigned parent_offset, std::vector<SVGLength>
const *overlay_list =
nullptr);
169 static void eraseSingleAttribute(std::vector<SVGLength> *attr_vector,
unsigned start_index,
unsigned n);
172 static void insertSingleAttribute(std::vector<SVGLength> *attr_vector,
unsigned start_index,
unsigned n,
bool is_xy);
175 static void splitSingleAttribute(std::vector<SVGLength> *first_vector,
unsigned index, std::vector<SVGLength> *second_vector,
bool trimZeros);
178 static void joinSingleAttribute(std::vector<SVGLength> *dest_vector, std::vector<SVGLength>
const &first_vector, std::vector<SVGLength>
const &second_vector,
unsigned second_index);
3x3 matrix representing an affine transformation.
Two-dimensional point that doubles as a vector.
Axis aligned, non-empty rectangle.
Interface for refcounted XML nodes.
void split(unsigned index, TextTagAttributes *second)
Divides the stored attributes into two, at the given index.
static void insertSingleAttribute(std::vector< SVGLength > *attr_vector, unsigned start_index, unsigned n, bool is_xy)
Does the work for insert().
static void writeSingleAttributeLength(Inkscape::XML::Node *node, gchar const *key, const SVGLength &length)
Writes a single length value to node.
static void splitSingleAttribute(std::vector< SVGLength > *first_vector, unsigned index, std::vector< SVGLength > *second_vector, bool trimZeros)
Does the work for split().
Geom::Point firstXY() const
Returns the first coordinates in the x and y vectors.
void mergeInto(Inkscape::Text::Layout::OptionalTextTagAttrs *output, Inkscape::Text::Layout::OptionalTextTagAttrs const &parent_attrs, unsigned parent_attrs_offset, bool copy_xy, bool copy_dxdyrotate) const
Implements the rules for overlaying the contents of the class (treated as the child object) on top of...
SVGLength * getTextLength()
SVGLength * getFirstXLength()
Gets first value in the x vector as an SVGLength.
TextTagAttributes()=default
void setRotate(unsigned index, double angle)
Sets rotate vector at the given index.
bool readSingleAttribute(SPAttr key, gchar const *value, SPStyle const *style, Geom::Rect const *viewport)
Process the parameters from the set() function of SPObject.
bool singleXYCoordinates() const
For tspan role=line elements we should not use the set x,y coordinates since that would overrule the ...
double getDx(unsigned index)
Gets current value of dx vector at index.
SVGLength * getFirstYLength()
Gets first value in the y vector as an SVGLength.
void addToDy(unsigned index, double delta)
Adds the given value to the dy vector at the given index.
void addToDxDy(unsigned index, Geom::Point const &adjust)
Adds the given values to the dx and dy vectors at the given index.
void addToRotate(unsigned index, double delta)
Adds the given value to the rotate vector at the given index.
void setFirstXY(Geom::Point &point)
Sets the first coordinates in the x and y vectors.
void readFrom(Inkscape::XML::Node const *node)
Fill in all the fields of attributes from the given node.
void transform(Geom::Affine const &matrix, double scale_x, double scale_y, bool extend_zero_length=false)
Applies the given transformation to the stored coordinates.
void erase(unsigned start_index, unsigned n)
Deletes all the values from all the vectors beginning at start_index and extending for n fields.
static void mergeSingleAttribute(std::vector< SVGLength > *output_list, std::vector< SVGLength > const &parent_list, unsigned parent_offset, std::vector< SVGLength > const *overlay_list=nullptr)
Does mergeInto() for one member of attributes.
bool anyAttributesSet() const
Returns false if all of the vectors are zero length.
static void writeSingleAttributeVector(Inkscape::XML::Node *node, gchar const *key, std::vector< SVGLength > const &attr_vector)
Does the reverse of readSingleAttribute(), converting a vector<> to its SVG string representation and...
void writeTo(Inkscape::XML::Node *node) const
Write out all the contents of attributes to the given node.
Inkscape::Text::Layout::OptionalTextTagAttrs attributes
This holds the actual values.
void insert(unsigned start_index, unsigned n)
Inserts n new values in all the stored vectors at start_index.
void addToDx(unsigned index, double delta)
Adds the given value to the dx vector at the given index.
double getRotate(unsigned index)
Gets current value of rotate vector at index.
void update(double em, double ex, double w, double h)
Update relative values.
static void joinSingleAttribute(std::vector< SVGLength > *dest_vector, std::vector< SVGLength > const &first_vector, std::vector< SVGLength > const &second_vector, unsigned second_index)
Does the work for join().
double getDy(unsigned index)
Gets current value of dy vector at index.
static void eraseSingleAttribute(std::vector< SVGLength > *attr_vector, unsigned start_index, unsigned n)
Does the work for erase().
TextTagAttributes(Inkscape::Text::Layout::OptionalTextTagAttrs attrs)
void join(TextTagAttributes const &first, TextTagAttributes const &second, unsigned second_index)
Overwrites all the attributes contained in this object with the given parameters by putting first at ...
Inkscape::XML::Node * node
Helper class to stream background task notifications as a series of messages.
static cairo_user_data_key_t key
The optional attributes which can be applied to a SVG text or related tag.
LengthAdjust lengthAdjust