Inkscape
Vector Graphics Editor
|
#include <drawing-text.h>
Public Member Functions | |
DrawingText (Drawing &drawing) | |
int | tag () const override |
Unlink this node and its subtree from the rendering tree and destroy. | |
bool | addComponent (std::shared_ptr< FontInstance > const &font, int unsigned glyph, Geom::Affine const &trans, float width, float ascent, float descent, float phase_length) |
void | setStyle (SPStyle const *style, SPStyle const *context_style=nullptr) override |
Process information related to the new style. | |
void | setChildrenStyle (SPStyle const *context_style) override |
Recursively update children style. | |
![]() | |
DrawingGroup (Drawing &drawing) | |
bool | pickChildren () |
void | setPickChildren (bool) |
Set whether the group returns children from pick calls. | |
void | setChildTransform (Geom::Affine const &) |
Set additional transform for the group. | |
![]() | |
DrawingItem (Drawing &drawing) | |
DrawingItem (DrawingItem const &)=delete | |
DrawingItem & | operator= (DrawingItem const &)=delete |
void | unlink () |
Geom::OptIntRect const & | bbox () const |
Geom::OptIntRect const & | drawbox () const |
Geom::OptRect const & | itemBounds () const |
Geom::Affine const & | ctm () const |
Geom::Affine | transform () const |
Drawing & | drawing () const |
DrawingItem * | parent () const |
bool | isAncestorOf (DrawingItem const *item) const |
Returns true if item is among the descendants. Will return false if item == this. | |
int | getUpdateComplexity () const |
bool | unisolatedBlend () const |
void | appendChild (DrawingItem *item) |
void | prependChild (DrawingItem *item) |
void | clearChildren () |
bool | visible () const |
void | setVisible (bool visible) |
bool | sensitive () const |
void | setSensitive (bool sensitive) |
void | setOpacity (float opacity) |
void | setAntialiasing (Antialiasing antialias) |
void | setIsolation (bool isolation) |
void | setBlendMode (SPBlendMode blend_mode) |
void | setTransform (Geom::Affine const &trans) |
void | setClip (DrawingItem *item) |
void | setMask (DrawingItem *item) |
void | setFillPattern (DrawingPattern *pattern) |
void | setStrokePattern (DrawingPattern *pattern) |
void | setZOrder (unsigned zorder) |
Move this item to the given place in the Z order of siblings. Does nothing if the item is not a normal child. | |
void | setItemBounds (Geom::OptRect const &bounds) |
void | setFilterRenderer (std::unique_ptr< Filters::Filter > renderer) |
void | setKey (unsigned key) |
unsigned | key () const |
void | setItem (SPItem *item) |
SPItem * | getItem () const |
void | update (Geom::IntRect const &area=Geom::IntRect::infinite(), UpdateContext const &ctx=UpdateContext(), unsigned flags=STATE_ALL, unsigned reset=0) |
Update derived data before operations. | |
unsigned | render (DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area, unsigned flags=0, DrawingItem const *stop_at=nullptr) const |
Rasterize items. | |
unsigned | render (DrawingContext &dc, Geom::IntRect const &area, unsigned flags=0) const |
A stand alone render, ignoring all other objects in the document. | |
void | clip (DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area) const |
Rasterize the clipping path. | |
DrawingItem * | pick (Geom::Point const &p, double delta, unsigned flags=0) |
Get the item under the specified point. | |
Glib::ustring | name () const |
void | recursivePrintTree (unsigned level=0) const |
Protected Member Functions | |
~DrawingText () override=default | |
unsigned | _updateItem (Geom::IntRect const &area, UpdateContext const &ctx, unsigned flags, unsigned reset) override |
unsigned | _renderItem (DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area, unsigned flags, DrawingItem const *stop_at) const override |
void | _clipItem (DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area) const override |
DrawingItem * | _pickItem (Geom::Point const &p, double delta, unsigned flags) override |
bool | _canClip () const override |
void | decorateItem (DrawingContext &dc, double phase_length, bool under) const |
void | decorateStyle (DrawingContext &dc, double vextent, double xphase, Geom::Point const &p1, Geom::Point const &p2, double thickness) const |
![]() | |
~DrawingGroup () override=default | |
![]() | |
virtual | ~DrawingItem () |
void | _renderOutline (DrawingContext &dc, RenderContext &rc, Geom::IntRect const &area, unsigned flags) const |
void | _markForUpdate (unsigned state, bool propagate) |
Marks the item as needing a recomputation of internal data. | |
void | _markForRendering () |
Marks the current visual bounding box of the item for redrawing. | |
void | _invalidateFilterBackground (Geom::IntRect const &area) |
double | _cacheScore () |
Compute the caching score. | |
Geom::OptIntRect | _cacheRect () const |
void | _setCached (bool cached, bool persistent=false) |
Enable / disable storing the rendering in memory. | |
virtual void | _dropPatternCache () |
template<typename F > | |
void | defer (F &&f) |
Protected Attributes | |
NRStyle | _nrstyle |
bool | style_vector_effect_stroke: 1 |
bool | style_stroke_extensions_hairline: 1 |
SPWindRule | style_clip_rule |
![]() | |
std::unique_ptr< Geom::Affine > | _child_transform |
![]() | |
Drawing & | _drawing |
DrawingItem * | _parent |
ListHook | _child_hook |
ChildrenList | _children |
unsigned | _key |
Auxiliary key used by the object tree for showing clips/masks/patterns. | |
SPItem * | _item |
Used to associate DrawingItems with SPItems that created them. | |
SPStyle const * | _style |
SPStyle const * | _context_style |
float | _opacity |
std::unique_ptr< Geom::Affine > | _transform |
Incremental transform from parent to this item's coords. | |
Geom::Affine | _ctm |
Total transform from item coords to display coords. | |
Geom::OptIntRect | _bbox |
Bounding box in display (pixel) coords including stroke. | |
Geom::OptIntRect | _drawbox |
Full visual bounding box - enlarged by filters, shrunk by clips and masks. | |
Geom::OptRect | _item_bbox |
Geometric bounding box in item's user space. | |
DrawingItem * | _clip |
DrawingItem * | _mask |
DrawingPattern * | _fill_pattern |
DrawingPattern * | _stroke_pattern |
std::unique_ptr< Inkscape::Filters::Filter > | _filter |
std::unique_ptr< CacheData > | _cache |
int | _update_complexity = 0 |
bool | _contains_unisolated_blend: 1 |
CacheList::iterator | _cache_iterator |
bool | style_vector_effect_size: 1 |
bool | style_vector_effect_rotate: 1 |
bool | style_vector_effect_fixed: 1 |
unsigned | _state: 8 |
unsigned | _propagate_state: 8 |
ChildType | _child_type: 3 |
unsigned | _background_new: 1 |
Whether enable-background: new is set for this element. | |
unsigned | _background_accumulate: 1 |
Whether this element accumulates background (has any ancestor with enable-background: new) | |
unsigned | _visible: 1 |
unsigned | _sensitive: 1 |
Whether this item responds to events. | |
unsigned | _cached_persistent: 1 |
If set, will always be cached regardless of score. | |
unsigned | _has_cache_iterator: 1 |
If set, _cache_iterator is valid. | |
unsigned | _pick_children: 1 |
For groups: if true, children are returned from pick(), otherwise the group is returned. | |
Antialiasing | _antialias: 2 |
antialiasing level (default is Good) | |
bool | _isolation: 1 |
SPBlendMode | _blend_mode |
Friends | |
class | DrawingGlyphs |
Additional Inherited Members | |
![]() | |
enum | RenderFlags { RENDER_DEFAULT = 0 , RENDER_CACHE_ONLY = 1 << 0 , RENDER_BYPASS_CACHE = 1 << 1 , RENDER_FILTER_BACKGROUND = 1 << 2 , RENDER_OUTLINE = 1 << 3 , RENDER_NO_FILTERS = 1 << 4 , RENDER_VISIBLE_HAIRLINES = 1 << 5 } |
enum | StateFlags { STATE_NONE = 0 , STATE_BBOX = 1 << 0 , STATE_CACHE = 1 << 1 , STATE_PICK = 1 << 2 , STATE_RENDER = 1 << 3 , STATE_BACKGROUND = 1 << 4 , STATE_ALL = (1 << 5) - 1 , STATE_TOTAL_INV = 1 << 5 } |
enum | PickFlags { PICK_NORMAL = 0 , PICK_STICKY = 1 << 0 , PICK_AS_CLIP = 1 << 1 , PICK_OUTLINE = 1 << 2 } |
![]() | |
enum class | ChildType : unsigned char { ORPHAN = 0 , NORMAL = 1 , CLIP = 2 , MASK = 3 , FILL = 4 , STROKE = 5 , ROOT = 6 } |
enum | RenderResult { RENDER_OK = 0 , RENDER_STOP = 1 } |
using | ListHook = boost::intrusive::list_member_hook<> |
using | ChildrenList = boost::intrusive::list< DrawingItem, boost::intrusive::member_hook< DrawingItem, ListHook, &DrawingItem::_child_hook > > |
Definition at line 66 of file drawing-text.h.
Inkscape::DrawingText::DrawingText | ( | Drawing & | drawing | ) |
Definition at line 152 of file drawing-text.cpp.
|
overrideprotecteddefault |
|
inlineoverrideprotectedvirtual |
Reimplemented from Inkscape::DrawingGroup.
Definition at line 85 of file drawing-text.h.
|
overrideprotectedvirtual |
Reimplemented from Inkscape::DrawingGroup.
Definition at line 710 of file drawing-text.cpp.
References Inkscape::DrawingItem::_children, Inkscape::DrawingContext::fill(), Inkscape::DrawingContext::path(), Inkscape::DrawingContext::setFillRule(), SP_WIND_RULE_EVENODD, style_clip_rule, and Inkscape::DrawingContext::transform().
|
overrideprotectedvirtual |
Reimplemented from Inkscape::DrawingGroup.
Definition at line 735 of file drawing-text.cpp.
References Inkscape::DrawingGroup::_pickItem(), and delta.
|
overrideprotectedvirtual |
Reimplemented from Inkscape::DrawingGroup.
Definition at line 407 of file drawing-text.cpp.
References Inkscape::DrawingItem::_bbox, Inkscape::DrawingItem::_children, Inkscape::DrawingItem::_ctm, Inkscape::DrawingItem::_fill_pattern, Inkscape::DrawingItem::_item_bbox, _nrstyle, Inkscape::DrawingItem::_stroke_pattern, Inkscape::NRStyle::applyFill(), Inkscape::NRStyle::applyStroke(), Inkscape::NRStyle::applyTextDecorationFill(), Inkscape::NRStyle::applyTextDecorationStroke(), Inkscape::NRStyle::data, decorateItem(), Inkscape::DrawingContext::device_to_user_distance(), Inkscape::DrawingContext::fill(), Inkscape::DrawingContext::fillPreserve(), has_fill(), has_stroke(), Geom::Affine::inverse(), Inkscape::DrawingContext::newPath(), Inkscape::outline(), Inkscape::DrawingContext::paint(), Inkscape::NRStyleData::PAINT_ORDER_FILL, Inkscape::NRStyleData::paint_order_layer, Inkscape::NRStyleData::PAINT_ORDER_NORMAL, Inkscape::NRStyleData::PAINT_ORDER_STROKE, Inkscape::DrawingContext::path(), Inkscape::NRStyle::prepareFill(), Inkscape::NRStyle::prepareStroke(), Inkscape::NRStyle::prepareTextDecorationFill(), Inkscape::NRStyle::prepareTextDecorationStroke(), Inkscape::DrawingContext::raw(), rc, Inkscape::DrawingContext::rectangle(), Inkscape::DrawingItem::RENDER_OK, Inkscape::DrawingItem::RENDER_OUTLINE, Inkscape::DrawingItem::RENDER_VISIBLE_HAIRLINES, scale, Inkscape::DrawingContext::scale(), Inkscape::DrawingContext::setHairline(), Inkscape::DrawingContext::setLineWidth(), Inkscape::DrawingContext::setSource(), Inkscape::DrawingContext::setTolerance(), Inkscape::DrawingContext::stroke(), Inkscape::NRStyleData::stroke_width, Inkscape::DrawingContext::strokePreserve(), style_stroke_extensions_hairline, style_vector_effect_stroke, Inkscape::NRStyleData::text_decoration_line, Inkscape::NRStyleData::TEXT_DECORATION_LINE_CLEAR, Inkscape::DrawingContext::transform(), Inkscape::DrawingContext::translate(), Inkscape::DrawingItem::visible(), Geom::Affine::withoutTranslation(), Geom::X, and Geom::Y.
|
overrideprotectedvirtual |
Reimplemented from Inkscape::DrawingGroup.
Definition at line 217 of file drawing-text.cpp.
References _nrstyle, Inkscape::DrawingGroup::_updateItem(), and Inkscape::NRStyle::invalidate().
bool Inkscape::DrawingText::addComponent | ( | std::shared_ptr< FontInstance > const & | font, |
int unsigned | glyph, | ||
Geom::Affine const & | trans, | ||
float | width, | ||
float | ascent, | ||
float | descent, | ||
float | phase_length | ||
) |
Definition at line 160 of file drawing-text.cpp.
References Inkscape::DrawingItem::_drawing, Inkscape::DrawingItem::_markForRendering(), Inkscape::DrawingItem::appendChild(), Inkscape::DrawingItem::defer(), DrawingGlyphs, Inkscape::Drawing::snapshotted(), and width.
|
protected |
Definition at line 351 of file drawing-text.cpp.
References _nrstyle, Inkscape::NRStyleData::ascender, Inkscape::NRStyle::data, decorateStyle(), Inkscape::NRStyleData::descender, Inkscape::NRStyleData::font_size, Inkscape::NRStyleData::line_through_position, Inkscape::NRStyleData::line_through_thickness, Inkscape::DrawingContext::setTolerance(), Inkscape::NRStyleData::text_decoration_line, Inkscape::NRStyleData::TEXT_DECORATION_LINE_BLINK, Inkscape::NRStyleData::TEXT_DECORATION_LINE_LINETHROUGH, Inkscape::NRStyleData::TEXT_DECORATION_LINE_OVERLINE, Inkscape::NRStyleData::TEXT_DECORATION_LINE_UNDERLINE, Inkscape::NRStyleData::tspan_width, Inkscape::NRStyleData::underline_position, and Inkscape::NRStyleData::underline_thickness.
Referenced by _renderItem().
|
protected |
Definition at line 223 of file drawing-text.cpp.
References _nrstyle, Inkscape::DrawingContext::closePath(), Inkscape::NRStyle::data, dots, Inkscape::DrawingContext::lineTo(), Inkscape::DrawingContext::moveTo(), Inkscape::DrawingContext::rectangle(), Inkscape::NRStyleData::text_decoration_style, Inkscape::NRStyleData::TEXT_DECORATION_STYLE_DASHED, Inkscape::NRStyleData::TEXT_DECORATION_STYLE_DOTTED, Inkscape::NRStyleData::TEXT_DECORATION_STYLE_ISDOUBLE, Inkscape::NRStyleData::TEXT_DECORATION_STYLE_WAVY, Geom::X, and Geom::Y.
Referenced by decorateItem().
|
overridevirtual |
Recursively update children style.
The purpose of this call is to update fill and stroke for markers that have elements with fill/stroke property values of 'context-fill' or 'context-stroke'. Marker styling is not updated like other 'clones' as marker instances are not included the SP object tree. Note: this is a virtual function.
Reimplemented from Inkscape::DrawingItem.
Definition at line 208 of file drawing-text.cpp.
References Inkscape::DrawingItem::_context_style, _nrstyle, Inkscape::DrawingItem::_style, Inkscape::DrawingItem::defer(), Inkscape::NRStyle::set(), and Inkscape::DrawingItem::setChildrenStyle().
|
overridevirtual |
Process information related to the new style.
Note: _style is not used by DrawingGlyphs which uses its parent style.
Reimplemented from Inkscape::DrawingItem.
Definition at line 187 of file drawing-text.cpp.
References Inkscape::DrawingItem::_context_style, _nrstyle, Inkscape::DrawingItem::_style, SPStyle::clip_rule, Inkscape::DrawingItem::defer(), Inkscape::NRStyle::set(), Inkscape::DrawingItem::setStyle(), SP_WIND_RULE_EVENODD, SPStyle::stroke_extensions, style_clip_rule, style_stroke_extensions_hairline, style_vector_effect_stroke, and SPStyle::vector_effect.
|
inlineoverridevirtual |
Unlink this node and its subtree from the rendering tree and destroy.
Reimplemented from Inkscape::DrawingGroup.
Definition at line 71 of file drawing-text.h.
References tag_of.
|
friend |
Definition at line 95 of file drawing-text.h.
Referenced by addComponent().
|
protected |
Definition at line 89 of file drawing-text.h.
Referenced by _renderItem(), _updateItem(), decorateItem(), decorateStyle(), setChildrenStyle(), and setStyle().
|
protected |
Definition at line 93 of file drawing-text.h.
Referenced by _clipItem(), and setStyle().
|
protected |
Definition at line 92 of file drawing-text.h.
Referenced by _renderItem(), and setStyle().
|
protected |
Definition at line 91 of file drawing-text.h.
Referenced by _renderItem(), and setStyle().