Commit Graph

334 Commits

Author SHA1 Message Date
luz paz bb322d94d7 Fix typos
Found via:
```
codespell -q 3 -S ./ChangeLog*,*.po,./.git,./NEWS* -L als,ang,ba,chello,daa,doubleclick,foto,hist,iff,inport,klass,mut,nd,ower,paeth,params,pard,pevent,sinc,thru,tim,uint
```
2020-11-19 21:56:25 +01:00
Jehan 1a5eea4f0f app, libgimp, pdb: improve a bit gimp_image_get_parasite_list() docs.
It is more accurate to say it returns a list of parasite names rather
than a list of parasites (as we could take it as meaning a list of
GimpParasite). Of course, we would soon see the actual element contents
(if not for the introspection metadata (element-type gchar*)), but
better being accurate in textual docs too.
2020-10-30 11:02:20 +01:00
Jehan 1fb2448850 app, pdb: use gimp_is_canonical_identifier() for pdb-get|set-data…
… instead of gimp_pdb_is_canonical_procedure().
The later would set an error saying "Procedure name '%s' is not a
canonical identifier". Yet the data label is not a procedure name. It is
a random name. I'm not sure why we need it to be canonical too, but why
not. In any case, let's use the right function.
2020-10-30 11:02:20 +01:00
Jehan 90bcdf9bda app, libgimp, pdb: remove references of removed functions.
There were still a few references to functions which have been removed
from GIMP 3 (because they were deprecated in previous versions), which I
found as I was doing an inventory of removed functions.
2020-10-26 15:36:42 +01:00
Jehan 4b9dc93d08 app, pdb: set string arguments to "" *after* the GFile.
Thanks to Wormnest for pushing me to look further. Since gimp-file-save
is actually redirecting the call to another procedure (save proc for the
specific format) which might have more arguments, including string
arguments. When it finds any, it sets it to an empty string "" (which I
guess is ok as "default value when we don't know what to put there").

The previous code would not hurt. Starting at the fourth argument
(GFile), it would just do nothing, then continue with the firth and
further. Still, starting directly at the fifth arg is the proper code
for this.
2020-10-21 20:28:38 +02:00
Jehan 0f6e43f0b8 pdb: fix gimp-file-save PDB procedure implementation.
I fixed the wrong file in my previous commit (it's a generated file!).
This is the right one.
2020-10-21 18:40:18 +02:00
Jehan 09fa321074 app: new profile conversion policy to preferred color profile.
Our Preferences exposes a concept of "Preferred color profile" (for RGB,
grayscale and CMYK), which is used in some places to be proposed as
default alternative to built-in profiles. But it was not used in the
import color profile dialog (only 2 choices were: keep the image profile
or convert to built-in RGB).
This commit now adds this third choice, which is even made default when
hitting the "Convert" button directly, without tweaking with the dialog.
Because we can assume that if someone made the explicit choice to label
such a profile as "Preferred", this is more likely the one to convert to
(if one even wants to convert from an embedded profile anyway).

As for the `Preferences > Image Import & Export > Color profile policy`,
they now propose 4 choices: Ask, Keep embedded profile, Convert to
built-in or preferred profiles.
2020-09-24 16:27:34 +02:00
Jehan 5a8d69629a libgimp, pdb: new functions gimp_image_policy_rotate() and…
… gimp_image_policy_color_profile().
These functions allow a plug-in to explicitly execute the Rotation and
Profile conversion policies on an image (which may be any of
Rotating/Discarding/Ask or Converting/Keeping/Ask respectively). These
policies are automatically executed when loading an image from GIMP
interfaces, but they won't be when loading an image from the PDB. Then
it is up to the calling code to decide what to do (which can be either
some arbitrary code or following the user policy).
2020-09-24 12:49:57 +02:00
Jehan 84e587d255 app: GimpSelectionEditor multi-drawable aware.
When clicking on the selection mask (in the dockable view) or when
dropping a color on this same view, we can now select by color based on
the selected layer composition (not only one single layer, nor the whole
image as sample merged, but also a specific list of composited layers).

gimp_channel_select_by_color() is made multi-drawable aware as a
consequence of this.
2020-08-17 18:22:19 +02:00
Jehan 5357628df2 app, pdb: fix pdb and generated code.
Oups! The meson build failing to properly generate code is annoying!
2020-08-01 16:36:27 +02:00
Jehan 2ba6ac6286 app: selection stroke and "Stroke Path" now multi-layer aware.
This includes "select-stroke*" actions and "Stroke Path" feature of the
Vector tool.
2020-08-01 14:02:24 +02:00
Jehan 955aecab92 app, pdb: layers-merge-down action now multi-layer aware.
When several layers are selected, each layer will merge down with the
layer below it. This is similar to running Merge Down several times, one
for each selected layer.
2020-06-30 23:29:05 +02:00
Jehan 647ebffe7b app: GimpTransformTool multi-layer aware.
This implied a lot of other core changes, which also pushed me into
improving some of the edit actions and PDB calls to be multi-layer aware
in the same time.

Note that it is still work-in-progress, but I just had to commit
something in an acceptable intermediate state otherwise I was just going
crazy.

In particular now the various transform tools are multi-layer aware and
work simultaneously on all selected layers (and the linked layers if any
of the selected layers is linked too). Both preview and final transform
processing works.
In the limitations, preview doesn't work well (only one layer in the
preview) when there is a selection (though the actual transform works).

Also I am left to wonder how we should process this case of canvas
selection+transform on multi-layers. Indeed currently I am just creating
a floating selection (like we used to for the selection+transform case)
containing a transform result of the composited version of all selected
layers. This is a possible expected result, but another could be to get
several transformed layers (without composition). But then should the
"Floating Selection" concept allow for multiple Floating Selections?
Sooo many questions left to answer.
2020-05-28 14:28:01 +02:00
Jehan 5398d15b55 app, pdb: fix build warning because of discarded 'const' qualifier.
The PDB creates the array of drawables as a `const GimpItem *` and the
compiler does not like when we drop the const qualifier. So force this
const dropping with explicit type casting.
2020-05-26 21:49:58 +02:00
Simon Budig 22784727f4 pdb: implement gimp-vectors-stroke-reverse 2020-05-25 22:54:47 +02:00
Jehan 2956873740 app, libgimp, pdb: fix gimp_selection_float() usage.
This fixes bugs introduced in commit a7c59277fb where I obviously didn't
properly checked all the places where gimp_selection_float() was used
after its parameters changed.
2020-05-18 02:09:45 +02:00
Jehan 5498adf50a app, libgimp, pdb: color picker multi-layer aware.
Color picking on a single layer still works as it used to. On multiple
layer, it will now pick on the composited color, similarly to sample
merged if only selected layers were made visible.

