diff --git a/src/document.h b/src/document.h
index a3377f398287ad756e91387114c5aa4764f46c05..a5cc3b855bf794efe47e31fb4d4a248417ea0b52 100644 (file)
--- a/src/document.h
+++ b/src/document.h
#include <glibmm/ustring.h>
#include "verbs.h"
#include <vector>
+#include <set>
namespace Avoid {
class Router;
class Selection;
class UndoStackObserver;
class EventLog;
+ class ProfileManager;
namespace XML {
class Document;
class Node;
}
}
+class SP3DBox;
+class Persp3D;
+
+namespace Proj {
+ class TransfMat3x4;
+}
+
class SPDocumentPrivate;
/// Typed SVG document implementation.
struct SPDocument : public Inkscape::GC::Managed<>,
public Inkscape::GC::Finalized,
- public Inkscape::GC::Anchored
+ public Inkscape::GC::Anchored
{
- typedef sigc::signal<void, SPObject *> IDChangedSignal;
- typedef sigc::signal<void> ResourcesChangedSignal;
- typedef sigc::signal<void, guint> ModifiedSignal;
- typedef sigc::signal<void, gchar const *> URISetSignal;
- typedef sigc::signal<void, double, double> ResizedSignal;
- typedef sigc::signal<void> ReconstructionStart;
- typedef sigc::signal<void> ReconstructionFinish;
- typedef sigc::signal<void> CommitSignal;
+ typedef sigc::signal<void, SPObject *> IDChangedSignal;
+ typedef sigc::signal<void> ResourcesChangedSignal;
+ typedef sigc::signal<void, guint> ModifiedSignal;
+ typedef sigc::signal<void, gchar const *> URISetSignal;
+ typedef sigc::signal<void, double, double> ResizedSignal;
+ typedef sigc::signal<void> ReconstructionStart;
+ typedef sigc::signal<void> ReconstructionFinish;
+ typedef sigc::signal<void> CommitSignal;
+
+ SPDocument();
+ virtual ~SPDocument();
+
+ unsigned int keepalive : 1;
+ unsigned int virgin : 1; ///< Has the document never been touched?
+ unsigned int modified_since_save : 1;
+
+ Inkscape::XML::Document *rdoc; ///< Our Inkscape::XML::Document
+ Inkscape::XML::Node *rroot; ///< Root element of Inkscape::XML::Document
+ SPObject *root; ///< Our SPRoot
+ CRCascade *style_cascade;
- SPDocument();
- ~SPDocument();
+ gchar *uri; ///< URI string or NULL
+ gchar *base;
+ gchar *name;
- unsigned int keepalive : 1;
- unsigned int virgin : 1; ///< Has the document never been touched?
+ SPDocumentPrivate *priv;
- Inkscape::XML::Document *rdoc; ///< Our Inkscape::XML::Document
- Inkscape::XML::Node *rroot; ///< Root element of Inkscape::XML::Document
- SPObject *root; ///< Our SPRoot
- CRCascade *style_cascade;
+ /// Last action key
+ const gchar *actionkey;
+ /// Handler ID
+ guint modified_id;
- gchar *uri; ///< URI string or NULL
- gchar *base;
- gchar *name;
+ Inkscape::ProfileManager* profileManager;
- SPDocumentPrivate *priv;
+ // Instance of the connector router
+ Avoid::Router *router;
- /// Last action key
- const gchar *actionkey;
- /// Handler ID
- guint modified_id;
+ GSList *perspectives;
- // Instance of the connector router
- Avoid::Router *router;
+ Persp3D *current_persp3d; // "currently active" perspective (e.g., newly created boxes are attached to this one)
- sigc::connection connectModified(ModifiedSignal::slot_type slot);
- sigc::connection connectURISet(URISetSignal::slot_type slot);
- sigc::connection connectResized(ResizedSignal::slot_type slot);
- sigc::connection connectCommit(CommitSignal::slot_type slot);
+ GSList *_collection_queue;
- void bindObjectToId(gchar const *id, SPObject *object);
- SPObject *getObjectById(gchar const *id);
- sigc::connection connectIdChanged(const gchar *id, IDChangedSignal::slot_type slot);
+ void add_persp3d (Persp3D * const persp);
+ void remove_persp3d (Persp3D * const persp);
- void bindObjectToRepr(Inkscape::XML::Node *repr, SPObject *object);
- SPObject *getObjectByRepr(Inkscape::XML::Node *repr);
+ sigc::connection connectModified(ModifiedSignal::slot_type slot);
+ sigc::connection connectURISet(URISetSignal::slot_type slot);
+ sigc::connection connectResized(ResizedSignal::slot_type slot);
+sigc::connection connectCommit(CommitSignal::slot_type slot);
+
+ void bindObjectToId(gchar const *id, SPObject *object);
+ SPObject *getObjectById(gchar const *id);
+ sigc::connection connectIdChanged(const gchar *id, IDChangedSignal::slot_type slot);
+
+ void bindObjectToRepr(Inkscape::XML::Node *repr, SPObject *object);
+ SPObject *getObjectByRepr(Inkscape::XML::Node *repr);
Glib::ustring getLanguage();
- void queueForOrphanCollection(SPObject *object);
- void collectOrphans();
+ void queueForOrphanCollection(SPObject *object);
+ void collectOrphans();
- void _emitModified();
+ void _emitModified();
- GSList *_collection_queue;
+ void addUndoObserver(Inkscape::UndoStackObserver& observer);
+ void removeUndoObserver(Inkscape::UndoStackObserver& observer);
- void addUndoObserver(Inkscape::UndoStackObserver& observer);
- void removeUndoObserver(Inkscape::UndoStackObserver& observer);
+ bool _updateDocument();
- bool _updateDocument();
+ /// Are we currently in a transition between two "known good" states of the document?
+ bool isSeeking() const;
- /// Are we currently in a transition between two "known good" states of the document?
- bool isSeeking() const;
+ bool isModifiedSinceSave() const { return modified_since_save; }
+ void setModifiedSinceSave(bool modified = true) {
+ modified_since_save = modified;
+ }
private:
- SPDocument(SPDocument const &); // no copy
- void operator=(SPDocument const &); // no assign
+ SPDocument(SPDocument const &); // no copy
+ void operator=(SPDocument const &); // no assign
public:
- sigc::connection connectReconstructionStart(ReconstructionStart::slot_type slot);
- sigc::connection connectReconstructionFinish (ReconstructionFinish::slot_type slot);
- void emitReconstructionStart (void);
- void emitReconstructionFinish (void);
+ sigc::connection connectReconstructionStart(ReconstructionStart::slot_type slot);
+ sigc::connection connectReconstructionFinish (ReconstructionFinish::slot_type slot);
+ void emitReconstructionStart (void);
+ void emitReconstructionFinish (void);
- void reset_key (void *dummy);
- sigc::connection _selection_changed_connection;
- sigc::connection _desktop_activated_connection;
+ unsigned long serial() const;
+ void reset_key (void *dummy);
+ sigc::connection _selection_changed_connection;
+ sigc::connection _desktop_activated_connection;
- void fitToRect(NRRect const & rect);
+ void fitToRect(NR::Rect const &rect);
};
SPDocument *sp_document_new (const gchar *uri, unsigned int keepalive, bool make_new = false);
SPDocument *sp_document_new_from_mem (const gchar *buffer, gint length, unsigned int keepalive);
-SPDocument *sp_document_new_dummy();
SPDocument *sp_document_ref (SPDocument *doc);
SPDocument *sp_document_unref (SPDocument *doc);
@@ -243,3 +267,14 @@ void sp_document_resized_signal_emit (SPDocument *doc, gdouble width, gdouble he
unsigned int vacuum_document (SPDocument *document);
#endif
+
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :