Commit graph

28 commits

Author SHA1 Message Date
lloyd konneker
e56f2b1c54 ScriptFu: show and hide Dock icon for extension-script-fu
Makes the Dock icon only appear when a script plugin has a dialog.
Unfortunately, on MacOS where "transient for" doesn't work,
we need a Dock icon for the separate process so user can "Show window."
See #12150

Done at runtime.
A build-time alternative is: package script-fu binary in a bundle, and set properties.

Fixes both the new-style dialog (GimpProcedureDialog) and the old-style dialog (deprecated.)
2024-12-17 15:18:50 +00:00
lloyd konneker
0b72b028e8 ScriptFu: fix #12157 old-style dialog slider default 0 instead of declared value
This seems like a hack.
A better fix might be in the gimp_scale_entry widget.
2024-10-18 15:33:44 -04:00
Jehan
bd287d6f89 libgimp, plug-ins: variosu gimp_*_chooser_new() should use specific type…
… for default value.

Don't use the generic GimpResource which implies that we could set any
GimpResource (which of course makes no sense).
2024-09-29 12:27:49 +02:00
lloyd konneker
4ffc99b75d ScriptFu: fix 8463 obsolete SF-VALUE
Any third-party scripts using SF-VALUE will need porting.
2024-09-27 06:41:29 -04:00
lloyd konneker
d7f9c5e57e Fix #12044 broken build gcc14 incompatible pointers 2024-09-17 14:12:21 -04:00
lloyd konneker
15ae108150 ScriptFu: fix defaults for script args of type Resource
Script authors declare defaults by name strings.
Which can be valid name, or empty string, or "from context".

ScriptFu declares formal arguments to the PDB,
either with a default GimpResource, or defaulting dynamically from context.

Works with both new-style dialogs (ProcedureDialog and ProcedureConfig)
or with old-style dialog (script-fu-interface.c)
2024-09-17 12:06:37 +00:00
Alx Sa
2e6938b3da app: Rename app/core GimpVectors vectors API...
...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.
2024-07-13 05:07:57 +00:00
bootchk
20b19b960e ScriptFu: fix #10307 plugin call display not effective
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
2024-04-25 12:51:00 +00:00
Jehan
d51cde85c1 plug-ins: script-fu is now GimpRGB-free. 2024-04-20 12:06:41 +02:00
bootchk
9a2de135ee ScriptFu: fix #10698 and other issues with script progress
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.
2024-04-08 11:27:13 -04:00
bootchk
59b6c8fc8f ScriptFu: fix 11077: call gimp_ui_init in every run_func
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.
2024-03-20 11:35:48 +00:00
bootchk
f7c876dfd3 2.99 ScriptFu: refactor, extract methods of color and resource
Extract methods related to color into new file.
So method names document what is being done.
So related code is together.

Ditto for resource.

No functional change.

Preparing for changes to reset/default and changes to representation of pixels
in lists of differing lengths rgb vs rgba.
2024-03-06 08:07:11 -05:00
Jehan
916d032f67 app, libgimp*, plug-ins: GimpColorButton now space-invaded.
The invasion extended to some core widgets too, in particular GimpColorPanel (a
subclass of GimpColorButton). There was quite a lot of code depending on these
widgets.
2024-02-11 23:28:03 +01:00
Jacob Boerema
cc3f4c45c5 plug-ins, libscriptfu: silence warnings
We remove two warnings:
1. warning: format '%ld' expects argument of type 'long int', but
   argument 5 has type 'GType' {aka 'long long unsigned int'}
Since GType is gsize, and this is not used in translations, use format
specifier G_GSIZE_FORMAT.

2. warning: enumeration value 'SF_IMAGE' not handled in switch (and more
   similar ones).
Add a default block to let the compiler know we handle all values.
2023-11-27 13:10:22 -05:00
bootchk
355f665403 Fix 10170
Changes only to ScriptFu.

The third term (the default) of a SF-FONT etc. spec is now ignored.

Test case is SF>Test>Sphere.  There are still crashing issues
related but separate.
2023-10-19 16:37:05 +00:00
Jehan
bdcd9cd38a libgimp, plug-ins: let's just call gegl_init() in gimp_ui_init().
bootchk had the case in commit 6781a35668. I again had it with gfig. I think it
just makes sense to init GEGL, especially as the errors are not that explicit
and that the plug-in code may not even call GEGL code directly (so it makes it
harder to guess).
2023-10-05 22:36:40 +02:00
bootchk
6781a35668 Fix 10115 SF interface call gegl_init
Resource chooser widgets recently changed to use gegl.
2023-10-05 07:37:15 -04:00
Jehan
62a3889617 libgimp: rename Gimp*SelectButton widgets to Gimp*Chooser.
This name was really irking me because it's not a button (anymore? Maybe it used
to be just a button). Depending on the specific widget, it will have several
sub-widgets, including a label. And it can theoretically even be something else
than a button.

