summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 99368fa)
raw | patch | inline | side by side (parent: 99368fa)
author | dwyip <dwyip@users.sourceforge.net> | |
Fri, 23 Jun 2006 03:58:46 +0000 (03:58 +0000) | ||
committer | dwyip <dwyip@users.sourceforge.net> | |
Fri, 23 Jun 2006 03:58:46 +0000 (03:58 +0000) |
src/Makefile_insert | patch | blob | history | |
src/console-output-undo-observer.cpp | [new file with mode: 0644] | patch | blob |
src/console-output-undo-observer.h | [new file with mode: 0644] | patch | blob |
src/document-private.h | patch | blob | history | |
src/document.cpp | patch | blob | history |
diff --git a/src/Makefile_insert b/src/Makefile_insert
index a0f2ff527be1728bf8ed2bf3cfa5a01f393229a5..f6c591d831546b22a565ce7b2598df9bce2eb8c8 100644 (file)
--- a/src/Makefile_insert
+++ b/src/Makefile_insert
conn-avoid-ref.cpp conn-avoid-ref.h \
connector-context.cpp connector-context.h \
connection-pool.h \
+ console-output-undo-observer.h console-output-undo-observer.cpp \
context-fns.cpp context-fns.h \
desktop-affine.cpp desktop-affine.h \
desktop-events.cpp desktop-events.h \
diff --git a/src/console-output-undo-observer.cpp b/src/console-output-undo-observer.cpp
--- /dev/null
@@ -0,0 +1,48 @@
+/**
+ * Inkscape::ConsoleOutputUndoObserver - observer for tracing calls to
+ * sp_document_undo, sp_document_redo, sp_document_maybe_done
+ *
+ * Authors:
+ * David Yip <yipdw@alumni.rose-hulman.edu>
+ *
+ * Copyright (c) 2006 Authors
+ *
+ * Released under GNU GPL, see the file 'COPYING' for more information
+ */
+
+#include <glibmm.h>
+
+#include "console-output-undo-observer.h"
+
+namespace Inkscape {
+
+void
+ConsoleOutputUndoObserver::notifyUndoEvent(XML::Event* log)
+{
+ g_message("notifyUndoEvent (sp_document_undo) called; log=%p\n", log);
+}
+
+void
+ConsoleOutputUndoObserver::notifyRedoEvent(XML::Event* log)
+{
+ g_message("notifyRedoEvent (sp_document_redo) called; log=%p\n", log);
+}
+
+void
+ConsoleOutputUndoObserver::notifyUndoCommitEvent(XML::Event* log)
+{
+ g_message("notifyUndoCommitEvent (sp_document_maybe_done) called; log=%p\n", log);
+}
+
+}
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
diff --git a/src/console-output-undo-observer.h b/src/console-output-undo-observer.h
--- /dev/null
@@ -0,0 +1,50 @@
+/**
+ * Inkscape::ConsoleOutputUndoObserver - observer for tracing calls to
+ * sp_document_undo, sp_document_redo, sp_document_maybe_done
+ *
+ * Authors:
+ * David Yip <yipdw@alumni.rose-hulman.edu>
+ *
+ * Copyright (c) 2006 Authors
+ *
+ * Released under GNU GPL, see the file 'COPYING' for more information
+ */
+
+#ifndef __INKSCAPE_CONSOLE_OUTPUT_UNDO_OBSERVER_H__
+#define __INKSCAPE_CONSOLE_OUTPUT_UNDO_OBSERVER_H__
+
+#include "undo-stack-observer.h"
+
+namespace Inkscape {
+
+namespace XML {
+
+class Event;
+
+}
+
+class ConsoleOutputUndoObserver : public UndoStackObserver {
+public:
+ ConsoleOutputUndoObserver() : UndoStackObserver() { }
+ ~ConsoleOutputUndoObserver() { }
+
+ void notifyUndoEvent(XML::Event* log);
+ void notifyRedoEvent(XML::Event* log);
+ void notifyUndoCommitEvent(XML::Event* log);
+
+};
+
+}
+
+#endif
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
diff --git a/src/document-private.h b/src/document-private.h
index 34e61a9a06a9055a88def6716594fa01e92a946c..549a4530f49985a752cc6a69f33ac18987afb3da 100644 (file)
--- a/src/document-private.h
+++ b/src/document-private.h
#include "composite-undo-stack-observer.h"
+// XXX only for testing!
+#include "console-output-undo-observer.h"
+
#define SP_DOCUMENT_DEFS(d) ((SPObject *) SP_ROOT (SP_DOCUMENT_ROOT (d))->defs)
namespace Inkscape {
/* Undo listener */
Inkscape::CompositeUndoStackObserver undoStackObservers;
+ // XXX only for testing!
+ Inkscape::ConsoleOutputUndoObserver console_output_undo_observer;
};
#endif
diff --git a/src/document.cpp b/src/document.cpp
index 71f607b6524dcdc2e88a1c974c565243c1d830fc..e42f6c8cb57029c2b55e4225e76582c0b50c596e 100644 (file)
--- a/src/document.cpp
+++ b/src/document.cpp
p->redo = NULL;
priv = p;
+
+ // XXX only for testing!
+ priv->undoStackObservers.add(p->console_output_undo_observer);
}
SPDocument::~SPDocument() {