X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fdocument.h;h=12848aa68f469442a75d50be0448ed805d031588;hb=ef9d155a8149d4793471047b3836db719b9e0292;hp=da8b656eff430548dc74f2112ad2a48001985349;hpb=6b15695578f07a3f72c4c9475c1a261a3021472a;p=inkscape.git diff --git a/src/document.h b/src/document.h index da8b656ef..12848aa68 100644 --- a/src/document.h +++ b/src/document.h @@ -26,7 +26,14 @@ #include "gc-managed.h" #include "gc-finalized.h" #include "gc-anchored.h" +#include +#include "verbs.h" +namespace Avoid { +class Router; +} + +struct NRRect; struct SPDesktop; struct SPItem; struct SPObject; @@ -36,6 +43,7 @@ namespace Inkscape { struct Application; class Selection; class UndoStackObserver; + class EventLog; namespace XML { class Document; class Node; @@ -56,6 +64,7 @@ struct SPDocument : public Inkscape::GC::Managed<>, typedef sigc::signal ResizedSignal; typedef sigc::signal ReconstructionStart; typedef sigc::signal ReconstructionFinish; + typedef sigc::signal CommitSignal; SPDocument(); ~SPDocument(); @@ -79,9 +88,13 @@ struct SPDocument : public Inkscape::GC::Managed<>, /// Handler ID guint modified_id; + // Instance of the connector router + Avoid::Router *router; + 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); @@ -90,6 +103,8 @@ struct SPDocument : public Inkscape::GC::Managed<>, void bindObjectToRepr(Inkscape::XML::Node *repr, SPObject *object); SPObject *getObjectByRepr(Inkscape::XML::Node *repr); + Glib::ustring getLanguage(); + void queueForOrphanCollection(SPObject *object); void collectOrphans(); @@ -100,6 +115,8 @@ struct SPDocument : public Inkscape::GC::Managed<>, void addUndoObserver(Inkscape::UndoStackObserver& observer); void removeUndoObserver(Inkscape::UndoStackObserver& observer); + bool _updateDocument(); + private: SPDocument(SPDocument const &); // no copy void operator=(SPDocument const &); // no assign @@ -113,6 +130,8 @@ public: void reset_key (void *dummy); sigc::connection _selection_changed_connection; sigc::connection _desktop_activated_connection; + + void fitToRect(NRRect const & rect); }; SPDocument *sp_document_new (const gchar *uri, unsigned int keepalive, bool make_new = false); @@ -122,6 +141,9 @@ SPDocument *sp_document_new_dummy(); SPDocument *sp_document_ref (SPDocument *doc); SPDocument *sp_document_unref (SPDocument *doc); + +SPDocument *sp_document_create(Inkscape::XML::Document *rdoc, gchar const *uri, gchar const *base, gchar const *name, unsigned int keepalive); + /* * Access methods */ @@ -151,8 +173,8 @@ void sp_document_set_height (SPDocument * document, gdouble height, const SPUnit * Undo & redo */ -void sp_document_set_undo_sensitive (SPDocument * document, gboolean sensitive); -gboolean sp_document_get_undo_sensitive (SPDocument const * document); +void sp_document_set_undo_sensitive (SPDocument * document, bool sensitive); +bool sp_document_get_undo_sensitive (SPDocument const * document); void sp_document_clear_undo (SPDocument * document); void sp_document_clear_redo (SPDocument * document); @@ -168,8 +190,8 @@ void sp_document_request_modified (SPDocument *doc); gint sp_document_ensure_up_to_date (SPDocument *doc); /* Save all previous actions to stack, as one undo step */ -void sp_document_done (SPDocument *document); -void sp_document_maybe_done (SPDocument *document, const gchar *key); +void sp_document_done (SPDocument *document, unsigned int event_type, Glib::ustring event_description); +void sp_document_maybe_done (SPDocument *document, const gchar *keyconst, unsigned int event_type, Glib::ustring event_description); void sp_document_reset_key (Inkscape::Application *inkscape, SPDesktop *desktop, GtkObject *base); /* Cancel (and revert) current unsaved actions */