summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarkus Engel <markus.engel@tum.de>2013-04-20 21:21:33 +0000
committerMarkus Engel <markus.engel@tum.de>2013-04-20 21:21:33 +0000
commit39580f4b417374ccba9d504f028388b2a2932506 (patch)
treea4337231a1b27403dceb49810ea618297ed0b659 /src
parentMerging of EventContext classes complete. (diff)
parentGroup bbox update (Bug 1168979) (diff)
downloadinkscape-39580f4b417374ccba9d504f028388b2a2932506.tar.gz
inkscape-39580f4b417374ccba9d504f028388b2a2932506.zip
merged from trunk (r12287)
(bzr r11608.1.99)
Diffstat (limited to 'src')
-rw-r--r--src/display/cairo-utils.h2
-rw-r--r--src/display/drawing-image.cpp7
-rw-r--r--src/display/nr-style.cpp2
-rw-r--r--src/display/nr-style.h2
-rw-r--r--src/extension/implementation/script.cpp81
-rw-r--r--src/extension/internal/odf.cpp120
-rw-r--r--src/extension/internal/odf.h4
-rw-r--r--src/extension/param/radiobutton.cpp2
-rw-r--r--src/file.cpp4
-rw-r--r--src/livarot/ShapeSweep.cpp8
-rw-r--r--src/main.cpp15
-rw-r--r--src/proofs2
-rw-r--r--src/select-context.cpp4
-rw-r--r--src/selection-chemistry.cpp1
-rw-r--r--src/sp-paint-server-reference.h2
-rw-r--r--src/sp-pattern.cpp2
-rw-r--r--src/style.cpp98
-rw-r--r--src/style.h36
-rw-r--r--src/ui/dialog/font-substitution.cpp1
-rw-r--r--src/ui/dialog/symbols.cpp8
-rw-r--r--src/ui/dialog/text-edit.cpp50
-rw-r--r--src/ui/dialog/text-edit.h10
-rw-r--r--src/ui/dialog/xml-tree.cpp1
-rw-r--r--src/verbs.cpp2
-rw-r--r--src/xml/repr.h8
25 files changed, 314 insertions, 158 deletions
diff --git a/src/display/cairo-utils.h b/src/display/cairo-utils.h
index 2596cd969..016f72d00 100644
--- a/src/display/cairo-utils.h
+++ b/src/display/cairo-utils.h
@@ -203,4 +203,4 @@ inline guint AssembleARGB32(guint32 a, guint32 r, guint32 g, guint32 b)
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
diff --git a/src/display/drawing-image.cpp b/src/display/drawing-image.cpp
index 3f1a86ee7..753249e60 100644
--- a/src/display/drawing-image.cpp
+++ b/src/display/drawing-image.cpp
@@ -121,6 +121,13 @@ unsigned DrawingImage::_renderItem(DrawingContext &ct, Geom::IntRect const &/*ar
if (!outline) {
if (!_pixbuf) return RENDER_OK;
+ // if (_style) {
+ // _style->image_rendering.computed
+ // See: http://www.w3.org/TR/SVG/painting.html#ImageRenderingProperty
+ // http://www.w3.org/TR/css4-images/#the-image-rendering
+ // style.h/style.cpp
+ // }
+
Inkscape::DrawingContext::Save save(ct);
ct.transform(_ctm);
ct.newPath();
diff --git a/src/display/nr-style.cpp b/src/display/nr-style.cpp
index ba2340074..26d70ad15 100644
--- a/src/display/nr-style.cpp
+++ b/src/display/nr-style.cpp
@@ -220,4 +220,4 @@ void NRStyle::update()
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
diff --git a/src/display/nr-style.h b/src/display/nr-style.h
index 80547c43e..cd0bd208f 100644
--- a/src/display/nr-style.h
+++ b/src/display/nr-style.h
@@ -81,4 +81,4 @@ struct NRStyle {
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp
index 3ac1e06ab..69ce982d0 100644
--- a/src/extension/implementation/script.cpp
+++ b/src/extension/implementation/script.cpp
@@ -669,8 +669,13 @@ void Script::effect(Inkscape::Extension::Effect *module,
printf("TOO BAD TO LIVE!!!");
exit(1);
}
+ if (doc == NULL)
+ {
+ g_warning("Script::effect: View not defined");
+ return;
+ }
- SPDesktop *desktop = (SPDesktop *)doc;
+ SPDesktop *desktop = reinterpret_cast<SPDesktop *>(doc);
sp_namedview_document_from_window(desktop);
std::list<std::string> params;
@@ -696,16 +701,14 @@ void Script::effect(Inkscape::Extension::Effect *module,
return;
}
- if (desktop != NULL) {
- Inkscape::Util::GSListConstIterator<SPItem *> selected =
- sp_desktop_selection(desktop)->itemList();
- while ( selected != NULL ) {
- Glib::ustring selected_id;
- selected_id += "--id=";
- selected_id += (*selected)->getId();
- params.insert(params.begin(), selected_id);
- ++selected;
- }
+ Inkscape::Util::GSListConstIterator<SPItem *> selected =
+ sp_desktop_selection(desktop)->itemList(); //desktop should not be NULL since doc was checked and desktop is a casted pointer
+ while ( selected != NULL ) {
+ Glib::ustring selected_id;
+ selected_id += "--id=";
+ selected_id += (*selected)->getId();
+ params.insert(params.begin(), selected_id);
+ ++selected;
}
file_listener fileout;
@@ -728,30 +731,37 @@ void Script::effect(Inkscape::Extension::Effect *module,
g_unlink(tempfilename_out.c_str());
- /* Do something with mydoc.... */
if (mydoc) {
- doc->doc()->emitReconstructionStart();
- copy_doc(doc->doc()->rroot, mydoc->rroot);
- doc->doc()->emitReconstructionFinish();
- SPObject *layer = NULL;
-
- // Getting the named view from the document generated by the extension
- SPNamedView *nv = sp_document_namedview(mydoc, NULL);
-
- //Check if it has a default layer set up
- if ( nv != NULL){
- if( nv->default_layer_id != 0 ) {
- SPDocument *document = desktop->doc();
- //If so, get that layer
- layer = document->getObjectById(g_quark_to_string(nv->default_layer_id));
+ SPDocument* vd=doc->doc();
+ if (vd != NULL)
+ {
+ vd->emitReconstructionStart();
+ copy_doc(vd->rroot, mydoc->rroot);
+ vd->emitReconstructionFinish();
+ SPObject *layer = NULL;
+
+ // Getting the named view from the document generated by the extension
+ SPNamedView *nv = sp_document_namedview(mydoc, NULL);
+
+ //Check if it has a default layer set up
+ if ( nv != NULL)
+ {
+ if( nv->default_layer_id != 0 ) {
+ SPDocument *document = desktop->doc();
+ //If so, get that layer
+ if (document != NULL)
+ {
+ layer = document->getObjectById(g_quark_to_string(nv->default_layer_id));
+ }
+ }
+ }
+
+ sp_namedview_update_layers_from_document(desktop);
+ //If that layer exists,
+ if (layer) {
+ //set the current layer
+ desktop->setCurrentLayer(layer);
}
- }
-
- sp_namedview_update_layers_from_document(desktop);
- //If that layer exists,
- if (layer) {
- //set the current layer
- desktop->setCurrentLayer(layer);
}
mydoc->release();
}
@@ -778,6 +788,11 @@ void Script::effect(Inkscape::Extension::Effect *module,
*/
void Script::copy_doc (Inkscape::XML::Node * oldroot, Inkscape::XML::Node * newroot)
{
+ if ((oldroot == NULL) ||(newroot == NULL))
+ {
+ g_warning("Error on copy_doc: NULL pointer input.");
+ return;
+ }
std::vector<Inkscape::XML::Node *> delete_list;
Inkscape::XML::Node * oldroot_namedview = NULL;
diff --git a/src/extension/internal/odf.cpp b/src/extension/internal/odf.cpp
index 9fc6ecfdb..b23378fc3 100644
--- a/src/extension/internal/odf.cpp
+++ b/src/extension/internal/odf.cpp
@@ -47,7 +47,7 @@
#include <stdio.h>
#include <time.h>
#include <vector>
-
+#include <math.h>
//# Inkscape includes
#include "clear-n_.h"
@@ -1315,8 +1315,9 @@ writePath(Writer &outs, Geom::PathVector const &pathv,
return nrPoints;
}
-bool OdfOutput::processStyle(Writer &outs, SPItem *item, const Glib::ustring &id, const Glib::ustring &gradientNameFill)//, Glib::ustring &styleString)
+bool OdfOutput::processStyle(SPItem *item, const Glib::ustring &id, const Glib::ustring &gradientNameFill, const Glib::ustring &gradientNameStroke, Glib::ustring& output)
{
+ output.clear();
if (!item)
{
return false;
@@ -1408,40 +1409,39 @@ bool OdfOutput::processStyle(Writer &outs, SPItem *item, const Glib::ustring &id
styleTable.push_back(si);
styleLookupTable[id] = styleName;
- Glib::ustring tmpstring = Glib::ustring::compose ("<style:style style:name=\"%1\" style:family=\"graphic\" style:parent-style-name=\"standard\">\n", si.name);
- // Glib::ustring tmpstring;
- tmpstring += "<style:graphic-properties ";
+ output = Glib::ustring::compose ("<style:style style:name=\"%1\" style:family=\"graphic\" style:parent-style-name=\"standard\">\n", si.name);
+ output += "<style:graphic-properties";
if (si.fill == "gradient")
{
- tmpstring += Glib::ustring::compose (" draw:fill=\"gradient\" draw:fill-gradient-name=\"%1\"", gradientNameFill);
+ output += Glib::ustring::compose (" draw:fill=\"gradient\" draw:fill-gradient-name=\"%1\"", gradientNameFill);
}
else
{
- tmpstring += Glib::ustring(" draw:fill=\"") + si.fill + "\"";
+ output += Glib::ustring(" draw:fill=\"") + si.fill + "\"";
if(si.fill != "none")
{
- tmpstring += Glib::ustring::compose(" draw:fill-color=\"%1\" draw:fill-opacity=\"%2\"", si.fillColor, si.fillOpacity);
+ output += Glib::ustring::compose(" draw:fill-color=\"%1\"", si.fillColor);
}
}
if (si.stroke == "gradient")
{
- tmpstring += Glib::ustring (" draw:stroke=\"gradient\" draw:stroke-gradient-name=\"NotYetProgrammedPleaseBePatient\"");
+ //does not seem to be supported by Open Office.org
+ output += Glib::ustring::compose (" draw:stroke=\"gradient\" draw:stroke-gradient-name=\"%1\"", gradientNameStroke);
}
else
{
- tmpstring += Glib::ustring(" draw:stroke=\"") + si.stroke + "\"";
+ output += Glib::ustring(" draw:stroke=\"") + si.stroke + "\"";
if (si.stroke != "none")
{
- tmpstring += Glib::ustring::compose (" svg:stroke-width=\"%1\" svg:stroke-color=\"%2\" svg:stroke-opacity=\"%3\" ", si.strokeWidth, si.strokeColor, si.strokeOpacity);
+ output += Glib::ustring::compose (" svg:stroke-width=\"%1\" svg:stroke-color=\"%2\" ", si.strokeWidth, si.strokeColor);
}
}
- tmpstring += "/>\n</style:style>\n";
- outs.writeUString (tmpstring);
+ output += "/>\n</style:style>\n";
return true;
}
-bool OdfOutput::processGradient(Writer &outs, SPItem *item,
+bool OdfOutput::processGradient(SPItem *item,
const Glib::ustring &id, Geom::Affine &/*tf*/,
Glib::ustring& gradientName, Glib::ustring& output, bool checkFillGradient)
{
@@ -1481,6 +1481,7 @@ bool OdfOutput::processGradient(Writer &outs, SPItem *item,
gi.stops.push_back(gs);
}
+ Glib::ustring gradientName2;
if (SP_IS_LINEARGRADIENT(gradient))
{
gi.style = "linear";
@@ -1489,13 +1490,16 @@ bool OdfOutput::processGradient(Writer &outs, SPItem *item,
gi.y1 = linGrad->y1.value;
gi.x2 = linGrad->x2.value;
gi.y2 = linGrad->y2.value;
+ gradientName2 = Glib::ustring::compose("ImportedLinearGradient%1", gradientTable.size());
}
else if (SP_IS_RADIALGRADIENT(gradient))
{
gi.style = "radial";
SPRadialGradient *radGrad = SP_RADIALGRADIENT(gradient);
- gi.cx = radGrad->cx.computed * 100.0;//ODG cx is percentages
- gi.cy = radGrad->cy.computed * 100.0;
+ Geom::OptRect bbox = item->documentVisualBounds();
+ gi.cx = (radGrad->cx.value-bbox->left())/bbox->width();
+ gi.cy = (radGrad->cy.value-bbox->top())/bbox->height();
+ gradientName2 = Glib::ustring::compose("ImportedRadialGradient%1", gradientTable.size());
}
else
{
@@ -1511,7 +1515,6 @@ bool OdfOutput::processGradient(Writer &outs, SPItem *item,
if (gi.equals(*iter))
{
//map to existing gradientTable entry
- // Glib::ustring gradientName = iter->name;
gradientName = iter->name;
gradientLookupTable[id] = gradientName;
gradientMatch = true;
@@ -1525,8 +1528,7 @@ bool OdfOutput::processGradient(Writer &outs, SPItem *item,
}
// No match, let us write a new entry
- // Glib::ustring gradientName = Glib::ustring::compose("gradient%1", gradientTable.size());
- gradientName = Glib::ustring::compose("gradient%1", gradientTable.size());
+ gradientName = gradientName2;
gi.name = gradientName;
gradientTable.push_back(gi);
gradientLookupTable[id] = gradientName;
@@ -1552,16 +1554,17 @@ bool OdfOutput::processGradient(Writer &outs, SPItem *item,
return false;
}
output += Glib::ustring::compose("<draw:gradient draw:name=\"%1\"", gi.name);
- // "<draw:gradient id=\"%1\" draw:name=\"%2\"\n", gi.name, gi.name);
- output += Glib::ustring::compose(" draw:display-name=\"imported linear %1\"", gradientCount);
+ output += Glib::ustring::compose(" draw:display-name=\"%1\"", gi.name);
output += " draw:style=\"linear\"";
- // outs.writeUString (tmpstring);
- // outs.printf(" draw:start-color=\"#%06lx\" draw:end-color=\"#%06lx\"\n", gi.stops[0].rgb, gi.stops[1].rgb);
snprintf(buf, 127, " draw:start-color=\"#%06lx\" draw:end-color=\"#%06lx\"", gi.stops[0].rgb, gi.stops[1].rgb);
output += buf;
- output += Glib::ustring::compose(" draw:start-intensity=\"%1\" draw:end-intensity=\"%2\" draw:angle=\"0\" draw:border=\"0%%\"/>\n",
- gi.stops[0].opacity * 100.0, gi.stops[1].opacity * 100.0);
- // outs.writeUString (tmpstring);
+ //TODO: apply maths, to define begin of gradient, taking gradient begin and end, as well as object boundary into account
+ double angle = (gi.y2-gi.y1);
+ angle = (angle != 0.) ? (atan((gi.x2-gi.x1)/(gi.y2-gi.y1))* 180. / pi) : 90;
+ angle = (angle < 0)?(180+angle):angle;
+ angle = angle * 10; //why do we need this: precision?????????????
+ output += Glib::ustring::compose(" draw:start-intensity=\"%1\" draw:end-intensity=\"%2\" draw:angle=\"%3\"/>\n",
+ gi.stops[0].opacity * 100.0, gi.stops[1].opacity * 100.0, angle);// draw:border=\"0%%\"
}
else if (gi.style == "radial")
{
@@ -1582,33 +1585,14 @@ bool OdfOutput::processGradient(Writer &outs, SPItem *item,
g_warning("Need at least 2 stops for a radial gradient");
return false;
}
- /*
- outs.printf("<svg:radialGradient ");
- outs.printf("id=\"%s\" ", gi.name.c_str());
- outs.printf("draw:name=\"%s\"\n", gi.name.c_str());
- outs.printf(" draw:display-name=\"imported radial %d\"\n",
- gradientCount);
- outs.printf(" svg:gradientUnits=\"objectBoundingBox\"\n");
- outs.printf(" svg:cx=\"%05.3f\" svg:cy=\"%05.3f\"\n",
- gi.cx, gi.cy);
- outs.printf(" svg:fx=\"%05.3f\" svg:fy=\"%05.3f\"\n",
- gi.fx, gi.fy);
- outs.printf(" svg:r=\"%05.3f\">\n",
- gi.r);
- outs.printf(" <svg:stop\n");
- outs.printf(" svg:stop-color=\"#%06lx\"\n",
- gi.stops[0].rgb);
- outs.printf(" svg:stop-opacity=\"%f%%\"\n",
- gi.stops[0].opacity * 100.0);
- outs.printf(" svg:offset=\"0\"/>\n");
- outs.printf(" <svg:stop\n");
- outs.printf(" svg:stop-color=\"#%06lx\"\n",
- gi.stops[1].rgb);
- outs.printf(" svg:stop-opacity=\"%f%%\"\n",
- gi.stops[1].opacity * 100.0);
- outs.printf(" svg:offset=\"1\"/>\n");
- outs.printf("</svg:radialGradient>\n");
- */
+ output += Glib::ustring::compose("<draw:gradient draw:name=\"%1\" draw:display-name=\"%1\" ", gi.name);
+ snprintf(buf, 127, "draw:cx=\"%05.3f\" draw:cy=\"%05.3f\" ", gi.cx*100, gi.cy*100);
+ output += Glib::ustring("draw:style=\"radial\" ") + buf;
+ snprintf(buf, 127, "draw:start-color=\"#%06lx\" draw:end-color=\"#%06lx\" ", gi.stops[0].rgb, gi.stops[1].rgb);
+ output += buf;
+ snprintf(buf, 127, "draw:start-intensity=\"%f%%\" draw:end-intensity=\"%f%%\" ", gi.stops[0].opacity*100.0, gi.stops[1].opacity*100.0);
+ output += buf;
+ output += "/>\n";//draw:border=\"0%\"
}
else
{
@@ -1709,14 +1693,16 @@ bool OdfOutput::writeTree(Writer &couts, Writer &souts,
Glib::ustring gradientNameStroke;
Glib::ustring outputFill;
Glib::ustring outputStroke;
- // Glib::ustring styleString;
-
- processGradient(souts, item, id, tf, gradientNameFill, outputFill, 1);
+ Glib::ustring outputStyle;
+
+ processGradient(item, id, tf, gradientNameFill, outputFill, 1);
+ processGradient(item, id, tf, gradientNameStroke, outputStroke, 0);
souts.writeUString(outputFill);
+ souts.writeUString(outputStroke);
//# STYLE
- processStyle(souts, item, id, gradientNameFill);//, styleString);
-
+ processStyle(item, id, gradientNameFill, gradientNameStroke, outputStyle);
+ souts.writeUString(outputStyle);
//# ITEM DATA
if (nodeName == "image" || nodeName == "svg:image")
@@ -1806,25 +1792,15 @@ bool OdfOutput::writeTree(Writer &couts, Writer &souts,
Glib::ustring styleName = siter->second;
couts.printf("draw:style-name=\"%s\" ", styleName.c_str());
}
- // couts.writeUString(styleString);
-
- // std::map<Glib::ustring, Glib::ustring>::iterator giter;
- // giter = gradientLookupTable.find(id);
- // if (giter != gradientLookupTable.end())
- // {
- // Glib::ustring gradientName = giter->second;
- // couts.printf("draw:fill-gradient-name=\"%s\" ",
- // gradientName.c_str());
- // }
couts.printf("draw:layer=\"layout\" svg:x=\"%.3fcm\" svg:y=\"%.3fcm\" ",
bbox_x, bbox_y);
couts.printf("svg:width=\"%.3fcm\" svg:height=\"%.3fcm\" ",
bbox_width, bbox_height);
- couts.printf("svg:viewBox=\"0.0 0.0 %.3f %.3f\"\n",
+ couts.printf("svg:viewBox=\"0.0 0.0 %.3f %.3f\"",
bbox_width * 1000.0, bbox_height * 1000.0);
- couts.printf(" svg:d=\"");
+ couts.printf(" svg:d=\"");
int nrPoints = writePath(couts, curve->get_pathvector(),
tf, bbox_x, bbox_y);
couts.writeString("\"");
@@ -1915,9 +1891,9 @@ bool OdfOutput::writeStyleFooter(Writer &outs)
outs.writeString("<!-- ####### 'Standard' styles ####### -->\n");
outs.writeString("<style:style style:name=\"dp1\" style:family=\"drawing-page\"/>\n");
outs.writeString("<style:style style:name=\"standard\" style:family=\"graphic\">\n");
-
+
///TODO: add default document style here
-
+
outs.writeString("</style:style>\n");
outs.writeString("<style:style style:name=\"gr1\" style:family=\"graphic\" style:parent-style-name=\"standard\">\n");
outs.writeString(" <style:graphic-properties draw:stroke=\"none\" draw:fill=\"none\"\n");
diff --git a/src/extension/internal/odf.h b/src/extension/internal/odf.h
index 5fcad2630..6b915e347 100644
--- a/src/extension/internal/odf.h
+++ b/src/extension/internal/odf.h
@@ -313,9 +313,9 @@ private:
bool writeStyle(ZipFile &zf);
- bool processStyle(Writer &outs, SPItem *item, const Glib::ustring &id, const Glib::ustring &gradientNameFill);//, Glib::ustring &styleString);
+ bool processStyle(SPItem *item, const Glib::ustring &id, const Glib::ustring &gradientNameFill, const Glib::ustring &gradientNameStroke, Glib::ustring& output);
- bool processGradient(Writer &outs, SPItem *item,
+ bool processGradient(SPItem *item,
const Glib::ustring &id, Geom::Affine &tf, Glib::ustring& gradientName, Glib::ustring& output, bool checkFillGradient = 1);
bool writeStyleHeader(Writer &outs);
diff --git a/src/extension/param/radiobutton.cpp b/src/extension/param/radiobutton.cpp
index 921c322b6..38ed1fe77 100644
--- a/src/extension/param/radiobutton.cpp
+++ b/src/extension/param/radiobutton.cpp
@@ -172,7 +172,7 @@ const gchar *ParamRadioButton::set(const gchar * in, SPDocument * /*doc*/, Inksc
Glib::ustring * settext = NULL;
for (GSList * list = choices; list != NULL; list = g_slist_next(list)) {
optionentry * entr = reinterpret_cast<optionentry *>(list->data);
- if ( !entr->guitext->compare(in) ) {
+ if ( !entr->value->compare(in) ) {
settext = entr->value;
break; // break out of for loop
}
diff --git a/src/file.cpp b/src/file.cpp
index 453ddb546..5b4110253 100644
--- a/src/file.cpp
+++ b/src/file.cpp
@@ -157,8 +157,8 @@ Glib::ustring sp_file_default_template_uri()
baseNames.push_back("default.svg");
gchar *foundTemplate = 0;
- for (std::list<gchar const*>::iterator nameIt = baseNames.begin(); (nameIt != baseNames.end()) && !foundTemplate; ++nameIt) {
- for (std::list<gchar *>::iterator it = sources.begin(); (it != sources.end()) && !foundTemplate; ++it) {
+ for (std::list<gchar *>::iterator it = sources.begin(); (it != sources.end()) && !foundTemplate; ++it) {
+ for (std::list<gchar const*>::iterator nameIt = baseNames.begin(); (nameIt != baseNames.end()) && !foundTemplate; ++nameIt) {
gchar *dirname = *it;
if ( Inkscape::IO::file_test( dirname, (GFileTest)(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR) ) ) {
diff --git a/src/livarot/ShapeSweep.cpp b/src/livarot/ShapeSweep.cpp
index 2073d1cd2..c2fd83e31 100644
--- a/src/livarot/ShapeSweep.cpp
+++ b/src/livarot/ShapeSweep.cpp
@@ -2741,8 +2741,9 @@ Shape::CheckAdjacencies (int lastPointNo, int lastChgtPt, Shape * /*shapeHead*/,
{
if (TesteAdjacency (lS, lB, getPoint(n).x, n, false) ==
false)
- break;
- lS->swsData[lB].leftRnd = n;
+ break;
+ if (getPoint(lS->swsData[lB].leftRnd).x[0] > getPoint(n).x[0] + HalfRound (1)) // LP Bug 614577
+ lS->swsData[lB].leftRnd = n;
}
for (int n = rgtN + 1; n < lastPointNo; n++)
{
@@ -2768,7 +2769,8 @@ Shape::CheckAdjacencies (int lastPointNo, int lastChgtPt, Shape * /*shapeHead*/,
if (TesteAdjacency (rS, rB, getPoint(n).x, n, false) ==
false)
break;
- rS->swsData[rB].leftRnd = n;
+ if (getPoint(rS->swsData[rB].leftRnd).x[0] > getPoint(n).x[0] + HalfRound (1)) // LP Bug 614577
+ rS->swsData[rB].leftRnd = n;
}
for (int n = rgtN + 1; n < lastPointNo; n++)
{
diff --git a/src/main.cpp b/src/main.cpp
index cb8d12a0f..e63373695 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -134,6 +134,7 @@ enum {
SP_ARG_EXPORT_AREA,
SP_ARG_EXPORT_AREA_DRAWING,
SP_ARG_EXPORT_AREA_PAGE,
+ SP_ARG_EXPORT_MARGIN,
SP_ARG_EXPORT_AREA_SNAP,
SP_ARG_EXPORT_WIDTH,
SP_ARG_EXPORT_HEIGHT,
@@ -185,6 +186,7 @@ static gchar *sp_export_dpi = NULL;
static gchar *sp_export_area = NULL;
static gboolean sp_export_area_drawing = FALSE;
static gboolean sp_export_area_page = FALSE;
+static gchar *sp_export_margin = NULL;
static gboolean sp_export_latex = FALSE;
static gchar *sp_export_width = NULL;
static gchar *sp_export_height = NULL;
@@ -228,6 +230,7 @@ static void resetCommandlineGlobals() {
sp_export_area = NULL;
sp_export_area_drawing = FALSE;
sp_export_area_page = FALSE;
+ sp_export_margin = NULL;
sp_export_latex = FALSE;
sp_export_width = NULL;
sp_export_height = NULL;
@@ -315,6 +318,11 @@ struct poptOption options[] = {
N_("Exported area is the entire page"),
NULL},
+ {"export-margin", 0,
+ POPT_ARG_STRING, &sp_export_margin, SP_ARG_EXPORT_MARGIN,
+ N_("Only for PS/EPS/PDF, sets margin in mm around exported area (default 0)"),
+ N_("VALUE")},
+
{"export-area-snap", 0,
POPT_ARG_NONE, &sp_export_area_snap, SP_ARG_EXPORT_AREA_SNAP,
N_("Snap the bitmap export area outwards to the nearest integer values (in SVG user units)"),
@@ -1622,6 +1630,13 @@ static int do_export_ps_pdf(SPDocument* doc, gchar const* uri, char const* mime)
(*i)->set_param_int("resolution", (int) dpi);
}
+ // if no bleed/margin is given, set to 0 (otherwise it takes the value last used from the UI)
+ float margin = 0.;
+ if (sp_export_margin) {
+ margin = g_ascii_strtod(sp_export_margin, NULL);
+ }
+ (*i)->set_param_float("bleed", margin);
+
//check if specified directory exists
if (!Inkscape::IO::file_directory_exists(uri)) {
g_warning("File path \"%s\" includes directory that doesn't exist.\n", uri);
diff --git a/src/proofs b/src/proofs
index a3a22733f..05f27daea 100644
--- a/src/proofs
+++ b/src/proofs
@@ -329,4 +329,4 @@ style.cpp caller: preceded by explicit test for NULL:
# mode:indented-text
# fill-column:99
# End:
-# vim: filetype=text:tabstop=8:encoding=utf-8:textwidth=99 :
+# vim: filetype=text:tabstop=8:fileencoding=utf-8:textwidth=99 :
diff --git a/src/select-context.cpp b/src/select-context.cpp
index 0a0d411b8..66b0ebcb1 100644
--- a/src/select-context.cpp
+++ b/src/select-context.cpp
@@ -985,7 +985,7 @@ gint SPSelectContext::root_handler(GdkEvent* event) {
} else if (MOD__CTRL) {
sp_selection_rotate(selection, 90);
} else if (snaps) {
- sp_selection_rotate(selection, 180/snaps);
+ sp_selection_rotate(selection, 180.0/snaps);
}
ret = TRUE;
break;
@@ -997,7 +997,7 @@ gint SPSelectContext::root_handler(GdkEvent* event) {
} else if (MOD__CTRL) {
sp_selection_rotate(selection, -90);
} else if (snaps) {
- sp_selection_rotate(selection, -180/snaps);
+ sp_selection_rotate(selection, -180.0/snaps);
}
ret = TRUE;
break;
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index 07a037557..62ff04cc4 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -360,6 +360,7 @@ void sp_selection_delete(SPDesktop *desktop)
selection->clear();
sp_selection_delete_impl(selected);
g_slist_free(const_cast<GSList *>(selected));
+ reinterpret_cast<SPObject *>(desktop->currentLayer())->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
/* a tool may have set up private information in it's selection context
* that depends on desktop items. I think the only sane way to deal with
diff --git a/src/sp-paint-server-reference.h b/src/sp-paint-server-reference.h
index 90d8979f8..5561af1a3 100644
--- a/src/sp-paint-server-reference.h
+++ b/src/sp-paint-server-reference.h
@@ -40,4 +40,4 @@ protected:
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
diff --git a/src/sp-pattern.cpp b/src/sp-pattern.cpp
index e88bd2886..94588e443 100644
--- a/src/sp-pattern.cpp
+++ b/src/sp-pattern.cpp
@@ -733,4 +733,4 @@ cairo_pattern_t* SPPattern::pattern_new(cairo_t *base_ct, Geom::OptRect const &b
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
diff --git a/src/style.cpp b/src/style.cpp
index eef1c6ee5..ca89e6f65 100644
--- a/src/style.cpp
+++ b/src/style.cpp
@@ -313,27 +313,34 @@ static SPStyleEnum const enum_display[] = {
};
static SPStyleEnum const enum_shape_rendering[] = {
- {"auto", 0},
- {"optimizeSpeed", 0},
- {"crispEdges", 0},
- {"geometricPrecision", 0},
+ {"auto", SP_CSS_SHAPE_RENDERING_AUTO},
+ {"optimizeSpeed", SP_CSS_SHAPE_RENDERING_OPTIMIZESPEED},
+ {"crispEdges", SP_CSS_SHAPE_RENDERING_CRISPEDGES},
+ {"geometricPrecision", SP_CSS_SHAPE_RENDERING_GEOMETRICPRECISION},
{NULL, -1}
};
static SPStyleEnum const enum_color_rendering[] = {
- {"auto", 0},
- {"optimizeSpeed", 0},
- {"optimizeQuality", 0},
+ {"auto", SP_CSS_COLOR_RENDERING_AUTO},
+ {"optimizeSpeed", SP_CSS_COLOR_RENDERING_OPTIMIZESPEED},
+ {"optimizeQuality", SP_CSS_COLOR_RENDERING_OPTIMIZEQUALITY},
{NULL, -1}
};
-static SPStyleEnum const *const enum_image_rendering = enum_color_rendering;
+static SPStyleEnum const enum_image_rendering[] = {
+ {"auto", SP_CSS_IMAGE_RENDERING_AUTO},
+ {"optimizeSpeed", SP_CSS_IMAGE_RENDERING_OPTIMIZESPEED},
+ {"optimizeQuality", SP_CSS_IMAGE_RENDERING_OPTIMIZEQUALITY},
+ {"-inkscape-crisp-edges", SP_CSS_IMAGE_RENDERING_CRISPEDGES},
+ {"-inkscape-pixelated", SP_CSS_IMAGE_RENDERING_PIXELATED},
+ {NULL, -1}
+};
static SPStyleEnum const enum_text_rendering[] = {
- {"auto", 0},
- {"optimizeSpeed", 0},
- {"optimizeLegibility", 0},
- {"geometricPrecision", 0},
+ {"auto", SP_CSS_TEXT_RENDERING_AUTO},
+ {"optimizeSpeed", SP_CSS_TEXT_RENDERING_OPTIMIZESPEED},
+ {"optimizeLegibility", SP_CSS_TEXT_RENDERING_OPTIMIZELEGIBILITY},
+ {"geometricPrecision", SP_CSS_TEXT_RENDERING_GEOMETRICPRECISION},
{NULL, -1}
};
@@ -795,6 +802,12 @@ sp_style_read(SPStyle *style, SPObject *object, Inkscape::XML::Node *repr)
/* clip-rule */
SPS_READ_PENUM_IF_UNSET(&style->clip_rule, repr, "clip-rule", enum_clip_rule, true);
+ /* color_rendering, image_rendering, shape_rendering, text_rendering */
+ SPS_READ_PENUM_IF_UNSET(&style->color_rendering, repr, "color_rendering", enum_color_rendering, true);
+ SPS_READ_PENUM_IF_UNSET(&style->image_rendering, repr, "image_rendering", enum_image_rendering, true);
+ SPS_READ_PENUM_IF_UNSET(&style->shape_rendering, repr, "shape_rendering", enum_shape_rendering, true);
+ SPS_READ_PENUM_IF_UNSET(&style->text_rendering, repr, "text_rendering", enum_text_rendering, true);
+
/* 3. Merge from parent */
if (object) {
if (object->parent) {
@@ -1115,11 +1128,8 @@ sp_style_merge_property(SPStyle *style, gint id, gchar const *val)
case SP_PROP_BASELINE_SHIFT:
SPS_READ_IBASELINE_SHIFT_IF_UNSET(&style->baseline_shift, val);
break;
- /* Text (unimplemented) */
case SP_PROP_TEXT_RENDERING: {
- /* Ignore the hint. */
- SPIEnum dummy;
- SPS_READ_IENUM_IF_UNSET(&dummy, val, enum_text_rendering, true);
+ SPS_READ_IENUM_IF_UNSET(&style->text_rendering, val, enum_text_rendering, true);
break;
}
case SP_PROP_ALIGNMENT_BASELINE:
@@ -1240,9 +1250,7 @@ sp_style_merge_property(SPStyle *style, gint id, gchar const *val)
g_warning("Unimplemented style property SP_PROP_COLOR_PROFILE: value: %s", val);
break;
case SP_PROP_COLOR_RENDERING: {
- /* Ignore the hint. */
- SPIEnum dummy;
- SPS_READ_IENUM_IF_UNSET(&dummy, val, enum_color_rendering, true);
+ SPS_READ_IENUM_IF_UNSET(&style->color_rendering, val, enum_color_rendering, true);
break;
}
case SP_PROP_FILL:
@@ -1261,9 +1269,7 @@ sp_style_merge_property(SPStyle *style, gint id, gchar const *val)
}
break;
case SP_PROP_IMAGE_RENDERING: {
- /* Ignore the hint. */
- SPIEnum dummy;
- SPS_READ_IENUM_IF_UNSET(&dummy, val, enum_image_rendering, true);
+ SPS_READ_IENUM_IF_UNSET(&style->image_rendering, val, enum_image_rendering, true);
break;
}
case SP_PROP_MARKER:
@@ -1306,9 +1312,7 @@ sp_style_merge_property(SPStyle *style, gint id, gchar const *val)
break;
case SP_PROP_SHAPE_RENDERING: {
- /* Ignore the hint. */
- SPIEnum dummy;
- SPS_READ_IENUM_IF_UNSET(&dummy, val, enum_shape_rendering, true);
+ SPS_READ_IENUM_IF_UNSET(&style->shape_rendering, val, enum_shape_rendering, true);
break;
}
@@ -1834,6 +1838,12 @@ sp_style_merge_from_parent(SPStyle *const style, SPStyle const *const parent)
if (!style->clip_rule.set || style->clip_rule.inherit) {
style->clip_rule.computed = parent->clip_rule.computed;
}
+
+ /* Rendering */
+ if (!style->color_rendering.set || style->color_rendering.inherit) {
+ style->color_rendering.computed = parent->color_rendering.computed;
+ }
+
}
template <typename T>
@@ -2126,18 +2136,18 @@ sp_style_merge_from_dying_parent(SPStyle *const style, SPStyle const *const pare
&SPStyle::clip_rule,
&SPStyle::color_interpolation,
&SPStyle::color_interpolation_filters,
- //nyi: SPStyle::color_rendering,
+ &SPStyle::color_rendering,
&SPStyle::direction,
&SPStyle::fill_rule,
&SPStyle::font_style,
&SPStyle::font_variant,
- //nyi: SPStyle::image_rendering,
+ &SPStyle::image_rendering,
//nyi: SPStyle::pointer_events,
- //nyi: SPStyle::shape_rendering,
+ &SPStyle::shape_rendering,
&SPStyle::stroke_linecap,
&SPStyle::stroke_linejoin,
&SPStyle::text_anchor,
- //nyi: &SPStyle::text_rendering,
+ &SPStyle::text_rendering,
&SPStyle::visibility,
&SPStyle::writing_mode
};
@@ -2742,6 +2752,12 @@ sp_style_write_string(SPStyle const *const style, guint const flags)
/* clipping */
p += sp_style_write_ienum(p, c + BMAX - p, "clip-rule", enum_clip_rule, &style->clip_rule, NULL, flags);
+ /* rendering */
+ p += sp_style_write_ienum(p, c + BMAX - p, "color-rendering", enum_color_rendering, &style->color_rendering, NULL, flags);
+ p += sp_style_write_ienum(p, c + BMAX - p, "image-rendering", enum_image_rendering, &style->image_rendering, NULL, flags);
+ p += sp_style_write_ienum(p, c + BMAX - p, "shape-rendering", enum_shape_rendering, &style->shape_rendering, NULL, flags);
+ p += sp_style_write_ienum(p, c + BMAX - p, "text-rendering", enum_text_rendering, &style->text_rendering, NULL, flags);
+
/* fixme: */
p += sp_text_style_write(p, c + BMAX - p, style->text, flags);
@@ -2892,6 +2908,12 @@ sp_style_write_difference(SPStyle const *const from, SPStyle const *const to)
p += sp_style_write_ienum(p, c + BMAX - p, "clip-rule", enum_clip_rule, &from->clip_rule, &to->clip_rule, SP_STYLE_FLAG_IFDIFF);
+ /* rendering */
+ p += sp_style_write_ienum(p, c + BMAX - p, "color-rendering", enum_color_rendering, &from->color_rendering, &to->color_rendering, SP_STYLE_FLAG_IFDIFF);
+ p += sp_style_write_ienum(p, c + BMAX - p, "image-rendering", enum_image_rendering, &from->image_rendering, &to->image_rendering, SP_STYLE_FLAG_IFDIFF);
+ p += sp_style_write_ienum(p, c + BMAX - p, "shape-rendering", enum_shape_rendering, &from->shape_rendering, &to->shape_rendering, SP_STYLE_FLAG_IFDIFF);
+ p += sp_style_write_ienum(p, c + BMAX - p, "text-rendering", enum_text_rendering, &from->text_rendering, &to->text_rendering, SP_STYLE_FLAG_IFDIFF);
+
/** \todo
* The reason we use IFSET rather than IFDIFF is the belief that the IFDIFF
* flag is mainly only for attributes that don't handle explicit unset well.
@@ -3087,6 +3109,12 @@ sp_style_clear(SPStyle *style)
style->enable_background.inherit = false;
style->clip_rule.value = style->clip_rule.computed = SP_WIND_RULE_NONZERO;
+
+ style->color_rendering.value = style->color_rendering.computed = SP_CSS_COLOR_RENDERING_AUTO;
+ style->image_rendering.value = style->image_rendering.computed = SP_CSS_IMAGE_RENDERING_AUTO;
+ style->shape_rendering.value = style->shape_rendering.computed = SP_CSS_SHAPE_RENDERING_AUTO;
+ style->text_rendering.value = style->text_rendering.computed = SP_CSS_TEXT_RENDERING_AUTO;
+
}
@@ -4492,6 +4520,18 @@ sp_style_unset_property_attrs(SPObject *o)
if (style->clip_rule.set) {
repr->setAttribute("clip-rule", NULL);
}
+ if (style->color_rendering.set) {
+ repr->setAttribute("color-rendering", NULL);
+ }
+ if (style->image_rendering.set) {
+ repr->setAttribute("image-rendering", NULL);
+ }
+ if (style->shape_rendering.set) {
+ repr->setAttribute("shape-rendering", NULL);
+ }
+ if (style->text_rendering.set) {
+ repr->setAttribute("text-rendering", NULL);
+ }
}
/**
diff --git a/src/style.h b/src/style.h
index 0710f5c8e..534a6ae70 100644
--- a/src/style.h
+++ b/src/style.h
@@ -378,6 +378,13 @@ struct SPStyle {
filter when the style is used for querying */
SPILength filter_gaussianBlur_deviation;
+ /** hints on how to render: e.g. speed vs. accuracy.
+ * As of April, 2013, only image_rendering used. */
+ SPIEnum color_rendering;
+ SPIEnum image_rendering;
+ SPIEnum shape_rendering;
+ SPIEnum text_rendering;
+
/** enable-background, used for defining where filter effects get
* their background image */
SPIEnum enable_background;
@@ -579,6 +586,35 @@ enum SPColorInterpolation {
SP_CSS_COLOR_INTERPOLATION_LINEARRGB
};
+enum SPColorRendering {
+ SP_CSS_COLOR_RENDERING_AUTO,
+ SP_CSS_COLOR_RENDERING_OPTIMIZESPEED,
+ SP_CSS_COLOR_RENDERING_OPTIMIZEQUALITY
+};
+
+/* Last two are CSS4 Image values... for the momement prefaced with -inkscape. */
+enum SPImageRendering {
+ SP_CSS_IMAGE_RENDERING_AUTO,
+ SP_CSS_IMAGE_RENDERING_OPTIMIZESPEED,
+ SP_CSS_IMAGE_RENDERING_OPTIMIZEQUALITY,
+ SP_CSS_IMAGE_RENDERING_CRISPEDGES,
+ SP_CSS_IMAGE_RENDERING_PIXELATED
+};
+
+enum SPShapeRendering {
+ SP_CSS_SHAPE_RENDERING_AUTO,
+ SP_CSS_SHAPE_RENDERING_OPTIMIZESPEED,
+ SP_CSS_SHAPE_RENDERING_CRISPEDGES,
+ SP_CSS_SHAPE_RENDERING_GEOMETRICPRECISION
+};
+
+enum SPTextRendering {
+ SP_CSS_TEXT_RENDERING_AUTO,
+ SP_CSS_TEXT_RENDERING_OPTIMIZESPEED,
+ SP_CSS_TEXT_RENDERING_OPTIMIZELEGIBILITY,
+ SP_CSS_TEXT_RENDERING_GEOMETRICPRECISION
+};
+
/// An SPTextStyle has a refcount, a font family, and a font name.
struct SPTextStyle {
int refcount;
diff --git a/src/ui/dialog/font-substitution.cpp b/src/ui/dialog/font-substitution.cpp
index 8df3ee5c8..9fa94ca8f 100644
--- a/src/ui/dialog/font-substitution.cpp
+++ b/src/ui/dialog/font-substitution.cpp
@@ -11,6 +11,7 @@
#endif
#include <gtkmm/messagedialog.h>
+#include <gtkmm/checkbutton.h>
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/textview.h>
diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp
index dfc92774c..4eeb1b5f0 100644
--- a/src/ui/dialog/symbols.cpp
+++ b/src/ui/dialog/symbols.cpp
@@ -148,6 +148,9 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) :
//iconView->set_text_column( columns->symbol_id );
iconView->set_tooltip_column( 1 );
iconView->set_pixbuf_column( columns->symbol_image );
+ // Giving the iconview a small minimum size will help users understand
+ // What the dialog does.
+ iconView->set_size_request( 100, 200 );
std::vector< Gtk::TargetEntry > targets;
targets.push_back(Gtk::TargetEntry( "application/x-inkscape-paste"));
@@ -466,8 +469,9 @@ void SymbolsDialog::get_symbols() {
symbol_doc = SPDocument::createNewDoc( fullname, FALSE );
if( symbol_doc ) {
- symbolSets[Glib::ustring(filename)]= symbol_doc;
- symbolSet->append(filename);
+ gchar *title = symbol_doc->getRoot()->title();
+ symbolSets[Glib::ustring(title)] = symbol_doc;
+ symbolSet->append(title);
}
}
diff --git a/src/ui/dialog/text-edit.cpp b/src/ui/dialog/text-edit.cpp
index c87e94fc6..9f3294275 100644
--- a/src/ui/dialog/text-edit.cpp
+++ b/src/ui/dialog/text-edit.cpp
@@ -59,7 +59,7 @@ extern "C" {
#include <glibmm/i18n.h>
#include <glibmm/markup.h>
#include "unit-constants.h"
-
+#include "sp-textpath.h"
namespace Inkscape {
namespace UI {
@@ -133,6 +133,30 @@ TextEdit::TextEdit()
layout_frame.set_padding(4,4,4,4);
layout_frame.add(layout_hbox);
+ // Text start Offset
+ {
+ startOffset = gtk_combo_box_text_new_with_entry ();
+ gtk_widget_set_size_request(startOffset, 90, -1);
+
+ const gchar *spacings[] = {"0%", "10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%", "100%", NULL};
+ for (int i = 0; spacings[i]; i++) {
+ gtk_combo_box_text_append_text(reinterpret_cast<GtkComboBoxText *>(startOffset), spacings[i]);
+ }
+ gtk_entry_set_text(reinterpret_cast<GtkEntry *>(gtk_bin_get_child(reinterpret_cast<GtkBin *>(startOffset))), "0%");
+
+ gtk_widget_set_tooltip_text(startOffset, _("Text path offset"));
+
+#if WITH_GTKMM_3_0
+ Gtk::Separator *sep = Gtk::manage(new Gtk::Separator());
+ sep->set_orientation(Gtk::ORIENTATION_VERTICAL);
+#else
+ Gtk::VSeparator *sep = Gtk::manage(new Gtk::VSeparator);
+#endif
+ layout_hbox.pack_start(*sep, false, false, 10);
+
+ layout_hbox.pack_start(*Gtk::manage(Glib::wrap(startOffset)), false, false);
+ }
+
/* Font preview */
preview_label.set_ellipsize(Pango::ELLIPSIZE_END);
preview_label.set_justify(Gtk::JUSTIFY_CENTER);
@@ -189,6 +213,7 @@ TextEdit::TextEdit()
g_signal_connect ( G_OBJECT (fontsel), "font_set", G_CALLBACK (onFontChange), this );
g_signal_connect ( G_OBJECT (spacing_combo), "changed", G_CALLBACK (onLineSpacingChange), this );
g_signal_connect ( G_OBJECT (text_buffer), "changed", G_CALLBACK (onTextChange), this );
+ g_signal_connect(startOffset, "changed", G_CALLBACK(onStartOffsetChange), this);
setasdefault_button.signal_clicked().connect(sigc::mem_fun(*this, &TextEdit::onSetDefault));
apply_button.signal_clicked().connect(sigc::mem_fun(*this, &TextEdit::onApply));
close_button.signal_clicked().connect(sigc::bind(_signal_response.make_slot(), GTK_RESPONSE_CLOSE));
@@ -263,8 +288,16 @@ void TextEdit::onReadSelection ( gboolean dostyle, gboolean /*docontent*/ )
guint items = getSelectedTextCount ();
if (items == 1) {
gtk_widget_set_sensitive (text_view, TRUE);
+ gtk_widget_set_sensitive( startOffset, SP_IS_TEXT_TEXTPATH(text) );
+ if (SP_IS_TEXT_TEXTPATH(text)) {
+ SPTextPath *tp = SP_TEXTPATH(text->firstChild());
+ if (tp->getAttribute("startOffset")) {
+ gtk_entry_set_text(reinterpret_cast<GtkEntry *>(gtk_bin_get_child(reinterpret_cast<GtkBin *>(startOffset))), tp->getAttribute("startOffset"));
+ }
+ }
} else {
gtk_widget_set_sensitive (text_view, FALSE);
+ gtk_widget_set_sensitive( startOffset, FALSE );
}
apply_button.set_sensitive ( false );
setasdefault_button.set_sensitive ( true );
@@ -286,6 +319,7 @@ void TextEdit::onReadSelection ( gboolean dostyle, gboolean /*docontent*/ )
text->getRepr(); // was being called but result ignored. Check this.
} else {
gtk_widget_set_sensitive (text_view, FALSE);
+ gtk_widget_set_sensitive( startOffset, FALSE );
apply_button.set_sensitive ( false );
setasdefault_button.set_sensitive ( false );
}
@@ -616,6 +650,19 @@ void TextEdit::onFontChange(SPFontSelector * /*fontsel*/, gchar* fontspec, TextE
}
+void TextEdit::onStartOffsetChange(GtkTextBuffer *text_buffer, TextEdit *self)
+{
+ SPItem *text = self->getSelectedTextItem();
+ if (text && SP_IS_TEXT_TEXTPATH(text))
+ {
+ SPTextPath *tp = SP_TEXTPATH(text->firstChild());
+ const gchar *sstr = gtk_combo_box_text_get_active_text(reinterpret_cast<GtkComboBoxText *>(self->startOffset));
+ tp->setAttribute("startOffset", sstr);
+
+ DocumentUndo::maybeDone(sp_desktop_document(SP_ACTIVE_DESKTOP), "startOffset", SP_VERB_CONTEXT_TEXT, _("Set text style"));
+ }
+}
+
void TextEdit::onToggle()
{
if (blocked)
@@ -628,7 +675,6 @@ void TextEdit::onToggle()
//onApply();
}
setasdefault_button.set_sensitive ( true );
-
}
diff --git a/src/ui/dialog/text-edit.h b/src/ui/dialog/text-edit.h
index f27fdfc87..0e3ebafa7 100644
--- a/src/ui/dialog/text-edit.h
+++ b/src/ui/dialog/text-edit.h
@@ -107,6 +107,14 @@ protected:
static void onFontChange (SPFontSelector *fontsel, gchar* fontspec, TextEdit *self);
/**
+ * Callback invoked when the user modifies the startOffset of text on a path.
+ *
+ * @param text_buffer pointer to the GtkTextBuffer with the text of the selected text object.
+ * @param self pointer to the current instance of the dialog.
+ */
+ static void onStartOffsetChange(GtkTextBuffer *text_buffer, TextEdit *self);
+
+ /**
* Get the selected text off the main canvas.
*
* @return SPItem pointer to the selected text object
@@ -191,6 +199,8 @@ private:
GtkWidget *spacing_combo;
+ GtkWidget *startOffset;
+
Gtk::Label preview_label;
Gtk::Label text_label;
diff --git a/src/ui/dialog/xml-tree.cpp b/src/ui/dialog/xml-tree.cpp
index 29dbc4b93..a537b7fca 100644
--- a/src/ui/dialog/xml-tree.cpp
+++ b/src/ui/dialog/xml-tree.cpp
@@ -986,6 +986,7 @@ void XmlTree::cmd_delete_node()
g_assert(selected_repr != NULL);
sp_repr_unparent(selected_repr);
+ reinterpret_cast<SPObject *>(current_desktop->currentLayer())->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
DocumentUndo::done(current_document, SP_VERB_DIALOG_XML_EDITOR,
Q_("nodeAsInXMLinHistoryDialog|Delete node"));
}
diff --git a/src/verbs.cpp b/src/verbs.cpp
index b8e72bc9b..4777e168c 100644
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
@@ -2753,7 +2753,7 @@ Verb *Verb::_base_verbs[] = {
new DialogVerb(SP_VERB_DIALOG_SWATCHES, "DialogSwatches", N_("S_watches..."),
N_("Select colors from a swatches palette"), GTK_STOCK_SELECT_COLOR),
new DialogVerb(SP_VERB_DIALOG_SYMBOLS, "DialogSymbols", N_("S_ymbols..."),
- N_("Select symbol from a symbols palette"), GTK_STOCK_SELECT_COLOR),
+ N_("Select symbol from a symbols palette"), INKSCAPE_ICON("symbols")),
new DialogVerb(SP_VERB_DIALOG_TRANSFORM, "DialogTransform", N_("Transfor_m..."),
N_("Precisely control objects' transformations"), INKSCAPE_ICON("dialog-transform")),
new DialogVerb(SP_VERB_DIALOG_ALIGN_DISTRIBUTE, "DialogAlignDistribute", N_("_Align and Distribute..."),
diff --git a/src/xml/repr.h b/src/xml/repr.h
index 52f07d11f..e691eaa7f 100644
--- a/src/xml/repr.h
+++ b/src/xml/repr.h
@@ -98,9 +98,11 @@ void sp_repr_css_print(SPCSSAttr *css);
/* Utility finctions */
/// Remove \a repr from children of its parent node.
inline void sp_repr_unparent(Inkscape::XML::Node *repr) {
- Inkscape::XML::Node *parent=repr->parent();
- if (parent) {
- parent->removeChild(repr);
+ if (repr) {
+ Inkscape::XML::Node *parent=repr->parent();
+ if (parent) {
+ parent->removeChild(repr);
+ }
}
}