Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
sp-page.cpp
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Inkscape pages implementation
4 *
5 * Authors:
6 * Martin Owens <doctormo@geek-2.com>
7 *
8 * Copyright (C) 2021 Martin Owens
9 *
10 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
11 */
12
13#include "sp-page.h"
14
15#include <glibmm/i18n.h>
16
17#include "attributes.h"
18#include "document.h"
19
21#include "object/object-set.h"
22#include "util/units.h"
23
25
31
33{
34 delete _canvas_item;
35 _canvas_item = nullptr;
36}
37
39{
41
44 this->readAttr(SPAttr::X);
45 this->readAttr(SPAttr::Y);
50
51 /* Register */
52 document->addResource("page", this);
53}
54
56{
57 if (this->document) {
58 // Unregister ourselves
59 this->document->removeResource("page", this);
60 }
61
63}
64
65void SPPage::set(SPAttr key, const gchar *value)
66{
67 switch (key) {
68 case SPAttr::X:
69 this->x.readOrUnset(value);
70 break;
71 case SPAttr::Y:
72 this->y.readOrUnset(value);
73 break;
74 case SPAttr::WIDTH:
75 this->width.readOrUnset(value);
76 break;
77 case SPAttr::HEIGHT:
78 this->height.readOrUnset(value);
79 break;
82 break;
85 break;
87 this->_size_label = value ? std::string(value) : "";
88 break;
89 default:
90 SPObject::set(key, value);
91 break;
92 }
95}
96
101{
102 if (this->width && this->height) {
103 if (this->margin)
104 this->margin.update(12, 6, this->width.computed, this->height.computed);
105 if (this->bleed)
106 this->bleed.update(12, 6, this->width.computed, this->height.computed);
107 }
108}
109
114{
115 if (margin || bleed) {
116 return false;
117 }
118 return true;
119}
120
128
136
141{
142 auto box = getDesktopRect();
143 return Geom::Translate(box.left(), box.top());
144}
145
150{
151 auto rect = getRect();
152 rect.setTop(rect.top() + margin.top().computed);
153 rect.setLeft(rect.left() + margin.left().computed);
154 rect.setBottom(rect.bottom() - margin.bottom().computed);
155 rect.setRight(rect.right() - margin.right().computed);
156 if (rect.hasZeroArea())
157 return getDocumentRect(); // Cancel!
158 return rect * document->getDocumentScale();
159}
160
165
170{
171 auto rect = getRect();
172 rect.setTop(rect.top() - bleed.top().computed);
173 rect.setLeft(rect.left() - bleed.left().computed);
174 rect.setBottom(rect.bottom() + bleed.bottom().computed);
175 rect.setRight(rect.right() + bleed.right().computed);
176
177 if (rect.hasZeroArea()) {
178 return getRect();
179 }
180 return rect;
181}
182
190
195
203
209{
210 auto rect = getDesktopRect();
211 rect.expandBy(-0.1);
212 return rect;
213}
214
219{
220 this->x = rect.left();
221 this->y = rect.top();
222 this->width = rect.width();
223 this->height = rect.height();
224
225 // always clear size label, toolbar is responsible for putting it back if needed.
226 this->_size_label = "";
227
228 // This is needed to update the xml
229 this->updateRepr();
230
231 // This eventually calls the ::update below while idle
233}
234
238void SPPage::setDocumentRect(Geom::Rect rect, bool add_margins)
239{
240 rect *= document->getDocumentScale().inverse();
241 if (add_margins) {
242 // Add margins to rectangle.
243 rect.setTop(rect.top() - margin.top().computed);
244 rect.setLeft(rect.left() - margin.left().computed);
245 rect.setBottom(rect.bottom() + margin.bottom().computed);
246 rect.setRight(rect.right() + margin.right().computed);
247 }
248 setRect(rect);
249}
250
258
267void SPPage::setSize(double width, double height)
268{
269 auto rect = getDocumentRect();
270 rect.setMax(rect.corner(0) + Geom::Point(width, height));
271 setDocumentRect(rect);
272}
273
277void SPPage::setMargin(const std::string &value)
278{
280 this->updateRepr();
281}
282
286void SPPage::setBleed(const std::string &value)
287{
289 this->updateRepr();
290}
291
295double SPPage::getMarginSide(int side)
296{
297 return this->margin.get((BoxSide)side);
298}
299
303void SPPage::setMarginSide(int side, double value, bool confine)
304{
305 if (confine && !margin) {
306 this->margin.set(value, value, value, value);
307 } else {
308 this->margin.set((BoxSide)side, value, confine);
309 }
310 this->updateRepr();
311}
315void SPPage::setMarginSide(int side, const std::string &value, bool confine)
316{
318 auto unit = document->getDisplayUnit()->abbr;
319 if (confine && !margin) {
320 this->margin.fromString(value, unit, scale);
321 } else {
322 this->margin.fromString((BoxSide)side, value, unit, scale);
323 }
324 this->updateRepr();
325}
326
327std::string SPPage::getMarginLabel() const
328{
329 if (!margin || margin.isZero())
330 return "";
332 auto unit = document->getDisplayUnit()->abbr;
333 return margin.toString(unit, scale, 2);
334}
335
336std::string SPPage::getBleedLabel() const
337{
338 if (!bleed || bleed.isZero())
339 return "";
341 auto unit = document->getDisplayUnit()->abbr;
342 return bleed.toString(unit, scale, 2);
343}
344
345double SPPage::getBleedSide(int side)
346{
347 return this->bleed.get((BoxSide)side);
348}
349
350void SPPage::setBleedSide(int side, double value)
351{
352 this->bleed.set((BoxSide)side, value, false);
353 this->updateRepr();
354}
355
367std::vector<SPItem *> SPPage::getExclusiveItems(bool hidden, bool in_bleed, bool in_layers) const
368{
369 return document->getItemsInBox(0, in_bleed ? getDocumentBleed() : getDocumentRect(), hidden, true, true, false, in_layers);
370}
371
379std::vector<SPItem *> SPPage::getOverlappingItems(bool hidden, bool in_bleed, bool in_layers) const
380{
381 return document->getItemsPartiallyInBox(0, in_bleed ? getDocumentBleed() : getDocumentRect(), hidden, true, true, false, in_layers);
382}
383
393bool SPPage::itemOnPage(SPItem const *item, bool contains, bool groups) const
394{
395 if (!groups && is<SPGroup>(item)) {
396 return std::any_of(item->children.begin(),
397 item->children.end(),
398 [this](auto const &obj) {
399 auto const *as_item = cast<SPItem>(&obj);
400 return as_item && itemOnPage(as_item);
401 });
402 }
403 if (auto box = item->desktopGeometricBounds()) {
404 if (contains) {
405 return getDesktopRect().contains(*box);
406 }
407 return getDesktopRect().intersects(*box);
408 }
409 return false;
410}
411
416{
417 auto rect = document->preferredBounds();
418 return getDocumentRect().corner(0).floor() == rect->corner(0).floor();
419}
420
425{
427 // The final steps are completed in an update cycle
429}
430
435{
438 return true;
439 }
440 return false;
441}
442
447{
448 this->_canvas_item->is_selected = sel;
450}
451
456{
457 return document->getPageManager().getPageIndex(this);
458}
459
468bool SPPage::setPageIndex(int index, bool swap_page)
469{
470 int current = getPageIndex();
471
472 if (current != index) {
474
475 // The page we're going to be shifting to
476 auto sibling = page_manager.getPage(index);
477
478 // Insertions are done to the right of the sibling
479 if (index < current) {
480 index -= 1;
481 }
482 auto insert_after = page_manager.getPage(index);
483
484 // We may have selected an index off the end, so attach it after the last page.
485 if (!insert_after && index > 0) {
486 insert_after = page_manager.getLastPage();
487 sibling = nullptr; // disable swap
488 }
489
490 if (insert_after) {
491 if (this == insert_after) {
492 g_warning("Page is already at this index. Not moving.");
493 return false;
494 }
495 // Attach after the given page
496 getRepr()->parent()->changeOrder(getRepr(), insert_after->getRepr());
497 } else {
498 // Attach to before any existing page
499 sibling = page_manager.getFirstPage();
500 getRepr()->parent()->changeOrder(getRepr(), nullptr);
501 }
502 if (sibling && swap_page) {
503 swapPage(sibling, true);
504 }
505 return true;
506 }
507 return false;
508}
509
514{
515 SPObject *item = this;
516 while ((item = item->getNext())) {
517 if (auto next = cast<SPPage>(item)) {
518 return next;
519 }
520 }
521 return nullptr;
522}
523
528{
529 SPObject *item = this;
530 while ((item = item->getPrev())) {
531 if (auto prev = cast<SPPage>(item)) {
532 return prev;
533 }
534 }
535 return nullptr;
536}
537
544void SPPage::movePage(Geom::Affine translate, bool with_objects)
545{
546 if (translate.isTranslation()) {
547 if (with_objects) {
548 // Move each item that is overlapping this page too
549 moveItems(translate, getOverlappingItems());
550 }
551 setDesktopRect(getDesktopRect() * translate);
552 }
553}
554
561void SPPage::moveItems(Geom::Affine translate, std::vector<SPItem *> const &items)
562{
563 if (items.empty()) {
564 return;
565 }
567 for (auto &item : items) {
568 if (item->isLocked()) {
569 continue;
570 }
571 set.add(item);
572 }
573 set.applyAffine(translate, true, false, true);
574}
575
582void SPPage::swapPage(SPPage *other, bool with_objects)
583{
584 // Swapping with the viewport page must be handled gracefully.
585 if (this->isViewportPage()) {
586 auto other_rect = other->getDesktopRect();
587 auto new_rect = Geom::Rect(Geom::Point(0, 0),
588 Geom::Point(other_rect.width(), other_rect.height()));
589 this->document->fitToRect(new_rect, false);
590 } else if (other->isViewportPage()) {
591 other->swapPage(this, with_objects);
592 return;
593 }
594
595 auto this_affine = Geom::Translate(getDesktopRect().corner(0));
598 other->movePage(other_affine.inverse() * this_affine, with_objects);
599}
600
601void SPPage::update(SPCtx * /*ctx*/, unsigned int /*flags*/)
602{
603 // This is manual because this is not an SPItem, but it's own visual identity.
604 auto lbl = label();
605 char *alt = nullptr;
608 }
610 g_free(alt);
611}
612
617{
618 if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
619 repr = xml_doc->createElement("inkscape:page");
620 }
621
623 repr->setAttributeSvgDouble("y", this->y.computed);
624 repr->setAttributeSvgDouble("width", this->width.computed);
625 repr->setAttributeSvgDouble("height", this->height.computed);
626 repr->setAttributeOrRemoveIfEmpty("margin", this->margin.write());
627 repr->setAttributeOrRemoveIfEmpty("bleed", this->bleed.write());
628 repr->setAttributeOrRemoveIfEmpty("page-size", this->_size_label);
629
630 return SPObject::write(xml_doc, repr, flags);
631}
632
634{
636 // This is needed to update the xml
637 this->updateRepr();
638}
639
640std::string SPPage::getDefaultLabel() const
641{
642 gchar *format = g_strdup_printf(_("Page %d"), getPagePosition());
643 auto ret = std::string(format);
644 g_free(format);
645 return ret;
646}
647
648std::string SPPage::getLabel() const
649{
650 auto ret = label();
651 if (!ret) {
652 return getDefaultLabel();
653 }
654 return std::string(ret);
655}
656
657std::string SPPage::getSizeLabel() const
658{
659 return _size_label;
660}
661
666{
667 _size_label = page->_size_label;
668 if (auto const &margin_box = page->getMarginBox()) {
670 }
671 if (auto const &bleed_box = page->getBleedBox()) {
673 }
674 updateRepr();
675}
676
680
681/*
682 Local Variables:
683 mode:c++
684 c-file-style:"stroustrup"
685 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
686 indent-tabs-mode:nil
687 fill-column:99
688 End:
689*/
690// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
double scale
Definition aa.cpp:228
Lookup dictionary for attributes/properties.
SPAttr
Definition attributes.h:27
@ PAGE_BLEED
@ PAGE_SIZE_NAME
@ INKSCAPE_LABEL
@ PAGE_MARGIN
uint64_t page
Definition canvas.cpp:171
3x3 matrix representing an affine transformation.
Definition affine.h:70
bool isTranslation(Coord eps=EPSILON) const
Check whether this matrix represents a pure translation.
Definition affine.cpp:123
static CRect from_xywh(Coord x, Coord y, Coord w, Coord h)
Create rectangle from origin and dimensions.
C right() const
Return rightmost coordinate of the rectangle (+X is to the right).
bool contains(GenericRect< C > const &r) const
Check whether the rectangle includes all points in the given rectangle.
bool intersects(GenericRect< C > const &r) const
Check whether the rectangles have any common points.
void setLeft(C val)
Set the minimum X coordinate of the rectangle.
C top() const
Return top coordinate of the rectangle (+Y is downwards).
void setTop(C val)
Set the minimum Y coordinate of the rectangle.
void setRight(C val)
Set the maximum X coordinate of the rectangle.
void setBottom(C val)
Set the maximum Y coordinate of the rectangle.
C left() const
Return leftmost coordinate of the rectangle (+X is to the right).
C height() const
Get the vertical extent of the rectangle.
C width() const
Get the horizontal extent of the rectangle.
C bottom() const
Return bottom coordinate of the rectangle (+Y is downwards).
CPoint corner(unsigned i) const
Return the n-th corner of the rectangle.
Two-dimensional point that doubles as a vector.
Definition point.h:66
Axis aligned, non-empty rectangle.
Definition rect.h:92
Scale inverse() const
Definition transforms.h:172
Translation by a vector.
Definition transforms.h:115
void update(Geom::Rect size, Geom::OptRect margin, Geom::OptRect bleed, const char *txt, bool outline, bool is_yaxisdown)
Update the visual representation of a page on screen.
void add(Geom::Rect size, CanvasItemGroup *background_group, CanvasItemGroup *foreground_group)
Add the page canvas to the given canvas item groups (canvas view is implicit)
void set_guides_visible(bool show)
bool setDefaultAttributes(CanvasPage *item)
Update the canvas item with the default display attributes.
bool showDefaultLabel() const
int getPageIndex(const SPPage *page) const
Get page index, returns -1 if the page is not found in this document.
Glib::ustring abbr
Definition units.h:76
Interface for refcounted XML nodes.
Definition node.h:80
virtual Node * parent()=0
Get the parent of this node.
virtual void changeOrder(Node *child, Node *after)=0
Move a given node in this node's child order.
void setAttributeOrRemoveIfEmpty(Inkscape::Util::const_char_ptr key, Inkscape::Util::const_char_ptr value)
Change an attribute of this node.
Definition node.cpp:167
bool setAttributeSvgDouble(Util::const_char_ptr key, double val)
For attributes where an exponent is allowed.
Definition node.cpp:111
Typed SVG document implementation.
Definition document.h:103
const Geom::Affine & doc2dt() const
Document to desktop coordinate transformation.
Definition document.cpp:935
bool removeResource(char const *key, SPObject *object)
bool addResource(char const *key, SPObject *object)
const Geom::Affine & dt2doc() const
Desktop to document coordinate transformation.
Definition document.h:270
void fitToRect(Geom::Rect const &rect, bool with_margins=false)
Given a Geom::Rect that may, for example, correspond to the bbox of an object, this function fits the...
std::vector< SPItem * > getItemsPartiallyInBox(unsigned int dkey, Geom::Rect const &box, bool take_hidden=false, bool take_insensitive=false, bool take_groups=true, bool enter_groups=false, bool enter_layers=true) const
Get items whose bounding box overlaps with given area.
Geom::OptRect preferredBounds() const
Definition document.cpp:978
Inkscape::PageManager & getPageManager()
Definition document.h:164
std::vector< SPItem * > getItemsInBox(unsigned int dkey, Geom::Rect const &box, bool take_hidden=false, bool take_insensitive=false, bool take_groups=true, bool enter_groups=false, bool enter_layers=true) const
Return list of items, contained in box.
bool is_yaxisdown() const
True if the desktop Y-axis points down, false if it points up.
Definition document.h:276
Geom::Scale getDocumentScale(bool computed=true) const
Returns document scale as defined by width/height (in pixels) and viewBox (real world to user-units).
Definition document.cpp:773
Inkscape::Util::Unit const * getDisplayUnit()
guaranteed not to return nullptr
Definition document.cpp:741
Base class for visual SVG elements.
Definition sp-item.h:109
bool isLocked() const
Definition sp-item.cpp:218
Geom::OptRect desktopGeometricBounds() const
Get item's geometric bbox in desktop coordinate system.
Definition sp-item.cpp:1044
SPObject is an abstract base class of all of the document nodes at the SVG document level.
Definition sp-object.h:160
char const * label() const
Gets the author-visible label property for the object or a default if no label is defined.
SPObject * getNext()
Inkscape::XML::Node * repr
Definition sp-object.h:193
void requestModified(unsigned int flags)
Requests that a modification notification signal be emitted later (e.g.
SPDocument * document
Definition sp-object.h:188
virtual void set(SPAttr key, const char *value)
virtual Inkscape::XML::Node * write(Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, unsigned int flags)
SPObject * getPrev()
Returns previous object in sibling list or NULL.
virtual void release()
Inkscape::XML::Node * updateRepr(unsigned int flags=SP_OBJECT_WRITE_EXT)
Updates the object's repr based on the object's state.
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.
virtual void build(SPDocument *doc, Inkscape::XML::Node *repr)
ChildrenList children
Definition sp-object.h:907
void requestDisplayUpdate(unsigned int flags)
Queues an deferred update of this object's display.
void setDesktopRect(Geom::Rect rect)
Set the page rectangle in desktop coordinates.
Definition sp-page.cpp:254
SVGLength x
Definition sp-page.h:122
Geom::Rect getDesktopMargin() const
Definition sp-page.cpp:161
int getPageIndex() const
Returns the page number (order of pages) starting at 1.
Definition sp-page.cpp:455
void setRect(Geom::Rect rect)
Set the page rectangle in its native units.
Definition sp-page.cpp:218
~SPPage() override
Definition sp-page.cpp:32
bool setPageIndex(int index, bool swap_page)
Set this page to a new order in the page stack.
Definition sp-page.cpp:468
SVGLength height
Definition sp-page.h:125
Geom::Translate getDesktopAffine() const
Gets the page's position as a translation in desktop units.
Definition sp-page.cpp:140
void setBleedSide(int side, double value)
Definition sp-page.cpp:350
std::string getLabel() const
Definition sp-page.cpp:648
void setSizeLabel(std::string label)
Definition sp-page.cpp:633
Geom::Rect getDesktopRect() const
Get the rectangle of the page, in desktop units.
Definition sp-page.cpp:132
std::string getDefaultLabel() const
Definition sp-page.cpp:640
void copyFrom(SPPage *page)
Copy non-size attributes from the given page.
Definition sp-page.cpp:665
SPPage()
Definition sp-page.cpp:26
std::string getMarginLabel() const
Definition sp-page.cpp:327
SPPage * getNextPage()
Returns the sibling page next to this one in the stack order.
Definition sp-page.cpp:513
SVGBox margin
Definition sp-page.h:126
void swapPage(SPPage *other, bool with_objects)
Swap the locations of this page with another page (see movePage)
Definition sp-page.cpp:582
Geom::Rect getDesktopBleed() const
Definition sp-page.cpp:191
SVGLength width
Definition sp-page.h:124
void showPage()
Definition sp-page.h:44
std::string getSizeLabel() const
Definition sp-page.cpp:657
bool itemOnPage(SPItem const *item, bool contains=false, bool groups=true) const
Return true if this item is contained within the page boundary.
Definition sp-page.cpp:393
Geom::Rect getDocumentMargin() const
Get document rect, minus the margin amounts.
Definition sp-page.cpp:149
void set_guides_visible(bool show)
Definition sp-page.cpp:677
Geom::Rect getBleed() const
Get page rect enlarged by bleed amounts.
Definition sp-page.cpp:169
static void moveItems(Geom::Affine translate, std::vector< SPItem * > const &objects)
Move the given items by the given translation in document units.
Definition sp-page.cpp:561
bool setDefaultAttributes()
Sets the default attributes from the namedview.
Definition sp-page.cpp:434
Geom::Rect getDocumentBleed() const
Get document rect, plus the bleed amounts.
Definition sp-page.cpp:186
std::vector< SPItem * > getOverlappingItems(bool hidden=true, bool in_bleed=false, bool in_layers=true) const
Like ExcludiveItems above but get all the items which are inside or overlapping.
Definition sp-page.cpp:379
SVGBox bleed
Definition sp-page.h:127
void setSelected(bool selected)
Set the selected high-light for this page.
Definition sp-page.cpp:446
std::string getBleedLabel() const
Definition sp-page.cpp:336
void update(SPCtx *ctx, unsigned int flags) override
Definition sp-page.cpp:601
SPPage * getPreviousPage()
Returns the sibling page previous to this one in the stack order.
Definition sp-page.cpp:527
Geom::Rect getRect() const
Gets the rectangle in document units.
Definition sp-page.cpp:124
std::string _size_label
Definition sp-page.h:128
bool isBarePage() const
Returns true if the only aspect to this page is its size.
Definition sp-page.cpp:113
Inkscape::CanvasPage * _canvas_item
Definition sp-page.h:120
Geom::Rect getDocumentRect() const
Get the rectangle of the page, scaled to the document.
Definition sp-page.cpp:199
double getMarginSide(int side)
Get the margin side of the box.
Definition sp-page.cpp:295
double getBleedSide(int side)
Definition sp-page.cpp:345
void setBleed(const std::string &value)
Set the page's bleed.
Definition sp-page.cpp:286
void setMargin(const std::string &value)
Set the page's margin.
Definition sp-page.cpp:277
std::vector< SPItem * > getExclusiveItems(bool hidden=true, bool in_bleed=false, bool in_layers=true) const
Get the items which are ONLY on this page and don't overlap.
Definition sp-page.cpp:367
void update_relatives()
Update the percentage values of the svg boxes.
Definition sp-page.cpp:100
Geom::Rect getSensitiveRect() const
Like getDesktopRect but returns a slightly shrunken rectangle so interactions don't confuse the borde...
Definition sp-page.cpp:208
bool isViewportPage() const
Returns true if this page is the same as the viewport.
Definition sp-page.cpp:415
void movePage(Geom::Affine translate, bool with_objects)
Move the page by the given affine, in desktop units.
Definition sp-page.cpp:544
void release() override
Definition sp-page.cpp:55
void build(SPDocument *doc, Inkscape::XML::Node *repr) override
Definition sp-page.cpp:38
void setDocumentRect(Geom::Rect rect, bool add_margins=false)
Set the page rectangle in document coordinates.
Definition sp-page.cpp:238
void set(SPAttr key, const char *value) override
Definition sp-page.cpp:65
int getPagePosition() const
Definition sp-page.h:66
SVGLength y
Definition sp-page.h:123
void setSize(double width, double height)
Set just the height and width from a predefined size.
Definition sp-page.cpp:267
void setMarginSide(int pos, double value, bool confine=false)
Set the margin at this side of the box in user units.
Definition sp-page.cpp:303
Inkscape::XML::Node * write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) override
Write out the page's data into its xml structure.
Definition sp-page.cpp:616
SVGLength bottom() const
Definition svg-box.h:61
void set(BoxSide side, double value, bool confine=false)
Set the value of the side, retaining it's original unit.
Definition svg-box.cpp:148
SVGLength left() const
Definition svg-box.h:62
bool fromString(const std::string &value, const std::string &unit, const Geom::Scale &doc_scale)
Set the svg box from user input, with a default unit.
Definition svg-box.cpp:86
bool isZero() const
Returns true if the box is set, but all values are zero.
Definition svg-box.cpp:125
void readOrUnset(gchar const *str, const Geom::Scale &doc_scale)
Definition svg-box.cpp:163
std::string write() const
Write out the values into a compact form.
Definition svg-box.cpp:54
void update(double em, double ex, double width, double height)
Update box with em, ex and percentage scaling.
Definition svg-box.cpp:43
bool read(const std::string &value, const Geom::Scale &doc_scale)
Read in the value, may be an array of four.
Definition svg-box.cpp:35
std::string toString(const std::string &unit, const Geom::Scale &doc_scale, std::optional< unsigned int > precision={}, bool add_unit=true) const
Write as specific unit for user display.
Definition svg-box.cpp:62
SVGLength top() const
Definition svg-box.h:59
SVGLength right() const
Definition svg-box.h:60
double get(BoxSide side) const
Definition svg-box.h:58
std::string write() const
void readOrUnset(char const *str, Unit u=NONE, float v=0, float c=0)
float computed
Definition svg-length.h:50
static char const *const current
Definition dir-util.cpp:71
SPItem * item
Glib::ustring label
static cairo_user_data_key_t key
GList * items
SPPage – a page object.
Interface for XML documents.
Definition document.h:43
Unused.
Definition sp-object.h:94
BoxSide
Definition svg-box.h:19
int index
double height
double width