? inkscape/doxygen
? inkscape (copie)/doxygen
Index: inkscape/ChangeLog
===================================================================
RCS file: /cvsroot/inkscape/inkscape/ChangeLog,v
retrieving revision 1.1682
diff -u -p -u -3 -r1.1682 ChangeLog
--- inkscape/ChangeLog	4 Dec 2005 20:22:44 -0000	1.1682
+++ inkscape/ChangeLog	5 Dec 2005 16:45:29 -0000
@@ -1,3 +1,26 @@
+2005-12-05  Mathieu Dimanche <mdimanche@...8...>
+
+    * src/snapper.cpp, src/snapper.h: 
+    Added visual feedback of snapped guides
+    Added a virtual highlight_snapped_line() function to the prototype
+
+    * src/guide-snapper.cpp, src/guide-snapper.h: 
+    Added the new highlight_snapped_line() function, Guides now
+    highlight when an object selection is snapped against them.
+
+    * src/grid-snapper.cpp, src/grid-snapper.h: 
+    Added the new highlight_snapped_line function, empty for now.
+
+    * src/sp-namedview.cpp, src/sp-namedview.h: 
+    Added a new reset_snapped_visual_feedback() function to downlight 
+    every temporary visual feedback provided during snapping.
+
+    * src/select-context.cpp, src/rect-context.cpp: 
+    
+    Added calls to reset_snapped_visual_feedback() before dragging and 
+    when dragging is finished.
+
+
 2005-12-04  Ted Gould  <ted@...11...>
 
 	* po/POTFILES.in:
Index: inkscape/src/grid-snapper.cpp
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/grid-snapper.cpp,v
retrieving revision 1.2
diff -u -p -u -3 -r1.2 grid-snapper.cpp
--- inkscape/src/grid-snapper.cpp	30 Nov 2005 14:12:31 -0000	1.2
+++ inkscape/src/grid-snapper.cpp	5 Dec 2005 16:45:29 -0000
@@ -50,6 +50,17 @@ Snapper::LineList GridSnapper::get_snap_
     return s;
 }
 
