Code

Merge and cleanup of GSoC C++-ification project.
[inkscape.git] / src / document-private.h
1 #ifndef SEEN_SP_DOCUMENT_PRIVATE_H
2 #define SEEN_SP_DOCUMENT_PRIVATE_H
4 /*
5  * Seldom needed document data
6  *
7  * Authors:
8  *   Lauris Kaplinski <lauris@kaplinski.com>
9  *   Jon A. Cruz <jon@joncruz.org>
10  *
11  * Copyright (C) 1999-2002 Lauris Kaplinski
12  * Copyright (C) 2001-2002 Ximian, Inc.
13  *
14  * Released under GNU GPL, read the file 'COPYING' for more information
15  */
17 #include <map>
18 #include <sigc++/sigc++.h>
19 #include "xml/event-fns.h"
20 #include "sp-defs.h"
21 #include "sp-root.h"
22 #include "document.h"
24 #include "composite-undo-stack-observer.h"
26 #include "event-log.h"
28 // XXX only for testing!
29 #include "console-output-undo-observer.h"
31 #define SP_DOCUMENT_DEFS(d) ((SPObject *) SP_ROOT(d->getRoot())->defs)
33 namespace Inkscape {
34 namespace XML {
35 class Event;
36 }
37 }
40 struct SPDocumentPrivate {
41         typedef std::map<GQuark, SPDocument::IDChangedSignal> IDChangedSignalMap;
42         typedef std::map<GQuark, SPDocument::ResourcesChangedSignal> ResourcesChangedSignalMap;
44         GHashTable *iddef;      /**< Dictionary of id -> SPObject mappings */
45         GHashTable *reprdef;   /**< Dictionary of Inkscape::XML::Node -> SPObject mappings */
47         unsigned long serial;
49         /** Dictionary of signals for id changes */
50         IDChangedSignalMap id_changed_signals;
52         /* Resources */
53         /* It is GHashTable of GSLists */
54         GHashTable *resources;
55         ResourcesChangedSignalMap resources_changed_signals;
57         SPDocument::ModifiedSignal modified_signal;
58         SPDocument::URISetSignal uri_set_signal;
59         SPDocument::ResizedSignal resized_signal;
60         SPDocument::ReconstructionStart _reconstruction_start_signal;
61         SPDocument::ReconstructionFinish  _reconstruction_finish_signal;
62   SPDocument::CommitSignal commit_signal;
64         /* Undo/Redo state */
65         bool sensitive: true; /* If we save actions to undo stack */
66         Inkscape::XML::Event * partial; /* partial undo log when interrupted */
67         int history_size;
68         GSList * undo; /* Undo stack of reprs */
69         GSList * redo; /* Redo stack of reprs */
71         /* Undo listener */
72         Inkscape::CompositeUndoStackObserver undoStackObservers;
74         // XXX only for testing!
75         Inkscape::ConsoleOutputUndoObserver console_output_undo_observer;
77         bool seeking;
78 };
80 #endif // SEEN_SP_DOCUMENT_PRIVATE_H