Commit Graph

43760 Commits

Author SHA1 Message Date
Michael Natterer 6a0ef1f7fe plug-ins: help: remove the temp proc using new API 2019-07-30 21:21:36 +02:00
Michael Natterer 46cacb5ebd plug-ins: help: use new API to call the help browser 2019-07-30 21:16:07 +02:00
Michael Natterer 941165961d plug-ins: port help to the new plug-in API, to test temp procs
and they do work :)
2019-07-30 21:04:11 +02:00
Michael Natterer 1c650801e8 plug-ins: follow gimp_procedure_new() API change in goat-exercise 2019-07-30 21:03:34 +02:00
Michael Natterer d64c0ebd30 libgimp: change GimpPlugIn and GimpProcedures so temp procs work 2019-07-30 21:02:58 +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
Ell 2331b88d7d app: fix #include in gimpdrawable.c
Local foo leak.
2019-07-30 21:36:38 +03:00
Ell fb679f9efa app: guarantee fully-COWed copies in more cases in paint code 2019-07-30 20:32:43 +03:00
Ell 2d80d4d138 app: use gimp_gegl_buffer_dup() everywhere
... instead of gegl_buffer_dup().
2019-07-30 20:32:41 +03:00
Ell 5798cefe1b app: add gimp_gegl_buffer_dup()
... as a drop-in replacement for gegl_buffer_dup(), which COWs all
tiles of the source buffer, including ones that aren't fully
included within buffer's extent.
2019-07-30 20:32:10 +03:00
Ell 69ce5e7e02 app: in gimp_gegl_buffer_copy(), allow tiles outside the abyss to be COWed
In gimp_gegl_buffer_copy(), assume that the area outside the abyss
is empty, and so, when the abyss policy is NONE, allow data otuside
the source/destination abyss to be copied, by temporarily modifying
the abyss.  This allows tiles that aren't fully contained within
the abyss to be COWed, unlike gegl_buffer_copy(), which has to be
more general.
2019-07-30 20:32:09 +03:00
Ell ab94251ae9 app: remove gimp_gegl_rectangle_align_to_tile_grid()
... and replace it with gegl_rectangle_align_to_buffer().
2019-07-30 20:32:08 +03:00
Michael Natterer 1e10cfc53f plug-ins: register an icon for goat-exercise 2019-07-30 19:25:06 +02:00
Michael Natterer 7a9e0d984e libgimp: add more registering API to GimpPlugIn and GimpProcedure
Icon, menu branch, translation domain and help domain can now be
registered using the objects' API instead of the direct PDB calls.
2019-07-30 19:23:55 +02:00
Michael Schumacher a001ce29a5 build: .gitlab-ci.yml: change babl build to meson 2019-07-30 19:08:16 +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 a47789fcb8 plug-ins: and in ifs-compose too... 2019-07-30 18:37:05 +02:00
Michael Natterer 2d471ce049 libgimpconfig: fix float parsing in gimp_config_deserialize_fundamental() too 2019-07-30 18:36:20 +02:00
Jehan 84ff060ffa libgimp: GValue of type GEnum not possible.
This fixes such warning:
> Warning: gvalue.c:188: cannot initialize GValue with type 'GEnum',
> this type is abstract with regards to GValue use, use a more specific
> (derived) type

And obviously all subsequent errors because we failed to initialize and
set enum values. Such as:

> Warning: g_value_set_enum: assertion 'G_VALUE_HOLDS_ENUM (value)' failed

I have only fixed this in gimp_image_pdb. If enum types are used in
other places with GimpValueArray, we must fix them the same way.
2019-07-30 17:34:57 +02:00
Jehan 67f33cb6ec plug-ins: add button mnemonics. 2019-07-30 16:34:06 +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
Jehan 82cfa9c25f libgimpwidgets: fix annotations in GimpDialog.
(skip) various variable length functions (va_list functions are not
introspectable anyway, but adding manual annotations shows we've have
been through them).

