Code

Include new routines for building the fill point queue in a standard way
[inkscape.git] / src / document.h
index f29804db0f43e3a6475ae113153735f4c9d77bda..c04ed5441db175af559cb5b8a33b5f65e229ae05 100644 (file)
@@ -28,6 +28,7 @@
 #include "gc-anchored.h"
 #include <glibmm/ustring.h>
 #include "verbs.h"
+#include <vector>
 
 namespace Avoid {
 class Router;
@@ -50,6 +51,13 @@ namespace Inkscape {
     }
 }
 
+class SP3DBox;
+
+namespace Box3D {
+  class Perspective3D;
+  class VanishingPoint;
+}
+
 class SPDocumentPrivate;
 
 /// Typed SVG document implementation.
@@ -91,6 +99,19 @@ struct SPDocument : public Inkscape::GC::Managed<>,
        // Instance of the connector router
        Avoid::Router *router;
 
+        GSList *perspectives;
+        Box3D::Perspective3D *current_perspective;
+
+        // FIXME: Perspectives should be linked to the list of existing ones automatically in the constructor
+        //        and removed in the destructor!
+        void add_perspective (Box3D::Perspective3D * const persp);
+        void remove_perspective (Box3D::Perspective3D * const persp);
+        /* find an existing perspective whose VPs are equal to those of persp */
+        Box3D::Perspective3D * find_perspective (const Box3D::Perspective3D * persp);
+
+        Box3D::Perspective3D * get_persp_of_box (const SP3DBox *box);
+        Box3D::Perspective3D * get_persp_of_VP (const Box3D::VanishingPoint *vp);
+
        sigc::connection connectModified(ModifiedSignal::slot_type slot);
        sigc::connection connectURISet(URISetSignal::slot_type slot);
        sigc::connection connectResized(ResizedSignal::slot_type slot);
@@ -115,10 +136,11 @@ struct SPDocument : public Inkscape::GC::Managed<>,
        void addUndoObserver(Inkscape::UndoStackObserver& observer);
        void removeUndoObserver(Inkscape::UndoStackObserver& observer);
 
-       Inkscape::EventLog& getEventLog() const;
-
         bool _updateDocument();
 
+       /// Are we currently in a transition between two "known good" states of the document?
+       bool isSeeking() const;
+
 private:
        SPDocument(SPDocument const &); // no copy
        void operator=(SPDocument const &); // no assign
@@ -129,16 +151,16 @@ public:
        void emitReconstructionStart (void);
        void emitReconstructionFinish  (void);
 
+       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);
@@ -200,12 +222,12 @@ void sp_document_reset_key (Inkscape::Application *inkscape, SPDesktop *desktop,
 void sp_document_cancel (SPDocument *document);
 
 /* Undo and redo */
-bool sp_document_undo (SPDocument * document);
-bool sp_document_redo (SPDocument * document);
+gboolean sp_document_undo (SPDocument * document);
+gboolean sp_document_redo (SPDocument * document);
 
 /* Resource management */
-bool sp_document_add_resource (SPDocument *document, const gchar *key, SPObject *object);
-bool sp_document_remove_resource (SPDocument *document, const gchar *key, SPObject *object);
+gboolean sp_document_add_resource (SPDocument *document, const gchar *key, SPObject *object);
+gboolean sp_document_remove_resource (SPDocument *document, const gchar *key, SPObject *object);
 const GSList *sp_document_get_resource_list (SPDocument *document, const gchar *key);
 sigc::connection sp_document_resources_changed_connect(SPDocument *document, const gchar *key, SPDocument::ResourcesChangedSignal::slot_type slot);
 
@@ -231,8 +253,9 @@ sigc::connection sp_document_resources_changed_connect(SPDocument *document, con
 GSList * sp_document_items_in_box(SPDocument *document, unsigned int dkey, NR::Rect const &box);
 GSList * sp_document_partial_items_in_box(SPDocument *document, unsigned int dkey, NR::Rect const &box);
 SPItem* sp_document_item_from_list_at_point_bottom (unsigned int dkey, SPGroup *group, const GSList *list, NR::Point const p, bool take_insensitive = false);
-SPItem * sp_document_item_at_point (SPDocument *document, unsigned int key, NR::Point const p, bool into_groups, SPItem *upto = NULL);
-SPItem * sp_document_group_at_point (SPDocument *document, unsigned int key,  NR::Point const p);
+SPItem * sp_document_item_at_point (SPDocument *document, unsigned int key, NR::Point const p, gboolean into_groups, SPItem *upto = NULL);
+GSList *sp_document_items_at_points(SPDocument *document, unsigned const key, std::vector<NR::Point> points);
+SPItem *sp_document_group_at_point (SPDocument *document, unsigned int key,  NR::Point const p);
 
 void sp_document_set_uri (SPDocument *document, const gchar *uri);
 void sp_document_resized_signal_emit (SPDocument *doc, gdouble width, gdouble height);