From 5a931dcbd585584fed4990ae6cd1717a3918f90a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Krzysztof=20Kosi=C5=84ski?= Date: Mon, 15 Mar 2010 00:58:16 +0100 Subject: [PATCH] Move around files to remove some vanity directories. Also remove the obsolete IDL file stub. --- configure.ac | 4 - src/Makefile.am | 12 - src/Makefile_insert | 2 + src/algorithms/CMakeLists.txt | 6 - src/algorithms/Makefile_insert | 5 - src/algorithms/makefile.in | 17 -- src/api/CMakeLists.txt | 3 - src/api/inkscape.idl | 178 -------------- src/{graphlayout => }/graphlayout.cpp | 2 +- src/{graphlayout => }/graphlayout.h | 0 src/graphlayout/CMakeLists.txt | 6 - src/graphlayout/Makefile_insert | 5 - src/graphlayout/makefile | 17 -- src/inkjar/CMakeLists.txt | 6 - src/inkjar/Makefile_insert | 5 - src/inkjar/makefile.in | 17 -- src/inkview.cpp | 2 +- src/io/Makefile_insert | 2 + src/{inkjar/jar.cpp => io/inkjar.cpp} | 2 +- src/{inkjar/jar.h => io/inkjar.h} | 0 src/layer-fns.cpp | 2 +- src/{removeoverlap => }/removeoverlap.cpp | 0 src/{removeoverlap => }/removeoverlap.h | 0 src/removeoverlap/CMakeLists.txt | 6 - src/removeoverlap/Makefile_insert | 5 - src/removeoverlap/makefile.in | 17 -- src/sp-item.cpp | 2 +- src/sp-object.cpp | 2 +- src/traits/CMakeLists.txt | 2 - src/traits/Makefile_insert | 5 - src/traits/makefile.in | 17 -- src/ui/dialog/align-and-distribute.cpp | 4 +- src/ui/tool/node.h | 36 +-- src/util/Makefile_insert | 9 +- src/{traits => util}/copy.h | 0 src/util/filter-list.h | 2 +- src/{algorithms => util}/find-if-before.h | 0 src/{algorithms => util}/find-last-if.h | 0 src/util/fixed_point.h | 224 +----------------- src/util/forward-pointer-iterator.h | 2 +- src/{traits => util}/function.h | 0 src/{traits => util}/list-copy.h | 2 +- src/util/list.h | 2 +- .../longest-common-suffix.h | 0 src/{traits => util}/reference.h | 0 src/util/reverse-list.h | 2 +- src/util/tuple.h | 2 +- src/widgets/toolbox.cpp | 2 +- src/xml/Makefile_insert | 1 - src/xml/composite-node-observer.cpp | 2 +- src/xml/node-fns.cpp | 2 +- src/xml/repr-sorting.cpp | 2 +- 52 files changed, 49 insertions(+), 594 deletions(-) delete mode 100644 src/algorithms/CMakeLists.txt delete mode 100644 src/algorithms/Makefile_insert delete mode 100644 src/algorithms/makefile.in delete mode 100644 src/api/CMakeLists.txt delete mode 100644 src/api/inkscape.idl rename src/{graphlayout => }/graphlayout.cpp (99%) rename src/{graphlayout => }/graphlayout.h (100%) delete mode 100644 src/graphlayout/CMakeLists.txt delete mode 100644 src/graphlayout/Makefile_insert delete mode 100644 src/graphlayout/makefile delete mode 100644 src/inkjar/CMakeLists.txt delete mode 100644 src/inkjar/Makefile_insert delete mode 100644 src/inkjar/makefile.in rename src/{inkjar/jar.cpp => io/inkjar.cpp} (99%) rename src/{inkjar/jar.h => io/inkjar.h} (100%) rename src/{removeoverlap => }/removeoverlap.cpp (100%) rename src/{removeoverlap => }/removeoverlap.h (100%) delete mode 100644 src/removeoverlap/CMakeLists.txt delete mode 100644 src/removeoverlap/Makefile_insert delete mode 100644 src/removeoverlap/makefile.in delete mode 100644 src/traits/CMakeLists.txt delete mode 100644 src/traits/Makefile_insert delete mode 100644 src/traits/makefile.in rename src/{traits => util}/copy.h (100%) rename src/{algorithms => util}/find-if-before.h (100%) rename src/{algorithms => util}/find-last-if.h (100%) rename src/{traits => util}/function.h (100%) rename src/{traits => util}/list-copy.h (97%) rename src/{algorithms => util}/longest-common-suffix.h (100%) rename src/{traits => util}/reference.h (100%) diff --git a/configure.ac b/configure.ac index 00b0e91cb..330e40d7d 100644 --- a/configure.ac +++ b/configure.ac @@ -960,7 +960,6 @@ AC_CONFIG_FILES([ Makefile src/Makefile src/check-header-compile -src/algorithms/makefile src/application/makefile src/bind/makefile src/debug/makefile @@ -973,7 +972,6 @@ src/extension/makefile src/extension/script/makefile src/filters/makefile src/helper/makefile -src/inkjar/makefile src/io/makefile src/libcroco/makefile src/libgdl/makefile @@ -985,10 +983,8 @@ src/live_effects/makefile src/live_effects/parameter/makefile src/pedro/makefile src/jabber_whiteboard/makefile -src/removeoverlap/makefile src/svg/makefile src/trace/makefile -src/traits/makefile src/ui/cache/makefile src/ui/dialog/makefile src/ui/makefile 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; - - /** - * 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 similarity index 99% rename from src/graphlayout/graphlayout.cpp rename to 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 similarity index 100% rename from src/graphlayout/graphlayout.h rename to 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 similarity index 99% rename from src/inkjar/jar.cpp rename to src/io/inkjar.cpp index 6897cb317..c238aba36 100644 --- a/src/inkjar/jar.cpp +++ b/src/io/inkjar.cpp @@ -48,7 +48,7 @@ #include #include -#include "jar.h" +#include "inkjar.h" #include #ifdef WORDS_BIGENDIAN diff --git a/src/inkjar/jar.h b/src/io/inkjar.h similarity index 100% rename from src/inkjar/jar.h rename to 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 similarity index 100% rename from src/removeoverlap/removeoverlap.cpp rename to src/removeoverlap.cpp diff --git a/src/removeoverlap/removeoverlap.h b/src/removeoverlap.h similarity index 100% rename from src/removeoverlap/removeoverlap.h rename to 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(_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 iterator; typedef NodeIterator const_iterator; - typedef std::reverse_iterator reverse_iterator; - typedef std::reverse_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::operator bool() const { return _node && static_cast(_node->ln_list) != _node; } template -NodeIterator NodeIterator::next() const { - NodeIterator ret(*this); - ++ret; - if (G_UNLIKELY(!ret) && _node->ln_list->closed()) ++ret; - return ret; +NodeIterator &NodeIterator::advance() { + ++(*this); + if (G_UNLIKELY(!*this) && _node->ln_list->closed()) ++(*this); + return *this; } template -NodeIterator NodeIterator::prev() const { - NodeIterator ret(*this); - --ret; - if (G_UNLIKELY(!ret) && _node->ln_list->closed()) --ret; - return ret; +NodeIterator &NodeIterator::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 similarity index 100% rename from src/traits/copy.h rename to 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 similarity index 100% rename from src/algorithms/find-if-before.h rename to src/util/find-if-before.h diff --git a/src/algorithms/find-last-if.h b/src/util/find-last-if.h similarity index 100% rename from src/algorithms/find-last-if.h rename to 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 -#include -#include - -namespace Inkscape { - -namespace Util { - -template -class FixedPoint { -public: - FixedPoint() {} - FixedPoint(const FixedPoint& value) : v(value.v) {} - FixedPoint(char value) : v(static_cast(value)<(value)<(value)<(value)<(value)<(value)<(floor(value*(1<>half_size, bh = val.v>>half_size; - v = static_cast(al*bl)>>precision; - if ( half_size >= precision ) { - v += ((al*bh)+(ah*bl)+((ah*bh)<>(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(*this)*val; } - double operator*(double val) const { return static_cast(*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 FixedPoint operator *(char a, FixedPoint b) { return b*=a; } -template FixedPoint operator *(unsigned char a, FixedPoint b) { return b*=a; } -template FixedPoint operator *(short a, FixedPoint b) { return b*=a; } -template FixedPoint operator *(unsigned short a, FixedPoint b) { return b*=a; } -template FixedPoint operator *(int a, FixedPoint b) { return b*=a; } -template FixedPoint operator *(unsigned int a, FixedPoint b) { return b*=a; } - -template float operator *(float a, FixedPoint b) { return b*a; } -template double operator *(double a, FixedPoint 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 - * - * 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 -#include -#include - -namespace Inkscape { - -namespace Util { - -template -class FixedPoint { -public: - FixedPoint() {} - FixedPoint(const FixedPoint& value) : v(value.v) {} - FixedPoint(char value) : v(static_cast(value)<(value)<(value)<(value)<(value)<(value)<(floor(value*(1<>half_size, bh = val.v>>half_size; - v = static_cast(al*bl)>>precision; - if ( half_size >= precision ) { - v += ((al*bh)+(ah*bl)+((ah*bh)<>(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(*this)*val; } - double operator*(double val) const { return static_cast(*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 FixedPoint operator *(char a, FixedPoint b) { return b*=a; } -template FixedPoint operator *(unsigned char a, FixedPoint b) { return b*=a; } -template FixedPoint operator *(short a, FixedPoint b) { return b*=a; } -template FixedPoint operator *(unsigned short a, FixedPoint b) { return b*=a; } -template FixedPoint operator *(int a, FixedPoint b) { return b*=a; } -template FixedPoint operator *(unsigned int a, FixedPoint b) { return b*=a; } - -template float operator *(float a, FixedPoint b) { return b*a; } -template double operator *(double a, FixedPoint 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 - * - * 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 #include #include 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 -#include "traits/reference.h" +#include "util/reference.h" namespace Inkscape { diff --git a/src/traits/function.h b/src/util/function.h similarity index 100% rename from src/traits/function.h rename to src/util/function.h diff --git a/src/traits/list-copy.h b/src/util/list-copy.h similarity index 97% rename from src/traits/list-copy.h rename to 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 -#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 #include #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 similarity index 100% rename from src/algorithms/longest-common-suffix.h rename to src/util/longest-common-suffix.h diff --git a/src/traits/reference.h b/src/util/reference.h similarity index 100% rename from src/traits/reference.h rename to 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 #include -#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 // 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" -- 2.30.2