The PDB/libgimp function gimp_image_pick_color() is also updated to work
on multiple drawables too, giving the same ability to plug-ins (the only
call to this function in core plug-ins have been updated).
2020-05-17 18:57:32 +02:00
Jehan 5964f72cea app, pdb: layers-merge-layers* and image-merge-layers multi-layer aware.
Multi selection actually only really matter when "Merge within active
groups only" option is checked, in which case we are able to merge
layers within several layer groups simultaneously, and end up with
multi-selected merged layers.

Also not sure why both layers-merge-layers and image-merge-layers exist,
as they are exactly the same (exact same callback called when
activated).
2020-05-17 18:57:32 +02:00
Jehan 98603c69c9 app, libgimp, pdb: "edit-copy" multi-layer aware.
When several layers are selected, select their render, similar to how
"edit-copy-visible" would have copied an image with only these layers
made visible.
Also apply the same logics to PDB function gimp_edit_copy() which can
now be used on several drawables at once.
2020-05-17 18:57:32 +02:00
Jehan d3139e0f7c app: support saving/exporting with multi-selection.
This commit just changes our saving API (i.e. the GimpSaveProcedure
class) to take an array of drawables as argument instead of a single
drawable.

It actually doesn't matter much for exporting as the whole API seems
more or less bogus there and all formats plug-ins mostly care only
whether they will merge/flatten all visible layers (the selected ones
don't really matter) or if the format supports layers of some sort. It
may be worth later strengthening a bit this whole logics, and maybe
allow partial exports for instance.

As for saving, it was not even looking at the passed GimpDrawable either
and was simply re-querying the active layer anyway.
Note that I don't implement the multi-selection saving in XCF yet in
this commit. I only updated the API. The reason is that the current
commit won't be backportable to gimp-2-10 because it is an API break. On
the other hand, the code to save multi-selection can still be backported
even though the save() API will only pass a single drawable (as I said
anyway, this argument was mostly bogus until now, hence it doesn't
matter much for 2.10 logics).
2020-05-17 18:32:16 +02:00
Jehan ac56b1ed14 app, libgimp, pdb: add PDB function gimp_image_get_selected_layers().
Also add gimp_image_list_selected_layers() which is the GList version.
2020-05-17 18:32:16 +02:00
Jehan bcacf6e2ae app: "active item" concept => "selected items".
After much thought, tests and discussions with Aryeom, we decided adding
back an active item concept additionally to the selected items ones is a
bad idea as it makes only usage unecessarily complex.
We will just have selected layers. Some kind of operations will work
when more than one item (layers, channels, vectors) are selected while
others will require exacty one item.

In particular, let's replace instances of gimp_image_(s|g)et_active_*()
by corresponding gimp_image_(s|g)et_selected_*(). Also replace single
item in various undo classes by GList of items.
Also "active-*-changed" GimpImage signals are no more, fully replaced by
"selected-*s-changed".

This is still work-in-progress.
2020-05-17 18:32:16 +02:00
Ell 362b828a03 Issue #4996 - Wrong propagate_mode parameter handling in plug-in-vpropagate
Fix plug-in-vpropagate compat procedure when propagate_mode == 3.
2020-04-28 15:09:21 +03:00
Jehan ea0cc27c01 app, libgimp, pdb: update gimpfile PDB functions' documentation.
All file-related functions now uses a single GimpFile as argument.
Comments regarding path as entered vs full pathname are now obsolete.
2020-04-13 20:25:32 +02:00
Ell 1a2039da65 pdb: add missing change to last commit 2020-01-17 12:22:15 +02:00
Ell 50b655de27 Issue #1975 - Color to alpha now requires an alpha-channel ...
... (used to add one automatically)

In GimpFilterTool and gimp_drawable_apply_operation(), use
gimp_drawable_filter_set_add_alpha() to add an alpha channel when
applying an operation that specifies "needs-alpha" to a drawable
that can have alpha.

Don't disable gegl:color-to-alpha (which has "needs-alpha") when
the drawable doesn't have an alpha channel, if one can be added.
2020-01-17 12:11:24 +02:00
Ell e74994feaf pdb: in plug_in_compat.pdb, set underlying op nodes
In plug_in_compat.pdb, when wrapping an op node inside a graph, set
the op node as the graph node's underlying operation.  This allows
gimp_gegl_apply_operation() to perform certain optimizations.
2020-01-07 10:53:00 +02:00
Ell 8b7bafa43a Issue #4204 - "Add Bevel" Has No Effect
In plug_in_compat.pdb, don't add child nodes to nodes containing an
op, since this turns them into graphs and discards the op.
Instead, add a new wrap_in_graph() helper function, which takes a
node op and wraps it in a simple "input -> op -> output" graph.
Use the graph as the container for child nodes, and as the node
passed to gimp_drawable_apply_operation().  (This is similar to
what we used to do before commit
afdd573136, except that we now pass
the parent node to gimp_drawable_apply_operation(), instead of the
op node).
2020-01-07 10:52:59 +02:00
Michael Natterer 4dfcffe4f7 Remove all checks for finite() and isfinite()
and simply use isfinite() everywhere, it's part of C99.
2020-01-05 16:36:18 +01:00
Alex Samorukov 2cb0493b2f Replace finite() with isfinite() by default
This is part of the C standard also also causing warning on macOS.

(cherry picked from commit 04997fc0ae)
2019-11-07 10:13:59 +01:00
Michael Natterer c8bf85cc54 pdb: item.pdb: '3,0' is not a version, it's '3.0' 2019-10-27 18:56:53 +01:00
Michael Natterer 83a936b8fe pdb: rename all functions in the "plug_in" group
from gimp_plugin_foo() to gimp_plug_in_foo() for consistency.
2019-09-11 23:58:47 +02:00
Michael Natterer 6de4af4ade pdb: change paths and URIs in the "plug_in" group to GFiles 2019-09-11 23:54:53 +02:00
Michael Natterer 2fa9b8f030 pdb: forgot to change an URI to GFile in gimp_file_load() 2019-09-11 22:48:32 +02:00
Michael Natterer 77731d1e8e pdb: change the URIs in the color profile API to GFiles 2019-09-11 22:44:17 +02:00
Michael Natterer 14af676b51 pdb, libgimp: change "filename" to "file" in gimp_pdb_dump() 2019-09-11 22:37:40 +02:00
Michael Natterer 6468fa06c7 pdb, plug-ins: change gimp_temp_name() to gimp_temp_file() 2019-09-11 22:32:44 +02:00
Michael Natterer 6bca8c4f89 pdb, app, libgimp, plug-ins: replace most PDB filenames/URIs by GFile
and in an attack of madness, changes almost all file plug-in
code to use GFile instead of filenames, which means passing
the GFile down to the bottom and get its filename at the very
end where it's actually needed.
2019-09-11 21:48:34 +02:00
Michael Natterer f3fb3d1a57 Remove the second "raw-filename"/"raw-uri" parameter from file procedures
It's an ancient concept from ancient times when we didn't have URIs
and only filenames (not to speak of GFile), and actually even from
before the ancient time before that ancient time when we first had
ones and zeros, and only had zeros.
2019-09-11 00:21:03 +02:00
Michael Natterer 6115d34fe8 Rename the "fileops" PDB group to just "file" 2019-09-10 21:38:11 +02:00
Michael Natterer 7c5cb29ca6 pdb: move the file procedure register API from "fileops" to "pdb"
because it has nothing to do with the other procedures in fileops and
only sets properties on procedures.
2019-09-10 21:24:09 +02:00
Michael Natterer 56fee73441 pdb: reorder stuff in the "pdb" group to make more sense 2019-09-10 20:23:19 +02:00
Michael Natterer ff9b469808 app: move the file procedure registering functions into gimpplugin-proc.c
They are simply setting properties on GimpPlugInProcedures, just like
the other functions in gimpplugin-proc.[ch], so there is no reason to
have them elsewhere and with worse checks and error messages.
2019-09-10 20:05:27 +02:00
Michael Natterer 0745043ddb pdb, libgimp: remove _gimp_register_load_handler()
and rename _gimp_register_magic_load_handler() to
_gimp_register_load_handler().
2019-09-10 12:29:17 +02:00
Michael Natterer a88aa27942 app: use GError in all gimpplugin-proc.[ch] functions, not gimp_message() 2019-09-09 12:10:32 +02:00
Michael Natterer bde70bcdab pdb: avoid duplicate argument names in gimp-plugins-query
Also rename all arguments to make more sense.
2019-09-09 01:51:33 +02:00
Michael Natterer 22a780c9d1 pdb: add gimp_pdb_set_proc_documentation() and _attribution()
and all the needed code in libgimp/ and app/ to set them on a
procedure using the new API. Remove the strings from GPProcInstall.
2019-09-09 00:36:24 +02:00
Michael Natterer 453b4f4aa2 pdb: add gimp_pdb_set_proc_menu_label()
and all the needed code in libgimp/ and app/ to set a plug-in
procedure's menu label using the new API. Remove the menu label from
GPProcInstall.
2019-09-08 17:30:54 +02:00
Michael Natterer 2a62287439 pdb: add gimp_pdb_set_proc_image_types()
and all the needed code in libgimp/ and app/ to set a plug-in
procedure's image types using the new API. Remove the image types from
GPProcInstall.
2019-09-08 16:54:08 +02:00
Michael Natterer d75a25c565 app: move the plug-in procedure setters to gimpplugin-proc.[ch]
because there are going to be much more more.
2019-09-08 16:38:31 +02:00
Michael Natterer 303ccbedad pdb: move gimp_plugin_icon_register_invoker() from "plugin" to "pdb"
and call it gimp_pdb_set_proc_icon(). Change icon registration code in
libgimp/ and app/ so it's now possible to register icons for temporary
procedures.
2019-09-08 16:22:32 +02:00
Michael Natterer d89adebff8 pdb: move gimp_plugin_menu_register() from the "plugin" to the "pdb" group
and call it gimp_pdb_add_proc_menu_path(). Move around and rename some
code in app/ to prepare for more procedure setters to work this way.
2019-09-08 15:53:37 +02:00
Michael Natterer e82c80bf5f pdb: rename all procedure query procedures to gimp-pdb-get-proc-foo 2019-09-08 15:07:24 +02:00
Michael Natterer 388776df07 Simplify the plug-in query API and fix plugin-browser
- remove the menu path and image types from "gimp-plugins-query",
  they are available via GimpProcedure, also reorder and rename
  its remaining return values to make sense
- remove the "menu_path" parameter to gimp_proc_view_new(),
  it can also ask GimpProcedure
- adapt plugin-browser to the new API and make it use GimpProcedure
- fix plugin-browser's tree view to show all menu hierarchies
  completely, it was still expecting menu paths that contain
  the menu label too
2019-09-08 14:59:09 +02:00
Michael Natterer 48692e58c3 pdb: add pdb API to get a procedure's image types, menu label and menu paths 2019-09-07 21:08:13 +02:00
Ell 85704c6c46 pdb: add $since info to gimp-image-merge-layer-group 2019-09-07 10:55:09 +03:00
Ell 62a6023b27 pdb: add gimp-image-merge-layer-group procedure
Oddly, we didn't have this one yet :P
2019-09-07 10:33:43 +03:00
Michael Natterer f764fd0f82 pdb, libgimp: change all generated ID array return values to object arrays
and remove the manual libgimp wrappers which now have the same
signature as the generated functions.
2019-09-05 13:01:00 +02:00
Ell cf3638391d app: add support for color picking in "show all" mode
Add a show_all parameter to gimp_image_pick_color(), which, when
TRUE, allows picking colors outside the canvas bounds in sample-
merged mode.  Forward the display's "show all" mode through this
parameter where applicable (in particular, in the color-picker tool
and the pointer dockable).
2019-09-04 20:51:43 +03:00
Michael Natterer b92dd2c8e3 app: split GimpDisplay in two classes: GimpDisplay and GimpDisplayImpl
GimpDisplay contains only the ID logic and the "gimp" and "config"
pointers, and lives in the core.

GimpDisplayImpl is a subclass and contains all the actual display
stuff. The subclass is only an implementation detail and doesn't
appear in any API.

Remove all hacks which pass displays as gpointer, GObject or
GimpObject through the core, or even lookup its type by name,
just use GimpDisplay.
2019-09-04 14:30:43 +02:00
Michael Natterer feaf96735f pdb: don't return any strings from _gimp_pdb_proc_info()
and instead add _gimp_pdb_proc_documentation() and
_gimp_pdb_proc_attribution().

Remove the gimp_pdb_proc_info() utility function in app/.
2019-09-04 01:38:31 +02:00
Jehan 1c0fb800e5 app, pdb: fix gimp_item_id_is_vectors().
It was testing for GimpDrawable!
2019-09-02 11:44:36 +02:00
Michael Natterer 392f00baf5 app, libgimp: get rid of all ID GTypes and ID param specs
Turn all ID param specs into object param specs (e.g. GimpParamImageID
becomes GimpParamImage) and convert between IDs and objects in
gimpgpparams.c directly above the the wire protocol, so all of app/,
libgimp/ and plug-ins/ can deal directly with objects down to the
lowest level and not care about IDs.

Use the actual object param specs for procedure arguments and return
values again instead of a plain g_param_spec_object() and bring back
the none_ok parameter.

This implies changing the PDB type checking functions to work on pure
integers instead of IDs (one can't check whether object creation is
possible if performing that check requires the object to already
exist).

For example gimp_foo_is_valid() becomes gimp_foo_id_is_valid() and is
not involved in automatic object creation magic at the protocol
level. Added wrappers which still say gimp_foo_is_valid() and take the
respective objects.

Adapted all code, and it all becomes nicer and less convoluted, even
the generated PDB wrappers in app/ and libgimp/.
2019-08-29 11:39:34 +02:00
Jehan 24af759483 pdb: update a bunch of docs where s/-1/%NULL/
Also add a none_ok on gimp_text_fontname() outarg since it is clearly
noted as being able to return no layer with invalid parameters.
2019-08-25 12:01:41 +02:00
Michael Natterer 7201d48231 Get rid of capitalized "ID" in function and variable names
and use "id" instead.
2019-08-23 22:23:23 +02:00
Jehan 75f8a3804d libgimp: nicer API for functions returning a list.
I.e.: gimp_image_get_(layers|channels|vectors)(), gimp_image_list() and
gimp_item_get_children().
Instead of returning an array of IDs, these will now return a GList with
the right objects ready to use.
2019-08-22 15:54:36 +02:00
Jehan 4db8cda24e app, pdb, libgimp: add a new GimpImage class for plug-ins.
This means that all functions which were returning or taking as
parameter an image id (as gint32) are now taking a GimpImage object
instead.
The PDB is still passing around an id only over the wire. But we create
an object for plug-ins to work on.

This is quite a huge API break, but is probably the best bet for the
future quality. It will make nicer API instrospection (and nicer API in
binding), will fix the issues with pspec on GimpImageID in Python
bindings (which makes the current Python API unusable as soon as we need
to work on images, which is most of our plug-ins!), etc.
Also it will allow to use signals on images, which will be a great asset
when we will finally have bi-directionnal communications (i.e. plug-ins
would be able to connect to image changes, destructions, and whatnot).
2019-08-22 15:54:36 +02:00
Michael Natterer de121374ef Change the "handles uri" flag of file procedures to "handle remote"
And always pass URIs to all file procedures, the ones what didn't
register as "handles remove" will only ever get local file:// URIs.

Change all file plug-ins (also legacy ones) to expect URIs instead
of filenames, and convert to local paths in the plug-in.

The wire protocol should now be almost 100% clean of non-UTF-8 strings.
2019-08-19 12:05:12 +02:00
Michael Natterer 11ce199cea app: stop canonicalizing procedure names
on behalf of plug-in authors who have no style or can't type.

Instead, simply reject non-canonical procedure names and remove all
code that keeps aroud the original non-canonical shit just to pass it
back to the plug-in.
2019-08-18 01:55:47 +02:00
Michael Natterer 4fa08458e8 pdb: remove int16 from the PDB types and rename int8 to uchar 2019-08-15 15:11:18 +02:00
Michael Natterer 8222d3ffad pdb: don't pass nodes with parents to gimp_drawable_apply_operation() 2019-08-12 19:41:48 +02:00
Michael Natterer ae824dcab5 pdb, libgimp: remove the now unused gimp_pdb_proc_arg() and _proc_val()
Bye bye legacy.
2019-08-11 22:32:25 +02:00
Michael Natterer b35dbf0d77 libgimp: change the remaining "author" strings and variables to "authors" 2019-08-11 17:03:03 +02:00
Michael Natterer fc065f8add pdb, libgimp: add gimp_load_procedure_set_thumbnail_loader()
and move the old API to gimplegacy.[ch]
2019-08-11 14:27:41 +02:00
Michael Natterer 84629cc1d0 pdb, libgimp: move the old file proc registering API to gimplegacy.[ch]
Also, #define GIMP_DISABLE_COMPAT_CRUFT in all GimpPlugIn related
files to prevent accidential use of the old API.
2019-08-11 13:21:55 +02:00
Michael Natterer 60b6f34737 pdb, libgimp: fix various doc issues found by gtk-doc 2019-08-10 11:08:06 +02:00
Ell ce6dfd3194 pdb: fix image-mask transforms
In the various PDB transform functions, avoid erroneously creating
a floating selection when transforming the image mask, and rather
transform the mask normally.
2019-08-09 22:23:35 +03:00
Ell 33a389cd0c app, pdb: use gimp_item_get_clip() everywhere
Remove the special clipping-mode handling for channels throughout
the transform (and drawable-filter) code, and rather use
gimp_item_get_clip(), added in the previous commit, instead.  As
mentioned in the previous commit, we only modify the clipping mode
in top-level code, while having lower-level code use the clipping
mode as-is.  This not only hides the actual clipping-mode logic
from the transform code, but, in particular, allows code performing
transformation internally to use arbitrary clipping modes.

Also, this commit fixes a bunch of PDB bugs all over the place :)
2019-08-09 22:23:17 +03:00
Michael Natterer 244b52bf0d pdb, libgimp: make the "pdb" PDB group private
and don't install its header. Temporarily add its only two remaining
needed functions to gimppdb.[ch].

