Code

Merge and cleanup of GSoC C++-ification project.
[inkscape.git] / src / sp-namedview.h
index 7eefdfae53cf345fd6d65281c2273cf3e69b6510..86b16a5577e2bb63b6e2775340d56a25498a0fca 100644 (file)
@@ -6,6 +6,7 @@
  *
  * Authors:
  *   Lauris Kaplinski <lauris@kaplinski.com>
+ *   Abhishek Sharma
  *
  * Copyright (C) 2006 Johan Engelen <johan@shouraizou.nl>
  * Copyright (C) Lauris Kaplinski 2000-2002
 
 #include "helper/helper-forward.h"
 #include "sp-object-group.h"
-#include "libnr/nr-point.h"
 #include "sp-metric.h"
 #include "snap.h"
+#include "display/canvas-grid.h"
+#include "document.h"
 
 namespace Inkscape {
 class CanvasGrid;
@@ -48,23 +50,17 @@ struct SPNamedView : public SPObjectGroup {
     gint window_height;
     gint window_x;
     gint window_y;
+    gint window_maximized;
 
     SnapManager snap_manager;
     GSList * grids;
+    bool grids_visible;
 
     SPUnit const *doc_units;
-
-    SPUnit const *gridtoleranceunit;
-    gdouble gridtolerance;
-
-    SPUnit const *guidetoleranceunit;
-    gdouble guidetolerance;
-
-    SPUnit const *objecttoleranceunit;
-    gdouble objecttolerance;
-
-    GQuark default_layer_id;
+    SPUnit const *units;
     
+    GQuark default_layer_id;
+
     double connector_spacing;
 
     guint32 guidecolor;
@@ -75,7 +71,7 @@ struct SPNamedView : public SPObjectGroup {
 
     GSList *guides;
     GSList *views;
-    
+
     gint viewcount;
 
     void show(SPDesktop *desktop);
@@ -85,6 +81,17 @@ 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);
+    void writeNewGrid(SPDocument *document,int gridtype);
+    bool getSnapGlobal() const;
+    void setSnapGlobal(bool v);
+    void setGuides(bool v);
+
+private:
+    double getMarginLength(gchar const * const key,SPUnit const * const margin_units,SPUnit const * const return_units,double const width,double const height,bool const use_width);
+    friend class SPDocument;
 };
 
 struct SPNamedViewClass {
@@ -100,6 +107,8 @@ 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_show_grids(SPNamedView *namedview, bool show, bool dirty_document);
+Inkscape::CanvasGrid * sp_namedview_get_first_enabled_grid(SPNamedView *namedview);
 
 #endif /* !INKSCAPE_SP_NAMEDVIEW_H */
 
@@ -113,4 +122,4 @@ void sp_namedview_toggle_guides(SPDocument *doc, Inkscape::XML::Node *repr);
   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 :