Commit Graph

485 Commits

Author SHA1 Message Date
Alx Sa 3d54665a94 libgimpconfig: Retain color scale preferences
RGB 0..255/0..100 and LCh/HSV settings are now remembered when closing
and reopening GIMP.
A few enums were explicitly cast to GimpColorSelectorChannel to clear
some compiler warnings.
2023-01-10 00:20:22 +00:00
Jehan 75dd13981a libgimpconfig: more param spec types to ignore (GeglParamFormat). 2022-10-26 23:29:32 +02:00
Jehan e5d5be4277 Issue #8062: error when offsetting a layer. 2022-10-26 23:10:51 +02: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 ccbf3c4bb0 app, libgimp*: add various stamp files to CLEANFILES.
Fixes:

> ERROR: files left in build directory after distclean:
2022-08-01 23:34:50 +02:00
Jehan 83e465ec16 app, libgimp*: updating autotools script in sync with meson.
Generated *enums.c now have an additional stamp no-op header include
(see last 2 commits). Sync this change into the autotools generation
scripts to prevent back and forth useless generation of these files each
time we switch from one build system to another.
2022-08-01 20:00:01 +02:00
Jehan 979acaaae2 app, libgimp*: commit the newly generated *enums.c files.
They are nearly the same as initially, except that now they include an
intermediate stamp header which will be generated by the build system.

The only 2 enums which don't need these includes (and are not versioned)
are libgimp/gimpenums.c and libgimpthumb/gimpthumb-enums.c.
2022-08-01 20:00:01 +02:00
Jehan 106f2a061d Issue #8145: meson: generation of '*-enums.c' files.
Our meson build system was not properly building the enums.c file,
because they are versionned.

I did a similar trick as what I did for the pdbgen, which is that I used
a wrapper script around the existing perl script, which sets proper
options and generate a stamp file in the end (which is considered by
meson as the actual custom target, not the C file since it is generated
in the source dir).

The most important part is that the stamp file is a generated header
source (not just a random text file) which is **included** by the
generated C file. This is what will force meson to regenerate the C file
if the header is updated, **then** build using this new version, not use
an outdated versionned version (which would make for hard to diagnose
bugs), through the indirection of the intermediate stamp header.

See #4201.
See also: https://github.com/mesonbuild/meson/issues/10196#issuecomment-1080742592
2022-08-01 19:59:53 +02:00
lloyd konneker 42750c25a7 libgimpconfig: fix missing GimpChannel in gimp_config_param_spec_duplicate
Partial fix to issue 8062

Only fixing the part that I understand, that impedes enhancements to ScriptFu.
2022-07-20 23:09:55 +00:00
Jehan 3e256451e4 libgimpconfig: fix small typo. 2022-03-04 16:09:09 +01:00
Jehan 29f23c8f98 libgimp, libgimpconfig: fixing gi-docgen "qualifier fragments".
Fixing these 2 warnings in the CI which end up fatal:

WARNING: Invalid fragment for 'Gimp.Parasite': it should be struct
Serializes the object properties of @config to a [class@Parasite].
                                                 ^~~~~~~~~~~~~~~~
WARNING: Invalid fragment for 'GLib.MainLoop': it should be struct
it has a GUI and is hanging around in a [class@GLib.MainLoop], it must call
                                        ^~~~~~~~~~~~~~~~~~~~~
2022-02-18 12:11:01 +01:00
Niels De Graef 8eb7f6df9e Remove GimpStringArray in favor of GStrv
GLib has a specific type of NULL-terminated string arrays:
`G_TYPE_STRV`, which is the `GType` of `char**` aka `GStrv`.

By using this type, we can avoid having a `GimpStringArray` which is a
bit cumbersome to use for both the C API, as well as bindings. By using
`GStrv`, we allow other languages to pass on string lists as they are
used to, while the bindings will make sure to do the right thing.

In the end, it makes the API a little bit simpler for everyone, and
reduces confusion for people who are used to working with string arrays
in other C/GLib based code (and not having 2 different types to denote
the same thing).

Related: https://gitlab.gnome.org/GNOME/gimp/-/issues/5919
2022-02-12 00:07:53 +00:00
Jehan e7a7edd29c libgimpconfig: fix gimp_config_param_spec_duplicate() for objects and…
… object arrays.

