diff options
| author | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-12-04 20:22:15 +0000 |
|---|---|---|
| committer | Jabier Arraiza <jabier.arraiza@marker.es> | 2017-12-04 20:22:15 +0000 |
| commit | 0c9f0d1d84f706590c8704b32d06270ec0eacbea (patch) | |
| tree | 9ea8f5c06da1c8787f7ebe882248a77f9d3ce1fa | |
| parent | Remobing bspline interpolator (diff) | |
| parent | CairoRenderer: print warning if rendering failed (diff) | |
| download | inkscape-0c9f0d1d84f706590c8704b32d06270ec0eacbea.tar.gz inkscape-0c9f0d1d84f706590c8704b32d06270ec0eacbea.zip | |
Update to trunk
48 files changed, 269 insertions, 178 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 35d443ef4..2f9fb9b43 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -229,7 +229,9 @@ add_custom_target(clean-all if(GMOCK_PRESENT) enable_testing() set(CMAKE_CTEST_COMMAND ctest -V) - set(CMAKE_CTEST_ENV INKSCAPE_DATADIR=${CMAKE_CURRENT_SOURCE_DIR}/share) + if(WIN32) + set(CMAKE_CTEST_ENV INKSCAPE_DATADIR=${CMAKE_CURRENT_SOURCE_DIR}/share) + endif() add_subdirectory(testfiles EXCLUDE_FROM_ALL) add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS tests) add_dependencies(check inkscape) diff --git a/CMakeScripts/cmake_consistency_check.py b/CMakeScripts/cmake_consistency_check.py index 64419936b..0b26f05d6 100755 --- a/CMakeScripts/cmake_consistency_check.py +++ b/CMakeScripts/cmake_consistency_check.py @@ -280,7 +280,7 @@ def main(): ignore_used = [False] * len(IGNORE) # now check on files not accounted for. - print("\nC/C++ Files CMake doesnt know about...") + print("\nC/C++ Files CMake does not know about...") for cf in sorted(source_list(SOURCE_DIR, is_c)): if not is_ignore(cf, ignore_used): if cf not in global_c: @@ -297,7 +297,7 @@ def main(): print("bad_c: ", cf) ''' - print("\nC/C++ Headers CMake doesnt know about...") + print("\nC/C++ Headers CMake does not know about...") for hf in sorted(source_list(SOURCE_DIR, is_c_header)): if not is_ignore(hf, ignore_used): if hf not in global_h: diff --git a/TRANSLATORS b/TRANSLATORS index 7bf3d05de..9b6772127 100644 --- a/TRANSLATORS +++ b/TRANSLATORS @@ -86,7 +86,7 @@ Leandro Regueiro <leandro.regueiro@gmail.com>, 2006-2008, 2010. Liu Xiaoqin <liuxqsmile@gmail.com>, 2008. Louni Kandulna <kandulna.louni@gmail.com>, 2014. Luca Bruno <luca.br@uno.it>, 2005. -Lucas Vieites Fariña<lucas@codexion.com>, 2003-2013. +Lucas Vieites Fariña <lucas@codexion.com>, 2003-2017. Mahesh subedi <submanesh@hotmail.com>, 2006. Marcin Floryan <marcin.floryan+inkscape (at) gmail.com>, 2016. Maren Hachmann <marenhachmann@yahoo.com>, 2015-2016. diff --git a/doc/architecture.txt b/doc/architecture.txt index 14b038b6e..4f4c859f7 100644 --- a/doc/architecture.txt +++ b/doc/architecture.txt @@ -385,7 +385,7 @@ behaviour can be used to collect multi-step actions (like winding the Gtk spinbutton) from the UI into a single undoable step. For controls implemented by Sodipodi itself, implementing undo as a -single step is usually done in a more efficent way. Most controls have +single step is usually done in a more efficient way. Most controls have the abstract model of grab, drag, release, and change user action. During the grab phase, all modifications are done to the SPObject directly - i.e. they do not change XML tree, and thus do not diff --git a/doc/nr-filter-interface.txt b/doc/nr-filter-interface.txt index 6950317fc..6eb27bc2a 100644 --- a/doc/nr-filter-interface.txt +++ b/doc/nr-filter-interface.txt @@ -143,7 +143,7 @@ contains the filter effect area Filter effects region and filter primitive subregion ==================================================== -void Filter::set_x(SVGLength &lenght) +void Filter::set_x(SVGLength &length) void FilterPrimitive::set_x(SVGLength &length) void Filter::set_y(SVGLength &length) diff --git a/share/extensions/Barcode/Code128.py b/share/extensions/Barcode/Code128.py index b90e3bcf6..4af788bbe 100644 --- a/share/extensions/Barcode/Code128.py +++ b/share/extensions/Barcode/Code128.py @@ -73,9 +73,9 @@ class Code128(Barcode): blocks = [] block = '' - # Split up into sections of numbers, or charicters - # This makes sure that all the charicters are encoded - # In the best way posible for Code128 + # Split up into sections of numbers, or characters + # This makes sure that all the characters are encoded + # In the best way possible for Code128 for datum in re.findall(r'(?:(?:\d\d){2,})|(?:^\d\d)|.', text): if len(datum) == 1: block = block + datum diff --git a/share/extensions/Barcode/Code39.py b/share/extensions/Barcode/Code39.py index 0d4d445b1..cfe619bb0 100644 --- a/share/extensions/Barcode/Code39.py +++ b/share/extensions/Barcode/Code39.py @@ -73,7 +73,7 @@ class Code39(Barcode): def encode(self, text): self.text = text.upper() result = '' - # It isposible for us to encode code39 + # It is possible for us to encode code39 # into full ascii, but this feature is # not enabled here for char in '*' + self.text + '*': diff --git a/share/extensions/Barcode/Code93.py b/share/extensions/Barcode/Code93.py index 939a739dd..d09971fe7 100644 --- a/share/extensions/Barcode/Code93.py +++ b/share/extensions/Barcode/Code93.py @@ -91,7 +91,7 @@ class Code93(Barcode): return PALLET[check % 47] - # Some charicters need re-ENCODE into the code93 specification + # Some characters need re-ENCODE into the code93 specification def encode_ascii(self, text): result = [] for char in text: diff --git a/share/extensions/bezmisc.py b/share/extensions/bezmisc.py index c36e8e1b4..1119b85e2 100755 --- a/share/extensions/bezmisc.py +++ b/share/extensions/bezmisc.py @@ -113,7 +113,7 @@ def bezierslopeatt(((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)),t): def beziertatslope(((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3)),(dy,dx)): ax,ay,bx,by,cx,cy,x0,y0=bezierparameterize(((bx0,by0),(bx1,by1),(bx2,by2),(bx3,by3))) - #quadratic coefficents of slope formula + #quadratic coefficients of slope formula if dx: slope = 1.0*(dy/dx) a=3*ay-3*ax*slope diff --git a/share/filters/README b/share/filters/README index ac45826b8..2cdb43e79 100644 --- a/share/filters/README +++ b/share/filters/README @@ -9,6 +9,6 @@ inkscape:menu is the submenu under Effects > Filters inkscape:menu-tooltip is the menu command's tooltip in the statusbar These are then put into filters.svg.h in order to make them translatable. -They should appear as a normal translation to translaters through the +They should appear as a normal translation to translators through the gettext system. diff --git a/share/icons/hicolor/scalable/actions/feBlend-icon.svg b/share/icons/hicolor/scalable/actions/feBlend-icon.svg index dca97f107..1a5cffc60 100644 --- a/share/icons/hicolor/scalable/actions/feBlend-icon.svg +++ b/share/icons/hicolor/scalable/actions/feBlend-icon.svg @@ -43,7 +43,7 @@ </rdf:Bag> </dc:subject> <dc:coverage /> -<dc:description>this is an image originaly intended to be used in Inkscape</dc:description> +<dc:description>this is an image originally intended to be used in Inkscape</dc:description> <dc:contributor> <cc:Agent> <dc:title /> diff --git a/share/icons/hicolor/scalable/actions/feColorMatrix-icon.svg b/share/icons/hicolor/scalable/actions/feColorMatrix-icon.svg index ed33b0158..0aea1b545 100644 --- a/share/icons/hicolor/scalable/actions/feColorMatrix-icon.svg +++ b/share/icons/hicolor/scalable/actions/feColorMatrix-icon.svg @@ -54,7 +54,7 @@ </rdf:Bag> </dc:subject> <dc:coverage /> -<dc:description>this is an image originaly intended to be used in inkscape</dc:description> +<dc:description>this is an image originally intended to be used in inkscape</dc:description> <dc:contributor> <cc:Agent> <dc:title /> diff --git a/share/icons/hicolor/scalable/actions/feComposite-icon.svg b/share/icons/hicolor/scalable/actions/feComposite-icon.svg index d3bd7511e..d8dc0a9d1 100644 --- a/share/icons/hicolor/scalable/actions/feComposite-icon.svg +++ b/share/icons/hicolor/scalable/actions/feComposite-icon.svg @@ -43,7 +43,7 @@ </rdf:Bag> </dc:subject> <dc:coverage /> -<dc:description>this is an image originaly intended to be used in Inkscape</dc:description> +<dc:description>this is an image originally intended to be used in Inkscape</dc:description> <dc:contributor> <cc:Agent> <dc:title /> diff --git a/share/icons/hicolor/scalable/actions/feConvolveMatrix-icon.svg b/share/icons/hicolor/scalable/actions/feConvolveMatrix-icon.svg index 5fa369e0c..c87a5bda1 100644 --- a/share/icons/hicolor/scalable/actions/feConvolveMatrix-icon.svg +++ b/share/icons/hicolor/scalable/actions/feConvolveMatrix-icon.svg @@ -34,7 +34,7 @@ <rdf:li>ConvolveMatrix filter primitive example</rdf:li> </rdf:Bag> </dc:subject> -<dc:description>this is an image originaly intended to be used in Inkscape</dc:description> +<dc:description>this is an image originally intended to be used in Inkscape</dc:description> <dc:publisher> <cc:Agent> <dc:title>Felipe Corrêa da Silva Sanches</dc:title> diff --git a/share/icons/hicolor/scalable/actions/feDisplacementMap-icon.svg b/share/icons/hicolor/scalable/actions/feDisplacementMap-icon.svg index aba251e47..66f886d13 100644 --- a/share/icons/hicolor/scalable/actions/feDisplacementMap-icon.svg +++ b/share/icons/hicolor/scalable/actions/feDisplacementMap-icon.svg @@ -51,7 +51,7 @@ </rdf:Bag> </dc:subject> <dc:coverage /> -<dc:description>this is an image originaly intended to be used in inkscape</dc:description> +<dc:description>this is an image originally intended to be used in inkscape</dc:description> <dc:contributor> <cc:Agent> <dc:title /> diff --git a/share/icons/hicolor/scalable/actions/feFlood-icon.svg b/share/icons/hicolor/scalable/actions/feFlood-icon.svg index c7cafac7b..75cd33589 100644 --- a/share/icons/hicolor/scalable/actions/feFlood-icon.svg +++ b/share/icons/hicolor/scalable/actions/feFlood-icon.svg @@ -42,7 +42,7 @@ </rdf:Bag> </dc:subject> <dc:coverage /> -<dc:description>this is an image originaly intended to be used in Inkscape</dc:description> +<dc:description>this is an image originally intended to be used in Inkscape</dc:description> <dc:contributor> <cc:Agent> <dc:title /> diff --git a/share/icons/hicolor/scalable/actions/feGaussianBlur-icon.svg b/share/icons/hicolor/scalable/actions/feGaussianBlur-icon.svg index 92f87e75c..c906a5f4a 100644 --- a/share/icons/hicolor/scalable/actions/feGaussianBlur-icon.svg +++ b/share/icons/hicolor/scalable/actions/feGaussianBlur-icon.svg @@ -31,7 +31,7 @@ <rdf:li>hexamines icon</rdf:li> </rdf:Bag> </dc:subject> -<dc:description>this is an image originaly intended to be used in the hexamines game</dc:description> +<dc:description>this is an image originally intended to be used in the hexamines game</dc:description> <dc:publisher> <cc:Agent> <dc:title>Felipe Corrêa da Silva Sanches</dc:title> diff --git a/share/icons/hicolor/scalable/actions/feImage-icon.svg b/share/icons/hicolor/scalable/actions/feImage-icon.svg index 2203c16b8..b40e84d56 100644 --- a/share/icons/hicolor/scalable/actions/feImage-icon.svg +++ b/share/icons/hicolor/scalable/actions/feImage-icon.svg @@ -31,7 +31,7 @@ <rdf:li>Image filter primitive example</rdf:li> </rdf:Bag> </dc:subject> -<dc:description>this is an image originaly intended to be used in Inkscape</dc:description> +<dc:description>this is an image originally intended to be used in Inkscape</dc:description> <dc:publisher> <cc:Agent> <dc:title>Felipe Corrêa da Silva Sanches</dc:title> diff --git a/share/icons/hicolor/scalable/actions/feMerge-icon.svg b/share/icons/hicolor/scalable/actions/feMerge-icon.svg index 14070373e..d3b34564e 100644 --- a/share/icons/hicolor/scalable/actions/feMerge-icon.svg +++ b/share/icons/hicolor/scalable/actions/feMerge-icon.svg @@ -43,7 +43,7 @@ </rdf:Bag> </dc:subject> <dc:coverage /> -<dc:description>this is an image originaly intended to be used in Inkscape</dc:description> +<dc:description>this is an image originally intended to be used in Inkscape</dc:description> <dc:contributor> <cc:Agent> <dc:title /> diff --git a/share/icons/hicolor/scalable/actions/feMorphology-icon.svg b/share/icons/hicolor/scalable/actions/feMorphology-icon.svg index 15f215508..5cbf580dd 100644 --- a/share/icons/hicolor/scalable/actions/feMorphology-icon.svg +++ b/share/icons/hicolor/scalable/actions/feMorphology-icon.svg @@ -40,7 +40,7 @@ </rdf:Bag> </dc:subject> <dc:coverage /> -<dc:description>this is an image originaly intended to be used in Inkscape</dc:description> +<dc:description>this is an image originally intended to be used in Inkscape</dc:description> <dc:contributor> <cc:Agent> <dc:title /> diff --git a/share/icons/hicolor/scalable/actions/feOffset-icon.svg b/share/icons/hicolor/scalable/actions/feOffset-icon.svg index 6b2d87681..e8a4808dd 100644 --- a/share/icons/hicolor/scalable/actions/feOffset-icon.svg +++ b/share/icons/hicolor/scalable/actions/feOffset-icon.svg @@ -36,7 +36,7 @@ </rdf:Bag> </dc:subject> <dc:coverage /> -<dc:description>this is an image originaly intended to be used in the hexamines game</dc:description> +<dc:description>this is an image originally intended to be used in the hexamines game</dc:description> <dc:contributor> <cc:Agent> <dc:title /> diff --git a/share/icons/hicolor/scalable/actions/feTurbulence-icon.svg b/share/icons/hicolor/scalable/actions/feTurbulence-icon.svg index 37d986d36..cc0d0c714 100644 --- a/share/icons/hicolor/scalable/actions/feTurbulence-icon.svg +++ b/share/icons/hicolor/scalable/actions/feTurbulence-icon.svg @@ -40,7 +40,7 @@ </rdf:Bag> </dc:subject> <dc:coverage /> -<dc:description>this is an image originaly intended to be used in Inkscape</dc:description> +<dc:description>this is an image originally intended to be used in Inkscape</dc:description> <dc:contributor> <cc:Agent> <dc:title /> diff --git a/share/icons/hicolor/scalable/actions/stroke-join-bevel.svg b/share/icons/hicolor/scalable/actions/stroke-join-bevel.svg index 2784c7070..1d493023c 100644 --- a/share/icons/hicolor/scalable/actions/stroke-join-bevel.svg +++ b/share/icons/hicolor/scalable/actions/stroke-join-bevel.svg @@ -7,7 +7,7 @@ height="24" > <g id="stroke-join-bevel" inkscape:label="#join_bevel"> - <!-- Corner exagerated --> + <!-- Corner exaggerated --> <path d="m 0.5,24 0,-13 10.5,-10.5 13,0 0,17 -6.5,0 0,6.5 z" style="fill:#99b6d4"/> <path d="m 0.5,24 0,-13 10.5,-10.5 13,0 m 0,17 -6.5,0 0,6.5 " style="fill:none;stroke:black"/> <path d="m 9,24 0,-15 15,0" style="fill:none;stroke:white;stroke-width:2px;stroke-dasharray:2 2;stroke-dashoffset:2"/> diff --git a/share/icons/hicolor/scalable/actions/stroke-join-round.svg b/share/icons/hicolor/scalable/actions/stroke-join-round.svg index d604d2f0a..06cbeb745 100644 --- a/share/icons/hicolor/scalable/actions/stroke-join-round.svg +++ b/share/icons/hicolor/scalable/actions/stroke-join-round.svg @@ -8,7 +8,7 @@ > <g id="stroke-join-round" inkscape:label="#join_round"> - <!-- Corner exagerated --> + <!-- Corner exaggerated --> <path d="m 0.5,24 0,-11 a 12.5,12.5 0 0 1 12.5,-12.5 l 11,0 0,17 -6.5,0 0,6.5 z" style="fill:#99b6d4"/> <path d="m 0.5,24 0,-11 a 12.5,12.5 0 0 1 12.5,-12.5 l 11,0 m 0,17 -6.5,0 0,6.5 " style="fill:none;stroke:black"/> <path d="m 9,24 0,-15 15,0" style="fill:none;stroke:white;stroke-width:2px;stroke-dasharray:2 2;stroke-dashoffset:2"/> diff --git a/share/symbols/BalloonSymbols.svg b/share/symbols/BalloonSymbols.svg index b2563e47a..e9a76fafb 100644 --- a/share/symbols/BalloonSymbols.svg +++ b/share/symbols/BalloonSymbols.svg @@ -36,7 +36,7 @@ <rdf:li>balloon</rdf:li> <rdf:li>comic</rdf:li> <rdf:li>cartoon</rdf:li> - <rdf:li>speach</rdf:li> + <rdf:li>speech</rdf:li> <rdf:li>exclaim</rdf:li> </rdf:Bag> </dc:subject> diff --git a/share/ui/menus.xml b/share/ui/menus.xml index bc1d19587..5bcaca8cf 100644 --- a/share/ui/menus.xml +++ b/share/ui/menus.xml @@ -120,6 +120,13 @@ <!--verb verb-id="ViewColorModePrintColorsPreview" radio="yes"/--> <!--verb verb-id="DialogPrintColorsPreview" /--> </submenu> + <submenu _name="_Canvas orientation"> + <verb verb-id="FlipHorizontal"/> + <verb verb-id="FlipVertical"/> + <verb verb-id="FlipNone"/> + <separator/> + <verb verb-id="RotateZero"/> + </submenu> <separator/> <verb verb-id="ToggleGrid" check="yes" /> <verb verb-id="ToggleGuides" check="yes" /> diff --git a/share/ui/select-toolbar.ui b/share/ui/select-toolbar.ui index 122c52a2c..d3f35393c 100644 --- a/share/ui/select-toolbar.ui +++ b/share/ui/select-toolbar.ui @@ -140,6 +140,7 @@ <separator /> <toolitem action='measure_units_label' /> <toolitem action='MeasureUnitsAction' /> + <toolitem action='MeasureOnlySelected' /> <toolitem action='MeasureIgnore1stAndLast' /> <toolitem action='MeasureInBettween' /> <toolitem action='MeasureShowHidden' /> diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4c56b211d..c6ef78a4f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -233,6 +233,7 @@ set(inkscape_SRC object-set.cpp object-snapper.cpp path-chemistry.cpp + path-prefix.cpp persp3d-reference.cpp persp3d.cpp perspective-line.cpp diff --git a/src/attribute-rel-util.cpp b/src/attribute-rel-util.cpp index 5e770d4ae..42b6bebf2 100644 --- a/src/attribute-rel-util.cpp +++ b/src/attribute-rel-util.cpp @@ -309,7 +309,7 @@ bool sp_attribute_check_attribute(Glib::ustring element, Glib::ustring id, Glib: // First check if it is a presentation attribute. Presentation attributes can be applied to // any element. At the moment, we are only going to check if it is a possibly useful - // attribute. Note, we don't explicitely check against the list of elements where presentation + // attribute. Note, we don't explicitly check against the list of elements where presentation // attributes are allowed (See SVG1.1 spec, Appendix M.2). if( !SPAttributeRelCSS::findIfValid( attribute, element ) ) { diff --git a/src/display/drawing-pattern.cpp b/src/display/drawing-pattern.cpp index d0bf5de58..b590a59c5 100644 --- a/src/display/drawing-pattern.cpp +++ b/src/display/drawing-pattern.cpp @@ -165,8 +165,8 @@ unsigned DrawingPattern::_updateItem(Geom::IntRect const &area, UpdateContext co const double oversampling = 2.0; double scale = det_ctm*det_ps2user*det_child_transform * oversampling; //FIXME: When scale is too big (zooming in a hatch), cairo doesn't render the pattern - //More precisely it fails when seting pattern matrix in DrawingPattern::renderPattern - //Fully correct solution should make use of visible area bbox and change hach tile rect + //More precisely it fails when setting pattern matrix in DrawingPattern::renderPattern + //Fully correct solution should make use of visible area bbox and change hatch tile rect //accordingly if (scale > 25) { scale = 25; diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp index 4869472da..b631f8c04 100644 --- a/src/extension/internal/cairo-render-context.cpp +++ b/src/extension/internal/cairo-render-context.cpp @@ -128,8 +128,7 @@ CairoRenderContext::CairoRenderContext(CairoRenderer *parent) : _renderer(parent), _render_mode(RENDER_MODE_NORMAL), _clip_mode(CLIP_MODE_MASK), - _omittext_state(EMPTY), - _omittext_missing_pages(0) + _omittext_state(EMPTY) { } @@ -885,19 +884,16 @@ CairoRenderContext::finish(bool finish_surface) if (_vector_based_target && finish_surface) cairo_show_page(_cr); - // PDF+TeX Output, see CairoRenderContext::_prepareRenderGraphic() - while (_omittext_missing_pages > 0) { - _omittext_missing_pages--; - g_warning("PDF+TeX output: issuing blank PDF page at end (workaround for previous error)"); - cairo_show_page(_cr); - } + cairo_status_t status = cairo_status(_cr); + if (status != CAIRO_STATUS_SUCCESS) + g_critical("error while rendering output: %s", cairo_status_to_string(status)); cairo_destroy(_cr); _cr = NULL; if (finish_surface) cairo_surface_finish(_surface); - cairo_status_t status = cairo_surface_status(_surface); + status = cairo_surface_status(_surface); cairo_surface_destroy(_surface); _surface = NULL; @@ -1444,28 +1440,38 @@ CairoRenderContext::_prepareRenderGraphic() { // Only PDFLaTeX supports importing a single page of a graphics file, // so only PDF backend gets interleaved text/graphics - if (_is_omittext && _target == CAIRO_SURFACE_TYPE_PDF) { + if (_is_omittext && _target == CAIRO_SURFACE_TYPE_PDF && _render_mode != RENDER_MODE_CLIP) { if (_omittext_state == NEW_PAGE_ON_GRAPHIC) { - if (cairo_get_group_target(_cr) != cairo_get_target(_cr)) { - // we are in the middle of a group, i. e., between cairo_push_group() and cairo_pop_group(). - // cairo_show_page() has no effect here! - // To ensure that the the generated TeX source doesn't try to include non-existing pages, - // we will later output an extra blank page. - // This is a workaround for bug #1417470. - g_warning("PDF+TeX output: Found text inside a clipped/masked group. This is not supported, the Z-order will be incorrect. Blank pages will be added to the PDF output to work around bug #1417470."); - _omittext_missing_pages++; - } else { - // no group is active, create new page - cairo_show_page(_cr); - // Output missing pages (workaround for the 'if' case above). - // With this solution, the Z-order is more wrong than necessary. - // It would be better to print the blank pages first, and then the actual current page. - // However, this isn't easily possible with cairo. - while (_omittext_missing_pages > 0) { - _omittext_missing_pages--; - g_warning("PDF+TeX output: issuing blank PDF page (workaround for previous error)"); - cairo_show_page(_cr); - } + // better set this immediately (not sure if masks applied during "popLayer" could call + // this function, too, triggering the same code again in error + _omittext_state = GRAPHIC_ON_TOP; + + // As we can not emit the page in the middle of a layer (aka group) - it will not be fully painted yet! - + // the following basically mirrors the calls in CairoRenderer::renderItem (but in reversed order) + // - first traverse all saved states in reversed order (i.e. from deepest nesting to the top) + // and apply clipping / masking to layers on the way (this is done in popLayer) + // - then emit the page using cairo_show_page() + // - finally restore the previous state with proper transforms and appropriate layers again + // + // TODO: While this appears to be an ugly hack it seems to work + // Somebody with a more intimate understanding of cairo and the renderer implementation might + // be able to implement this in a cleaner way, though. + int stack_size = _state_stack.size(); + for (int i = stack_size-1; i > 0; i--) { + if (_state_stack[i]->need_layer) + popLayer(); + cairo_restore(_cr); + _state = _state_stack[i-1]; + } + + cairo_show_page(_cr); + + for (int i = 1; i < stack_size; i++) { + cairo_save(_cr); + _state = _state_stack[i]; + if (_state->need_layer) + pushLayer(); + setTransform(_state->transform); } } _omittext_state = GRAPHIC_ON_TOP; diff --git a/src/extension/internal/cairo-render-context.h b/src/extension/internal/cairo-render-context.h index a0ca2665b..f75d05ea7 100644 --- a/src/extension/internal/cairo-render-context.h +++ b/src/extension/internal/cairo-render-context.h @@ -207,7 +207,6 @@ protected: CairoClipMode _clip_mode; CairoOmitTextPageState _omittext_state; - int _omittext_missing_pages; cairo_pattern_t *_createPatternForPaintServer(SPPaintServer const *const paintserver, Geom::OptRect const &pbox, float alpha); diff --git a/src/gc-finalized.h b/src/gc-finalized.h index d39338643..887603806 100644 --- a/src/gc-finalized.h +++ b/src/gc-finalized.h @@ -36,7 +36,7 @@ namespace GC { * 1. The garbage collector uses strictly topologically-ordered * finalization; if objects with finalizers reference each other * directly or indirectly, the collector will refuse to finalize (and - * therefor free) them. You'll see a warning on the console if this + * therefore free) them. You'll see a warning on the console if this * happens. * * The best way to limit this effect is to only make "leaf" objects diff --git a/src/io/resource.cpp b/src/io/resource.cpp index 13da37d7a..0b242cc31 100644 --- a/src/io/resource.cpp +++ b/src/io/resource.cpp @@ -209,7 +209,7 @@ Glib::ustring get_filename(Glib::ustring path, Glib::ustring filename) } /* - * Get's all the files in a given type, for all domain types. + * Gets all the files in a given type, for all domain types. * * domain - Optional domain (overload), will check return domains if not. * type - The type of files, e.g. TEMPLATES diff --git a/src/libnrtype/Layout-TNG-Output.cpp b/src/libnrtype/Layout-TNG-Output.cpp index 9a73b9eca..984c2dd1a 100644 --- a/src/libnrtype/Layout-TNG-Output.cpp +++ b/src/libnrtype/Layout-TNG-Output.cpp @@ -625,7 +625,7 @@ Glib::ustring Layout::dumpAsText() const + Glib::ustring::compose(" direction %1, block-progression %2\n", direction_to_text(_spans[span_index].direction), direction_to_text(_spans[span_index].block_progression)) + " ** characters:\n"; Glib::ustring::const_iterator iter_char = _spans[span_index].input_stream_first_character; - // very inefficent code. what the hell, it's only debug stuff. + // very inefficient code. what the hell, it's only debug stuff. for (unsigned char_index = 0 ; char_index < _characters.size() ; char_index++) { union {const PangoLogAttr* pattr; const unsigned* uattr;} u; u.pattr = &_characters[char_index].char_attributes; diff --git a/src/path-prefix.cpp b/src/path-prefix.cpp new file mode 100644 index 000000000..87b756eb4 --- /dev/null +++ b/src/path-prefix.cpp @@ -0,0 +1,74 @@ +/* + * path-prefix.cpp - Inkscape specific prefix handling + * + * Authors: + * Eduard Braun <eduard.braun2@gmx.de> + * + * Copyright (C) 2017 Authors + * + * This file is part of Inkscape. + * + * Inkscape is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * See the file COPYING for details. + * + */ + + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + + +#include <glib.h> +#include "path-prefix.h" + + +/** + * Determine the location of the Inkscape data directory (typically the share/ folder + * from where Inkscape should be loading resources) and append a relative path + * + * - by default use the compile time value of INKSCAPE_DATADIR + * - on Windows inkscape_datadir will be relative to the called executable by default + * (typically inkscape/share but also handles the case where the executable is in a /bin subfolder) + * - if the environment variable INKSCAPE_DATADIR is set it will override all of the above + */ +char *append_inkscape_datadir(const char *relative_path) +{ + static gchar const *inkscape_datadir; + if (!inkscape_datadir) { + gchar const *datadir_env = g_getenv("INKSCAPE_DATADIR"); + if (datadir_env) { + inkscape_datadir = g_strdup(datadir_env); + } else { +#ifdef _WIN32 + gchar *module_path = g_win32_get_package_installation_directory_of_module(NULL); + inkscape_datadir = g_build_filename(module_path, "share", NULL); + g_free(module_path); +#else + inkscape_datadir = INKSCAPE_DATADIR; +#endif + } + } + + if (!relative_path) { + relative_path = ""; + } + + return g_build_filename(inkscape_datadir, relative_path, NULL); +} + + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/path-prefix.h b/src/path-prefix.h index d6514d832..b69ad3753 100644 --- a/src/path-prefix.h +++ b/src/path-prefix.h @@ -18,9 +18,13 @@ #endif #include "prefix.h" -//#ifdef __cplusplus -//extern "C" { -//#endif /* __cplusplus */ + +char *append_inkscape_datadir(const char *relative_path); + +#ifdef _WIN32 +#undef INKSCAPE_DATADIR +#define INKSCAPE_DATADIR append_inkscape_datadir(NULL) +#endif #ifdef ENABLE_BINRELOC /* The way that we're building now is with a shared library between Inkscape @@ -52,30 +56,30 @@ # define CREATE_PALETTESDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/create/swatches" ) # define CREATE_PATTERNSDIR BR_DATADIR( INKSCAPE_LIBPREFIX "/share/create/patterns/vector" ) #else -# ifdef WIN32 -# define INKSCAPE_APPICONDIR WIN32_DATADIR("pixmaps") -# define INKSCAPE_ATTRRELDIR WIN32_DATADIR("attributes") -# define INKSCAPE_BINDDIR WIN32_DATADIR("bind") -# define INKSCAPE_EXAMPLESDIR WIN32_DATADIR("examples") -# define INKSCAPE_EXTENSIONDIR WIN32_DATADIR("extensions") -# define INKSCAPE_FILTERDIR WIN32_DATADIR("filters") -# define INKSCAPE_FONTSDIR WIN32_DATADIR("fonts") -# define INKSCAPE_GRADIENTSDIR WIN32_DATADIR("gradients") -# define INKSCAPE_KEYSDIR WIN32_DATADIR("keys") -# define INKSCAPE_PIXMAPDIR WIN32_DATADIR("icons") -# define INKSCAPE_MARKERSDIR WIN32_DATADIR("markers") -# define INKSCAPE_PALETTESDIR WIN32_DATADIR("palettes") -# define INKSCAPE_PATTERNSDIR WIN32_DATADIR("patterns") -# define INKSCAPE_SCREENSDIR WIN32_DATADIR("screens") -# define INKSCAPE_SYMBOLSDIR WIN32_DATADIR("symbols") -# define INKSCAPE_THEMEDIR INKSCAPE_PIXMAPDIR -# define INKSCAPE_TUTORIALSDIR WIN32_DATADIR("tutorials") -# define INKSCAPE_TEMPLATESDIR WIN32_DATADIR("templates") -# define INKSCAPE_UIDIR WIN32_DATADIR("ui") +# ifdef _WIN32 +# define INKSCAPE_APPICONDIR append_inkscape_datadir("pixmaps") +# define INKSCAPE_ATTRRELDIR append_inkscape_datadir("attributes") +# define INKSCAPE_BINDDIR append_inkscape_datadir("bind") +# define INKSCAPE_EXAMPLESDIR append_inkscape_datadir("examples") +# define INKSCAPE_EXTENSIONDIR append_inkscape_datadir("extensions") +# define INKSCAPE_FILTERDIR append_inkscape_datadir("filters") +# define INKSCAPE_FONTSDIR append_inkscape_datadir("fonts") +# define INKSCAPE_GRADIENTSDIR append_inkscape_datadir("gradients") +# define INKSCAPE_KEYSDIR append_inkscape_datadir("keys") +# define INKSCAPE_PIXMAPDIR append_inkscape_datadir("icons") +# define INKSCAPE_MARKERSDIR append_inkscape_datadir("markers") +# define INKSCAPE_PALETTESDIR append_inkscape_datadir("palettes") +# define INKSCAPE_PATTERNSDIR append_inkscape_datadir("patterns") +# define INKSCAPE_SCREENSDIR append_inkscape_datadir("screens") +# define INKSCAPE_SYMBOLSDIR append_inkscape_datadir("symbols") +# define INKSCAPE_THEMEDIR append_inkscape_datadir("icons") +# define INKSCAPE_TUTORIALSDIR append_inkscape_datadir("tutorials") +# define INKSCAPE_TEMPLATESDIR append_inkscape_datadir("templates") +# define INKSCAPE_UIDIR append_inkscape_datadir("ui") //CREATE V0.1 WIN32 support -# define CREATE_GRADIENTSDIR WIN32_DATADIR("create\\gradients\\gimp") -# define CREATE_PALETTESDIR WIN32_DATADIR("create\\swatches") -# define CREATE_PATTERNSDIR WIN32_DATADIR("create\\patterns\\vector") +# define CREATE_GRADIENTSDIR append_inkscape_datadir("create\\gradients\\gimp") +# define CREATE_PALETTESDIR append_inkscape_datadir("create\\swatches") +# define CREATE_PATTERNSDIR append_inkscape_datadir("create\\patterns\\vector") # elif defined ENABLE_OSX_APP_LOCATIONS # define INKSCAPE_APPICONDIR "Contents/Resources/share/pixmaps" # define INKSCAPE_ATTRRELDIR "Contents/Resources/share/inkscape/attributes" @@ -101,34 +105,30 @@ # define CREATE_PALETTESDIR "/Library/Application Support/create/swatches" # define CREATE_PATTERNSDIR "/Library/Application Support/create/patterns/vector" # else -# define INKSCAPE_APPICONDIR INKSCAPE_DATADIR "/pixmaps" -# define INKSCAPE_ATTRRELDIR INKSCAPE_DATADIR "/inkscape/attributes" -# define INKSCAPE_BINDDIR INKSCAPE_DATADIR "/inkscape/bind" -# define INKSCAPE_EXAMPLESDIR INKSCAPE_DATADIR "/inkscape/examples" -# define INKSCAPE_EXTENSIONDIR INKSCAPE_DATADIR "/inkscape/extensions" -# define INKSCAPE_FILTERDIR INKSCAPE_DATADIR "/inkscape/filters" -# define INKSCAPE_FONTSDIR INKSCAPE_DATADIR "/inkscape/fonts" -# define INKSCAPE_GRADIENTSDIR INKSCAPE_DATADIR "/inkscape/gradients" -# define INKSCAPE_KEYSDIR INKSCAPE_DATADIR "/inkscape/keys" -# define INKSCAPE_PIXMAPDIR INKSCAPE_DATADIR "/inkscape/icons" -# define INKSCAPE_MARKERSDIR INKSCAPE_DATADIR "/inkscape/markers" -# define INKSCAPE_PALETTESDIR INKSCAPE_DATADIR "/inkscape/palettes" -# define INKSCAPE_PATTERNSDIR INKSCAPE_DATADIR "/inkscape/patterns" -# define INKSCAPE_SCREENSDIR INKSCAPE_DATADIR "/inkscape/screens" -# define INKSCAPE_SYMBOLSDIR INKSCAPE_DATADIR "/inkscape/symbols" -# define INKSCAPE_THEMEDIR INKSCAPE_DATADIR "/icons" -# define INKSCAPE_TUTORIALSDIR INKSCAPE_DATADIR "/inkscape/tutorials" -# define INKSCAPE_TEMPLATESDIR INKSCAPE_DATADIR "/inkscape/templates" -# define INKSCAPE_UIDIR INKSCAPE_DATADIR "/inkscape/ui" +# define INKSCAPE_APPICONDIR append_inkscape_datadir("pixmaps") +# define INKSCAPE_ATTRRELDIR append_inkscape_datadir("inkscape/attributes") +# define INKSCAPE_BINDDIR append_inkscape_datadir("inkscape/bind") +# define INKSCAPE_EXAMPLESDIR append_inkscape_datadir("inkscape/examples") +# define INKSCAPE_EXTENSIONDIR append_inkscape_datadir("inkscape/extensions") +# define INKSCAPE_FILTERDIR append_inkscape_datadir("inkscape/filters") +# define INKSCAPE_FONTSDIR append_inkscape_datadir("inkscape/fonts") +# define INKSCAPE_GRADIENTSDIR append_inkscape_datadir("inkscape/gradients") +# define INKSCAPE_KEYSDIR append_inkscape_datadir("inkscape/keys") +# define INKSCAPE_PIXMAPDIR append_inkscape_datadir("inkscape/icons") +# define INKSCAPE_MARKERSDIR append_inkscape_datadir("inkscape/markers") +# define INKSCAPE_PALETTESDIR append_inkscape_datadir("inkscape/palettes") +# define INKSCAPE_PATTERNSDIR append_inkscape_datadir("inkscape/patterns") +# define INKSCAPE_SCREENSDIR append_inkscape_datadir("inkscape/screens") +# define INKSCAPE_SYMBOLSDIR append_inkscape_datadir("inkscape/symbols") +# define INKSCAPE_THEMEDIR append_inkscape_datadir("icons") +# define INKSCAPE_TUTORIALSDIR append_inkscape_datadir("inkscape/tutorials") +# define INKSCAPE_TEMPLATESDIR append_inkscape_datadir("inkscape/templates") +# define INKSCAPE_UIDIR append_inkscape_datadir("inkscape/ui") //CREATE V0.1 support -# define CREATE_GRADIENTSDIR INKSCAPE_DATADIR "/create/gradients/gimp" -# define CREATE_PALETTESDIR INKSCAPE_DATADIR "/create/swatches" -# define CREATE_PATTERNSDIR INKSCAPE_DATADIR "/create/patterns/vector" -# endif +# define CREATE_GRADIENTSDIR append_inkscape_datadir("create/gradients/gimp") +# define CREATE_PALETTESDIR append_inkscape_datadir("create/swatches") +# define CREATE_PATTERNSDIR append_inkscape_datadir("create/patterns/vector") +# endif #endif -//#ifdef __cplusplus -//} -//#endif /* __cplusplus */ - #endif /* _PATH_PREFIX_H_ */ diff --git a/src/prefix.cpp b/src/prefix.cpp index c8bf7abec..14fdd04df 100644 --- a/src/prefix.cpp +++ b/src/prefix.cpp @@ -416,44 +416,4 @@ br_extract_prefix (const char *path) } #endif /* __cplusplus */ - - -#ifdef __WIN32__ -/** - * Provide a similar mechanism for Win32. Enable a macro, - * WIN32_DATADIR, that can look up subpaths for inkscape resources - */ - -/** - * Get the Windows-equivalent of INKSCAPE_DATADIR and append a relative path - * - * - by default INKSCAPE_DATADIR will be relative to the called executable - * (typically inkscape/share but also handles the case where the executable is in a /bin subfolder) - * - to override set the INKSCAPE_DATADIR environment variable - */ -char *win32_append_datadir(const char *relative_path) -{ - static gchar *datadir; - if (!datadir) { - gchar const *inkscape_datadir = g_getenv("INKSCAPE_DATADIR"); - if (inkscape_datadir) { - datadir = g_strdup(inkscape_datadir); - } else { - gchar *module_path = g_win32_get_package_installation_directory_of_module(NULL); - datadir = g_build_filename(module_path, "share", NULL); - g_free(module_path); - } - } - - if (!relative_path) { - relative_path = ""; - } - - return g_build_filename(datadir, relative_path, NULL); -} -#endif /* __WIN32__ */ - - - - #endif /* _PREFIX_C */ diff --git a/src/prefix.h b/src/prefix.h index d28e896d0..bdf3b6df4 100644 --- a/src/prefix.h +++ b/src/prefix.h @@ -118,11 +118,4 @@ char *br_extract_prefix(const char *path); } #endif /* __cplusplus */ -#ifdef __WIN32__ -char *win32_append_datadir(const char *relative_path); -#undef INKSCAPE_DATADIR -#define INKSCAPE_DATADIR win32_append_datadir(NULL) -#define WIN32_DATADIR(suffix) (win32_append_datadir(suffix)) -#endif - #endif /* _PREFIX_H_ */ diff --git a/src/style-internal.h b/src/style-internal.h index 5c22c093d..33e71d5b4 100644 --- a/src/style-internal.h +++ b/src/style-internal.h @@ -116,7 +116,7 @@ enum SPStyleSrc { * */ -/// Virtual base class for all SPStyle interal classes +/// Virtual base class for all SPStyle internal classes class SPIBase { @@ -733,7 +733,7 @@ public: gchar *value_default; }; -/// Color type interal to SPStyle, FIXME Add string value to store SVG named color. +/// Color type internal to SPStyle, FIXME Add string value to store SVG named color. class SPIColor : public SPIBase { diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp index 118d7ae1f..a0f1fa09c 100644 --- a/src/ui/clipboard.cpp +++ b/src/ui/clipboard.cpp @@ -672,7 +672,7 @@ std::vector<Glib::ustring> ClipboardManagerImpl::getElementsOfType(SPDesktop *de root->removeChild(tempdoc->getDefs()->getRepr()); std::vector<Inkscape::XML::Node const *> reprs; if (strcmp(type, "*") == 0){ - //TODO:Fill vector with all posible elements + //TODO:Fill vector with all possible elements std::vector<Glib::ustring> types; types.push_back((Glib::ustring)"svg:path"); types.push_back((Glib::ustring)"svg:circle"); diff --git a/src/ui/dialog/xml-tree.cpp b/src/ui/dialog/xml-tree.cpp index 5747c7726..6429e655d 100644 --- a/src/ui/dialog/xml-tree.cpp +++ b/src/ui/dialog/xml-tree.cpp @@ -447,7 +447,7 @@ void XmlTree::set_tree_select(Inkscape::XML::Node *repr) gtk_tree_selection_select_iter(selection, &node); } else { - g_message("XmlTree::set_tree_select : Couldnt find repr node"); + g_message("XmlTree::set_tree_select : Couldn't find repr node"); } } else { GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)); diff --git a/src/ui/tools/measure-tool.cpp b/src/ui/tools/measure-tool.cpp index bd2964d94..8037a02a9 100644 --- a/src/ui/tools/measure-tool.cpp +++ b/src/ui/tools/measure-tool.cpp @@ -602,6 +602,12 @@ bool MeasureTool::root_handler(GdkEvent* event) showInfoBox(motion_w, false); } } else { + SPDesktop *desktop = SP_ACTIVE_DESKTOP; + Inkscape::Util::Unit const * unit = desktop->getNamedView()->getDisplayUnit(); + for (size_t idx = 0; idx < measure_item.size(); ++idx) { + sp_canvas_item_destroy(measure_item[idx]); + } + measure_item.clear(); ret = TRUE; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); tolerance = prefs->getIntLimited("/options/dragtolerance/value", 0, 0, 100); @@ -1153,6 +1159,7 @@ void MeasureTool::showInfoBox(Geom::Point cursor, bool into_groups) double scale = prefs->getDouble("/tools/measure/scale", 100.0) / 100.0; int precision = prefs->getInt("/tools/measure/precision", 2); Glib::ustring unit_name = prefs->getString("/tools/measure/unit"); + bool only_selected = prefs->getBool("/tools/measure/only_selected", false); if (!unit_name.compare("")) { unit_name = "px"; } @@ -1185,6 +1192,14 @@ void MeasureTool::showInfoBox(Geom::Point cursor, bool into_groups) Geom::Point rel_position = Geom::Point(origin, origin); Geom::Point pos = desktop->w2d(cursor); double gap = Inkscape::Util::Quantity::convert(7 + fontsize, "px", unit->abbr); + if (only_selected) { + if (desktop->getSelection()->includes(over)) { + showItemInfoText(pos + (rel_position * zoom),_("Selected"),fontsize); + } else { + showItemInfoText(pos + (rel_position * zoom),_("Not selected"),fontsize); + } + rel_position = Geom::Point(rel_position[Geom::X], rel_position[Geom::Y] + gap); + } if (SP_IS_SHAPE(over)) { precision_str << _("Length") << ": %." << precision << "f %s"; measure_str = g_strdup_printf(precision_str.str().c_str(), item_length, unit_name.c_str()); @@ -1196,7 +1211,6 @@ void MeasureTool::showInfoBox(Geom::Point cursor, bool into_groups) showItemInfoText(pos + (rel_position * zoom),measure_str,fontsize); rel_position = Geom::Point(rel_position[Geom::X], rel_position[Geom::Y] + gap); } - precision_str << "Y: %." << precision << "f %s"; measure_str = g_strdup_printf(precision_str.str().c_str(), item_y, unit_name.c_str()); precision_str.str(""); @@ -1268,8 +1282,12 @@ void MeasureTool::showCanvasItems(bool to_guides, bool to_item, bool to_phantom, current_layer = desktop->currentLayer(); } std::vector<double> intersection_times; + bool only_selected = prefs->getBool("/tools/measure/only_selected", false); for (std::vector<SPItem*>::const_iterator i=items.begin(); i!=items.end(); ++i) { SPItem *item = *i; + if (!desktop->getSelection()->includes(*i) && only_selected) { + continue; + } if(all_layers || (layer_model && layer_model->layerForObject(item) == current_layer)){ if (SP_IS_SHAPE(item)) { calculate_intersections(desktop, item, lineseg, SP_SHAPE(item)->getCurve(), intersection_times); diff --git a/src/ui/tools/pencil-tool.cpp b/src/ui/tools/pencil-tool.cpp index 108a89af8..13d69b063 100644 --- a/src/ui/tools/pencil-tool.cpp +++ b/src/ui/tools/pencil-tool.cpp @@ -113,7 +113,7 @@ void PencilTool::_endpointSnap(Geom::Point &p, guint const state) { } } else { if (!(state & GDK_SHIFT_MASK)) { //SHIFT disables all snapping, except the angular snapping above - //After all, the user explicitely asked for angular snapping by + //After all, the user explicitly asked for angular snapping by //pressing CTRL boost::optional<Geom::Point> origin = this->npoints > 0 ? this->p[0] : boost::optional<Geom::Point>(); spdc_endpoint_snap_free(this, p, origin, state); @@ -325,7 +325,7 @@ bool PencilTool::_handleMotionNotify(GdkEventMotion const &mevent) { // Only in freehand mode we have to add the first point also to this->ps (apparently) // - We cannot add this point in spdc_set_startpoint, because we only need it for freehand // - We cannot do this in the button press handler because at that point we don't know yet - // wheter we're going into freehand mode or not + // whether we're going into freehand mode or not this->ps.push_back(this->p[0]); this->wps.push_back(this->pressure); } diff --git a/src/verbs.cpp b/src/verbs.cpp index d0975af16..f01a3c79c 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -3028,11 +3028,11 @@ Verb *Verb::_base_verbs[] = { new ZoomVerb(SP_VERB_ROTATE_CW, "RotateClockwise", N_("Rotate Clockwise"), N_("Rotate canvas clockwise"), NULL), new ZoomVerb(SP_VERB_ROTATE_CCW, "RotateCounterClockwise", N_("Rotate Counter-Clockwise"), N_("Rotate canvas counter-clockwise"), NULL), - new ZoomVerb(SP_VERB_ROTATE_ZERO, "RotateZero", N_("Rotate Zero"), N_("Reset canvas rotation to zero"), NULL), + new ZoomVerb(SP_VERB_ROTATE_ZERO, "RotateZero", N_("Reset Rotation"), N_("Reset canvas rotation to zero"), NULL), - new ZoomVerb(SP_VERB_FLIP_HORIZONTAL, "FlipHorizontal", N_("Flip Horizontal"), N_("Flip canvas horizontally"), INKSCAPE_ICON("object-flip-horizontal")), - new ZoomVerb(SP_VERB_FLIP_VERTICAL, "FlipVertical", N_("Flip Vertical"), N_("Flip canvas vertically"), INKSCAPE_ICON("object-flip-vertical")), - new ZoomVerb(SP_VERB_FLIP_NONE, "FlipNone", N_("Flip None"), N_("Undo any flip"), NULL), + new ZoomVerb(SP_VERB_FLIP_HORIZONTAL, "FlipHorizontal", N_("Flip Horizontally"), N_("Flip canvas horizontally"), INKSCAPE_ICON("object-flip-horizontal")), + new ZoomVerb(SP_VERB_FLIP_VERTICAL, "FlipVertical", N_("Flip Vertically"), N_("Flip canvas vertically"), INKSCAPE_ICON("object-flip-vertical")), + new ZoomVerb(SP_VERB_FLIP_NONE, "FlipNone", N_("Reset Flip"), N_("Undo any flip"), NULL), // WHY ARE THE FOLLOWING ZoomVerbs??? diff --git a/src/widgets/measure-toolbar.cpp b/src/widgets/measure-toolbar.cpp index fc6cfdb11..f031414a4 100644 --- a/src/widgets/measure-toolbar.cpp +++ b/src/widgets/measure-toolbar.cpp @@ -165,6 +165,24 @@ sp_toggle_ignore_1st_and_last( GtkToggleAction* act, gpointer data ) } static void +sp_toggle_only_selected( GtkToggleAction* act, gpointer data ) +{ + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + gboolean active = gtk_toggle_action_get_active(act); + prefs->setBool("/tools/measure/only_selected", active); + SPDesktop *desktop = static_cast<SPDesktop *>(data); + if ( active ) { + desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Measures only selected.")); + } else { + desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Measure all.")); + } + MeasureTool *mt = get_measure_tool(); + if (mt) { + mt->showCanvasItems(); + } +} + +static void sp_toggle_show_hidden( GtkToggleAction* act, gpointer data ) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); @@ -335,6 +353,18 @@ void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, G gtk_action_group_add_action( mainActions, GTK_ACTION(eact) ); } + /* measure only selected */ + { + InkToggleAction* act = ink_toggle_action_new( "MeasureOnlySelected", + _("Measure only selected"), + _("Measure only selected"), + INKSCAPE_ICON("snap-bounding-box-center"), + secondarySize ); + gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/measure/only_selected", false) ); + g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(sp_toggle_only_selected), desktop) ; + gtk_action_group_add_action( mainActions, GTK_ACTION(act) ); + } + /* ignore_1st_and_last */ { InkToggleAction* act = ink_toggle_action_new( "MeasureIgnore1stAndLast", diff --git a/testfiles/CMakeLists.txt b/testfiles/CMakeLists.txt index 0ff2b28e0..d42e3fdee 100644 --- a/testfiles/CMakeLists.txt +++ b/testfiles/CMakeLists.txt @@ -29,7 +29,7 @@ foreach(source ${TEST_SOURCES}) add_executable(${source} src/${source}.cpp unittest.cpp doc-per-case-test.cpp) target_link_libraries(${source} ${TEST_LIBS}) add_test(NAME ${source} COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${source}) - set_tests_properties(${source} PROPERTIES ENVIRONMENT ${CMAKE_CTEST_ENV}) + set_tests_properties(${source} PROPERTIES ENVIRONMENT "${CMAKE_CTEST_ENV}") add_dependencies(tests ${source}) endforeach() add_subdirectory(rendering_tests) diff --git a/testfiles/rendering_tests/CMakeLists.txt b/testfiles/rendering_tests/CMakeLists.txt index 8db01d97a..ff067c3f5 100644 --- a/testfiles/rendering_tests/CMakeLists.txt +++ b/testfiles/rendering_tests/CMakeLists.txt @@ -11,6 +11,6 @@ set(RENDERING_TESTS foreach(rendering_test ${RENDERING_TESTS}) add_test(NAME ${rendering_test} COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/test.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/inkscape ${CMAKE_CURRENT_SOURCE_DIR}/${rendering_test} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/testfiles/rendering_tests ) - set_tests_properties(${rendering_test} PROPERTIES ENVIRONMENT ${CMAKE_CTEST_ENV}) + set_tests_properties(${rendering_test} PROPERTIES ENVIRONMENT "${CMAKE_CTEST_ENV}") endforeach() |
