Code

remove desktop-affine.h and refactor sp_desktop_dt2doc_* calls
authorspeleo3 <speleo3@users.sourceforge.net>
Fri, 13 Mar 2009 17:13:24 +0000 (17:13 +0000)
committerspeleo3 <speleo3@users.sourceforge.net>
Fri, 13 Mar 2009 17:13:24 +0000 (17:13 +0000)
15 files changed:
src/Makefile_insert
src/connector-context.cpp
src/context-fns.cpp
src/desktop-affine.h [deleted file]
src/doxygen-main.cpp
src/draw-context.cpp
src/dyna-draw-context.cpp
src/eraser-context.cpp
src/object-edit.cpp
src/sp-flowtext.cpp
src/spiral-context.cpp
src/star-context.cpp
src/text-context.cpp
src/tweak-context.cpp
src/ui/view/CMakeLists.txt

index a3babf265720d4c24cc29e0886b06f42909d0c38..de986ca16e3a19fec2f3f1943ede0926a82c766e 100644 (file)
@@ -26,7 +26,6 @@ ink_common_sources += \
        console-output-undo-observer.h console-output-undo-observer.cpp \
        context-fns.cpp context-fns.h                                   \
        decimal-round.h                                                 \
-       desktop-affine.h                                                \
        desktop.cpp desktop.h                                           \
        desktop-events.cpp desktop-events.h                             \
        desktop-handles.cpp desktop-handles.h                           \
index a3bb19de6d6131c397c66669f171f2ca53fb69bb..e364336c48a86bca26949ea5316fc067cbe039d6 100644 (file)
@@ -52,7 +52,6 @@
 #include "svg/svg.h"
 #include "desktop.h"
 #include "desktop-style.h"
-#include "desktop-affine.h"
 #include "desktop-handles.h"
 #include "document.h"
 #include "message-context.h"
@@ -913,7 +912,7 @@ spcc_flush_white(SPConnectorContext *cc, SPCurve *gc)
     }
 
     /* Now we have to go back to item coordinates at last */
-    c->transform(sp_desktop_dt2doc_affine(SP_EVENT_CONTEXT_DESKTOP(cc)));
+    c->transform(SP_EVENT_CONTEXT_DESKTOP(cc)->dt2doc());
 
     SPDesktop *desktop = SP_EVENT_CONTEXT_DESKTOP(cc);
     SPDocument *doc = sp_desktop_document(desktop);
index 30062504cfd03d81f91f01b4bd7e2d74026eca51..50942b80a77b1ffbe58329ef3fb7e25a866328c5 100644 (file)
@@ -9,7 +9,6 @@
 #include "message-stack.h"
 #include "context-fns.h"
 #include "snap.h"
-#include "desktop-affine.h"
 #include "event-context.h"
 #include "sp-namedview.h"
 #include "display/snap-indicator.h"
@@ -207,8 +206,8 @@ Geom::Rect Inkscape::snap_rectangular_box(SPDesktop const *desktop, SPItem *item
         desktop->snapindicator->set_new_snaptarget(snappoint);
     }
 
-    p[0] = sp_desktop_dt2doc_xy_point(desktop, p[0]);
-    p[1] = sp_desktop_dt2doc_xy_point(desktop, p[1]);
+    p[0] *= desktop->dt2doc();
+    p[1] *= desktop->dt2doc();
 
     return Geom::Rect(Geom::Point(MIN(p[0][Geom::X], p[1][Geom::X]), MIN(p[0][Geom::Y], p[1][Geom::Y])),
                     Geom::Point(MAX(p[0][Geom::X], p[1][Geom::X]), MAX(p[0][Geom::Y], p[1][Geom::Y])));
