summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1d41cfe)
raw | patch | inline | side by side (parent: 1d41cfe)
author | mental <mental@users.sourceforge.net> | |
Mon, 7 Jul 2008 16:35:28 +0000 (16:35 +0000) | ||
committer | mental <mental@users.sourceforge.net> | |
Mon, 7 Jul 2008 16:35:28 +0000 (16:35 +0000) |
src/box3d.cpp | patch | blob | history | |
src/sp-guide.cpp | patch | blob | history | |
src/sp-guide.h | patch | blob | history | |
src/sp-item.cpp | patch | blob | history | |
src/sp-path.cpp | patch | blob | history | |
src/sp-rect.cpp | patch | blob | history | |
src/verbs.cpp | patch | blob | history |
diff --git a/src/box3d.cpp b/src/box3d.cpp
index f0bf4647d6b25d1065f106f509e978eb04b918c7..cda482e738c3944c2a05044bcb594d4f5f5c36aa 100644 (file)
--- a/src/box3d.cpp
+++ b/src/box3d.cpp
return;
}
- SPDocument *doc = SP_OBJECT_DOCUMENT(box);
-
std::list<std::pair<Geom::Point, Geom::Point> > pts;
/* perspective lines in X direction */
box3d_push_back_corner_pair(box, pts, 2, 6);
box3d_push_back_corner_pair(box, pts, 3, 7);
- sp_guide_pt_pairs_to_guides(doc, pts);
+ sp_guide_pt_pairs_to_guides(inkscape_active_desktop(), pts);
}
/*
diff --git a/src/sp-guide.cpp b/src/sp-guide.cpp
index 2f91a17cfedeb6375f3e265c03541f36edfab279..5375bc442d7301d12d06d8e3d7076a42d1eae6ad 100644 (file)
--- a/src/sp-guide.cpp
+++ b/src/sp-guide.cpp
#include <algorithm>
#include <cstring>
#include <string>
+#include "desktop-handles.h"
#include "display/guideline.h"
#include "svg/svg.h"
#include "svg/stringstream.h"
@@ -241,8 +242,8 @@ static void sp_guide_set(SPObject *object, unsigned int key, const gchar *value)
}
SPGuide *
-sp_guide_create(SPDocument *doc, Geom::Point const &pt1, Geom::Point const &pt2) {
- SPDesktop *desktop = inkscape_active_desktop();
+sp_guide_create(SPDesktop *desktop, Geom::Point const &pt1, Geom::Point const &pt2) {
+ SPDocument *doc=sp_desktop_document(desktop);
Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc);
Inkscape::XML::Node *repr = xml_doc->createElement("sodipodi:guide");
@@ -260,14 +261,15 @@ sp_guide_create(SPDocument *doc, Geom::Point const &pt1, Geom::Point const &pt2)
}
void
-sp_guide_pt_pairs_to_guides(SPDocument *doc, std::list<std::pair<Geom::Point, Geom::Point> > &pts) {
+sp_guide_pt_pairs_to_guides(SPDesktop *dt, std::list<std::pair<Geom::Point, Geom::Point> > &pts) {
for (std::list<std::pair<Geom::Point, Geom::Point> >::iterator i = pts.begin(); i != pts.end(); ++i) {
- sp_guide_create(doc, (*i).first, (*i).second);
+ sp_guide_create(dt, (*i).first, (*i).second);
}
}
void
-sp_guide_create_guides_around_page(SPDocument *doc) {
+sp_guide_create_guides_around_page(SPDesktop *dt) {
+ SPDocument *doc=sp_desktop_document(dt);
std::list<std::pair<Geom::Point, Geom::Point> > pts;
Geom::Point A(0, 0);
pts.push_back(std::make_pair<Geom::Point, Geom::Point>(C, D));
pts.push_back(std::make_pair<Geom::Point, Geom::Point>(D, A));
- sp_guide_pt_pairs_to_guides(doc, pts);
+ sp_guide_pt_pairs_to_guides(dt, pts);
sp_document_done (doc, SP_VERB_NONE, _("Guides around page"));
}
diff --git a/src/sp-guide.h b/src/sp-guide.h
index 502cf2c5b7b7af2bc3b58f4cb199b585e00e90c0..78c795f837f245d53bf3e7c61b19988e7f79791d 100644 (file)
--- a/src/sp-guide.h
+++ b/src/sp-guide.h
GType sp_guide_get_type();
SPGuide *sp_guide_create(SPDesktop *desktop, Geom::Point const &pt1, Geom::Point const &pt2);
-void sp_guide_pt_pairs_to_guides(SPDocument *doc, std::list<std::pair<Geom::Point, Geom::Point> > &pts);
-void sp_guide_create_guides_around_page(SPDocument *doc);
+void sp_guide_pt_pairs_to_guides(SPDesktop *dt, std::list<std::pair<Geom::Point, Geom::Point> > &pts);
+void sp_guide_create_guides_around_page(SPDesktop *dt);
void sp_guide_show(SPGuide *guide, SPCanvasGroup *group, GCallback handler);
void sp_guide_hide(SPGuide *guide, SPCanvas *canvas);
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index 33f140de24417947879a3e595e78ec74aa55be05..81e75ad7c1f9aa76eacc3b693863e95b36373732 100644 (file)
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
pts.push_back(std::make_pair(C.to_2geom(), D.to_2geom()));
pts.push_back(std::make_pair(D.to_2geom(), A.to_2geom()));
- sp_guide_pt_pairs_to_guides(SP_OBJECT_DOCUMENT(item), pts);
+ sp_guide_pt_pairs_to_guides(dt, pts);
}
/*
diff --git a/src/sp-path.cpp b/src/sp-path.cpp
index 8327cb88d080bd77cd12549b45d0e2b9fd72f073..47d63b2b92e99724ce99d65c162b0bdb9f766615 100644 (file)
--- a/src/sp-path.cpp
+++ b/src/sp-path.cpp
}
}
- SPDocument *doc = SP_OBJECT_DOCUMENT(path);
- sp_guide_pt_pairs_to_guides(doc, pts);
+ sp_guide_pt_pairs_to_guides(inkscape_active_desktop(), pts);
}
/**
diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp
index 7d3cd1c0c5639f53de382da822380d3293b2e03b..e5ffa8b396a16f8ed1c74a11a60b7f090370894a 100644 (file)
--- a/src/sp-rect.cpp
+++ b/src/sp-rect.cpp
#include <libnr/nr-matrix-div.h>
#include <libnr/nr-matrix-fns.h>
+#include "inkscape.h"
#include "document.h"
#include "attributes.h"
#include "style.h"
static void
sp_rect_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
- SPRect *rect = SP_RECT(object);
-
if (((SPObjectClass *) parent_class)->build)
((SPObjectClass *) parent_class)->build(object, document, repr);
return;
}
- SPDocument *doc = SP_OBJECT_DOCUMENT(rect);
std::list<std::pair<Geom::Point, Geom::Point> > pts;
NR::Matrix const i2d (from_2geom(sp_item_i2d_affine(SP_ITEM(rect))));
pts.push_back(std::make_pair(A3.to_2geom(), A4.to_2geom()));
pts.push_back(std::make_pair(A4.to_2geom(), A1.to_2geom()));
- sp_guide_pt_pairs_to_guides(doc, pts);
+ sp_guide_pt_pairs_to_guides(inkscape_active_desktop(), pts);
}
/*
diff --git a/src/verbs.cpp b/src/verbs.cpp
index b92eb52c06f03969691c4aa38628e2a3c6ddf996..73612557cf5b6458a09b22dfe3c4c07dafa4a30e 100644 (file)
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
break;
case SP_VERB_EDIT_GUIDES_AROUND_PAGE:
- sp_guide_create_guides_around_page(sp_desktop_document(dt));
+ sp_guide_create_guides_around_page(dt);
break;
case SP_VERB_EDIT_NEXT_PATHEFFECT_PARAMETER: