summaryrefslogtreecommitdiffstats
path: root/src/live_effects/lpe-perspective_path.cpp
diff options
context:
space:
mode:
authorMichael Soegtrop <MSoegtrop@yahoo.de>2017-06-05 13:01:17 +0000
committerMichael Soegtrop <MSoegtrop@yahoo.de>2017-06-05 13:01:17 +0000
commit509ca3687330fea576ea67ae6c7f31d16e66b800 (patch)
tree9097520c54e355ded9bd0b4d6618af4e8dacdd91 /src/live_effects/lpe-perspective_path.cpp
parentupdated to latest trunk (diff)
parent[Bug #1695016] Xaml export misses some radialGradients. (diff)
downloadinkscape-509ca3687330fea576ea67ae6c7f31d16e66b800.tar.gz
inkscape-509ca3687330fea576ea67ae6c7f31d16e66b800.zip
updated to latest trunk
(bzr r14876.2.4)
Diffstat (limited to 'src/live_effects/lpe-perspective_path.cpp')
-rw-r--r--src/live_effects/lpe-perspective_path.cpp50
1 files changed, 29 insertions, 21 deletions
diff --git a/src/live_effects/lpe-perspective_path.cpp b/src/live_effects/lpe-perspective_path.cpp
index c8cdd7912..435c91c2d 100644
--- a/src/live_effects/lpe-perspective_path.cpp
+++ b/src/live_effects/lpe-perspective_path.cpp
@@ -11,22 +11,17 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <gtkmm.h>
-#include <glibmm/i18n.h>
-
#include "persp3d.h"
//#include "transf_mat_3x4.h"
-#include "document.h"
#include "document-private.h"
#include "live_effects/lpe-perspective_path.h"
#include "live_effects/lpeobject.h"
-#include "sp-item-group.h"
#include "knot-holder-entity.h"
#include "knotholder.h"
-#include "desktop.h"
#include <util/units.h>
-#include "inkscape.h"
-#include <2geom/path.h>
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
namespace Inkscape {
namespace LivePathEffect {
@@ -56,11 +51,11 @@ LPEPerspectivePath::LPEPerspectivePath(LivePathEffectObject *lpeobject) :
uses_plane_xy(_("Uses XY plane?"), _("If true, put the path on the left side of an imaginary box, otherwise on the right side"), "uses_plane_xy", &wr, this, true)
{
// register all your parameters here, so Inkscape knows which parameters this effect has:
- registerParameter( dynamic_cast<Parameter *>(&scalex) );
- registerParameter( dynamic_cast<Parameter *>(&scaley) );
- registerParameter( dynamic_cast<Parameter *>(&offsetx) );
- registerParameter( dynamic_cast<Parameter *>(&offsety) );
- registerParameter( dynamic_cast<Parameter *>(&uses_plane_xy) );
+ registerParameter( &scalex);
+ registerParameter( &scaley);
+ registerParameter( &offsetx);
+ registerParameter( &offsety);
+ registerParameter( &uses_plane_xy);
concatenate_before_pwd2 = true; // don't split the path into its subpaths
_provides_knotholder_entities = true;
@@ -107,12 +102,12 @@ void LPEPerspectivePath::refresh(Gtk::Entry* perspective) {
perspectiveID = perspective->get_text();
Persp3D *first = 0;
Persp3D *persp = 0;
- for ( SPObject *child = this->lpeobj->document->getDefs()->firstChild(); child && !persp; child = child->getNext() ) {
- if (SP_IS_PERSP3D(child) && first == 0) {
- first = SP_PERSP3D(child);
+ for (auto& child: lpeobj->document->getDefs()->children) {
+ if (SP_IS_PERSP3D(&child) && first == 0) {
+ first = SP_PERSP3D(&child);
}
- if (SP_IS_PERSP3D(child) && strcmp(child->getId(), const_cast<const gchar *>(perspectiveID.c_str())) == 0) {
- persp = SP_PERSP3D(child);
+ if (SP_IS_PERSP3D(&child) && strcmp(child.getId(), const_cast<const gchar *>(perspectiveID.c_str())) == 0) {
+ persp = SP_PERSP3D(&child);
break;
}
}
@@ -231,15 +226,28 @@ LPEPerspectivePath::newWidget()
++it;
}
Gtk::HBox * perspectiveId = Gtk::manage(new Gtk::HBox(true,0));
+
+#if WITH_GTKMM_3_10
+ Gtk::Label* labelPerspective = Gtk::manage(new Gtk::Label("Perspective ID:", Gtk::ALIGN_START, Gtk::ALIGN_START));
+#else
Gtk::Label* labelPerspective = Gtk::manage(new Gtk::Label("Perspective ID:", 0., 0.));
+#endif
+
Gtk::Entry* perspective = Gtk::manage(new Gtk::Entry());
perspective->set_text(perspectiveID);
perspective->set_tooltip_text("Set the perspective ID to apply");
perspectiveId->pack_start(*labelPerspective, true, true, 2);
perspectiveId->pack_start(*perspective, true, true, 2);
vbox->pack_start(*perspectiveId, true, true, 2);
- Gtk::Button* apply3D = Gtk::manage(new Gtk::Button(Glib::ustring(_("Refresh perspective"))));
- apply3D->set_alignment(0.0, 0.5);
+ Gtk::Button* apply3D = Gtk::manage(new Gtk::Button());
+
+#if WITH_GTKMM_3_10
+ Gtk::Label *apply3DLabel = Gtk::manage(new Gtk::Label(_("Refresh perspective"), Gtk::ALIGN_START, Gtk::ALIGN_CENTER));
+#else
+ Gtk::Label *apply3DLabel = Gtk::manage(new Gtk::Label(_("Refresh perspective"), 0.0, 0.5));
+#endif
+
+ apply3D->add(*apply3DLabel);
apply3D->signal_clicked().connect(sigc::bind<Gtk::Entry*>(sigc::mem_fun(*this,&LPEPerspectivePath::refresh),perspective));
Gtk::Widget* apply3DWidget = dynamic_cast<Gtk::Widget *>(apply3D);
apply3DWidget->set_tooltip_text("Refresh perspective");
@@ -247,9 +255,9 @@ LPEPerspectivePath::newWidget()
return dynamic_cast<Gtk::Widget *>(vbox);
}
-void LPEPerspectivePath::addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item) {
+void LPEPerspectivePath::addKnotHolderEntities(KnotHolder *knotholder, SPItem *item) {
KnotHolderEntity *e = new PP::KnotHolderEntityOffset(this);
- e->create( desktop, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN,
+ e->create( NULL, item, knotholder, Inkscape::CTRL_TYPE_UNKNOWN,
_("Adjust the origin") );
knotholder->add(e);
};