summaryrefslogtreecommitdiffstats
path: root/src/extension (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-11-13Fix alignment error for inline-size SVG 1.1 fallback text.Tavmjong Bah1-3/+44
Puts white space at end of line into separate tspan when 'text-anchor' is not start.
2019-11-09Fix SVG 1.1 fallback for SVG 2 text in a shape with 'text-align' not equal ↵Tavmjong Bah1-4/+13
to 'start'.
2019-11-03refactor: Eliminate SPIString::value_defaultThomas Holder2-4/+4
- eliminate value_default - make value private (-> _value) - add value() method
2019-10-30PDF+LaTeX export: escape ampersandsPatrick Storz1-1/+7
Fixes https://gitlab.com/inkscape/inbox/issues/1104
2019-10-28refactor: clean up SPI constructorsThomas Holder2-4/+4
2019-10-28refactor SPIEnum: more type safetyThomas Holder4-60/+64
fixes ungrouping of "font-weight:bolder" fixes "titling-caps" parsing fixes a casting error in CairoRenderContext::renderGlyphtext
2019-10-26fix poppler 0.82.0 buildThomas Holder4-3/+9
2019-10-19Extensions: catch parameters and translatable values with empty namePatrick Storz2-2/+9
A parameter with empty name (or name consisting of whitespace only) can cause undefined behavior and should be avoided at all cost. Empty translatable values like "gui-text"/"gui-description", while not encouraged, might be acceptable. However they must not be translated as gettext would return the full metadata of the .po file in this case.
2019-10-19Extensions: Implement translationdomain functionalityPatrick Storz3-12/+136
Inkscape will read the "translationdomain" attribute from the <inkscape-extension> root element in the .inx file. It will then attempt to lookup a message catalog that matches this domain, register it with gettext, and use it for translations. Message catalogs may be located in either - the .inx file's location - the root of the "extensions" directory containing the .inx - the system location Inkscape's own catalog is loaded from To make this functionality available to script extensions, Inkscape will set the environment variables INKEX_GETTEXT_DOMAIN and INKEX_GETTEXT_DIRECTORY so extension scripts can then use something like bindtextdomain(INKEX_GETTEXT_DOMAIN, INKEX_GETTEXT_DIRECTORY) textdomain(INKEX_GETTEXT_DOMAIN) to enable the feature. See also https://gitlab.com/inkscape/inkscape/issues/333 https://gitlab.com/inkscape/extensions/issues/117
2019-10-19Add export/import PDF blend modes and add isolation modifierJabier Arraiza3-17/+66
2019-10-17fix heap-use-after-freeThomas Holder1-1/+1
Verb::set_tip takes a borrowed string pointer. This line in Effect::check() is invalid if getErrorReason() returns a temporary: _verb.set_tip(Extension::getErrorReason().c_str());
2019-10-16Inkscape::XML::Node::addChildAtPosThomas Holder1-3/+5
2019-10-16Extensions: only check existence for interpreted scripts.Patrick Storz1-8/+17
This is for backwards-compatibility with older .inx files that used to redundantly request a dependency on their own interpreted script and did so with type="executable". However, in practice script files often *don't* have the x-bit set, which fortunately did not cause problems in the past, though, as the check for the x-bit was broken, see 3da7f71e45eb986aef67771b5af3c1e308971cff
2019-10-15Extensions: Disable effects that failed to loadPatrick Storz3-12/+10
Instead of removing them from the menu, they're now shown as inactive (greyed out), so users have a chance to know they even exists, without having to know about extension-errors.log Unfortunately tooltips seem to be hidden for insensitive menuitems as well, so we currently have no way of informing the user directly in the UI about the problem. Fixes https://gitlab.com/inkscape/inkscape/issues/470
2019-10-15Extensions: Do not even attempt to register incompatible extensionsPatrick Storz4-33/+50
This improves the fix for https://bugs.launchpad.net/inkscape/+bug/1307554 Also fixes a potential crashing issue when an .inx includes invalid XML.
2019-10-15Extensions: Fix file test when checking dependencies by typePatrick Storz3-36/+64
For "executable" files only existence was checked. (Glib::file_test needs a single FileTest) Apply this properly when checking script <command>s and xslt <file>s - interpreted scripts and xslt files -> only check existence - un-interpreted scripts -> check for executable file For Windows workarounds are implemented to yield desirable behavior: - as there is no executable bit, only check existence - as executables usually come with an extensions, scan for those as well.
2019-10-14Extensions: Switch .xslt file look-up to dependency logic as wellPatrick Storz3-22/+12
2019-10-14Extensions: Improve logic to lookup script extensionsPatrick Storz7-188/+148
- Use identical logic for looking up <dependency>s and <command>s. - Remove duplicate (but inconsistent and incomplete) logic from script.cpp that was used to search for the <command> again - Remove <check> element from .inx format It seems unused (at the very least by core extensions) and redundant to <dependency> checking - Deprecate the <command>-specific "reldir" attribute. Consistently use the functionally identical "location" attribute that was only used for <dependency>s before - Introduce the new relative location value location="inx", which looks up <dependencies> and <command>s relative to the .inx file's location.
2019-10-12Revert "Remove unused "nopref" variant of effects"Patrick Storz2-0/+10
This reverts commit ef84b6a06b8fe5be8c15384cd95a35bc6d0c95a7.
2019-10-05Fix various minor code problemsMarc Jeanmougin1-1/+2
2019-10-05Fix some memory leaks found by scan-buildMarc Jeanmougin1-1/+1
2019-09-26Extensions: Fix filename encoding issues in error loggingPatrick Storz4-31/+37
(std::ostream is not properly portable unfortunately)
2019-09-25Extensions: add a few missing calls to Gtk::manage()Patrick Storz4-6/+6
2019-09-25Extensions: Warn for duplicate page names and option names/valuesPatrick Storz3-4/+31
This is easy to miss and causes confusing behavior (e.g. wrong page/option selected)
2019-09-22Try to improve match of image-rendering values to cairo filtersPatrick Storz1-8/+13
Specifically image-rendering="crisp-edges" should use a scaling algorithm that does *not* blur edges. Unfortunately this only leaves CAIRO_FILTER_NEAREST, but seems to be the most suitable choice.
2019-09-19Extensions/grid2: fix header file locationPatrick Storz1-1/+2
2019-09-07Fix bugs appliing in fallback elementsJabier Arraiza1-1/+1
2019-09-07Prepared for beta. Fixed blocking bugJabiertxof1-1/+1
2019-09-07Extensions: Handle optiongroup options without valuePatrick Storz3-6/+12
We use the user visible GUI text as value in this case, which may or may not be translated. For backwards-compatibility with enum items use the untranslated value instead, if one of the deprecated tag-names is found. Fixes https://gitlab.com/inkscape/inkscape/issues/399
2019-09-01Update internal extensions for latest .inx format changesPatrick Storz55-750/+750
2019-09-01Add appearance="multiline" to parameters of type stringPatrick Storz5-13/+102
Renders a Gtk::TextView that automatically fills the available space in the extension's preferences dialog and can be used to accept longer multi-line strings. Newlines in the string value will be passed as "\\n" to the extension script (i.e. literal '\n' with the backspace escaped).
2019-09-01Add appearance="colorbutton" to parameters of type colorPatrick Storz3-14/+69
Renders a simple Gtk::ColorButton with label instead of the full ColorNotebook which is too large for many applications. Should likely be re-implemented bringing up a new Dialog that wraps an Inkscape::UI::Widget::ColorNotebook eventually, instead of relying on the Gtk::ColorButton's picker implementation which is inconsistent to existing pickers.
2019-08-31Add new parameter of type "path"Patrick Storz4-0/+362
* Similar to parameter's of type "string": Has a text entry and stores a string preference * Additionally offers a button to show a file chooser dialog * The node's content is the initial (default) file path. * Relative paths will be considered relative to the extension's .inx file. This allows to reference files/folders shipped with the extension in a portable way. The stored value as well as the parameter value passed to the script interpreter will always be absolute, though. * The attribute "mode" controls what type(s) of paths the file chooser allows to select. Valid values: - 'file', 'files', 'folder', 'folder' (pick existing items) - 'file_new', 'folder_new' (create a new file/folder) * Note that manually entered values will be passed as-is without checking for existence.
2019-08-31Adjust <print> extensions for previous commit.Patrick Storz3-48/+48
(No idea what they do tbh, but I've never seen any of those parameters, so they likely *are* hidden in some way or another)
2019-08-31Make 'gui-text' required for visible parametersPatrick Storz4-30/+41
We were actually crashing for visible parameters without 'gui-text' otherwise. Also make sure we actually *do* bail out if we have parameters missing required fields and throw/catch an exception instead of producing broken instances.
2019-08-31Add new widget "image" which allows to display an image filePatrick Storz4-1/+155
* The node's content is the file path. Absolute paths should work, the preferred way is to specify a relative path, though, which will be interpreted relatively to the .inx file's location * The attributes "width/height" allows to override the native size of the image.
2019-08-31Add base_directory for extensions loaded from a file.Patrick Storz13-44/+57
2019-08-31Add new widget "spacer" which adds an empty space between widgetsPatrick Storz6-1/+138
The attribute "size" allows to define the spacing in px. The special value "expand" can be used to make the spacer consume all available space in the parent.
2019-08-31Add new widget "separator" which draws a line between widgetsPatrick Storz4-1/+101
2019-08-31Add new widgets "hbox" and "vbox" for layouting purposesPatrick Storz6-8/+188
2019-08-31Simplify pref_name() functionPatrick Storz9-57/+23
2019-08-31Make sure we have get_widget()Patrick Storz2-2/+5
2019-08-31Remove completely unused "doc" and "node" parametersPatrick Storz23-315/+195
2019-08-31Re-implement get_param() locally using get_widgets()Patrick Storz8-116/+59
2019-08-31Inherit destructor and recursively delete all widgetsPatrick Storz4-18/+5
let's hope this works as expected...
2019-08-31Complete conversion of ParamNotebook to use _childrenPatrick Storz2-14/+26
2019-08-31Make parameter string generation a job of Inkscape::ExtensionPatrick Storz7-94/+77
For this take a first step towards properly tracking children of each parameter and provide functions to look up all widgets.
2019-08-31Accept parameter type "bool"Patrick Storz1-1/+1
Seems more consistent with "int" and "float" types and should likely be preferred over the old "boolean"
2019-08-31Parameter float: add note regarding rounding issuePatrick Storz1-0/+3
2019-08-31Optimize parameter string generationPatrick Storz17-76/+66
Also rename overloaded string() functions, so it's clear what they actually do, as it's not the same thing at all...