Commit Graph

43858 Commits

Author SHA1 Message Date
Jehan 0f0cf4df87 po-python: install again localization for Python plug-ins.
This used to be deactivated. Let's install them again.
Also activate localization in the palette-to-gradient plug-in.
2019-07-28 21:06:36 +02:00
Jehan 7444b8eb9c libgimpthumb: do not scan gimpthumb-enums.c for introspection.
gimpthumb-enums.c is a built source from the header. No need to scan it.
As a side effect, it fixes another build break as it could not recognize
the construction rule for this file.
Thanks to tmanni for raising these build issues.
2019-07-28 20:59:10 +02:00
Jehan 01e958422b libgimpthumb: argh! Copy paste error which broke the build. 2019-07-28 20:42:36 +02:00
Jehan ebc797a64e libgimp: update gimp.def.
How come I always forget this so annoying file?!
2019-07-28 20:02:40 +02:00
Jehan 65fb7536e1 plug-ins: port Python plug-in palette-to-gradient to introspected API.
Localization still doesn't work, but this is normal (po-python is not
installed). I will later make the proper tests for this.

Other than this, it is a pretty simple port. It lost all particularities
and facilities of pygimp, but the fact that it now works similarly to
the C API is quite nice too.
It still uses the legacy API for plug-ins though and will have to be
ported further when the new API will be stable.

Also I still haven't figured out why we need to return the number of
returned values. With the proper annotations, an array length parameter
disappears in introspected Python (because it is useless as Python lists
know their length). But it would seem that this annotation doesn't work
the same for returned values, which is a bit sad as it creates ugly
redundancy.

It can be noted that I an going to move all Python plug-ins from
plug-ins/pygimp/plug-ins/ to plug-ins/python/. The whole pygimp/
subdirectory will actually be deleted eventually (I keep it around for
now as reference) as Python plug-in should not need to be considered
particularly from now on. They can just be considered as generic
executables.
2019-07-28 18:43:00 +02:00
Jehan 521ff83cba configure: some Python test cleanup/improvements.
In particular, when header check fails, Python option is disabled.

Also let's use pkg-config to search for the Python include directory.
The reason is that include/python{version} is not always
true. On my system in particular, python3.7 was in `include/python3.7m`.
2019-07-28 18:43:00 +02:00
Akkana Peck 872aa50c56 Re-enable Python in the build, but requiring Python >3.6.0 since...
... we'll need that for gobject introspection
Edit by Jehan: don't actually re-enable pygimp, only do bring back the
Python 3 configure search.
2019-07-28 18:43:00 +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
Jehan 3a9ae8cc69 libgimp: API to create GimpParam from values.
The `data` property of a GimpParam is a union. Unfortunately setting a
union is not supported by GObject Introspection yet. So I create some
APIs to create GimpParam-s from values. Note that this is temporary API
(i.e. it may be removed before GIMP 3 release) since we likely won't use
this GimpParam type anymore with the new plug-in API. But for now, this
is necessary, at least for testing and porting Python plug-ins.

Also for GimpParam to be actually introspectable, I had to make it a
boxed type, but since no length information is available for various
variants of the type (arrays, whose length information is a separate
parameter), the copy and free functions are basically broken or leaking
respectively for all types requiring a length.

Bottom line: this is ugly and we really need a new introspectable
parameter type. But for now, it allows to start porting some of our
Python plug-ins.
2019-07-28 18:43:00 +02:00
Michael Natterer 624d091887 libgimpbase: use _gimp_write_read_color() and _write_color()
instead of dealing with the 4 doubles manually.
2019-07-28 18:00:42 +02:00
Michael Natterer 32ea28b6b1 app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
  information needed for constructing all GParamSpecs we use, don't
  use GimpPDBArgType in GPProcInstall but an enum private to the wire
  protocol plus the GParamSpec's GType name. Bump the wire protocol
  version.

- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
  take care of converting between GPParamDef and GParamSpec. They
  share code as far as possible.

- Change pluginrc writing and parsing to re-use GPParamDef and the
  utility functions from gimpgpparamspecs.

- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
  the entire core uses proper GParamSpecs from the wire protocol now,
  the whole file will follow down the drain once we use a GValue
  representation on the wire too.

- In gimp_plug_in_handle_proc_install(), change the "run-mode"
  parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
  already an enum). and change all places in app/ to treat it as an
  enum value.

- plug-ins: fix cml-explorer to register correctly, a typo in
  "run-mode" was never noticed until now.

- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
  between old-style wire communication and using GParamSpec and
  GValue, it contains some functions that are subject to change or
  even removal in the next steps.

- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
  able to actually install procedures the new way.

- plug-ins: change goat-exercise to completely use the new GimpPlugIn
  and GimpProcedure API, look here to see how plug-ins will look in
  the future, of course subject to change until this is finished.

