object-hierarchy.h revision c0537dcfe264414d52ad86579d57cb0cb2183dcb
/*
* Authors:
* MenTaLguY <mental@rydia.net>
*
* Copyright (C) 2004 MenTaLguY
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifndef SEEN_INKSCAPE_OBJECT_HIERARCHY_H
#define SEEN_INKSCAPE_OBJECT_HIERARCHY_H
#include <exception>
#include <list>
#include <stddef.h>
#include <sigc++/connection.h>
#include <glib.h>
/**
* An Inkscape::ObjectHierarchy is useful for situations where one wishes
* to keep a reference to an SPObject, but fall back on one of its ancestors
* when that object is removed.
*
* That cannot be accomplished simply by hooking the "release" signal of the
* SPObject, as by the time that signal is emitted, the object's parent
* field has already been cleared.
*
* There are also some subtle refcounting issues to take into account.
*
* @see SPObject
*/
/**
* Create new object hierarchy.
* @param top The first entry if non-NULL.
*/
~ObjectHierarchy();
}
}
{
}
/**
* Remove all entries.
*/
void clear();
}
/**
* Trim or expand hierarchy on top such that object becomes top entry.
*/
}
/**
* Trim or expand hierarchy at bottom such that object becomes bottom entry.
*/
struct Record {
: object(o), connection(c) {}
};
/**
* Add hierarchy from junior's parent to senior to this
* hierarchy's top.
*/
/**
* Add object to top of hierarchy.
* \pre object!=NULL.
*/
/**
* Remove all objects above limit from hierarchy.
*/
/**
* Add hierarchy from senior to junior, in range (senior, junior], to this hierarchy's bottom.
*/
/**
* Add object at bottom of hierarchy.
* \pre object!=NULL
*/
/**
* Remove all objects under given object.
* @param limit If NULL, remove all.
*/
};
}
#endif
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :