diff options
| author | Adrian Boguszewski <adrbogus1@student.pg.gda.pl> | 2016-06-09 15:19:23 +0000 |
|---|---|---|
| committer | Adrian Boguszewski <adrbogus1@student.pg.gda.pl> | 2016-06-09 15:19:23 +0000 |
| commit | 5633812ca77f35e52db62e7b432761e0e59253fe (patch) | |
| tree | 2985071a7a26ae482e9e6e468f7175bf124aa1f8 /src | |
| parent | Splitted tests to separate executables (diff) | |
| download | inkscape-5633812ca77f35e52db62e7b432761e0e59253fe.tar.gz inkscape-5633812ca77f35e52db62e7b432761e0e59253fe.zip | |
Removed Object class and temporary test dependencies
(bzr r14954.1.4)
Diffstat (limited to 'src')
| -rw-r--r-- | src/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/object.cpp | 50 | ||||
| -rw-r--r-- | src/object.h | 76 | ||||
| -rw-r--r-- | src/sp-flowtext.h | 1 |
4 files changed, 1 insertions, 128 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 802a79c4f..92436ea9a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -229,7 +229,6 @@ set(inkscape_SRC message-context.cpp message-stack.cpp mod360.cpp - object.cpp object-hierarchy.cpp object-set.cpp object-snapper.cpp @@ -355,7 +354,6 @@ set(inkscape_SRC mod360-test.h mod360.h number-opt-number.h - object.h object-hierarchy.h object-set.h object-snapper.h diff --git a/src/object.cpp b/src/object.cpp deleted file mode 100644 index c05d50b3a..000000000 --- a/src/object.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Temporary file - * - * Authors: - * Adrian Boguszewski - * - * Copyright (C) 2016 Adrian Boguszewski - * - * Released under GNU GPL, read the file 'COPYING' for more information - */ - -#include "object.h" - -Object::Object(std::string name) : name(name), parent(NULL) { } - -Object::~Object() { - // only for this prototype - // call destructor on every child - children.clear_and_dispose(delete_disposer()); - release_signal.emit(this); -} - -const std::string& Object::getName() const { - return name; -} - -Object *Object::getParent() { - return parent; -} - -bool Object::isDescendantOf(Object *o) { - Object* p = parent; - while(p != NULL) { - if (p == o) { - return true; - } - p = p->parent; - } - return false; -} - -void Object::addChild(Object* o) { - o->parent = this; - children.push_back(*o); -} - -sigc::connection Object::connectRelease(sigc::slot<bool, Object*> slot) { - return release_signal.connect(slot); -} - diff --git a/src/object.h b/src/object.h deleted file mode 100644 index a5ad5692e..000000000 --- a/src/object.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Temporary file - * - * Authors: - * Adrian Boguszewski - * - * Copyright (C) 2016 Adrian Boguszewski - * - * Released under GNU GPL, read the file 'COPYING' for more information - */ - -#ifndef INKSCAPE_PROTOTYPE_OBJECT_H -#define INKSCAPE_PROTOTYPE_OBJECT_H - -#include <string> -#include <sigc++/signal.h> -#include <sigc++/connection.h> -#include <boost/intrusive/list.hpp> - -// this causes some warning, but it's only for this prototype -class Object; -struct delete_disposer -{ - void operator()(Object *delete_this) { - delete delete_this; - } -}; - -class Object { -private: - std::string name; - Object* parent; - - typedef boost::intrusive::list_member_hook< - boost::intrusive::link_mode< - boost::intrusive::auto_unlink - >> list_hook; - list_hook child_hook; - - typedef boost::intrusive::list< - Object, - boost::intrusive::constant_time_size<false>, - boost::intrusive::member_hook< - Object, - list_hook, - &Object::child_hook - >> list; - list children; - - sigc::signal<bool, Object*> release_signal; - -public: - Object(std::string name); - virtual ~Object(); - - list &getChildren() { - return children; - } - - const std::string &getName() const; - Object * getParent() ; - - sigc::connection connectRelease(sigc::slot<bool, Object*> slot); - void addChild(Object* o); - bool isDescendantOf(Object* o); - - bool operator==(Object o) { - return name == o.name; - } - - bool operator!=(Object o) { - return name != o.name; - } -}; - -#endif //INKSCAPE_PROTOTYPE_OBJECT_H diff --git a/src/sp-flowtext.h b/src/sp-flowtext.h index 9ee676893..d0b0a19a4 100644 --- a/src/sp-flowtext.h +++ b/src/sp-flowtext.h @@ -8,6 +8,7 @@ #include "libnrtype/Layout-TNG.h" #include "sp-item.h" +#include "desktop.h" #define SP_FLOWTEXT(obj) (dynamic_cast<SPFlowtext*>((SPObject*)obj)) #define SP_IS_FLOWTEXT(obj) (dynamic_cast<const SPFlowtext*>((SPObject*)obj) != NULL) |
