Commit Graph

8662 Commits

Author SHA1 Message Date
Michael Natterer 8265cb8f9d plug-ins: port file-psp to GimpPlugIn and libgimp objects, untested 2019-08-24 19:52:36 +02:00
Michael Natterer cd4fbb6213 plug-ins: port file-pcx to GimpPlunIn and libgimp objects 2019-08-24 19:27:46 +02:00
Michael Natterer 7f65383ad4 plug-ins: port file-xpm to GimpPlugIn and to libgimp objects 2019-08-24 18:56:03 +02:00
Michael Natterer 0ae833b0e0 plug-ins: port file-tga to GimpPlugIn and libgimp objects 2019-08-24 18:34:53 +02:00
Michael Natterer 9847072978 plug-ins: port file-faxg3 to GimpPlugIn and libgimp objects
No idea if this works, I didn't find an example image.
2019-08-24 18:08:31 +02:00
Michael Natterer e6322e319c plug-ins: port file-fits to GimpPlugIn and libgimp objects 2019-08-24 17:49:58 +02:00
Michael Natterer 71d56d8e6f plug-ins: port file-bmp to GimpPlugIn and libgimp objects 2019-08-24 17:26:00 +02:00
Michael Natterer 2fd17029f4 plug-ins: port file-cel to GimpPlugIn and libgimp objects 2019-08-24 17:04:38 +02:00
Michael Natterer 44ebcee901 plug-ins: port file-xwd to GimpPlugIn and libgimp objects 2019-08-24 16:46:40 +02:00
Michael Natterer d7fb408267 plug-ins: port file-gif-save to GimpPlugIn and libgimp objects 2019-08-24 15:57:54 +02:00
Michael Natterer ed041bff39 plug-ins: port file-html-table to GimpPlugIn and libgimp objects 2019-08-24 13:53:16 +02:00
Michael Natterer 5428cc60b0 plug-ins: port file-header to GimpPlugIn and libgmp objects 2019-08-24 13:41:48 +02:00
Michael Natterer 037e8a6e49 plug-ins: port file-csource to GimpPlugIn and libgimp objects 2019-08-24 13:33:54 +02:00
Michael Natterer 55049488dc plug-ins: port file-pnm to GimpPlugIn and libgimp objects 2019-08-24 13:18:49 +02:00
Michael Natterer ee5a93f368 plug-ins: port file-raw-data to GimpPlugIn and libgmp objects 2019-08-24 12:33:18 +02:00
Michael Natterer 3636541b42 plug-ins: port file-webp to GimpPlugIn and libgimp objects 2019-08-24 11:45:01 +02:00
Michael Natterer 9f3bc2bd7a plug-ins: port file-xbm to GimpPlugIn and libgimp objects 2019-08-24 10:58:34 +02:00
Michael Natterer e1c2150f64 plug-ins: port file-heif to GimpPlugIn and libgimp objects 2019-08-24 10:23:01 +02:00
Michael Natterer 23197cfa9b plug-ins: port file-pix to GimpPlugIn and libgimp objects 2019-08-24 03:02:13 +02:00
Michael Natterer 3bef94d56f plug-ins: port file-jpeg to GimpPlugIn and to libgimp objects 2019-08-24 02:33:45 +02:00
Jehan e8bbf42eba Issue #3841: double mnemonics.
I kept the 'i' as 'f' was already used for another widget.
2019-08-23 01:26:53 +02:00
Jehan 4942acbc46 plug-ins: animation-play ported to new GimpImage/Drawable objects. 2019-08-23 00:56:41 +02:00
Jehan 753434369b plug-ins: port file-svg to libgimp objects. 2019-08-23 00:36:57 +02:00
Jehan 858ab51f44 plug-ins: port file-gif-load to new libgimp objects. 2019-08-22 23:41:36 +02:00
Jehan 5e87258067 plug-ins: plugin-browser and procedure-browser don't need porting. 2019-08-22 23:30:19 +02:00
Jehan f9582f1a2f plug-ins: port file-pdf-load to libgimp objects. 2019-08-22 23:23:23 +02:00
Jehan 2211e4eb0e plug-ins: port file-wmf to libgimp objects. 2019-08-22 23:11:03 +02:00
Jehan 54dab3285d plug-ins: update/fix the 3 non-C goat-exercise.
The JS and Python 3 had to be ported to the new GimpImageProcedure API.

The Lua one was still using the old ID API hence was broken. Also not
sure why run_mode enum has become a string in Lua with the new
GimpImageProcedure API (probably some automatic conversion happening
during the C to Lua binding?), but well… it works like that, so what.