- Next: changing GPParam to transmit all information about a GValue.
2019-07-28 17:34:40 +02:00
Jordi Mas 83d485d9c6 Update Catalan translation 2019-07-28 12:36:10 +02:00
Ell 5a500b4a12 app: use longer iteration inteval (= bigger chunks) when applyng an op
In gimp_gegl_apply_[cached_]operation(), use a longer iteration
interval (resulying in bigger chunks) when processing the op, than
the iteration interval used for rendering the projection.  In
particular, use an even longer interval when processing area
filters, since their may be particularly sensitive to the chunk
size (see, for example, issue #3711).  Likewise, use the asme
longer interval when not showing progress indication, since we
don't need to stay responsive in this case (but don't avoid
chunking altogether, to reduce the space required for intermediate
results).

This allows us to process an op faster when committing a filter,
while still remaining responsive (if overall slower) during
preview.
2019-07-28 12:10:18 +03:00
Ell f6c4e4912a app: add gimp_gegl_node_is_area_filter_operation()
... which determines if a node is an area filter operation.  If the
node is a meta op, we conservatively return TRUE, as it may involve
an area-filter op.
2019-07-28 12:10:18 +03:00
Ell a1f676aabd app: in the gradient tool, set the graph's underlying node
... to the gimp:gradient node
2019-07-28 12:10:17 +03:00
Jehan ab6783902e libgimpbase: more (transfer) and (element-type) warnings fixed. 2019-07-28 10:09:46 +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 c67fa791be GOI: add more introspected libraries as dependencies to ours.
This fixes various "Unresolved type" warnings.
2019-07-27 23:41:54 +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 3597e92a20 libgimpcolor: add gimp_param_spec_rgb_get_default() 2019-07-27 16:10:24 +02:00
Piotr Drąg 597f3e0916 Update Polish translation 2019-07-27 15:36:58 +02:00
Jordi Mas a375a744c7 Update Catalan translation 2019-07-27 12:10:08 +02:00
Jehan 2e03300eb7 desktop: new <release> appdata tag for GIMP 2.10.14. 2019-07-26 19:44:10 +02:00
Michael Natterer 0093487d33 libgimp: include the new file in gimp.h 2019-07-26 16:08:09 +02:00
Michael Natterer 427b01a634 libgimp: add GType and GParamSpec types for all IDs, like image, drawable
Same set of functions and types as in app/, but purely ID-based.
2019-07-26 16:05:11 +02:00
Michael Natterer d74ae12781 app: oops these two files were not meant to be pushed just yet 2019-07-26 16:02:33 +02:00
Michael Natterer 76ee0f6559 app, libgimpbase: move lots of GValue and GParamSpec types to libgimpbase
all the stuff from app/core/gimpparamspecs.[ch] that is not about
image, drawable etc IDs, these will have to go to libgimp with
different implementations than in app/.
2019-07-26 15:54:33 +02:00
Michael Natterer 5c7134f3a5 app, pdb: rename GIMP_TYPE_COLOR_ARRAY to GIMP_TYPE_RGB_ARRAY
and rename its GParamSpec too. Also, always say "foo_array" not
"fooarray".
2019-07-26 12:58:19 +02:00
Michael Natterer 6cb8a59501 app: fix gimp_value_set_drawable(), set_channel()
to work like gimp_value_set_item() and properly deal with all sorts of
drawables and channels.
2019-07-26 12:14:25 +02:00
Michael Natterer 4a5f0508e9 libgimp: remove GimpParamRegion, it was never used 2019-07-26 02:37:52 +02:00
Michael Natterer 8a462e867d libgimp: add a GimpProcedure class
Mostly the same code as GimpProcedure in app/pdb/.

Move the "run" function to GimpProcedure. Add API to GimpPlugIn to
list and create procedures, and always keep a list of the plug-ins
procedures around. Still only using the old params and return_vals.
2019-07-26 02:11:35 +02:00
Michael Natterer f2d399b17b libgimp: add initial version of a GimpPlugIn class
The new way of doing plug-ins:

- subclass GimpPlugIn in your plug-in
- implement its query() and run() methods, run() will move to a
  new GimpProcedure class soon
- instead of MAIN(), say GIMP_MAIN(YOUR_PLUG_IN_TYPE)

Instead of keeping around a GimpPlugInInfo struct, libgimp will
create an instance of your plug-in class, keep it around during
the plug-in's lifetime, and call its virtual functions.
2019-07-25 23:07:24 +02:00
Jehan 771d415b5f app: rename "On color" matting preview mode to "Color".
As discussed earlier with mitch and tmanni.
2019-07-25 22:44:41 +02:00
Michael Natterer e7af081b05 libgimpbase: fix docs of struct GimpParamSpecValueArray 2019-07-25 21:32:36 +02:00
Jehan c20645054c libgimp: update annotations for gimp_install_procedure() and...
... GimpRunProc function type.
In gimp_install_procedure(), make sure that @params and @return_vals are
processed as arrays, otherwise they are unusable.

