diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2017-10-01 15:49:53 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marc@jeanmougin.fr> | 2017-10-01 15:49:53 +0000 |
| commit | 17edb1a6d1a35aeeeb4e07ec64ceec63351e8a25 (patch) | |
| tree | 86d7978cc682693b3841826c1d9036493a21c159 | |
| parent | Removed all GSList occurences in .h files (diff) | |
| parent | A little styling tweak to a LPE expander (diff) | |
| download | inkscape-17edb1a6d1a35aeeeb4e07ec64ceec63351e8a25.tar.gz inkscape-17edb1a6d1a35aeeeb4e07ec64ceec63351e8a25.zip | |
Merge branch 'master' of gitlab.com:inkscape/inkscape
| -rw-r--r-- | buildtools/appveyor.sh | 7 | ||||
| -rw-r--r-- | buildtools/msys2installdeps.sh | 11 | ||||
| -rw-r--r-- | src/extension/internal/bitmap/imagemagick.cpp | 32 | ||||
| -rw-r--r-- | src/live_effects/effect.cpp | 3 | ||||
| -rw-r--r-- | src/live_effects/lpe-clone-original.cpp | 8 | ||||
| -rw-r--r-- | src/live_effects/parameter/item.cpp | 5 | ||||
| -rw-r--r-- | src/live_effects/parameter/text.cpp | 24 | ||||
| -rw-r--r-- | src/live_effects/parameter/text.h | 1 | ||||
| -rw-r--r-- | src/path-chemistry.cpp | 7 |
9 files changed, 67 insertions, 31 deletions
diff --git a/buildtools/appveyor.sh b/buildtools/appveyor.sh index 5dac1227f..d8dddb104 100644 --- a/buildtools/appveyor.sh +++ b/buildtools/appveyor.sh @@ -9,6 +9,13 @@ error() { echo -e "\e[1;31m\nError: ${1}\n\e[0m"; exit 1; } ### setup +# reduce time required to install packages by disabling pacman's disk space checking +sed -i 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf + +# update MSYS2-packages and MINGW-packages (but only for current architecture) +pacman -Quq | grep -v mingw-w64- | xargs pacman -S --needed --noconfirm --noprogressbar +pacman -Quq | grep ${MINGW_PACKAGE_PREFIX} | xargs pacman -S --needed --noconfirm --noprogressbar + # do everything in /build cd "$(cygpath ${APPVEYOR_BUILD_FOLDER})" mkdir build diff --git a/buildtools/msys2installdeps.sh b/buildtools/msys2installdeps.sh index 38c713342..e2b0528e1 100644 --- a/buildtools/msys2installdeps.sh +++ b/buildtools/msys2installdeps.sh @@ -68,14 +68,9 @@ $ARCH-libyaml # or (always!) run pacman with the additional command line switch # --ignore=mingw-w64-*-imagemagick for arch in $(eval echo $ARCH); do - case ${arch} in - mingw-w64-i686) - pacman -U --needed --noconfirm http://repo.msys2.org/mingw/i686/mingw-w64-i686-imagemagick-6.9.3.7-1-any.pkg.tar.xz - ;; - mingw-w64-x86_64) - pacman -U --needed --noconfirm http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-imagemagick-6.9.3.7-1-any.pkg.tar.xz - ;; - esac + wget -nv https://gitlab.com/Ede123/bintray/raw/master/${arch}-imagemagick-6.9.9.15-1-any.pkg.tar.xz \ + && pacman -U --needed --noconfirm ${arch}-imagemagick-6.9.9.15-1-any.pkg.tar.xz \ + && rm ${arch}-imagemagick-6.9.9.15-1-any.pkg.tar.xz done diff --git a/src/extension/internal/bitmap/imagemagick.cpp b/src/extension/internal/bitmap/imagemagick.cpp index cc5b3d1bc..352271e26 100644 --- a/src/extension/internal/bitmap/imagemagick.cpp +++ b/src/extension/internal/bitmap/imagemagick.cpp @@ -39,7 +39,7 @@ namespace Bitmap { class ImageMagickDocCache: public Inkscape::Extension::Implementation::ImplementationDocumentCache { friend class ImageMagick; private: - void readImage(char const *xlink, Magick::Image *image); + void readImage(char const *xlink, char const *id, Magick::Image *image); protected: Inkscape::XML::Node** _nodes; @@ -85,11 +85,12 @@ ImageMagickDocCache::ImageMagickDocCache(Inkscape::UI::View::View * view) : { _nodes[_imageCount] = node; char const *xlink = node->attribute("xlink:href"); + char const *id = node->attribute("id"); _originals[_imageCount] = xlink; _caches[_imageCount] = (char*)""; _cacheLengths[_imageCount] = 0; _images[_imageCount] = new Magick::Image(); - readImage(xlink, _images[_imageCount]); + readImage(xlink, id, _images[_imageCount]); _imageItems[_imageCount] = item; _imageCount++; } @@ -113,26 +114,33 @@ ImageMagickDocCache::~ImageMagickDocCache ( ) { } void -ImageMagickDocCache::readImage(const char *xlink, Magick::Image *image) +ImageMagickDocCache::readImage(const char *xlink, const char *id, Magick::Image *image) { // Find if the xlink:href is base64 data, i.e. if the image is embedded - char *search = (char *) g_strndup(xlink, 30); + gchar *search = g_strndup(xlink, 30); if (strstr(search, "base64") != (char*)NULL) { // 7 = strlen("base64") + strlen(",") const char* pureBase64 = strstr(xlink, "base64") + 7; Magick::Blob blob; blob.base64(pureBase64); - image->read(blob); - } - else { - const gchar *path = xlink; - if (strncmp (xlink,"file:", 5) == 0) { - path = g_filename_from_uri(xlink, NULL, NULL); + try { + image->read(blob); + } catch (Magick::Exception &error_) { + g_warning("ImageMagick could not read '%s'\nDetails: %s", id, error_.what()); + } + } else { + gchar *path; + if (strncmp (xlink,"file:", 5) == 0) { + path = g_filename_from_uri(xlink, NULL, NULL); + } else { + path = g_strdup(xlink); } - try { image->read(path); - } catch (...) {} + } catch (Magick::Exception &error_) { + g_warning("ImageMagick could not read '%s' from '%s'\nDetails: %s", id, path, error_.what()); + } + g_free(path); } g_free(search); } diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 703852881..2332ab8f2 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -874,7 +874,8 @@ Effect::defaultParamSet() vbox->pack_start(*dynamic_cast<Gtk::Widget *> (expander), true, true, 2); if (has_params) { Gtk::Widget *vboxwidg = dynamic_cast<Gtk::Widget *>(vbox); - vboxwidg->set_margin_bottom(15); + vboxwidg->set_margin_bottom(10); + vboxwidg->set_margin_top(5); return vboxwidg; } else { return NULL; diff --git a/src/live_effects/lpe-clone-original.cpp b/src/live_effects/lpe-clone-original.cpp index b035cc1d0..6e5ad66bf 100644 --- a/src/live_effects/lpe-clone-original.cpp +++ b/src/live_effects/lpe-clone-original.cpp @@ -181,7 +181,7 @@ LPECloneOriginal::cloneAttrbutes(SPObject *origin, SPObject *dest, const char * g_strfreev (styleattarray); Glib::ustring css_str; sp_repr_css_write_string(css_dest,css_str); - dest->getRepr()->setAttribute("style", css_str.c_str()); + dest->getRepr()->setAttribute("style", g_strdup(css_str.c_str())); } void @@ -189,9 +189,9 @@ LPECloneOriginal::doBeforeEffect (SPLPEItem const* lpeitem){ if (linkeditem.linksToItem()) { Glib::ustring attr = ""; if (method != CLM_NONE) { - attr.append("d,"); + attr += Glib::ustring("d,"); } - attr.append(Glib::ustring(attributes.param_getSVGValue()).append(",")); + attr += Glib::ustring(attributes.param_getSVGValue()) + Glib::ustring(","); if (attr.size() && !Glib::ustring(attributes.param_getSVGValue()).size()) { attr.erase (attr.size()-1, 1); } @@ -199,7 +199,7 @@ LPECloneOriginal::doBeforeEffect (SPLPEItem const* lpeitem){ if (style_attr.size() && !Glib::ustring(style_attributes.param_getSVGValue()).size()) { style_attr.erase (style_attr.size()-1, 1); } - style_attr.append(Glib::ustring(style_attributes.param_getSVGValue()).append(",")); + style_attr += Glib::ustring(style_attributes.param_getSVGValue()) + Glib::ustring(","); SPItem * origin = SP_ITEM(linkeditem.getObject()); SPItem * dest = SP_ITEM(sp_lpe_item); diff --git a/src/live_effects/parameter/item.cpp b/src/live_effects/parameter/item.cpp index 149fd6627..e075cab1a 100644 --- a/src/live_effects/parameter/item.cpp +++ b/src/live_effects/parameter/item.cpp @@ -101,7 +101,10 @@ ItemParam::param_readSVGValue(const gchar * strvalue) gchar * ItemParam::param_getSVGValue() const { - return g_strdup(href); + if (href) { + return g_strdup(href); + } + return g_strdup(""); } gchar * diff --git a/src/live_effects/parameter/text.cpp b/src/live_effects/parameter/text.cpp index 3f41bfeed..7e56b2c75 100644 --- a/src/live_effects/parameter/text.cpp +++ b/src/live_effects/parameter/text.cpp @@ -9,7 +9,7 @@ */ #include "ui/widget/registered-widget.h" -#include <glibmm/i18n.h> +#include <gtkmm/alignment.h> #include "live_effects/parameter/text.h" #include "live_effects/effect.h" @@ -18,9 +18,10 @@ #include "inkscape.h" #include "verbs.h" #include "display/canvas-text.h" - #include <2geom/sbasis-geometric.h> +#include <glibmm/i18n.h> + namespace Inkscape { namespace LivePathEffect { @@ -124,6 +125,14 @@ TextParam::param_getDefaultSVGValue() const return str; } +void +TextParam::setTextParam(Inkscape::UI::Widget::RegisteredText *rsu) +{ + Glib::ustring str(rsu->getText()); + param_setValue(str); + write_to_SVG(); +} + Gtk::Widget * TextParam::param_newWidget() { @@ -131,9 +140,16 @@ TextParam::param_newWidget() param_label, param_tooltip, param_key, *param_wr, param_effect->getRepr(), param_effect->getSPDoc())); rsu->setText(value); rsu->setProgrammatically = false; - rsu->set_undo_parameters(SP_VERB_DIALOG_LIVE_PATH_EFFECT, _("Change text parameter")); - return dynamic_cast<Gtk::Widget *> (rsu); + Gtk::Box *text_container = Gtk::manage(new Gtk::Box()); + Gtk::Button *set = Gtk::manage(new Gtk::Button(Glib::ustring("✔"))); + set->signal_clicked() + .connect(sigc::bind<Inkscape::UI::Widget::RegisteredText *>(sigc::mem_fun(*this, &TextParam::setTextParam),rsu)); + text_container->pack_start(*rsu, false, false, 2); + text_container->pack_start(*set, false, false, 2); + Gtk::Widget *return_widg = dynamic_cast<Gtk::Widget *> (text_container); + return_widg->set_halign(Gtk::ALIGN_END); + return return_widg; } void diff --git a/src/live_effects/parameter/text.h b/src/live_effects/parameter/text.h index 460ef8629..a9de26a52 100644 --- a/src/live_effects/parameter/text.h +++ b/src/live_effects/parameter/text.h @@ -42,6 +42,7 @@ public: void param_setValue(Glib::ustring newvalue); void param_hide_canvas_text(); + void setTextParam(Inkscape::UI::Widget::RegisteredText *rsu); virtual void param_set_default(); virtual void param_update_default(const gchar * default_value); void setPos(Geom::Point pos); diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index 043d47517..89cf6fb43 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -366,7 +366,12 @@ sp_item_list_to_curves(const std::vector<SPItem*> &items, std::vector<SPItem*>& { continue; } - + //TODO: decide if we want to unlink clones or not, for now keep previous functionality retaining clones as is + SPUse *use = dynamic_cast<SPUse *>(item); + if (use) { + continue; + } + SPPath *path = dynamic_cast<SPPath *>(item); if (path && !path->_curve_before_lpe) { // remove connector attributes |
