Lines Matching defs:object

15 #include "sp-object.h"
16 #include "object-hierarchy.h"
37 void ObjectHierarchy::setTop(SPObject *object) {
38 if (object == NULL) { printf("Assertion object != NULL failed\n"); return; }
40 if ( top() == object ) {
45 _addTop(object);
46 } else if (object->isAncestorOf(top())) {
47 _addTop(object, top());
48 } else if ( object == bottom() || object->isAncestorOf(bottom()) ) {
49 _trimAbove(object);
52 _addTop(object);
62 SPObject *object = junior->parent;
64 _addTop(object);
65 object = object->parent;
66 } while ( object != senior );
69 void ObjectHierarchy::_addTop(SPObject *object) {
70 assert(object != NULL);
71 _hierarchy.push_back(_attach(object));
72 _added_signal.emit(object);
76 while ( !_hierarchy.empty() && _hierarchy.back().object != limit ) {
77 SPObject *object=_hierarchy.back().object;
79 sp_object_ref(object, NULL);
82 _removed_signal.emit(object);
83 sp_object_unref(object, NULL);
87 void ObjectHierarchy::setBottom(SPObject *object) {
88 if (object == NULL) { printf("assertion object != NULL failed\n"); return; }
90 if ( bottom() == object ) {
95 _addBottom(object);
96 } else if (bottom()->isAncestorOf(object)) {
97 _addBottom(bottom(), object);
98 } else if ( top() == object ) {
100 } else if (top()->isAncestorOf(object)) {
101 if (object->isAncestorOf(bottom())) {
102 _trimBelow(object);
103 } else { // object is a sibling or cousin of bottom()
108 _addBottom(saved_top, object);
113 _addBottom(object);
120 while ( !_hierarchy.empty() && _hierarchy.front().object != limit ) {
121 SPObject *object=_hierarchy.front().object;
122 sp_object_ref(object, NULL);
125 _removed_signal.emit(object);
126 sp_object_unref(object, NULL);
140 void ObjectHierarchy::_addBottom(SPObject *object) {
141 assert(object != NULL);
142 _hierarchy.push_front(_attach(object));
143 _added_signal.emit(object);
146 void ObjectHierarchy::_trim_for_release(SPObject *object) {
147 this->_trimBelow(object);
149 assert(this->_hierarchy.front().object == object);
151 sp_object_ref(object, NULL);
154 this->_removed_signal.emit(object);
155 sp_object_unref(object, NULL);
160 ObjectHierarchy::Record ObjectHierarchy::_attach(SPObject *object) {
161 sp_object_ref(object, NULL);
163 = object->connectRelease(
166 return Record(object, connection);
171 sp_object_unref(rec.object, NULL);