summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2016-07-24 16:51:32 +0000
committerjabiertxof <info@marker.es>2016-07-24 16:51:32 +0000
commit21bb5ac09822da9d71731b7ff7eff9f03247a855 (patch)
treeb916ac10a1b07708dc7d81fd9dab68311d6f097f /src
parentAdd Text tag and update widgets code (diff)
parentFixed a bug on roughen LPE on open paths (diff)
downloadinkscape-21bb5ac09822da9d71731b7ff7eff9f03247a855.tar.gz
inkscape-21bb5ac09822da9d71731b7ff7eff9f03247a855.zip
update to trunk
(bzr r15017.1.3)
Diffstat (limited to 'src')
-rw-r--r--src/document-undo.cpp7
-rw-r--r--src/document.cpp3
-rw-r--r--src/live_effects/lpe-copy_rotate.cpp3
-rw-r--r--src/live_effects/lpe-lattice2.cpp7
-rw-r--r--src/live_effects/lpe-lattice2.h2
-rw-r--r--src/live_effects/lpe-mirror_symmetry.cpp5
-rw-r--r--src/live_effects/lpe-mirror_symmetry.h2
-rw-r--r--src/live_effects/lpe-roughen.cpp11
-rw-r--r--src/live_effects/lpe-roughen.h1
-rw-r--r--src/live_effects/lpe-show_handles.cpp4
-rw-r--r--src/live_effects/lpe-show_handles.h2
-rw-r--r--src/live_effects/lpe-simplify.cpp5
-rw-r--r--src/live_effects/lpe-simplify.h2
-rw-r--r--src/live_effects/parameter/togglebutton.cpp72
-rw-r--r--src/live_effects/parameter/togglebutton.h8
-rw-r--r--src/ui/tools/tool-base.cpp2
-rw-r--r--src/ui/widget/registered-widget.cpp6
-rw-r--r--src/ui/widget/registered-widget.h3
18 files changed, 75 insertions, 70 deletions
diff --git a/src/document-undo.cpp b/src/document-undo.cpp
index eb0ac7707..c27904ea8 100644
--- a/src/document-undo.cpp
+++ b/src/document-undo.cpp
@@ -196,6 +196,7 @@ void Inkscape::DocumentUndo::cancel(SPDocument *doc)
if (doc->priv->partial) {
sp_repr_undo_log (doc->priv->partial);
+ doc->emitReconstructionFinish();
sp_repr_free_log (doc->priv->partial);
doc->priv->partial = NULL;
}
@@ -222,6 +223,8 @@ static void perform_document_update(SPDocument &doc) {
doc.ensureUpToDate();
Inkscape::XML::Event *update_log=sp_repr_commit_undoable(doc.rdoc);
+ doc.emitReconstructionFinish();
+
if (update_log != NULL) {
g_warning("Document was modified while being updated after undo operation");
sp_repr_debug_print_log(update_log);
@@ -322,8 +325,10 @@ gboolean Inkscape::DocumentUndo::redo(SPDocument *doc)
doc->priv->sensitive = TRUE;
doc->priv->seeking = false;
- if (ret)
+ if (ret) {
INKSCAPE.external_change();
+ doc->emitReconstructionFinish();
+ }
return ret;
}
diff --git a/src/document.cpp b/src/document.cpp
index 902dabbc3..9f408788b 100644
--- a/src/document.cpp
+++ b/src/document.cpp
@@ -955,6 +955,9 @@ SPDocument::emitReconstructionFinish(void)
{
// printf("Finishing Reconstruction\n");
priv->_reconstruction_finish_signal.emit();
+ // indicates that gradients are reloaded (to rebuild the Auto palette)
+ priv->resources_changed_signals[g_quark_from_string("gradient")].emit();
+
/**
// Reference to the old persp3d object is invalid after reconstruction.
diff --git a/src/live_effects/lpe-copy_rotate.cpp b/src/live_effects/lpe-copy_rotate.cpp
index efea76039..80f5bdafd 100644
--- a/src/live_effects/lpe-copy_rotate.cpp
+++ b/src/live_effects/lpe-copy_rotate.cpp
@@ -11,7 +11,6 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <glibmm/i18n.h>
#include <gdk/gdk.h>
#include <2geom/path-intersection.h>
#include <2geom/sbasis-to-bezier.h>
@@ -22,6 +21,8 @@
#include "knot-holder-entity.h"
#include "knotholder.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-lattice2.cpp b/src/live_effects/lpe-lattice2.cpp
index 0c403daec..bacbe5fa7 100644
--- a/src/live_effects/lpe-lattice2.cpp
+++ b/src/live_effects/lpe-lattice2.cpp
@@ -17,9 +17,6 @@
*/
#include "live_effects/lpe-lattice2.h"
-
-#include <gtkmm/expander.h>
-
#include "sp-shape.h"
#include "sp-item.h"
#include "sp-path.h"
@@ -36,6 +33,8 @@
#include <2geom/d2.h>
#include <2geom/piecewise.h>
#include <2geom/transforms.h>
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
using namespace Geom;
@@ -280,7 +279,7 @@ void
LPELattice2::onExpanderChanged()
{
expanded = expander->get_expanded();
- if(expander->get_expanded()) {
+ if(expanded) {
expander->set_label (Glib::ustring(_("Hide Points")));
} else {
expander->set_label (Glib::ustring(_("Show Points")));
diff --git a/src/live_effects/lpe-lattice2.h b/src/live_effects/lpe-lattice2.h
index 8d0c18a3a..07bc4af86 100644
--- a/src/live_effects/lpe-lattice2.h
+++ b/src/live_effects/lpe-lattice2.h
@@ -18,8 +18,8 @@
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#include <gtkmm.h>
#include "live_effects/parameter/enum.h"
-#include <gtkmm/widget.h>
#include "live_effects/effect.h"
#include "live_effects/parameter/point.h"
#include "live_effects/lpegroupbbox.h"
diff --git a/src/live_effects/lpe-mirror_symmetry.cpp b/src/live_effects/lpe-mirror_symmetry.cpp
index 9f3070ff4..cf866ad6a 100644
--- a/src/live_effects/lpe-mirror_symmetry.cpp
+++ b/src/live_effects/lpe-mirror_symmetry.cpp
@@ -13,9 +13,6 @@
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <gtkmm.h>
-#include <glibmm/i18n.h>
-
#include "live_effects/lpe-mirror_symmetry.h"
#include <sp-path.h>
#include <display/curve.h>
@@ -28,6 +25,8 @@
#include "knot-holder-entity.h"
#include "knotholder.h"
#include "inkscape.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-mirror_symmetry.h b/src/live_effects/lpe-mirror_symmetry.h
index 3a244cb7e..9e5b4d628 100644
--- a/src/live_effects/lpe-mirror_symmetry.h
+++ b/src/live_effects/lpe-mirror_symmetry.h
@@ -15,7 +15,7 @@
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-
+#include <gtkmm.h>
#include "live_effects/effect.h"
#include "live_effects/parameter/parameter.h"
#include "live_effects/parameter/point.h"
diff --git a/src/live_effects/lpe-roughen.cpp b/src/live_effects/lpe-roughen.cpp
index 105fe2fc4..13f2b7b51 100644
--- a/src/live_effects/lpe-roughen.cpp
+++ b/src/live_effects/lpe-roughen.cpp
@@ -13,16 +13,16 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <gtkmm.h>
-#include "desktop.h"
#include "live_effects/lpe-roughen.h"
+#include "desktop.h"
#include "display/curve.h"
#include "live_effects/parameter/parameter.h"
#include <boost/functional/hash.hpp>
#include "helper/geom.h"
#include "sp-item-group.h"
-#include <glibmm/i18n.h>
#include <cmath>
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
namespace Inkscape {
namespace LivePathEffect {
@@ -229,7 +229,7 @@ void LPERoughen::doEffect(SPCurve *curve)
nCurve->lineto(curve_it1->finalPoint());
}
last_move = Geom::Point(0, 0);
- double length = curve_it1->length(0.001);
+ double length = curve_it1->length(0.01);
std::size_t splits = 0;
if (method == DM_SEGMENTS) {
splits = segments;
@@ -354,9 +354,6 @@ SPCurve const * LPERoughen::addNodesAndJitter(Geom::Curve const * A, Geom::Point
point_a3 = seg1[3] + point_a3;
ray.setPoints(prev,A->initialPoint());
point_a1 = A->initialPoint() + Geom::Point::polar(ray.angle(), max_lenght);
- if(prev == Geom::Point(0,0)){
- point_a1 = randomize(max_lenght);
- }
if(last){
Geom::Path b2(point_b3);
b2.appendNew<Geom::LineSegment>(point_a3);
diff --git a/src/live_effects/lpe-roughen.h b/src/live_effects/lpe-roughen.h
index 44a723c89..c4be8fed7 100644
--- a/src/live_effects/lpe-roughen.h
+++ b/src/live_effects/lpe-roughen.h
@@ -12,6 +12,7 @@
#ifndef INKSCAPE_LPE_ROUGHEN_H
#define INKSCAPE_LPE_ROUGHEN_H
+#include <gtkmm.h>
#include "live_effects/parameter/enum.h"
#include "live_effects/effect.h"
#include "live_effects/parameter/parameter.h"
diff --git a/src/live_effects/lpe-show_handles.cpp b/src/live_effects/lpe-show_handles.cpp
index 0bc1c4f17..2d4666fe4 100644
--- a/src/live_effects/lpe-show_handles.cpp
+++ b/src/live_effects/lpe-show_handles.cpp
@@ -6,8 +6,6 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <gtkmm.h>
-#include <glibmm/i18n.h>
#include "live_effects/lpe-show_handles.h"
#include "live_effects/parameter/parameter.h"
#include <2geom/sbasis-to-bezier.h>
@@ -16,6 +14,8 @@
#include "desktop-style.h"
#include "style.h"
#include "svg/svg.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-show_handles.h b/src/live_effects/lpe-show_handles.h
index 34390dd32..8bff3c1a8 100644
--- a/src/live_effects/lpe-show_handles.h
+++ b/src/live_effects/lpe-show_handles.h
@@ -8,7 +8,7 @@
* Copyright (C) Jabier Arraiza Cenoz 2014 <jabier.arraiza@marker.es>
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-
+#include <gtkmm.h>
#include "live_effects/effect.h"
#include "live_effects/lpegroupbbox.h"
#include "live_effects/parameter/bool.h"
diff --git a/src/live_effects/lpe-simplify.cpp b/src/live_effects/lpe-simplify.cpp
index f807bdc8d..b0c1fbc23 100644
--- a/src/live_effects/lpe-simplify.cpp
+++ b/src/live_effects/lpe-simplify.cpp
@@ -2,12 +2,9 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-#include <gtkmm.h>
-
#include "live_effects/lpe-simplify.h"
#include "display/curve.h"
#include "live_effects/parameter/parameter.h"
-#include <glibmm/i18n.h>
#include "helper/geom.h"
#include "livarot/Path.h"
#include "splivarot.h"
@@ -21,6 +18,8 @@
#include <2geom/interval.h>
#include "ui/icon-names.h"
#include "util/units.h"
+// TODO due to internal breakage in glibmm headers, this must be last:
+#include <glibmm/i18n.h>
namespace Inkscape {
namespace LivePathEffect {
diff --git a/src/live_effects/lpe-simplify.h b/src/live_effects/lpe-simplify.h
index 294d77b35..8135561af 100644
--- a/src/live_effects/lpe-simplify.h
+++ b/src/live_effects/lpe-simplify.h
@@ -6,7 +6,7 @@
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
-
+#include <gtkmm.h>
#include "live_effects/effect.h"
#include "live_effects/parameter/togglebutton.h"
#include "live_effects/lpegroupbbox.h"
diff --git a/src/live_effects/parameter/togglebutton.cpp b/src/live_effects/parameter/togglebutton.cpp
index 5977a5114..b30a5a3d2 100644
--- a/src/live_effects/parameter/togglebutton.cpp
+++ b/src/live_effects/parameter/togglebutton.cpp
@@ -25,10 +25,10 @@ namespace LivePathEffect {
ToggleButtonParam::ToggleButtonParam( const Glib::ustring& label, const Glib::ustring& tip,
const Glib::ustring& key, Inkscape::UI::Widget::Registry* wr,
Effect* effect, bool default_value, const Glib::ustring& inactive_label,
- char const * icon_active, char const * icon_inactive,
- Inkscape::IconSize icon_size)
+ char const * _icon_active, char const * _icon_inactive,
+ Inkscape::IconSize _icon_size)
: Parameter(label, tip, key, wr, effect), value(default_value), defvalue(default_value),
- inactiveLabel(inactive_label), iconActive(icon_active), iconInactive(icon_inactive), iconSize(icon_size)
+ inactive_label(inactive_label), _icon_active(_icon_active), _icon_inactive(_icon_inactive), _icon_size(_icon_size)
{
checkwdg = NULL;
}
@@ -76,45 +76,47 @@ ToggleButtonParam::param_newWidget()
param_effect->getRepr(),
param_effect->getSPDoc()) );
#if GTK_CHECK_VERSION(3,0,0)
- GtkWidget * boxButton = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
- gtk_box_set_homogeneous(GTK_BOX(boxButton), false);
+ GtkWidget * box_button = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+ gtk_box_set_homogeneous(GTK_BOX(box_button), false);
#else
- GtkWidget * boxButton = gtk_hbox_new (false, 0);
+ GtkWidget * box_button = gtk_hbox_new (false, 0);
#endif
- GtkWidget * labelButton = gtk_label_new ("");
+ GtkWidget * label_button = gtk_label_new ("");
if (!param_label.empty()) {
- if(value || inactiveLabel.empty()){
- gtk_label_set_text(GTK_LABEL(labelButton), param_label.c_str());
+ if(value || inactive_label.empty()){
+ gtk_label_set_text(GTK_LABEL(label_button), param_label.c_str());
}else{
- gtk_label_set_text(GTK_LABEL(labelButton), inactiveLabel.c_str());
+ gtk_label_set_text(GTK_LABEL(label_button), inactive_label.c_str());
}
}
- gtk_widget_show(labelButton);
- if ( iconActive ) {
- if(!iconInactive){
- iconInactive = iconActive;
+ gtk_widget_show(label_button);
+ if ( _icon_active ) {
+ if(!_icon_inactive){
+ _icon_inactive = _icon_active;
}
- gtk_widget_show(boxButton);
- GtkWidget *iconButton = sp_icon_new(iconSize, iconActive);
+ gtk_widget_show(box_button);
+ GtkWidget *icon_button = NULL;
if(!value){
- iconButton = sp_icon_new(iconSize, iconInactive);
+ icon_button = sp_icon_new(_icon_size, _icon_inactive);
+ } else {
+ icon_button = sp_icon_new(_icon_size, _icon_active);
}
- gtk_widget_show(iconButton);
- gtk_box_pack_start (GTK_BOX(boxButton), iconButton, false, false, 1);
+ gtk_widget_show(icon_button);
+ gtk_box_pack_start (GTK_BOX(box_button), icon_button, false, false, 1);
if (!param_label.empty()) {
- gtk_box_pack_start (GTK_BOX(boxButton), labelButton, false, false, 1);
+ gtk_box_pack_start (GTK_BOX(box_button), label_button, false, false, 1);
}
}else{
- gtk_box_pack_start (GTK_BOX(boxButton), labelButton, false, false, 1);
+ gtk_box_pack_start (GTK_BOX(box_button), label_button, false, false, 1);
}
- param_effect->upd_params = false;
+
checkwdg->add(*Gtk::manage(Glib::wrap(boxButton)));
checkwdg->setActive(value);
checkwdg->setProgrammatically = false;
checkwdg->set_undo_parameters(SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Change togglebutton parameter"));
_toggled_connection = checkwdg->signal_toggled().connect(sigc::mem_fun(*this, &ToggleButtonParam::toggled));
-
+ param_effect->upd_params = false;
return checkwdg;
}
@@ -128,25 +130,27 @@ ToggleButtonParam::refresh_button()
if(!checkwdg){
return;
}
- Gtk::Widget * boxButton = checkwdg->get_child();
- if(!boxButton){
+ Gtk::Widget * box_button = checkwdg->get_child();
+ if(!box_button){
return;
}
- GList * childs = gtk_container_get_children(GTK_CONTAINER(boxButton->gobj()));
- guint totalWidgets = g_list_length (childs);
+ GList * childs = gtk_container_get_children(GTK_CONTAINER(box_button->gobj()));
+ guint total_widgets = g_list_length (childs);
if (!param_label.empty()) {
- if(value || inactiveLabel.empty()){
- gtk_label_set_text(GTK_LABEL(g_list_nth_data(childs, totalWidgets-1)), param_label.c_str());
+ if(value || inactive_label.empty()){
+ gtk_label_set_text(GTK_LABEL(g_list_nth_data(childs, total_widgets-1)), param_label.c_str());
}else{
- gtk_label_set_text(GTK_LABEL(g_list_nth_data(childs, totalWidgets-1)), inactiveLabel.c_str());
+ gtk_label_set_text(GTK_LABEL(g_list_nth_data(childs, total_widgets-1)), inactive_label.c_str());
}
}
- if ( iconActive ) {
- GdkPixbuf * iconPixbuf = sp_pixbuf_new( iconSize, iconActive );
+ if ( _icon_active ) {
+ GdkPixbuf * icon_pixbuf = NULL;
if(!value){
- iconPixbuf = sp_pixbuf_new( iconSize, iconInactive);
+ icon_pixbuf = sp_pixbuf_new( _icon_size, _icon_inactive );
+ } else {
+ icon_pixbuf = sp_pixbuf_new( _icon_size, _icon_active );
}
- gtk_image_set_from_pixbuf (GTK_IMAGE(g_list_nth_data(childs, 0)), iconPixbuf);
+ gtk_image_set_from_pixbuf (GTK_IMAGE(g_list_nth_data(childs, 0)), icon_pixbuf);
}
}
diff --git a/src/live_effects/parameter/togglebutton.h b/src/live_effects/parameter/togglebutton.h
index 4e545bcfd..8390fec86 100644
--- a/src/live_effects/parameter/togglebutton.h
+++ b/src/live_effects/parameter/togglebutton.h
@@ -59,10 +59,10 @@ private:
void refresh_button();
bool value;
bool defvalue;
- const Glib::ustring inactiveLabel;
- const char * iconActive;
- const char * iconInactive;
- Inkscape::IconSize iconSize;
+ const Glib::ustring inactive_label;
+ const char * _icon_active;
+ const char * _icon_inactive;
+ Inkscape::IconSize _icon_size;
Inkscape::UI::Widget::RegisteredToggleButton * checkwdg;
sigc::signal<void> _signal_toggled;
diff --git a/src/ui/tools/tool-base.cpp b/src/ui/tools/tool-base.cpp
index 36fe26e76..72ba499de 100644
--- a/src/ui/tools/tool-base.cpp
+++ b/src/ui/tools/tool-base.cpp
@@ -1083,7 +1083,7 @@ void sp_event_root_menu_popup(SPDesktop *desktop, SPItem *item, GdkEvent *event)
/* fixme: This is not what I want but works for now (Lauris) */
if (event->type == GDK_KEY_PRESS) {
- item = desktop->getSelection()->singleItem();
+ item = desktop->getSelection()->itemList().front();
}
ContextMenu* CM = new ContextMenu(desktop, item);
diff --git a/src/ui/widget/registered-widget.cpp b/src/ui/widget/registered-widget.cpp
index 7abab25c9..c58e599ee 100644
--- a/src/ui/widget/registered-widget.cpp
+++ b/src/ui/widget/registered-widget.cpp
@@ -114,10 +114,8 @@ RegisteredToggleButton::~RegisteredToggleButton()
_toggled_connection.disconnect();
}
-RegisteredToggleButton::RegisteredToggleButton (const Glib::ustring& /*label*/, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, bool right, Inkscape::XML::Node* repr_in, SPDocument *doc_in, char const *active_str, char const *inactive_str)
+RegisteredToggleButton::RegisteredToggleButton (const Glib::ustring& /*label*/, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, bool right, Inkscape::XML::Node* repr_in, SPDocument *doc_in, char const *icon_active, char const *icon_inactive)
: RegisteredWidget<Gtk::ToggleButton>()
- , _active_str(active_str)
- , _inactive_str(inactive_str)
{
init_parent(key, wr, repr_in, doc_in);
setProgrammatically = false;
@@ -150,7 +148,7 @@ RegisteredToggleButton::on_toggled()
return;
_wr->setUpdating (true);
- write_to_xml(get_active() ? _active_str : _inactive_str);
+ write_to_xml(get_active() ? "true" : "false");
//The slave button is greyed out if the master button is untoggled
for (std::list<Gtk::Widget*>::const_iterator i = _slavewidgets.begin(); i != _slavewidgets.end(); ++i) {
(*i)->set_sensitive(get_active());
diff --git a/src/ui/widget/registered-widget.h b/src/ui/widget/registered-widget.h
index 17c04de9f..3c8205058 100644
--- a/src/ui/widget/registered-widget.h
+++ b/src/ui/widget/registered-widget.h
@@ -167,7 +167,7 @@ protected:
class RegisteredToggleButton : public RegisteredWidget<Gtk::ToggleButton> {
public:
virtual ~RegisteredToggleButton();
- RegisteredToggleButton (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, bool right=true, Inkscape::XML::Node* repr_in=NULL, SPDocument *doc_in=NULL, char const *active_str = "true", char const *inactive_str = "false");
+ RegisteredToggleButton (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, bool right=true, Inkscape::XML::Node* repr_in=NULL, SPDocument *doc_in=NULL, char const *icon_active = "true", char const *icon_inactive = "false");
void setActive (bool);
@@ -184,7 +184,6 @@ public:
// if a callback checks it, it must reset it back to false
protected:
- char const *_active_str, *_inactive_str;
sigc::connection _toggled_connection;
void on_toggled();
};