Sync also the late changes from the C goat exercise, like for instance
not returning an error when selection is empty as well as keeping the
order of calls to be the same across the 4 supported demo scripts.
2019-08-22 23:02:06 +02:00
Jehan 883fbd7b65 plug-ins: fixing automake warnings about source in subdirectories.
This fixes:
> warning: source file 'images/imagemap-icon-images.c' is in a subdirectory,
> but option 'subdir-objects' is disabled
And similar warnings.
2019-08-22 22:36:50 +02:00
Michael Natterer e1fe044779 plug-ins: minor follow-up to the icon include fix two commits below 2019-08-22 21:17:14 +02:00
Michael Natterer e146e4747a plug-ins: port file-xmc to GimpPlugIn and new API objects 2019-08-22 21:13:21 +02:00
Félix Piédallu 211e5f51a5 plug-ins: do not #include c autogenerated sources 2019-08-22 18:45:31 +02:00
Jehan 2d0584dc91 plug-ins: port file-psd to GimpImage/GimpDrawable. 2019-08-22 15:54:37 +02:00
Jehan 6e68f18685 plug-ins: port file-ps to GimpImage/GimpDrawable. 2019-08-22 15:54:37 +02:00
Jehan bbf90b3ba5 plug-ins: port film to GimpImage/GimpDrawable. 2019-08-22 15:54:37 +02:00
Jehan 3e06295adf plug-ins: port pagecurl to GimpImage/GimpDrawable. 2019-08-22 15:54:37 +02:00
Jehan 00e750776a plug-ins: port print to GimpImage/GimpDrawable/etc. 2019-08-22 15:54:36 +02:00
Jehan 962e8b995e plug-ins: port gfig to GimpImage|Drawable. 2019-08-22 15:54:36 +02:00
Jehan 7838c7f2b2 plug-ins: port fractal-explorer to GimpImage|Drawable. 2019-08-22 15:54:36 +02:00
Jehan 6db115e475 plug-ins: unit-editor does not need GimpImage porting.
It doesn't use any image/drawable, whatever.
2019-08-22 15:54:36 +02:00
Jehan e6b141ffe4 plug-ins: port file-tiff to GimpImage|Drawable|Vectors, etc. 2019-08-22 15:54:36 +02:00
Jehan adc4f8e589 plug-ins: port mail to GimpImage/GimpDrawable. 2019-08-22 15:54:36 +02:00
Jehan 8f34af49b7 plug-ins: port file-png to GimpImage/GimpDrawable. 2019-08-22 15:54:36 +02:00
Jehan 9f0dbb5759 plug-ins: port screenshot to GimpImage/GimpDrawable. 2019-08-22 15:54:36 +02:00
Jehan 0b64395fa6 plug-ins: port colormap-remap to GimpImage/GimpDrawable. 2019-08-22 15:54:36 +02:00
Jehan 1b6e6b9b53 plug-ins: port file-exr to GimpImage/GimpDrawable. 2019-08-22 15:54:36 +02:00
Jehan 3d4bf19bae plug-ins: port file-sgi to GimpImage/GimpDrawable. 2019-08-22 15:54:36 +02:00
Jehan 08849a584c libgimp: GimpItem now also belong to libgimp. 2019-08-22 15:54:36 +02:00
Jehan cfd30ec62a libgimp: s/gimp_image_new_by_id()/gimp_image_get_by_id()/
This means that images' ownership is not given to caller in particular.
libgimp will now keep a reference of all GimpImage-s it creates and
return this same reference if called again. It also means that you can
now compare images by pointer comparison (as 2 GimpImage objects
representing the same image ID will be equal).
Obviously as a side effect, gimp_image_list() is changed to (transfer
container) as you must only free the container now, not the elements.
Also various other functions creating new images are now (transfer none)
too.

