Code

A simple layout document as to what, why and how is cppification.
[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 #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         unsigned long serial;
48         /** Dictionary of signals for id changes */
49         IDChangedSignalMap id_changed_signals;
51         /* Resources */
52         /* It is GHashTable of GSLists */
53         GHashTable *resources;
54         ResourcesChangedSignalMap resources_changed_signals;
56         SPDocument::ModifiedSignal modified_signal;
57         SPDocument::URISetSignal uri_set_signal;
58         SPDocument::ResizedSignal resized_signal;
59         SPDocument::ReconstructionStart _reconstruction_start_signal;
60         SPDocument::ReconstructionFinish  _reconstruction_finish_signal;
61   SPDocument::CommitSignal commit_signal;
63         /* Undo/Redo state */
64         bool sensitive: true; /* If we save actions to undo stack */
65         Inkscape::XML::Event * partial; /* partial undo log when interrupted */
66         int history_size;
67         GSList * undo; /* Undo stack of reprs */
68         GSList * redo; /* Redo stack of reprs */
70         /* Undo listener */
71         Inkscape::CompositeUndoStackObserver undoStackObservers;
73         // XXX only for testing!
74         Inkscape::ConsoleOutputUndoObserver console_output_undo_observer;
76         bool seeking;
77 };
79 #endif