X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Frubberband.h;h=1f4b7d2eaec6b3b2be2154234999c2a46da1aff7;hb=7b51296159813ffbc382e4decef735f222ee23f8;hp=36e9c4d8ec6e89e62c23525ae53769160cf3d4bd;hpb=3e12f5342d147c05ccad3d80cacc4bcd74a2c25d;p=inkscape.git diff --git a/src/rubberband.h b/src/rubberband.h index 36e9c4d8e..1f4b7d2ea 100644 --- a/src/rubberband.h +++ b/src/rubberband.h @@ -15,13 +15,21 @@ */ #include "forward.h" -#include "libnr/nr-forward.h" -#include "libnr/nr-point.h" -#include "libnr/nr-maybe.h" +#include +#include +#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 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 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 _points; + + CtrlRect *_rect; + SPCanvasItem *_touchpath; + SPCurve *_touchpath_curve; + + void delete_canvas_items(); + bool _started; + int _mode; }; }