We were not supporting duplicating object pspec for no good reason. Well
maybe the reason was that libgimpconfig does not see these types which
are in libgimp. But then the trick is to compare by name.

As for object array, they are present as subtypes of GimpArray specs.
Yet most GimpParamSpec*Array-s are subclass of GimpParamSpecArray but
GimpParamSpecObjectArray are their own GParamSpecBoxed subclass (same as
the Gimp*Array-s are just typedef-s of GimpArray but GimpObjectArray is
its own boxed type).
So I had to move the object array test as its own case to fix support.

Finally do not ignore anymore any type in gimp_config_class_init(). When
we create a GimpConfig, we want to know when a type is not implemented
as parameter (and if it's a well known type, we need to implement it).
2022-02-11 17:31:30 +01:00
Jehan e6350f9459 libgimpconfig: this is the appropriate fix for the previous assert.
Since the parsing failure I was experiencing was normal (not a bug), and
since I was not seeing error being passed down to deserialize(), I
assume this assert was always wrong. I hadn't realize that the GError
object was in fact populated by deserialized through g_scanner_error()
calls which were setting the GError passed at creation of the scanner
through a handler.

So there was indeed a bug in one of the functions called by our
deserialize() implementation. There was one failure case where the error
was just reported with g_warning() instead of g_scanner_error().

Now that it's fixed, I brought back the asserts (previous commits)
because the error object is actually always well populated.
2022-02-10 22:18:03 +01:00
Jehan f4c7ea7e02 Revert "libgimp, libgimpconfig: gimp_config_deserialize_file() should not…"
This reverts commit 73c0ee8da7.

Actually I was wrong, there was a bug in gimpconfig-deserialize.c. See
coming commit.
2022-02-10 22:18:03 +01:00
Jehan 1ed8ed8223 Revert "libgimpconfig: remove more g_assert()."
This reverts commit 40bebec273.

Actually I was wrong, there was a bug in gimpconfig-deserialize.c. See
coming commits.
2022-02-10 22:18:03 +01:00
Jehan 40bebec273 libgimpconfig: remove more g_assert().
As discussed with mitch on IRC, these asserts make no sense. They can
happen if we fail to parse user-side data. Also currently deserialize()
does not even pass the GError down so we would always assert on failed
parsing.

What must be done instead if change the signature of deserialize() and
all its implementations, with a GError arg. Then this GError will
properly bubble up to the caller for appropriate handling.
2022-02-10 21:27:33 +01:00
Jehan 73c0ee8da7 libgimp, libgimpconfig: gimp_config_deserialize_file() should not…
… assert the existence of GError.

This is even worse as deserialize() method does not even take a GError
parameter anyway so this assert will always go off when a
deserialization failed (which happened in my case as I was working on a
plug-in API, hence gimp_procedure_config_load_last() actually failed to
load a previous version of the plug-in-settings when I changed a
procedure arg's type).

Just fail the deserialization normally and let the calling code handling
this case. Nevertheless it is kind of useful to bubble-up the error to
calling code, so I add a TODO in the interface header (hopefully to see
and improve this before we release GIMP 3.0).
2022-02-10 18:44:44 +01:00
Niels De Graef 0446a9025a docs: Migrate some gtk-doc comments to gi-docgen 2021-12-29 11:21:19 +01:00
Niels De Graef 5ca9a38ea4 Fix some gobject-introspection annotations 2021-12-02 12:46:05 +01:00
Jehan 49e534247a app, libgimp*, pdb, plug-ins: use g_memdup2() instead of g_memdup()
Since it appeared with GLib 2.68.0, we could not change this until we
bumped the dependency which has only become possible a few days ago
(since Debian testing is our baseline for dependency bumps). Cf.
previous commit.

As this is a drop-in replacement (just a guint parameter changed to
gsize to avoid integer overflow), search-and-replace with:

> sed -i 's/g_memdup\>/g_memdup2/g' `grep -rIl 'g_memdup\>' *`

… followed by a few manual alignment tweaks when necessary.

This gets rid of the many deprecation warnings which we had lately when
building with a recent GLib version.
2021-08-26 17:32:09 +02:00
Jehan c3e3c68a01 libgimpconfig: free a GimpValueArray on deserialization failure.
Thanks to Massimo.
2021-08-21 19:19:23 +02:00
Marie-P c112a55958 libgimp*, plug-ins: fix some warnings 2021-05-24 20:36:31 +00:00
Jehan 5d210667c5 libgimp, libgimpconfig: recognize RGB boxed args containing GimpRGB.
Still the same problem as ever with the Python binding where we have a
hard time creating GParamSpec, hence we make them from object
properties.
See: https://gitlab.gnome.org/GNOME/pygobject/-/issues/227#note_570031

But then again, the Python binding way to create GObject properties does
not seem to give us a way to use our custom param types (or I didn't
find how). So when I create a property with Gimp.RGB type in Python, it
doesn't appear as a GIMP_PARAM_SPEC_RGB to our C code, but as a
G_PARAM_SPEC_BOXED. So my trick is to check the value type instead.
Note that I check the default value, but in reality it doesn't seem to
work much either. Better than no support at all anyway.
2021-04-20 16:54:40 +02:00
Jehan 0b01b812a9 libgimpconfig: implement serializing GimpParasite into a GimpConfig.
Used for instance if a plug-in had a GimpParasite argument (or aux
argument), which might not seem too useful at first. But anyway we
propose the type, so let's support it properly.

And actually I am going to use it in the next commit as a trick to save
binary data in stored last values for a plug-in.
2021-04-06 00:14:40 +02:00
Jehan 353c73457a app, libgimp, libgimpconfig, extensions: image procedures now with…
… drawable array instead of a single drawable.

Instead of expecting a single drawable, GimpImageProcedure's run()
function will now have an array of drawable as parameter.
As a consequence, all existing plug-ins are broken again. I am going to
fix them in the next commit so that this change can be easily reviewed
and examined if needed later.

I only fix the Vala demo plug-in now (or rather, I just use the first
layer in the array for now) because otherwise the build fails.
2021-04-04 01:40:00 +02:00
Niels De Graef dffab0e9a4 Remove GimpInt16Array
It isn't being used by any plug-in or any code in GIMP at all even.
Let's get rid of it while we can still break API, so we can cut down on
all the complexity of the gimp-param stuff a bit.
2021-02-18 11:32:45 +00:00
Jehan 3e4407a315 libgimp, libgimpconfig: use gimp_parasite_get_data().
As previously do not trust that parasite contents is proper text ending
with nul character by always using the parasite size info.
2021-01-30 08:57:43 +01:00
scootergrisen df507c05ae Remove trailing spaces in 3 strings 2020-12-15 15:55:45 +00:00
Jehan 025309b0d7 app, libgimpconfig: "printer-profile" becomes "simulation-profile".
As per a FIXME for 3.0 where various mention to "print" got replaced by
a more generic notion of "simulation".
2020-10-16 19:50:19 +02:00
Jacob Boerema 71ad53ebcf libgimpconfig: fix conversion of negative int values in gimp_scanner_parse_float()
Negative int values were not correctly handled because value.v_int is unsigned
causing a conversion to a large positive value.

To fix this we cast it to gint64 first before making it negative.
2020-09-21 19:36:25 -04:00
Michael Natterer 896286279b libgimpconfig: cache the "gegl-property-keys" Quark
in gimp_config_param_spec_duplicate().
2020-06-17 21:56:31 +02:00
Michael Natterer 2e6656599d libgimpconfig: fix string deserialization for some cases
In gimp_config_deserialize_fundamental(), we can't use
g_value_set_static_string() because that will in the end pass the
GScanner's temporary scanner->value.v_string to
GObject::set_property(), and depending on set_property()'s
implementation, we might not dup the string (for example objects
created via gimp_config_type_register() will simply use g_value_copy()
and end up with a dangling pointer as a string member).
2020-06-08 22:35:42 +02:00
Niels De Graef 842dc7535f gir: (skip) functions with varargs
Bindings can't handle these, so they are not introspectable.
2020-05-21 13:49:38 +02:00
Niels De Graef 7a8a300adc gimpconfig-iface: Use G_DECLARE_INTERFACE 2020-05-10 14:45:19 +00:00
Niels De Graef 57d3837e40 gir: More missing annotations
Especially need to watch out with forgetting `(array)` and `(out)`
annotations, as they can really give a different API in certain (if not
most) bindings.
2020-05-08 16:57:45 +02:00
Niels De Graef 7f58f2d6e5 gir: Add more missing (array) and (out) annotations 2020-05-04 21:29:42 +02:00
Niels De Graef 9c9e310a67 gir: Add missing annotations
Otherwise we won't be able to generate proper API for our bindings
2020-05-04 02:11:57 +02:00
Niels De Graef 99a7d5f7dd gir: Found some more missing (out) annotations 2020-05-03 18:12:37 +02:00
Niels De Graef 52a146604b gir: Add some missing (array length) annotations
This will make sure that bindings can generate a more "native" API so
they don't have to pass the length explicitly.
2020-05-03 18:11:29 +02:00
Ell 46df3642d2 libgimpconfig: in gimp_config_type_register(), don't override GimpConfig::equal()
gimp_config_type_register() currently overrides GimpConfig::equal()
to only compare the properties of the most-derived type.  However,
this prevents the properties of GimpOperationSettings from being
considered during comparison of operation-config objects.  Instead,
don't override GimpConfig::equal(), and rely on
GIMP_CONFIG_PARAM_DONT_COMPARE to exclude specific base-class
properties from comparison.
2020-04-08 00:22:49 +03:00
Ell c5c807d191 libgimpconfig: add GIMP_CONFIG_PARAM_DONT_COMPARE flag
... which excludes a property from comparison in the default
implementation of GimpConfig::equal().
2020-04-08 00:10:42 +03:00
Ell dcea2348c6 libgimpconfig: allow calling gimp_scanner_new_string (NULL, -1, ...)
Allow calling gimp_scanner_new_string() with a NULL `text` and a
negative `text_len` (which is interpreted as 0), instead of
requiring `text_len == 0` in this case.  This allows passing a
negative `text_len` unconditionally to infer the length, even when
the string may be NULL.
2020-01-30 02:51:56 +02:00
Ell 38fff3b6b3 Issue #4172 - Gimp doesn't store negative values between sessions (Text Tool)
In gimp_config_deserialize_fundamental(), cast integer token values
to the target value type *before* negating them, to avoid
performing unsigned negation, which can result in a positive value
when cast to the target value type (in particular, when the target
value type is float/double).
2019-11-03 13:42:04 +02:00
Jehan b8d8424ae0 app, libgimp*: (meson) fix all the generated `*-enums.c`.
More of the files were wrong, or at least not absolutely identical to
the files generated by the autotools. I am not doing any code change
other than trying to make both build systems produce identical files
(except for slight differences on 2 files not worth the effort) even
though maybe some things can be improved (especially on the include
list). Maybe to be improved later.

Also fixing 2 of the previously autotools-generated files because of
space typos which should have been committed earlier.

Finally it is to be noted that there is no logics to copy the generated
files back to the source directory in the meson rules. I am not sure
anyway this is really worth it and maybe we should just stop tracking
these generated files eventually.
2019-10-19 22:32:29 +02:00
Ell 3d30a036de libgimpconfig: relax precondition check in gimp_config_type_register()
Allow passing a non-NULL `pspecs` with `n_pspecs == 0` to
gimp_config_type_register(), in particular since
g_object_class_list_properties() may return such values.
2019-09-23 18:22:19 +03:00
Michael Natterer bfe7bb1d05 libgimpconfig: fix doc typo 2019-09-21 19:02:22 +02:00
Michael Natterer dbd793d631 libgimpconfig: get rid of filenames in all config related APIs
and rename function names which say "gfile" to just "file".
2019-09-21 12:55:12 +02:00
Michael Natterer 82b11c361a libgimpconfig: add function which (de)desialize from/to a GimpParasite 2019-09-21 12:26:29 +02:00
Michael Natterer 31bf04a610 libgimpconfig: fix precondition checks in gimp_config_type_register()
check for zero pspecs or more than zero pspecs, but consistently check
both pspecs and n_pspecs.
2019-09-20 00:35:56 +02:00
Jehan 5c7d6da1c3 libgimpconfig: allow gimp_config_type_register() with 0 pspecs.
There is at least one valid case of a config type registration with no
parameters: when registering the gegl:nop operation. This is the default
case when running the GEGL operation tool. See implementation of
gimp_filter_tool_get_operation().
Therefore we ended up crashing GIMP just by calling this tool.
2019-09-17 12:55:04 +02:00
Michael Natterer ccd6f6385b libgimpconfig: turn some comments into actual docs 2019-09-16 20:24:06 +02:00
Michael Natterer 3598722020 libgimpconfig: add gimp_config_type_register()
which implements a generalized (not GEGL operation specific) version
of the dynamic config type creation code from gimp-operation-config.c.
2019-09-16 10:48:32 +02:00
Michael Natterer 832e7fafc1 libgimpconfig: gimp_config_param_spec_duplicate() support GFile
object param specs.
2019-09-16 10:48:32 +02:00
Michael Natterer 44f3630574 libgimpconfig: support more types in gimp_config_param_spec_duplicate()
It now supports all GParamSpecs possible on the wire protocol, except
the ones that are implemented in app/ and libgimp/ (image, drawable,
...) and are not visible to libgimpconfig
2019-09-14 18:29:38 +02:00
Michael Natterer 6fad257693 libgimpconfig: more nested if() in gimp_config_param_spec_duplicate()
to reduce the number of checks per copy.
2019-09-14 18:07:06 +02:00
Michael Natterer 918f66c8c1 libgimpconfig: support GimpParamSpecConfigPath
in gimp_config_param_spec_duplicate().
2019-09-14 17:56:23 +02:00
Michael Natterer a06d33f4af libgimpconfig: clean up gimp_config_param_spec_duplicate() 2019-09-14 17:52:54 +02:00
Michael Natterer 8cdab31393 app, libgimpconfig: move gimp_param_spec_duplicate() to libgimpconfig 2019-09-14 17:35:32 +02:00
Félix Piédallu 65eff6f150 Meson port. 2019-09-11 16:42:04 +02:00
Michael Natterer 81bb3237ef libgimpconfig: add weird hack to gimp_scanner_parse_float()
because for whatever reason, writing

*dest = -scanner->value.v_int;

fails and writes some positive value instead.
2019-08-18 18:28:32 +02:00
Niels De Graef 284ba5c870 libgimpconfig: Prevent GIR conflicts in GimpConfigWriter
GimpConfigWriter contains several constructors with the convention
`gimp_config_writer_new_* ()`. This will lead to problems however with
languages like Vala, where it cannot disambiguate the following:

```
// calls config_writer_new_string()
Gimp.ConfigWriter w = new ConfigWriter.string("xxx");
// calls config_writer_string()
w.string("xxx")
```

Using `from_` in constructors is general practice in GObject-bsed
libraries because of this.

This also fixes an error when trying to use vapigen on the GIMP .GIR
file.
2019-08-16 10:04:39 +00:00
Michael Natterer 7e504a0ddd libgimpconig: fix indentation in gimpscanner.h 2019-08-10 11:07:27 +02:00
Niels De Graef aefb40c82a libgimpconfig: Ensure G_PARAM_STATIC_STRINGS
The `GIMP_CONFIG_PROP_*` macros do not automatically set
`G_PARAM_STATIC_STRINGS`, which means each property that uses such a
macro does not have this flag set by default (and almost none set it
themselves). By adding `G_PARAM_STATIC_STRINGS` to
`GIMP_CONFIG_PARAM_FLAGS`, we can prevent this from happening, which
should lead to some unnecessary string copies being prevented.
2019-08-09 19:27:02 +00:00
Michael Natterer c9b22def51 libgimpconfig: update gimpconfig.def 2019-08-09 18:51:12 +02:00
Michael Natterer d3d621b502 libgimpconfig: add a GimpScanner typedef and make it a boxed type
Replace _destroy() by _ref() and _unref().
2019-08-09 12:42:52 +02:00
Jehan 2dde79b3e7 libgimp*: move GObject Introspection into libgimp/.
libgimp is anyway processed at the very end after all other libgimp*
were built. This way, it also fixes #3746, by removing the $(top_srcdir)
everywhere from introspected files, hence making the build work again
with older automake.
2019-08-08 15:59:44 +02:00
Michael Natterer f90e19091d libgimpconfig: make GimpConfigWriter a boxed type 2019-08-07 21:51:30 +02:00
Michael Natterer cc8fc0f90f libgimp*: add GI's .dirstamp to .gitigore 2019-08-03 19:50:17 +02:00
Niels De Graef 5f92ced1f3 Add (nullable) if applicable
Basically this commit makes sure that all return values that are marked
as "Returns:" also have a `(nullable)` annotation if it is mentioned on
the same line that NULL can also be returned.

This will prevent a few problems in GObject-introspection.
2019-08-03 07:53:47 +00:00
Niels De Graef 1dda60154c Use "Returns:" to annotate return values
To be able to annotate return values through GObject-introspection, you
need to make sure it is tagged with `Returns:` and not something else.
2019-08-03 07:53:47 +00:00
Michael Natterer c12c031f2d pdb, libgimp*: add (out caller-allocates) to all GimpRGB* return values 2019-08-01 15:39:13 +02:00
Michael Natterer 2d471ce049 libgimpconfig: fix float parsing in gimp_config_deserialize_fundamental() too 2019-07-30 18:36:20 +02:00
Michael Natterer c0fb66254e Use g_ascii_dtostr() instead of g_ascii_formatd()
The latter is broken and doesn't guarantee a decimal point with the
current bug. Also, g_ascii_dtostr() doesn't need the format parameter
and produces nicer output.
2019-07-30 15:57:36 +02:00
Michael Natterer 2c97bc8327 libgimpconfig: make gimp_scanner_parse_float() less strict
A number without a decimal point can be put into a gdouble just fine,
no need to refuse them. Moreover, g_ascii_dtostr() serializes doubles
without fractional part without a decimal point, and we are soon going
to use it.
2019-07-30 14:31:14 +02:00
Jehan 74a0da9aa0 libgimpconfig: fix a few more warnings.
Fixes these sorts of warnings:
> return value: Missing (element-type) annotation
> return value: Missing (transfer) annotation
2019-07-28 09:50:20 +02:00
Jehan 4e99c25902 libgimpconfig: fix introspection in gimpcolorconfig.c.
Several returned values had no documentation, and needed in particular
(transfer) annotations.

Fixes various warnings:
> return value: Missing (transfer) annotation
2019-07-27 23:55:30 +02:00
Jehan fb4c86a660 libgimp*: make more libgimp* libraries introspected.
Only libgimpwidgets is not introspected yet as it didn't work from
scratch and I don't have the time right now to look into it. Anyway with
all the others, we already have so many warnings during the GObject
Introspection step now that we have a lot of work to do already!
2019-07-27 20:25:20 +02:00
Michael Natterer aca5f806c4 libgimp*: lots of doc fixes and new docs for structs and enums 2019-07-24 01:18:30 +02:00
Michael Natterer d7d281bd97 libgimpconfig: fix previous commit to return the right error token 2019-06-20 15:01:29 +02:00
sarah f19844d0d1 enhancement: validate reference argument of gimp_scanner_parse_string before using it 2019-06-20 06:04:30 +00:00
Jehan 613bf7c5ab app, libgimpconfig: make various usage of g_file_replace() safer.
When an error occurs, we want to prevent overwriting any previous
version of the file by incomplete contents. So run
g_output_stream_close() with a cancelled GCancellable to do so.
See also discussion in #2565.
2018-11-26 15:50:38 +01:00
Michael Natterer a29f73bd9a Issue #2224 - Use the "Swap folder" setting for the GEGL cache
Move swap/cache and temporary files out the GIMP user config dir:

libgimpbase: add gimp_cache_directory() and gimp_temp_directory()
which return the new default values inside XDG_CACHE_HOME and the
system temp directory. Like all directories from gimpenv.[ch] the
values can be overridden by environment variables. Improve API docs
for all functions returning directories.

Add new config file substitutions ${gimp_cache_dir} and
${gimp_temp_dir}.

Document all the new stuff in the gimp and gimprc manpages.

app: default "swap-path" and "temp-path" to the new config file
substitutions. On startup and config changes, make sure that the swap
and temp directories actually exist.

In the preferences dialog, add reset buttons to all file path pages.
2018-11-18 18:10:34 +01:00
Ell 3b0040c043 app, libgimp*, modules: don't use g_type_class_add_private() ...
... and G_TYPE_INSTANCE_GET_PRIVATE()

g_type_class_add_private() and G_TYPE_INSTANCE_GET_PRIVATE() were
deprecated in GLib 2.58.  Instead, use
G_DEFINE_[ABSTRACT_]TYPE_WITH_PRIVATE(), and
G_ADD_PRIVATE[_DYNAMIC](), and the implictly-defined
foo_get_instance_private() functions, all of which are available in
the GLib versions we depend on.

This commit only covers types registered using one of the
G_DEFINE_FOO() macros (i.e., most types), but not types with a
custom registration function, of which we still have a few -- GLib
currently only provides a (non-deprecated) public API for adding a
private struct using the G_DEFINE_FOO() macros.

Note that this commit was 99% auto-generated (because I'm not
*that* crazy :), so if there are any style mismatches... we'll have
to live with them for now.
2018-09-18 14:39:56 -04:00
Jehan bc427479e0 libgimpconfig: update some description comments.
Second parameter of gimp_scanner_parse_token() and
gimp_scanner_parse_identifier() is not a return value. It is a value to
compare with.
2018-07-17 19:45:51 +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
Ell 3b228afdbe libgimpconfig: allow writing empty data in gimp_config_writer_data() 2018-07-05 22:47:45 -04:00
Jehan a411ee7c38 libgimpconfig: forgot to update gimpconfig.def AGAIN!
Aaaaargh!
2018-07-03 02:01:20 +02:00
Jehan 9c05f10368 libgimpconfig: new API gimp_config_build_system_path().
This is the complementary of gimp_config_build_writable_path() to
properly get the system vs. user directories.
2018-07-02 21:16:14 +02:00
Ell e47ffefab2 libgimpcolor, libgimpconfig: remove deprecated interface functions
Remove the deprectaed foo_interface_get_type() functions, as per
the last two commits.
2018-05-27 05:59:39 -04:00
Ell 5f8643a6ee libgimpconfig: align GimpConfig with the rest of the interfaces
Unlike the last two commits, we don't port GimpConfig to
G_DEFINE_INTERFACE(), since we need to provide a base initializer
for it.  However, this commit aligns it with the rest of our
intefaces, by renaming gimp_config_interface_get_type() to
gimp_config_get_type(), and by performing class initialization for
the interface in a separate function than base initialization.

Keep gimp_config_interface_get_type() around as a deprecated
function, to maintain ABI compatibility.  It will be removed in a
separate commit in master, so that this commit can be easily
cherry-picked to gimp-2-10.
2018-05-27 05:56:34 -04:00
Michael Natterer 7990b1d57c libgimp: update all .def files 2018-05-25 22:13:33 +02:00
Michael Natterer bb2a9d119f libgimpconfig: move all GimpColorConfig members to private 2018-05-20 21:06:33 +02:00
Michael Natterer f4f106ad26 libimp*: add private pointers to all instance structs
even if we don't have private members (yet). Also make class padding 8
pointers in all headers. This commit moves nothing to private, it just
makes all headers consistent and adjusts .c files accordigly.
2018-05-20 21:06:33 +02:00
Michael Natterer 86e3f31a03 libgimpconfig: remove all deprecated cruft 2018-05-20 21:06:29 +02:00
luz.paz 69b2e84924 Source and trivial typos
Found via `codespell` and `grep`
2018-05-12 23:44:47 +02:00
Jehan d4404aa4bc libgimpconfig: fix the fix of the fix!
So apparently, it's "parenthesis" in singular.
Cf. commit 1b44812ab1.
2018-04-26 01:10:55 +02:00
Jehan 1b44812ab1 libgimpconfig: fix wrong typo fix.
Actually after re-reviewing previous commit, I found at least one wrong
fix in commit 4a77ff2d3d.
s/the opening parentheses/the opening parenthese/
2018-04-25 23:53:45 +02:00
luz.paz 4a77ff2d3d Bug 795557 - Misc. typo fixes in source, comments and doxygen (pt3)
Found via `codespell` and grep.
2018-04-25 23:49:06 +02:00
Jehan 08cc37271f libgimpconfig: create parent directories for config file if necessary.
The directory should be already created by GIMP. But just in case it is
not there, for whatever reason, don't just fail. Try and create all
parents.
2018-04-22 22:17:28 +02:00