Also some Makefile cleanup.
2019-08-08 21:55:11 +02:00
Michael Natterer 0aa2dcfadb libgimp: replace gimp_pdb_dump() and gimp_pdb_query() by new API
and move them to gimplegacy.[ch].
2019-08-08 01:14:35 +02:00
Michael Natterer 6584839bf2 pdb: add "lib_private" on procedures too, to make them private
This replaces the "wrap" field on proc args and values, this belongs
to the procedure not to its args or values.
2019-08-07 19:09:00 +02:00
Michael Natterer e437e00adf pdb, libgimp: hide gimpunit_pdb.h and gimpplugin_pdb.h from the API
They only contain private functions and don't need to be installed or
included by gimp_pdb_headers.h.

The PDB generation part is done by adding a "lib_private" variable
that can be set on PDB groups which should not be public API; the rest
is manual Makefile fiddling.
2019-08-07 18:47:24 +02:00
Michael Natterer 0ef65bc647 pdb: move gimp_plugin_set,get_pdb_error_handler() to gimplegacy.[ch]
Hide the PDB wrappers and add the same API to GimpPlugIn.
2019-08-07 11:01:53 +02:00
Michael Natterer 64d880f1fe libgimp: add gimp_pdb_temp_procedure_name() and hide the PDB wrapper 2019-08-07 00:19:38 +02:00
Michael Natterer 8860d78979 libgimp: more progress on the GimpPDB object
- add gimp_pdb_run_procedure()
- hide more functions in gimppdb_pdb.[ch], and add proper API
- add gimp_get_pdb() which returns the singleton
2019-08-06 19:13:06 +02:00
Michael Natterer 468276e4d2 pdb: remove the section docs from unit.pdb
The functions are all private and the section is already documented in
libgimpbase.
2019-08-06 12:55:34 +02:00
Michael Natterer 05baadcd1d pdb: rename the "procedural_db" PDB group to just "pdb" 2019-08-06 12:51:56 +02:00
Michael Natterer c8f38810d1 pdb: add gimp_procedural_db_proc_argument() and _return_value()
Which return proper GParamSpecs. Incuding some useless testing code in
gimp_procedural_db_proc_info(), to make sure things work, will go away
again soon.
2019-08-05 10:48:23 +02:00
Michael Natterer 21d63d6c65 pdb: fix the names of the oilify compat PDB wrappers 2019-08-04 23:31:14 +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 0cfaeb7a90 pdb: remove the section docs for the plug-in group
it was duplicated with the GimpPlugIn class section docs.
2019-08-01 16:15:27 +02:00
Michael Natterer 0ccb40f89b pdb, libgimp: hide more functions that have new API in gimplegacy.[ch]
Also reorder some functions in plug_in.pdb
2019-08-01 12:28:01 +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
Michael Natterer cd1ba1cd17 pdb, libgimp: add proper support for multiline section comments
and move the "Gimp" section docs to the generated file.
2019-07-31 12:18:44 +02:00
Michael Natterer 0a02855a59 Revert "pdb, libgimp: fix some annotations in gimp.c and gimp_pdb.c."
This reverts commit b687f111f6.

We will generate annotations for all PDB wrappers automatically.
2019-07-30 20:54:53 +02:00
Jehan b687f111f6 pdb, libgimp: fix some annotations in gimp.c and gimp_pdb.c. 2019-07-30 20:42:53 +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 b2f660ae43 app, pdb, libgimp: remove the "plug-in precision-enabled" API and logic
There is no old way of accessing pixels any longer, all plug-ins are
now precsion-enabled.
2019-07-20 01:53:31 +02:00
Michael Natterer b7cf850671 plug-ins: remove the oilify plug-in and add a PDB compat procedure 2019-07-19 17:35:13 +02:00
Jehan 5fce763612 pdb: fix wrong default value on gimp-plug-in-emboss compat proc.
Commit eca4ca8c8c was fixing a generated
file. My bad!
2019-07-19 14:00:07 +02:00
Michael Natterer 8a51993e3f pdb, plug-ins: remove the emboss plug-in and add a PDB compat procedure
Not for 2.10 because it looks a bit different.
2019-07-18 15:05:48 +02:00
Michael Natterer 31fc338ab0 pdb, plug-ins: remove the newsprint plug-in and add a PDB compat procedure 2019-07-18 12:52:18 +02:00
Michael Natterer 2ead56096d plug-ins, pdb: remove the softglow plug-in and add a PDB compat procedure
Not for 2.10 because the GEGL op's result looks different. I have no
clue how softglow is supposed to look at all, but the removed plug-in
did things that can't possibly be done with physical light in a
darkroom, so chances are the GEGL op is more correct.
2019-07-14 21:34:27 +02:00
Michael Natterer a0ae31d337 plug-ins, pdb: remove the edge-dog plug-in and add a PDB compat procedure
This is not for 2.10 because the result of the GEGL op looks different,
but without doubt more correct.
2019-07-14 20:09:11 +02:00
Michael Natterer 8fcccf3f88 plug-ins, pdb: remove the contrast-normalize plug-in
and add a PDB compat procedure.
2019-07-14 14:28:40 +02:00
Michael Natterer 8b08f958ba plug-ins, pdb: remove the edge-neon plug-in and add a PDB compat procedure 2019-07-13 23:59:31 +02:00
Michael Natterer ceb327f357 plug-ins, pdb: remove the photocopy plug-in and add a PDB compat procedure
The results are different here too, but tweakable like for cartoon.
2019-07-11 12:33:56 +02:00
Michael Natterer 529ee9efc8 plug-ins, pdb: remove the cartoon plug-in and add a PDB compat procedure
The result of the GEGL op is a bitt different but so what, this is an
artistic effect and the result can be tweaked with parameters.
2019-07-11 11:41:06 +02:00
Michael Natterer fc89dfb09b pdb, libgimp, app: add gimp_drawable_get_thumbnail_format()
so plug-ins can allocate buffers and stuff before getting the actual
thumbnail data.
2019-07-10 15:10:03 +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 aace6b179b Issue #3512 - feather selection doesn't work at edges of images
Add a "gboolean edge_lock" parameter to GimpChannel::feather() and a
"Selected areas continue outside the image" toggle to the "Feather
Selection" dialog, just like they exist for shrink selection and
border selection. At the end, convert the boolean to the right abyss
policy for gegl:gaussian-blur.
2019-06-16 16:51:30 +02:00
Michael Natterer 710cfc1f47 app: fix undoing image parasite attach/detach to emit the right signals
Add "gboolean push_undo" parameters to gimp_image_parasite_attach()
and _detach() and use the API also from undo, instead of implementing
attaching/removing manually and forgetting about the signals.

