diff --git a/src/jabber_whiteboard/inkboard-document.cpp b/src/jabber_whiteboard/inkboard-document.cpp
index 9f3d8ce4293dac6fb59862965dec2df0ad85de0a..4b27d530a8f9db1402e942499382a8715c68cf39 100644 (file)
#include "xml/element-node.h"
#include "xml/text-node.h"
#include "xml/comment-node.h"
+#include "xml/pi-node.h"
#include "util/share.h"
#include "util/ucompose.hpp"
InkboardDocument::InkboardDocument(int code, State::SessionType sessionType,
Glib::ustring const& to)
-: XML::SimpleNode(code), sessionType(sessionType), recipient(to),
+: XML::SimpleNode(code, this), sessionType(sessionType), recipient(to),
_in_transaction(false)
{
_initBindings();
this->sm = &SessionManager::instance();
this->state = State::INITIAL;
this->tracker = new KeyNodeTable();
- _bindDocument(*this);
}
void
XML::Node*
InkboardDocument::createElement(char const* name)
{
- return new XML::ElementNode(g_quark_from_string(name));
+ return new XML::ElementNode(g_quark_from_string(name), this);
}
XML::Node*
InkboardDocument::createTextNode(char const* content)
{
- return new XML::TextNode(Util::share_string(content));
+ return new XML::TextNode(Util::share_string(content), this);
}
XML::Node*
InkboardDocument::createComment(char const* content)
{
- return new XML::CommentNode(Util::share_string(content));
+ return new XML::CommentNode(Util::share_string(content), this);
+}
+
+XML::Node*
+InkboardDocument::createPI(char const *target, char const* content)
+{
+ return new XML::PINode(g_quark_from_string(target), Util::share_string(content), this);
}
-void InkboardDocument::notifyChildAdded(XML::Node &parent,
+
+void InkboardDocument::notifyChildAdded(XML::Node &/*parent*/,
XML::Node &child,
- XML::Node *prev)
+ XML::Node */*prev*/)
{
if (_in_transaction && state == State::IN_WHITEBOARD) {
}
}
-void InkboardDocument::notifyChildRemoved(XML::Node &parent,
+void InkboardDocument::notifyChildRemoved(XML::Node &/*parent*/,
XML::Node &child,
- XML::Node *prev)
+ XML::Node */*prev*/)
{
if (_in_transaction && state == State::IN_WHITEBOARD)
{
void InkboardDocument::notifyChildOrderChanged(XML::Node &parent,
XML::Node &child,
- XML::Node *old_prev,
- XML::Node *new_prev)
+ XML::Node */*old_prev*/,
+ XML::Node */*new_prev*/)
{
if (_in_transaction && state == State::IN_WHITEBOARD)
{
- XML::Node *element = (XML::Node *)&child;
- XML::Node *parentElement = (XML::Node *)&parent;
-
- unsigned int index = parentElement->_childPosition(*element);
+ unsigned int index = child.position();
Message::Message message = String::ucompose(Vars::MOVE_MESSAGE,
- tracker->get(element),index);
+ tracker->get(&child),index);
send(getRecipient(),Message::MOVE,message);
}
}
void InkboardDocument::notifyContentChanged(XML::Node &node,
- Util::ptr_shared<char> old_content,
+ Util::ptr_shared<char> /*old_content*/,
Util::ptr_shared<char> new_content)
{
if (_in_transaction && state == State::IN_WHITEBOARD)
void InkboardDocument::notifyAttributeChanged(XML::Node &node,
GQuark name,
- Util::ptr_shared<char> old_value,
+ Util::ptr_shared<char> /*old_value*/,
Util::ptr_shared<char> new_value)
{
if (_in_transaction && state == State::IN_WHITEBOARD)