summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5339875)
raw | patch | inline | side by side (parent: 5339875)
author | cilix42 <cilix42@users.sourceforge.net> | |
Wed, 5 Mar 2008 18:57:01 +0000 (18:57 +0000) | ||
committer | cilix42 <cilix42@users.sourceforge.net> | |
Wed, 5 Mar 2008 18:57:01 +0000 (18:57 +0000) |
src/menus-skeleton.h | patch | blob | history | |
src/sp-guide.cpp | patch | blob | history | |
src/sp-guide.h | patch | blob | history | |
src/verbs.cpp | patch | blob | history | |
src/verbs.h | patch | blob | history |
diff --git a/src/menus-skeleton.h b/src/menus-skeleton.h
index 208bc799429948e02c469ce71d76004b81f2ebb8..56542e79e90dc2f55a95ff114d5a36422a1d4186 100644 (file)
--- a/src/menus-skeleton.h
+++ b/src/menus-skeleton.h
" <verb verb-id=\"EditInvert\" />\n"
" <verb verb-id=\"EditDeselect\" />\n"
" <separator/>\n"
+" <verb verb-id=\"EditGuidesAroundPage\" />\n"
+" <separator/>\n"
" <verb verb-id=\"DialogXMLEditor\" />\n"
" </submenu>\n"
" <submenu name=\"" N_("_View") "\">\n"
diff --git a/src/sp-guide.cpp b/src/sp-guide.cpp
index 81109c4fb3f90376465c57bbab6a01e236bfc98f..2f91a17cfedeb6375f3e265c03541f36edfab279 100644 (file)
--- a/src/sp-guide.cpp
+++ b/src/sp-guide.cpp
@@ -266,6 +266,25 @@ sp_guide_pt_pairs_to_guides(SPDocument *doc, std::list<std::pair<Geom::Point, Ge
}
}
+void
+sp_guide_create_guides_around_page(SPDocument *doc) {
+ std::list<std::pair<Geom::Point, Geom::Point> > pts;
+
+ Geom::Point A(0, 0);
+ Geom::Point C(sp_document_width(doc), sp_document_height(doc));
+ Geom::Point B(C[Geom::X], 0);
+ Geom::Point D(0, C[Geom::Y]);
+
+ pts.push_back(std::make_pair<Geom::Point, Geom::Point>(A, B));
+ pts.push_back(std::make_pair<Geom::Point, Geom::Point>(B, C));
+ 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_document_done (doc, SP_VERB_NONE, _("Guides around page"));
+}
+
void sp_guide_show(SPGuide *guide, SPCanvasGroup *group, GCallback handler)
{
SPCanvasItem *item = sp_guideline_new(group, guide->point_on_line, guide->normal_to_line.to_2geom());
diff --git a/src/sp-guide.h b/src/sp-guide.h
index a9b04dfaa99b10195df611e4b76f19798905d1a9..502cf2c5b7b7af2bc3b58f4cb199b585e00e90c0 100644 (file)
--- a/src/sp-guide.h
+++ b/src/sp-guide.h
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_show(SPGuide *guide, SPCanvasGroup *group, GCallback handler);
void sp_guide_hide(SPGuide *guide, SPCanvas *canvas);
diff --git a/src/verbs.cpp b/src/verbs.cpp
index 08f1bb124241362ba928d87d0bb6dccf19ba22db..674ccdd82bc8996065bb18922a0a956e1119b85e 100644 (file)
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
#include "shape-editor.h"
#include "draw-context.h"
#include "gradient-drag.h"
+#include "sp-guide.h"
/**
}
break;
+ case SP_VERB_EDIT_GUIDES_AROUND_PAGE:
+ sp_guide_create_guides_around_page(sp_desktop_document(dt));
+ break;
+
case SP_VERB_EDIT_NEXT_PATHEFFECT_PARAMETER:
sp_selection_next_patheffect_param(dt);
break;
N_("Select previous object or node"), NULL),
new EditVerb(SP_VERB_EDIT_DESELECT, "EditDeselect", N_("D_eselect"),
N_("Deselect any selected objects or nodes"), "selection_deselect"),
+ new EditVerb(SP_VERB_EDIT_GUIDES_AROUND_PAGE, "EditGuidesAroundPage", N_("_Guides around page"),
+ N_("Create four guides aligned with the page borders"), NULL),
new EditVerb(SP_VERB_EDIT_NEXT_PATHEFFECT_PARAMETER, "EditNextPathEffectParameter", N_("Next Path Effect Parameter"),
N_("Show next Path Effect parameter for editing"), "edit_next_parameter"),
diff --git a/src/verbs.h b/src/verbs.h
index 6576c96527685bb782f00a48b2ea12118e227679..6924a4bfd0c725b630d8999ea8194edc31d9de4d 100644 (file)
--- a/src/verbs.h
+++ b/src/verbs.h
SP_VERB_EDIT_SELECT_NEXT,
SP_VERB_EDIT_SELECT_PREV,
SP_VERB_EDIT_DESELECT,
+ SP_VERB_EDIT_GUIDES_AROUND_PAGE,
SP_VERB_EDIT_NEXT_PATHEFFECT_PARAMETER,
/* Selection */
SP_VERB_SELECTION_TO_FRONT,