549a4530f49985a752cc6a69f33ac18987afb3da
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 // XXX only for testing!
26 #include "console-output-undo-observer.h"
28 #define SP_DOCUMENT_DEFS(d) ((SPObject *) SP_ROOT (SP_DOCUMENT_ROOT (d))->defs)
30 namespace Inkscape {
31 namespace XML {
32 class Event;
33 }
34 }
37 struct SPDocumentPrivate {
38 typedef std::map<GQuark, SPDocument::IDChangedSignal> IDChangedSignalMap;
39 typedef std::map<GQuark, SPDocument::ResourcesChangedSignal> ResourcesChangedSignalMap;
41 GHashTable *iddef; /**< Dictionary of id -> SPObject mappings */
42 GHashTable *reprdef; /**< Dictionary of Inkscape::XML::Node -> SPObject mappings */
44 /** Dictionary of signals for id changes */
45 IDChangedSignalMap id_changed_signals;
47 /* Resources */
48 /* It is GHashTable of GSLists */
49 GHashTable *resources;
50 ResourcesChangedSignalMap resources_changed_signals;
52 SPDocument::ModifiedSignal modified_signal;
53 SPDocument::URISetSignal uri_set_signal;
54 SPDocument::ResizedSignal resized_signal;
55 SPDocument::ReconstructionStart _reconstruction_start_signal;
56 SPDocument::ReconstructionFinish _reconstruction_finish_signal;
58 /* Undo/Redo state */
59 guint sensitive: 1; /* If we save actions to undo stack */
60 Inkscape::XML::Event * partial; /* partial undo log when interrupted */
61 int history_size;
62 GSList * undo; /* Undo stack of reprs */
63 GSList * redo; /* Redo stack of reprs */
65 /* Undo listener */
66 Inkscape::CompositeUndoStackObserver undoStackObservers;
68 // XXX only for testing!
69 Inkscape::ConsoleOutputUndoObserver console_output_undo_observer;
70 };
72 #endif