1 #ifndef __SP_DOCUMENT_PRIVATE_H__
2 #define __SP_DOCUMENT_PRIVATE_H__
4 /*
5 * Seldom needed document data
6 *
7 * Authors:
8 * Lauris Kaplinski <lauris@kaplinski.com>
9 *
10 * Copyright (C) 1999-2002 Lauris Kaplinski
11 * Copyright (C) 2001-2002 Ximian, Inc.
12 *
13 * Released under GNU GPL, read the file 'COPYING' for more information
14 */
16 #include <map>
17 #include <sigc++/sigc++.h>
18 #include "xml/event-fns.h"
19 #include "sp-defs.h"
20 #include "sp-root.h"
21 #include "document.h"
23 #include "composite-undo-stack-observer.h"
25 #include "event-log.h"
27 // XXX only for testing!
28 #include "console-output-undo-observer.h"
30 #define SP_DOCUMENT_DEFS(d) ((SPObject *) SP_ROOT (SP_DOCUMENT_ROOT (d))->defs)
32 namespace Inkscape {
33 namespace XML {
34 class Event;
35 }
36 }
39 struct SPDocumentPrivate {
40 typedef std::map<GQuark, SPDocument::IDChangedSignal> IDChangedSignalMap;
41 typedef std::map<GQuark, SPDocument::ResourcesChangedSignal> ResourcesChangedSignalMap;
43 GHashTable *iddef; /**< Dictionary of id -> SPObject mappings */
44 GHashTable *reprdef; /**< Dictionary of Inkscape::XML::Node -> SPObject mappings */
46 /** Dictionary of signals for id changes */
47 IDChangedSignalMap id_changed_signals;
49 /* Resources */
50 /* It is GHashTable of GSLists */
51 GHashTable *resources;
52 ResourcesChangedSignalMap resources_changed_signals;
54 SPDocument::ModifiedSignal modified_signal;
55 SPDocument::URISetSignal uri_set_signal;
56 SPDocument::ResizedSignal resized_signal;
57 SPDocument::ReconstructionStart _reconstruction_start_signal;
58 SPDocument::ReconstructionFinish _reconstruction_finish_signal;
59 SPDocument::CommitSignal commit_signal;
61 /* Undo/Redo state */
62 bool sensitive: true; /* If we save actions to undo stack */
63 Inkscape::XML::Event * partial; /* partial undo log when interrupted */
64 int history_size;
65 GSList * undo; /* Undo stack of reprs */
66 GSList * redo; /* Redo stack of reprs */
68 /* Undo listener */
69 Inkscape::CompositeUndoStackObserver undoStackObservers;
71 // XXX only for testing!
72 Inkscape::ConsoleOutputUndoObserver console_output_undo_observer;
73 };
75 #endif