summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am12
-rw-r--r--src/Makefile_insert2
-rw-r--r--src/algorithms/CMakeLists.txt6
-rw-r--r--src/algorithms/Makefile_insert5
-rw-r--r--src/algorithms/makefile.in17
-rw-r--r--src/api/CMakeLists.txt3
-rw-r--r--src/api/inkscape.idl178
-rw-r--r--src/graphlayout.cpp (renamed from src/graphlayout/graphlayout.cpp)2
-rw-r--r--src/graphlayout.h (renamed from src/graphlayout/graphlayout.h)0
-rw-r--r--src/graphlayout/CMakeLists.txt6
-rw-r--r--src/graphlayout/Makefile_insert5
-rw-r--r--src/graphlayout/makefile17
-rw-r--r--src/inkjar/CMakeLists.txt6
-rw-r--r--src/inkjar/Makefile_insert5
-rw-r--r--src/inkjar/makefile.in17
-rw-r--r--src/inkview.cpp2
-rw-r--r--src/io/Makefile_insert2
-rw-r--r--src/io/inkjar.cpp (renamed from src/inkjar/jar.cpp)2
-rw-r--r--src/io/inkjar.h (renamed from src/inkjar/jar.h)0
-rw-r--r--src/layer-fns.cpp2
-rw-r--r--src/removeoverlap.cpp (renamed from src/removeoverlap/removeoverlap.cpp)0
-rw-r--r--src/removeoverlap.h (renamed from src/removeoverlap/removeoverlap.h)0
-rw-r--r--src/removeoverlap/CMakeLists.txt6
-rw-r--r--src/removeoverlap/Makefile_insert5
-rw-r--r--src/removeoverlap/makefile.in17
-rw-r--r--src/sp-item.cpp2
-rw-r--r--src/sp-object.cpp2
-rw-r--r--src/traits/CMakeLists.txt2
-rw-r--r--src/traits/Makefile_insert5
-rw-r--r--src/traits/makefile.in17
-rw-r--r--src/ui/dialog/align-and-distribute.cpp4
-rw-r--r--src/ui/tool/node.h36
-rw-r--r--src/util/Makefile_insert9
-rw-r--r--src/util/copy.h (renamed from src/traits/copy.h)0
-rw-r--r--src/util/filter-list.h2
-rw-r--r--src/util/find-if-before.h (renamed from src/algorithms/find-if-before.h)0
-rw-r--r--src/util/find-last-if.h (renamed from src/algorithms/find-last-if.h)0
-rw-r--r--src/util/fixed_point.h224
-rw-r--r--src/util/forward-pointer-iterator.h2
-rw-r--r--src/util/function.h (renamed from src/traits/function.h)0
-rw-r--r--src/util/list-copy.h (renamed from src/traits/list-copy.h)2
-rw-r--r--src/util/list.h2
-rw-r--r--src/util/longest-common-suffix.h (renamed from src/algorithms/longest-common-suffix.h)0
-rw-r--r--src/util/reference.h (renamed from src/traits/reference.h)0
-rw-r--r--src/util/reverse-list.h2
-rw-r--r--src/util/tuple.h2
-rw-r--r--src/widgets/toolbox.cpp2
-rw-r--r--src/xml/Makefile_insert1
-rw-r--r--src/xml/composite-node-observer.cpp2
-rw-r--r--src/xml/node-fns.cpp2
-rw-r--r--src/xml/repr-sorting.cpp2
51 files changed, 49 insertions, 590 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index ff5d20f49..b392ef0d2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -110,7 +110,6 @@ include extension/internal/Makefile_insert
include extension/script/Makefile_insert
include filters/Makefile_insert
include helper/Makefile_insert
-include inkjar/Makefile_insert
include io/Makefile_insert
#include pedro/Makefile_insert
#include jabber_whiteboard/Makefile_insert
@@ -124,14 +123,10 @@ include live_effects/Makefile_insert
include live_effects/parameter/Makefile_insert
include libvpsc/Makefile_insert
include libcola/Makefile_insert
-include removeoverlap/Makefile_insert
-include graphlayout/Makefile_insert
include svg/Makefile_insert
include widgets/Makefile_insert
include debug/Makefile_insert
include xml/Makefile_insert
-include traits/Makefile_insert
-include algorithms/Makefile_insert
include ui/Makefile_insert
include ui/cache/Makefile_insert
include ui/dialog/Makefile_insert
@@ -159,7 +154,6 @@ EXTRA_DIST = \
extension/script/makefile.in \
filters/makefile.in \
helper/makefile.in \
- inkjar/makefile.in \
io/makefile.in \
io/crystalegg.xml \
io/doc2html.xsl \
@@ -173,10 +167,8 @@ EXTRA_DIST = \
livarot/makefile.in \
live_effects/makefile.in \
live_effects/parameter/makefile.in \
- removeoverlap/makefile.in \
svg/makefile.in \
trace/makefile.in \
- traits/makefile.in \
ui/makefile.in \
ui/cache/makefile.in \
ui/dialog/makefile.in \
@@ -193,10 +185,6 @@ EXTRA_DIST = \
extension/internal/emf-win32-print.cpp \
extension/internal/emf-win32-print.h \
helper/sp-marshal.list \
- traits/copy.h \
- traits/function.h \
- traits/list-copy.h \
- traits/reference.h \
show-preview.bmp \
$(jabber_whiteboard_SOURCES) \
$(CXXTEST_TEMPLATE)
diff --git a/src/Makefile_insert b/src/Makefile_insert
index 1e5b1fea0..89c1b17b0 100644
--- a/src/Makefile_insert
+++ b/src/Makefile_insert
@@ -67,6 +67,7 @@ ink_common_sources += \
gradient-chemistry.cpp gradient-chemistry.h \
gradient-context.cpp gradient-context.h \
gradient-drag.cpp gradient-drag.h \
+ graphlayout.cpp graphlayout.h \
guide-snapper.cpp guide-snapper.h \
help.cpp help.h \
helper-fns.h \
@@ -117,6 +118,7 @@ ink_common_sources += \
print.cpp print.h \
profile-manager.cpp profile-manager.h \
proj_pt.cpp proj_pt.h \
+ removeoverlap.cpp removeoverlap.h \
rdf.cpp rdf.h \
rect-context.cpp rect-context.h \
require-config.h \
diff --git a/src/algorithms/CMakeLists.txt b/src/algorithms/CMakeLists.txt
deleted file mode 100644
index 0ac17f57c..000000000
--- a/src/algorithms/CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-#SET(algorithms_SRC
-#find-if-before.h
-#find-last-if.h
-#longest-common-suffix.h
-#)
-#ADD_LIBRARY(algorithms STATIC ${algorithms_SRC}) \ No newline at end of file
diff --git a/src/algorithms/Makefile_insert b/src/algorithms/Makefile_insert
deleted file mode 100644
index dff5b578d..000000000
--- a/src/algorithms/Makefile_insert
+++ /dev/null
@@ -1,5 +0,0 @@
-
-algorithms/all:
-
-algorithms/clean:
-
diff --git a/src/algorithms/makefile.in b/src/algorithms/makefile.in
deleted file mode 100644
index 112aae15d..000000000
--- a/src/algorithms/makefile.in
+++ /dev/null
@@ -1,17 +0,0 @@
-# Convenience stub makefile to call the real Makefile.
-
-@SET_MAKE@
-
-OBJEXT = @OBJEXT@
-
-# Explicit so that it's the default rule.
-all:
- cd .. && $(MAKE) algorithms/all
-
-clean %.a %.$(OBJEXT):
- cd .. && $(MAKE) algorithms/$@
-
-.PHONY: all clean
-
-.SUFFIXES:
-.SUFFIXES: .a .$(OBJEXT)
diff --git a/src/api/CMakeLists.txt b/src/api/CMakeLists.txt
deleted file mode 100644
index e2e9ff892..000000000
--- a/src/api/CMakeLists.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-SET(api_SRC
-#inkscape.idl
-)
diff --git a/src/api/inkscape.idl b/src/api/inkscape.idl
deleted file mode 100644
index 482184f18..000000000
--- a/src/api/inkscape.idl
+++ /dev/null
@@ -1,178 +0,0 @@
-#ifndef __INKSCAPE_IDL__
-#define __INKSCAPE_IDL__
-/**
- * Inkscape API Description
- *
- * This is a place where people can discuss and modify their ideas
- * of what an Inkscape exported API should look like.
- *
- * This IDL file should be considered to be somewhat of a Wish List,
- * and people should feel free to add their ideas to it.
- *
- * Authors:
- * Inkscape members
- *
- * Copyright (C) 2007 Inkscape.org
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-
-module inkscape
-{
-module api
-{
-
- /**
- * This will actually be defined as a Glib::ustring
- * but people should use the word 'String'
- */
- valuetype String sequence<unsigned short>;
-
- /**
- * Forward declarations
- */
- interface Env;
- interface Application;
- interface Document;
- interface Desktop;
- interface DialogManager;
-
-
-
- exception Exception {
- unsigned short code;
- };
-
- /**
- * ExceptionCodes
- * These muse be constants, since languages handle enums
- * differently.
- */
- const unsigned short INKER = 1;
- const unsigned short INKERR_NOT_FOUND = 2;
- const unsigned short INKERR_NOT_SUPPORTED = 3;
-
-
-
- /**
- * This is the top-level root of all Inkscape interfaces.
- * It is the single point of contact from which all other
- * interfaces can be accessed. Anything top-level or
- * global should be parented here.
- *
- * This allows an entire set of interfaces to be exported
- * to a shared object with only a single symbol. This symbol
- * can be accessed something like:
- *
- * typedef (Env *)(EnvCreateFunc)();
- * EnvCreateFunc createEnvironment =
- * (EnvCreateFunc) dlsym("createEnvironment");
- * Env *ink = createEnvironment();
- *
- *
- * This allows shared object linking to be much easier, and
- * allows binding to other languages to be performed however
- * is best for each.
- *
- */
- interface Env {
-
- /**
- * This is the main application, which
- */
- Application *getApplication();
-
- };
-
- /**
- *
- * Top-level Inkscape application
- *
- */
- interface Application {
-
- /**
- * Return the currently-focused desktop
- */
- Desktop *getActiveDesktop();
-
- /**
- * Return the document in the currently-focused desktop
- */
- Document *getActiveDocument();
-
- };
-
- /**
- *
- * This is a main editing window, with all of its chrome.
- *
- */
- interface Desktop {
-
- /**
- * Return the dialog manager for this desktop
- */
- DialogManager *getDialogManager();
-
- };
-
- /**
- * An Inkscape Document, which is SPObject + XML
- *
- */
- interface Document {
-
-
- /**
- * Copy the document's XML into a DOM tree and
- * return a pointer to it.
- */
- org::w3c::dom::Document *getDOM();
-
- /**
- * Set the Document's repr tree to the specified
- * DOM document
- */
- bool setDOM(org::w3c::dom::Document *doc);
-
- };
-
- /**
- * The interface that controls Inkscape's dialogs
- *
- */
- interface DialogManager {
-
- /**
- *
- */
- //some method
-
- };
-
-
-
-
-
-}; // module api
-
-}; // module inkscape
-
-
-#endif // __INKSCAPE_IDL__
-
diff --git a/src/graphlayout/graphlayout.cpp b/src/graphlayout.cpp
index 23b0ee13b..a89af10af 100644
--- a/src/graphlayout/graphlayout.cpp
+++ b/src/graphlayout.cpp
@@ -23,7 +23,7 @@
#include "inkscape.h"
#include "sp-namedview.h"
#include "util/glib-list-iterators.h"
-#include "graphlayout/graphlayout.h"
+#include "graphlayout.h"
#include "sp-path.h"
#include "sp-item.h"
#include "sp-item-transform.h"
diff --git a/src/graphlayout/graphlayout.h b/src/graphlayout.h
index 40090ef6b..40090ef6b 100644
--- a/src/graphlayout/graphlayout.h
+++ b/src/graphlayout.h
diff --git a/src/graphlayout/CMakeLists.txt b/src/graphlayout/CMakeLists.txt
deleted file mode 100644
index c8847a228..000000000
--- a/src/graphlayout/CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-SET(graphlayout_SRC
-graphlayout.cpp
-)
-ADD_LIBRARY(graphlayout STATIC ${graphlayout_SRC})
-TARGET_LINK_LIBRARIES(graphlayout
-2geom ${INKSCAPE_LIBS}) \ No newline at end of file
diff --git a/src/graphlayout/Makefile_insert b/src/graphlayout/Makefile_insert
deleted file mode 100644
index 790c951ae..000000000
--- a/src/graphlayout/Makefile_insert
+++ /dev/null
@@ -1,5 +0,0 @@
-## Makefile.am fragment sourced by src/Makefile.am.
-
-ink_common_sources += \
- graphlayout/graphlayout.cpp \
- graphlayout/graphlayout.h
diff --git a/src/graphlayout/makefile b/src/graphlayout/makefile
deleted file mode 100644
index 5d8ac906e..000000000
--- a/src/graphlayout/makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-# Convenience stub makefile to call the real Makefile.
-
-
-
-# Explicit so that it's the default rule.
-all:
- cd .. && $(MAKE) graphlayout/all
-
-clean %.a %.o:
- cd .. && $(MAKE) graphlayout/$@
-
-.PHONY: all clean
-
-OBJEXT = o
-
-.SUFFIXES:
-.SUFFIXES: .a .$(OBJEXT)
diff --git a/src/inkjar/CMakeLists.txt b/src/inkjar/CMakeLists.txt
deleted file mode 100644
index 7a1e86525..000000000
--- a/src/inkjar/CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-SET(inkjar_SRC
-jar.cpp
-)
-ADD_LIBRARY(inkjar STATIC ${inkjar_SRC})
-TARGET_LINK_LIBRARIES(inkjar
-2geom ${INKSCAPE_LIBS}) \ No newline at end of file
diff --git a/src/inkjar/Makefile_insert b/src/inkjar/Makefile_insert
deleted file mode 100644
index ef4f1fd19..000000000
--- a/src/inkjar/Makefile_insert
+++ /dev/null
@@ -1,5 +0,0 @@
-## Makefile.am fragment sourced by src/Makefile.am.
-
-ink_common_sources += \
- inkjar/jar.cpp \
- inkjar/jar.h
diff --git a/src/inkjar/makefile.in b/src/inkjar/makefile.in
deleted file mode 100644
index 96834aa2f..000000000
--- a/src/inkjar/makefile.in
+++ /dev/null
@@ -1,17 +0,0 @@
-# Convenience stub makefile to call the real Makefile.
-
-@SET_MAKE@
-
-OBJEXT = @OBJEXT@
-
-# Explicit so that it's the default rule.
-all:
- cd .. && $(MAKE) inkjar/all
-
-clean %.a %.$(OBJEXT):
- cd .. && $(MAKE) inkjar/$@
-
-.PHONY: all clean
-
-.SUFFIXES:
-.SUFFIXES: .a .$(OBJEXT)
diff --git a/src/inkview.cpp b/src/inkview.cpp
index 007438b49..c151991dd 100644
--- a/src/inkview.cpp
+++ b/src/inkview.cpp
@@ -63,7 +63,7 @@
#include "svg-view-widget.h"
#ifdef WITH_INKJAR
-#include "inkjar/jar.h"
+#include "io/inkjar.h"
#endif
#include "inkscape-private.h"
diff --git a/src/io/Makefile_insert b/src/io/Makefile_insert
index 2696e9334..bb47b46b8 100644
--- a/src/io/Makefile_insert
+++ b/src/io/Makefile_insert
@@ -7,6 +7,8 @@ ink_common_sources += \
io/ftos.h \
io/gzipstream.cpp \
io/gzipstream.h \
+ io/inkjar.cpp \
+ io/inkjar.h \
io/inkscapestream.cpp \
io/inkscapestream.h \
io/resource.cpp \
diff --git a/src/inkjar/jar.cpp b/src/io/inkjar.cpp
index 6897cb317..c238aba36 100644
--- a/src/inkjar/jar.cpp
+++ b/src/io/inkjar.cpp
@@ -48,7 +48,7 @@
#include <glib.h>
#include <zlib.h>
-#include "jar.h"
+#include "inkjar.h"
#include <fstream>
#ifdef WORDS_BIGENDIAN
diff --git a/src/inkjar/jar.h b/src/io/inkjar.h
index 0fe088b24..0fe088b24 100644
--- a/src/inkjar/jar.h
+++ b/src/io/inkjar.h
diff --git a/src/layer-fns.cpp b/src/layer-fns.cpp
index 75bb89bcf..ca7c1c493 100644
--- a/src/layer-fns.cpp
+++ b/src/layer-fns.cpp
@@ -16,7 +16,7 @@
#include "document.h"
#include "sp-item-group.h"
#include "xml/repr.h"
-#include "algorithms/find-last-if.h"
+#include "util/find-last-if.h"
#include "layer-fns.h"
namespace Inkscape {
diff --git a/src/removeoverlap/removeoverlap.cpp b/src/removeoverlap.cpp
index 975b4becb..975b4becb 100644
--- a/src/removeoverlap/removeoverlap.cpp
+++ b/src/removeoverlap.cpp
diff --git a/src/removeoverlap/removeoverlap.h b/src/removeoverlap.h
index 5b16e706b..5b16e706b 100644
--- a/src/removeoverlap/removeoverlap.h
+++ b/src/removeoverlap.h
diff --git a/src/removeoverlap/CMakeLists.txt b/src/removeoverlap/CMakeLists.txt
deleted file mode 100644
index 7f71c29dc..000000000
--- a/src/removeoverlap/CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-SET(removeoverlap_SRC
-removeoverlap.cpp
-)
-ADD_LIBRARY(removeoverlap STATIC ${removeoverlap_SRC})
-TARGET_LINK_LIBRARIES(removeoverlap
-2geom ${INKSCAPE_LIBS}) \ No newline at end of file
diff --git a/src/removeoverlap/Makefile_insert b/src/removeoverlap/Makefile_insert
deleted file mode 100644
index d5e90ec02..000000000
--- a/src/removeoverlap/Makefile_insert
+++ /dev/null
@@ -1,5 +0,0 @@
-## Makefile.am fragment sourced by src/Makefile.am.
-
-ink_common_sources += \
- removeoverlap/removeoverlap.cpp \
- removeoverlap/removeoverlap.h
diff --git a/src/removeoverlap/makefile.in b/src/removeoverlap/makefile.in
deleted file mode 100644
index 34e31a9a3..000000000
--- a/src/removeoverlap/makefile.in
+++ /dev/null
@@ -1,17 +0,0 @@
-# Convenience stub makefile to call the real Makefile.
-
-@SET_MAKE@
-
-OBJEXT = @OBJEXT@
-
-# Explicit so that it's the default rule.
-all:
- cd .. && $(MAKE) removeoverlap/all
-
-clean %.a %.$(OBJEXT):
- cd .. && $(MAKE) removeoverlap/$@
-
-.PHONY: all clean
-
-.SUFFIXES:
-.SUFFIXES: .a .$(OBJEXT)
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index c28940fca..c4411e47d 100644
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
@@ -64,7 +64,7 @@
#include "libnr/nr-scale-translate-ops.h"
#include "libnr/nr-translate-scale-ops.h"
#include "libnr/nr-convert2geom.h"
-#include "algorithms/find-last-if.h"
+#include "util/find-last-if.h"
#include "util/reverse-list.h"
#include <2geom/rect.h>
#include <2geom/matrix.h>
diff --git a/src/sp-object.cpp b/src/sp-object.cpp
index 5e0f72758..420c7b4a6 100644
--- a/src/sp-object.cpp
+++ b/src/sp-object.cpp
@@ -53,8 +53,8 @@
#include "debug/demangle.h"
#include "util/share.h"
#include "util/format.h"
+#include "util/longest-common-suffix.h"
-#include "algorithms/longest-common-suffix.h"
using std::memcpy;
using std::strchr;
using std::strcmp;
diff --git a/src/traits/CMakeLists.txt b/src/traits/CMakeLists.txt
deleted file mode 100644
index 791f9cd85..000000000
--- a/src/traits/CMakeLists.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-SET(traits_SRC
-)
diff --git a/src/traits/Makefile_insert b/src/traits/Makefile_insert
deleted file mode 100644
index 4290ac2dd..000000000
--- a/src/traits/Makefile_insert
+++ /dev/null
@@ -1,5 +0,0 @@
-
-traits/all:
-
-traits/clean:
-
diff --git a/src/traits/makefile.in b/src/traits/makefile.in
deleted file mode 100644
index c0f07d432..000000000
--- a/src/traits/makefile.in
+++ /dev/null
@@ -1,17 +0,0 @@
-# Convenience stub makefile to call the real Makefile.
-
-@SET_MAKE@
-
-OBJEXT = @OBJEXT@
-
-# Explicit so that it's the default rule.
-all:
- cd .. && $(MAKE) traits/all
-
-clean %.a %.$(OBJEXT):
- cd .. && $(MAKE) traits/$@
-
-.PHONY: all clean
-
-.SUFFIXES:
-.SUFFIXES: .a .$(OBJEXT)
diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp
index 8c8d64ec0..a75a8d68d 100644
--- a/src/ui/dialog/align-and-distribute.cpp
+++ b/src/ui/dialog/align-and-distribute.cpp
@@ -24,11 +24,11 @@
#include "unclump.h"
#include "document.h"
#include "enums.h"
-#include "graphlayout/graphlayout.h"
+#include "graphlayout.h"
#include "inkscape.h"
#include "macros.h"
#include "preferences.h"
-#include "removeoverlap/removeoverlap.h"
+#include "removeoverlap.h"
#include "selection.h"
#include "sp-flowtext.h"
#include "sp-item-transform.h"
diff --git a/src/ui/tool/node.h b/src/ui/tool/node.h
index e502ddea1..d04b87976 100644
--- a/src/ui/tool/node.h
+++ b/src/ui/tool/node.h
@@ -234,8 +234,16 @@ public:
/// @see get_pointer()
N *ptr() const { return static_cast<N*>(_node); }
- self next() const;
- self prev() const;
+ self next() const {
+ self r(*this);
+ r.advance();
+ return r;
+ }
+ self prev() const {
+ self r(*this);
+ r.retreat();
+ return r;
+ }
self &advance();
self &retreat();
private:
@@ -256,8 +264,6 @@ public:
typedef Node value_type;
typedef NodeIterator<value_type> iterator;
typedef NodeIterator<value_type const> const_iterator;
- typedef std::reverse_iterator<iterator> reverse_iterator;
- typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
// TODO Lame. Make this private and make SubpathList a factory
NodeList(SubpathList &_list);
@@ -268,10 +274,6 @@ public:
iterator end() { return iterator(this); }
const_iterator begin() const { return const_iterator(ln_next); }
const_iterator end() const { return const_iterator(this); }
- reverse_iterator rbegin() { return reverse_iterator(end()); }
- reverse_iterator rend() { return reverse_iterator(begin()); }
- const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); }
- const_reverse_iterator rend() const { return const_reverse_iterator(begin()); }
// size
bool empty();
@@ -376,18 +378,16 @@ NodeIterator<N>::operator bool() const {
return _node && static_cast<ListNode*>(_node->ln_list) != _node;
}
template <typename N>
-NodeIterator<N> NodeIterator<N>::next() const {
- NodeIterator<N> ret(*this);
- ++ret;
- if (G_UNLIKELY(!ret) && _node->ln_list->closed()) ++ret;
- return ret;
+NodeIterator<N> &NodeIterator<N>::advance() {
+ ++(*this);
+ if (G_UNLIKELY(!*this) && _node->ln_list->closed()) ++(*this);
+ return *this;
}
template <typename N>
-NodeIterator<N> NodeIterator<N>::prev() const {
- NodeIterator<N> ret(*this);
- --ret;
- if (G_UNLIKELY(!ret) && _node->ln_list->closed()) --ret;
- return ret;
+NodeIterator<N> &NodeIterator<N>::retreat() {
+ --(*this);
+ if (G_UNLIKELY(!*this) && _node->ln_list->closed()) --(*this);
+ return *this;
}
} // namespace UI
diff --git a/src/util/Makefile_insert b/src/util/Makefile_insert
index 1908aea19..259fd762e 100644
--- a/src/util/Makefile_insert
+++ b/src/util/Makefile_insert
@@ -2,23 +2,30 @@
ink_common_sources += \
util/compose.hpp \
- util/ucompose.hpp \
+ util/copy.h \
util/enums.h \
util/ege-tags.h \
util/ege-tags.cpp \
util/filter-list.h \
+ util/find-if-before.h \
+ util/find-last-if.h \
util/fixed_point.h \
util/format.h \
util/forward-pointer-iterator.h \
+ util/function.h \
util/glib-list-iterators.h \
util/list.h \
util/list-container.h \
+ util/list-copy.h \
+ util/longest-common-suffix.h \
util/map-list.h \
util/mathfns.h \
+ util/reference.h \
util/reverse-list.h \
util/share.h \
util/share.cpp \
util/tuple.h \
+ util/ucompose.hpp \
util/units.cpp \
util/units.h \
util/unordered-containers.h
diff --git a/src/traits/copy.h b/src/util/copy.h
index 27038ff2d..27038ff2d 100644
--- a/src/traits/copy.h
+++ b/src/util/copy.h
diff --git a/src/util/filter-list.h b/src/util/filter-list.h
index e00c33b08..50aba12fa 100644
--- a/src/util/filter-list.h
+++ b/src/util/filter-list.h
@@ -13,7 +13,7 @@
#define SEEN_INKSCAPE_UTIL_FILTER_LIST_H
#include "util/list.h"
-#include "traits/list-copy.h"
+#include "util/list-copy.h"
namespace Inkscape {
diff --git a/src/algorithms/find-if-before.h b/src/util/find-if-before.h
index 6a0f63be6..6a0f63be6 100644
--- a/src/algorithms/find-if-before.h
+++ b/src/util/find-if-before.h
diff --git a/src/algorithms/find-last-if.h b/src/util/find-last-if.h
index 1ffd63b9c..1ffd63b9c 100644
--- a/src/algorithms/find-last-if.h
+++ b/src/util/find-last-if.h
diff --git a/src/util/fixed_point.h b/src/util/fixed_point.h
index 6afec5e3c..05a73dab5 100644
--- a/src/util/fixed_point.h
+++ b/src/util/fixed_point.h
@@ -12,229 +12,7 @@
#ifndef SEEN_INKSCAPE_UTIL_FIXED_POINT_H
#define SEEN_INKSCAPE_UTIL_FIXED_POINT_H
-#include "traits/reference.h"
-#include <math.h>
-#include <algorithm>
-#include <limits>
-
-namespace Inkscape {
-
-namespace Util {
-
-template <typename T, unsigned int precision>
-class FixedPoint {
-public:
- FixedPoint() {}
- FixedPoint(const FixedPoint& value) : v(value.v) {}
- FixedPoint(char value) : v(static_cast<T>(value)<<precision) {}
- FixedPoint(unsigned char value) : v(static_cast<T>(value)<<precision) {}
- FixedPoint(short value) : v(static_cast<T>(value)<<precision) {}
- FixedPoint(unsigned short value) : v(static_cast<T>(value)<<precision) {}
- FixedPoint(int value) : v(static_cast<T>(value)<<precision) {}
- FixedPoint(unsigned int value) : v(static_cast<T>(value)<<precision) {}
- FixedPoint(double value) : v(static_cast<T>(floor(value*(1<<precision)))) {}
-
- FixedPoint& operator+=(FixedPoint val) { v += val.v; return *this; }
- FixedPoint& operator-=(FixedPoint val) { v -= val.v; return *this; }
- FixedPoint& operator*=(FixedPoint val) {
- const unsigned int half_size = 8*sizeof(T)/2;
- const T al = v&((1<<half_size)-1), bl = val.v&((1<<half_size)-1);
- const T ah = v>>half_size, bh = val.v>>half_size;
- v = static_cast<unsigned int>(al*bl)>>precision;
- if ( half_size >= precision ) {
- v += ((al*bh)+(ah*bl)+((ah*bh)<<half_size))<<(half_size-precision);
- } else {
- v += ((al*bh)+(ah*bl))>>(precision-half_size);
- v += (ah*bh)<<(2*half_size-precision);
- }
- return *this;
- }
-
- FixedPoint& operator*=(char val) { v *= val; return *this; }
- FixedPoint& operator*=(unsigned char val) { v *= val; return *this; }
- FixedPoint& operator*=(short val) { v *= val; return *this; }
- FixedPoint& operator*=(unsigned short val) { v *= val; return *this; }
- FixedPoint& operator*=(int val) { v *= val; return *this; }
- FixedPoint& operator*=(unsigned int val) { v *= val; return *this; }
-
- FixedPoint operator+(FixedPoint val) const { FixedPoint r(*this); return r+=val; }
- FixedPoint operator-(FixedPoint val) const { FixedPoint r(*this); return r-=val; }
- FixedPoint operator*(FixedPoint val) const { FixedPoint r(*this); return r*=val; }
-
- FixedPoint operator*(char val) const { FixedPoint r(*this); return r*=val; }
- FixedPoint operator*(unsigned char val) const { FixedPoint r(*this); return r*=val; }
- FixedPoint operator*(short val) const { FixedPoint r(*this); return r*=val; }
- FixedPoint operator*(unsigned short val) const { FixedPoint r(*this); return r*=val; }
- FixedPoint operator*(int val) const { FixedPoint r(*this); return r*=val; }
- FixedPoint operator*(unsigned int val) const { FixedPoint r(*this); return r*=val; }
-
- float operator*(float val) const { return static_cast<float>(*this)*val; }
- double operator*(double val) const { return static_cast<double>(*this)*val; }
-
- operator char() const { return v>>precision; }
- operator unsigned char() const { return v>>precision; }
- operator short() const { return v>>precision; }
- operator unsigned short() const { return v>>precision; }
- operator int() const { return v>>precision; }
- operator unsigned int() const { return v>>precision; }
-
- operator float() const { return ldexpf(v,-precision); }
- operator double() const { return ldexp(v,-precision); }
-private:
- T v;
-};
-
-template<typename T, unsigned int precision> FixedPoint<T,precision> operator *(char a, FixedPoint<T,precision> b) { return b*=a; }
-template<typename T, unsigned int precision> FixedPoint<T,precision> operator *(unsigned char a, FixedPoint<T,precision> b) { return b*=a; }
-template<typename T, unsigned int precision> FixedPoint<T,precision> operator *(short a, FixedPoint<T,precision> b) { return b*=a; }
-template<typename T, unsigned int precision> FixedPoint<T,precision> operator *(unsigned short a, FixedPoint<T,precision> b) { return b*=a; }
-template<typename T, unsigned int precision> FixedPoint<T,precision> operator *(int a, FixedPoint<T,precision> b) { return b*=a; }
-template<typename T, unsigned int precision> FixedPoint<T,precision> operator *(unsigned int a, FixedPoint<T,precision> b) { return b*=a; }
-
-template<typename T, unsigned int precision> float operator *(float a, FixedPoint<T,precision> b) { return b*a; }
-template<typename T, unsigned int precision> double operator *(double a, FixedPoint<T,precision> b) { return b*a; }
-
-}
-
-}
-
-#endif
-/*
- 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:encoding=utf-8:textwidth=99 :
-/*
- * Inkscape::Util::FixedPoint - fixed point type
- *
- * Authors:
- * Jasper van de Gronde <th.v.d.gronde@hccnet.net>
- *
- * Copyright (C) 2006 Jasper van de Gronde
- *
- * Released under GNU GPL, read the file 'COPYING' for more information
- */
-
-#ifndef SEEN_INKSCAPE_UTIL_FIXED_POINT_H
-#define SEEN_INKSCAPE_UTIL_FIXED_POINT_H
-
-#include "traits/reference.h"
-#include <math.h>
-#include <algorithm>
-#include <limits>
-
-namespace Inkscape {
-
-namespace Util {
-
-template <typename T, unsigned int precision>
-class FixedPoint {
-public:
- FixedPoint() {}
- FixedPoint(const FixedPoint& value) : v(value.v) {}
- FixedPoint(char value) : v(static_cast<T>(value)<<precision) {}
- FixedPoint(unsigned char value) : v(static_cast<T>(value)<<precision) {}
- FixedPoint(short value) : v(static_cast<T>(value)<<precision) {}
- FixedPoint(unsigned short value) : v(static_cast<T>(value)<<precision) {}
- FixedPoint(int value) : v(static_cast<T>(value)<<precision) {}
- FixedPoint(unsigned int value) : v(static_cast<T>(value)<<precision) {}
- FixedPoint(double value) : v(static_cast<T>(floor(value*(1<<precision)))) {}
-
- FixedPoint& operator+=(FixedPoint val) { v += val.v; return *this; }
- FixedPoint& operator-=(FixedPoint val) { v -= val.v; return *this; }
- FixedPoint& operator*=(FixedPoint val) {
- const unsigned int half_size = 8*sizeof(T)/2;
- const T al = v&((1<<half_size)-1), bl = val.v&((1<<half_size)-1);
- const T ah = v>>half_size, bh = val.v>>half_size;
- v = static_cast<unsigned int>(al*bl)>>precision;
- if ( half_size >= precision ) {
- v += ((al*bh)+(ah*bl)+((ah*bh)<<half_size))<<(half_size-precision);
- } else {
- v += ((al*bh)+(ah*bl))>>(precision-half_size);
- v += (ah*bh)<<(2*half_size-precision);
- }
- return *this;
- }
-
- FixedPoint& operator*=(char val) { v *= val; return *this; }
- FixedPoint& operator*=(unsigned char val) { v *= val; return *this; }
- FixedPoint& operator*=(short val) { v *= val; return *this; }
- FixedPoint& operator*=(unsigned short val) { v *= val; return *this; }
- FixedPoint& operator*=(int val) { v *= val; return *this; }
- FixedPoint& operator*=(unsigned int val) { v *= val; return *this; }
-
- FixedPoint operator+(FixedPoint val) const { FixedPoint r(*this); return r+=val; }
- FixedPoint operator-(FixedPoint val) const { FixedPoint r(*this); return r-=val; }
- FixedPoint operator*(FixedPoint val) const { FixedPoint r(*this); return r*=val; }
-
- FixedPoint operator*(char val) const { FixedPoint r(*this); return r*=val; }
- FixedPoint operator*(unsigned char val) const { FixedPoint r(*this); return r*=val; }
- FixedPoint operator*(short val) const { FixedPoint r(*this); return r*=val; }
- FixedPoint operator*(unsigned short val) const { FixedPoint r(*this); return r*=val; }
- FixedPoint operator*(int val) const { FixedPoint r(*this); return r*=val; }
- FixedPoint operator*(unsigned int val) const { FixedPoint r(*this); return r*=val; }
-
- float operator*(float val) const { return static_cast<float>(*this)*val; }
- double operator*(double val) const { return static_cast<double>(*this)*val; }
-
- operator char() const { return v>>precision; }
- operator unsigned char() const { return v>>precision; }
- operator short() const { return v>>precision; }
- operator unsigned short() const { return v>>precision; }
- operator int() const { return v>>precision; }
- operator unsigned int() const { return v>>precision; }
-
- operator float() const { return ldexpf(v,-precision); }
- operator double() const { return ldexp(v,-precision); }
-private:
- T v;
-};
-
-template<typename T, unsigned int precision> FixedPoint<T,precision> operator *(char a, FixedPoint<T,precision> b) { return b*=a; }
-template<typename T, unsigned int precision> FixedPoint<T,precision> operator *(unsigned char a, FixedPoint<T,precision> b) { return b*=a; }
-template<typename T, unsigned int precision> FixedPoint<T,precision> operator *(short a, FixedPoint<T,precision> b) { return b*=a; }
-template<typename T, unsigned int precision> FixedPoint<T,precision> operator *(unsigned short a, FixedPoint<T,precision> b) { return b*=a; }
-template<typename T, unsigned int precision> FixedPoint<T,precision> operator *(int a, FixedPoint<T,precision> b) { return b*=a; }
-template<typename T, unsigned int precision> FixedPoint<T,precision> operator *(unsigned int a, FixedPoint<T,precision> b) { return b*=a; }
-
-template<typename T, unsigned int precision> float operator *(float a, FixedPoint<T,precision> b) { return b*a; }
-template<typename T, unsigned int precision> double operator *(double a, FixedPoint<T,precision> b) { return b*a; }
-
-}
-
-}
-
-#endif
-/*
- 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:encoding=utf-8:textwidth=99 :
-/*
- * Inkscape::Util::FixedPoint - fixed point type
- *
- * Authors:
- * Jasper van de Gronde <th.v.d.gronde@hccnet.net>
- *
- * Copyright (C) 2006 Jasper van de Gronde
- *
- * Released under GNU GPL, read the file 'COPYING' for more information
- */
-
-#ifndef SEEN_INKSCAPE_UTIL_FIXED_POINT_H
-#define SEEN_INKSCAPE_UTIL_FIXED_POINT_H
-
-#include "traits/reference.h"
+#include "util/reference.h"
#include <math.h>
#include <algorithm>
#include <limits>
diff --git a/src/util/forward-pointer-iterator.h b/src/util/forward-pointer-iterator.h
index 2c2345c81..1603fed27 100644
--- a/src/util/forward-pointer-iterator.h
+++ b/src/util/forward-pointer-iterator.h
@@ -15,7 +15,7 @@
#define SEEN_INKSCAPE_UTIL_FORWARD_POINTER_ITERATOR_H
#include <iterator>
-#include "traits/reference.h"
+#include "util/reference.h"
namespace Inkscape {
diff --git a/src/traits/function.h b/src/util/function.h
index d0dd5d87c..d0dd5d87c 100644
--- a/src/traits/function.h
+++ b/src/util/function.h
diff --git a/src/traits/list-copy.h b/src/util/list-copy.h
index 9d99c4f29..811f93b77 100644
--- a/src/traits/list-copy.h
+++ b/src/util/list-copy.h
@@ -13,7 +13,7 @@
#define SEEN_INKSCAPE_TRAITS_LIST_COPY_H
#include <iterator>
-#include "traits/copy.h"
+#include "util/copy.h"
#include "util/list.h"
namespace Inkscape {
diff --git a/src/util/list.h b/src/util/list.h
index 86a73711a..ebe3a9773 100644
--- a/src/util/list.h
+++ b/src/util/list.h
@@ -15,7 +15,7 @@
#include <cstddef>
#include <iterator>
#include "gc-managed.h"
-#include "traits/reference.h"
+#include "util/reference.h"
namespace Inkscape {
diff --git a/src/algorithms/longest-common-suffix.h b/src/util/longest-common-suffix.h
index 04d2b179d..04d2b179d 100644
--- a/src/algorithms/longest-common-suffix.h
+++ b/src/util/longest-common-suffix.h
diff --git a/src/traits/reference.h b/src/util/reference.h
index 199ae8929..199ae8929 100644
--- a/src/traits/reference.h
+++ b/src/util/reference.h
diff --git a/src/util/reverse-list.h b/src/util/reverse-list.h
index 586f706c7..798b15701 100644
--- a/src/util/reverse-list.h
+++ b/src/util/reverse-list.h
@@ -13,7 +13,7 @@
#define SEEN_INKSCAPE_UTIL_REVERSE_LIST_H
#include "util/list.h"
-#include "traits/list-copy.h"
+#include "util/list-copy.h"
namespace Inkscape {
diff --git a/src/util/tuple.h b/src/util/tuple.h
index bf9338366..42266c8d2 100644
--- a/src/util/tuple.h
+++ b/src/util/tuple.h
@@ -12,7 +12,7 @@
#ifndef SEEN_INKSCAPE_UTIL_TUPLE_H
#define SEEN_INKSCAPE_UTIL_TUPLE_H
-#include "traits/reference.h"
+#include "util/reference.h"
namespace Inkscape {
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index b4324ca0d..4b0d84d90 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -50,7 +50,7 @@
#include "../ege-select-one-action.h"
#include "../flood-context.h"
#include "gradient-toolbar.h"
-#include "../graphlayout/graphlayout.h"
+#include "../graphlayout.h"
#include "../helper/unit-menu.h"
#include "../helper/units.h"
#include "../helper/unit-tracker.h"
diff --git a/src/xml/Makefile_insert b/src/xml/Makefile_insert
index e4269026c..7190b7948 100644
--- a/src/xml/Makefile_insert
+++ b/src/xml/Makefile_insert
@@ -1,7 +1,6 @@
## Makefile.am fragment sourced by src/Makefile.am.
ink_common_sources += \
- algorithms/find-if-before.h \
xml/comment-node.h \
xml/composite-node-observer.cpp xml/composite-node-observer.h \
xml/element-node.h \
diff --git a/src/xml/composite-node-observer.cpp b/src/xml/composite-node-observer.cpp
index e65981616..564938dda 100644
--- a/src/xml/composite-node-observer.cpp
+++ b/src/xml/composite-node-observer.cpp
@@ -15,7 +15,7 @@
#include <cstring>
#include <glib.h>
-#include "algorithms/find-if-before.h"
+#include "util/find-if-before.h"
#include "xml/composite-node-observer.h"
#include "xml/node-event-vector.h"
#include "debug/event-tracker.h"
diff --git a/src/xml/node-fns.cpp b/src/xml/node-fns.cpp
index deb88fb5e..bf860d8f3 100644
--- a/src/xml/node-fns.cpp
+++ b/src/xml/node-fns.cpp
@@ -8,7 +8,7 @@
#include <glib.h> // g_assert()
#include "xml/node-iterators.h"
-#include "algorithms/find-if-before.h"
+#include "util/find-if-before.h"
namespace Inkscape {
namespace XML {
diff --git a/src/xml/repr-sorting.cpp b/src/xml/repr-sorting.cpp
index 123df33ee..27293d3c2 100644
--- a/src/xml/repr-sorting.cpp
+++ b/src/xml/repr-sorting.cpp
@@ -1,5 +1,5 @@
-#include "algorithms/longest-common-suffix.h"
+#include "util/longest-common-suffix.h"
#include "xml/repr.h"
#include "xml/node-iterators.h"