First of all: sorry to all translators who started working on these new
strings!
We use CamelCase for our titles, and in particular "Plug-In" is
capitalized with 'I'.
Furthermore, let's use understandable titles like "Plug-In Example in C"
and not just "In C", because while the short title works OK in the menu,
it makes for very broken action names in non-contextual parts of the
software, such as the action search.
Note that we in fact have a concept of short label for actions since
commit 89772351c9. I added support for it to GEGL actions (cf. commit
6dc5f6792e), and to a few core actions (e.g. commit ea1205f094).
Unfortunately I don't think I added an API yet for short label in
plug-ins. Maybe I'll add it soon. But for now, if we have to have a
single label, it should be long, so that it works in every situation.
P.S.: not sure if it's useful to keep documentation strings just
repeating the title, but for now, let's leave them.
Since it will be distributed in a release.
Only translate the menu item and help.
Not translate dialog labels, they will only be read by plugin authors.
Revise the tests that can't default the args.
Actual args default to the min value formal declared in the PDB.
The declared min value must correspond with declaration in GEGL.
vector(s) => path(s)
layer-group => group-layer
Add a few tests.
(script-fu-use-v3) in more tests, code becomes more terse.
Added some aliases in script-fu-compat.c for renamed procedures, for compatibility third party.
...to path.
Changes the names of
gimp_vectors_* () API to
gimp_path[s]_* (). Renames related files
to [path] instead of [vectors], along with
relevant enums and functions.
This commit renames the GimpVectors
object to GimpPath in both app/core and
in libgimp. It also renames the files
to gimppath.[ch] and updates the relevant
build and translation files.
There are still outstanding gimp_vectors_* ()
functions on the app side that need to be renamed
in a subsequent commit.
Same for gimp_procedure_add_aux_argument() and gimp_procedure_add_return_value().
We now have specific public functions for every supported type and it's
in fact much better to use them. The generic functions gave the feeling
that we could use any GParamSpec as procedure argument, whereas we in
fact depend on what the PDB support, and only these subtypes.
With the new API introduced int d1c4457f,
we next need to port all plug-ins using
the argument macros to functions.
This will allow us to remove the macros
as part of the 3.0 API clean-up.
Resolves#10609
Continuing from 1759174d, this patch
removes the on-canvas restrictions for
guides from the New Guide dialogue and
the Measure Tool's guide creation feature.
Formerly, closing a port cleared all the attribute bits.
Then the port was not disposed of properly (leaked memory)
when the port was garbage collected.
Now, closing a port only clears the direction bits.
The kind of port is still known for a closed port.
Add test script for file port methods of Scheme.
This benefits script authors and testers of ScriptFu.
Now a call to (display "foo") in a plugin goes to the terminal where GIMP started.
Whether interactive or in batch mode.
Make TS errors go to an error port instead of the output port.
Tool plugins: Console, Eval, Server get error messages from the error port.
TextConsole not changed. Tools behave per new doc "ScriptFu Tools" at dev web site.
Driveby fix of SF Server: send whole message instead of byte by byte.
Driveby comments and more semantic checking of set-output-port in TS.
Add test plugin test-display.scm
Move test plugins from /scripts to /scripts/test.
POTFILES.skip that directory.
Add a readme to scripts dir.
Revise readme in scripts/test
Rename test9.scm which tests the new byte type support in Scheme.
Install it in unstable build, it is an important test,
long and sophisticated.
Install contactsheet.scm as a test plugin in unstable build.
See test/meson.build for comments about its issue.
Formerly, both Clothify and "Clothify v3" are installed
in menu Filters>Artistic.
They are duplicates.
Clothify is the original using the old-style, homegrown interface.
"Clothify v3" is new-style, GimpProcedureDialog interface.
Both are marked for translation.
Only Clothify (v2) is translated (in potfiles.in)
"Clothify v3" is not translated (in potfiles.skip)
This commit does not break string freeze.
Moves "Clothify v3" to Demos menu.
It only installs in an unstable build.
The new is installed in unstable only for comparison with the old.
FUTURE: when no string freeze:
Swap the new and the old.
Move "Clothify v3" clothify-v3.scm to potfiles.in
and move "Clothify" clothify.scm to potfiles.skip.
Swap the menu items, so the user doesn't see "v3."
Only affects unstable build.
Move remaining items to Demos.
They have names like "Test foo."
They only install on an unstable build.
The ScriptFu>Test menu is only in an unstable release.
It is untranslated.
The ScriptFu menus don't need to be so deep.
The Demos menu is an appropriate place for test plugins.
If the Demos menu is not in the stable release and translated,
Gimp creates the Demos menu and it is untranslated.
The "Sphere" plugin demonstrate all the widgets for arguments of a plugin.
Only its menu label is translated.
The "Hello World" plugin demonstrates an independently interpreted SF plugin.
It has no translations, even of its menu label.
Formerly in ..ScriptFu>Test menu.
They still are installed even in a stable release.
If we don't want 3.0 stable to ship with demos,
need more changes to meson.build.
They are akin to the goat exercise plugins.
These plugins are expected to ship with the goat plugins in a stable build.
!!! But 2.10 did not ship with any demo plugins in stable build.
There are duplicate "Sphere" (v2) and "Sphere v3" plugins.
Does not break string freeze.
The new-style "Sphere v3" plugin moves to Demos.
It will be installed with stable build.
No translations will change.
"Sphere" (v2) will only be installed in an unstable build.
FUTURE: we should translate Hello World and Sphere v3.
If they are to ship as demos, their GUI should be translated.
FUTURE: low priority we could rename "Sphere v3" to just Sphere,
and Sphere to "Sphere v2" so there is no conflict.
Fix ScriptFu, CRITICAL handling filename args user-entered in old-style interface.
Fix plugin, changes to API re Resource i.e. Palette and Colormap
Add message giving mangled name of output file.
Driveby minor refactoring of plugin.
Driveby cleanup, remove old email addresses.
Driveby use script-fu-use-v3 binding to PDB.
Fix tests broken by changes to gimp_data, wilber.png=>gimp-logo.png
Uncomment failing tests whose issue was fixed.
Remove calls to deprecated functions.
Make more test files use v3 binding script-fu-use-v3
Compare floats relatively by epsilon.
Add some missing tests.
New functions with the same name as these functions are created, except without
the length argument (i.e. it's equivalent to calling these with -1).
The reason for this is that using strings with a length variant which may be
negative to switch to NUL-terminated strings are not bindable. At least in our
case, when testing in Python, the input string ended up as corrupted garbage and
GObject Introspection docs warns about such interfaces:
> In particular, avoid functions taking a const char * with a signed length that
> can be set to a negative value to let the function compute the string length
> in bytes. These functions are hard to bind, and require manual overrides.
(see: https://gi.readthedocs.io/en/latest/writingbindableapis.html#strings)
So instead, I create a simple version which runs on NUL-terminated strings only
and which is bound, whereas unbinding the generic length-version (making it
C-only, or maybe usable in some other bindings which ignore the (skip)
annotation; apparently some do this).
This fixes:
> plug-ins/script-fu/script-fu-refresh.c:70:1: warning: no previous declaration for ‘script_fu_register_refresh_procedure’ [-Wmissing-declarations]
This is meant to obsolete GeglParamColor with at least an additional argument
has_alpha which we need in GIMP. It allows to advertize when a parameter wants
an opaque color, which in particular means we know when displaying a GUI to pick
colors with alpha or not.
There are no plug-ins which uses GimpRGB for procedure argument, nor is there
any base PDB procedure. We don't pass this type anymore through from/to
core/plug-ins. So let's clean the whole code out as a next step to get rid of
GimpRGB from our codebase!
Resolves#11354
Due to improvements in the text API, we have to pass a GimpFont
object as the last parameter of gimp-text-get-extents-font rather
than just a String.
Resolves#10932
Since GIMP distinguishes between saving
XCF and exporting image like PNG,
we should change the PDB to show
export rather than save in the function
calls.
Fixes 2 such warnings:
> warning: format ‘%i’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
As well as:
> warning: conversion lacks type at end of format [-Wformat=]
And:
> warning: no previous declaration for ‘reset_output_port_struct’ [-Wmissing-declarations]
Fix unreported issue that new-style dialog using GimpProcedureDialog
does not display progress.
Change progress reporting to use app's status bar, for all scripts,
old and new style.
As before, report progress whenever a script calls a PDB procedure,
by putting the procedure name in the status bar.
Eliminate progress bar widget from old-style script dialog.
Since it was failing on Wayland, and since it is inconsitent
with new style dialog using GimpProcedureDialog.
It is broken and throws critical, see #10596.
Expedient to hide it instead of fixing it, to not block 3.0rc1.
As discussed in #10652, a user can simply restart GIMP instead.
"Refresh Scripts" is a poor design, a bandaid.
There are plans for better alternatives to install/remove scripts.
The MR for #10652 shows the reason it throws critical,
and could fix it,
but completing the MR requires time we don't have.
Note the MR is not on these files, but on core plugin machinery.
The change is to extract functions to a separate file,
and still build them, but not call them or link them.
They also are not translated while not being called.
Eventually, the extracted files can be deleted (or restored when they work.)
There is other related cruft that needs deletion in scheme-wrapper.c.
Add canonical/idiomatic functions call-with-output-string,
call-with-input-string, any->string to the library init.scm.
Since they are useful, especially in test scripts and frameworks.
Remove their definitions from test scripts and test frameworks.
Also comment out failing test in test script string-escape.scm.
Redefine call-with-output-string etc. in the test script: test9.scm
Other fixes to the test script.
Improve logging of no memory condition for string-ports
Fix bug freeing ports that have been closed.
When ports are closed, string-port code was treating them as string-ports.
Fix#11040 and #9495 bugs with unicode in string-ports
Fix other unreported bugs with allocations and garbage collection of string-ports.
Obsolete open-input-output-string, a string port of kind input-ouput is no longer supported
and the function actually opens a string-port of kind input which cannot be written.
Comments and Gimp style in the original TinyScheme code, now in string-port.c
Revise tests of string-port.
Update TinyScheme README: Discuss more thoroughly the ancestry, and changes from upstream.
Extract pseudo class string-port methods to separate file.
No functional changes intended.
Style changes not complete: anticipate further bug fixes and styling.
Now the development and stable logos will be generated from gimp-data.
In other changes, the gi-docgen logo is installed as a symlink using
install_symlink() which exists since meson 0.61.0 so I bumped our meson
dependency (in practice we were already using this function anyway and Debian
bookworm has meson 1.0.1 so it's all good).
Finally I don't install a wilber.png anymore, which was only used by script-fu
testing, and which was the same as gimp-logo.png (except 256x256 instead of
128x128). Unless mistaken, all script-fu tests loading this image still work
with the change. The only one where I needed further change was buffer.scm
(which was checking the dimensions).
See gimp-data@9aa6e35.
More descriptive name for script-fu-interface-dialog
Delete SF flag for gimp_ui_init already called: gimp_ui_init can be called often.
FUTURE: might be faster to call just gegl_init when mode is non-interactive.
Without this, there is no easy way to quietly check for existence of a resource by name.
Needed when plugin authors can name defaults for resource args by name.
Add tests to script-fu/test/tests