+/**
+ * Provide visual feedback of a snapped line in the grid.  
+ * @return True if a line was showed.
+ * TODO: create a temporary line (on the sketch layer ?)
+ */
+bool GridSnapper::highlight_snapped_line(NR::Point const normal, NR::Coord const position) const
+{
+    return false;
+}
+
+
 /*
   Local Variables:
   mode:c++
Index: inkscape/src/grid-snapper.h
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/grid-snapper.h,v
retrieving revision 1.2
diff -u -p -u -3 -r1.2 grid-snapper.h
--- inkscape/src/grid-snapper.h	30 Nov 2005 14:12:31 -0000	1.2
+++ inkscape/src/grid-snapper.h	5 Dec 2005 16:45:29 -0000
@@ -25,6 +25,9 @@ public:
 
 private:    
     LineList get_snap_lines(NR::Point const &p) const;
+
+    bool highlight_snapped_line(NR::Point const normal, NR::Coord const position) const;
+
 };
 
 #endif
Index: inkscape/src/guide-snapper.cpp
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/guide-snapper.cpp,v
retrieving revision 1.2
diff -u -p -u -3 -r1.2 guide-snapper.cpp
--- inkscape/src/guide-snapper.cpp	30 Nov 2005 14:12:31 -0000	1.2
+++ inkscape/src/guide-snapper.cpp	5 Dec 2005 16:45:29 -0000
@@ -17,6 +17,8 @@
 #include "sp-namedview.h"
 #include "sp-guide.h"
 #include "guide-snapper.h"
+#include "display/guideline.h"
+
 
 GuideSnapper::GuideSnapper(SPNamedView const *nv, NR::Coord const d) : Snapper(nv, d)
 {
@@ -35,6 +37,31 @@ Snapper::LineList GuideSnapper::get_snap
     return s;
 }
 
+
+/**
+ * Provide visual feedback of a snapped guide.  
+ * @return True if a guide was showed.
+ */
+bool GuideSnapper::highlight_snapped_line(NR::Point const normal, NR::Coord const position) const
+{
+    bool guidefound;
+
+    guidefound = false;
+
+    for (GSList const *l = _named_view->guides; l != NULL; l = l->next) {
+        SPGuide &g = *SP_GUIDE(l->data);
+        if ( ( g.normal == normal ) && ( g.position == position ) ) {
+            for (GSList *l2 = g.views; l2 != NULL; l2 = l2->next) {
+                sp_guideline_set_color(SP_GUIDELINE(l2->data), _named_view->guidehicolor);
+            }
+            guidefound = true;
+        }
+    }
+    
+    return guidefound;
+}
+
+
 /*
   Local Variables:
   mode:c++
Index: inkscape/src/guide-snapper.h
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/guide-snapper.h,v
retrieving revision 1.2
diff -u -p -u -3 -r1.2 guide-snapper.h
--- inkscape/src/guide-snapper.h	30 Nov 2005 14:12:31 -0000	1.2
+++ inkscape/src/guide-snapper.h	5 Dec 2005 16:45:29 -0000
@@ -29,6 +29,9 @@ public:
 
 private:
     LineList get_snap_lines(NR::Point const &p) const;
+    
+    bool highlight_snapped_line(NR::Point const normal, NR::Coord const position) const;
+
 };
 
 #endif
Index: inkscape/src/object-edit.cpp
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/object-edit.cpp,v
retrieving revision 1.58
diff -u -p -u -3 -r1.58 object-edit.cpp
--- inkscape/src/object-edit.cpp	26 Nov 2005 00:11:59 -0000	1.58
+++ inkscape/src/object-edit.cpp	5 Dec 2005 16:45:29 -0000
@@ -341,7 +341,6 @@ static NR::Point rect_snap_knot_position
 {
     SPDesktop const *desktop = inkscape_active_desktop();
     NR::Point s = sp_desktop_dt2root_xy_point(desktop, p);
-    namedview_free_snap_all_types(SP_DT_NAMEDVIEW(desktop), s);
     return sp_desktop_root2dt_xy_point(desktop, s);
 }
 
Index: inkscape/src/rect-context.cpp
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/rect-context.cpp,v
retrieving revision 1.77
diff -u -p -u -3 -r1.77 rect-context.cpp
--- inkscape/src/rect-context.cpp	26 Nov 2005 00:11:59 -0000	1.77
+++ inkscape/src/rect-context.cpp	5 Dec 2005 16:45:30 -0000
@@ -371,6 +371,10 @@ static gint sp_rect_context_root_handler
             ret = TRUE;
             sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate),
                                   event->button.time);
+            
+            // reset snapping visual feedback
+            desktop->namedview->reset_snapped_visual_feedback();
+
         }
         break;
     case GDK_KEY_PRESS:
@@ -443,6 +447,8 @@ static gint sp_rect_context_root_handler
 
 static void sp_rect_drag(SPRectContext &rc, NR::Point const pt, guint state)
 {
+
+
     SPDesktop *desktop = SP_EVENT_CONTEXT(&rc)->desktop;
 
     if (!rc.item) {
@@ -469,6 +475,11 @@ static void sp_rect_drag(SPRectContext &
         rc.item->updateRepr();
     }
 
+
+    // reset snapping visual feedback
+    desktop->namedview->reset_snapped_visual_feedback();
+
+
     NR::Point p0, p1;
     if ( state & GDK_CONTROL_MASK ) {
         NR::Point delta = pt - rc.center;
Index: inkscape/src/select-context.cpp
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/select-context.cpp,v
retrieving revision 1.114
diff -u -p -u -3 -r1.114 select-context.cpp
--- inkscape/src/select-context.cpp	24 Nov 2005 08:37:26 -0000	1.114
+++ inkscape/src/select-context.cpp	5 Dec 2005 16:45:30 -0000
@@ -631,6 +631,10 @@ sp_select_context_root_handler(SPEventCo
             sc->button_press_shift = false;
             sc->button_press_ctrl = false;
             sc->button_press_alt = false;
+
+            // reset snapping visual feedback
+            desktop->namedview->reset_snapped_visual_feedback();
+
             break;
 
         case GDK_KEY_PRESS: // keybindings for select context
@@ -841,6 +845,10 @@ static void sp_selection_moveto(SPSelTra
         namedview_free_snap(desktop->namedview, Snapper::SNAP_POINT, dxy);
     } else if ((state & GDK_SHIFT_MASK) == 0) {
         /* Snap as normal.  Shift-drag will not snap to the grid even if it is enabled. */
