18#include <sigc++/sigc++.h>
32#define SP_TEXT_CONTENT_MODIFIED_FLAG SP_OBJECT_USER_MODIFIED_FLAG_A
33#define SP_TEXT_LAYOUT_MODIFIED_FLAG SP_OBJECT_USER_MODIFIED_FLAG_A
42 int tag()
const override {
return tag_of<
decltype(*this)>; }
115 void update(
SPCtx* ctx,
unsigned int flags)
override;
116 void modified(
unsigned int flags)
override;
121 const char*
typeName()
const override;
125 void hide(
unsigned int key)
override;
constexpr int tag_of
Convenience function to retrieve the tag (class id) of a given type.
3x3 matrix representing an affine transformation.
Axis-aligned rectangle that can be empty.
Two-dimensional point that doubles as a vector.
SVG drawing item for display.
Storing of snapping preferences.
Generates the layout for either wrapped or non-wrapped text and stores the result.
Interface for refcounted XML nodes.
Wrapper around a Geom::PathVector object.
To do: update description of desktop.
Typed SVG document implementation.
Base class for visual SVG elements.
SPObject is an abstract base class of all of the document nodes at the SVG document level.
Inkscape::XML::Node * repr
Base class for shapes, including <path> element.
void getLinked(std::vector< SPObject * > &objects, LinkedObjectNature direction=LinkedObjectNature::ANY) const override
Get objects which are linked to this object as either a source or a target.
bool has_inline_size() const
void child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) override
std::unique_ptr< Shape > getInclusionShape(SPShape *shape) const
Add a single inclusion shape with padding.
void newline_to_sodipodi()
Convert new lines in 'inline-size' text to tspans with sodipodi:role="tspan".
void optimizeTextpathText()
Optimize textpath text on next set_transform.
void sodipodi_to_newline()
Convert tspans with sodipodi:role="tspans" to ' '.
void print(SPPrintContext *ctx) override
SVGLength * _getFirstYLength()
SPItem * get_first_shape_dependency()
Get the first shape reference which affects the position and layout of this text item.
void build(SPDocument *doc, Inkscape::XML::Node *repr) override
Inkscape::XML::Node * write(Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, unsigned int flags) override
std::unique_ptr< Shape > getExclusionShape() const
Union all exclusion shapes.
static void _adjustCoordsRecursive(SPItem *item, Geom::Affine const &m, double ex, bool is_root=true)
when the object is transformed it's nicer to change the font size and coordinates when we can,...
void _buildLayoutInit()
Initializes layout from <text> (i.e.
std::optional< Geom::Point > getBaselinePoint() const
Get the position of the baseline point for this text object.
SPCurve getNormalizedBpath() const
Converts the text object to its component curves.
void _clearFlow(Inkscape::DrawingGroup *in_arena)
discards the drawing objects representing this text.
bool has_shape_inside() const
std::unordered_map< unsigned, Inkscape::Text::StyleAttachments > view_style_attachments
void update(SPCtx *ctx, unsigned int flags) override
std::vector< std::unique_ptr< Shape > > makeEffectiveShapes() const
Compute the final effective shapes: All inclusion shapes shrunk by the padding, from which we subtrac...
static void _adjustFontsizeRecursive(SPItem *item, double ex, bool is_root=true)
Inkscape::DrawingItem * show(Inkscape::Drawing &drawing, unsigned int key, unsigned int flags) override
void remove_child(Inkscape::XML::Node *child) override
void show_shape_inside()
This two functions are useful because layout calculations need text visible for example Calculating a...
Geom::Affine set_transform(Geom::Affine const &transform) override
Geom::OptRect get_frame()
const char * displayName() const override
The item's type name as a translated human string.
Geom::OptRect bbox(Geom::Affine const &transform, SPItem::BBoxType type) const override
void rebuildLayout()
Completely recalculates the layout.
SVGLength * _getFirstXLength()
Find first x/y values which may be in a descendent element.
Inkscape::Text::Layout layout
bool is_horizontal() const
void modified(unsigned int flags) override
void snappoints(std::vector< Inkscape::SnapCandidatePoint > &p, Inkscape::SnapPreferences const *snapprefs) const override
const char * typeName() const override
The item's type name, not node tag name.
TextTagAttributes attributes
bool _optimizeTextpathText
Inkscape::XML::Node * get_first_rectangle()
void hide(unsigned int key) override
void remove_svg11_fallback()
Remove 'x' and 'y' values on children (lines) or they will be interpreted as absolute positions when ...
unsigned _buildLayoutInput(SPObject *object, Inkscape::Text::Layout::OptionalTextTagAttrs const &parent_optional_attrs, unsigned parent_attrs_offset, bool in_textpath)
Recursively walks the xml tree adding tags and their contents.
const std::vector< SPItem * > get_all_shape_dependencies() const
char * description() const override
Editable view implementation.
static cairo_user_data_key_t key
Some things pertinent to all visible shapes: SPItem, SPItemView, SPItemCtx.
TODO: insert short description here.
SPItem * create_text_with_rectangle(SPDesktop *desktop, Geom::Point p0, Geom::Point p1)
SPItem * create_text_with_inline_size(SPDesktop *desktop, Geom::Point p0, Geom::Point p1)
The optional attributes which can be applied to a SVG text or related tag.
Interface for XML documents.
Creates and maintains display tree needed for text styling.
contains and manages the attributes common to all types of text tag