summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMenTaLguY <mental@rydia.net>2006-03-15 03:22:23 +0000
committermental <mental@users.sourceforge.net>2006-03-15 03:22:23 +0000
commit7663e55d418b5ea8765421c9570dba40f6bd97fd (patch)
tree74e9eef28e3553010bb121dc4eba4cb5b59d05ff /src
parentdifferentiate _hreffed and _listening flags for color, fill, and stroke paint... (diff)
downloadinkscape-7663e55d418b5ea8765421c9570dba40f6bd97fd.tar.gz
inkscape-7663e55d418b5ea8765421c9570dba40f6bd97fd.zip
shared_ptr -> ptr_shared
(bzr r240)
Diffstat (limited to 'src')
-rw-r--r--src/debug/event.h12
-rw-r--r--src/debug/gc-heap.h2
-rw-r--r--src/debug/heap.h2
-rw-r--r--src/debug/logger.cpp8
-rw-r--r--src/debug/simple-event.h6
-rw-r--r--src/debug/sysv-heap.h2
-rw-r--r--src/jabber_whiteboard/deserializer.cpp6
-rw-r--r--src/jabber_whiteboard/message-utilities.cpp2
-rw-r--r--src/jabber_whiteboard/message-utilities.h4
-rw-r--r--src/jabber_whiteboard/node-tracker-observer.h8
-rw-r--r--src/jabber_whiteboard/serializer.cpp8
-rw-r--r--src/jabber_whiteboard/serializer.h8
-rw-r--r--src/sp-object.cpp12
-rw-r--r--src/util/share.cpp6
-rw-r--r--src/util/share.h56
-rw-r--r--src/xml/attribute-record.h4
-rw-r--r--src/xml/comment-node.h2
-rw-r--r--src/xml/composite-node-observer.cpp8
-rw-r--r--src/xml/composite-node-observer.h8
-rw-r--r--src/xml/event.cpp16
-rw-r--r--src/xml/event.h16
-rw-r--r--src/xml/log-builder.cpp8
-rw-r--r--src/xml/log-builder.h8
-rw-r--r--src/xml/node-observer.h8
-rw-r--r--src/xml/repr-io.cpp10
-rw-r--r--src/xml/simple-node.cpp58
-rw-r--r--src/xml/simple-node.h2
-rw-r--r--src/xml/simple-session.cpp8
-rw-r--r--src/xml/simple-session.h8
-rw-r--r--src/xml/text-node.h2
30 files changed, 154 insertions, 154 deletions
diff --git a/src/debug/event.h b/src/debug/event.h
index 8232f890d..fdc50f225 100644
--- a/src/debug/event.h
+++ b/src/debug/event.h
@@ -37,23 +37,23 @@ public:
struct PropertyPair {
public:
PropertyPair() {}
- PropertyPair(Util::shared_ptr<char> n, Util::shared_ptr<char> v)
+ PropertyPair(Util::ptr_shared<char> n, Util::ptr_shared<char> v)
: name(n), value(v) {}
- PropertyPair(char const *n, Util::shared_ptr<char> v)
+ PropertyPair(char const *n, Util::ptr_shared<char> v)
: name(Util::share_string(n)), value(v) {}
- PropertyPair(Util::shared_ptr<char> n, char const *v)
+ PropertyPair(Util::ptr_shared<char> n, char const *v)
: name(n), value(Util::share_string(v)) {}
PropertyPair(char const *n, char const *v)
: name(Util::share_string(n)),
value(Util::share_string(v)) {}
- Util::shared_ptr<char> name;
- Util::shared_ptr<char> value;
+ Util::ptr_shared<char> name;
+ Util::ptr_shared<char> value;
};
static Category category() { return OTHER; }
- virtual Util::shared_ptr<char> name() const=0;
+ virtual Util::ptr_shared<char> name() const=0;
virtual unsigned propertyCount() const=0;
virtual PropertyPair property(unsigned property) const=0;
};
diff --git a/src/debug/gc-heap.h b/src/debug/gc-heap.h
index 75a60158e..4d0343f12 100644
--- a/src/debug/gc-heap.h
+++ b/src/debug/gc-heap.h
@@ -23,7 +23,7 @@ public:
int features() const {
return SIZE_AVAILABLE | USED_AVAILABLE | GARBAGE_COLLECTED;
}
- Util::shared_ptr<char> name() const {
+ Util::ptr_shared<char> name() const {
return Util::share_static_string("libgc");
}
Heap::Stats stats() const {
diff --git a/src/debug/heap.h b/src/debug/heap.h
index ef563030f..f3cc250a5 100644
--- a/src/debug/heap.h
+++ b/src/debug/heap.h
@@ -36,7 +36,7 @@ public:
virtual int features() const=0;
- virtual Util::shared_ptr<char> name() const=0;
+ virtual Util::ptr_shared<char> name() const=0;
virtual Stats stats() const=0;
virtual void force_collect()=0;
};
diff --git a/src/debug/logger.cpp b/src/debug/logger.cpp
index 3acd95ff5..a3f6899ef 100644
--- a/src/debug/logger.cpp
+++ b/src/debug/logger.cpp
@@ -25,7 +25,7 @@ bool Logger::_category_mask[Event::N_CATEGORIES];
namespace {
-static void write_escaped_value(std::ostream &os, Util::shared_ptr<char> value) {
+static void write_escaped_value(std::ostream &os, Util::ptr_shared<char> value) {
for ( char const *current=value ; *current ; ++current ) {
switch (*current) {
case '&':
@@ -57,7 +57,7 @@ static void write_indent(std::ostream &os, unsigned depth) {
static std::ofstream log_stream;
static bool empty_tag=false;
-typedef std::vector<Util::shared_ptr<char>, GC::Alloc<Util::shared_ptr<char>, GC::MANUAL> > TagStack;
+typedef std::vector<Util::ptr_shared<char>, GC::Alloc<Util::ptr_shared<char>, GC::MANUAL> > TagStack;
static TagStack &tag_stack() {
static TagStack stack;
return stack;
@@ -136,7 +136,7 @@ void Logger::init() {
}
void Logger::_start(Event const &event) {
- Util::shared_ptr<char> name=event.name();
+ Util::ptr_shared<char> name=event.name();
if (empty_tag) {
log_stream << ">\n";
@@ -161,7 +161,7 @@ void Logger::_start(Event const &event) {
}
void Logger::_skip() {
- tag_stack().push_back(Util::shared_ptr<char>());
+ tag_stack().push_back(Util::ptr_shared<char>());
}
void Logger::_finish() {
diff --git a/src/debug/simple-event.h b/src/debug/simple-event.h
index 90eed3a0e..3695eaa6a 100644
--- a/src/debug/simple-event.h
+++ b/src/debug/simple-event.h
@@ -21,17 +21,17 @@ namespace Debug {
template <Event::Category C=Event::OTHER>
class SimpleEvent : public Event {
public:
- SimpleEvent(Util::shared_ptr<char> name) : _name(name) {}
+ SimpleEvent(Util::ptr_shared<char> name) : _name(name) {}
SimpleEvent(char const *name) : _name(Util::share_string(name)) {}
static Category category() { return C; }
- Util::shared_ptr<char> name() const { return _name; }
+ Util::ptr_shared<char> name() const { return _name; }
unsigned propertyCount() const { return 0; }
PropertyPair property(unsigned property) const { return PropertyPair(); }
private:
- Util::shared_ptr<char> _name;
+ Util::ptr_shared<char> _name;
};
}
diff --git a/src/debug/sysv-heap.h b/src/debug/sysv-heap.h
index 840afac32..82fe9b769 100644
--- a/src/debug/sysv-heap.h
+++ b/src/debug/sysv-heap.h
@@ -23,7 +23,7 @@ public:
int features() const;
- Util::shared_ptr<char> name() const {
+ Util::ptr_shared<char> name() const {
return Util::share_static_string("standard malloc()");
}
Stats stats() const;
diff --git a/src/jabber_whiteboard/deserializer.cpp b/src/jabber_whiteboard/deserializer.cpp
index 2df35e8ab..0e207122f 100644
--- a/src/jabber_whiteboard/deserializer.cpp
+++ b/src/jabber_whiteboard/deserializer.cpp
@@ -284,7 +284,7 @@ Deserializer::deserializeEventChgContent(Glib::ustring const& msg)
{
// 1. Extract required attributes: node ID. If we do not know these, return.
std::string id;
- Util::shared_ptr<char> oldval, newval;
+ Util::ptr_shared<char> oldval, newval;
Node buf;
buf.tag = MESSAGE_ID;
@@ -344,7 +344,7 @@ Deserializer::deserializeEventChgAttr(Glib::ustring const& msg)
// 2. Extract optional attributes: new value. If we do not find it in the message,
// assume there is no new value.
buf.tag = MESSAGE_NEWVAL;
- Util::shared_ptr<char> newval;
+ Util::ptr_shared<char> newval;
if (MessageUtilities::findTag(buf, msg)) {
newval = Util::share_string(buf.data.c_str());
} else {
@@ -354,7 +354,7 @@ Deserializer::deserializeEventChgAttr(Glib::ustring const& msg)
// 3. Extract optional attributes: old value. If we do not find it in the message,
// assume that there is no old value.
buf.tag = MESSAGE_OLDVAL;
- Util::shared_ptr<char> oldval;
+ Util::ptr_shared<char> oldval;
if (MessageUtilities::findTag(buf, msg)) {
oldval = Util::share_string(buf.data.c_str());
} else {
diff --git a/src/jabber_whiteboard/message-utilities.cpp b/src/jabber_whiteboard/message-utilities.cpp
index 2812e303b..c10521b61 100644
--- a/src/jabber_whiteboard/message-utilities.cpp
+++ b/src/jabber_whiteboard/message-utilities.cpp
@@ -297,7 +297,7 @@ MessageUtilities::objectDeleteMessage(Glib::ustring* msgbuf, XMLNodeTracker* xmt
}
void
-MessageUtilities::contentChangeMessage(Glib::ustring& msgbuf, std::string const nodeid, Util::shared_ptr<char> old_value, Util::shared_ptr<char> new_value)
+MessageUtilities::contentChangeMessage(Glib::ustring& msgbuf, std::string const nodeid, Util::ptr_shared<char> old_value, Util::ptr_shared<char> new_value)
{
if (!nodeid.empty()) {
// <MESSAGE_NODECONTENT>
diff --git a/src/jabber_whiteboard/message-utilities.h b/src/jabber_whiteboard/message-utilities.h
index 8fbefac18..c6d464f08 100644
--- a/src/jabber_whiteboard/message-utilities.h
+++ b/src/jabber_whiteboard/message-utilities.h
@@ -27,7 +27,7 @@ namespace Inkscape {
namespace Util {
template <typename T>
-class shared_ptr;
+class ptr_shared;
}
@@ -47,7 +47,7 @@ public:
static void newObjectMessage(ustring* msgbuf, KeyToNodeMap& newidsbuf, NodeToKeyMap& newnodesbuf, NewChildObjectMessageList& childmsgbuf, XMLNodeTracker* xmt, Inkscape::XML::Node const* node, bool only_collect_nodes = false, bool collect_children = true);
static void objectChangeMessage(ustring* msgbuf, XMLNodeTracker* xmt, std::string const id, gchar const* key, gchar const* oldval, gchar const* newval, bool is_interactive);
static void objectDeleteMessage(ustring* msgbuf, XMLNodeTracker* xmt, Inkscape::XML::Node const& parent, Inkscape::XML::Node const& child, Inkscape::XML::Node const* prev);
- static void contentChangeMessage(ustring& msgbuf, std::string const nodeid, Util::shared_ptr<char> old_value, Util::shared_ptr<char> new_value);
+ static void contentChangeMessage(ustring& msgbuf, std::string const nodeid, Util::ptr_shared<char> old_value, Util::ptr_shared<char> new_value);
static void childOrderChangeMessage(ustring& msgbuf, std::string const childid, std::string const oldprevid, std::string const newprevid);
// Message parsing utilities
diff --git a/src/jabber_whiteboard/node-tracker-observer.h b/src/jabber_whiteboard/node-tracker-observer.h
index a3260d8a0..86aa5c304 100644
--- a/src/jabber_whiteboard/node-tracker-observer.h
+++ b/src/jabber_whiteboard/node-tracker-observer.h
@@ -45,12 +45,12 @@ public:
XML::Node *old_prev, XML::Node *new_prev)=0;
virtual void notifyContentChanged(XML::Node &node,
- Util::shared_ptr<char> old_content,
- Util::shared_ptr<char> new_content)=0;
+ Util::ptr_shared<char> old_content,
+ Util::ptr_shared<char> new_content)=0;
virtual void notifyAttributeChanged(XML::Node &node, GQuark name,
- Util::shared_ptr<char> old_value,
- Util::shared_ptr<char> new_value)=0;
+ Util::ptr_shared<char> old_value,
+ Util::ptr_shared<char> new_value)=0;
// ...but we do provide node tracking facilities
diff --git a/src/jabber_whiteboard/serializer.cpp b/src/jabber_whiteboard/serializer.cpp
index eb5278047..094944257 100644
--- a/src/jabber_whiteboard/serializer.cpp
+++ b/src/jabber_whiteboard/serializer.cpp
@@ -91,11 +91,11 @@ Serializer::_newObjectEventHelper(XML::Node& node, XML::Node& child, XML::Node*
Inkscape::Util::List<Inkscape::XML::AttributeRecord const> attrlist = child.attributeList();
for(; attrlist; attrlist++) {
- this->notifyAttributeChanged(child, attrlist->key, Util::shared_ptr<char>(), attrlist->value);
+ this->notifyAttributeChanged(child, attrlist->key, Util::ptr_shared<char>(), attrlist->value);
}
if (child.content()) {
- this->notifyContentChanged(child, Util::shared_ptr<char>(), Util::share_string(child.content()));
+ this->notifyContentChanged(child, Util::ptr_shared<char>(), Util::share_string(child.content()));
}
this->_attributes_scanned.insert(childid);
@@ -188,7 +188,7 @@ Serializer::notifyChildOrderChanged(XML::Node& node, XML::Node& child, XML::Node
}
void
-Serializer::notifyContentChanged(XML::Node& node, Util::shared_ptr<char> old_content, Util::shared_ptr<char> new_content)
+Serializer::notifyContentChanged(XML::Node& node, Util::ptr_shared<char> old_content, Util::ptr_shared<char> new_content)
{
// 1. Find the ID of the node, or generate it if it does not exist.
std::string nodeid = this->_findOrGenerateNodeID(node);
@@ -221,7 +221,7 @@ Serializer::notifyContentChanged(XML::Node& node, Util::shared_ptr<char> old_con
}
void
-Serializer::notifyAttributeChanged(XML::Node& node, GQuark name, Util::shared_ptr<char> old_value, Util::shared_ptr<char> new_value)
+Serializer::notifyAttributeChanged(XML::Node& node, GQuark name, Util::ptr_shared<char> old_value, Util::ptr_shared<char> new_value)
{
// 1. Find the ID of the node that has had an attribute modified, or generate it if it
// does not exist.
diff --git a/src/jabber_whiteboard/serializer.h b/src/jabber_whiteboard/serializer.h
index 16889c571..2884d43d3 100644
--- a/src/jabber_whiteboard/serializer.h
+++ b/src/jabber_whiteboard/serializer.h
@@ -39,12 +39,12 @@ public:
XML::Node *old_prev, XML::Node *new_prev);
void notifyContentChanged(XML::Node &node,
- Util::shared_ptr<char> old_content,
- Util::shared_ptr<char> new_content);
+ Util::ptr_shared<char> old_content,
+ Util::ptr_shared<char> new_content);
void notifyAttributeChanged(XML::Node &node, GQuark name,
- Util::shared_ptr<char> old_value,
- Util::shared_ptr<char> new_value);
+ Util::ptr_shared<char> old_value,
+ Util::ptr_shared<char> new_value);
void synthesizeChildNodeAddEvents();
diff --git a/src/sp-object.cpp b/src/sp-object.cpp
index 5f6bf779f..9068c4ba2 100644
--- a/src/sp-object.cpp
+++ b/src/sp-object.cpp
@@ -227,16 +227,16 @@ sp_object_finalize(GObject *object)
namespace {
-Inkscape::Util::shared_ptr<char> stringify(SPObject *obj) {
+Inkscape::Util::ptr_shared<char> stringify(SPObject *obj) {
char *temp=g_strdup_printf("%p", obj);
- Inkscape::Util::shared_ptr<char> result=Inkscape::Util::share_string(temp);
+ Inkscape::Util::ptr_shared<char> result=Inkscape::Util::share_string(temp);
g_free(temp);
return result;
}
-Inkscape::Util::shared_ptr<char> stringify(unsigned n) {
+Inkscape::Util::ptr_shared<char> stringify(unsigned n) {
char *temp=g_strdup_printf("%u", n);
- Inkscape::Util::shared_ptr<char> result=Inkscape::Util::share_string(temp);
+ Inkscape::Util::ptr_shared<char> result=Inkscape::Util::share_string(temp);
g_free(temp);
return result;
}
@@ -252,7 +252,7 @@ public:
static Category category() { return REFCOUNT; }
- Inkscape::Util::shared_ptr<char> name() const {
+ Inkscape::Util::ptr_shared<char> name() const {
if ( _type == REF) {
return Inkscape::Util::share_static_string("sp-object-ref");
} else {
@@ -272,7 +272,7 @@ public:
}
private:
- Inkscape::Util::shared_ptr<char> _object;
+ Inkscape::Util::ptr_shared<char> _object;
unsigned _refcount;
Type _type;
};
diff --git a/src/util/share.cpp b/src/util/share.cpp
index 7f2d09bf6..2f693fac9 100644
--- a/src/util/share.cpp
+++ b/src/util/share.cpp
@@ -1,5 +1,5 @@
/*
- * Inkscape::Util::shared_ptr<T> - like T const *, but stronger
+ * Inkscape::Util::ptr_shared<T> - like T const *, but stronger
*
* Authors:
* MenTaLguY <mental@rydia.net>
@@ -15,12 +15,12 @@
namespace Inkscape {
namespace Util {
-shared_ptr<char> share_string(char const *string) {
+ptr_shared<char> share_string(char const *string) {
g_return_val_if_fail(string != NULL, share_unsafe<char>(NULL));
return share_string(string, std::strlen(string));
}
-shared_ptr<char> share_string(char const *string, std::size_t length) {
+ptr_shared<char> share_string(char const *string, std::size_t length) {
g_return_val_if_fail(string != NULL, share_unsafe<char>(NULL));
char *new_string=new (GC::ATOMIC) char[length+1];
std::memcpy(new_string, string, length);
diff --git a/src/util/share.h b/src/util/share.h
index 93cef7a02..3a2b73561 100644
--- a/src/util/share.h
+++ b/src/util/share.h
@@ -1,5 +1,5 @@
/*
- * Inkscape::Util::shared_ptr<T> - like T const *, but stronger
+ * Inkscape::Util::ptr_shared<T> - like T const *, but stronger
*
* Authors:
* MenTaLguY <mental@rydia.net>
@@ -19,12 +19,12 @@ namespace Inkscape {
namespace Util {
template <typename T>
-class shared_ptr {
+class ptr_shared {
public:
- shared_ptr() : _obj(NULL) {}
+ ptr_shared() : _obj(NULL) {}
template <typename T1>
- shared_ptr(shared_ptr<T1> const &other) : _obj(other._obj) {}
+ ptr_shared(ptr_shared<T1> const &other) : _obj(other._obj) {}
T const *pointer() const { return _obj; }
@@ -37,98 +37,98 @@ public:
T const *operator->() const { return _obj; }
T const &operator[](int i) const { return _obj[i]; }
- shared_ptr<T> operator+(int i) const {
+ ptr_shared<T> operator+(int i) const {
return share_unsafe(_obj+i);
}
- shared_ptr<T> operator-(int i) const {
+ ptr_shared<T> operator-(int i) const {
return share_unsafe(_obj-i);
}
- shared_ptr<T> &operator+=(int i) const {
+ ptr_shared<T> &operator+=(int i) const {
_obj += i;
return *this;
}
- shared_ptr<T> &operator-=(int i) const {
+ ptr_shared<T> &operator-=(int i) const {
_obj -= i;
return *this;
}
template <typename T1>
- std::ptrdiff_t operator-(shared_ptr<T1> const &other) {
+ std::ptrdiff_t operator-(ptr_shared<T1> const &other) {
return _obj - other._obj;
}
template <typename T1>
- shared_ptr<T> &operator=(shared_ptr<T1> const &other) {
+ ptr_shared<T> &operator=(ptr_shared<T1> const &other) {
_obj = other._obj;
return *this;
}
template <typename T1>
- bool operator==(shared_ptr<T1> const &other) const {
+ bool operator==(ptr_shared<T1> const &other) const {
return _obj == other._obj;
}
template <typename T1>
- bool operator!=(shared_ptr<T1> const &other) const {
+ bool operator!=(ptr_shared<T1> const &other) const {
return _obj != other._obj;
}
template <typename T1>
- bool operator>(shared_ptr<T1> const &other) const {
+ bool operator>(ptr_shared<T1> const &other) const {
return _obj > other._obj;
}
template <typename T1>
- bool operator<(shared_ptr<T1> const &other) const {
+ bool operator<(ptr_shared<T1> const &other) const {
return _obj < other._obj;
}
- static shared_ptr<T> share_unsafe(T const *obj) {
- return shared_ptr<T>(obj);
+ static ptr_shared<T> share_unsafe(T const *obj) {
+ return ptr_shared<T>(obj);
}
protected:
- explicit shared_ptr(T const *obj) : _obj(obj) {}
+ explicit ptr_shared(T const *obj) : _obj(obj) {}
private:
T const *_obj;
};
template <typename T>
-inline shared_ptr<T> share(T const *obj) {
+inline ptr_shared<T> share(T const *obj) {
return share_unsafe(obj ? new T(*obj) : NULL);
}
-shared_ptr<char> share_string(char const *string);
-shared_ptr<char> share_string(char const *string, std::size_t length);
+ptr_shared<char> share_string(char const *string);
+ptr_shared<char> share_string(char const *string, std::size_t length);
template <typename T>
-inline shared_ptr<T> reshare(T const *obj) {
- return shared_ptr<T>::share_unsafe(obj);
+inline ptr_shared<T> reshare(T const *obj) {
+ return ptr_shared<T>::share_unsafe(obj);
}
template <typename T>
-inline shared_ptr<T> share_unsafe(T const *obj) {
- return shared_ptr<T>::share_unsafe(obj);
+inline ptr_shared<T> share_unsafe(T const *obj) {
+ return ptr_shared<T>::share_unsafe(obj);
}
-inline shared_ptr<char> share_static_string(char const *string) {
+inline ptr_shared<char> share_static_string(char const *string) {
return share_unsafe(string);
}
template <typename T1, typename T2>
-inline shared_ptr<T1> static_cast_shared(shared_ptr<T2> const &ref) {
+inline ptr_shared<T1> static_cast_shared(ptr_shared<T2> const &ref) {
return reshare(static_cast<T1 const *>(ref.pointer()));
}
template <typename T1, typename T2>
-inline shared_ptr<T1> dynamic_cast_shared(shared_ptr<T2> const &ref) {
+inline ptr_shared<T1> dynamic_cast_shared(ptr_shared<T2> const &ref) {
return reshare(dynamic_cast<T1 const *>(ref.pointer()));
}
template <typename T1, typename T2>
-inline shared_ptr<T1> reinterpret_cast_shared(shared_ptr<T2> const &ref) {
+inline ptr_shared<T1> reinterpret_cast_shared(ptr_shared<T2> const &ref) {
return reshare(reinterpret_cast<T1 const *>(ref.pointer()));
}
diff --git a/src/xml/attribute-record.h b/src/xml/attribute-record.h
index 30d8576d0..bfae19e21 100644
--- a/src/xml/attribute-record.h
+++ b/src/xml/attribute-record.h
@@ -13,11 +13,11 @@ namespace Inkscape {
namespace XML {
struct AttributeRecord : public Inkscape::GC::Managed<> {
- AttributeRecord(GQuark k, Inkscape::Util::shared_ptr<char> v)
+ AttributeRecord(GQuark k, Inkscape::Util::ptr_shared<char> v)
: key(k), value(v) {}
GQuark key;
- Inkscape::Util::shared_ptr<char> value;
+ Inkscape::Util::ptr_shared<char> value;
// accept default copy constructor and assignment operator
};
diff --git a/src/xml/comment-node.h b/src/xml/comment-node.h
index e41a36b59..c439d0d54 100644
--- a/src/xml/comment-node.h
+++ b/src/xml/comment-node.h
@@ -23,7 +23,7 @@ namespace Inkscape {
namespace XML {
struct CommentNode : public SimpleNode {
- explicit CommentNode(Util::shared_ptr<char> content)
+ explicit CommentNode(Util::ptr_shared<char> content)
: SimpleNode(g_quark_from_static_string("comment"))
{
setContent(content);
diff --git a/src/xml/composite-node-observer.cpp b/src/xml/composite-node-observer.cpp
index b564da78d..bb68ba9c4 100644
--- a/src/xml/composite-node-observer.cpp
+++ b/src/xml/composite-node-observer.cpp
@@ -66,7 +66,7 @@ void CompositeNodeObserver::notifyChildOrderChanged(Node &node, Node &child,
void CompositeNodeObserver::notifyContentChanged(
Node &node,
- Util::shared_ptr<char> old_content, Util::shared_ptr<char> new_content
+ Util::ptr_shared<char> old_content, Util::ptr_shared<char> new_content
) {
_startIteration();
for ( ObserverRecordList::iterator iter=_active.begin() ;
@@ -81,7 +81,7 @@ void CompositeNodeObserver::notifyContentChanged(
void CompositeNodeObserver::notifyAttributeChanged(
Node &node, GQuark name,
- Util::shared_ptr<char> old_value, Util::shared_ptr<char> new_value
+ Util::ptr_shared<char> old_value, Util::ptr_shared<char> new_value
) {
_startIteration();
for ( ObserverRecordList::iterator iter=_active.begin() ;
@@ -130,13 +130,13 @@ public:
}
}
- void notifyContentChanged(Node &node, Util::shared_ptr<char> old_content, Util::shared_ptr<char> new_content) {
+ void notifyContentChanged(Node &node, Util::ptr_shared<char> old_content, Util::ptr_shared<char> new_content) {
if (vector.content_changed) {
vector.content_changed(&node, old_content, new_content, data);
}
}
- void notifyAttributeChanged(Node &node, GQuark name, Util::shared_ptr<char> old_value, Util::shared_ptr<char> new_value) {
+ void notifyAttributeChanged(Node &node, GQuark name, Util::ptr_shared<char> old_value, Util::ptr_shared<char> new_value) {
if (vector.attr_changed) {
vector.attr_changed(&node, g_quark_to_string(name), old_value, new_value, false, data);
}
diff --git a/src/xml/composite-node-observer.h b/src/xml/composite-node-observer.h
index 4acde0b4c..7b5a24d53 100644
--- a/src/xml/composite-node-observer.h
+++ b/src/xml/composite-node-observer.h
@@ -51,12 +51,12 @@ public:
Node *old_prev, Node *new_prev);
void notifyContentChanged(Node &node,
- Util::shared_ptr<char> old_content,
- Util::shared_ptr<char> new_content);
+ Util::ptr_shared<char> old_content,
+ Util::ptr_shared<char> new_content);
void notifyAttributeChanged(Node &node, GQuark name,
- Util::shared_ptr<char> old_value,
- Util::shared_ptr<char> new_value);
+ Util::ptr_shared<char> old_value,
+ Util::ptr_shared<char> new_value);
private:
unsigned _iterating;
diff --git a/src/xml/event.cpp b/src/xml/event.cpp
index dd7167874..d91dd681f 100644
--- a/src/xml/event.cpp
+++ b/src/xml/event.cpp
@@ -114,15 +114,15 @@ public:
}
void notifyAttributeChanged(Node &node, GQuark name,
- Inkscape::Util::shared_ptr<char> old_value,
- Inkscape::Util::shared_ptr<char> new_value)
+ Inkscape::Util::ptr_shared<char> old_value,
+ Inkscape::Util::ptr_shared<char> new_value)
{
node.setAttribute(g_quark_to_string(name), new_value);
}
void notifyContentChanged(Node &node,
- Inkscape::Util::shared_ptr<char> old_value,
- Inkscape::Util::shared_ptr<char> new_value)
+ Inkscape::Util::ptr_shared<char> old_value,
+ Inkscape::Util::ptr_shared<char> new_value)
{
node.setContent(new_value);
}
@@ -458,8 +458,8 @@ public:
}
void notifyAttributeChanged(Node &node, GQuark name,
- Inkscape::Util::shared_ptr<char> old_value,
- Inkscape::Util::shared_ptr<char> new_value)
+ Inkscape::Util::ptr_shared<char> old_value,
+ Inkscape::Util::ptr_shared<char> new_value)
{
if (new_value) {
g_warning("Event: Set attribute %s to \"%s\" on %s", g_quark_to_string(name), new_value.pointer(), node_to_string(node).c_str());
@@ -469,8 +469,8 @@ public:
}
void notifyContentChanged(Node &node,
- Inkscape::Util::shared_ptr<char> old_value,
- Inkscape::Util::shared_ptr<char> new_value)
+ Inkscape::Util::ptr_shared<char> old_value,
+ Inkscape::Util::ptr_shared<char> new_value)
{
if (new_value) {
g_warning("Event: Set content of %s to \"%s\"", node_to_string(node).c_str(), new_value.pointer());
diff --git a/src/xml/event.h b/src/xml/event.h
index 56fdb8bb6..59dbe7c7b 100644
--- a/src/xml/event.h
+++ b/src/xml/event.h
@@ -96,15 +96,15 @@ private:
class EventChgAttr : public Event {
public:
EventChgAttr(Node *repr, GQuark k,
- Inkscape::Util::shared_ptr<char> ov,
- Inkscape::Util::shared_ptr<char> nv,
+ Inkscape::Util::ptr_shared<char> ov,
+ Inkscape::Util::ptr_shared<char> nv,
Event *next)
: Event(repr, next), key(k),
oldval(ov), newval(nv) {}
GQuark key;
- Inkscape::Util::shared_ptr<char> oldval;
- Inkscape::Util::shared_ptr<char> newval;
+ Inkscape::Util::ptr_shared<char> oldval;
+ Inkscape::Util::ptr_shared<char> newval;
private:
Event *_optimizeOne();
@@ -115,13 +115,13 @@ private:
class EventChgContent : public Event {
public:
EventChgContent(Node *repr,
- Inkscape::Util::shared_ptr<char> ov,
- Inkscape::Util::shared_ptr<char> nv,
+ Inkscape::Util::ptr_shared<char> ov,
+ Inkscape::Util::ptr_shared<char> nv,
Event *next)
: Event(repr, next), oldval(ov), newval(nv) {}
- Inkscape::Util::shared_ptr<char> oldval;
- Inkscape::Util::shared_ptr<char> newval;
+ Inkscape::Util::ptr_shared<char> oldval;
+ Inkscape::Util::ptr_shared<char> newval;
private:
Event *_optimizeOne();
diff --git a/src/xml/log-builder.cpp b/src/xml/log-builder.cpp
index 97451075a..e8b7c707e 100644
--- a/src/xml/log-builder.cpp
+++ b/src/xml/log-builder.cpp
@@ -48,16 +48,16 @@ void LogBuilder::setChildOrder(Node &node, Node &child,
}
void LogBuilder::setContent(Node &node,
- Util::shared_ptr<char> old_content,
- Util::shared_ptr<char> new_content)
+ Util::ptr_shared<char> old_content,
+ Util::ptr_shared<char> new_content)
{
_log = new Inkscape::XML::EventChgContent(&node, old_content, new_content, _log);
_log = _log->optimizeOne();
}
void LogBuilder::setAttribute(Node &node, GQuark name,
- Util::shared_ptr<char> old_value,
- Util::shared_ptr<char> new_value)
+ Util::ptr_shared<char> old_value,
+ Util::ptr_shared<char> new_value)
{
_log = new Inkscape::XML::EventChgAttr(&node, name, old_value, new_value, _log);
_log = _log->optimizeOne();
diff --git a/src/xml/log-builder.h b/src/xml/log-builder.h
index dc68a4f4a..478bf295f 100644
--- a/src/xml/log-builder.h
+++ b/src/xml/log-builder.h
@@ -39,12 +39,12 @@ public:
Node *old_prev, Node *new_prev);
void setContent(Node &node,
- Util::shared_ptr<char> old_content,
- Util::shared_ptr<char> new_content);
+ Util::ptr_shared<char> old_content,
+ Util::ptr_shared<char> new_content);
void setAttribute(Node &node, GQuark name,
- Util::shared_ptr<char> old_value,
- Util::shared_ptr<char> new_value);
+ Util::ptr_shared<char> old_value,
+ Util::ptr_shared<char> new_value);
private:
Event *_log;
diff --git a/src/xml/node-observer.h b/src/xml/node-observer.h
index e50a41dd8..584505e4e 100644
--- a/src/xml/node-observer.h
+++ b/src/xml/node-observer.h
@@ -43,12 +43,12 @@ public:
Node *old_prev, Node *new_prev)=0;
virtual void notifyContentChanged(Node &node,
- Util::shared_ptr<char> old_content,
- Util::shared_ptr<char> new_content)=0;
+ Util::ptr_shared<char> old_content,
+ Util::ptr_shared<char> new_content)=0;
virtual void notifyAttributeChanged(Node &node, GQuark name,
- Util::shared_ptr<char> old_value,
- Util::shared_ptr<char> new_value)=0;
+ Util::ptr_shared<char> old_value,
+ Util::ptr_shared<char> new_value)=0;
};
}
diff --git a/src/xml/repr-io.cpp b/src/xml/repr-io.cpp
index 884bb3360..c3222e4ae 100644
--- a/src/xml/repr-io.cpp
+++ b/src/xml/repr-io.cpp
@@ -585,7 +585,7 @@ repr_quote_write (Writer &out, const gchar * val)
namespace {
typedef std::map<Glib::QueryQuark, gchar const *, Inkscape::compare_quark_ids> LocalNameMap;
-typedef std::map<Glib::QueryQuark, Inkscape::Util::shared_ptr<char>, Inkscape::compare_quark_ids> NSMap;
+typedef std::map<Glib::QueryQuark, Inkscape::Util::ptr_shared<char>, Inkscape::compare_quark_ids> NSMap;
gchar const *qname_local_name(Glib::QueryQuark qname) {
static LocalNameMap local_name_map;
@@ -604,7 +604,7 @@ gchar const *qname_local_name(Glib::QueryQuark qname) {
}
void add_ns_map_entry(NSMap &ns_map, Glib::QueryQuark prefix) {
- using Inkscape::Util::shared_ptr;
+ using Inkscape::Util::ptr_shared;
using Inkscape::Util::share_unsafe;
static const Glib::QueryQuark xml_prefix("xml");
@@ -619,7 +619,7 @@ void add_ns_map_entry(NSMap &ns_map, Glib::QueryQuark prefix) {
g_warning("No namespace known for normalized prefix %s", g_quark_to_string(prefix));
}
} else {
- ns_map.insert(NSMap::value_type(prefix, shared_ptr<char>()));
+ ns_map.insert(NSMap::value_type(prefix, ptr_shared<char>()));
}
}
}
@@ -648,7 +648,7 @@ void populate_ns_map(NSMap &ns_map, Node &repr) {
void
sp_repr_write_stream_root_element (Node *repr, Writer &out, gboolean add_whitespace, gchar const *default_ns)
{
- using Inkscape::Util::shared_ptr;
+ using Inkscape::Util::ptr_shared;
g_assert(repr != NULL);
Glib::QueryQuark xml_prefix=g_quark_from_static_string("xml");
@@ -664,7 +664,7 @@ sp_repr_write_stream_root_element (Node *repr, Writer &out, gboolean add_whitesp
for ( NSMap::iterator iter=ns_map.begin() ; iter != ns_map.end() ; ++iter )
{
Glib::QueryQuark prefix=(*iter).first;
- shared_ptr<char> ns_uri=(*iter).second;
+ ptr_shared<char> ns_uri=(*iter).second;
if (prefix.id()) {
if ( prefix != xml_prefix ) {
diff --git a/src/xml/simple-node.cpp b/src/xml/simple-node.cpp
index d83e5d54b..17339271f 100644
--- a/src/xml/simple-node.cpp
+++ b/src/xml/simple-node.cpp
@@ -28,7 +28,7 @@ namespace XML {
namespace {
-Util::shared_ptr<char> stringify_node(Node const &node) {
+Util::ptr_shared<char> stringify_node(Node const &node) {
gchar *string;
switch (node.type()) {
case ELEMENT_NODE: {
@@ -51,14 +51,14 @@ Util::shared_ptr<char> stringify_node(Node const &node) {
default:
string = g_strdup_printf("unknown(%p)", &node);
}
- Util::shared_ptr<char> result=Util::share_string(string);
+ Util::ptr_shared<char> result=Util::share_string(string);
g_free(string);
return result;
}
-Util::shared_ptr<char> stringify_unsigned(unsigned n) {
+Util::ptr_shared<char> stringify_unsigned(unsigned n) {
gchar *string = g_strdup_printf("%u", n);
- Util::shared_ptr<char> result=Util::share_string(string);
+ Util::ptr_shared<char> result=Util::share_string(string);
g_free(string);
return result;
}
@@ -75,7 +75,7 @@ public:
static Category category() { return XML; }
- Util::shared_ptr<char> name() const {
+ Util::ptr_shared<char> name() const {
return Util::share_static_string("add-child");
}
unsigned propertyCount() const { return 3; }
@@ -92,8 +92,8 @@ public:
}
}
private:
- Util::shared_ptr<char> _parent;
- Util::shared_ptr<char> _child;
+ Util::ptr_shared<char> _parent;
+ Util::ptr_shared<char> _child;
unsigned _position;
};
@@ -106,7 +106,7 @@ public:
static Category category() { return XML; }
- Util::shared_ptr<char> name() const {
+ Util::ptr_shared<char> name() const {
return Util::share_static_string("remove-child");
}
unsigned propertyCount() const { return 2; }
@@ -121,8 +121,8 @@ public:
}
}
private:
- Util::shared_ptr<char> _parent;
- Util::shared_ptr<char> _child;
+ Util::ptr_shared<char> _parent;
+ Util::ptr_shared<char> _child;
};
class DebugSetChildPosition : public Debug::Event {
@@ -140,7 +140,7 @@ public:
static Category category() { return XML; }
- Util::shared_ptr<char> name() const {
+ Util::ptr_shared<char> name() const {
return Util::share_static_string("set-child-position");
}
unsigned propertyCount() const { return 3; }
@@ -157,21 +157,21 @@ public:
}
}
private:
- Util::shared_ptr<char> _parent;
- Util::shared_ptr<char> _child;
+ Util::ptr_shared<char> _parent;
+ Util::ptr_shared<char> _child;
unsigned _position;
};
class DebugSetContent : public Debug::Event {
public:
DebugSetContent(Node const &node,
- Util::shared_ptr<char> old_content,
- Util::shared_ptr<char> new_content)
+ Util::ptr_shared<char> old_content,
+ Util::ptr_shared<char> new_content)
: _node(stringify_node(node)), _content(new_content) {}
static Category category() { return XML; }
- Util::shared_ptr<char> name() const {
+ Util::ptr_shared<char> name() const {
if (_content) {
return Util::share_static_string("set-content");
} else {
@@ -196,22 +196,22 @@ public:
}
}
private:
- Util::shared_ptr<char> _node;
- Util::shared_ptr<char> _content;
+ Util::ptr_shared<char> _node;
+ Util::ptr_shared<char> _content;
};
class DebugSetAttribute : public Debug::Event {
public:
DebugSetAttribute(Node const &node, GQuark name,
- Util::shared_ptr<char> old_value,
- Util::shared_ptr<char> new_value)
+ Util::ptr_shared<char> old_value,
+ Util::ptr_shared<char> new_value)
: _node(stringify_node(node)),
_name(Util::share_unsafe(g_quark_to_string(name))),
_value(new_value) {}
static Category category() { return XML; }
- Util::shared_ptr<char> name() const {
+ Util::ptr_shared<char> name() const {
if (_value) {
return Util::share_static_string("set-attribute");
} else {
@@ -239,12 +239,12 @@ public:
}
private:
- Util::shared_ptr<char> _node;
- Util::shared_ptr<char> _name;
- Util::shared_ptr<char> _value;
+ Util::ptr_shared<char> _node;
+ Util::ptr_shared<char> _name;
+ Util::ptr_shared<char> _value;
};
-using Inkscape::Util::shared_ptr;
+using Inkscape::Util::ptr_shared;
using Inkscape::Util::share_string;
using Inkscape::Util::share_unsafe;
using Inkscape::Util::share_static_string;
@@ -366,8 +366,8 @@ bool SimpleNode::matchAttributeName(gchar const *partial_name) const {
}
void SimpleNode::setContent(gchar const *content) {
- shared_ptr<char> old_content=_content;
- shared_ptr<char> new_content = ( content ? share_string(content) : shared_ptr<char>() );
+ ptr_shared<char> old_content=_content;
+ ptr_shared<char> new_content = ( content ? share_string(content) : ptr_shared<char>() );
Debug::EventTracker<DebugSetContent> tracker(
*this, old_content, new_content
@@ -402,9 +402,9 @@ SimpleNode::setAttribute(gchar const *name, gchar const *value, bool const is_in
Debug::EventTracker<> tracker;
- shared_ptr<char> old_value=( existing ? existing->value : shared_ptr<char>() );
+ ptr_shared<char> old_value=( existing ? existing->value : ptr_shared<char>() );
- shared_ptr<char> new_value=shared_ptr<char>();
+ ptr_shared<char> new_value=ptr_shared<char>();
if (value) {
new_value = share_string(value);
tracker.set<DebugSetAttribute>(*this, key, old_value, new_value);
diff --git a/src/xml/simple-node.h b/src/xml/simple-node.h
index f1cf78680..367516ee7 100644
--- a/src/xml/simple-node.h
+++ b/src/xml/simple-node.h
@@ -140,7 +140,7 @@ private:
Inkscape::Util::MutableList<AttributeRecord> _attributes;
- Inkscape::Util::shared_ptr<char> _content;
+ Inkscape::Util::ptr_shared<char> _content;
unsigned _child_count;
mutable bool _cached_positions_valid;
diff --git a/src/xml/simple-session.cpp b/src/xml/simple-session.cpp
index c8d873fd2..d5c17a540 100644
--- a/src/xml/simple-session.cpp
+++ b/src/xml/simple-session.cpp
@@ -88,8 +88,8 @@ void SimpleSession::notifyChildOrderChanged(Node &parent,
}
void SimpleSession::notifyContentChanged(Node &node,
- Util::shared_ptr<char> old_content,
- Util::shared_ptr<char> new_content)
+ Util::ptr_shared<char> old_content,
+ Util::ptr_shared<char> new_content)
{
if (_in_transaction) {
_log_builder.setContent(node, old_content, new_content);
@@ -98,8 +98,8 @@ void SimpleSession::notifyContentChanged(Node &node,
void SimpleSession::notifyAttributeChanged(Node &node,
GQuark name,
- Util::shared_ptr<char> old_value,
- Util::shared_ptr<char> new_value)
+ Util::ptr_shared<char> old_value,
+ Util::ptr_shared<char> new_value)
{
if (_in_transaction) {
_log_builder.setAttribute(node, name, old_value, new_value);
diff --git a/src/xml/simple-session.h b/src/xml/simple-session.h
index 9e3693d9a..ecd61ba08 100644
--- a/src/xml/simple-session.h
+++ b/src/xml/simple-session.h
@@ -52,12 +52,12 @@ public:
Inkscape::XML::Node *old_prev, Inkscape::XML::Node *new_prev);
void notifyContentChanged(Inkscape::XML::Node &node,
- Util::shared_ptr<char> old_content,
- Util::shared_ptr<char> new_content);
+ Util::ptr_shared<char> old_content,
+ Util::ptr_shared<char> new_content);
void notifyAttributeChanged(Inkscape::XML::Node &node, GQuark name,
- Util::shared_ptr<char> old_value,
- Util::shared_ptr<char> new_value);
+ Util::ptr_shared<char> old_value,
+ Util::ptr_shared<char> new_value);
private:
SimpleSession(SimpleSession const &); // no copy
diff --git a/src/xml/text-node.h b/src/xml/text-node.h
index bcd1c3e4f..bd6095f3b 100644
--- a/src/xml/text-node.h
+++ b/src/xml/text-node.h
@@ -23,7 +23,7 @@ namespace Inkscape {
namespace XML {
struct TextNode : public SimpleNode {
- TextNode(Util::shared_ptr<char> content)
+ TextNode(Util::ptr_shared<char> content)
: SimpleNode(g_quark_from_static_string("string"))
{
setContent(content);