Commit Graph

93 Commits

Author SHA1 Message Date
Jehan dbbcfb16d5 app, libgimp*, pdb, plug-ins: GimpContext is now using only GeglColor.
- app: gimp_context_get_(foreground|background)() are now returning a GeglColor.
- libgimp: PDB functions named similarly in libgimp are returning a newly
  allocated GeglColor too.
- A few other PDB functions (the ones using these functions) were updated and
  their signature changed to use GeglColor too, when relevant. Plug-ins which
  use any of the changed libgimp functions were fixed.
- GimpContext: signals "(foreground|background)-changed" are now passing a
  GeglColor.
- libgimpconfig: new macro GIMP_CONFIG_PROP_COLOR using gegl_param_spec_color().
- GimpContext: properties "foreground" and "background" are now GeglParamColor
  properties.
- app: All code interacting with GimpContext objects were updated to receive a
  GeglColor (that they may still convert, or no, to GimpRGB for now).
- app: gimp_prop_gegl_color_button_new() was added as an alternative to
  gimp_prop_color_button_new() when the property is a GeglParamColor. Eventually
  the former should replace completely the latter.
- libgimpwidgets: gimp_prop_color_area_new() now works on GeglParamColor
  properties only.
- libgimp: gimp_procedure_dialog_get_widget() will generate a GimpColorArea for
  GeglTypeParamColor arguments.
2024-02-11 23:28:02 +01:00
Jehan f18266cb04 app, libgimp, pdb, plug-ins: gimp_context_[gs]et_foreground() now using GeglColor.
Also the color is internally stored as GeglColor, though there are still get
APIs and signals using GimpRGB.

The equivalent PDB functions are also changed to use GeglColor, same as app/
functions.
2024-02-11 23:28:02 +01:00
Jehan 475dafcee4 libgimp, pdb: make gimp_pdb_run_procedure_array() internal.
Apart from all regenerated PDB files, this commit fixes the few manual usages in
libgimp too.
2023-10-16 22:12:08 +02:00
Jehan 41ed091879 app, libgimp, pdb: add an internal gimp_context_get_resource().
This will be useful in an incoming code to serialize GimpResource PDB arguments.
2023-07-27 15:27:53 +02:00
Jehan ae29736ee0 app, libgimp, pdb: fix annotations for resources as return values.
Resources are stored by the plug-in infrastructure and their memory should not
be managed by plug-in code.

My commit 4f69995b46 was crappy and modified a generated function. I was just
too tired with all the heat in here, I guess!
2023-07-11 16:16:21 +02:00
lloyd konneker d720375e97 2.99 libgimp: add GimpResource, GimpBrush, GimpPropWidgetBrush
So procedures can declare args and GimpProcedureDialog show chooser
widgets

Fix so is no error dialog on id_is_valid for resources

Palette.pdb changes and testing

Memory mgt changes

Gradient pdb

Font and Pattern tests

Test  brush, palette

Cleanup, remove generator

Rebase, edit docs, install test-dialog.py

Whitespace, and fix failed distcheck

Fix some clang-format, fix fail distcheck

Fix distcheck

Cleanup from review Jehan
2023-01-14 12:58:05 +00:00
Jehan f9cf16f46f Issue #4201: meson: pdbgen not working.
Fix the dependency by making the stamp an actual (yet empty/no-op)
header file which is included by all generated source file. This way, we
ensure that meson rebuild .o files when the .pdb sources are changed.

This is the second solution proposed by eli-schwartz here:
https://github.com/mesonbuild/meson/issues/10196#issuecomment-1080053413
2022-03-28 15:25:23 +02:00
Niels De Graef 1e34a95db7 app, libgimp: pdbgen for previous commit. 2022-02-12 00:07:53 +00:00
Jehan d9387811f4 app, libgimp, pdb: new PDB API to enable/disable dynamics.
New libgimp C functions:
- gimp_context_are_dynamics_enabled()
- gimp_context_enable_dynamics()
2022-02-04 13:54:59 +01:00
Michael Natterer 5e00decc13 pdb, libgimp: use GIMP_VALUES_GET,DUP_FOO() in the libgimp PDB wrappers 2019-09-04 02:49:33 +02:00
Michael Natterer 90f9d551dc pdb, libgimp: use GIMP_VALLUES_GET_ENUM() in libgimp PDB wrappers
to get the procedure's return status.
2019-09-04 01:49:35 +02:00
Michael Natterer a351ce9126 Remove the entire old plug-in interface 2019-09-04 00:03:12 +02:00
Michael Natterer 449e84c108 pdb: use guint for tatoo, guide, sample point, which they are
and initialize GimpUnit with PIXEL instead of just 0.
2019-08-15 16:41:39 +02:00
Michael Natterer 5a09523214 Remove GIMP_TYPE_INT32 and GimpParamSpecInt32
Use gint and GParamSpecInt instead.
2019-08-15 14:04:56 +02:00
Michael Natterer 30d63111c3 libgimp*, pdb: gimp_value_array_new_from_types*() takes (type, value)
So a value array can now we created like this:

