Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
SPPage Class Referencefinal

#include <sp-page.h>

Inheritance diagram for SPPage:
SPObject Inkscape::XML::NodeObserver

Classes

struct  PageIndexOrder
 

Public Member Functions

 SPPage ()
 
 ~SPPage () override
 
int tag () const override
 
void movePage (Geom::Affine translate, bool with_objects)
 Move the page by the given affine, in desktop units.
 
void swapPage (SPPage *other, bool with_objects)
 Swap the locations of this page with another page (see movePage)
 
void showPage (Inkscape::CanvasItemGroup *fg, Inkscape::CanvasItemGroup *bg)
 Shows the page in the given canvas item group.
 
void hidePage (Inkscape::UI::Widget::Canvas *canvas)
 
void showPage ()
 
void hidePage ()
 
void set_guides_visible (bool show)
 
double getMarginSide (int side)
 Get the margin side of the box.
 
const SVGBoxgetMarginBox () const
 
void setMargin (const std::string &value)
 Set the page's margin.
 
void setMarginSide (int pos, double value, bool confine=false)
 Set the margin at this side of the box in user units.
 
void setMarginSide (int side, const std::string &value, bool confine=false)
 Set the margin at this side in display units.
 
std::string getMarginLabel () const
 
double getBleedSide (int side)
 
void setBleedSide (int side, double value)
 
const SVGBoxgetBleedBox () const
 
void setBleed (const std::string &value)
 Set the page's bleed.
 
std::string getBleedLabel () const
 
void copyFrom (SPPage *page)
 Copy non-size attributes from the given page.
 
void setSelected (bool selected)
 Set the selected high-light for this page.
 
bool setDefaultAttributes ()
 Sets the default attributes from the namedview.
 
void setSizeLabel (std::string label)
 
int getPageIndex () const
 Returns the page number (order of pages) starting at 1.
 
int getPagePosition () const
 
bool setPageIndex (int index, bool swap_page)
 Set this page to a new order in the page stack.
 
bool setPagePosition (int position, bool swap_page)
 
bool isBarePage () const
 Returns true if the only aspect to this page is its size.
 
SPPagegetNextPage ()
 Returns the sibling page next to this one in the stack order.
 
SPPagegetPreviousPage ()
 Returns the sibling page previous to this one in the stack order.
 
Geom::Rect getRect () const
 Gets the rectangle in document units.
 
Geom::Rect getDesktopRect () const
 Get the rectangle of the page, in desktop units.
 
Geom::Rect getDocumentRect () const
 Get the rectangle of the page, scaled to the document.
 
Geom::Rect getDesktopMargin () const
 
Geom::Rect getDocumentMargin () const
 Get document rect, minus the margin amounts.
 
Geom::Rect getBleed () const
 Get page rect enlarged by bleed amounts.
 
Geom::Rect getDesktopBleed () const
 
Geom::Rect getDocumentBleed () const
 Get document rect, plus the bleed amounts.
 
Geom::Rect getSensitiveRect () const
 Like getDesktopRect but returns a slightly shrunken rectangle so interactions don't confuse the border with the object.
 
void setRect (Geom::Rect rect)
 Set the page rectangle in its native units.
 
void setDesktopRect (Geom::Rect rect)
 Set the page rectangle in desktop coordinates.
 
void setDocumentRect (Geom::Rect rect, bool add_margins=false)
 Set the page rectangle in document coordinates.
 
void setSize (double width, double height)
 Set just the height and width from a predefined size.
 
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.
 
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.
 
bool itemOnPage (SPItem const *item, bool contains=false, bool groups=true) const
 Return true if this item is contained within the page boundary.
 
bool isViewportPage () const
 Returns true if this page is the same as the viewport.
 
std::string getDefaultLabel () const
 
std::string getLabel () const
 
std::string getSizeLabel () const
 
Geom::Translate getDesktopAffine () const
 Gets the page's position as a translation in desktop units.
 
