Inkscape
Vector Graphics Editor
|
#include <sp-page.h>
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 SVGBox & | getMarginBox () 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 SVGBox & | getBleedBox () 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. | |
SPPage * | getNextPage () |
Returns the sibling page next to this one in the stack order. | |
SPPage * | getPreviousPage () |
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. | |
![]() | |
SPObject () | |
Constructor, sets all attributes to default values. | |
SPObject (SPObject const &)=delete | |
SPObject & | operator= (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::Node * | getRepr () |
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. | |
SPObject * | getNext () |
SPObject * | getPrev () |
Returns previous object in sibling list or NULL. | |
bool | hasChildren () const |
SPObject * | firstChild () |
SPObject const * | firstChild () const |
SPObject * | lastChild () |
SPObject const * | lastChild () const |
SPObject * | nthChild (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. | |
SPObject * | appendChildRepr (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) |
SPObject * | successor () |
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::Node * | updateRepr (unsigned int flags=SP_OBJECT_WRITE_EXT) |
Updates the object's repr based on the object's state. | |
Inkscape::XML::Node * | updateRepr (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. | |
SPObject * | get_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::Node * | write (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. | |
![]() | |
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::Node * | write (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 | |
![]() | |
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, ParentIteratorStrategy > | ParentIterator |
typedef Inkscape::Util::ForwardPointerIterator< SPObject const, ParentIteratorStrategy > | ConstParentIterator |
using | ChildrenList = boost::intrusive::list< SPObject, boost::intrusive::member_hook< SPObject, ListHook, &SPObject::_child_hook > > |
![]() | |
unsigned int | cloned: 1 |
SPObject * | clone_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} |
SPDocument * | document {nullptr} |
SPObject * | parent {nullptr} |
int | refCount {1} |
std::list< SPObject * > | hrefList |
SPStyle * | style |
Represents the style properties, whether from presentation attributes, the style attribute, or inherited. | |
SPStyle * | context_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 |
![]() | |
typedef boost::intrusive::list_member_hook | ListHook |
![]() | |
ListHook | _child_hook |
SPPage::SPPage | ( | ) |
Definition at line 26 of file sp-page.cpp.
References _canvas_item.
|
override |
Definition at line 32 of file sp-page.cpp.
References _canvas_item.
|
overrideprotectedvirtual |
Reimplemented from SPObject.
Definition at line 38 of file sp-page.cpp.
References SPDocument::addResource(), SPObject::build(), SPObject::document, HEIGHT, INKSCAPE_LABEL, PAGE_BLEED, PAGE_MARGIN, PAGE_SIZE_NAME, SPObject::readAttr(), SPObject::repr, WIDTH, X, and Y.
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.
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().
std::string SPPage::getBleedLabel | ( | ) | const |
Definition at line 336 of file sp-page.cpp.
References Inkscape::Util::Unit::abbr, bleed, SPObject::document, SPDocument::getDisplayUnit(), SPDocument::getDocumentScale(), SVGBox::isZero(), scale, and SVGBox::toString().
Definition at line 345 of file sp-page.cpp.
References bleed, and SVGBox::get().
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().
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().
Geom::Rect SPPage::getDesktopBleed | ( | ) | const |
Definition at line 191 of file sp-page.cpp.
References SPDocument::doc2dt(), SPObject::document, and getDocumentBleed().
Referenced by update().
Geom::Rect SPPage::getDesktopMargin | ( | ) | const |
Definition at line 161 of file sp-page.cpp.
References SPDocument::doc2dt(), SPObject::document, and getDocumentMargin().
Referenced by update().
Geom::Rect SPPage::getDesktopRect | ( | ) | const |
Get the rectangle of the page, in desktop units.
Definition at line 132 of file sp-page.cpp.
References SPDocument::doc2dt(), SPObject::document, and getDocumentRect().
Referenced by getDesktopAffine(), Inkscape::PageManager::getSelectedPageRect(), getSensitiveRect(), Inkscape::UI::Tools::PagesTool::grabPage(), itemOnPage(), movePage(), Inkscape::PageManager::removePage(), showPage(), sp_import_document(), swapPage(), and update().
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().
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().
Geom::Rect SPPage::getDocumentRect | ( | ) | const |
Get the rectangle of the page, scaled to the document.
Definition at line 199 of file sp-page.cpp.
References SPObject::document, SPDocument::getDocumentScale(), and getRect().
Referenced by getDesktopRect(), getDocumentMargin(), getExclusiveItems(), getOverlappingItems(), isViewportPage(), Inkscape::UI::Dialog::BatchItem::refresh(), and setSize().
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.
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.
std::string SPPage::getLabel | ( | ) | const |
Definition at line 648 of file sp-page.cpp.
References getDefaultLabel(), SPObject::label(), and x.
std::string SPPage::getMarginLabel | ( | ) | const |
Definition at line 327 of file sp-page.cpp.
References Inkscape::Util::Unit::abbr, SPObject::document, SPDocument::getDisplayUnit(), SPDocument::getDocumentScale(), SVGBox::isZero(), margin, scale, and SVGBox::toString().
Get the margin side of the box.
Definition at line 295 of file sp-page.cpp.
References SVGBox::get(), and margin.
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.
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.
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().
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().
|
inline |
Definition at line 66 of file sp-page.h.
References getPageIndex().
Referenced by getDefaultLabel(), Inkscape::UI::Widget::PageSelector::renderPageLabel(), and update().
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.
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().
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().
std::string SPPage::getSizeLabel | ( | ) | const |
Definition at line 657 of file sp-page.cpp.
References _size_label.
|
inline |
Definition at line 45 of file sp-page.h.
References _canvas_item, and Inkscape::CanvasPage::hide().
|
inline |
Definition at line 43 of file sp-page.h.
References _canvas_item, and Inkscape::CanvasPage::remove().
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.
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().
Return true if this item is contained within the page boundary.
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().
|
static |
Move the given items by the given translation in document units.
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().
void SPPage::movePage | ( | Geom::Affine | translate, |
bool | with_objects | ||
) |
Move the page by the given affine, in desktop units.
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().
|
overrideprotectedvirtual |
Reimplemented from SPObject.
Definition at line 55 of file sp-page.cpp.
References SPObject::document, SPObject::release(), and SPDocument::removeResource().
Reimplemented from SPObject.
Definition at line 65 of file sp-page.cpp.
References _size_label, bleed, SPObject::document, SPDocument::getDocumentScale(), HEIGHT, height, key, margin, PAGE_BLEED, PAGE_MARGIN, PAGE_SIZE_NAME, SVGLength::readOrUnset(), SVGBox::readOrUnset(), SPObject::requestDisplayUpdate(), SPObject::set(), update_relatives(), WIDTH, width, X, x, Y, and y.
Definition at line 677 of file sp-page.cpp.
References _canvas_item, and Inkscape::CanvasPage::set_guides_visible().
Set the page's bleed.
Definition at line 286 of file sp-page.cpp.
References Inkscape::Util::Unit::abbr, bleed, SPObject::document, SVGBox::fromString(), SPDocument::getDisplayUnit(), SPDocument::getDocumentScale(), and SPObject::updateRepr().
Definition at line 350 of file sp-page.cpp.
References bleed, SVGBox::set(), and SPObject::updateRepr().
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.
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().
void SPPage::setDocumentRect | ( | Geom::Rect | rect, |
bool | add_margins = false |
||
) |
Set the page rectangle in document coordinates.
Definition at line 238 of file sp-page.cpp.
References Geom::GenericRect< C >::bottom(), SVGBox::bottom(), SVGLength::computed, SPObject::document, SPDocument::getDocumentScale(), Geom::Scale::inverse(), Geom::GenericRect< C >::left(), SVGBox::left(), margin, Geom::GenericRect< C >::right(), SVGBox::right(), Geom::GenericRect< C >::setBottom(), Geom::GenericRect< C >::setLeft(), setRect(), Geom::GenericRect< C >::setRight(), Geom::GenericRect< C >::setTop(), Geom::GenericRect< C >::top(), SVGBox::top(), and x.
Referenced by setDesktopRect(), and setSize().
Set the page's margin.
Definition at line 277 of file sp-page.cpp.
References Inkscape::Util::Unit::abbr, SPObject::document, SVGBox::fromString(), SPDocument::getDisplayUnit(), SPDocument::getDocumentScale(), margin, and SPObject::updateRepr().
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.
Set the margin at this side in display units.
Definition at line 315 of file sp-page.cpp.
References Inkscape::Util::Unit::abbr, SPObject::document, SVGBox::fromString(), SPDocument::getDisplayUnit(), SPDocument::getDocumentScale(), margin, scale, SPObject::updateRepr(), and x.
Set this page to a new order in the page stack.
index | - Placement of page in the stack, starting at '0' |
swap_page | - Swap the rectangle position |
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().
Definition at line 68 of file sp-page.h.
References setPageIndex(), and x.
void SPPage::setRect | ( | Geom::Rect | rect | ) |
Set the page rectangle in its native units.
Definition at line 218 of file sp-page.cpp.
References _size_label, Geom::GenericRect< C >::height(), height, Geom::GenericRect< C >::left(), SPObject::requestModified(), Geom::GenericRect< C >::top(), SPObject::updateRepr(), Geom::GenericRect< C >::width(), width, x, and y.
Referenced by setDocumentRect().
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.
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.
width | The desired width in document/desktop units. |
height | The desired height in document/desktop units. |
Definition at line 267 of file sp-page.cpp.
References getDocumentRect(), height, setDocumentRect(), and width.
void SPPage::setSizeLabel | ( | std::string | label | ) |
Definition at line 633 of file sp-page.cpp.
References _size_label, SPObject::label(), and SPObject::updateRepr().
|
inline |
Definition at line 44 of file sp-page.h.
References _canvas_item, and Inkscape::CanvasPage::show().
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.
Swap the locations of this page with another page (see movePage)
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().
|
inlineoverridevirtual |
Reimplemented from SPObject.
Definition at line 601 of file sp-page.cpp.
References _canvas_item, SPObject::document, getDesktopBleed(), getDesktopMargin(), getDesktopRect(), SPDocument::getPageManager(), getPagePosition(), SPDocument::is_yaxisdown(), SPObject::label(), Inkscape::PageManager::showDefaultLabel(), Inkscape::CanvasPage::update(), and x.
|
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().
|
overrideprotected |
Write out the page's data into its xml structure.
Definition at line 616 of file sp-page.cpp.
References _size_label, bleed, SVGLength::computed, height, margin, SPObject::repr, Inkscape::XML::Node::setAttributeOrRemoveIfEmpty(), Inkscape::XML::Node::setAttributeSvgDouble(), width, SVGBox::write(), SPObject::write(), x, and y.
|
private |
Definition at line 120 of file sp-page.h.
Referenced by hidePage(), hidePage(), set_guides_visible(), setDefaultAttributes(), setSelected(), showPage(), showPage(), SPPage(), update(), and ~SPPage().
|
private |
Definition at line 128 of file sp-page.h.
Referenced by copyFrom(), getSizeLabel(), set(), setRect(), setSizeLabel(), and write().
|
private |
Definition at line 127 of file sp-page.h.
Referenced by copyFrom(), getBleed(), getBleedBox(), getBleedLabel(), getBleedSide(), isBarePage(), set(), setBleed(), setBleedSide(), update_relatives(), and write().
|
private |
|
private |
Definition at line 126 of file sp-page.h.
Referenced by copyFrom(), getDocumentMargin(), getMarginBox(), getMarginLabel(), getMarginSide(), isBarePage(), set(), setDocumentRect(), setMargin(), setMarginSide(), setMarginSide(), update_relatives(), and write().
|
private |
|
private |
Definition at line 122 of file sp-page.h.
Referenced by copyFrom(), getDefaultLabel(), getExclusiveItems(), getLabel(), getNextPage(), getOverlappingItems(), getPreviousPage(), getRect(), itemOnPage(), movePage(), SPPage::PageIndexOrder::operator()(), set(), setDefaultAttributes(), setDocumentRect(), setMarginSide(), setMarginSide(), setPageIndex(), setPagePosition(), setRect(), setSelected(), showPage(), swapPage(), update(), update_relatives(), and write().
|
private |