Fixes updating of the image properties color profile page.
2019-05-30 16:51:29 +02:00
Jehan 45f37b9b63 app, libgimp, pdb: s/procesures/procedures/
While we are at it, another typo was missed.
2019-05-10 01:38:33 +09:00
luz.paz 86edc31b11 Misc. typos
Found via `codespell`
2019-05-09 09:13:37 -04:00
Ell e83d8ac4f2 app: merge layers in chunks, and show progress
In gimp_image_merge_layers() -- the internal function used by the
various layer-merging/flattenning functions -- process the merged-
layer graph in chunks, using gimp_gegl_apply_operation(), instead
of in one go, using gegl_node_blit_buffer().  Processing in chunks
better utilizes the cache, since it reduces the size of
intermediate buffers, reducing the chances of hitting the swap when
merging large images (see, for example, issue #3012.)

Additionally, this allows us to show progress indication.  Have the
relevant gimpimage-merge functions take a GimpProgress, and pass it
down to gimp_image_merge_layers().  Adapt all callers.
2019-02-25 05:10:50 -05:00
Ell 82c449496e app, pdb: use compat formats for brushes/patterns in plug-ins
Plug-ins are not prepared to handle high-precision brushes/
patterns, even when they're otherwise aware of high-precision
drawables, so make sure to always use compat formats when
communicating brush/pattern data to plug-ins.

Allowing plug-ins to handle high-precision brush/pattern data would
require some additional API.
2019-02-07 09:19:20 -05:00
Jehan 90e9eb3fca app: alt-click to pick a layer will loop through candidate layers.
If you click on a zone filled in several visible layers, you don't
necessarily want the top layer. You may want one below. With this
change, as long as you hold alt, you will loop through all candidate
layers from top to bottom (then looping back top when reaching the
bottom).
In a first alt-click, you will always end up to the top candidate.
2019-01-07 23:08:48 +01:00
Michael Natterer ce55cfa7b2 pdb: remove gimp_get_theme_dir() and gimp_get_icon_theme_dir() 2019-01-04 16:00:25 +01:00
Michael Natterer dfe3e23622 libgimp: fix gimp_drawable_get_format() to honor the drawable's space
The raw PDB wrapper _gimp_drawable_get_format() only transfers the
format's encoding, so we need to add the space from the image's color
profile.

Also fix handling of indexed formats: remove our own indexed format
cache and rely on babl_new_palette_with_space() to return the same
format for any (encoding, space) combination.

Also update the PDB docs to reflect that most magic is happening in
the libgimp C wrapper.
2019-01-01 18:28:10 +01:00
Jehan cd924f453a app: do not make line art bucket fill a GimpSelectCriterion anymore.
This was my initial choice, but the more I think about it, the less I am
sure this was the right choice. There was some common code (as I was
making a common composite bucket fill once the line art was generated),
but there is also a lot of different code and the functions were filled
of exception when we were doing a line art fill. Also though there is a
bit of color works (the way we decide whether a pixel is part of a
stroke or not, though currently this is basic grayscale threshold), this
is really not the same as other criterions. In particular this was made
obvious on the Select by Color tool where the line art criterion was
completely meaningless and would have had to be opted-out!

This commit split a bit the code. Instead of finding the line art in the
criterion list, I add a third choice to the "Fill whole selection"/"Fill
similar colors" radio. In turn I create a new GimpBucketFillArea type
with the 3 choices, and remove line art value from GimpSelectCriterion.

I am not fully happy yet of this code, as it creates a bit of duplicate
code, and I would appreciate to move some code away from gimpdrawable-*
and gimppickable-* files. This may happen later. I break the work in
pieces to not get too messy.
Also this removes access to the smart colorization from the API, but
that's probably ok as I prefer to not freeze options too early in the
process since API needs to be stable. Probably we should get a concept
of experimental API.
2018-12-12 15:27:48 +01:00
Jehan db18c679f3 app: reorganize the line art code inside a GimpLineArt object.
The code was too much spread out, in core and tool code, and also it was
made too specific to fill. I'll want to reuse this code at least in the
fuzzy select tool. This will avoid code duplication, and also make this
new process more self-contained and simpler to review later (the
algorithm also has a lot of settings and it is much cleaner to have them
as properties rather than passing these as parameters through many
functions).

The refactoring may not be finished; that's at least a first step.
2018-12-07 22:18:06 +01:00
Jehan d71efdec20 app: add the segment and spline max length options for line art.
We can't just hardcode this. On huge images in particular, you'll want
to increase this value.
2018-11-29 17:29:42 +01:00
Jehan 6bec0bc82d app: radius map actually not useful during smart colorization grow step.
The distance map has all the information we need already. Also we will
actually grow up to the max radius pixel (middle pixel of a stroke).
After discussing with Aryeom, we realized it was better to fill a stroke
fully (for cases of overflowing, I already added the "Maximum growing
size" property anyway).
2018-11-27 14:59:35 +01:00
Jehan eb042e6c87 app: add "line-art-max-grow" property to the bucket fill options.
When flooding the line art, we may overflood it in sample merge (which
would use color in the line art computation). And if having all colors
on the same layer, this would go over other colors (making the wrong
impression that the line art leaked).
This new option is mostly to keep some control over the mask growth.
Usually a few pixels is enough for most styles of drawing (though we
could technically allow for very wide strokes).
2018-11-22 18:13:58 +01:00
Jehan 3467acf096 app: replace gegl:watershed-transform with custom algorithm.
We don't really need to flow every line art pixel and this new
implementation is simpler (because we don't actually need over-featured
watershedding), and a lot lot faster, making the line art bucket fill
now very reactive.
For this, I am keeping the computed distance map, as well as local
thickness map around to be used when flooding the line art pixels
(basically I try to flood half the stroke thickness).

Note that there are still some issues with this new implementation as it
doesn't properly flood yet created (i.e. invisible) splines and
segments, and in particular the ones between 2 colored sections. I am
going to fix this next.
2018-11-22 14:24:52 +01:00
Jehan 3f58a38574 app: remove now useless erosion size option.
Since commit b00037b850, erosion size is not used anymore, as this step
has been removed, and the end point detection now uses local thickness
of strokes instead.
2018-11-19 14:18:18 +01:00
Jehan 824af12438 app: edit the bucket fill tool options with new line art options.
I have not added all the options for this new tool yet, but this sets
the base. I also added a bit of TODO for several places where we need to
make it settable, in particular the fuzzy select tool, but also simply
PDB calls (this will need to be a PDB context settings.

Maybe also I will want to make some LineArtOptions struct in order not
to have infinite list of parameters to functions. And at some point, it
may also be worth splitting a bit process with other type of
selection/fill (since they barely share any settings anyway).

Finally I take the opportunity to document a little more the parameters
to gimp_lineart_close(), which can still be improved later (I should
have documented these straight away when I re-implemented this all from
G'Mic code, as I am a bit fuzzy on some details now and will need to
re-understand code).
2018-11-14 13:37:42 +01:00
Jehan f246f40494 app: compute line art in advance.
Right now, this is mostly meaningless as it is still done sequentially.
But I am mostly preparing the field to pre-compute the line art as
background thread.
2018-11-14 13:37:42 +01:00
Michael Natterer 0b99fc8194 plug-ins, pdb: remove the fractal-trace plug-in and add a PDB compat proc 2018-10-20 13:05:17 +02:00
Michael Natterer 6938d11716 Issue #1997 - Colors not properly converted to image's color space
Add a Babl space parameter to gimp_gegl_color_new() and all utility
functions using it. Pass NULL if the GimpRGB actually is sRGB, pass
the image's layer space if the color was already converted using
gimp_pickable_srgb_to_image_color() or similar.
2018-08-09 20:04:44 +02:00
Michael Natterer e09e563a70 Initial space invasion commit in GIMP
All babl formats now have a space equivalent to a color profile,
determining the format's primaries and TRCs. This commit makes GIMP
aware of this.

libgimp:

- enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
  as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
  NON_LINEAR and PERCPTUAL for each encoding, matching the babl
  encoding variants RGB, R'G'B' and R~G~B~.

- gimp_color_transform_can_gegl_copy() now returns TRUE if both
  profiles can return a babl space, increasing the amount of fast babl
  color conversions significantly.

- TODO: no solution yet for getting libgimp drawable proxy buffers in
  the right format with space.

plug-ins:

- follow the GimpPrecision change.

- TODO: everything else unchanged and partly broken or sub-optimal,
  like setting a new image's color profile too late.

app:

- add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
  replacement for all "linear" booleans.

- change gimp-babl functions to take babl spaces and GimpTRCType
  parameters and support all sorts of new perceptual ~ formats.

- a lot of places changed in the early days of goat invasion didn't
  take advantage of gimp-babl utility functions and constructed
  formats manually. They all needed revisiting and many now use much
  simpler code calling gimp-babl API.

- change gimp_babl_format_get_color_profile() to really extract a
  newly allocated color profile from the format, and add
  gimp_babl_get_builtin_color_profile() which does the same as
  gimp_babl_format_get_color_profile() did before. Visited all callers
  to decide whether they are looking for the format's actual profile,
  or for one of the builtin profiles, simplifying code that only needs
  builtin profiles.

- drawables have a new get_space_api(), get_linear() is now get_trc().

- images now have a "layer space" and an API to get it,
  gimp_image_get_layer_format() returns formats in that space.

- an image's layer space is created from the image's color profile,
  change gimpimage-color-profile to deal with that correctly

- change many babl_format() calls to babl_format_with_space() and take
  the space from passed formats or drawables

- add function gimp_layer_fix_format_space() which replaces the
  layer's buffer with one that has the image's layer format, but
  doesn't change pixel values

- use gimp_layer_fix_format_space() to make sure layers loaded from
  XCF and created by plug-ins have the right space when added to the
  image, because it's impossible to always assign the right space upon
  layer creation

- "assign color profile" and "discard color profile" now require use
  of gimp_layer_fix_format_space() too because the profile is now
  embedded in all formats via the space.  Add
  gimp_image_assign_color_profile() which does all that and call it
  instead of a simple gimp_image_set_color_profile(), also from the
  PDB set-color-profile functions, which are essentially "assign" and
  "discard" calls.

- generally, make sure a new image's color profile is set before
  adding layers to it, gimp_image_set_color_profile() is more than
  before considered know-what-you-are-doing API.

- take special precaution in all places that call
  gimp_drawable_convert_type(), we now must pass a new_profile from
  all callers that convert layers within the same image (such as
  image_convert_type, image_convert_precision), because the layer's
  new space can't be determined from the image's layer format during
  the call.

- change all "linear" properties to "trc", in all config objects like
  for levels and curves, in the histogram, in the widgets. This results
  in some GUI that now has three choices instead of two.
  TODO: we might want to reduce that back to two later.

- keep "linear" boolean properties around as compat if needed for file
  pasring, but always convert the parsed parsed boolean to
  GimpTRCType.

- TODO: the image's "enable color management" switch is currently
  broken, will fix that in another commit.
2018-07-21 16:42:57 +02:00
Ell b4ac956859 app, pdb: add gimp-register-file-handler-priority procedure
Add a gimp-register-file-handler-priority procedure, which can be
used to set the priority of a file-handler procedure.  When more
than one file-handler procedure matches a file, the procedure with
the lowest priority is used; if more than one procedure has the
lowest priority, it is unspecified which one of them is used.  The
default priority of file-handler procedures is 0.

Add the necessary plumbing (plus some fixes) to the plug-in manager
to handle file-handler priorities.  In particular, use two
different lists for each type of file-handler procedures: one meant
for searching, and is sorted according to priority, and one meant
for display, and is sorted alphabetically.
2018-07-17 02:56:18 -04:00
Michael Natterer 2cd829eb85 app: add GimpAuxItem as base class for GimpGuide and GimpSamplePoint
and GimpAuxItemUndo for their respective undo classes.
2018-07-15 17:08:06 +02:00
Michael Natterer 680642e37c plug-ins, pdb: remove the unsharp-mask plug-in and add a PDB compat proc 2018-07-14 17:11:25 +02:00
Michael Natterer bab75b7365 Change a bazillion URLs to https://
Including all user-visible link and links called from code, like
the help pages.
2018-07-14 14:19: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
Ell 49ca383fa4 app, pdb: use gimp_babl_is_valid() in more places
Use gimp_babl_is_valid(), added in the previous commit, to validate
image-type/precision combinations in various functions.
2018-07-06 13:44:57 -04:00
Jehan d56a8d439e app: do not stop the measurement when straightening.
Instead just transform the measurement extremities appropriately to
still map to the same points.
To do so, I also added out parameters to gimp_image_resize_to_layers()
so that calling code can get offsets from old origin (as well as new
image dimensions).
2018-06-05 23:34:30 +02:00
Michael Natterer e88fb8e9c7 app: remove all old font management code, switch to GimpFontFactory[View]
Biggest change in this commit is reordering stuff in GimpContext
because GimpFont is now a first class citizen.
2018-06-03 01:27:06 +02:00
Ell da27632c11 pdb: change image freeze/thaw procs to "Since: 2.10.2" 2018-05-29 16:04:28 -04:00
Ell f2134180de app, pdb: wait for fonts to load before dependent operations
Use gimp_fonts_wait(), added in the previous commit, to wait for
fonts to finish loading before operations that depend on font
availability.  In particular, this includes font- and text-related
PDB functions, and text-layer rendering.
2018-05-29 16:04:28 -04:00
Jehan 2484dec7d5 Issue #1211: Load fonts in background after startup.
Fonts should not be blocking startup as this provides a very bad
experience when people have a lot of fonts. This was experienced even
more on Windows where loading time are often excessively long.
We were already running font loading in a thread, yet were still
blocking startup (thread was only so that the loading status GUI could
get updated as a feedback). Now we will only start loading and proceed
directly to next steps.
While fonts are not loaded, the text tool will not be usable, yet all
other activities can be performed.
2018-05-27 02:13:33 +02:00
Michael Natterer 8511eb6451 pdb: remove all compat procedures for the old lcms plug-in 2018-05-20 21:06:33 +02:00
Michael Natterer 5ece7a8d1f Port a lot of stuff from GdkScreen/monitor_number to GdkMonitor
including some fixes for getting pointer coords, and needed
API changes in libgimpwidgets.
2018-05-20 21:06:30 +02:00
Michael Natterer f180a171cd pdb: remove all deprecated procedures 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
Michael Natterer 7e1df2c8c6 app: add layers/channels/vectors freeze/thaw to gimpplugin-cleanup
so plug-ins cannot thaw what they haven't frozen, and the code
can clean up frozen stuff left behind by crashed or broken plug-ins.

Also redo the cleanup code so it only keeps track of the undo group
counts and freeze counts of what *this* GimpPlugInProcFrame did
itself. That should make it even stricter against broken code that
could mess up internals.
2018-05-07 20:09:07 +02:00
Michael Natterer b15f38d21f pdb: add "Since: 2.10" to the newly added freeze/thaw procedures 2018-05-07 10:16:52 +02:00
Ell 40e3406b91 pdb: add gimp-image-{freeze,thaw}-{layers,channels,vectors}
These procedures freeze/thaw the corresponding containers of the
image, allowing plug-ins that perform many changes affecting any of
these containers to suppress updates to the corresponding dialogs,
significantly improving performance.
2018-05-07 02:56:10 -04:00
Michael Natterer 12908aed8c pdb: don't change generated files... 2018-05-01 14:14:00 +02:00
Michael Natterer 12904cffc8 pdb: fix typo s/chanel/channel/ 2018-04-26 20:46:32 +02:00
Simon Budig 44a931e16c ripple: put the compat code in the proper place, fix up POTFILES.in 2018-04-24 14:26:39 +02:00
Michael Natterer db227148f0 pdb: finally deprecate gimp-color-balance
Since nobody can tell me how the new gimp-drawable-color-balance can
be improved, it's going to be identical, just with a namespace.
2018-04-23 18:20:05 +02:00
Michael Natterer a9fb4f9a39 pdb: make all item-transform procedures honor the "linked" flag
and improve their documentation.
2018-04-23 17:10:46 +02:00
Michael Natterer b80036e14f pdb: deprecated gimp-layer-translate
and port all plug-ins/scripts to gimp-item-transform-translate.
2018-04-23 15:49:23 +02:00
Michael Natterer acbdc4d5b4 pdb: add gimp-item-transform-translate procedure
We were only able to translate selections and layers (bot not channels
and paths) via the PDB, this new procedure fixes that. Deprecation of
old API and some more transform consistency to follow...
2018-04-23 03:06:23 +02:00
Michael Natterer 8be37da012 Bug 795418 - Gimp 'critical error' when running luminosity masks script
In the gimp-channel-combine-masks PDB wrapper, only push an undo step
if the modified channel is attached to an image. It's a completely
reasonable use case to combine unattached channels.
2018-04-21 10:41:29 +02:00
Jehan 38a2887802 app, pdb: s/gimp_pdb_item_is_modifyable/gimp_pdb_item_is_modifiable/
Fix proper English.
2018-04-20 23:34:01 +02:00
Michael Natterer 12d38816a5 pdb: fix formatting of generated code in item_transform.pdb 2018-04-19 01:03:29 +02:00
Michael Natterer 428110f63f app: remove non-cut/copy/paste functions from gimp-edit.[ch]
Move them to the new files gimpdrawable-edit.[ch] and
gimpimage-fade.[ch].
2018-04-18 23:48:33 +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 c0dd812ea6 pdb: fix use of "seed" properties in plug_in_compat.pdb
now that GeglParamSpecSeed is uint.
2018-04-17 00:42:15 +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 410e55c40c pdb: never pass bogus supersample values to gimp_drawable_gradient()
even when supersampling is not enabled, or we will get warnings about
out-of-range property values.
2018-04-16 01:18:05 +02:00
Michael Natterer 5ee67deea5 pdb: deprecate all non-clipboard functions in the "edit" group
Still have to port script-fu scripts...
2018-04-15 16:39:59 +02:00
Michael Natterer 1305926f38 pdb: forgot to add drawable_edit.pdb 2018-04-15 16:15:58 +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
Michael Natterer 5f6dfc7617 app: add GimpGradientBlendColorSpace parameter to gimp_drawable_gradient() 2018-04-14 01:34:50 +02:00
Michael Natterer 4f2e078ccb Bug 795230 - Rename Blend tool and provide PDB compatibility
Rename gimpdrawable-blend.[ch] to gimpdrawable-gradient.[ch]
2018-04-13 23:43:27 +02:00
Michael Natterer bf49b47620 Bug 795207 - Add color space to blend(gradient) tool options
First WIP commit, adds:

- enum GimpGradientBlendColorSpace { RGB_PERCEPTUAL, RGB_LINEAR }
- linear blending mode for gradient segments
- tool options GUI for the blend and paint tools which use gradients
2018-04-13 22:33:16 +02:00
Michael Natterer 3f95dc52d3 Bug 791519 - Unexpected selection from channel
Make sure a channel -> selection -> channel roundtrip never does any
gamma conversion.

In gimp_channel_duplicate(), make sure a created channel has the
right format, and the right data. Fixes selection -> channel.

When switching off quick mask, call gimp_item_to_selection() instead
if gimp_selection_load(), the latter was implementing a shortcut which
is now wrong.

Remove gimp_selection_load() which is now unused.

Unrelated: also remove gimp_selection_save(), it was an obvious
3-liner used only twice.
2018-04-10 02:00:23 +02:00
Michael Natterer 6effffba93 pdb: one of the recent typo fixes was in a generated file 2018-04-10 01:58:12 +02:00
Michael Natterer 753bd0a0c9 pdb: add jehan_pdb_misc() and use it in the new procedures
so they have the correct aithor.
2018-03-18 13:57:43 +01:00
Jehan 1789f0fe2a app, libgimp, pdb: update gimp_edit_blend() description.
Make it known that gimp_context_set_distance_metric() influences the end
render of a shapeburst blend.
2018-03-18 13:21:05 +01: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
Jehan 34fe992f44 app: keep track of number of errors and traces in GimpCriticalDialog.
We don't want an infinite number of traces because it takes some time to
get. Until now I was keeping track of traces in app/errors.c, but that
was very sucky because then I was limiting traces per session. Instead
save them as a variable of a GimpCriticalDialog instance. Therefore only
generate the traces for WARNING/CRITICAL at the last second, when
calling the dialog.
When too many traces are displayed, just fallback to just add error
messages only. But then even errors without traces can be time-consuming
(if you have dozens of thousands of errors in a few seconds, as I had
the other day, updating the dialog for all of them would just freeze the
whole application for a long time).
So also keep track of errors as well and as last fallback, just send the
remaining errors to the stderr.
2018-02-12 02:09:15 +01:00
Michael Natterer 539927ebfa app: replace all g_assert() by the newly added gimp_assert()
which is just a #define to g_assert for now, but can now easily be
turned into something that does some nicer debugging using our new
stack trace infrastructure. This commit also reverts all constructed()
functions to use assert again.
2018-02-11 22:23:10 +01:00
Ell 7e661d3ca9 pdb: allow adding masks to group layers in layer-add-mask
... and a small fix to last commit.
2018-02-05 15:33:55 -05:00
Ell 9befb8594e pdb: fail layer-remove-mask if applying a mask to a group layer
... which is not supported.
2018-02-05 15:15:22 -05:00
Jehan a700b15e37 pdb: oups! I previously edited a generated file.
This is the PDB I had to edit instead of app/pdb/message-cmds.c which is
generated.
2018-01-28 15:43:07 +01:00
Michael Natterer dce93c7d7e Bug 762443 - Levels tool Output Level sliders works incorrectly
Add "clamp-input" (which clamps the input values to [0..1])
and "clamp-output" (which clips the final result to [0..1]),
properties, parameters and GUI to:

- GimpLevelsConfig
- GimpOperationLevels
- The levels tool dialog
- The gimp_drawable_levels() PDB API

The old deprecated gimp_levels() PDB API now sets both clamping
options to TRUE which restores the 2.8 behavior.

Also reorder some stuff in GimpLevelsConfig and elsewhere so the
levels parameters are always in the same order.
2018-01-02 18:47:20 +01:00
Michael Natterer b05cfc6050 pdb: (try 3) move PDB generation and sources to toplevel/pdb
It never belonged inside "tools". Also rename its "pdb" subdirectory
to "groups". This had to happen before 2.10 so cherry-picking between
branches doesn't become a nightmare in the future.
2017-12-17 14:16:08 -05:00