Long-time plug-ins will have to be taken in consideration in a further
step (we currently never free GimpImage for destroyed images in
particular).
2019-08-22 15:54:36 +02:00
Jehan 8559cee053 plug-ins: improve parameter creation on Python 3 goat-exercise.
PyGObject seems to have at least 3 syntaxes to create object properties.
Though the one I used previously was apparently the recommended syntax,
it was clearly a bit messy and not clear. This alternative syntax ends
up much more compact, really look alike the C-style, which is a good
thing and is very visual. From what I can see, we should also override
the get|set_property() methods, but since we are not going to actually
set any value (this is only a workaround to make a GParamSpec), it seems
to work fine without.
2019-08-22 15:54:36 +02:00
Jehan c95e9334d1 plug-ins: port file-raw plug-ins to GimpImage/GimpDrawable. 2019-08-22 15:54:36 +02:00
Jehan e29cb0329c plug-ins: port file-compressor to GimpImage/GimpDrawable. 2019-08-22 15:54:36 +02:00
Jehan 3e636ba0c6 plug-ins: port file-desktop-link to GimpImage/GimpDrawable. 2019-08-22 15:54:36 +02:00
Jehan 0cb995e8a4 plug-ins: port file-gih to GimpImage/GimpDrawable. 2019-08-22 15:54:36 +02:00
Jehan d6365c778e plug-in: port file-gbr to GimpImage/GimpDrawable. 2019-08-22 15:54:36 +02:00
Jehan abd4d6fab8 plug-ins: port file-pat to GimpImage/GimpDrawable. 2019-08-22 15:54:36 +02:00
Jehan 0fa09282f2 plug-ins: port file-ico to the new GimpImage/GimpDrawable objects. 2019-08-22 15:54:36 +02:00
Jehan ee8b467e9f libgimp: GimpSaveProcedure() now uses GimpImage/GimpDrawable object...
... as parameters.
And GimpLoadProcedure() now expects the run() function to return a
GimpImage object.
2019-08-22 15:54:36 +02:00
Jehan 292b697f3e plug-ins: use GimpDrawable class in Python goat-exercise.
And re-enable it. Now it works fine!
2019-08-22 15:54:36 +02:00
Jehan 9b8f6089ce plug-ins: port JavaScript goat-exercise to new GimpImage API.
Note how much nicer it is in bindings!
2019-08-22 15:54:36 +02:00
Jehan 52811edcee plug-ins: C goat-exercise now ported to new GimpImage/GimpDrawable.
You'll notice that with the new class when used together with the new
GimpPlugIn API, it is not needed to allocate/destroy anymore the
GimpImage/GimpDrawable. These can be directly the parameters.
2019-08-22 15:54:36 +02:00
Jehan 433fcd4334 plug-ins: ported a few plug-ins to new GimpImage/GimpDrawable classes. 2019-08-22 15:54:36 +02:00
Jehan e0d50aa121 plug-ins: keep building all plug-ins with old API.
Build existing plug-ins with -DGIMP_DEPRECATED_REPLACE_NEW_API.
We will port the plug-ins one at a time to the new GimpImage API.
2019-08-22 15:54:36 +02:00
Michael Natterer 2b310999fc plug-ins: port file-wmf to GimpPlugIn 2019-08-20 10:22:27 +02:00
Michael Natterer 4c3f3c451b plug-ins: port file-pdf-load to GimpPlugIn 2019-08-20 02:32:15 +02:00
Michael Natterer 4cb4b3ef3a plug-ins: port all plug-ins to the new macros 2019-08-20 01:03:38 +02:00
Michael Natterer 1253faaab3 plug-ins: change all ported thumbnail loaders to GimpThumbnailProcedure 2019-08-19 14:04:00 +02:00
Michael Natterer d62e75a41f Move GimpParamSpecString from libgimp back to app
It's just too weird to be public. Remove its properties from the wire
protocol and from pluginrc. Instead, have all GParamSpecs' flags on
the wire and in pluginrc, so we can use stuff like
GIMP_PARAM_NO_VALIDATE.

Port the remaining few places to GIMP_PROC_ARG_STRING().

I'm sure something is broken now wrt UTF-8 validation,
will add tighter checks in the next commit.
2019-08-19 12:54:52 +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 9cabc8c8d0 libgimp, plug-ins: use the new macros everwhere
Except for gimp_param_spec_string() which is on its way back to the
core.
2019-08-19 10:02:07 +02:00
Michael Natterer 64920f01eb plug-ins: port file-svg to GimpPlugIn 2019-08-18 23:47:03 +02:00
Michael Natterer 1e49befef3 plug-ins: link file-svg against GEGL, it uses it indirectly 2019-08-18 23:19:58 +02:00
Jehan 045d03a3de plug-ins: some very minor style (alignment) fixes. 2019-08-18 22:37:31 +02:00
Jehan 4799619bbc plug-ins: fix various plug-ins ported to GimpImageProcedure.
All the GimpImageProcedure must remap the order of their additional
arguments (i.e. subtracts 3).
This fixes the other plug-ins changed in commit 15019fef52 which had
such additional arguments.
2019-08-18 22:26:33 +02:00
Jehan 5b3e8e1f05 plug-ins: fix pagecurl arguments order after GimpImageProcedure port.
The additional arguments are ordered down -3.
2019-08-18 21:53:45 +02:00
Jehan 011ae15460 plug-ins: canonicalize curve-bend.
Since commit 11ce199cea, we reject non-canonical procedure name. We
have one such in our plug-ins in curve-bend. Fix this.
2019-08-18 21:50:14 +02:00
Michael Natterer b444954d03 plug-ins: port file-ps to GimpPlugIn 2019-08-18 18:28:32 +02:00
Michael Natterer 17648ead86 plug-ins: port file-fig-load to GimpPlugIn
And also fix a glitch in my earlier g_strlcpy() commit that would keep
most GIFs from being loaded, oops.
2019-08-18 15:04:57 +02:00
Michael Natterer 15019fef52 plug-ins: port many plug-ins from GimpProcedure to GimpImageProcedure
Also move the call to set_icon_name() after set_menu_label(), all
ported plug-ins should look the same so we are a good example for copy
and paste ;)
2019-08-18 13:45:58 +02:00
Michael Natterer d89e6ca7e9 plug-ins: port goat-exercise-c to GimpFileProcedure
and fix loading of the plug-in source code into the text view. Also,
ancountering a zero-sized selection is not an error, but simply a
successful nop.
2019-08-18 13:14:27 +02:00
Michael Natterer 293d909cf4 plug-ins: port file-psd to GimpPlugIn
and remove all save arguments, they are completely unused, wtf?
2019-08-18 00:26:13 +02:00
Jehan 91bde62b08 plug-ins: make mail more robust.
I got a 'Invalid cross-device link' error (errno 18) on my system. Let's
add some redundancy and try g_file_move() if g_rename() failed.
This at least fixed my case.
2019-08-17 10:54:03 +02:00
Michael Natterer 253a163c3f plug-ins: port file-tiff to GimpPlugIn 2019-08-16 22:55:56 +02:00
Michael Natterer 732d7c6a27 plug-ins: port file-png to GimpPlugIn
This commit removes all save procedures except gimp-png-save with all
parameters, and kills the default value handling procedures.