- Public Member Functions inherited from SPObject
 SPObject ()
 Constructor, sets all attributes to default values.
 
 SPObject (SPObject const &)=delete
 
SPObjectoperator= (SPObject const &)=delete
 
 ~SPObject () override
 Destructor, frees the used memory and unreferences a potential successor of the object.
 
char const * getId () const
 Returns the objects current ID string.
 
void getIds (std::set< std::string > &ret) const
 Accumulate this id and all it's descendants ids.
 
std::string getUrl () const
 Get the id in a URL format.
 
Inkscape::XML::NodegetRepr ()
 Returns the XML representation of tree.
 
Inkscape::XML::Node const * getRepr () const
 Returns the XML representation of tree.
 
void releaseReferences ()
 Cleans up an SPObject, releasing its references and requesting that references to it be released.
 
sigc::connection connectRelease (sigc::slot< void(SPObject *)> slot)
 Connects to the release request signal.
 
bool isSiblingOf (SPObject const *object) const
 
virtual void getLinked (std::vector< SPObject * > &objects, LinkedObjectNature direction=LinkedObjectNature::ANY) const
 Get objects which are linked to this object as either a source or a target.
 
std::vector< SPObject * > getLinked (LinkedObjectNature direction=LinkedObjectNature::ANY) const
 Get objects which are linked, like above.
 
bool isAncestorOf (SPObject const *object) const
 True if object is non-NULL and this is some in/direct parent of object.
 
SPObject const * nearestCommonAncestor (SPObject const *object) const
 Returns youngest object being parent to this and object.
 
SPObject const * getTopAncestorNonLayer () const
 Returns ancestor non layer.
 
SPObjectgetNext ()
 
SPObjectgetPrev ()
 Returns previous object in sibling list or NULL.
 
bool hasChildren () const
 
SPObjectfirstChild ()
 
SPObject const * firstChild () const
 
SPObjectlastChild ()
 
SPObject const * lastChild () const
 
SPObjectnthChild (unsigned index)
 
SPObject const * nthChild (unsigned index) const
 
std::vector< SPObject * > childList (bool add_ref, Action action=ActionGeneral)
 Retrieves the children as a std vector object, optionally ref'ing the children in the process, if add_ref is specified.
 
std::vector< SPObject * > ancestorList (bool root_to_tip)
 Retrieves a list of ancestors of the object, as an easy to use vector.
 
SPObjectappendChildRepr (Inkscape::XML::Node *repr)
 Append repr as child of this object.
 
char const * label () const
 Gets the author-visible label property for the object or a default if no label is defined.
 
char const * defaultLabel () const
 Returns a default label property for this object.
 
void setLabel (char const *label)
 Sets the author-visible label for this object.
 
char * title () const
 Returns the title of this object, or NULL if there is none.
 
bool setTitle (char const *title, bool verbatim=false)
 Sets the title of this object.
 
char * desc () const
 Returns the description of this object, or NULL if there is none.
 
bool setDesc (char const *desc, bool verbatim=false)
 Sets the description of this object.
 
Glib::ustring getExportFilename () const
 Get and set the exportable filename on this object.
 
void setExportFilename (Glib::ustring filename)
 
Geom::Point getExportDpi () const
 Get and set the exported DPI for this objet, if available.
 
void setExportDpi (Geom::Point dpi)
 
CollectionPolicy collectionPolicy () const
 Set the policy under which this object will be orphan-collected.
 
void setCollectionPolicy (CollectionPolicy policy)
 Sets the orphan-collection policy in effect for this object.
 
void requestOrphanCollection ()
 Requests a later automatic call to collectOrphan().
 
void collectOrphan ()
 Unconditionally delete the object if it is not referenced.
 
void hrefObject (SPObject *owner=nullptr)
 Increase weak refcount.
 
void unhrefObject (SPObject *owner=nullptr)
 Decrease weak refcount.
 
bool isReferenced ()
 Check if object is referenced by any other object.
 
