/*
8 * Copyright (C) 2021 Martin Owens
10 * Released under GNU GPL v2+, read the file
'COPYING' for more information.
35 int tag()
const override {
return tag_of<
decltype(*this)>; }
58 void setBleed(
const std::string &value);
76 return (
Page1->getPageIndex() <
Page2->getPageIndex());
constexpr int tag_of
Convenience function to retrieve the tag (class id) of a given type.
3x3 matrix representing an affine transformation.
Axis aligned, non-empty rectangle.
void remove(UI::Widget::Canvas *canvas)
Hide the page in the given canvas widget.
Interface for refcounted XML nodes.
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.
char const * label() const
Gets the author-visible label property for the object or a default if no label is defined.
Inkscape::XML::Node * repr
void setDesktopRect(Geom::Rect rect)
Set the page rectangle in desktop coordinates.
Geom::Rect getDesktopMargin() const
int getPageIndex() const
Returns the page number (order of pages) starting at 1.
void setRect(Geom::Rect rect)
Set the page rectangle in its native units.
bool setPageIndex(int index, bool swap_page)
Set this page to a new order in the page stack.
Geom::Translate getDesktopAffine() const
Gets the page's position as a translation in desktop units.
void setBleedSide(int side, double value)
std::string getLabel() const
void setSizeLabel(std::string label)
Geom::Rect getDesktopRect() const
Get the rectangle of the page, in desktop units.
std::string getDefaultLabel() const
void copyFrom(SPPage *page)
Copy non-size attributes from the given page.
const SVGBox & getBleedBox() const
std::string getMarginLabel() const
SPPage * getNextPage()
Returns the sibling page next to this one in the stack order.
void hidePage(Inkscape::UI::Widget::Canvas *canvas)
void swapPage(SPPage *other, bool with_objects)
Swap the locations of this page with another page (see movePage)
Geom::Rect getDesktopBleed() const
bool setPagePosition(int position, bool swap_page)
std::string getSizeLabel() const
bool itemOnPage(SPItem const *item, bool contains=false, bool groups=true) const
Return true if this item is contained within the page boundary.
Geom::Rect getDocumentMargin() const
Get document rect, minus the margin amounts.
void set_guides_visible(bool show)
Geom::Rect getBleed() const
Get page rect enlarged by bleed amounts.
static void moveItems(Geom::Affine translate, std::vector< SPItem * > const &objects)
Move the given items by the given translation in document units.
bool setDefaultAttributes()
Sets the default attributes from the namedview.
Geom::Rect getDocumentBleed() const
Get document rect, plus the bleed amounts.
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.
void setSelected(bool selected)
Set the selected high-light for this page.
std::string getBleedLabel() const
void update(SPCtx *ctx, unsigned int flags) override
SPPage * getPreviousPage()
Returns the sibling page previous to this one in the stack order.
Geom::Rect getRect() const
Gets the rectangle in document units.
bool isBarePage() const
Returns true if the only aspect to this page is its size.
Inkscape::CanvasPage * _canvas_item
Geom::Rect getDocumentRect() const
Get the rectangle of the page, scaled to the document.
double getMarginSide(int side)
Get the margin side of the box.
double getBleedSide(int side)
const SVGBox & getMarginBox() const
void setBleed(const std::string &value)
Set the page's bleed.
void setMargin(const std::string &value)
Set the page's margin.
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.
void update_relatives()
Update the percentage values of the svg boxes.
Geom::Rect getSensitiveRect() const
Like getDesktopRect but returns a slightly shrunken rectangle so interactions don't confuse the borde...
bool isViewportPage() const
Returns true if this page is the same as the viewport.
void movePage(Geom::Affine translate, bool with_objects)
Move the page by the given affine, in desktop units.
void build(SPDocument *doc, Inkscape::XML::Node *repr) override
void setDocumentRect(Geom::Rect rect, bool add_margins=false)
Set the page rectangle in document coordinates.
int getPagePosition() const
void setSize(double width, double height)
Set just the height and width from a predefined size.
void setMarginSide(int pos, double value, bool confine=false)
Set the margin at this side of the box in user units.
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.
Helper class to stream background task notifications as a series of messages.
static cairo_user_data_key_t key
Interface for XML documents.
bool operator()(const SPPage *Page1, const SPPage *Page2) const