diff options
| author | MenTaLguY <mental@rydia.net> | 2006-03-15 03:22:23 +0000 |
|---|---|---|
| committer | mental <mental@users.sourceforge.net> | 2006-03-15 03:22:23 +0000 |
| commit | 7663e55d418b5ea8765421c9570dba40f6bd97fd (patch) | |
| tree | 74e9eef28e3553010bb121dc4eba4cb5b59d05ff /src/xml | |
| parent | differentiate _hreffed and _listening flags for color, fill, and stroke paint... (diff) | |
| download | inkscape-7663e55d418b5ea8765421c9570dba40f6bd97fd.tar.gz inkscape-7663e55d418b5ea8765421c9570dba40f6bd97fd.zip | |
shared_ptr -> ptr_shared
(bzr r240)
Diffstat (limited to 'src/xml')
| -rw-r--r-- | src/xml/attribute-record.h | 4 | ||||
| -rw-r--r-- | src/xml/comment-node.h | 2 | ||||
| -rw-r--r-- | src/xml/composite-node-observer.cpp | 8 | ||||
| -rw-r--r-- | src/xml/composite-node-observer.h | 8 | ||||
| -rw-r--r-- | src/xml/event.cpp | 16 | ||||
| -rw-r--r-- | src/xml/event.h | 16 | ||||
| -rw-r--r-- | src/xml/log-builder.cpp | 8 | ||||
| -rw-r--r-- | src/xml/log-builder.h | 8 | ||||
| -rw-r--r-- | src/xml/node-observer.h | 8 | ||||
| -rw-r--r-- | src/xml/repr-io.cpp | 10 | ||||
| -rw-r--r-- | src/xml/simple-node.cpp | 58 | ||||
| -rw-r--r-- | src/xml/simple-node.h | 2 | ||||
| -rw-r--r-- | src/xml/simple-session.cpp | 8 | ||||
| -rw-r--r-- | src/xml/simple-session.h | 8 | ||||
| -rw-r--r-- | src/xml/text-node.h | 2 |
15 files changed, 83 insertions, 83 deletions
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); |
