Code

Use subdirectories with icon sizes.
[inkscape.git] / src / rubberband.h
index 36e9c4d8ec6e89e62c23525ae53769160cf3d4bd..57e4ea2a394e159b499b0369173a7537452bfcd8 100644 (file)
  */
 
 #include "forward.h"
-#include "libnr/nr-forward.h"
-#include "libnr/nr-point.h"
-#include "libnr/nr-maybe.h"
+#include <boost/optional.hpp>
+#include <vector>
+#include <2geom/point.h>
+#include <2geom/rect.h>
 
 /* fixme: do multidocument safe */
 
 class CtrlRect;
+class SPCanvasItem;
+class SPCurve;
+
+enum {
+    RUBBERBAND_MODE_RECT,
+    RUBBERBAND_MODE_TOUCHPATH
+};
 
 namespace Inkscape
 {
@@ -30,24 +38,38 @@ class Rubberband
 {
 public:
 
-    void start(SPDesktop *desktop, NR::Point const &p);
-    void move(NR::Point const &p);
-    NR::Maybe<NR::Rect> getRectangle() const;
+    void start(SPDesktop *desktop, Geom::Point const &p);
+    void move(Geom::Point const &p);
+    Geom::OptRect getRectangle() const;
     void stop();
     bool is_started();
 
-    static Rubberband* get();
+    inline int getMode() {return _mode;}
+    inline std::vector<Geom::Point> getPoints() {return _points;}
+
+    void setMode(int mode);
+
+    static Rubberband* get(SPDesktop *desktop);
 
 private:
 
-    Rubberband();
+    Rubberband(SPDesktop *desktop);
     static Rubberband* _instance;
     
     SPDesktop *_desktop;
-    NR::Point _start;
-    NR::Point _end;
-    CtrlRect *_canvas;
+    Geom::Point _start;
+    Geom::Point _end;
+
+    std::vector<Geom::Point> _points;
+
+    CtrlRect *_rect;
+    SPCanvasItem *_touchpath;
+    SPCurve *_touchpath_curve;
+
+    void delete_canvas_items();
+
     bool _started;
+    int _mode;
 };
 
 }
@@ -63,4 +85,4 @@ private:
   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 :