Code

Add interface to check whether or not rubberband operation has been started
authorjohncoswell <johncoswell@users.sourceforge.net>
Wed, 4 Oct 2006 01:30:15 +0000 (01:30 +0000)
committerjohncoswell <johncoswell@users.sourceforge.net>
Wed, 4 Oct 2006 01:30:15 +0000 (01:30 +0000)
src/rubberband.cpp
src/rubberband.h

index b6211c519bafcc1c85517b45ce09470c24f8f872..9ada46f523a40818825f0e05d881590db962ac27 100644 (file)
@@ -21,7 +21,7 @@
 Inkscape::Rubberband *Inkscape::Rubberband::_instance = NULL;
 
 Inkscape::Rubberband::Rubberband()
-    : _desktop(SP_ACTIVE_DESKTOP), _canvas(NULL)
+    : _desktop(SP_ACTIVE_DESKTOP), _canvas(NULL), _started(false)
 {
 
 }
@@ -31,6 +31,7 @@ void Inkscape::Rubberband::start(SPDesktop *d, NR::Point const &p)
     stop();
     _desktop = d;
     _start = p;
+    _started = true;
 
     sp_canvas_force_full_redraw_after_interruptions(_desktop->canvas, 5);
 }
@@ -42,6 +43,8 @@ void Inkscape::Rubberband::stop()
         _canvas = NULL;
         sp_canvas_end_forced_full_redraws(_desktop->canvas);
     }
+    
+    _started = false;
 }
 
 void Inkscape::Rubberband::move(NR::Point const &p)
@@ -74,6 +77,11 @@ Inkscape::Rubberband *Inkscape::Rubberband::get()
     return _instance;
 }
 
+bool Inkscape::Rubberband::is_started()
+{
+    return _started;
+}
+
 /*
   Local Variables:
   mode:c++
index 9dd0b6025e96cb08a825ef467ee4baa2b96c501b..36e9c4d8ec6e89e62c23525ae53769160cf3d4bd 100644 (file)
@@ -34,6 +34,7 @@ public:
     void move(NR::Point const &p);
     NR::Maybe<NR::Rect> getRectangle() const;
     void stop();
+    bool is_started();
 
     static Rubberband* get();
 
@@ -46,6 +47,7 @@ private:
     NR::Point _start;
     NR::Point _end;
     CtrlRect *_canvas;
+    bool _started;
 };
 
 }