+        
+        // reset snapping visual feedback
+        desktop->namedview->reset_snapped_visual_feedback();
+        
         for (unsigned int dim = 0 ; dim < 2 ; ++dim) {
             std::pair<NR::Coord, bool> b = namedview_dim_snap_list (desktop->namedview, Snapper::BBOX_POINT, seltrans->bbox_points,
                                                                     dxy[dim], NR::Dim2(dim));
Index: inkscape/src/snap.cpp
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/snap.cpp,v
retrieving revision 1.12
diff -u -p -u -3 -r1.12 snap.cpp
--- inkscape/src/snap.cpp	30 Nov 2005 17:23:36 -0000	1.12
+++ inkscape/src/snap.cpp	5 Dec 2005 16:45:30 -0000
@@ -24,6 +24,7 @@
 #include "sp-namedview.h"
 #include "snap.h"
 #include "geom.h"
+
 #include <libnr/nr-point-fns.h>
 #include <libnr/nr-scale.h>
 #include <libnr/nr-scale-ops.h>
@@ -93,7 +94,7 @@ NR::Coord namedview_free_snap(SPNamedVie
  * \return The distance from \a req to the snap point along the vector \a d,
  * or \c NR_HUGE if no snap point was found.
  *
- * \pre d ����� (0, 0).
+ * \pre d ��� (0, 0).
  */
 NR::Coord namedview_vector_snap(SPNamedView const *nv, Snapper::PointType t, 
                                 NR::Point &req, NR::Point const &d)
@@ -357,7 +358,6 @@ std::pair<int, NR::Point> namedview_free
 }
 
 
-
 /*
   Local Variables:
   mode:c++
Index: inkscape/src/snap.h
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/snap.h,v
retrieving revision 1.9
diff -u -p -u -3 -r1.9 snap.h
--- inkscape/src/snap.h	30 Nov 2005 17:24:14 -0000	1.9
+++ inkscape/src/snap.h	5 Dec 2005 16:45:30 -0000
@@ -63,7 +63,6 @@ NR::Coord namedview_free_snap_all_types(
 NR::Coord namedview_vector_snap_all_types(SPNamedView const *nv, NR::Point &req, NR::Point const &d);
 NR::Coord namedview_dim_snap_all_types(SPNamedView const *nv, NR::Point& req, NR::Dim2 const dim);
 
-
 #endif /* !SEEN_SNAP_H */
 
 /*
Index: inkscape/src/snapper.cpp
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/snapper.cpp,v
retrieving revision 1.3
diff -u -p -u -3 -r1.3 snapper.cpp
--- inkscape/src/snapper.cpp	30 Nov 2005 14:12:31 -0000	1.3
+++ inkscape/src/snapper.cpp	5 Dec 2005 16:45:30 -0000
@@ -133,11 +133,16 @@ NR::Coord Snapper::vector_snap(PointType
         if (intersector_line_intersection(n2, d2, i->first, i->second, trial) == INTERSECTS) {
             const NR::Coord dist = L2(trial - req);
             if (dist < upper) {
+                
                 upper = best = dist;
                 snapped = trial;
+
+                // the snapping occured, provide visual feedback
+                highlight_snapped_line(i->first, i->second);
             }
+
         }
-    }
+}
 
     req = snapped;
     return best;
Index: inkscape/src/snapper.h
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/snapper.h,v
retrieving revision 1.3
diff -u -p -u -3 -r1.3 snapper.h
--- inkscape/src/snapper.h	30 Nov 2005 16:50:11 -0000	1.3
+++ inkscape/src/snapper.h	5 Dec 2005 16:45:30 -0000
@@ -52,7 +52,16 @@ protected:
      *  \return List of lines that we should try snapping to.
      */
     virtual LineList get_snap_lines(NR::Point const &p) const = 0;
-    
+
+    /**
+     * Provide visual feedback of a snapped guide.  
+     *  \param normal Normal of the line to show.
+     *  \param position Point through which the line passes.
+     *  \return True if the line was showed.
+     */
+    virtual bool highlight_snapped_line(NR::Point const normal, NR::Coord const position) const = 0;
+
+
     SPNamedView const *_named_view;
     
 private:
Index: inkscape/src/sp-namedview.cpp
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/sp-namedview.cpp,v
retrieving revision 1.78
diff -u -p -u -3 -r1.78 sp-namedview.cpp
--- inkscape/src/sp-namedview.cpp	2 Dec 2005 14:13:43 -0000	1.78
+++ inkscape/src/sp-namedview.cpp	5 Dec 2005 16:45:30 -0000
@@ -36,6 +36,8 @@
 #include "sp-namedview.h"
 #include "prefs-utils.h"
 #include "desktop.h"
+#include "display/guideline.h"
+
 
 #include "isnan.h" //temp fox for isnan().  include last
 
@@ -931,6 +933,27 @@ SPMetric SPNamedView::getDefaultMetric()
 }
 
 