array = gimp_value_array_new_from_types (&error_msg,
                                         G_TYPE_STRING, "foo",
                                         G_TYPE_INT,    23,
                                         G_TYPE_NONE);

Change PDB generation to use this, which makes for much nicer code in
the libgimp wrappers, and only set arrays separately instead of all
values.
2019-08-08 13:01:50 +02:00
Michael Natterer caa61eef4f libgimp, pdb: remove gimp_run_procedure_with_array() from gimp.[ch]
and add it to gimplegacy.[ch] as gimp_run_procedure_array().
Regenerate all PDB wrapper accordingly.
2019-08-06 21:44:26 +02:00
Michael Natterer c2e5374845 pdb, libgimp: make all PDB wrappers use GimpPDB to run procedures 2019-08-06 21:34:00 +02:00
Michael Natterer c6236ac140 pdb, libgimp: more docs and annotations 2019-08-05 15:31:43 +02:00
Michael Natterer 360314eda7 pdb: fix generation of "Returns:" to not line-wrap annotations
Also generate comments like "Must be freed with g_free()" for all
return values instead of manually and inconsistently having them on
some return values only.
2019-08-04 22:09:04 +02:00
Michael Natterer c12c031f2d pdb, libgimp*: add (out caller-allocates) to all GimpRGB* return values 2019-08-01 15:39:13 +02:00
Jehan ac0c3cf532 pdb: remove some formerly manually added annotations.
From the time when I was just manually editing these even in the PDB!
2019-07-31 22:56:43 +02:00
Jehan a87104fffb pdb, libgimp: fix missing colons at end of annotations. 2019-07-31 22:51:35 +02:00
Michael Natterer 05e68da4d4 pdb, libgimp: add (array length=foo) annotations for out args 2019-07-31 19:19:06 +02:00
Michael Natterer a40f139fdc pdb, libgimp: annotate input arrays with (array length=foo) 2019-07-31 19:08:01 +02:00
Michael Natterer e73916eab8 pdb, libgimp: annotate input arrays with (element-type foo) 2019-07-31 18:58:52 +02:00
Michael Natterer f02a218356 pdb, libgimp: add (out) annotations to everything returned via pointers 2019-07-31 13:12:46 +02:00
Michael Natterer e8c6ab7ce9 pdb: add (element-type foo) annotations to all returned arrays 2019-07-31 13:08:19 +02:00
Michael Natterer 5b6cfd9863 pdb, libgimp: generate (transfer full) annotations for libgimp
for all returned allocated memory.
2019-07-31 12:56:04 +02:00
Michael Natterer 16043cec5e Revert "pdb, libgimp: append _pdb for gtk-doc SECTION names of pdb files."
This reverts commit 833666d462.

The _pdb files are an implementation detail and we do not want
separate doc sections for them, the conflicts need so be resolved in
another way.
2019-07-31 10:04:43 +02:00
Jehan 833666d462 pdb, libgimp: append _pdb for gtk-doc SECTION names of pdb files.
Otherwise we get a few duplicate sections since some of the non-PDB
files are named similarly.
Fix this GObject introspection warning and other similar warnings:

> libgimp/gimp_pdb.c:28: Warning: Gimp: multiple comment blocks
> documenting 'SECTION:gimp:' identifier (already seen at gimp.c:129).
2019-07-31 01:39:42 +02:00
Michael Natterer 271c656e2d pdb, libgimp: fix enum type generation in the libgimp PDB wrappers
Use the actual enum type not just G_TYPE_ENUM.
2019-07-30 18:45:10 +02:00
Michael Natterer af5c587e21 pdb, libgimp: port lib.pl to the new GType based libgimp API
All foo_pdb.c functions in libgimp regenerated. I have reviewed this a
dozen times, but please have a look, there might well be glitches and
our public API is sortof important...
2019-07-30 10:51:16 +02:00
Jehan 6b442a1ba3 app, pdb, libgimp: fix annotations of some PDB functions.
These are used in the first port of a Python plug-in which I am doing
right now.
2019-07-28 18:43:00 +02:00
Michael Natterer 8bd4a4fac9 pdb: fix typo in the gimp-context-set-line-dash-pattern docs 2019-07-24 01:57:43 +02:00
Michael Natterer 7a589951c9 Issue #3610 - Documentation: missing item in built-in documentation...
...for gimp_context_set_antialias(antialias)

