Code

convert almost all libnrtype to Geom::
[inkscape.git] / src / display / canvas-axonomgrid.h
index a5bc33fa933bf9b423cd41b738ac3ad4499ac501..f8dc8e25a983ae81454185c14f414378d865e643 100644 (file)
@@ -17,7 +17,6 @@
 
 #include "ui/widget/registered-widget.h"
 #include "ui/widget/registry.h"
-#include "ui/widget/tolerance-slider.h"
 
 #include "xml/node-event-vector.h"
 
@@ -41,21 +40,14 @@ public:
     
     void readRepr();
     void onReprAttrChanged (Inkscape::XML::Node * repr, const gchar *key, const gchar *oldval, const gchar *newval, bool is_interactive);
-    
-    Gtk::Widget & getWidget();
-
-    SPUnit const* gridunit;
 
-    NR::Point origin;     /**< Origin of the grid */
     double lengthy;       /**< The lengths of the primary y-axis */
     double angle_deg[3];  /**< Angle of each axis (note that angle[2] == 0) */
     double angle_rad[3];  /**< Angle of each axis (note that angle[2] == 0) */
     double tan_angle[3];  /**< tan(angle[.]) */
-    guint32 color;        /**< Color for normal lines */
-    guint32 empcolor;     /**< Color for emphasis lines */
-    gint empspacing;      /**< Spacing between emphasis lines */
+    
     bool scaled;          /**< Whether the grid is in scaled mode */
-
+    
     NR::Point ow;         /**< Transformed origin by the affine for the zoom */
     double lyw;           /**< Transformed length y by the affine for the zoom */
     double lxw_x;
@@ -63,22 +55,15 @@ public:
     double spacing_ylines;
                           
     NR::Point sw;          /**< the scaling factors of the affine transform */
-    
-    
+
+protected:
+    virtual Gtk::Widget * newSpecificWidget();
+
 private:
     CanvasAxonomGrid(const CanvasAxonomGrid&);
     CanvasAxonomGrid& operator=(const CanvasAxonomGrid&);
     
     void updateWidgets();
-
-    Gtk::Table table;
-    
-    Inkscape::UI::Widget::RegisteredCheckButton _rcbgrid, _rcbsnbb, _rcbsnnod;
-    Inkscape::UI::Widget::RegisteredUnitMenu    _rumg, _rums;
-    Inkscape::UI::Widget::RegisteredScalarUnit  _rsu_ox, _rsu_oy, _rsu_sy;
-    Inkscape::UI::Widget::RegisteredScalar      _rsu_ax, _rsu_az;
-    Inkscape::UI::Widget::RegisteredColorPicker _rcp_gcol, _rcp_gmcol;
-    Inkscape::UI::Widget::RegisteredSuffixedInteger _rsi;
 };
 
 
@@ -86,11 +71,11 @@ private:
 class CanvasAxonomGridSnapper : public LineSnapper
 {
 public:
-    CanvasAxonomGridSnapper(CanvasAxonomGrid *grid, SPNamedView const *nv, NR::Coord const d);
+    CanvasAxonomGridSnapper(CanvasAxonomGrid *grid, SnapManager const *sm, Geom::Coord const d);
 
 private:    
-    LineList _getSnapLines(NR::Point const &p) const;
-    void _addSnappedLine(SnappedConstraints &sc, NR::Point const snapped_point, NR::Coord const snapped_distance, NR::Point const normal_to_line, const NR::Point point_on_line) const;
+    LineList _getSnapLines(Geom::Point const &p) const;
+    void _addSnappedLine(SnappedConstraints &sc, Geom::Point const snapped_point, Geom::Coord const snapped_distance, Geom::Point const normal_to_line, const Geom::Point point_on_line) const;
 
     CanvasAxonomGrid *grid;
 };