document-subset.cpp revision b6b6fb614b494412013ec0cde6f9cd147e8207f3
a8f1a69ef0da383f9b413c3043a74084e23b75c2mental * Inkscape::DocumentSubset - view of a document including only a subset
a8f1a69ef0da383f9b413c3043a74084e23b75c2mental * Copyright 2006 MenTaLguY <mental@rydia.net>
9dc68827cbd515262ecb8d5ae8547d9e82c72e00Jon A. Cruz * Abhishek Sharma
a8f1a69ef0da383f9b413c3043a74084e23b75c2mental * Released under GNU GPL, read the file 'COPYING' for more information
a8f1a69ef0da383f9b413c3043a74084e23b75c2mentalstruct DocumentSubset::Relations : public GC::Managed<GC::ATOMIC>,
a8f1a69ef0da383f9b413c3043a74084e23b75c2mental found = std::find(children.begin(), children.end(), obj);
33e65aa0bff5323a2f8473f4a7f7a74a97ebf5d6joncruz Siblings::const_iterator mid = first + ( last - first + 1 ) / 2;
a8f1a69ef0da383f9b413c3043a74084e23b75c2mental if ( pos < 0 ) {
a8f1a69ef0da383f9b413c3043a74084e23b75c2mental } else if ( pos > 0 ) {
33e65aa0bff5323a2f8473f4a7f7a74a97ebf5d6joncruz // compare to the single possiblity left
33e65aa0bff5323a2f8473f4a7f7a74a97ebf5d6joncruz if ( pos < 0 ) {
a8f1a69ef0da383f9b413c3043a74084e23b75c2mental template <typename OutputIterator>
a8f1a69ef0da383f9b413c3043a74084e23b75c2mental } else if (found_one) {
a8f1a69ef0da383f9b413c3043a74084e23b75c2mental found = std::find(children.begin(), children.end(), obj);
8f9fc892f53e932a79afe15bd7039b5578983cb2joncruz for ( Siblings::iterator it = root.children.begin(); it != root.children.end(); ++it ) {
a767b323d0447407045ed6ca309f373b1c3eab52Krzysztof Kosiński record.position_changed_connection.disconnect();
a8f1a69ef0da383f9b413c3043a74084e23b75c2mentalvoid DocumentSubset::Relations::addOne(SPObject *obj) {
a8f1a69ef0da383f9b413c3043a74084e23b75c2mental /* find the nearest ancestor in the subset */
a8f1a69ef0da383f9b413c3043a74084e23b75c2mental for ( SPObject::ParentIterator parent_iter=obj->parent
a8f1a69ef0da383f9b413c3043a74084e23b75c2mental /* reparent descendants of obj to obj */
a8f1a69ef0da383f9b413c3043a74084e23b75c2mental /* add obj to the child list */
a8f1a69ef0da383f9b413c3043a74084e23b75c2mentalvoid DocumentSubset::Relations::remove(SPObject *obj, bool subtree) {
a8f1a69ef0da383f9b413c3043a74084e23b75c2mental /* reparent obj's orphaned children to their grandparent */
a8f1a69ef0da383f9b413c3043a74084e23b75c2mental /* remove obj's record */
a8f1a69ef0da383f9b413c3043a74084e23b75c2mentalvoid DocumentSubset::Relations::reorder(SPObject *obj) {
a8f1a69ef0da383f9b413c3043a74084e23b75c2mental /* find nearest ancestor in the subset */
a8f1a69ef0da383f9b413c3043a74084e23b75c2mental /* move the object if it's in the subset */
a8f1a69ef0da383f9b413c3043a74084e23b75c2mental /* otherwise, move any top-level descendants */
a8f1a69ef0da383f9b413c3043a74084e23b75c2mentalvoid DocumentSubset::_remove(SPObject *obj, bool subtree) {
a8f1a69ef0da383f9b413c3043a74084e23b75c2mentalSPObject *DocumentSubset::parentOf(SPObject *obj) const {
a8f1a69ef0da383f9b413c3043a74084e23b75c2mentalunsigned DocumentSubset::childCount(SPObject *obj) const {
a8f1a69ef0da383f9b413c3043a74084e23b75c2mentalunsigned DocumentSubset::indexOf(SPObject *obj) const {
a8f1a69ef0da383f9b413c3043a74084e23b75c2mentalSPObject *DocumentSubset::nthChildOf(SPObject *obj, unsigned n) const {
a8f1a69ef0da383f9b413c3043a74084e23b75c2mentalsigc::connection DocumentSubset::connectChanged(sigc::slot<void> slot) const {
a8f1a69ef0da383f9b413c3043a74084e23b75c2mentalDocumentSubset::connectAdded(sigc::slot<void, SPObject *> slot) const {
a8f1a69ef0da383f9b413c3043a74084e23b75c2mentalDocumentSubset::connectRemoved(sigc::slot<void, SPObject *> slot) const {
a8f1a69ef0da383f9b413c3043a74084e23b75c2mental Local Variables:
a8f1a69ef0da383f9b413c3043a74084e23b75c2mental c-file-style:"stroustrup"
a8f1a69ef0da383f9b413c3043a74084e23b75c2mental c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
a8f1a69ef0da383f9b413c3043a74084e23b75c2mental indent-tabs-mode:nil
a8f1a69ef0da383f9b413c3043a74084e23b75c2mental fill-column:99
a4030d5ca449e7e384bc699cd249ee704faaeab0Chris Morgan// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :