2
* Inkscape::XML::LogBuilder - NodeObserver which builds an event log
4
* Copyright 2005 MenTaLguY <mental@rydia.net>
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
11
* See the file COPYING for details.
15
#include "xml/log-builder.h"
16
#include "xml/event.h"
17
#include "xml/event-fns.h"
22
void LogBuilder::discard() {
23
sp_repr_free_log(_log);
27
Event *LogBuilder::detach() {
33
void LogBuilder::addChild(Node &node, Node &child, Node *prev) {
34
_log = new Inkscape::XML::EventAdd(&node, &child, prev, _log);
35
_log = _log->optimizeOne();
38
void LogBuilder::removeChild(Node &node, Node &child, Node *prev) {
39
_log = new Inkscape::XML::EventDel(&node, &child, prev, _log);
40
_log = _log->optimizeOne();
43
void LogBuilder::setChildOrder(Node &node, Node &child,
44
Node *old_prev, Node *new_prev)
46
_log = new Inkscape::XML::EventChgOrder(&node, &child, old_prev, new_prev, _log);
47
_log = _log->optimizeOne();
50
void LogBuilder::setContent(Node &node,
51
Util::SharedCStringPtr old_content,
52
Util::SharedCStringPtr new_content)
54
_log = new Inkscape::XML::EventChgContent(&node, old_content, new_content, _log);
55
_log = _log->optimizeOne();
58
void LogBuilder::setAttribute(Node &node, GQuark name,
59
Util::SharedCStringPtr old_value,
60
Util::SharedCStringPtr new_value)
62
_log = new Inkscape::XML::EventChgAttr(&node, name, old_value, new_value, _log);
63
_log = _log->optimizeOne();
72
c-file-style:"stroustrup"
73
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
78
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :