Commit Graph

208 Commits

Author SHA1 Message Date
Alx Sa 4bf5dc7b97 plug-ins: Port argument macros to functions
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.
2024-06-13 23:17:48 +00:00
Jehan a78c41d2a3 meson: on macOS temporarily update rpath to find libraries of non-installed GIMP.
The DYLD_LIBRARY_PATH trick was working fine on CI, but not on local builds for
Lukas. Apparently there are security measures disabling the environment
variable. Instead let's temporarily add then remove libgimp libraries folders
from rpath.

See: https://gitlab.gnome.org/Infrastructure/gimp-macos-build/-/merge_requests/292#note_2075291
2024-04-16 17:43:15 +00:00
Alx Sa 437cb6b366 plug-ins: Use correct colormap in Flame
Resolves #11292

Since the GimpProcedureDialog port, the "settings-data"
parameter has been used to save and load the selected
color map. However, the parameter was not being updated
when the user switched colormaps in the GUI - therefore, it
always used the "Custom Gradient" option.
This patch updates the "settings-data" parameter after the
change to resolve the issue.
2024-04-13 22:42:01 +00:00
Alx Sa 1f2ce6fe58 plug-ins: Fix Flame crash on interactive run
Resolves #11283

In the GUI, set_flame_preview () is connected to GimpProcedureConfig's
"notify" signal. However it is not disconnected afterwards, so it runs again
after the plug-in is finished and the "setting-data" parameter is updated.
Since the preview area no longer exists, this causes a crash.
This patch resolves the issue by storing the callback ID and then disconnecting
after the GUI is closed.
2024-04-13 17:23:45 +00:00
Anders Jonsson 3f0120578d plug-ins: fix duplicate Brightness labels in Flame 2024-04-13 14:37:19 +00:00
Anders Jonsson bdf0d88456 app, plug-ins: mark missing strings as translatable 2023-12-13 17:44:35 +00:00
Jehan 3352fb8639 plug-ins: port flame to GimpProcedureDialog.
I added a bunch of arguments, in particular nearly all the settings in the main
dialog, except for "Colormap" as I'm unsure yet how to handle it. It looks like
a mix of GimpChoice and GimpDrawable. I guess it could just be both (2 args,
using values from the GimpChoice if GimpDrawable arg is NULL).

And I didn't make the settings in the "Edit Flame" dialog into arguments as I'm
not sure if the "Speed" and "Variation" in particular should be args, or are
just temporary args only meant to construct a flame (in particular, it looks
like it builds data defining the flame?). These data should be their own args
probably?

Maybe we could also have the "file" as alternative way to init the flame data
(the "Open" button)?

For now, I'm just storing the whole settings struct as an aux argument, so that
"Load/Save Settings" work, as well as the initial values from previous run.

Also the whole code is still a bit of a mess. I feel like we could really
simplify a lot of the code, all these values stored globally or duplicated now
in both the GimpProcedureConfig and the control_point structure.
2023-10-23 17:07:09 +02:00
Jehan bf8ee69570 plug-ins: fix some broken macros with a massive search-and-replace.
If we leave a space between the macro name and opening parenthese for argument
lists, the args are not considered macro args (which will be discovered when
using it). I experienced this issue while testing code on some plug-in
yesterday, so thought I might as well fix all these broken macros for casting to
the specific GimpPlugIn subclass, so that we won't have a next time.
2023-10-18 18:29:37 +02:00
Jehan 1d50c81130 libgimp, plug-ins, extensions: gimp_image_procedure_new2() renamed gimp_image_procedure_new(). 2023-10-01 21:02:34 +02:00
Jehan 3c658789a6 plug-ins: now port to gimp_image_procedure_new2() all plug-ins without args. 2023-10-01 20:52:01 +02:00
Michael Natterer 26dce72d2c Remove autotools 2023-05-27 00:03:52 +02:00
lloyd konneker e00f2d7f50 Fix plugins to use new GimpResource. 2023-01-14 17:43:26 +01:00
Jacob Boerema 981979bb39 plug-ins: improve security in flame plug-in
- Use g_malloc* functions instead of malloc, so we don't continue on
failed allocations unless we test for NULL.
- Make sure we don't iterate past the known number of control points (ncps).
- Safely allocate, initialize and free points. Since points seems to be
used uninitialized, we use g_malloc0 to set everything to 0.
2022-11-08 16:57:04 -05:00
Jacob Boerema 89c83ef4c7 plug-ins: fix crash when reading corrupt flame settings file
Thanks to a report by Stefan Cornelius, we became aware that the flame
plug-in does no checking for correct input when loading a pre-saved
settings file.

I reworked the parser to read one or more values based on the type of
token, making sure we also don't read past the end of our token buffer.

All int values have a min and max value set. If any unexpected input is
encountered, we will give a warning.
2022-10-31 14:22:44 -04:00
Jacob Boerema 536c7cbc4b plug-ins: fix missing input buffer length checking in flame
The flame plug-in can read stored settings from a file. The expected
input is that a ; signifies the end of input.

However, with user input we cannot depend on this to be true, so we need
to make sure that we do not read past the end of our input buffer.
To do so, we add a length check.
2022-10-31 14:00:54 -04:00
Jacob Boerema 193596397e plug-ins: fix failure to load flame saved settings from file
We were using the plug-in name with underscores, which is incorrect.
Since nobody ever complained about this, this doesn't seem to be used
very often.

We will use the const that defines the plug-in name instead.
2022-10-31 13:57:14 -04:00
Jehan ca230cb770 meson: fix warnings of deprecated features.
Now that we bumped our meson requirement, meson is complaining about
several features now deprecated even in the minimum required meson
version:

s/meson.source_root/meson.project_source_root/ to fix:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.56.0': meson.source_root. use meson.project_source_root() or meson.global_source_root() instead.

s/meson.build_root/meson.project_build_root/ to fix:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.56.0': meson.build_root. use meson.project_build_root() or meson.global_build_root() instead.

Fixing using path() on xdg_email and python ExternalProgram variables:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.55.0': ExternalProgram.path. use ExternalProgram.full_path() instead

s/get_pkgconfig_variable *(\([^)]*\))/get_variable(pkgconfig: \1)/ to
fix:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.56.0': dependency.get_pkgconfig_variable. use dependency.get_variable(pkgconfig : ...) instead
2022-08-31 01:29:37 +02:00
Jehan df074bfe09 plug-ins: label and documentation of plug-ins localized plug-in side.
This is the consequence of previous commit. Plug-ins' label and
documentation are now localized before sending these data to GIMP core.
In other words, we replace N_() macros with basic gettext calls.
2022-07-05 12:23:51 +02:00
Jehan 18c37f7084 plug-ins, libgimp: override set_i18n() for all our core plug-ins.
Hence avoiding the stderr messages. These are going to be localized with
centrally installed catalogs "gimp*-std-plugins", "gimp*-script-fu" and
"gimp*-python".

We now handle core plug-in localizations differently and in particular,
with kind of a reverse logic:

- We don't consider "gimp*-std-plugins" to be the default catalog
  anymore. It made sense in the old world where we would consider the
  core plug-ins to be the most important and numerous ones. But we want
  to push a world where people are even more encouraged to develop their
  own plug-ins. These won't use the standard catalog anymore (because
  there are nearly no reasons that the strings are the same, it's only a
  confusing logic). So let's explicitly set the standard catalogs with
  DEFINE_STD_SET_I18N macro (which maps to a different catalog for
  script-fu plug-ins).
- Doing something similar for Python plug-ins which have again their own
  catalog.
- Getting rid of the INIT_I18N macro since now all the locale domain
  binding is done automatically by libgimp when using the set_i18n()
  method infrastructure.
2022-06-05 01:57:02 +02:00
Jehan ca8bc2bc1d app, libgimp, pdb, plug-ins: more functions moved to get|set().
The gimp_drawable_type() is an issue though as gimp_drawable_get_type()
is already defined as a common GObject API.
Though I'm actually wondering if GimpImageType is well called. Rather
than Type, shouldn't we go with ColorModel?

sed -i 's/\<gimp_drawable_bpp\>/gimp_drawable_get_bpp/g' "$@"
sed -i 's/\<gimp_drawable_width\>/gimp_drawable_get_width/g' "$@"
sed -i 's/\<gimp_drawable_height\>/gimp_drawable_get_height/g' "$@"
sed -i 's/\<gimp_drawable_offsets\>/gimp_drawable_get_offsets/g' "$@"
2021-04-06 14:34:31 +02:00
Jehan 79e608694e plug-ins: fix many GimpImageProcedure to new run() API.
No logics change so far.
2021-04-04 01:40:00 +02:00
Jehan d95f417719 app, libgimpwidgets, modules, plug-ins: code changes after GimpScaleEntry…
… reclassing as GimpLabelSpin subclass.
2020-11-05 18:06:52 +01:00
Jehan b3c0ba061b app, libgimpwidgets, modules, plug-ins: finishing GimpScaleEntry port.
Renaming the temporary function gimp_scale_entry_new2() into
gimp_scale_entry_new() now that the original code is entirely gone. This
is now a fully-fledged widget with a nice and proper introspectable API.
2020-11-01 02:46:20 +01:00
Jehan 7ebd19636c plug-ins, modules: more port to GimpScaleEntry. 2020-10-31 02:07:35 +01:00
Niels De Graef ae34e778fc meson: Use libgimp(ui)_dep in plug-ins meson files
This gives a big cleanup in the meson.build files of the plug-ins.

It's also quite a bit more maintainable, since anything that changes in
libgimp's dependencies, linkage, ... doesn't have to be copy-pasted into
each plug-in.
2020-05-11 07:01:37 +02:00
Michael Natterer df8d5b02ae libgimp, plug-ins: remove the "preview" parameter from gimp_ui_init()
It's dead since a looong time.
2019-09-20 19:56:00 +02:00
Félix Piédallu 65eff6f150 Meson port. 2019-09-11 16:42:04 +02:00
Michael Natterer 45d60acb65 plug-ins: use the new item-type specific get_by_id() functions 2019-09-03 10:48:32 +02:00
Michael Natterer 7fe136c638 plug-ins: port flame to GimpPlugIn 2019-08-31 14:42:33 +02:00
Michael Natterer b407d33259 plug-ins: port flame to libgimp objects 2019-08-30 18:00:44 +02:00
Michael Natterer 8a78203aed Properly prefix the values of enum GimpPDBProcType
to be GIMP_PDB_PROC_TYPE_PLUGIN, _EXTENSION etc.
2019-08-30 12:52:28 +02:00
Jehan e0d50aa121 plug-ins: keep building all plug-ins with old API.
Build existing plug-ins with -DGIMP_DEPRECATED_REPLACE_NEW_API.
We will port the plug-ins one at a time to the new GimpImage API.
2019-08-22 15:54:36 +02:00
Michael Natterer 169f98f915 libgimpwidgets: add GDestroyNotify to gimp_int_combo_box_connect() 2019-08-08 00:22:15 +02:00
Michael Natterer c6bcb3114f libgimp: add GDestroyNotify for image and item combo box data 2019-08-07 23:16:25 +02:00
Michael Natterer be411a58a7 plug-ins: port flame to GEGL, 8-bit only 2019-06-28 12:37:26 +02:00
Michael Natterer 6bb8c74a46 plug-ins: kill GtkAlignment in all plug-ins which are currently built 2018-10-22 14:47:54 +02:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Jehan 870ca6334d plug-ins: install plug-ins in subfolder.
I am going to forbid plug-ins from being installed directly in the root
of the plug-ins/ directory. They will have to be installed in a
subdirectory named the same as the entry point binary.
This may seem useless for our core plug-ins which are nearly all
self-contained in single binaries, but this is actually a necessary
restriction to eliminate totally the DLL hell issue on Windows. Moving
core plug-ins in subfolders is only a necessary consequence for it.
2018-05-20 21:06:35 +02:00
Simon Budig 7d64cf62c6 libgimpwidgets: rename the _grid()-Variants of gimp_scale_entry_*
Adjust all plugins to follow accordingly.

This concludes the GtkTable'ocide.
2018-05-20 21:06:35 +02:00
Michael Natterer bdbec7941c Use the new macros from the last commit in all files
...and gone are the annoying warnings.
2018-05-20 21:06:34 +02:00
Simon Budig 0a82cd4452 flame: kill GtkTable 2018-05-20 21:06:34 +02:00
Michael Natterer 1b3135ca95 Get rid of using GtkMisc API globally 2018-05-20 21:06:30 +02:00
Michael Natterer 138a3a4bf3 plug-ins: more s/GtkObject/GtkAdjustment/ 2018-05-20 21:06:27 +02:00
luz.paz 147c09f19e Bug 795161 - Misc. typo fixes in source comments and doxygen
Found via `codespell`
Follow-up to  commit 7fdb963e01
2018-04-18 21:06:57 +02:00
Michael Natterer dda54c1df8 Deprecate stock items for good and change all icon defines to GIMP_ICON_*
Try to sort all GIMP_ICON_* defines into FDO categories like in
https://specifications.freedesktop.org/icon-naming-spec/latest/ar01s04.html

Add defines for all icons we override, rename some icons to their FDO
standard names, and mark the ones we duplicate with a comment so we
don't forget to rename those to standard names in 3.0.
2017-03-05 16:01:59 +01:00
Michael Natterer 801bd8fb3f plug-ins: get rid of icons in dialog buttons (use labels not stock IDs) 2017-02-12 16:18:54 +01:00
Richard Kreckel dd9b0fc55b Bug 768044 - Fix many typos
This fixes many typos in comments and one in a user-visible string (msgid
"center abscisse" changed to "center abscissa" in affected po files. too).
2016-06-26 00:35:24 +02:00
Michael Natterer 001a75e1d2 app, plug-ins: move Filters/Render/Nature to Filters/Render/Fractals
but keep "Nature" around for compat, it's hidden if empty.
2014-06-19 23:11:30 +02:00
Michael Natterer ec786816bb */Makefile.am: merge INCLUDES into AM_CPPFLAGS
automake-1.13 finally warns about this anachronism.
2013-06-05 20:48:37 +02:00
Michael Henning 57740d107d plug-ins: fix memory leak in flame/rect.c
Found using clang's scan-build.
2013-01-08 16:14:37 -05:00