Code

Make linked offsets respect "Relink duplicated clones" settings
[inkscape.git] / src / document.h
index 696e568ad419e01465564e308928197278068ecf..4f5f045c5566fb5819fcb59a5898740637b844a3 100644 (file)
@@ -55,6 +55,7 @@ namespace Inkscape {
 
 class SP3DBox;
 class Persp3D;
+class Persp3DImpl;
 
 namespace Proj {
     class TransfMat3x4;
@@ -95,25 +96,39 @@ struct SPDocument : public Inkscape::GC::Managed<>,
     SPDocumentPrivate *priv;
 
     /// Last action key
-    const gchar *actionkey;
+    Glib::ustring actionkey;
+
     /// Handler ID
     guint modified_id;
+    
+    /// Connector rerouting handler ID
+    guint rerouting_handler_id;
 
     Inkscape::ProfileManager* profileManager;
 
     // Instance of the connector router
     Avoid::Router *router;
 
-    GSList *perspectives;
-
-    Persp3D *current_persp3d; // "currently active" perspective (e.g., newly created boxes are attached to this one)
-
     GSList *_collection_queue;
 
     bool oldSignalsConnected;
 
-    void add_persp3d(Persp3D * const persp);
-    void remove_persp3d(Persp3D * const persp);
+    void setCurrentPersp3D(Persp3D * const persp);
+    inline void setCurrentPersp3DImpl(Persp3DImpl * const persp_impl) { current_persp3d_impl = persp_impl; }
+    /*
+     * getCurrentPersp3D returns current_persp3d (if non-NULL) or the first
+     * perspective in the defs. If no perspective exists, returns NULL.
+     */
+    Persp3D * getCurrentPersp3D();
+    Persp3DImpl * getCurrentPersp3DImpl();
+    void getPerspectivesInDefs(std::vector<Persp3D*> &list);
+    unsigned int numPerspectivesInDefs() {
+        std::vector<Persp3D*> list;
+        getPerspectivesInDefs(list);
+        return list.size();
+    }
+
+    //void initialize_current_persp3d();
 
     sigc::connection connectModified(ModifiedSignal::slot_type slot);
     sigc::connection connectURISet(URISetSignal::slot_type slot);
@@ -151,6 +166,9 @@ private:
     SPDocument(SPDocument const &); // no copy
     void operator=(SPDocument const &); // no assign
 
+    Persp3D *current_persp3d; /**< Currently 'active' perspective (to which, e.g., newly created boxes are attached) */
+    Persp3DImpl *current_persp3d_impl;
+
 public:
     sigc::connection connectReconstructionStart(ReconstructionStart::slot_type slot);
     sigc::connection connectReconstructionFinish(ReconstructionFinish::slot_type slot);
@@ -162,7 +180,7 @@ public:
     sigc::connection _selection_changed_connection;
     sigc::connection _desktop_activated_connection;
 
-    void fitToRect(Geom::Rect const &rect);
+    void fitToRect(Geom::Rect const &rect, bool with_margins = false);
 };
 
 SPDocument *sp_document_new(const gchar *uri, unsigned int keepalive, bool make_new = false);
@@ -283,4 +301,4 @@ unsigned int vacuum_document(SPDocument *document);
   fill-column:99
   End:
 */
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :