From 93650897c928bfa9ca9b737cfbff55c25271d5d3 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Tue, 8 Dec 2015 00:34:32 +0100 Subject: cppification : GHashMaps replaced by stl maps. getResouceList now gives a std::set. Should give some performance improvements (quite a few linear lookups are now logarithmic) (bzr r14504.1.6) --- src/document-private.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/document-private.h') diff --git a/src/document-private.h b/src/document-private.h index a5033b3c2..a4a2abd77 100644 --- a/src/document-private.h +++ b/src/document-private.h @@ -15,6 +15,8 @@ */ #include +#include +#include #include #include #include "xml/event-fns.h" @@ -40,8 +42,10 @@ struct SPDocumentPrivate { typedef std::map IDChangedSignalMap; typedef std::map ResourcesChangedSignalMap; - GHashTable *iddef; /**< Dictionary of id -> SPObject mappings */ - GHashTable *reprdef; /**< Dictionary of Inkscape::XML::Node -> SPObject mappings */ + std::map iddef; + std::map reprdef; + //GHashTable *iddef; /**< Dictionary of id -> SPObject mappings */ + //GHashTable *reprdef; /**< Dictionary of Inkscape::XML::Node -> SPObject mappings */ unsigned long serial; @@ -50,7 +54,8 @@ struct SPDocumentPrivate { /* Resources */ /* It is GHashTable of GSLists */ - GHashTable *resources; + std::map > resources; + //GHashTable *resources; ResourcesChangedSignalMap resources_changed_signals; sigc::signal destroySignal; -- cgit v1.2.3 From cfd295134c9804bf98fba835361000a891c2fa56 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Tue, 8 Dec 2015 23:18:50 +0100 Subject: cppification: GSList replaced by vectors (undo/redo) (bzr r14504.1.14) --- src/document-private.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/document-private.h') diff --git a/src/document-private.h b/src/document-private.h index a4a2abd77..55c844ecc 100644 --- a/src/document-private.h +++ b/src/document-private.h @@ -53,9 +53,7 @@ struct SPDocumentPrivate { IDChangedSignalMap id_changed_signals; /* Resources */ - /* It is GHashTable of GSLists */ std::map > resources; - //GHashTable *resources; ResourcesChangedSignalMap resources_changed_signals; sigc::signal destroySignal; @@ -70,8 +68,8 @@ struct SPDocumentPrivate { bool sensitive; /* If we save actions to undo stack */ Inkscape::XML::Event * partial; /* partial undo log when interrupted */ int history_size; - GSList * undo; /* Undo stack of reprs */ - GSList * redo; /* Redo stack of reprs */ + std::vector undo; /* Undo stack of reprs */ + std::vector redo; /* Redo stack of reprs */ /* Undo listener */ Inkscape::CompositeUndoStackObserver undoStackObservers; -- cgit v1.2.3 From 1c18349cc106bb55c7bca12fd572fb7b899ff225 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Wed, 9 Dec 2015 01:45:44 +0100 Subject: replaced remaining GHashTable with std::map (bzr r14504.1.16) --- src/document-private.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/document-private.h') diff --git a/src/document-private.h b/src/document-private.h index 55c844ecc..eaed0020e 100644 --- a/src/document-private.h +++ b/src/document-private.h @@ -36,16 +36,12 @@ class Event; } } -typedef struct _GHashTable GHashTable; - struct SPDocumentPrivate { typedef std::map IDChangedSignalMap; typedef std::map ResourcesChangedSignalMap; std::map iddef; std::map reprdef; - //GHashTable *iddef; /**< Dictionary of id -> SPObject mappings */ - //GHashTable *reprdef; /**< Dictionary of Inkscape::XML::Node -> SPObject mappings */ unsigned long serial; -- cgit v1.2.3