Lines Matching defs:SPObject
2 * SPObject implementation.
67 SPObject::repr_child_added,
68 SPObject::repr_child_removed,
69 SPObject::repr_attr_changed,
70 SPObject::repr_content_changed,
71 SPObject::repr_order_changed
74 // A friend class used to set internal members on SPObject so as to not expose settors in SPObject's public API
80 * Null's the id member of an SPObject without attempting to free prior contents.
82 static void setIdNull( SPObject* obj ) {
91 static void setId( SPObject* obj, gchar const* id ) {
104 static gchar *sp_object_get_unique_id(SPObject *object,
107 SPObject::SPObject()
110 next(NULL), id(NULL), repr(NULL), refCount(1),hrefList(std::list<SPObject*>()),
111 _successor(NULL), _collection_policy(SPObject::COLLECT_WITH_PARENT),
129 SPObject::~SPObject() {
144 std::cerr << "SPObject::~SPObject(): style pointer is NULL" << std::endl;
152 // std::cerr << "SPObject::~SPObject(): someone else still holding ref to style" << std::endl;
161 void SPObject::read_content() {
165 void SPObject::update(SPCtx* /*ctx*/, unsigned int /*flags*/) {
169 void SPObject::modified(unsigned int /*flags*/) {
182 RefCountEvent(SPObject *object, int bias, Util::ptr_shared<char> name)
193 RefEvent(SPObject *object)
200 UnrefEvent(SPObject *object)
207 gchar const* SPObject::getId() const {
211 Inkscape::XML::Node * SPObject::getRepr() {
215 Inkscape::XML::Node const* SPObject::getRepr() const{
220 SPObject *sp_object_ref(SPObject *object, SPObject *owner)
232 SPObject *sp_object_unref(SPObject *object, SPObject *owner)
249 SPObject *sp_object_href(SPObject *object, SPObject* owner)
263 SPObject *sp_object_hunref(SPObject *object, SPObject* owner)
278 void SPObject::_updateTotalHRefCount(int increment) {
279 SPObject *topmost_collectable = NULL;
280 for ( SPObject *iter = this ; iter ; iter = iter->parent ) {
296 bool SPObject::isAncestorOf(SPObject const *object) const {
310 bool same_objects(SPObject const &a, SPObject const &b) {
316 SPObject const *SPObject::nearestCommonAncestor(SPObject const *object) const {
320 return longest_common_suffix<SPObject::ConstParentIterator>(this, object, NULL, &same_objects);
323 static SPObject const *AncestorSon(SPObject const *obj, SPObject const *ancestor) {
324 SPObject const *result = 0;
335 int sp_object_compare_position(SPObject const *first, SPObject const *second)
339 SPObject const *ancestor = first->nearestCommonAncestor(second);
348 SPObject const *to_first = AncestorSon(first, ancestor);
349 SPObject const *to_second = AncestorSon(second, ancestor);
360 bool sp_object_compare_position_bool(SPObject const *first, SPObject const *second){
365 SPObject *SPObject::appendChildRepr(Inkscape::XML::Node *repr) {
375 void SPObject::setCSS(SPCSSAttr *css, gchar const *attr)
381 void SPObject::changeCSS(SPCSSAttr *css, gchar const *attr)
387 std::vector<SPObject*> SPObject::childList(bool add_ref, Action) {
388 std::vector<SPObject*> l;
389 for ( SPObject *child = firstChild() ; child; child = child->getNext() ) {
400 gchar const *SPObject::label() const {
404 gchar const *SPObject::defaultLabel() const {
419 void SPObject::setLabel(gchar const *label)
425 void SPObject::requestOrphanCollection() {
447 * merging SPObjectGroup with SPObject; SPObjectGroup would issue
456 void SPObject::_sendDeleteSignalRecursive() {
457 for (SPObject *child = firstChild(); child; child = child->getNext()) {
463 void SPObject::deleteObject(bool propagate, bool propagate_descendants)
484 void SPObject::cropToObject(SPObject *except)
486 std::vector<SPObject*> toDelete;
487 for ( SPObject *child = this->firstChild(); child; child = child->getNext() ) {
501 void SPObject::attach(SPObject *object, SPObject *prev)
515 SPObject *next;
531 void SPObject::reorder(SPObject *prev)
540 SPObject *const parent=this->parent;
542 SPObject *old_prev=NULL;
543 for ( SPObject *child = parent->children ; child && child != this ;
549 SPObject *next=this->next;
571 void SPObject::detach(SPObject *object)
581 SPObject *prev=NULL;
582 for ( SPObject *child = this->children ; child && child != object ;
588 SPObject *next=object->next;
605 SPObject *SPObject::get_child_by_repr(Inkscape::XML::Node *repr)
608 SPObject *result = 0;
613 for ( SPObject *child = children ; child ; child = child->next ) {
623 void SPObject::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) {
624 SPObject* object = this;
628 SPObject* ochild = SPFactory::createObject(type_string);
631 // corresponding classes in the SPObject tree.
637 SPObject *prev = ref ? object->get_child_by_repr(ref) : NULL;
644 void SPObject::release() {
645 SPObject* object = this;
653 void SPObject::remove_child(Inkscape::XML::Node* child) {
656 SPObject *ochild = this->get_child_by_repr(child);
664 void SPObject::order_changed(Inkscape::XML::Node *child, Inkscape::XML::Node * /*old_ref*/, Inkscape::XML::Node *new_ref) {
665 SPObject* object = this;
667 SPObject *ochild = object->get_child_by_repr(child);
669 SPObject *prev = new_ref ? object->get_child_by_repr(new_ref) : NULL;
674 void SPObject::build(SPDocument *document, Inkscape::XML::Node *repr) {
675 SPObject* object = this;
687 SPObject* child = SPFactory::createObject(typeString);
690 // corresponding classes in the SPObject tree.
702 void SPObject::invoke_build(SPDocument *document, Inkscape::XML::Node *repr, unsigned int cloned)
765 int SPObject::getIntAttribute(char const *key, int def)
771 unsigned SPObject::getPosition(){
777 void SPObject::appendChild(Inkscape::XML::Node *child) {
783 void SPObject::addChild(Inkscape::XML::Node *child, Inkscape::XML::Node * prev)
790 void SPObject::releaseReferences() {
820 // style belongs to SPObject, we should not need to unref here.
830 SPObject *SPObject::getPrev()
832 SPObject *prev = 0;
833 for ( SPObject *obj = parent->firstChild(); obj && !prev; obj = obj->getNext() ) {
841 void SPObject::repr_child_added(Inkscape::XML::Node * /*repr*/, Inkscape::XML::Node *child, Inkscape::XML::Node *ref, gpointer data)
843 SPObject *object = SP_OBJECT(data);
848 void SPObject::repr_child_removed(Inkscape::XML::Node * /*repr*/, Inkscape::XML::Node *child, Inkscape::XML::Node * /*ref*/, gpointer data)
850 SPObject *object = SP_OBJECT(data);
855 void SPObject::repr_order_changed(Inkscape::XML::Node * /*repr*/, Inkscape::XML::Node *child, Inkscape::XML::Node *old, Inkscape::XML::Node *newer, gpointer data)
857 SPObject *object = SP_OBJECT(data);
862 void SPObject::set(unsigned int key, gchar const* value) {
865 SPObject* object = this;
873 SPObject *conflict=NULL;
920 object->setCollectionPolicy(SPObject::ALWAYS_COLLECT);
922 object->setCollectionPolicy(SPObject::COLLECT_WITH_PARENT);
933 SPObject *parent;
948 void SPObject::setKeyValue(unsigned int key, gchar const *value)
956 void SPObject::readAttr(gchar const *key)
974 void SPObject::repr_attr_changed(Inkscape::XML::Node * /*repr*/, gchar const *key, gchar const * /*oldval*/, gchar const * /*newval*/, bool is_interactive, gpointer data)
976 SPObject *object = SP_OBJECT(data);
987 void SPObject::repr_content_changed(Inkscape::XML::Node * /*repr*/, gchar const * /*oldcontent*/, gchar const * /*newcontent*/, gpointer data)
989 SPObject *object = SP_OBJECT(data);
1009 Inkscape::XML::Node* SPObject::write(Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags) {
1025 this->collectionPolicy() == SPObject::ALWAYS_COLLECT )
1081 Inkscape::XML::Node * SPObject::updateRepr(unsigned int flags)
1097 Inkscape::XML::Node * SPObject::updateRepr(Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, unsigned int flags)
1115 void SPObject::requestDisplayUpdate(unsigned int flags)
1145 void SPObject::updateDisplay(SPCtx *ctx, unsigned int flags)
1185 g_warning("SPObject::updateDisplay(SPCtx *ctx, unsigned int flags) : throw in ((SPObjectClass *) G_OBJECT_GET_CLASS(this))->update(this, ctx, flags);");
1191 void SPObject::requestModified(unsigned int flags)
1217 void SPObject::emitModified(unsigned int flags)
1240 gchar const *SPObject::getTagName(SPException *ex) const
1253 gchar const *SPObject::getAttribute(gchar const *key, SPException *ex) const
1266 void SPObject::setAttribute(gchar const *key, gchar const *value, SPException *ex)
1276 void SPObject::setAttribute(char const *key, Glib::ustring const &value, SPException *ex)
1280 void SPObject::setAttribute(Glib::ustring const &key, Glib::ustring const &value, SPException *ex)
1287 void SPObject::removeAttribute(gchar const *key, SPException *ex)
1297 bool SPObject::storeAsDouble( gchar const *key, double *val ) const
1305 sp_object_get_unique_id(SPObject *object,
1344 gchar const * SPObject::getStyleProperty(gchar const *key, gchar const *def) const
1391 void SPObject::_requireSVGVersion(Inkscape::Version version) {
1392 for ( SPObject::ParentIterator iter=this ; iter ; ++iter ) {
1393 SPObject *object = iter;
1418 gchar * SPObject::title() const
1423 bool SPObject::setTitle(gchar const *title, bool verbatim)
1428 gchar * SPObject::desc() const
1433 bool SPObject::setDesc(gchar const *desc, bool verbatim)
1438 char * SPObject::getTitleOrDesc(gchar const *svg_tagname) const
1441 SPObject *elem = findFirstChild(svg_tagname);
1448 bool SPObject::setTitleOrDesc(gchar const *value, gchar const *svg_tagname, bool verbatim)
1478 SPObject *elem = findFirstChild(svg_tagname);
1504 SPObject *child;
1513 SPObject * SPObject::findFirstChild(gchar const *tagname) const
1515 for (SPObject *child = children; child; child = child->next)
1525 char* SPObject::textualContent() const
1529 for (const SPObject *child = firstChild(); child; child = child->next)
1546 void SPObject::recursivePrintTree( unsigned level )
1556 for (SPObject *child = children; child; child = child->next) {