Default handling is now broken for NONINTERACTIVE use, but we will
handle this much better and consistent for all save procedures inside
GimpSaveProcedure
2019-08-16 21:55:34 +02:00
Jehan 0abdbebaad plug-ins: fix and install the Lua goat-exercise.
So procedure:new_return_values() just seems broken with LGI. It doesn't
even look like it reaches the C code.
Anyway we can also just reconstruct the GimpValueArray, which works
fine. We now have official support for Lua plug-ins!
2019-08-16 19:46:32 +02:00
Jehan bbfa8f8e3e plug-ins: Lua goat-exercise now showing its own source too. 2019-08-16 17:36:00 +02:00
Jehan a09b7a9c92 plug-ins: add a Lua goat-exercise.
It is working fine except that it crashes at the end when running
procedure:new_return_values(). I have not understood why yet, but it may
be a bug in lua LGI. Maybe we'll have to create the returned
GimpValueArray by hand in Lua.
Also the dialog does not show the source yet.

This is not installed yet (and lua interpreter is not checked at
configure) because of these issues which I will have to figure out. In
the meantime, I commit this work-in-progress.
2019-08-16 17:05:18 +02:00
Jehan ef5c091e58 plug-ins: add Python and JavaScript files to the DIST.
So it seems that whatever is in _SCRIPTS is not in the distribution by
default (I suppose the reason is that even scripts can be generated). So
let's add the non-generated scripts to EXTRA_DIST.
2019-08-16 14:53:19 +02:00
Michael Natterer ebc09985b0 plug-ins: port file-sgi to GimpPlugIn 2019-08-15 21:37:43 +02:00
Michael Natterer 7edd28706f file-exr: use gimp_pdb_get_last_error() instead of gimp_get_pdb_error() 2019-08-15 19:03:09 +02:00
Michael Natterer c6fa23c22c plug-ins: port file-exr to GimpPlugIn 2019-08-15 19:00:10 +02:00
Michael Natterer 652fd75891 Rename GIMP_TYPE_INT8_ARRAY to GIMP_TYPE_UINT8_ARRAY
and GimpParamSpecInt8Array to GimpParamSpecUInt8Array
2019-08-15 15:04:34 +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 1bf90ec77f Remove GIMP_TYPE_INT8 and GimpParamSpecInt8
Use guchar and GParamSpecUChar instead.
2019-08-15 13:34:11 +02:00
Michael Natterer b3a05a9f1d plug-ins: port colormap-remap to GimpPlugIn 2019-08-15 12:47:31 +02:00
Michael Natterer 5c4fa2de51 plug-ins: port screenshot to GimpPlugIn 2019-08-15 11:48:05 +02:00
Michael Natterer b007269729 Use g_strlcpy() instead of strncpy() everywhere
except where I didn't understand the code after 10 seconds of
looking..
2019-08-14 23:52:38 +02:00
Michael Natterer bb8d18ed39 plug-ins: port mail to GimpPlugIn 2019-08-14 22:06:19 +02:00
Michael Natterer b6ca0c4433 plug-ins: port unit-editor to GimpPlugIn 2019-08-14 20:24:02 +02:00
Michael Natterer ff5dd3f3cf plug-ins: port animation-play to GimpPlugIn 2019-08-14 20:03:06 +02:00
Michael Natterer 30c3fd4de5 plug-ins: port fractal-explorer to GimpPlugIn 2019-08-14 18:57:16 +02:00
Michael Natterer 0b5f5bf70a plug-ins: port gfig to GimpPlugIn 2019-08-14 12:58:27 +02:00
Michael Natterer 037421dee0 plug-ins: port film to GimpPlugIn 2019-08-14 12:39:07 +02:00
Michael Natterer 0bfc4cf7b2 plug-ins: port all file-raw plug-ins to GimpPlugIn 2019-08-14 01:34:11 +02:00
Michael Natterer 966c49d08e plug-ins: remove some crack code from curve-bend
containing the last use of gimp_run_procedure().
2019-08-14 00:11:21 +02:00
Michael Natterer 10f1fcf066 plug-ins: port file-ico to GimpPlugIn 2019-08-14 00:06:22 +02:00
Michael Natterer 29165fde7f plug-ins: port file-gih to GimpPlugIn 2019-08-13 22:53:04 +02:00
Michael Natterer 358bbd932c plug-ins: port print to GimpPlugIn 2019-08-13 19:41:52 +02:00
Michael Natterer bc5cfaea25 plug-ins: port file-compressor to GimpPlugIn 2019-08-13 19:10:55 +02:00
luz.paz c1585d609b Misc typo fixes in plug-ins/ 2019-08-13 11:50:51 -04:00
Michael Natterer 1e717a0dc6 plug-ins: port file-gbr to GimpPlugIn, and clean up file-pat a bit 2019-08-13 13:36:20 +02:00
Michael Natterer 0491f653fa plug-ins: port help-browser to GimpPlugIn 2019-08-13 00:38:02 +02:00
Ell 21649c5eaa Issue #3341 - Add Bevel doesn't work for high thickness values
Something during the port to gimp-drawable-edit (commit
233ac80de1) broke add-bevel.scm when
the thickness is high enough for the selection to become empty.