void deleteObject (bool propagate, bool propagate_descendants)
 Deletes an object, unparenting it from its parent.
 
void deleteObject (bool propagate=true)
 Deletes on object.
 
void cropToObject (SPObject *except)
 Removes all children except for the given object, it's children and it's ancesstors.
 
void cropToObjects (std::vector< SPObject * > except_objects)
 Removes objects which are not related to given list of objects.
 
void getObjectsExcept (std::vector< SPObject * > &objects, const std::vector< SPObject * > &except)
 Get all child objects except for any in the list.
 
void getLinkedRecursive (std::vector< SPObject * > &objects, LinkedObjectNature direction=LinkedObjectNature::ANY) const
 Grows the input list with all linked items recursively in both child nodes and links of links.
 
sigc::connection connectDelete (sigc::slot< void(SPObject *)> slot)
 Connects a slot to be called when an object is deleted.
 
sigc::connection connectPositionChanged (sigc::slot< void(SPObject *)> slot)
 
SPObjectsuccessor ()
 Returns the object which supercedes this one (if any).
 
void setSuccessor (SPObject *successor)
 Indicates that another object supercedes this one.
 
void setTmpSuccessor (SPObject *tmpsuccessor)
 Indicates that another object supercedes temporaty this one.
 
void unsetTmpSuccessor ()
 Unset object supercedes.
 
void fixTmpSuccessors ()
 Fix temporary successors in duple stamp.
 
Inkscape::XML::NodeupdateRepr (unsigned int flags=SP_OBJECT_WRITE_EXT)
 Updates the object's repr based on the object's state.
 
Inkscape::XML::NodeupdateRepr (Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, unsigned int flags)
 Updates the given repr based on the object's state.
 
void requestDisplayUpdate (unsigned int flags)
 Queues an deferred update of this object's display.
 
void updateDisplay (SPCtx *ctx, unsigned int flags)
 Updates the object's display immediately.
 