+/**
+ *  Downlight or delete all temporary highlighted item used
+ *  to provide a visual feedback of where elements where snapped
+ *  \return True if all visual feedback was cleared
+ */
+bool
+SPNamedView::reset_snapped_visual_feedback() {
+
+    // downlight all the guides (for now)
+   for (GSList const *l = guides; l != NULL; l = l->next) {
+        SPGuide &g = *SP_GUIDE(l->data);
+        for (GSList *l2 = g.views; l2 != NULL; l2 = l2->next) {
+            sp_guideline_set_color(SP_GUIDELINE(l2->data), guidecolor);
+        }
+    }
+
+    // TODO: downlight grid items (when they'll be highlightable)
+
+    return true;
+}
+
 /*
   Local Variables:
   mode:c++
Index: inkscape/src/sp-namedview.h
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/sp-namedview.h,v
retrieving revision 1.29
diff -u -p -u -3 -r1.29 sp-namedview.h
--- inkscape/src/sp-namedview.h	2 Dec 2005 14:13:43 -0000	1.29
+++ inkscape/src/sp-namedview.h	5 Dec 2005 16:45:30 -0000
@@ -90,6 +90,9 @@ struct SPNamedView : public SPObjectGrou
     guint getViewCount();
     GSList const *getViewList() const;
     SPMetric getDefaultMetric() const;
+
+    bool reset_snapped_visual_feedback();
+
 };
 
 struct SPNamedViewClass {
Index: inkscape (copie)/src/grid-snapper.cpp
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/grid-snapper.cpp,v
retrieving revision 1.2
diff -u -p -u -3 -r1.2 grid-snapper.cpp
--- inkscape (copie)/src/grid-snapper.cpp	30 Nov 2005 14:12:31 -0000	1.2
+++ inkscape (copie)/src/grid-snapper.cpp	5 Dec 2005 16:45:30 -0000
@@ -50,6 +50,17 @@ Snapper::LineList GridSnapper::get_snap_
     return s;
 }
 
+/**
+ * Provide visual feedback of a snapped line in the grid.  
+ * @return True if a line was showed.
+ * TODO: create a temporary line (on the sketch layer ?)
+ */
+bool GridSnapper::highlight_snapped_line(NR::Point const normal, NR::Coord const position) const
+{
+    return false;
+}
+
+
 /*
   Local Variables:
   mode:c++
Index: inkscape (copie)/src/grid-snapper.h
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/grid-snapper.h,v
retrieving revision 1.2
diff -u -p -u -3 -r1.2 grid-snapper.h
--- inkscape (copie)/src/grid-snapper.h	30 Nov 2005 14:12:31 -0000	1.2
+++ inkscape (copie)/src/grid-snapper.h	5 Dec 2005 16:45:30 -0000
@@ -25,6 +25,9 @@ public:
 
 private:    
     LineList get_snap_lines(NR::Point const &p) const;
+
+    bool highlight_snapped_line(NR::Point const normal, NR::Coord const position) const;
+
 };
 
 #endif
Index: inkscape (copie)/src/guide-snapper.cpp
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/guide-snapper.cpp,v
retrieving revision 1.2
diff -u -p -u -3 -r1.2 guide-snapper.cpp
--- inkscape (copie)/src/guide-snapper.cpp	30 Nov 2005 14:12:31 -0000	1.2
+++ inkscape (copie)/src/guide-snapper.cpp	5 Dec 2005 16:45:30 -0000
@@ -17,6 +17,8 @@
 #include "sp-namedview.h"
 #include "sp-guide.h"
 #include "guide-snapper.h"
+#include "display/guideline.h"
+
 
 GuideSnapper::GuideSnapper(SPNamedView const *nv, NR::Coord const d) : Snapper(nv, d)
 {
@@ -35,6 +37,31 @@ Snapper::LineList GuideSnapper::get_snap
     return s;
 }
 
+
+/**
+ * Provide visual feedback of a snapped guide.  
+ * @return True if a guide was showed.
+ */
+bool GuideSnapper::highlight_snapped_line(NR::Point const normal, NR::Coord const position) const
+{
+    bool guidefound;
+
+    guidefound = false;
+
+    for (GSList const *l = _named_view->guides; l != NULL; l = l->next) {
+        SPGuide &g = *SP_GUIDE(l->data);
+        if ( ( g.normal == normal ) && ( g.position == position ) ) {
+            for (GSList *l2 = g.views; l2 != NULL; l2 = l2->next) {
+                sp_guideline_set_color(SP_GUIDELINE(l2->data), _named_view->guidehicolor);
+            }
+            guidefound = true;
+        }
+    }
+    
+    return guidefound;
+}
+
+
 /*
   Local Variables:
   mode:c++
Index: inkscape (copie)/src/guide-snapper.h
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/guide-snapper.h,v
retrieving revision 1.2
diff -u -p -u -3 -r1.2 guide-snapper.h
--- inkscape (copie)/src/guide-snapper.h	30 Nov 2005 14:12:31 -0000	1.2
+++ inkscape (copie)/src/guide-snapper.h	5 Dec 2005 16:45:30 -0000
@@ -29,6 +29,9 @@ public:
 
 private:
     LineList get_snap_lines(NR::Point const &p) const;
+    
+    bool highlight_snapped_line(NR::Point const normal, NR::Coord const position) const;
+
 };
 
 #endif
Index: inkscape (copie)/src/object-edit.cpp
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/object-edit.cpp,v
retrieving revision 1.58
diff -u -p -u -3 -r1.58 object-edit.cpp
--- inkscape (copie)/src/object-edit.cpp	26 Nov 2005 00:11:59 -0000	1.58
+++ inkscape (copie)/src/object-edit.cpp	5 Dec 2005 16:45:30 -0000
@@ -341,7 +341,6 @@ static NR::Point rect_snap_knot_position
 {
     SPDesktop const *desktop = inkscape_active_desktop();
     NR::Point s = sp_desktop_dt2root_xy_point(desktop, p);
-    namedview_free_snap_all_types(SP_DT_NAMEDVIEW(desktop), s);
     return sp_desktop_root2dt_xy_point(desktop, s);
 }
 
Index: inkscape (copie)/src/rect-context.cpp
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/rect-context.cpp,v
retrieving revision 1.77
diff -u -p -u -3 -r1.77 rect-context.cpp
--- inkscape (copie)/src/rect-context.cpp	26 Nov 2005 00:11:59 -0000	1.77
+++ inkscape (copie)/src/rect-context.cpp	5 Dec 2005 16:45:30 -0000
@@ -371,6 +371,10 @@ static gint sp_rect_context_root_handler
             ret = TRUE;
             sp_canvas_item_ungrab(SP_CANVAS_ITEM(desktop->acetate),
                                   event->button.time);
+            
+            // reset snapping visual feedback
+            desktop->namedview->reset_snapped_visual_feedback();
+
         }
         break;
     case GDK_KEY_PRESS:
@@ -443,6 +447,8 @@ static gint sp_rect_context_root_handler
 
 static void sp_rect_drag(SPRectContext &rc, NR::Point const pt, guint state)
 {
+
+
     SPDesktop *desktop = SP_EVENT_CONTEXT(&rc)->desktop;
 
     if (!rc.item) {
@@ -469,6 +475,11 @@ static void sp_rect_drag(SPRectContext &
         rc.item->updateRepr();
     }
 
+
+    // reset snapping visual feedback
+    desktop->namedview->reset_snapped_visual_feedback();
+
+
     NR::Point p0, p1;
     if ( state & GDK_CONTROL_MASK ) {
         NR::Point delta = pt - rc.center;
Index: inkscape (copie)/src/select-context.cpp
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/select-context.cpp,v
retrieving revision 1.114
diff -u -p -u -3 -r1.114 select-context.cpp
--- inkscape (copie)/src/select-context.cpp	24 Nov 2005 08:37:26 -0000	1.114
+++ inkscape (copie)/src/select-context.cpp	5 Dec 2005 16:45:30 -0000
@@ -631,6 +631,10 @@ sp_select_context_root_handler(SPEventCo
             sc->button_press_shift = false;
             sc->button_press_ctrl = false;
             sc->button_press_alt = false;
+
+            // reset snapping visual feedback
+            desktop->namedview->reset_snapped_visual_feedback();
+
             break;
 
         case GDK_KEY_PRESS: // keybindings for select context
@@ -841,6 +845,10 @@ static void sp_selection_moveto(SPSelTra
         namedview_free_snap(desktop->namedview, Snapper::SNAP_POINT, dxy);
     } else if ((state & GDK_SHIFT_MASK) == 0) {
         /* Snap as normal.  Shift-drag will not snap to the grid even if it is enabled. */
