Code

moving trunk for module inkscape
[inkscape.git] / src / document-private.h
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 #define SP_DOCUMENT_DEFS(d) ((SPObject *) SP_ROOT (SP_DOCUMENT_ROOT (d))->defs)
27 namespace Inkscape {
28 namespace XML {
29 class Event;
30 }
31 }
34 struct SPDocumentPrivate {
35         typedef std::map<GQuark, SPDocument::IDChangedSignal> IDChangedSignalMap;
36         typedef std::map<GQuark, SPDocument::ResourcesChangedSignal> ResourcesChangedSignalMap;
38         GHashTable *iddef;      /**< Dictionary of id -> SPObject mappings */
39         GHashTable *reprdef;   /**< Dictionary of Inkscape::XML::Node -> SPObject mappings */
41         /** Dictionary of signals for id changes */
42         IDChangedSignalMap id_changed_signals;
44         /* Resources */
45         /* It is GHashTable of GSLists */
46         GHashTable *resources;
47         ResourcesChangedSignalMap resources_changed_signals;
49         SPDocument::ModifiedSignal modified_signal;
50         SPDocument::URISetSignal uri_set_signal;
51         SPDocument::ResizedSignal resized_signal;
52         SPDocument::ReconstructionStart _reconstruction_start_signal;
53         SPDocument::ReconstructionFinish  _reconstruction_finish_signal;
55         /* Undo/Redo state */
56         guint sensitive: 1; /* If we save actions to undo stack */
57         Inkscape::XML::Event * partial; /* partial undo log when interrupted */
58         int history_size;
59         GSList * undo; /* Undo stack of reprs */
60         GSList * redo; /* Redo stack of reprs */
62         /* Undo listener */
63         Inkscape::CompositeUndoStackObserver undoStackObservers;
65 };
67 #endif