summaryrefslogtreecommitdiffstats
path: root/src/live_effects/parameter/item-reference.cpp
diff options
context:
space:
mode:
authorJabiertxof <jtx@jtx>2016-12-28 08:45:05 +0000
committerJabiertxof <jtx@jtx>2016-12-28 08:45:05 +0000
commit0b5fe85427b24c57020b852d453af5f79f5220da (patch)
tree0b566defc5e9c0ff3efe3b1c272e2597b8b69d91 /src/live_effects/parameter/item-reference.cpp
parentFirst attemp working (diff)
parentMerge all upstream changes to GimpRuler (diff)
downloadinkscape-0b5fe85427b24c57020b852d453af5f79f5220da.tar.gz
inkscape-0b5fe85427b24c57020b852d453af5f79f5220da.zip
add missing files
(bzr r15356.1.2)
Diffstat (limited to 'src/live_effects/parameter/item-reference.cpp')
-rw-r--r--src/live_effects/parameter/item-reference.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/live_effects/parameter/item-reference.cpp b/src/live_effects/parameter/item-reference.cpp
new file mode 100644
index 000000000..a775d93b7
--- /dev/null
+++ b/src/live_effects/parameter/item-reference.cpp
@@ -0,0 +1,44 @@
+/*
+ * The reference corresponding to href of LPE Item parameter.
+ *
+ * Copyright (C) 2008 Johan Engelen
+ *
+ * Released under GNU GPL, read the file 'COPYING' for more information.
+ */
+
+#include "live_effects/parameter/item-reference.h"
+
+#include "sp-shape.h"
+#include "sp-text.h"
+#include "sp-item-group.h"
+
+namespace Inkscape {
+namespace LivePathEffect {
+
+bool ItemReference::_acceptObject(SPObject * const obj) const
+{
+ if (SP_IS_SHAPE(obj) || SP_IS_TEXT(obj) || SP_IS_GROUP(obj)) {
+ /* Refuse references to lpeobject */
+ if (obj == getOwner()) {
+ return false;
+ }
+ // TODO: check whether the referred item has this LPE applied, if so: deny deny deny!
+ return URIReference::_acceptObject(obj);
+ } else {
+ return false;
+ }
+}
+
+} // namespace LivePathEffect
+} // namespace Inkscape
+
+/*
+ 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 :