event.cpp revision 6cf4fe01f16c5713438743a95c971ed82c44c535
/*
* Repr transaction logging
*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* MenTaLguY <mental@rydia.net>
*
* Copyright (C) 2004-2005 MenTaLguY
* Copyright (C) 1999-2003 authors
* Copyright (C) 2001-2002 Ximian, Inc.
* g++ port Copyright (C) 2003 Nathan Hurst
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <glib.h> // g_assert()
#include "event.h"
#include "event-fns.h"
#include "util/reverse-list.h"
#include "xml/document.h"
#include "xml/node-observer.h"
#include "debug/event-tracker.h"
#include "debug/simple-event.h"
void
{
doc->beginTransaction();
}
void
{
}
void
{
}
{
return doc->commitUndoable();
}
namespace {
public:
static LogPerformer &instance() {
static LogPerformer singleton;
return singleton;
}
}
}
{
}
{
}
{
}
};
}
) {
}
}
void
{
}
}
) const {
}
) const {
}
) const {
}
) const {
}
) const {
}
) {
}
}
void
{
if (log) {
}
}
}
) const {
}
) const {
}
) const {
}
) const {
}
) const {
}
{
if (!b) return a;
if (!a) return b;
/* find the earliest action in the second log */
/* (also noting the pointer that references it, so we can
* replace it later) */
prev_ptr = &b;
}
/* add the first log after it */
/* optimize the result */
return b;
}
void
{
while (log) {
delete action;
}
}
namespace {
template <typename T> struct ActionRelations;
template <>
};
template <>
};
template <typename A>
{
delete opposite;
delete action;
return remaining;
} else {
return action;
}
}
}
return cancel_add_or_remove(this);
}
return cancel_add_or_remove(this);
}
/* consecutive chgattrs on the same key can be combined */
{
/* replace our oldval with the prior action's */
/* discard the prior action */
delete chg_attr;
}
return this;
}
Inkscape::XML::EventChgContent *chg_content=dynamic_cast<Inkscape::XML::EventChgContent *>(this->next);
/* consecutive content changes can be combined */
/* replace our oldval with the prior action's */
/* get rid of the prior action*/
delete chg_content;
}
return this;
}
/* consecutive chgorders for the same child may be combined or
* canceled out */
{
/* cancel them out */
delete chg_order;
delete this;
return after;
} else {
/* combine them */
/* get rid of the other one */
delete chg_order;
return this;
}
} else {
return this;
}
}
namespace {
public:
static LogPrinter &instance() {
static LogPrinter singleton;
return singleton;
}
type_name = "Document";
break;
type_name = "Element";
break;
type_name = "Text";
break;
type_name = "Comment";
break;
default:
}
char buffer[40];
return result;
}
if (ref) {
return node_to_string(*ref);
} else {
return "beginning";
}
}
g_warning("Event: Added %s to %s after %s", node_to_string(parent).c_str(), node_to_string(child).c_str(), ref_to_string(ref).c_str());
}
g_warning("Event: Removed %s from %s", node_to_string(parent).c_str(), node_to_string(child).c_str());
}
{
g_warning("Event: Moved %s after %s in %s", node_to_string(child).c_str(), ref_to_string(new_ref).c_str(), node_to_string(parent).c_str());
}
{
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());
} else {
g_warning("Event: Unset attribute %s on %s", g_quark_to_string(name), node_to_string(node).c_str());
}
}
{
if (new_value) {
} else {
}
}
};
}
void
}