Code

Translations. POTFILES.in, inkcape.pot and fr.po updated.
[inkscape.git] / src / lpe-tool-context.cpp
index be465e32469b1eaf08d7b63163844306dfe1848e..f259492962d927d3d5421be5e529f26887428894 100644 (file)
@@ -4,6 +4,7 @@
  * Authors:
  *   Maximilian Albert <maximilian.albert@gmail.com>
  *   Lauris Kaplinski <lauris@kaplinski.com>
+ *   Abhishek Sharma
  *
  * Copyright (C) 1998 The Free Software Foundation
  * Copyright (C) 1999-2005 authors
@@ -22,7 +23,6 @@
 
 #include "macros.h"
 #include "forward.h"
-#include "pixmaps/cursor-node.xpm"
 #include "pixmaps/cursor-crosshairs.xpm"
 #include <gtk/gtk.h>
 #include "desktop.h"
@@ -179,9 +179,6 @@ sp_lpetool_context_setup(SPEventContext *ec)
     }
 
     lc->_lpetool_message_context = new Inkscape::MessageContext((ec->desktop)->messageStack());
-
-
-    lc->shape_editor->update_statusbar();
 }
 
 /**
@@ -193,13 +190,9 @@ sp_lpetool_context_selection_changed(Inkscape::Selection *selection, gpointer da
 {
     SPLPEToolContext *lc = SP_LPETOOL_CONTEXT(data);
 
-    // TODO: update ShapeEditorsCollective instead
-    lc->shape_editor->unset_item(SH_NODEPATH);
     lc->shape_editor->unset_item(SH_KNOTHOLDER);
     SPItem *item = selection->singleItem();
-    lc->shape_editor->set_item(item, SH_NODEPATH);
     lc->shape_editor->set_item(item, SH_KNOTHOLDER);
-    lc->shape_editor->update_statusbar();
 }
 
 static void
@@ -280,7 +273,6 @@ sp_lpetool_context_root_handler(SPEventContext *event_context, GdkEvent *event)
                 event_context->xp = (gint) event->button.x;
                 event_context->yp = (gint) event->button.y;
                 event_context->within_tolerance = true;
-                lc->shape_editor->cancel_hit();
 
                 using namespace Inkscape::LivePathEffect;
 
@@ -296,28 +288,6 @@ sp_lpetool_context_root_handler(SPEventContext *event_context, GdkEvent *event)
                 ret = ((SPEventContextClass *) lpetool_parent_class)->root_handler(event_context, event);
             }
             break;
-        case GDK_MOTION_NOTIFY:
-        {
-            if (!lc->shape_editor->has_nodepath() || selection->singleItem() == NULL) {
-                break;
-            }
-
-            bool over_stroke = false;
-            over_stroke = lc->shape_editor->is_over_stroke(Geom::Point(event->motion.x, event->motion.y), false);
-
-            if (over_stroke) {
-                event_context->cursor_shape = cursor_node_xpm;
-                event_context->hot_x = 1;
-                event_context->hot_y = 1;
-                sp_event_context_update_cursor(event_context);
-            } else {
-                lc->cursor_shape = cursor_crosshairs_xpm;
-                lc->hot_x = 7;
-                lc->hot_y = 7;
-                sp_event_context_update_cursor(event_context);
-            }
-        }
-        break;
 
 
     case GDK_BUTTON_RELEASE:
@@ -423,8 +393,8 @@ lpetool_context_switch_mode(SPLPEToolContext *lc, Inkscape::LivePathEffect::Effe
 
 void
 lpetool_get_limiting_bbox_corners(SPDocument *document, Geom::Point &A, Geom::Point &B) {
-    Geom::Coord w = sp_document_width(document);
-    Geom::Coord h = sp_document_height(document);
+    Geom::Coord w = document->getWidth();
+    Geom::Coord h = document->getHeight();
     Inkscape::Preferences *prefs = Inkscape::Preferences::get();
 
     double ulx = prefs->getDouble("/tools/lpetool/bbox_upperleftx", 0);
@@ -503,7 +473,7 @@ lpetool_create_measuring_items(SPLPEToolContext *lc, Inkscape::Selection *select
     for (GSList const *i = selection->itemList(); i != NULL; i = i->next) {
         if (SP_IS_PATH(i->data)) {
             path = SP_PATH(i->data);
-            curve = sp_shape_get_curve(SP_SHAPE(path));
+            curve = SP_SHAPE(path)->getCurve();
             Geom::Piecewise<Geom::D2<Geom::SBasis> > pwd2 = paths_to_pw(curve->get_pathvector());
             canvas_text = (SPCanvasText *) sp_canvastext_new(tmpgrp, lc->desktop, Geom::Point(0,0), "");
             if (!show)
@@ -545,7 +515,7 @@ lpetool_update_measuring_items(SPLPEToolContext *lc)
     std::map<SPPath *, SPCanvasItem*>::iterator i;
     for (i = lc->measuring_items->begin(); i != lc->measuring_items->end(); ++i) {
         path = i->first;
-        curve = sp_shape_get_curve(SP_SHAPE(path));
+        curve = SP_SHAPE(path)->getCurve();
         Geom::Piecewise<Geom::D2<Geom::SBasis> > pwd2 = Geom::paths_to_pw(curve->get_pathvector());
         SPUnitId unitid = static_cast<SPUnitId>(prefs->getInt("/tools/lpetool/unitid", SP_UNIT_PX));
         SPUnit unit = sp_unit_get_by_id(unitid);
@@ -581,4 +551,4 @@ lpetool_show_measuring_info(SPLPEToolContext *lc, bool show)
   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 :