diff --git a/src/desktop-affine.h b/src/desktop-affine.h
deleted file mode 100644 (file)
index dda4e90..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef __SP_DESKTOP_AFFINE_H__
-#define __SP_DESKTOP_AFFINE_H__
-
-/*
- * Desktop transformations
- *
- * Authors:
- *   Lauris Kaplinski <lauris@kaplinski.com>
- *
- * Copyright (C) 1999-2002 Lauris Kaplinski
- * Copyright (C) 2000-2001 Ximian, Inc.
- *
- * Released under GNU GPL, read the file 'COPYING' for more information
- */
-
-#include "desktop.h"
-
-#define sp_desktop_dt2doc_affine(desktop)          desktop->dt2doc()
-#define sp_desktop_dt2doc_xy_point(desktop,point)  desktop->dt2doc(point)
-
-#endif
-
-/*
-  Local Variables:
-  mode:c++
-  c-file-style:"stroustrup"
-  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
-  indent-tabs-mode:nil
-  fill-column:99
-  End:
-*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
index bfca9b21a9c465bac2e9725afbb5d728048d1122..fd8f4bb1a2e5c1abccb75c56bd1856a1d45ecd41 100644 (file)
@@ -284,7 +284,7 @@ namespace XML {}
  *
  * - Inkscape::UI::View::View [\ref ui/view/view.cpp, \ref ui/view/view.h]
  *   - Inkscape::UI::View::Edit [\ref ui/view/edit.cpp, \ref ui/view/edit.h]
- *   - SPDesktop [\ref desktop.cpp, \ref desktop-affine.cpp, \ref desktop-events.cpp, \ref desktop-handles.cpp, \ref desktop-style.cpp, \ref desktop.h, \ref desktop-affine.h, \ref desktop-events.h, \ref desktop-handles.h, \ref desktop-style.h]
+ *   - SPDesktop [\ref desktop.cpp, \ref desktop-events.cpp, \ref desktop-handles.cpp, \ref desktop-style.cpp, \ref desktop.h, \ref desktop-events.h, \ref desktop-handles.h, \ref desktop-style.h]
  *   - SPSVGView [\ref svg-view.cpp, \ref svg-view.h]
  *
  * SPDesktopWidget [\ref desktop-widget.h] SPSVGSPViewWidget [\ref svg-view.cpp]
index c86e2cc69826f0ebad07620ebdee98efed572e78..3891ce331818e1442fec6d396b6487ae4ec38ca0 100644 (file)
@@ -26,7 +26,6 @@
 #include <glibmm/i18n.h>
 #include "display/curve.h"
 #include "desktop.h"
-#include "desktop-affine.h"
 #include "desktop-handles.h"
 #include "desktop-style.h"
 #include "document.h"
@@ -662,7 +661,7 @@ spdc_flush_white(SPDrawContext *dc, SPCurve *gc)
     /* Now we have to go back to item coordinates at last */
     c->transform( dc->white_item
                             ? sp_item_dt2i_affine(dc->white_item)
-                            : to_2geom(sp_desktop_dt2doc_affine(SP_EVENT_CONTEXT_DESKTOP(dc))) );
+                            : SP_EVENT_CONTEXT_DESKTOP(dc)->dt2doc() );
 
     SPDesktop *desktop = SP_EVENT_CONTEXT_DESKTOP(dc);
     SPDocument *doc = sp_desktop_document(desktop);
index 23a264c80d83208cac874d658f760a782b2ca001..bb8e690923e66402bdabd7f5e71914e3267ff809 100644 (file)
@@ -45,7 +45,6 @@
 #include "desktop.h"
 #include "desktop-events.h"
 #include "desktop-handles.h"
-#include "desktop-affine.h"
 #include "desktop-style.h"
 #include "message-context.h"
 #include "preferences.h"
@@ -1016,7 +1015,7 @@ set_to_accumulated(SPDynaDrawContext *dc, bool unionize, bool subtract)
             item->transform = sp_item_i2doc_affine(SP_ITEM(desktop->currentLayer())).inverse();
             item->updateRepr();
         }
-        Geom::PathVector pathv = dc->accumulated->get_pathvector() * sp_desktop_dt2doc_affine(desktop);
+        Geom::PathVector pathv = dc->accumulated->get_pathvector() * desktop->dt2doc();
         gchar *str = sp_svg_write_path(pathv);
         g_assert( str != NULL );
         dc->repr->setAttribute("d", str);
index 8854dbcec9e65241b6852b6fa79cf1b5b9bc2d50..022de409055cb0725e1a064b215cc3757dce3d5f 100644 (file)
@@ -43,7 +43,6 @@
 #include "desktop.h"
 #include "desktop-events.h"
 #include "desktop-handles.h"
-#include "desktop-affine.h"
 #include "desktop-style.h"
 #include "message-context.h"
 #include "preferences.h"
@@ -727,7 +726,7 @@ set_to_accumulated(SPEraserContext *dc)
             item->transform = sp_item_i2doc_affine(SP_ITEM(desktop->currentLayer())).inverse();
             item->updateRepr();
         }
-        Geom::PathVector pathv = dc->accumulated->get_pathvector() * sp_desktop_dt2doc_affine(desktop);
+        Geom::PathVector pathv = dc->accumulated->get_pathvector() * desktop->dt2doc();
         gchar *str = sp_svg_write_path(pathv);
         g_assert( str != NULL );
         dc->repr->setAttribute("d", str);
index edb1a0134da11e8c0f462d5cc036e5318bbe1f1c..a9cf202983efc0b39492c7fb80b4b02f11400b69 100644 (file)
@@ -26,7 +26,6 @@
 #include "sp-offset.h"
 #include "sp-flowtext.h"
 #include "preferences.h"
-#include "desktop-affine.h"
 #include "style.h"
 #include "desktop.h"
 #include "desktop-handles.h"
index c6c0950146790700ce1b24d4f01322e425d9768e..6af2f7169eaf3c9eb34ed451470c0d9ee4fa0aa1 100644 (file)
@@ -16,7 +16,6 @@
 #include "selection.h"
 #include "desktop-handles.h"
 #include "desktop.h"
-#include "desktop-affine.h"
 
 #include "xml/repr.h"
 