As for the run procedure, make so that @return_vals and @n_return_vals
are considered as returned values. In Python binding for instance, that
makes these not parameters anymore, but actually returnable by the run
function.

With these changes, I made the first fully functional GI Python plug-in,
which just creates a new image and a display for this image. Still a lot
to improve clearly, but we are on the right track. :-)
2019-07-25 19:27:16 +02:00
Jehan 74c69ae3c2 libgimp: update the def.
Also add a "Since: 3.0" and fix the query_proc docs.
2019-07-25 16:58:18 +02:00
Jehan febc1a843d libgimp: add gimp_plug_in_info_set_callbacks().
This is an alternative way to set up a plug-in callbacks, apart from
setting directly the PlugInInfo struct properties.
The reason is that setting directly the Gimp*Proc properties crashes the
plug-in, when done through the Python GI binding.

It is most likely a bug in Pygobject, unless we need the proper
annotation (which I haven't found yet). See:
https://gitlab.gnome.org/GNOME/pygobject/issues/24#note_564968

Setting these callbacks from the C code works fine though, hence this
new API. It is to be noted that the '(scope async)' is the most
important part in this function annotations. Without these annotations,
the function pointers become invalid at the end of the set_callbacks()
call, hence the plug-in crashes when they are actually called.

Unfortunally I am also notified by ebassi that using (scope) at all (any
of the 3 possible values) is just wrong. An API change will be
necessary. For the time being, I leave this like this, for the sake of
testing further, but we'll need to improve things.
2019-07-25 16:23:07 +02:00
Michael Natterer 8aaf517db4 devel-docs: add screenshots of more widgets 2019-07-25 15:24:59 +02:00
Øyvind Kolås 23ade7b80b build, app: require babl-0.1.68 or newer 2019-07-25 15:10:22 +02:00
Michael Natterer 7ddf40b78b app: make sure the display is not rotated by a very small angle
gimp_display_shell_rotate_update_transform(): reliably set rotation to
0.0 using an epsilon of 1e-3.
2019-07-25 12:48:37 +02:00
Michael Natterer c144cf69de libgimp*: use more g_clear_pointer() 2019-07-25 12:37:52 +02:00
Jehan 692272e580 libgimp: add some comment documentation to Gimp*Proc callback types.
It doesn't really help yet with the problem I encountered allowing to
set and run these Python callbacks from the C code (cf. pygobject#347),
but at least let's improve a bit the documentation.
2019-07-25 11:59:07 +02:00
Jehan c260b4d50d libgimp: add correct annotation for gimp_main().
With GObject introspection, this allows to properly use this function,
otherwise it sees the argv argument as a string (and not an array of
string), which cannot be used properly.
For instance, with Python binding, you can just call it like this:

> Gimp.main (info, sys.argv)
2019-07-25 11:02:53 +02:00
Jehan 6389bb4b58 libgimp, libgimpbase: both introspectable under same namespace Gimp.
At first I thought these could be different namespaces, but actually
GObject Introspection parses files and can only use (AFAICS) the
namespace actually used in our C function, which is always `gimp_` (and
not `gimpbase_` or whatever.

So make the introspection at the root level, and it will include all
libgimp* libraries in one namespace, same as the C lib anyway. For now
only libgimp and libgimpbase as I am still testing.
Also I move the introspectable sources in their own file in order to
share the list between the library building Makefile and the GI
makefile because I can't find how to pass over variables otherwise.
2019-07-25 10:51:03 +02:00
Jehan 0c75cd7fc4 configure, libgimpbase, m4macros: first steps into API introspection.
So far only libgimpbase is introspected. It just works though (I could
test that I could just run a plug-in which could access libgimpbase API
without any problem).
The g-ir-scanner call outputs a lot of warning but I won't care for
these right now.

The `introspection.m4` is taken straight from GEGL tree.
2019-07-25 10:51:03 +02:00
Michael Natterer fe75ef28ad libgimpwidgets: fix docs for GimpBusyBox:message 2019-07-25 10:24:30 +02:00
Michael Natterer ec18b969a3 app: remove gimp_display_shell_filter_new(), it's empty and useless 2019-07-25 09:55:55 +02:00
Michael Natterer 42a7d17d1a app: add missing include to gimpdisplayshell-filter.c 2019-07-25 09:15:07 +02:00
Michael Natterer 572775a60b devel-docs: update the libgimpwidgets docs with new widget shots
Added some more and some minor fixes.
2019-07-24 19:19:04 +02:00