Mention gimp_context_set_antialias() in the stroke docs, and mention
the stroke functions in the antialias docs.
2019-07-04 13:35:27 +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
Michael Natterer f180a171cd pdb: remove all deprecated procedures 2018-05-20 21:06:29 +02:00
Michael Natterer 436e53d390 pdb: improve docs about which procedures are affected by context settings
Also add some double blank lines so they show up as single blank
lines in the generated docs, which improves readablility.
2018-04-17 13:19:16 +02:00
Michael Natterer 93f41b344c pdb: improve docs of gimp_context_set_diagonal_neighbors() 2018-04-17 01:16:54 +02:00
Michael Natterer 3f4995d3d7 pdb: add procedures to set the built-in gradients
gimp-context-set-gradient-fg-bg-rgb
gimp-context-set-gradient-fg-bg-hsv-cw
gimp-context-set-gradient-fg-bg-hsv-ccw
gimp-context-set-gradient-fg-transparent
2018-04-16 11:42:46 +02:00
Michael Natterer 50536e1c38 Bug 795230 - Rename Blend tool and provide PDB compatibility
Add new PDB group "drawable_edit" which has all procedures from the
"edit" group which are not cut/copy/paste.

The new group's procedures don't have opacity, paint_mode
etc. arguments but take them from the context instead. Unlike the old
gimp-edit-fill, gimp-drawable-edit-fill now uses the context's opacity
and paint_mode.

The new gimp-drawable-edit-gradient-fill procedure uses even more
context properties which are also newly added with this commit
(gradient_color_space, gradient_repeat_mode, gradient_reverse).

And some cleanup in context.pdb.

This is still WIP, nothing in the edit group is depcreated yet.
2018-04-15 15:28:50 +02:00
Jehan e164aee7a9 app, libgimp, pdb: add "distance-metric" property to GimpPDBContext.
This property is currently only used for gimp_edit_blend() to control
how are computed distances. In the future, it could be used for more
functions making use of "gegl:distance-transform" operation, or even for
other algorithms, if relevant.
This new property obviously comes with 2 new PDB calls:
gimp_context_get_distance_metric() & gimp_context_set_distance_metric()
2018-03-18 01:03:40 +01:00
Michael Natterer 66060e3307 app, libgimp*, plug-ins: replace enum GimpLayerModeEffects by GimpLayerMode
with proper value names. Mark most values as _BROKEN because they use
weird alpha compositing that has to die. Move GimpLayerModeEffects to
libgimpbase, deprecate it, and set it as compat enum for GimpLayerMode.
Add the GimpLayerModeEffects values as compat constants to script-fu
and pygimp.
2017-01-08 23:00:19 +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
Ell 7b89fe6536 pdb: Use the diagonal-neighbors setting from GimpPDBContext...
...in gimp-image-select-contiguous-color()

This and the last 5 commits fix bug 760481.
2016-01-17 00:46:54 +01:00
Ell 7b3e5ba1e9 pdb: Add "diagonal-neighbors" as GimpPDBContext property
and add PDB API to get/set it.
2016-01-17 00:46:54 +01:00
Michael Natterer 80f713c9b8 pdb, libgimp: add gimp_context_set/get_mypaint_brush() 2016-01-02 13:40:38 +01:00
Michael Natterer 7d1a47a554 Bug 314379 - Allow stroking as outline (not with a paint tool) via the PDB
Add PDB API to configure/query all aspects of line stroking.
2015-11-11 00:47:31 +01:00
Michael Natterer 8fa7bc3622 Bug 314379 - Allow stroking as outline (not with a paint tool) via the PDB
Add new PDB procedures gimp-context-get/set-stroke-method and honor
the new setting in gimp-edit-stroke and gimp-edit-stroke-vectors.

Internally, keep a GimpStrokeOptions around in GimpPDBContext to keep
track of the newly added PDB state, and use it for the stroke
operations instead of creating a scratch GimpStrokeOptions.
2015-11-09 01:46:07 +01:00
Michael Natterer 02d1192753 pdb: return NULL for string arrays with zero elements
In e61b1f76 things were changed to return string arrays that can be
freed with g_strfreev(), but that returned a one-element array
containing a NULL pointer for zero-length arrays. Fix the code
to return NULL again for zero-length arrays. See bug #751584.
2015-09-14 01:12:57 +02:00