205
by mental
Add DocumentSubset as groundwork for layers |
1 |
/*
|
2 |
* Inkscape::DocumentSubset - view of a document including only a subset
|
|
3 |
* of nodes
|
|
4 |
*
|
|
5 |
* Copyright 2006 MenTaLguY <mental@rydia.net>
|
|
6 |
*
|
|
7 |
* Released under GNU GPL, read the file 'COPYING' for more information
|
|
8 |
*/
|
|
9 |
||
10 |
#ifndef SEEN_INKSCAPE_DOCUMENT_SUBSET_H
|
|
11 |
#define SEEN_INKSCAPE_DOCUMENT_SUBSET_H
|
|
12 |
||
9020
by JazzyNico
Code refactoring and merging with trunk (revision 10599). |
13 |
#include <stddef.h> |
205
by mental
Add DocumentSubset as groundwork for layers |
14 |
#include <sigc++/connection.h> |
15 |
#include <sigc++/functors/slot.h> |
|
16 |
||
17 |
#include "gc-managed.h" |
|
18 |
#include "gc-anchored.h" |
|
19 |
||
20 |
class SPObject; |
|
8422
by cilix42
Revert recent refactoring changes by johnce because they break the build, which cannot be fixed easily. |
21 |
class SPDocument; |
205
by mental
Add DocumentSubset as groundwork for layers |
22 |
|
23 |
namespace Inkscape { |
|
24 |
||
25 |
class DocumentSubset : public GC::Managed<>, |
|
26 |
public GC::Anchored |
|
27 |
{
|
|
28 |
public: |
|
29 |
bool includes(SPObject *obj) const; |
|
30 |
||
31 |
SPObject *parentOf(SPObject *obj) const; |
|
32 |
unsigned childCount(SPObject *obj) const; |
|
33 |
unsigned indexOf(SPObject *obj) const; |
|
34 |
SPObject *nthChildOf(SPObject *obj, unsigned n) const; |
|
35 |
||
36 |
sigc::connection connectChanged(sigc::slot<void> slot) const; |
|
37 |
sigc::connection connectAdded(sigc::slot<void, SPObject *> slot) const; |
|
38 |
sigc::connection connectRemoved(sigc::slot<void, SPObject *> slot) const; |
|
39 |
||
40 |
protected: |
|
208
by mental
remove unneeded document parameter from constructor |
41 |
DocumentSubset(); |
205
by mental
Add DocumentSubset as groundwork for layers |
42 |
|
43 |
void _addOne(SPObject *obj); |
|
44 |
void _removeOne(SPObject *obj) { _remove(obj, false); } |
|
45 |
void _removeSubtree(SPObject *obj) { _remove(obj, true); } |
|
210
by mental
add DocumentSubset::_clear |
46 |
void _clear(); |
205
by mental
Add DocumentSubset as groundwork for layers |
47 |
|
48 |
private: |
|
49 |
DocumentSubset(DocumentSubset const &); // no copy |
|
50 |
void operator=(DocumentSubset const &); // no assign |
|
51 |
||
52 |
void _remove(SPObject *obj, bool subtree); |
|
53 |
||
54 |
class Relations; |
|
55 |
||
56 |
Relations *_relations; |
|
57 |
};
|
|
58 |
||
59 |
}
|
|
60 |
||
61 |
#endif
|
|
62 |
/*
|
|
63 |
Local Variables:
|
|
64 |
mode:c++
|
|
65 |
c-file-style:"stroustrup"
|
|
66 |
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
|
|
67 |
indent-tabs-mode:nil
|
|
68 |
fill-column:99
|
|
69 |
End:
|
|
70 |
*/
|
|
9020
by JazzyNico
Code refactoring and merging with trunk (revision 10599). |
71 |
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
|