Also (skip) gimp_dialogs_show_help_button even though it could be
introspected without any problem. Yet it's written that's an
internal-only function, so let's forbid bindings from using it.

Finally fix gimp_dialog_add_button() introspection by properly including
Gtk-3.0 introspected library so that g-ir-* knows the GtkWidget type.
2019-07-30 15:37:42 +02:00
Michael Natterer e36028d2ac app, libgimp, libgimpbase: forgot to support GIMP_TYPE_UNIT on the wire
This commit can serve as an example how to add new types to
GimpProtocol, note that zero public API changes.
2019-07-30 15:04:06 +02:00
Michael Natterer 65a8ae2c91 libgimpbase: make the GimpParamSpecUnit struct public
like all other param specs.
2019-07-30 15:03:03 +02:00
Michael Natterer 82dd46580b app: use g_ascii_dtostr() in plug-in-rc.c it's locale-independent 2019-07-30 14:34:50 +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 f1351df9eb plug-ins: replace set_alternative_button_order_from_array() by the...
... Gimp.Dialog alternative version.
Just to get rid of the warning.
2019-07-30 14:05:38 +02:00
Jehan 9691d73058 libgimpwidgets: make a proper function out of the macro...
... gimp_dialog_set_alternative_button_order_from_array()
Macros are not introspectable, which means this call would not be
available for non-C plug-ins. Also adding a "Since: 3.0" since these
macros were added in commit 3be0d13be3.

Note that I don't do the same for the macro
gimp_dialog_set_alternative_button_order() because varargs functions
won't be introspected anyway. So this one can just stay a macro for C
plug-ins only.
2019-07-30 14:05:08 +02:00
Jehan 62d87f15d9 plug-ins: port python-console to new GObject-introspected API.
I may have missed things. That is the problem of non-compiled script
languages. There is also a known warning:
> DeprecationWarning: Gtk.Dialog.set_alternative_button_order_from_array is deprecated
I'll see later about this one.

Push-time note: calling various functions is actually broken right now
in the console since the late API changes (it was working fine yesterday
evening when I tested the same python-console code). Pushing anyway for
now.
2019-07-30 12:57:59 +02:00
Jehan afe0bcbc58 libgimpwidgets: introspect libgimpwidgets.
Only leave behind gimpcolorscale, gimpcolorscales and gimpcolorselect
for now. There are some GI compilation errors and I don't have the time
right now to look into it. Most of libgimpwidgets is available to GI
bindings now anyway.
2019-07-30 12:53:15 +02:00
Michael Natterer 1a8d300994 pdb: remove an obsolete snippet from lib.pl 2019-07-30 12:16:04 +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
Michael Natterer a0ee939dff pdb: "gtype", "dup_value_func" and "take_value_func" to all PDB types
so we have the toolkit for generating proper GType-based code in
libgimp. This commit changes no code yet.
2019-07-30 10:39:56 +02:00
Michael Natterer ee0b06cbf1 libgimp: remove all validation code from gimp_value_set_foo_id()
Validation is not the job of a GValue setter, we have the GParamSpec's
value_validate for that. Also, we will use the new GType-based API in
the libgimp PDB wrappers soon, and it's really a bad idea to
implicitly call e.g. gimp_image_is_valid() from the generated
gimp_image_is_valid() wrapper.
2019-07-30 10:28:26 +02:00
Michael Natterer e9443b2561 libgimpbase: add gimp_value_array_new_from_types()
and _new_from_types_valist()

which take a va_list of GTypes and creates a GimpValueArray
initialized with these types, so one can simply have a list of

g_value_set_foo (gimp_value_array_index (array, i), foo);

