1 /**
2 * Inkscape::Whiteboard::InkboardSession - Whiteboard implementation of XML::Session
3 *
4 * Authors:
5 * David Yip <yipdw@rose-hulman.edu>
6 *
7 * Copyright (c) 2005 Authors
8 *
9 * Released under GNU GPL, read the file 'COPYING' for more information
10 */
12 #include <glibmm.h>
13 #include <glib/gmessages.h>
14 #include <glib/gquark.h>
16 #include "jabber_whiteboard/inkboard-session.h"
18 #include "xml/node.h"
19 #include "xml/event.h"
20 #include "xml/element-node.h"
21 #include "xml/text-node.h"
22 #include "xml/comment-node.h"
24 #include "util/share.h"
26 namespace Inkscape {
28 namespace Whiteboard {
30 using XML::Node;
32 void
33 InkboardSession::beginTransaction()
34 {
35 g_assert(!_in_transaction);
36 _in_transaction = true;
37 }
39 void
40 InkboardSession::rollback()
41 {
42 g_assert(_in_transaction);
43 _in_transaction = false;
44 }
46 void
47 InkboardSession::commit()
48 {
49 g_assert(_in_transaction);
50 _in_transaction = false;
51 }
53 XML::Event*
54 InkboardSession::commitUndoable()
55 {
56 g_assert(_in_transaction);
57 _in_transaction = false;
58 return NULL;
59 }
61 XML::Node*
62 InkboardSession::createElementNode(char const* name)
63 {
64 g_log(NULL, G_LOG_LEVEL_DEBUG, "InkboardSession::createElementNode");
65 return new XML::ElementNode(g_quark_from_string(name));
66 }
68 XML::Node*
69 InkboardSession::createTextNode(char const* content)
70 {
71 g_log(NULL, G_LOG_LEVEL_DEBUG, "InkboardSession::createTextNode");
72 return new XML::TextNode(Util::share_string(content));
73 }
75 XML::Node*
76 InkboardSession::createCommentNode(char const* content)
77 {
78 g_log(NULL, G_LOG_LEVEL_DEBUG, "InkboardSession::createCommentNode");
79 return new XML::CommentNode(Util::share_string(content));
80 }
83 void InkboardSession::notifyChildAdded(Node &parent,
84 Node &child,
85 Node *prev)
86 {
87 if (_in_transaction) {
89 }
90 }
92 void InkboardSession::notifyChildRemoved(Node &parent,
93 Node &child,
94 Node *prev)
95 {
96 if (_in_transaction) {
97 }
98 }
100 void InkboardSession::notifyChildOrderChanged(Node &parent,
101 Node &child,
102 Node *old_prev,
103 Node *new_prev)
104 {
105 if (_in_transaction) {
106 }
107 }
109 void InkboardSession::notifyContentChanged(Node &node,
110 Util::SharedCStringPtr old_content,
111 Util::SharedCStringPtr new_content)
112 {
113 if (_in_transaction) {
114 }
115 }
117 void InkboardSession::notifyAttributeChanged(Node &node,
118 GQuark name,
119 Util::SharedCStringPtr old_value,
120 Util::SharedCStringPtr new_value)
121 {
122 if (_in_transaction) {
123 }
124 }
126 }
128 }