Code

wrtlprnft's patch for bug 234834 - keeps guidelines in same position relative to...
[inkscape.git] / src / sp-namedview.h
index b60fb56175a6378ad66fc0d8967835e00807997c..cfc57d1c4cab6688481796e6f86932f6312622b3 100644 (file)
@@ -7,6 +7,7 @@
  * Authors:
  *   Lauris Kaplinski <lauris@kaplinski.com>
  *
+ * Copyright (C) 2006 Johan Engelen <johan@shouraizou.nl>
  * Copyright (C) Lauris Kaplinski 2000-2002
  *
  * Released under GNU GPL, read the file 'COPYING' for more information
 #include "sp-metric.h"
 #include "snap.h"
 
+namespace Inkscape {
+class CanvasGrid;
+}
+
 enum {
     SP_BORDER_LAYER_BOTTOM,
     SP_BORDER_LAYER_TOP
@@ -31,7 +36,6 @@ enum {
 
 struct SPNamedView : public SPObjectGroup {
     unsigned int editable : 1;
-    unsigned int showgrid : 1;
     unsigned int showguides : 1;
     unsigned int showborder : 1;
     unsigned int showpageshadow : 1;
@@ -46,12 +50,9 @@ struct SPNamedView : public SPObjectGroup {
     gint window_y;
 
     SnapManager snap_manager;
-
-    SPUnit const *gridunit;
-    /* Grid data is in points regardless of unit */
-    NR::Point gridorigin;
-    gdouble gridspacing[2];
-    gint gridempspacing;
+    GSList * grids;
+    bool grids_visible;
+    bool snapindicator;
 
     SPUnit const *doc_units;
 
@@ -64,14 +65,10 @@ struct SPNamedView : public SPObjectGroup {
     SPUnit const *objecttoleranceunit;
     gdouble objecttolerance;
 
-    bool has_abs_tolerance;
-    
     GQuark default_layer_id;
-    
+
     double connector_spacing;
 
-    guint32 gridcolor;
-    guint32 gridempcolor;
     guint32 guidecolor;
     guint32 guidehicolor;
     guint32 bordercolor;
@@ -80,16 +77,19 @@ struct SPNamedView : public SPObjectGroup {
 
     GSList *guides;
     GSList *views;
-    GSList *gridviews;
+
     gint viewcount;
 
     void show(SPDesktop *desktop);
     void hide(SPDesktop const *desktop);
-    void activateGuides(gpointer desktop, bool active);
+    void activateGuides(gpointer desktop, gboolean active);
     gchar const *getName() const;
     guint getViewCount();
     GSList const *getViewList() const;
     SPMetric getDefaultMetric() const;
+
+    void translateGuides(NR::translate const &translation);
+    void scrollAllDesktops(double dx, double dy, bool is_scrolling);
 };
 
 struct SPNamedViewClass {
@@ -102,9 +102,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_show_grids(SPNamedView *namedview, bool show, bool dirty_document);
+Inkscape::CanvasGrid * sp_namedview_get_first_enabled_grid(SPNamedView *namedview);
 
 #endif /* !INKSCAPE_SP_NAMEDVIEW_H */