summaryrefslogtreecommitdiffstats
path: root/src/extension/extension.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Extensions: catch parameters and translatable values with empty namePatrick Storz2019-10-191-0/+5
| | | | | | | | | | 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.
* Extensions: Implement translationdomain functionalityPatrick Storz2019-10-191-7/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Extensions: Disable effects that failed to loadPatrick Storz2019-10-151-7/+6
| | | | | | | | | | | | 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
* Extensions: Do not even attempt to register incompatible extensionsPatrick Storz2019-10-151-12/+10
| | | | | | | | This improves the fix for https://bugs.launchpad.net/inkscape/+bug/1307554 Also fixes a potential crashing issue when an .inx includes invalid XML.
* Extensions: Fix file test when checking dependencies by typePatrick Storz2019-10-151-2/+4
| | | | | | | | | | | | | | 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.
* Extensions: Switch .xslt file look-up to dependency logic as wellPatrick Storz2019-10-141-1/+8
|
* Extensions: Improve logic to lookup script extensionsPatrick Storz2019-10-141-7/+31
| | | | | | | | | | | | | | | - 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.
* Extensions: Fix filename encoding issues in error loggingPatrick Storz2019-09-261-16/+24
| | | | (std::ostream is not properly portable unfortunately)
* Add appearance="multiline" to parameters of type stringPatrick Storz2019-09-011-1/+2
| | | | | | | | | 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).
* Add base_directory for extensions loaded from a file.Patrick Storz2019-08-311-2/+7
|
* Remove completely unused "doc" and "node" parametersPatrick Storz2019-08-311-53/+27
|
* Re-implement get_param() locally using get_widgets()Patrick Storz2019-08-311-48/+45
|
* Make parameter string generation a job of Inkscape::ExtensionPatrick Storz2019-08-311-2/+19
| | | | | For this take a first step towards properly tracking children of each parameter and provide functions to look up all widgets.
* Optimize parameter string generationPatrick Storz2019-08-311-1/+1
| | | | | Also rename overloaded string() functions, so it's clear what they actually do, as it's not the same thing at all...
* cleanup includes a bitPatrick Storz2019-08-311-0/+2
|
* Switch Inkscape::Extension to use InxWidgets instead of InxParametersPatrick Storz2019-08-311-39/+54
|
* Rename Parameter -> InxParameter for consistencyPatrick Storz2019-08-311-20/+20
|
* Implement "translationdomain" attribute for extensionsPatrick Storz2019-08-311-3/+36
| | | | | | | | | | | | Will allow extensions to ship their own message catalog used for translation of the extension#s strings. Needs to be set on the root <inkscape-extension> element of the .inx Currently supported values: - unset: use default textdomain (which happens to be 'inkscape') - 'inkscape': use Inkscape's message catalog - 'none': disable translation for the extension's strings
* Properly handle extensions without id or namePatrick Storz2019-08-311-59/+58
| | | | We used to fail silently, crashing later-on.
* Refactor a lot of the parameter handling codePatrick Storz2019-08-311-152/+155
| | | | | | | Many fixes, improvements and simplifications to existing code. Implements the first part of the changes discussed in https://gitlab.com/inkscape/inkscape/issues/333
* Remove effectively unused "silent" option from extensions.Patrick Storz2019-08-311-15/+1
| | | | See also https://gitlab.com/inkscape/inkscape/merge_requests/698
* Remove unused and disabled "help" feature for extensionsPatrick Storz2019-08-311-28/+1
|
* Rename parameter source files to avoid name conflictsPatrick Storz2019-08-311-1/+1
|
* Move prefdialog to own directoryPatrick Storz2019-08-311-1/+1
|
* Replace deprecated Gtk::Misc functionsKarl Cheng2019-06-161-1/+2
|
* Rm unused code now Gtk+ >= 3.22 dependency is setAlexander Valavanis2019-05-261-4/+0
|
* Tidy various dialog UIsNathan Lee2019-04-021-6/+10
|
* modernize loopsMarc Jeanmougin2019-01-021-5/+5
|
* Clarify licensesMax Gaukler2018-11-081-1/+2
| | | | | | - add license headers to everything - convert a few files from public domain or LGPL2.1+ to GPL2+ - some archaeology to clarify which files are from which library
* Remove #include "config.h" wherever possibleEduard Braun2018-10-011-4/+0
|
* Use _WIN32 instead of WIN32Eduard Braun2018-10-011-1/+1
| | | | | | | | The former is guaranteed to be set for any compiler targeting win32, the latter is implementation dependent (but works for gcc) See also http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system
* Run clang-tidy’s modernize-redundant-void-arg pass.Emmanuel Gil Peyrot2018-06-191-16/+16
|
* Run clang-tidy’s modernize-use-nullptr pass.Emmanuel Gil Peyrot2018-06-181-24/+24
| | | | | This replaces all NULL or 0 with nullptr when assigned to or returned as a pointer.
* Revert "Fix include order with clang-tidy check llvm-include-order"Marc Jeanmougin2018-05-041-6/+6
| | | | This reverts commit bba4ff6672494fab59286b50f6c645ad62a47e60.
* Fix include order with clang-tidy check llvm-include-orderMarc Jeanmougin2018-04-291-6/+6
|
* Misc. typosluz.paz2018-01-081-2/+2
| | | Found via `codespell`
* Make script warnings transient for "Working..." dialogEduard Braun2017-12-201-0/+1
| | | | | | | | | | | This turned out to be a bit of a mess due to the interplay between the classes Script / ExecutionEnv / Effect / PrefDialog. (Basically they don't talk to each other much but all want to contribute to the GUI) Likely "Script" (and possibly "ExecutionEnv") should be refactored to let the other classes handle UI exclusively and throw errors where suitable.
* Misc. typosUnknown2017-11-071-1/+1
| | | | | | | | | | | | Found using `codespell -q 3 -w --skip="*.svg,*.po,*.ts,./share/tutorials,./src/libavoid,./packaging/win32/languages,./man,./src/2geom" -I ../inkscape-whitelist.txt` whereby whitelist file contained: ``` dum iff glight substract te upto ```
* Removed all GSList occurences in .h filesMarc Jeanmougin2017-10-011-17/+7
|
* Move directory scanners to new get_filenames(...) callsMartin Owens2017-07-021-1/+0
|
* Refactor profile directory use and promote IO::Resource get_path and ↵Martin Owens2017-06-281-1/+2
| | | | get_filename methods
* Extensions: Fixes and improvements for "gui-description" parameter attribute ↵Eduard Braun2017-04-241-1/+1
| | | | | | | | along the lines of r14955 - "gui-description" was always translated (as opposed to only "_gui-description") - Added possibility to specify "msgctxt" for "_gui-description" (bzr r15635)
* Some code refactoring for consistencyEduard Braun2017-04-091-3/+3
| | | | | (notably "gui_hidden" -> hidden", "guitext" -> "text", "desc" -> "description") (bzr r15633.1.3)
* Gtk+ 3 deprecation fixesAlex Valavanis2017-02-261-0/+4
| | | (bzr r15547)
* Extensions: Harmonize appearance and try to simplify layouting a bitEduard Braun2017-02-121-2/+4
| | | (bzr r15509)
* Extensions: Make "indent" attribute a common attribute for all parameters ↵Eduard Braun2017-02-121-15/+17
| | | | | | | | | | | | | that behaves more consistent and predictable than before. - Every "Parameter" now has an "_indent" member variable (specifying the indentation level; set in "Parameter::make()", see parameter.cpp) - Indentation is achieved by using "set_margin_left()" on the parameter's widget. This fixes bug #1662035 (comment #4 contains some more details about this patch). - Specifying "indent" on a parameter will now work consistently for all parameters. Previously the "indent" attribute often had no effect at all, e.g. for notebooks but also for parameters with 'appearance="full"' which was reasonable in most cases but made the outcome of using this attribute often unpredictable and is unnecessarily restrictive. - Most visible change: "description"s always used an indentation level of at least one (even if no indentation was specified). For the sake of consistency this discrepancy was dropped. Previous appearance can easily be restored by setting 'indent="1"'. Fixed bugs: - https://launchpad.net/bugs/1662035 (bzr r15508)
* End GTK+ 2 support and remove GDL forkAlex Valavanis2016-08-041-20/+2
|\ | | | | (bzr r15038)
| * extensions: Drop GTKMM2 fallbacksAlex Valavanis2016-07-281-20/+2
| | | | | | (bzr r15023.2.5)
* | Removed unused includes, decreased compilation time. Once againAdrian Boguszewski2016-08-031-1/+1
| | | | | | (bzr r15034)
* | Reverted changes to r15024 after many building problemsAdrian Boguszewski2016-07-281-1/+1
| | | | | | (bzr r15027)