Code

Don't display canvas text (length info) in lpe-ruler any more; add many more options
[inkscape.git] / src / live_effects / lpe-ruler.h
index 48ca5d46f653b69e144d8ea94cba3bc07b22012f..0d5bf29e09aefc400c3149cfa9b9eb9577b76868 100644 (file)
 
 #include "live_effects/effect.h"
 #include "live_effects/parameter/text.h"
-#include "live_effects/parameter/unit.h"
+#include "live_effects/parameter/enum.h"
+#include "live_effects/parameter/bool.h"
 
 namespace Inkscape {
 namespace LivePathEffect {
 
+enum MarkType {
+    MARK_MAJOR,
+    MARK_MINOR
+};
+
+enum MarkDirType {
+    MARKDIR_LEFT,
+    MARKDIR_RIGHT,
+    MARKDIR_BOTH,
+};
+
 class LPERuler : public Effect {
 public:
     LPERuler(LivePathEffectObject *lpeobject);
@@ -30,11 +42,19 @@ public:
     virtual Geom::Piecewise<Geom::D2<Geom::SBasis> > doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & pwd2_in);
 
 private:
+    Geom::Piecewise<Geom::D2<Geom::SBasis> > ruler_mark(Geom::Point const &A, Geom::Point const &n, MarkType marktype);
+
     ScalarParam mark_distance;
     ScalarParam mark_length;
-    ScalarParam scale;
-    TextParamInternal info_text;
-    UnitParam unit;
+    ScalarParam minor_mark_length;
+    ScalarParam major_mark_steps;
+    ScalarParam shift;
+    EnumParam<MarkDirType> mark_dir;
+    ScalarParam offset;
+    BoolParam draw_border_marks;
+
+    static Geom::Point n_major, n_minor; // used for internal computations
+
     LPERuler(const LPERuler&);
     LPERuler& operator=(const LPERuler&);
 };