So let's just rename these widgets with the more generic "chooser" name.
2023-10-01 21:02:33 +02:00
Jehan
ead5d01d27 libgimp*, plug-ins: reorganize the resource property choosers.
- Move the property widget functions for GimpResource properties into a new
  libgimp/gimppropwidgets.[ch] file. This mirrors the files
  libgimpwidgets/gimppropwidgets.[ch] which are for more generic property types.
- Rename the functions gimp_prop_chooser_*_new() to gimp_prop_*_chooser_new().
- gimp_prop_chooser_factory() doesn't need to be public.
- Add a label to GimpResourceSelectButton, make so that the
  gimp_prop_chooser_*_new() functions set the property nick to this label and
  add this label to the size group in GimpProcedureDialog.
2023-10-01 21:02:33 +02:00
Jehan
b578fd8cf1 app, libgimp, plug-ins: a lot of cleanup in GimpResourceSelect* code.
- Removing useless or redundant code.
- Simplifying various logics.
- Using GimpResource directly in temporary PDB procedures, not resource names.
- Better cleanup of the core resource chooser when the plug-in dialog quits (we
  need it to ask core to close also any visible resource chooser dialog).
- Replace the "Close" button by more common OK/Cancel. In particular, the
  GimpPdbDialog now properly keeps track of the initial object and when hitting
  "Cancel" (or Escape key), this initial object is set back.
- Clean up some of the comments, especially when the code is self explanatory.

There is still much more to clean and improve, but it's a first welcome step.
2023-10-01 21:02:33 +02:00
bootchk
8c3d3a5247 Enhance #9532 elide "Script-Fu" from SF plugin dialog title 2023-08-20 20:44:04 +00:00
Michael Natterer
5acdaac8e0 libgimp: remove getters and setters from GimpResourceSelectButton subclasses 2023-05-31 17:18:19 +02:00
Michael Natterer
9638102418 Introduce a global ID space for GimpData/GimpResource objects
Much like for images and items. Change the PDB to transmit IDs
instead of names for brush, pattern etc. and refactor a whole
lot of libgimp code to deal with it.

	modified:   libgimp/gimpplugin-private.h
2023-05-31 16:12:04 +02:00
lloyd konneker
e00f2d7f50 Fix plugins to use new GimpResource. 2023-01-14 17:43:26 +01:00
lloyd konneker
d59a7af38c libgimp: API refactor GUI for GimpResource
Simplifies chooser widgets (e.g. GimpBrushSelect) by eliminating attributes (e.g. opacity) of chosen resource.
See #8745, but this commit fixes that by first refactoring the code.

Refactors GUI widgets (e.g. GimpBrushSelectButton and GimpBrushSelect etc.)

Refactor by "Extract class" GimpResourceSelectButton from GimpBrushSelectButton etc.
This moves common code into an inherited class (formerly called GimpSelectButton)
but the subclasses still exist.
The subclasses mainly just do drawing now.

Refactor by "Extract module" GimpResourceSelect from GimpBrushSelect etc.
Moves common code into one file, generic at runtime on type of GimpResource,
that is, the new code dispatches on type i.e. switch statements.
In the future, when core is changed some of that can be deleted.
The files gimpbrushselect.[c,h] etc. are deleted.
The module adapts the API from core to the API of callbacks to libgimp.

Note that core is running the resource chooser (select) widgets remotely.
Core is still calling back over the wire via PDB with more attributes
than necessary.
The new design gets the attributes from the resource themselves,
instead of receiving them from core callback.
The libgimp side adapts by discarding unneeded attributes.
In the future, core (running choosers for plugins) can be simplified also.

Fix gimp_prop_chooser_brush_new same as other resources.

Finish changes, and clean style.

Annotations
2023-01-14 16:38:40 +00:00
lloyd konneker
7708c3fec3 Issue #8744: refactor overdependence on gimpui.h
To reduce compiling due to changes in libgimpui.
2022-10-15 15:17:08 +00:00
lloyd konneker
12c0c18036 ScriptFu: script-fu-register-filter for GimpImageProcedure.
Resolves #8382

Also v2 scripts infer and set sensitivity to drawables

Add two test plugins clothify-v3.scm and test-sphere-v3.scm.
Temporary, to be removed when 3.0 ships.

Some refactoring (extracting methods, moving functions to new files).

Some drive-by fixes to script-fu-arg.c revealed by using GimpProcedureDialog.
2022-08-02 07:45:35 +00:00
lloyd konneker
5cc3becf16 ScriptFu: build shared libgimp-scriptfu-3.0.so separate from executable script-fu
Changes are mostly to the dir structures and build system for ScriptFu.
Some changes to the outer plugin source to call the library.

Why: so that other executables (future gimp-scheme-interpreter,
or a future separated script-fu-server) can exist in separate directories,
and share the library in memory (when built shared.)

Whether the library is built shared and installed on its own
(versus static and not installed)
is a compile time option (both automake LibTool and meson abstract it away)
The default is shared and installed, say as libgimp-scriptfu-3.0.so.

Installed alongside other shared libraries (e.g. wherever libgimp is installed)
to simplify packaging.

A preliminary refactoring which helps enable MR gimp!647
2022-06-11 08:58:30 -04:00
Renamed from plug-ins/script-fu/script-fu-interface.c (Browse further)