Add an explicit check for a selection while constructing the bump-
map layer.
2019-08-12 22:18:18 +03:00
Michael Natterer 103a7e4fc3 plug-ins: port script-fu to GimpPlugIn
This probably has some bugs, but worked flawlessly in my tests...
2019-08-12 20:49:08 +02:00
Michael Natterer 85d9a291a2 script-fu: undeprecate slide.scm 2019-08-12 20:08:55 +02:00
Michael Natterer 1c9b3c7055 libgimp: add gimp_pdb_get_last_error() and _get_last_status()
and move the old API to gimplegacy.[ch].
2019-08-11 16:41:58 +02:00
Michael Natterer cd836e9d96 libgimp: add gimp_file_procedure_set_handles_uri()
Implementing a shiny new GimpFileProcedure doesn't mean the libraries
we use to load/save files are automatically capable of handling remote
files, so we still need this flag.
2019-08-11 12:52:28 +02:00
Michael Natterer f042d21989 plug-ins: port file-desktop-link to GimpLoadPocedure 2019-08-11 12:31:41 +02:00
Michael Natterer c377644ba5 plug-ins: port file-pat-save to GimpSaveProcedure 2019-08-10 22:01:37 +02:00
Jehan f9f144b4bc configure: add a check for gjs (JavaScript interpreter with GI binding).
As discussed on IRC, I am not sure if really this is needed, since
theoretically we now have support for a whole bunch of languages without
doing anything (languages supported by GObject Introspection) and we are
not going to check for all of them.
Yet since now we install one JS plug-in, let's still do a quick check.
We'll see later if we want to change how we handle supported script
languages.
2019-08-09 18:40:14 +02:00
Jehan c1f28f7e8c plug-ins: rename the C goat exercise to goat-exercise-c.
Makes for consistent naming of the different demo code we have there.
2019-08-09 15:48:25 +02:00
Jehan d0be3d3e0c plug-ins: get rid of getCurrentPath() in goat-exercise-gjs.js.
The file path was already the same as ARGV first argument (i.e.
System.programInvocationName as I added this myself!). Why did I even
bothered with this annoying trick!
This makes the code much simpler, which is better for demo code.
2019-08-09 15:48:25 +02:00
Jehan 9ed4dd5dde plug-ins: add a goat-exercise-py3.py.
Right now it is not working, always because of the same bug about not
being able to create GParamSpec (pygobject#227). As a consequence, I
tried a workaround by creating object properties and using their spec
instead. But it turns out that in pygobject, I cannot create random
properties for custom types (well I could for boxed types or GObject
subclasses, not for GimpImageID or GimpDrawableID). Cf. pygobject#357.
So I am stuck again.

Anyway I still push this demo file which would just work as it is, if we
coult at least got the image/drawable ID.
I comment out the Makefile.am part for now until we can get the issues
sorted out.
2019-08-09 15:48:25 +02:00
Jehan 9454567e8c plug-ins: pre-load Babl module in Python console. 2019-08-09 14:41:40 +02:00
Michael Natterer 55940b733b libgimpwidgets: add a GDestroyNotify for gimp_help_connect()'s user_data 2019-08-09 13:11:30 +02:00
Michael Natterer fd55514416 plug-ins: eek, twain calls gimp_main() directly
Make it call gimp_main_legacy() instead.
2019-08-09 00:50:32 +02:00
Michael Natterer 155bc75a75 libimp*, app: get rid of inline pixbufs in the API and in pluginrc
because they are deprecated.

Change GIMP_ICON_TYPE_INLINE_PIXBUF to GIMP_ICON_TYPE_PIXBUF and the
libgimp API to (icon-name, GdkPixbuf, GFile). Use the file's uri and a
PNG blob of the pixbuf to pass around on the wire and for storage in
pluginrc.
2019-08-09 00:16:35 +02:00
Jehan 6ffd25b9f7 plug-ins: use new procedure.set_icon_name() in JavaScript demo. 2019-08-08 17:43:13 +02:00
Jehan 88ff7ca258 plug-ins: nearly-complete goat-exercise in JavaScript.
Only missing parts are:
- localization.
- help function and id unset.
- gimp_procedure_set_icon() should probably be reviewed for proper
  introspection.
- Finally there is a String() conversion which raises a warning, but I
  couldn't find the proper standard replacement code.
Other than this, the goat-exercise was totally reproduced in JavaScript.
2019-08-08 11:57:23 +02:00
Jehan f625e2ddfb menus, plug-ins: move script development related plug-ins in a...
"Development" submenu. Also get rid of the "Languages" placeholder.
2019-08-08 11:17:07 +02:00
Michael Natterer 169f98f915 libgimpwidgets: add GDestroyNotify to gimp_int_combo_box_connect() 2019-08-08 00:22:15 +02:00
Michael Natterer c6bcb3114f libgimp: add GDestroyNotify for image and item combo box data 2019-08-07 23:16:25 +02:00
Michael Natterer cbefd8e5bb libgimpwidgets: add GDestroyNotify for gimp_query_foo_box() user_data
This is ugly shit that should go down the canal but let's just fix
these GI warnings.
2019-08-07 22:48:06 +02:00
Jehan faf2db71cd plug-ins: improve Makefile.am of python/ subdir.
The old rules were crap and basically copying the scripts in build
folder before installing. Get proper/simpler rules.
2019-08-07 19:52:09 +02:00
Jehan 863c0849c8 desktop, plug-ins, tools: update various .gitignore. 2019-08-07 19:20:52 +02:00
Michael Natterer 7f0c801559 plug-ins: link goat-exercise against GTK 2019-08-07 18:47:24 +02:00
Jehan 6ed3b4898c plug-ins: goat-exercise improved to show a dialog.
This just adds a dialog before running the actual processing of data.
- it also shows what the run-mode is for;
- the purpose of the plug-in becomes explicit (plug-in creation
  documentation);
- it shows some GTK+ code too.
- last but not least, the code is actually shown for people to study,
  with a button to access the last version of the code on gitlab.

This makes the plug-in a lot more useful and understandable this way.
Other exercise plug-ins in other languages will have to do the same
thing.
2019-08-07 16:13:49 +02:00
Jehan 6b17c942cf plug-ins: adding a hello-world plug-in in javascript.
It is not installed yet, I am just committing my first version. Further
version should look like goat-exercise as an example of what must be
done in javascript.
Also the plug-in stopped working with one of the recent libgimp commits,
without any change in the plug-in code. This will need to be
investigated before installing.
2019-08-07 00:53:17 +02:00
Jehan fc33489223 plug-ins: move goat-exercise to a goat-exercises/ directory.
We will fill this up with more examples of plug-ins in other languages.
Also we will improve a bit the examples to redirect people to source
code so that they understand what these plug-ins are.
2019-08-07 00:00:20 +02:00
Jehan f16ad87f2d plug-ins: add .gitignore files. 2019-08-06 23:22:18 +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 d6d987ebac plug-ins: port plugin-browser to GimpPlugIn 2019-08-06 19:13:06 +02:00
Jehan bfda31a67e configure: fix the Python checks.
1/ First I realize we were still using AM_PATH_PYTHON() and not
   AM_PATH_PYTHON3().
2/ We don't need to check anymore for pygtk, pycairo, nor do we need
   Python headers. Everything is now taken care of by GObject
   Introspection and we have nothing else to build GIMP-side.
3/ Change --enable-python into --with-python. We don't actually build
   anything now. There is no Python support to enable or disable
   anymore. We simply install Python plug-ins or not. The 3 values are
   "yes" (default, configure breaks if a Python 3 interpreter is not
   found), "no" (Python plug-ins are not installed, not recommended) and
   "force" (install Python plug-ins anyway even if an interpreter is not
   found; this can be useful especially for cross-compilation since
   Python is not useful at build-time anymore).

   Note that --with-python=force, if an interpreter is not found, the
   file `pygimp.interp` won't be installed. This is not a problem at all
   if the interpreter can be found at runtime the standard way.
   Otherwise packagers should add themselves a pygimp.interp file with
   the known interpreter path.
2019-08-06 18:35:53 +02:00
Jehan dc8f9dd168 plug-ins: add interactive run mode for palette-offset.
In interactive run-mode, the offset amount can be selected through a
small dialog box.
Only a WITH_LAST_VALS mode is still to be done.
2019-08-06 17:31:30 +02:00
Michael Natterer d8640d5b59 plug-ins: port procedure-browser to GimpPlugIn 2019-08-06 16:30:41 +02:00
Michael Natterer 05baadcd1d pdb: rename the "procedural_db" PDB group to just "pdb" 2019-08-06 12:51:56 +02:00
Jehan 82ada55b99 plug-ins: port palette-offset to Python 3.
Oups, I left the plug-in as Python 2. This was still a good
proof-of-concept that GIMP 3 will support as well Python 2 and Python 3
(even though Python 2 is end-of-life soon anyway).
2019-08-06 01:03:31 +02:00
Jehan dca353f8cd plug-ins: port palette-offset to new API.
This first version will just offset by 1 in interactive mode, by
default. The GIMP 2 version used to have a GUI, but it was not created
by the plug-in itself. I am guessing that maybe our Python wrapper used
to create GUI by default.
If so, this will have to change. Python plug-ins will be responsible of
their own GUI, just like C plug-ins.
2019-08-06 00:40:37 +02:00
Jehan 35d4b68edc plug-ins: add a "palette" argument to palette-to-gradient.
Older palette-to-gradient used to have a palette argument. Bring it
back. The logics is that if the string is empty or None, the procedure
will use the currently selected palette. Otherwise it will try to
transform the named palette into a gradient and will fail with an error
if this palette does not exist.
2019-08-06 00:29:33 +02:00
Michael Natterer 550ec68cff libgimp: reorder functions and members of GimpProcedure
to make more sense, as long as the file has little git history.
2019-08-05 23:01:25 +02:00
Sabri Ünal e93a20e7ac Issue #3112 - Missing mnemonics.
(cherry picked from commit 30e4a7ee5e)
2019-08-05 22:44:36 +02:00
Jehan aa6a1d369c plug-ins: use GtkSettings values to determine whether to use header bar.
As we do in other parts of the code.
Also applies the same thing to the console dialog itself.
2019-08-05 16:10:12 +02:00
Jehan 0af32861e7 plug-ins: GimpProcBrowserDialog with "use-header-bar" in Python-console.
We have code for this in gimp_proc_browser_dialog_new(), but it cannot
be moved in the object init() because this is a construction-time only
property. So this needs to be passed from the python call too.
2019-08-05 15:16:32 +02:00
Michael Natterer acbe229427 libgimp: make gimp_proc_view_new() show both new- and old-style args
And reduce its API to just (proc-name, menu-path), it can look up all
the shit from the PDB itself.
2019-08-05 14:17:18 +02:00
y-guyon 8f828d1899 plug-ins: WebP: save_dialog() before gimp_export()
As mentioned in issue #1777, exporting non-animated WebP images was
only keeping the current layer.
Mimick file-gif-save.c: display the encoding settings pop-up earlier
so that gimp_export_image() can merge the layers unless "As Animation"
is enabled. Call gimp_image_get_layers() directly in save_image() in
case the layers were merged (for clarity because layers are used only
for animations).
2019-08-05 09:46:46 +00:00
Michael Natterer fad59611bc libgimp: port gimpprogress to the new plug-in API, untested
It's tested to still work when using the old API though.
2019-08-04 17:51:59 +02:00
Michael Natterer b6033684ff plug-ins: add all brush, pattern etc. select buttons to pagecurl
They do nothing but testing themselves with the new plug-in API, this
is of course temporary.
2019-08-04 17:02:21 +02:00
Øyvind Kolås 1661aab620 plug-ins: link dds plugins against libm 2019-08-04 14:22:09 +02:00
Jehan c822350fb3 plug-ins: forgot to change run() signature to new API in python-console. 2019-08-04 12:22:01 +02:00
Michael Natterer eaf5c792bf plug-ins: port pagecurl to the new API, to have a GUI plug-in to test 2019-08-03 17:10:33 +02:00
Niels De Graef 5f92ced1f3 Add (nullable) if applicable
Basically this commit makes sure that all return values that are marked
as "Returns:" also have a `(nullable)` annotation if it is mentioned on
the same line that NULL can also be returned.

This will prevent a few problems in GObject-introspection.
2019-08-03 07:53:47 +00:00
Niels De Graef 1dda60154c Use "Returns:" to annotate return values
To be able to annotate return values through GObject-introspection, you
need to make sure it is tagged with `Returns:` and not something else.
2019-08-03 07:53:47 +00:00
Jehan 58b3ca816a plug-ins: port python-console to new API. 2019-08-03 09:46:52 +02:00
Jehan 04598b1522 plug-ins: use new gimp_procedure_add_*_from_property() in Python.
Since GParamSpec are not working fine (cf. pygobject#227), we have this
trick of initializing new arguments or return values with properties.
Use this trick in the palette-to-gradient plug-in.
2019-08-03 09:38:46 +02:00
Michael Natterer a50069e176 libgimp: change the return values of GimpPlugIn::init_procedures()
and ::query_procedures() to a GList* of strings.
2019-08-02 19:10:13 +02:00
Jehan bc7b358802 libgimp, plug-ins: remove n_procedures from (init|query)_procedures().
The way currently implemented plug-ins are, they are already
NULL-terminating the returned arrays. Since a procedure name cannot be
NULL itself by definition, defining the array length by a terminal NULL
is enough. There is no need to also add a n_procedures parameters which
is just one more possible bug source, even more as we were already
expecting the NULL termination by using g_strfreev() to free the memory.

Anyway a length parameter does not bring any advantage since a plug-in
can still "lie" about its array size (just as it can forget to
NULL-terminate it) and when this happens, the plug-in will segfault.
That's it, it's just a plug-in programming error.

Last but not least, some binding seem to have issues with returned array
setting an (out) parameter as the length. In pygobject at least, the
length parameter doesn't disappear and we end up with this ugly
signature:

> In [3]: Gimp.PlugIn.do_query_procedures.__doc__
> Out[3]: 'query_procedures(self) -> list, n_procedures:int'

See bug report pygobject#352.
To avoid this, we should either set both the array and the length as
(out) parameters or just set the returned array as NULL-terminated
(which is the solution I chose).
2019-08-02 13:50:38 +02:00
Jehan 3945701bd6 plug-ins: localization calls must happens inside query().
It's a bit weird because this has to happen during the query() step, but
plug-ins don't have access to this step anymore, apart from
query_procedures(), which then turns out to be badly named.
2019-08-02 12:58:37 +02:00
Michael Natterer 5f8d0ef27b libgimp: add gimp_plug_in_extension_enable() and _extension_process()
Start copying all the actual wire communication to GimpPlugIn, and
move the legacy versions to gimplegacy.c.

This implies having the entire protocol code twice, but without any
if(PLUG_IN) { plug_in_stuff(); } else { legacy_stuff(); }

At the moment it is a wild mixture of old and new, but when finished
the wire code in gimplegacy.c will be entirely separate from the wire
code in GimpPlugIn, which will make it easy to g_assert() that only
one API is used by a plug-in.
2019-08-02 12:02:20 +02:00
Jehan 17667b7ddf plug-ins: start porting palette-to-gradient to new GimpPlugIn API.
Several aspects of the new API are kind of broken in the Python binding,
especially the arguments. So this first version has no arguments at all.
This also means it cannot be installed in "<Palettes>" menu for the time
being. This is work-in-progress and the missing parts will be
uncommented later when we figure out how to fix the problems.
2019-08-02 03:03:47 +02:00
Michael Natterer 0bec2bcdec libgimp: add gimp_procedure_set_menu_label() and _set_documentation()
which replace _set_strings(). Add more docs.
2019-08-02 00:56:00 +02:00
Michael Natterer b511cf34cf libgimp: add gimp_procedure_set_attribution()
Also rename "author" to "authors" and add some docs.
2019-08-02 00:35:17 +02:00
Michael Natterer 82afcf5c85 plug-ins: help: use gimp_procedure_extension_ready() 2019-08-01 23:46:55 +02:00
Michael Natterer a841e0fb06 libgimp: add gimp_procedure_set_image_types()
and remove the "image_types" parameter from gimp_procedure_set_strings(),
which is only a bad hack copied from the core procedure class.
2019-08-01 23:09:01 +02:00
Michael Natterer e0a6eb38da libgimp: add run_data and run_data_destroy parameters to procedure_new()
so bindings work properly. Change plug-ins accordingly.
2019-08-01 22:45:49 +02:00
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 1e10cfc53f plug-ins: register an icon for goat-exercise 2019-07-30 19:25:06 +02:00
Michael Natterer a47789fcb8 plug-ins: and in ifs-compose too... 2019-07-30 18:37:05 +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 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 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 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
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 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 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
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
Federico Mena Quintero 16660c5928 file-svg: Use rsvg_handle_new_from_gfile_sync() instead of GIOChannel
The latter is obsolete, and rsvg_handle_write()/close() are deprecated
anyway.
2019-07-22 17:26:22 -05:00
Federico Mena Quintero b2027c40b7 Issue #2561: Fix computation of SVG image sizes
The librsvg API was being called in an incorrect order.  One cannot
call rsvg_handle_get_dimensions() until after rsvg_handle_close() is
done.
2019-07-22 17:26:22 -05:00
Michael Natterer 6bb03dc21a plug-ins: revive animation-play, and draw stuff with cairo
Still lots of deprecated stuff, but mostly GtkAction and friends.
2019-07-22 17:28:20 +02:00
Jehan ef3c13c6c5 plug-ins: use global gegl_init() in file-pdf-load run() function.
As noted by Mitch, this is simpler and what we do in other plug-ins.
2019-07-22 14:56:04 +02:00
Jehan 443c171f8d plug-ins: babl_init|exit() for non-interactive "file-pdf-load" too.
Improve my previous commit: I added babl_init|exit() for
"file-pdf-load-thumb". But these was actually also missing from
non-interactive calls to "file-pdf-load", since the initialization was
done as part of gimp_ui_init() so far.
Just run them down the call stack around the needed part. It's not a
problem if it's called double (for the interactive code path).
2019-07-22 12:39:45 +02:00
Michael Natterer f4b88c0a9e plug-ins: link file-pdf against GEGL/babl 2019-07-22 12:19:07 +02:00
Jehan e0a24a27de plug-ins: babl_init|exit() needs to be run for "file-pdf-load-thumb".
This is run as part of gimp_ui_init() in the normal "file-pdf-load"
calls, but such calls have been forgotten for the thumbnail load
procedure.

Also the GimpRunMode is only a parameter in "file-pdf-load". For
"file-pdf-load-thumb", the first parameter is directly the filename. The
fact it might have used to work is chance as it were only tested against
GIMP_RUN_INTERACTIVE, which is 0, so the test would end up FALSE, which
is what we want for thumbnail loading. Anyway now we get a proper call
(thumbnail loading always considered non-interactive).
2019-07-22 12:13:38 +02:00
Michael Natterer b9b8879ba0 plug-ins: some GTK3 undeprecation in imagemap 2019-07-22 10:28:37 +02:00
Michael Natterer 8e809160f0 plug-ins: port file-dds to GtkGrid 2019-07-22 01:37:11 +02:00