Code

Fix Bug #447385 - Drag'n'drop from swatches doesn't always work
[inkscape.git] / src / sp-namedview.h
index e16f7a0beaac793b80a285eacfd1f562b68a4cf1..7a54b2dc56580c6018cce83e0cef8ce8a6a4143b 100644 (file)
 
 #include "helper/helper-forward.h"
 #include "sp-object-group.h"
-#include "libnr/nr-point.h"
 #include "sp-metric.h"
 #include "snap.h"
 
+namespace Inkscape {
+class CanvasGrid;
+}
+
 enum {
     SP_BORDER_LAYER_BOTTOM,
     SP_BORDER_LAYER_TOP
@@ -32,8 +35,6 @@ enum {
 
 struct SPNamedView : public SPObjectGroup {
     unsigned int editable : 1;
-    unsigned int showgrid : 1;
-    unsigned int gridtype : 1; // 0=normal 1=axonometric
     unsigned int showguides : 1;
     unsigned int showborder : 1;
     unsigned int showpageshadow : 1;
@@ -46,35 +47,19 @@ struct SPNamedView : public SPObjectGroup {
     gint window_height;
     gint window_x;
     gint window_y;
+    gint window_maximized;
 
     SnapManager snap_manager;
-
-    SPUnit const *gridunit;
-    /* Grid data is in points regardless of unit */
-    NR::Point gridorigin;
-    gdouble gridspacing[2];
-    gdouble gridangle[2];   // for axonometric grid
-    gint gridempspacing;
+    GSList * grids;
+    bool grids_visible;
 
     SPUnit const *doc_units;
-
-    SPUnit const *gridtoleranceunit;
-    gdouble gridtolerance;
-
-    SPUnit const *guidetoleranceunit;
-    gdouble guidetolerance;
-
-    SPUnit const *objecttoleranceunit;
-    gdouble objecttolerance;
-
-    bool has_abs_tolerance;
+    SPUnit const *units;
     
     GQuark default_layer_id;
-    
+
     double connector_spacing;
 
-    guint32 gridcolor;
-    guint32 gridempcolor;
     guint32 guidecolor;
     guint32 guidehicolor;
     guint32 bordercolor;
@@ -83,8 +68,7 @@ struct SPNamedView : public SPObjectGroup {
 
     GSList *guides;
     GSList *views;
-    GSList *gridviews;
-    
+
     gint viewcount;
 
     void show(SPDesktop *desktop);
@@ -94,6 +78,9 @@ struct SPNamedView : public SPObjectGroup {
     guint getViewCount();
     GSList const *getViewList() const;
     SPMetric getDefaultMetric() const;
+
+    void translateGuides(Geom::Translate const &translation);
+    void scrollAllDesktops(double dx, double dy, bool is_scrolling);
 };
 
 struct SPNamedViewClass {
@@ -106,10 +93,11 @@ SPNamedView *sp_document_namedview(SPDocument *document, gchar const *name);
 
 void sp_namedview_window_from_document(SPDesktop *desktop);
 void sp_namedview_document_from_window(SPDesktop *desktop);
+void sp_namedview_update_layers_from_document (SPDesktop *desktop);
 
 void sp_namedview_toggle_guides(SPDocument *doc, Inkscape::XML::Node *repr);
-void sp_namedview_toggle_grid(SPDocument *doc, Inkscape::XML::Node *repr);
-void sp_namedview_set_gridtype(unsigned int type, SPDocument *doc, Inkscape::XML::Node *repr);
+void sp_namedview_show_grids(SPNamedView *namedview, bool show, bool dirty_document);
+Inkscape::CanvasGrid * sp_namedview_get_first_enabled_grid(SPNamedView *namedview);
 
 #endif /* !INKSCAPE_SP_NAMEDVIEW_H */
 
@@ -123,4 +111,4 @@ void sp_namedview_set_gridtype(unsigned int type, SPDocument *doc, Inkscape::XML
   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 :