+        
+        // reset snapping visual feedback
+        desktop->namedview->reset_snapped_visual_feedback();
+        
         for (unsigned int dim = 0 ; dim < 2 ; ++dim) {
             std::pair<NR::Coord, bool> b = namedview_dim_snap_list (desktop->namedview, Snapper::BBOX_POINT, seltrans->bbox_points,
                                                                     dxy[dim], NR::Dim2(dim));
Index: inkscape (copie)/src/snap.cpp
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/snap.cpp,v
retrieving revision 1.12
diff -u -p -u -3 -r1.12 snap.cpp
--- inkscape (copie)/src/snap.cpp	30 Nov 2005 17:23:36 -0000	1.12
+++ inkscape (copie)/src/snap.cpp	5 Dec 2005 16:45:30 -0000
@@ -24,6 +24,7 @@
 #include "sp-namedview.h"
 #include "snap.h"
 #include "geom.h"
+
 #include <libnr/nr-point-fns.h>
 #include <libnr/nr-scale.h>
 #include <libnr/nr-scale-ops.h>
@@ -93,7 +94,7 @@ NR::Coord namedview_free_snap(SPNamedVie
  * \return The distance from \a req to the snap point along the vector \a d,
  * or \c NR_HUGE if no snap point was found.
  *
- * \pre d ����� (0, 0).
+ * \pre d ��� (0, 0).
  */
 NR::Coord namedview_vector_snap(SPNamedView const *nv, Snapper::PointType t, 
                                 NR::Point &req, NR::Point const &d)
@@ -357,7 +358,6 @@ std::pair<int, NR::Point> namedview_free
 }
 
 
-
 /*
   Local Variables:
   mode:c++
Index: inkscape (copie)/src/snap.h
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/snap.h,v
retrieving revision 1.9
diff -u -p -u -3 -r1.9 snap.h
--- inkscape (copie)/src/snap.h	30 Nov 2005 17:24:14 -0000	1.9
+++ inkscape (copie)/src/snap.h	5 Dec 2005 16:45:30 -0000
@@ -63,7 +63,6 @@ NR::Coord namedview_free_snap_all_types(
 NR::Coord namedview_vector_snap_all_types(SPNamedView const *nv, NR::Point &req, NR::Point const &d);
 NR::Coord namedview_dim_snap_all_types(SPNamedView const *nv, NR::Point& req, NR::Dim2 const dim);
 
-
 #endif /* !SEEN_SNAP_H */
 
 /*
Index: inkscape (copie)/src/snapper.cpp
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/snapper.cpp,v
retrieving revision 1.3
diff -u -p -u -3 -r1.3 snapper.cpp
--- inkscape (copie)/src/snapper.cpp	30 Nov 2005 14:12:31 -0000	1.3
+++ inkscape (copie)/src/snapper.cpp	5 Dec 2005 16:45:30 -0000
@@ -133,11 +133,16 @@ NR::Coord Snapper::vector_snap(PointType
         if (intersector_line_intersection(n2, d2, i->first, i->second, trial) == INTERSECTS) {
             const NR::Coord dist = L2(trial - req);
             if (dist < upper) {
+                
                 upper = best = dist;
                 snapped = trial;
+
+                // the snapping occured, provide visual feedback
+                highlight_snapped_line(i->first, i->second);
             }
+
         }
-    }
+}
 
     req = snapped;
     return best;
Index: inkscape (copie)/src/snapper.h
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/snapper.h,v
retrieving revision 1.3
diff -u -p -u -3 -r1.3 snapper.h
--- inkscape (copie)/src/snapper.h	30 Nov 2005 16:50:11 -0000	1.3
+++ inkscape (copie)/src/snapper.h	5 Dec 2005 16:45:30 -0000
@@ -52,7 +52,16 @@ protected:
      *  \return List of lines that we should try snapping to.
      */
     virtual LineList get_snap_lines(NR::Point const &p) const = 0;
-    
+
+    /**
+     * Provide visual feedback of a snapped guide.  
+     *  \param normal Normal of the line to show.
+     *  \param position Point through which the line passes.
+     *  \return True if the line was showed.
+     */
+    virtual bool highlight_snapped_line(NR::Point const normal, NR::Coord const position) const = 0;
+
+
     SPNamedView const *_named_view;
     
 private:
Index: inkscape (copie)/src/sp-namedview.cpp
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/sp-namedview.cpp,v
retrieving revision 1.75
diff -u -p -u -3 -r1.75 sp-namedview.cpp
--- inkscape (copie)/src/sp-namedview.cpp	26 Nov 2005 00:11:59 -0000	1.75
+++ inkscape (copie)/src/sp-namedview.cpp	5 Dec 2005 16:45:30 -0000
@@ -36,6 +36,8 @@
 #include "sp-namedview.h"
 #include "prefs-utils.h"
 #include "desktop.h"
+#include "display/guideline.h"
+
 
 #include "isnan.h" //temp fox for isnan().  include last
 
@@ -982,6 +984,27 @@ SPNamedView::getDefaultMetric() const
 }
 
 