@@ -697,8 +696,8 @@ SPItem *create_flowtext_with_internal_frame (SPDesktop *desktop, Geom::Point p0,
 
     SPObject *rect = doc->getObjectByRepr(rect_repr);
 
-    p0 = sp_desktop_dt2doc_xy_point(desktop, p0);
-    p1 = sp_desktop_dt2doc_xy_point(desktop, p1);
+    p0 *= desktop->dt2doc();
+    p1 *= desktop->dt2doc();
     using Geom::X;
     using Geom::Y;
     Geom::Coord const x0 = MIN(p0[X], p1[X]);
index 3689ae4af3fbbe9bea974c9b5306786e08fe7d6c..e91f550dc070dbb1c37806b86b5c840a3d6b98a3 100644 (file)
@@ -27,7 +27,6 @@
 #include "sp-namedview.h"
 #include "selection.h"
 #include "desktop-handles.h"
-#include "desktop-affine.h"
 #include "snap.h"
 #include "desktop.h"
 #include "desktop-style.h"
@@ -406,8 +405,8 @@ sp_spiral_drag(SPSpiralContext *sc, Geom::Point p, guint state)
     Geom::Point pt2g = to_2geom(p);
     m.freeSnapReturnByRef(Inkscape::SnapPreferences::SNAPPOINT_NODE, pt2g, Inkscape::SNAPSOURCE_HANDLE);
 
-    Geom::Point const p0 = to_2geom(sp_desktop_dt2doc_xy_point(desktop, sc->center));
-    Geom::Point const p1 = to_2geom(sp_desktop_dt2doc_xy_point(desktop, from_2geom(pt2g)));
+    Geom::Point const p0 = desktop->dt2doc(sc->center);
+    Geom::Point const p1 = desktop->dt2doc(pt2g);
 
     SPSpiral *spiral = SP_SPIRAL(sc->item);
 
index 54c431e2cadc656c1818f62bd3a9b4cfeb297de6..b2c56cc7f72ed7f145102ed646e60b7ef6a70eed 100644 (file)
@@ -30,7 +30,6 @@
 #include "sp-namedview.h"
 #include "selection.h"
 #include "desktop-handles.h"
-#include "desktop-affine.h"
 #include "snap.h"
 #include "desktop.h"
 #include "desktop-style.h"
@@ -418,8 +417,8 @@ static void sp_star_drag(SPStarContext *sc, Geom::Point p, guint state)
     Geom::Point pt2g = to_2geom(p);
     m.freeSnapReturnByRef(Inkscape::SnapPreferences::SNAPPOINT_NODE, pt2g, Inkscape::SNAPSOURCE_HANDLE);
 
-    Geom::Point const p0 = to_2geom(sp_desktop_dt2doc_xy_point(desktop, sc->center));
-    Geom::Point const p1 = to_2geom(sp_desktop_dt2doc_xy_point(desktop, from_2geom(pt2g)));
+    Geom::Point const p0 = desktop->dt2doc(sc->center);
+    Geom::Point const p1 = desktop->dt2doc(pt2g);
 
     SPStar *star = SP_STAR(sc->item);
 
index b2efd0cc21dfbeb4b40fe2883a9603dd1bc19e82..d743d45c2a3ab6af07a353bb710341f97bcbe8e0 100644 (file)
@@ -35,7 +35,6 @@
 #include "desktop.h"
 #include "desktop-style.h"
 #include "desktop-handles.h"
-#include "desktop-affine.h"
 #include "message-stack.h"
 #include "message-context.h"
 #include "pixmaps/cursor-text.xpm"
@@ -670,7 +669,7 @@ sp_text_context_root_handler(SPEventContext *const event_context, GdkEvent *cons
                     /* Button 1, set X & Y & new item */
                     sp_desktop_selection(desktop)->clear();
                     Geom::Point dtp = desktop->w2d(Geom::Point(event->button.x, event->button.y));
-                    tc->pdoc = sp_desktop_dt2doc_xy_point(desktop, dtp);
+                    tc->pdoc = desktop->dt2doc(dtp);
 
                     tc->show = TRUE;
                     tc->phase = 1;
index fd8f098fe9664bd69a85958905baed57bad45a07..7d797915e7779a30b80db4ecbd9421fdd75f1288 100644 (file)
@@ -29,7 +29,6 @@
 #include "desktop.h"
 #include "desktop-events.h"
 #include "desktop-handles.h"
-#include "desktop-affine.h"
 #include "desktop-style.h"
 #include "message-context.h"
 #include "pixmaps/cursor-tweak-move.xpm"
index df2b422ca620329aee2567bfc3a6ba8ba14eea57..5c96bc40e31e026ce4bf179a8c1a1bd4b52f9774 100644 (file)
@@ -1,6 +1,5 @@
 SET(ui_view_SRC
 desktop.cpp
-desktop-affine.cpp
 desktop-events.cpp
 desktop-handles.cpp
 desktop-style.cpp