in the next lines. I'm not so sure this is the best API ever...
2019-07-30 10:26:08 +02:00
Michael Natterer 9e50f1ed8f libgimpbase: NULL-terminate the result of gimp_value_dup_string_array()
so it can be free'd with g_strfreev().
2019-07-30 01:38:07 +02:00
Jehan aab75bb1d0 plug-ins: install the pygimp.interp file.
Python scripts should already properly run, whether you run them with a
direct python shebang or a `env python` one (cf. previous commit). But
it's still nice to install a `.interp` file, which allows to control
exactly the interpreter to use, overriding the shebang. With this file,
Python scripts will use installation-time Python interpreter.

Also update old code to make the interp contents about Python 3 instead
of 2.
2019-07-29 14:28:29 +02:00
Jehan 9e844ae1d7 app: when interpreter not found in interpreter DB, leave shebang as-is.
In particular, if the shebang is `#!/usr/bin/env lang` and we have not
registered a specific interpreter for `lang`, the system should leave
the env tool search the right interpreter for us. We only bypass env
when we set our own explicit interpreter.

Apply this to palette-to-gradient.py plug-in.
2019-07-29 14:11:25 +02:00
Michael Natterer 9a547c14d5 libgimp: add preliminary function gimp_run_procedure_with_array()
which takes and returns GimpValueArrays. This or something similar is
the new central function for running core procedures. Use the new
function from gimp_run_procedure2().
2019-07-29 12:53:27 +02:00
Michael Natterer 39ee40b1f0 libgimp: pass the GimpValueArray to gimp_set_pdb_error()
not the cruft GimpParam array.
2019-07-29 12:42:47 +02:00
Michael Natterer 0402313e60 libgimp: forgot to enable one commented-out gimp_value_array_unref() 2019-07-29 12:33:08 +02:00
Michael Natterer 0a6f157d58 app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
  GValues we use, in the same way done for GPParamDef. GPParam is now
  different from GimpParam from libgimp, pointers can't be casted any
  longer. The protocol is now completely GimpPDBArgType-free. Remove
  gp_params_destroy() from the public API.

- libgimp: add API to convert between an array of GPParams and
  GimpValueArray, the latter is now the new official API for dealing
  with procedure arguments and return values, GimpParam is cruft (the
  wire now talks with GimpPlugIn more directly than with the members
  of GimpPlugInInfo, which need additional compat conversions).

- libgimp, app: rename gimpgpparamspecs.[ch] to simply
  gimpgpparams.[ch] which is also more accurate because they now
  contain GValue functions too. The code that used to live in
  app/plug-in/plug-in-params.h is now completely in libgimp.

- app: contains no protocol compat code any longer, the only place
  that uses GimpPDBArgType is the PDB query procedure implementation,
  which also needs to change.

- app: change some forgotten int32 run-modes to enums.
2019-07-29 12:22:58 +02:00
Jehan f74320d4dc Makefile: libgimpui also introspected. 2019-07-29 02:08:27 +02:00
Jehan 404ab1da46 po-python: deactivate pot generation on VPATH builds.
Also remove temporarily the non-ported Python plug-ins from POTFILES to
fix distcheck.
2019-07-29 02:05:25 +02:00
Michael Schumacher 732852a471 build: adding a .gitlab-ci.yml file for automated GitLab pipeline builds 2019-07-29 01:11:44 +02:00
Ell 41d3b478a2 configure.ac: s/GOBJECT_INTROSPECTION_CHECK/GOBJECT_INTROSPECTION_REQUIRE/
Make sure configure fails when introspection is not installed,
since we compile it unconditionally for now.
2019-07-29 02:02:04 +03:00
Jehan c63ae2f945 plug-ins: one more missing backslash.
Come on!
2019-07-29 00:15:56 +02:00
Jehan ee4e9bfee5 plug-ins: missing backslash broke EXTRA_DIST.
Because of this, EXTRA_DIST was empty, hence images and XML resource
file were missing from the distributed files.
2019-07-28 23:47:05 +02:00
Jehan 7e23ed454a libgimp: fix gimp.def.
A distcheck showed a bunch of missing functions, while others were
listed yet not exported.
2019-07-28 23:36:54 +02:00