+/**
+ *  Downlight or delete all temporary highlighted item used
+ *  to provide a visual feedback of where elements where snapped
+ *  \return True if all visual feedback was cleared
+ */
+bool
+SPNamedView::reset_snapped_visual_feedback() {
+
+    // downlight all the guides (for now)
+   for (GSList const *l = guides; l != NULL; l = l->next) {
+        SPGuide &g = *SP_GUIDE(l->data);
+        for (GSList *l2 = g.views; l2 != NULL; l2 = l2->next) {
+            sp_guideline_set_color(SP_GUIDELINE(l2->data), guidecolor);
+        }
+    }
+
+    // TODO: downlight grid items (when they'll be highlightable)
+
+    return true;
+}
+
 /*
   Local Variables:
   mode:c++
Index: inkscape (copie)/src/sp-namedview.h
===================================================================
RCS file: /cvsroot/inkscape/inkscape/src/sp-namedview.h,v
retrieving revision 1.28
diff -u -p -u -3 -r1.28 sp-namedview.h
--- inkscape (copie)/src/sp-namedview.h	30 Nov 2005 12:18:31 -0000	1.28
+++ inkscape (copie)/src/sp-namedview.h	5 Dec 2005 16:45:30 -0000
@@ -86,6 +86,9 @@ struct SPNamedView : public SPObjectGrou
     gint viewcount;
 
     SPMetric getDefaultMetric() const;
+
+    bool reset_snapped_visual_feedback();
+
 };
 
 struct SPNamedViewClass {
