summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/clipboard.cpp40
-rw-r--r--src/ui/dialog/align-and-distribute.cpp4
-rw-r--r--src/ui/dialog/export.cpp15
-rw-r--r--src/ui/dialog/export.h2
-rw-r--r--src/ui/dialog/filedialogimpl-gtkmm.cpp2
-rw-r--r--src/ui/widget/registered-widget.h2
-rw-r--r--src/ui/widget/selected-style.cpp57
7 files changed, 39 insertions, 83 deletions
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp
index 42fc2fab4..2e866a9d1 100644
--- a/src/ui/clipboard.cpp
+++ b/src/ui/clipboard.cpp
@@ -645,7 +645,6 @@ Glib::ustring ClipboardManagerImpl::getShapeOrTextObjectId(SPDesktop *desktop)
return svgd;
}
-
/**
* Iterate over a list of items and copy them to the clipboard.
*/
@@ -691,25 +690,6 @@ void ClipboardManagerImpl::_copySelection(ObjectSet *selection)
else
obj_copy = _copyNode(obj, _doc, _clipnode);
- // For lpe items, copy lpe stack if applicable
- SPLPEItem *lpeitem = dynamic_cast<SPLPEItem *>(item);
- if (lpeitem) {
- Inkscape::SVGOStringStream os;
- if (lpeitem->hasPathEffect()) {
- for (PathEffectList::iterator it = lpeitem->path_effect_list->begin(); it != lpeitem->path_effect_list->end(); ++it)
- {
- LivePathEffectObject *lpeobj = (*it)->lpeobject;
- if (lpeobj) {
- Inkscape::XML::Node * lpeobjcopy = _copyNode(lpeobj->getRepr(), _doc, _defs);
- gchar *new_conflict_id = sp_object_get_unique_id(lpeobj, lpeobj->getAttribute("id"));
- lpeobjcopy->setAttribute("id", new_conflict_id);
- g_free(new_conflict_id);
- os << "#" << lpeobjcopy->attribute("id") << ";";
- }
- }
- }
- obj_copy->setAttribute("inkscape:path-effect", os.str().c_str());
- }
// copy complete inherited style
SPCSSAttr *css = sp_repr_css_attr_inherited(obj, "style");
sp_repr_css_set(obj_copy, css, "style");
@@ -741,6 +721,13 @@ void ClipboardManagerImpl::_copySelection(ObjectSet *selection)
sp_repr_css_set(_clipnode, style, "style");
sp_repr_css_attr_unref(style);
}
+ // copy path effect from the first path
+ if (object) {
+ gchar const *effect =object->getRepr()->attribute("inkscape:path-effect");
+ if (effect) {
+ _clipnode->setAttribute("inkscape:path-effect", effect);
+ }
+ }
}
Geom::OptRect size = selection->visualBounds();
@@ -843,6 +830,19 @@ void ClipboardManagerImpl::_copyUsedDefs(SPItem *item)
}
}
+ // For lpe items, copy lpe stack if applicable
+ SPLPEItem *lpeitem = dynamic_cast<SPLPEItem *>(item);
+ if (lpeitem) {
+ if (lpeitem->hasPathEffect()) {
+ for (PathEffectList::iterator it = lpeitem->path_effect_list->begin(); it != lpeitem->path_effect_list->end(); ++it){
+ LivePathEffectObject *lpeobj = (*it)->lpeobject;
+ if (lpeobj) {
+ _copyNode(lpeobj->getRepr(), _doc, _defs);
+ }
+ }
+ }
+ }
+
// recurse
for(auto& o: item->children) {
SPItem *childItem = dynamic_cast<SPItem *>(&o);
diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp
index 236832beb..1c88fc849 100644
--- a/src/ui/dialog/align-and-distribute.cpp
+++ b/src/ui/dialog/align-and-distribute.cpp
@@ -614,7 +614,7 @@ private :
}
};
-// instantiae the private static member
+// instantiate the private static member
boost::optional<Geom::Point> ActionExchangePositions::center;
class ActionUnclump : public Action {
@@ -928,7 +928,7 @@ AlignAndDistribute::AlignAndDistribute()
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
- //Instanciate the align buttons
+ //Instantiate the align buttons
addAlignButton(INKSCAPE_ICON("align-horizontal-right-to-anchor"),
_("Align right edges of objects to the left edge of the anchor"),
0, 0);
diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp
index 9bebde00f..1bb952de4 100644
--- a/src/ui/dialog/export.cpp
+++ b/src/ui/dialog/export.cpp
@@ -151,8 +151,10 @@ Export::Export (void) :
zlib_compression(),
pHYs_label(_("pHYs dpi")),
pHYs_sb(pHYs_adj, 1.0, 2),
+ antialiasing_label(_("Antialiasing")),
+ antialiasing_cb(),
hide_box(false, 5),
- hide_export(_("Hide a_ll except selected"), _("In the exported image, hide all objects except those that are selected")),
+ hide_export(_("Hide all except selected"), _("In the exported image, hide all objects except those that are selected")),
closeWhenDone(_("Close when complete"), _("Once the export completes, close this dialog")),
button_box(false, 3),
_prog(),
@@ -340,6 +342,10 @@ Export::Export (void) :
pHYs_sb.set_width_chars(7);
pHYs_sb.set_tooltip_text( _("Will force-set the physical dpi for the png file. Set this to 72 if you're planning to work on your png with Photoshop") );
zlib_compression.set_hexpand();
+ const char* const antialising_list[] = {"CAIRO_ANTIALIAS_NONE","CAIRO_ANTIALIAS_FAST","CAIRO_ANTIALIAS_GOOD (default)","CAIRO_ANTIALIAS_BEST"};
+ for(int i=0; i<4; ++i)
+ antialiasing_cb.append(antialising_list[i]);
+ antialiasing_cb.set_active_text(antialising_list[2]);
auto table = new Gtk::Grid();
gtk_container_add(GTK_CONTAINER(expander.gobj()), (GtkWidget*)(table->gobj()));
table->attach(interlacing,0,0,1,1);
@@ -349,6 +355,8 @@ Export::Export (void) :
table->attach(zlib_compression,1,2,1,1);
table->attach(pHYs_label,0,3,1,1);
table->attach(pHYs_sb,1,3,1,1);
+ table->attach(antialiasing_label,0,4,1,1);
+ table->attach(antialiasing_cb,1,4,1,1);
table->show();
/* Main dialog */
@@ -984,6 +992,7 @@ void Export::onExport ()
int bitdepths[] = {1,2,4,8,16,8,16,8,16,8,16};
int color_type = colortypes[bitdepth_cb.get_active_row_number()] ;
int bit_depth = bitdepths[bitdepth_cb.get_active_row_number()] ;
+ int antialiasing = antialiasing_cb.get_active_row_number();
if (batch_export.get_active ()) {
@@ -1052,7 +1061,7 @@ void Export::onExport ()
onProgressCallback, (void*)prog_dlg,
TRUE, // overwrite without asking
hide ? selected : x,
- do_interlace, color_type, bit_depth, zlib
+ do_interlace, color_type, bit_depth, zlib, antialiasing
)) {
gchar * error = g_strdup_printf(_("Could not export to filename %s.\n"), safeFile);
@@ -1145,7 +1154,7 @@ void Export::onExport ()
onProgressCallback, (void*)prog_dlg,
FALSE,
hide ? selected : x,
- do_interlace, color_type, bit_depth, zlib
+ do_interlace, color_type, bit_depth, zlib, antialiasing
);
if (status == EXPORT_ERROR) {
gchar * safeFile = Inkscape::IO::sanitizeString(path.c_str());
diff --git a/src/ui/dialog/export.h b/src/ui/dialog/export.h
index f64d92341..1f8e87dbc 100644
--- a/src/ui/dialog/export.h
+++ b/src/ui/dialog/export.h
@@ -327,6 +327,8 @@ private:
Gtk::Label pHYs_label;
Glib::RefPtr<Gtk::Adjustment> pHYs_adj;
Gtk::SpinButton pHYs_sb;
+ Gtk::Label antialiasing_label;
+ Gtk::ComboBoxText antialiasing_cb;
/* Export Button widgets */
Gtk::HBox button_box;
diff --git a/src/ui/dialog/filedialogimpl-gtkmm.cpp b/src/ui/dialog/filedialogimpl-gtkmm.cpp
index f5450ac9a..92e9ce834 100644
--- a/src/ui/dialog/filedialogimpl-gtkmm.cpp
+++ b/src/ui/dialog/filedialogimpl-gtkmm.cpp
@@ -554,7 +554,7 @@ bool SVGPreview::set(Glib::ustring &fileName, int dialogType)
Glib::ustring fileNameUtf8 = Glib::filename_to_utf8(fileName);
gchar *fName = const_cast<gchar *>(
fileNameUtf8.c_str()); // const-cast probably not necessary? (not necessary on Windows version of stat())
- struct stat info;
+ GStatBuf info;
if (g_stat(fName, &info)) // stat returns 0 upon success
{
g_warning("SVGPreview::set() : %s : %s", fName, strerror(errno));
diff --git a/src/ui/widget/registered-widget.h b/src/ui/widget/registered-widget.h
index d410dbfe6..f66d5cbf2 100644
--- a/src/ui/widget/registered-widget.h
+++ b/src/ui/widget/registered-widget.h
@@ -135,7 +135,7 @@ private:
repr = NULL;
doc = NULL;
write_undo = false;
- event_type = -1;
+ event_type = 0; //SP_VERB_INVALID
}
};
diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp
index fa7a83732..0370d55db 100644
--- a/src/ui/widget/selected-style.cpp
+++ b/src/ui/widget/selected-style.cpp
@@ -781,62 +781,7 @@ void SelectedStyle::on_stroke_paste() {
}
void SelectedStyle::on_fillstroke_swap() {
- SPCSSAttr *css = sp_repr_css_attr_new ();
-
- switch (_mode[SS_FILL]) {
- case SS_NA:
- case SS_MANY:
- break;
- case SS_NONE:
- sp_repr_css_set_property (css, "stroke", "none");
- break;
- case SS_UNSET:
- sp_repr_css_unset_property (css, "stroke");
- break;
- case SS_COLOR:
- gchar c[64];
- sp_svg_write_color (c, sizeof(c), _thisselected[SS_FILL]);
- sp_repr_css_set_property (css, "stroke", c);
- break;
- case SS_LGRADIENT:
- case SS_RGRADIENT:
-#ifdef WITH_MESH
- case SS_MGRADIENT:
-#endif
- case SS_PATTERN:
- sp_repr_css_set_property (css, "stroke", _paintserver_id[SS_FILL].c_str());
- break;
- }
-
- switch (_mode[SS_STROKE]) {
- case SS_NA:
- case SS_MANY:
- break;
- case SS_NONE:
- sp_repr_css_set_property (css, "fill", "none");
- break;
- case SS_UNSET:
- sp_repr_css_unset_property (css, "fill");
- break;
- case SS_COLOR:
- gchar c[64];
- sp_svg_write_color (c, sizeof(c), _thisselected[SS_STROKE]);
- sp_repr_css_set_property (css, "fill", c);
- break;
- case SS_LGRADIENT:
- case SS_RGRADIENT:
-#ifdef WITH_MESH
- case SS_MGRADIENT:
-#endif
- case SS_PATTERN:
- sp_repr_css_set_property (css, "fill", _paintserver_id[SS_STROKE].c_str());
- break;
- }
-
- sp_desktop_set_style (_desktop, css);
- sp_repr_css_attr_unref (css);
- DocumentUndo::done(_desktop->getDocument(), SP_VERB_DIALOG_FILL_STROKE,
- _("Swap fill and stroke"));
+ _desktop->getSelection()->swapFillStroke();
}
void SelectedStyle::on_fill_edit() {