void requestModified (unsigned int flags)
 Requests that a modification notification signal be emitted later (e.g.
 
void emitModified (unsigned int flags)
 Emits the MODIFIED signal with the object's flags.
 
sigc::connection connectModified (sigc::slot< void(SPObject *, unsigned int)> slot)
 Connects to the modification notification signal.
 
void _sendDeleteSignalRecursive ()
 Sends the delete signal to all children of this object recursively.
 
void _updateTotalHRefCount (int increment)
 Adds increment to _total_hrefcount of object and its parents.
 
void _requireSVGVersion (unsigned major, unsigned minor)
 
void _requireSVGVersion (Inkscape::Version version)
 Lifts SVG version of all root objects to version.
 
void attach (SPObject *object, SPObject *prev)
 Put object into object tree, under parent, and behind prev; also update object's XML space.
 
void reorder (SPObject *obj, SPObject *prev)
 In list of object's children, move object behind prev.
 
void detach (SPObject *object)
 Remove object from parent's children, release and unref it.
 
SPObjectget_child_by_repr (Inkscape::XML::Node *repr)
 Return object's child whose node pointer equals repr.
 
void invoke_build (SPDocument *document, Inkscape::XML::Node *repr, unsigned int cloned)
 
int getIntAttribute (char const *key, int def)
 
unsigned getPosition ()
 
char const * getAttribute (char const *name) const
 
void appendChild (Inkscape::XML::Node *child)
 
void addChild (Inkscape::XML::Node *child, Inkscape::XML::Node *prev=nullptr)
 
void setKeyValue (SPAttr key, char const *value)
 Call virtual set() function of object.
 
void setAttribute (Inkscape::Util::const_char_ptr key, Inkscape::Util::const_char_ptr value)
 
void setAttributeDouble (Inkscape::Util::const_char_ptr key, double value)
 
void setAttributeOrRemoveIfEmpty (Inkscape::Util::const_char_ptr key, Inkscape::Util::const_char_ptr value)
 
void readAttr (char const *key)
 Read value of key attribute from XML node into object.
 
void readAttr (SPAttr keyid)
 
char const * getTagName () const
 
void removeAttribute (char const *key)
 
void setCSS (SPCSSAttr *css, char const *attr)
 
void changeCSS (SPCSSAttr *css, char const *attr)
 
bool storeAsDouble (char const *key, double *val) const
 
virtual void read_content ()
 
void recursivePrintTree (unsigned level=0)
 
void objectTrace (std::string const &, bool in=true, unsigned flags=0)
 
std::string generate_unique_id (char const *default_id=nullptr) const
 Generate a document-wide unique id for this object.
 

Static Public Member Functions

static void moveItems (Geom::Affine translate, std::vector< SPItem * > const &objects)
 Move the given items by the given translation in document units.
 

Protected Member Functions

void build (SPDocument *doc, Inkscape::XML::Node *repr) override
 
void release () override
 
void update (SPCtx *ctx, unsigned int flags) override
 
void set (SPAttr key, const char *value) override
 
Inkscape::XML::Nodewrite (Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) override
 Write out the page's data into its xml structure.
 
void update_relatives ()
 Update the percentage values of the svg boxes.
 
- Protected Member Functions inherited from SPObject
virtual void child_added (Inkscape::XML::Node *child, Inkscape::XML::Node *ref)
 
virtual void remove_child (Inkscape::XML::Node *child)
 
virtual void order_changed (Inkscape::XML::Node *child, Inkscape::XML::Node *old_repr, Inkscape::XML::Node *new_repr)
 
virtual void tag_name_changed (gchar const *oldname, gchar const *newname)
 
virtual void modified (unsigned int flags)
 
virtual Inkscape::XML::Nodewrite (Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, unsigned int flags)
 

Private Attributes

Inkscape::CanvasPage_canvas_item = nullptr
 
SVGLength x
 
SVGLength y
 
SVGLength width
 
SVGLength height
 
SVGBox margin
 
SVGBox bleed
 
std::string _size_label
 

Additional Inherited Members

- Public Types inherited from SPObject
enum  CollectionPolicy { COLLECT_WITH_PARENT , ALWAYS_COLLECT }
 
enum class  LinkedObjectNature { DEPENDENT = -1 , ANY = 0 , DEPENDENCY = 1 }
 
enum  Action { ActionGeneral , ActionBBox , ActionUpdate , ActionShow }
 
typedef Inkscape::Util::ForwardPointerIterator< SPObject, ParentIteratorStrategyParentIterator
 
typedef Inkscape::Util::ForwardPointerIterator< SPObject const, ParentIteratorStrategyConstParentIterator
 
using ChildrenList = boost::intrusive::list< SPObject, boost::intrusive::member_hook< SPObject, ListHook, &SPObject::_child_hook > >
 
- Public Attributes inherited from SPObject
unsigned int cloned: 1
 
SPObjectclone_original {nullptr}
 
unsigned int uflags: 16
 
unsigned int mflags: 16
 
SPIXmlSpace xml_space
 
Glib::ustring lang
 
unsigned int hrefcount {0}
 
unsigned int _total_hrefcount {0}
 
SPDocumentdocument {nullptr}
 
SPObjectparent {nullptr}
 
int refCount {1}
 
std::list< SPObject * > hrefList
 
SPStylestyle
 Represents the style properties, whether from presentation attributes, the style attribute, or inherited.
 
SPStylecontext_style
 Represents the style that should be used to resolve 'context-fill' and 'context-stroke'.
 
sigc::signal< void(SPObject *)> _release_signal
 
sigc::signal< void(SPObject *)> _delete_signal
 
sigc::signal< void(SPObject *)> _position_changed_signal
 
sigc::signal< void(SPObject *, unsigned int)> _modified_signal
 
SPObject_successor {nullptr}
 
SPObject_tmpsuccessor {nullptr}
 
CollectionPolicy _collection_policy {SPObject::COLLECT_WITH_PARENT}
 
char * _label {nullptr}
 
char * _default_label {nullptr}
 
ChildrenList children
 
- Protected Types inherited from SPObject
typedef boost::intrusive::list_member_hook ListHook
 
- Protected Attributes inherited from SPObject
ListHook _child_hook
 

Detailed Description

Definition at line 30 of file sp-page.h.

Constructor & Destructor Documentation

◆ SPPage()

SPPage::SPPage ( )

Definition at line 26 of file sp-page.cpp.

References _canvas_item.

◆ ~SPPage()

SPPage::~SPPage ( )
override

Definition at line 32 of file sp-page.cpp.

References _canvas_item.

Member Function Documentation

◆ build()

void SPPage::build ( SPDocument doc,
Inkscape::XML::Node repr 
)
overrideprotectedvirtual

◆ copyFrom()

void SPPage::copyFrom ( SPPage page)

Copy non-size attributes from the given page.

Definition at line 665 of file sp-page.cpp.

References _size_label, bleed, SPObject::document, SPDocument::getDocumentScale(), margin, page, SVGBox::read(), SPObject::updateRepr(), SVGLength::write(), and x.

◆ getBleed()

Geom::Rect SPPage::getBleed ( ) const

Get page rect enlarged by bleed amounts.

Definition at line 169 of file sp-page.cpp.

References bleed, SVGBox::bottom(), SVGLength::computed, getRect(), SVGBox::left(), SVGBox::right(), and SVGBox::top().

Referenced by getDocumentBleed().

◆ getBleedBox()

const SVGBox & SPPage::getBleedBox ( ) const
inline

Definition at line 57 of file sp-page.h.

References bleed.

◆ getBleedLabel()

◆ getBleedSide()

double SPPage::getBleedSide ( int  side)

Definition at line 345 of file sp-page.cpp.

References bleed, and SVGBox::get().

◆ getDefaultLabel()

std::string SPPage::getDefaultLabel ( ) const

Definition at line 640 of file sp-page.cpp.

References getPagePosition(), and x.

Referenced by getLabel(), and Inkscape::UI::Dialog::BatchItem::update_label().

◆ getDesktopAffine()

Geom::Translate SPPage::getDesktopAffine ( ) const

Gets the page's position as a translation in desktop units.

Definition at line 140 of file sp-page.cpp.

References getDesktopRect().

Referenced by Inkscape::PageManager::getSelectedPageAffine().

◆ getDesktopBleed()

Geom::Rect SPPage::getDesktopBleed ( ) const

Definition at line 191 of file sp-page.cpp.

References SPDocument::doc2dt(), SPObject::document, and getDocumentBleed().

Referenced by update().

◆ getDesktopMargin()

Geom::Rect SPPage::getDesktopMargin ( ) const

Definition at line 161 of file sp-page.cpp.

References SPDocument::doc2dt(), SPObject::document, and getDocumentMargin().

Referenced by update().

◆ getDesktopRect()

◆ getDocumentBleed()

Geom::Rect SPPage::getDocumentBleed ( ) const

Get document rect, plus the bleed amounts.

Definition at line 186 of file sp-page.cpp.

References SPObject::document, getBleed(), and SPDocument::getDocumentScale().

Referenced by getDesktopBleed(), getExclusiveItems(), and getOverlappingItems().

◆ getDocumentMargin()

Geom::Rect SPPage::getDocumentMargin ( ) const

Get document rect, minus the margin amounts.

Definition at line 149 of file sp-page.cpp.

References SVGBox::bottom(), SVGLength::computed, SPObject::document, getDocumentRect(), SPDocument::getDocumentScale(), getRect(), SVGBox::left(), margin, SVGBox::right(), and SVGBox::top().

Referenced by getDesktopMargin().

◆ getDocumentRect()

Geom::Rect SPPage::getDocumentRect ( ) const

◆ getExclusiveItems()

std::vector< SPItem * > SPPage::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.

This ignores layers so items in the same layer which are shared between pages are not moved around or exported into pages they shouldn't be.

Parameters
hidden- Return hidden items (default: true)
in_bleed- Use the bleed box instead of the page box
in_layers- Should layers be traversed to find items (default: true)

Definition at line 367 of file sp-page.cpp.

References SPObject::document, getDocumentBleed(), getDocumentRect(), SPDocument::getItemsInBox(), and x.

◆ getLabel()

std::string SPPage::getLabel ( ) const

Definition at line 648 of file sp-page.cpp.

References getDefaultLabel(), SPObject::label(), and x.

◆ getMarginBox()

const SVGBox & SPPage::getMarginBox ( ) const
inline

Definition at line 49 of file sp-page.h.

References margin.

◆ getMarginLabel()

◆ getMarginSide()

double SPPage::getMarginSide ( int  side)

Get the margin side of the box.

Definition at line 295 of file sp-page.cpp.

References SVGBox::get(), and margin.

◆ getNextPage()

SPPage * SPPage::getNextPage ( )

Returns the sibling page next to this one in the stack order.

Definition at line 513 of file sp-page.cpp.

References SPObject::getNext(), item, and x.

◆ getOverlappingItems()

std::vector< SPItem * > SPPage::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.

Parameters
hidden- Return hidden items (default: true)
in_bleed- Use the bleed box instead of the page box
in_layers- Should layers be traversed to find items (default: true)

Definition at line 379 of file sp-page.cpp.

References SPObject::document, getDocumentBleed(), getDocumentRect(), SPDocument::getItemsPartiallyInBox(), and x.

Referenced by movePage(), and Inkscape::PageManager::rotatePage().

◆ getPageIndex()

int SPPage::getPageIndex ( ) const

Returns the page number (order of pages) starting at 1.

Definition at line 455 of file sp-page.cpp.

References SPObject::document, Inkscape::PageManager::getPageIndex(), and SPDocument::getPageManager().

Referenced by getPagePosition(), and setPageIndex().

◆ getPagePosition()

int SPPage::getPagePosition ( ) const
inline

◆ getPreviousPage()

SPPage * SPPage::getPreviousPage ( )

Returns the sibling page previous to this one in the stack order.

Definition at line 527 of file sp-page.cpp.

References SPObject::getPrev(), item, and x.

◆ getRect()

Geom::Rect SPPage::getRect ( ) const

Gets the rectangle in document units.

Definition at line 124 of file sp-page.cpp.

References SVGLength::computed, Geom::GenericRect< Coord >::from_xywh(), height, width, x, and y.

Referenced by getBleed(), getDocumentMargin(), getDocumentRect(), and Inkscape::PageManager::newPage().

◆ getSensitiveRect()

Geom::Rect SPPage::getSensitiveRect ( ) const

Like getDesktopRect but returns a slightly shrunken rectangle so interactions don't confuse the border with the object.

Definition at line 208 of file sp-page.cpp.

References getDesktopRect().

Referenced by Inkscape::PageManager::findPageAt().

◆ getSizeLabel()

std::string SPPage::getSizeLabel ( ) const

Definition at line 657 of file sp-page.cpp.

References _size_label.

◆ hidePage() [1/2]

void SPPage::hidePage ( )
inline

Definition at line 45 of file sp-page.h.

References _canvas_item, and Inkscape::CanvasPage::hide().

◆ hidePage() [2/2]

void SPPage::hidePage ( Inkscape::UI::Widget::Canvas canvas)
inline

Definition at line 43 of file sp-page.h.

References _canvas_item, and Inkscape::CanvasPage::remove().

◆ isBarePage()

bool SPPage::isBarePage ( ) const

Returns true if the only aspect to this page is its size.

Definition at line 113 of file sp-page.cpp.

References bleed, and margin.

◆ isViewportPage()

bool SPPage::isViewportPage ( ) const

Returns true if this page is the same as the viewport.

Definition at line 415 of file sp-page.cpp.

References Geom::GenericRect< C >::corner(), SPObject::document, getDocumentRect(), and SPDocument::preferredBounds().

Referenced by swapPage().

◆ itemOnPage()

bool SPPage::itemOnPage ( SPItem const item,
bool  contains = false,
bool  groups = true 
) const

Return true if this item is contained within the page boundary.

Parameters
item- The SPItem to check for page intersection or containment
contains- If true the test will be if the shape is entirely contained, rather than just partly overlaps.
groups- If true, groups will be tested as a whole object instead of one object at a time.

Definition at line 393 of file sp-page.cpp.

References SPObject::children, Geom::GenericRect< C >::contains(), SPItem::desktopGeometricBounds(), getDesktopRect(), Geom::GenericRect< C >::intersects(), item, and x.

Referenced by Inkscape::PageManager::selectPage().

◆ moveItems()

void SPPage::moveItems ( Geom::Affine  translate,
std::vector< SPItem * > const items 
)
static

Move the given items by the given translation in document units.

Parameters
translate- The movement to be applied
objects- a vector of SPItems to move

Definition at line 561 of file sp-page.cpp.

References SPObject::document, SPItem::isLocked(), item, items, and set.

Referenced by movePage().

◆ movePage()

void SPPage::movePage ( Geom::Affine  translate,
bool  with_objects 
)

Move the page by the given affine, in desktop units.

Parameters
translate- The positional translation to apply.
with_objects- Flag to request that connected objects also move.

Definition at line 544 of file sp-page.cpp.

References getDesktopRect(), getOverlappingItems(), Geom::Affine::isTranslation(), moveItems(), setDesktopRect(), and x.

Referenced by swapPage().

◆ release()

void SPPage::release ( )
overrideprotectedvirtual

Reimplemented from SPObject.

Definition at line 55 of file sp-page.cpp.

References SPObject::document, SPObject::release(), and SPDocument::removeResource().

◆ set()

◆ set_guides_visible()

void SPPage::set_guides_visible ( bool  show)

Definition at line 677 of file sp-page.cpp.

References _canvas_item, and Inkscape::CanvasPage::set_guides_visible().

◆ setBleed()

void SPPage::setBleed ( const std::string &  value)

◆ setBleedSide()

void SPPage::setBleedSide ( int  side,
double  value 
)

Definition at line 350 of file sp-page.cpp.

References bleed, SVGBox::set(), and SPObject::updateRepr().

◆ setDefaultAttributes()

bool SPPage::setDefaultAttributes ( )

Sets the default attributes from the namedview.

Definition at line 434 of file sp-page.cpp.

References _canvas_item, SPObject::document, SPDocument::getPageManager(), SPObject::requestDisplayUpdate(), Inkscape::PageManager::setDefaultAttributes(), and x.

◆ setDesktopRect()

void SPPage::setDesktopRect ( Geom::Rect  rect)

Set the page rectangle in desktop coordinates.

Definition at line 254 of file sp-page.cpp.

References SPObject::document, SPDocument::dt2doc(), and setDocumentRect().

Referenced by movePage().

◆ setDocumentRect()

◆ setMargin()

void SPPage::setMargin ( const std::string &  value)

◆ setMarginSide() [1/2]

void SPPage::setMarginSide ( int  pos,
double  value,
bool  confine = false 
)

Set the margin at this side of the box in user units.

Definition at line 303 of file sp-page.cpp.

References margin, SVGBox::set(), SPObject::updateRepr(), and x.

◆ setMarginSide() [2/2]

void SPPage::setMarginSide ( int  side,
const std::string &  value,
bool  confine = false 
)

◆ setPageIndex()

bool SPPage::setPageIndex ( int  index,
bool  swap_page 
)

Set this page to a new order in the page stack.

Parameters
index- Placement of page in the stack, starting at '0'
swap_page- Swap the rectangle position
Returns
true if page has been moved.

Definition at line 468 of file sp-page.cpp.

References Inkscape::XML::Node::changeOrder(), current, SPObject::document, getPageIndex(), SPDocument::getPageManager(), SPObject::getRepr(), index, Inkscape::XML::Node::parent(), swapPage(), and x.

Referenced by setPagePosition().

◆ setPagePosition()

bool SPPage::setPagePosition ( int  position,
bool  swap_page 
)
inline

Definition at line 68 of file sp-page.h.

References setPageIndex(), and x.

◆ setRect()

◆ setSelected()

void SPPage::setSelected ( bool  selected)

Set the selected high-light for this page.

Definition at line 446 of file sp-page.cpp.

References _canvas_item, Inkscape::CanvasPage::is_selected, SPObject::requestDisplayUpdate(), and x.

◆ setSize()

void SPPage::setSize ( double  width,
double  height 
)

Set just the height and width from a predefined size.

These dimensions are in document units, which happen to be the same as desktop units, since pages are aligned to the coordinate axes.

Parameters
widthThe desired width in document/desktop units.
heightThe desired height in document/desktop units.

Definition at line 267 of file sp-page.cpp.

References getDocumentRect(), height, setDocumentRect(), and width.

◆ setSizeLabel()

void SPPage::setSizeLabel ( std::string  label)

Definition at line 633 of file sp-page.cpp.

References _size_label, SPObject::label(), and SPObject::updateRepr().

◆ showPage() [1/2]

void SPPage::showPage ( )
inline

Definition at line 44 of file sp-page.h.

References _canvas_item, and Inkscape::CanvasPage::show().

◆ showPage() [2/2]

void SPPage::showPage ( Inkscape::CanvasItemGroup fg,
Inkscape::CanvasItemGroup bg 
)

Shows the page in the given canvas item group.

Definition at line 424 of file sp-page.cpp.

References _canvas_item, Inkscape::CanvasPage::add(), getDesktopRect(), SPObject::requestDisplayUpdate(), and x.

◆ swapPage()

void SPPage::swapPage ( SPPage other,
bool  with_objects 
)

Swap the locations of this page with another page (see movePage)

Parameters
other- The other page to swap with
with_objects- Should the page objects move too.

Definition at line 582 of file sp-page.cpp.

References Geom::GenericRect< C >::corner(), SPObject::document, SPDocument::fitToRect(), getDesktopRect(), isViewportPage(), movePage(), swapPage(), and x.

Referenced by setPageIndex(), and swapPage().

◆ tag()

int SPPage::tag ( ) const
inlineoverridevirtual

Reimplemented from SPObject.

Definition at line 35 of file sp-page.h.

References tag_of.

◆ update()

◆ update_relatives()

void SPPage::update_relatives ( )
protected

Update the percentage values of the svg boxes.

Definition at line 100 of file sp-page.cpp.

References bleed, SVGLength::computed, height, margin, SVGBox::update(), width, and x.

Referenced by set().

◆ write()

Inkscape::XML::Node * SPPage::write ( Inkscape::XML::Document xml_doc,
Inkscape::XML::Node repr,
guint  flags 
)
overrideprotected

Member Data Documentation

◆ _canvas_item

◆ _size_label

std::string SPPage::_size_label
private

Definition at line 128 of file sp-page.h.

Referenced by copyFrom(), getSizeLabel(), set(), setRect(), setSizeLabel(), and write().

◆ bleed

◆ height

SVGLength SPPage::height
private

Definition at line 125 of file sp-page.h.

Referenced by getRect(), set(), setRect(), setSize(), update_relatives(), and write().

◆ margin

◆ width

SVGLength SPPage::width
private

Definition at line 124 of file sp-page.h.

Referenced by getRect(), set(), setRect(), setSize(), update_relatives(), and write().

◆ x

◆ y

SVGLength SPPage::y
private

Definition at line 123 of file sp-page.h.

Referenced by getRect(), set(), setRect(), and write().


The documentation for this class was generated from the following files: