Commit Graph

8662 Commits

Author SHA1 Message Date
Michael Natterer e4acb969ba plug-ins: port file-xpm to GimpProcedureConfig 2019-09-26 12:09:41 +02:00
Michael Natterer 9cb62f5f9a libgimp: move "image" and "run_mode" from gimp_procedure_config_end_run()
and remember them internally between begin_run() and end_run().
Simplifies plug-in code even more.

Move the begin_run() before gimp_export_image() block in all export
plug-ins.
2019-09-26 00:44:52 +02:00
Michael Natterer e8ed263e63 plug-ins: port file-sunras to GimpProcedureConfig 2019-09-25 23:26:28 +02:00
Michael Natterer 505473ab76 plug-ins: gih_save(): file-gih-save-internal takes a GFile now 2019-09-25 22:41:07 +02:00
Michael Natterer 9593121431 app, libgimpwidgets: return visible widgets from all gimp_prop_foo_new()
and remove a gazillion gtk_widget_show() all over the place, some
places need a gtk_widget_hide() now, and I'm pretty sure I broke at
least one thing in all those files...
2019-09-25 20:24:06 +02:00
Michael Natterer 1099aea726 plug-ins: rename all "save-profile" args to "save-color-profile" 2019-09-25 12:50:29 +02:00
Michael Natterer 58bf1d431d libgimp: add a "status" parameter to gimp_procedure_config_end_run()
and require it to be always called paired with begin_run(), which is
more straightforward and makes the resulting code more future-proof.
2019-09-25 12:09:03 +02:00
Michael Natterer 1793a08548 plug-ins: port file-png to GimpProcedureConfig and use propwidgets
Remove the save dialog's builder file and construct the dialog
manually, which is actually less and more obvious code thanks to
propwidgets, which are not suited for a builder GUI.

I guess file-png-save counts as a real test for the new procedure
config stuff, and it seems to work nicely. The only thing that's a bit
ugly is the GimpMetadata integration which doesn't exist yet.
2019-09-25 01:06:16 +02:00
Michael Natterer d257c7ba91 plug-ins: remove second parameter of gimp_ui_init() in all non-C plug-ins 2019-09-24 19:43:58 +02:00
Michael Natterer 81cbc3edb7 plug-ins: port file-heif to GimpProcedureConfig
and also use an aux argument, seems to work fine.
2019-09-24 19:35:49 +02:00
Michael Natterer f94a241931 plug-ins: minor cleanup in file-pat 2019-09-24 15:58:54 +02:00
Michael Natterer e34ffbff81 plug-ins: port file-sgi to GimpProcedureConfig
and use the changed gimp_int_store_new() in the dialog. It appears
to be a straightforward way to replace gimp_int_radio_group_new()
which should really go away for 3.0.
2019-09-24 01:02:19 +02:00
Michael Natterer f3eef8fe83 plug-ins, app: port file-pat to GimpProcedureConfig
Exactly the same changes as in file-gbr.
2019-09-23 23:28:10 +02:00
Michael Natterer 104ddb1374 plug-ins: minor follow-up cleanup in file-gbr 2019-09-23 23:24:42 +02:00
Michael Natterer b8fb09d330 plug-ins, app: port file-gbr to GimpProcedureConfig
and use the new feature of saving the last config in an image
parasite.

In app/file-data/fie-data-gbr.c, manually construct the same parasite
when loading a brush, so its spacing and description are stored in the
image.

This replaces the "gimp-brush-name" parasite which is now obsolete.
2019-09-23 19:49:36 +02:00
Michael Natterer 243042730e libgimp: add "image" parameters to gimp_procedure_config_begin,end_run()
When non-NULL, the code tries to load/save image-specific last used
values from/to the image using a parasite. This is meant to be used by
file export plug-ins.
2019-09-23 19:28:04 +02:00
Jehan 2c6e21b1e7 plug-ins: fix another cast warning.
Fix again these warnings:
> cast from pointer to integer of different size
2019-09-23 10:50:33 +02:00
Jehan 0567bb2e71 plug-ins: fix some more cast of different size warnings.
Use GINT_TO_POINTER() and GPOINTER_TO_INT() on GList functions.
2019-09-22 14:20:02 +02:00
Jehan a2c92c576d app, plug-ins: (Win32) fix calls to ShellExecute().
This function returns a HINSTANCE (which is technically a pointer if I
understand correctly) for backward compatibility reason. But this is
actually meant to be used as an int only according to the docs.
Yet casting to gint outputs "cast from pointer to integer of different
size" warnings.
We should use intptr_t instead for such cases, since it is a type made
explicitly to hold a pointer as int, hence should always be right on any
platform.

https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellexecutea
2019-09-22 14:09:09 +02:00
Jehan 6bc6a07b7e libgimpbase, plug-ins: fix all warnings to g_stat() calls.
The second parameter should be GStatBuf*, which will be defined to be
the right struct depending on the actual platform. Using `struct stat*`
was good on Linux but was outputting warnings on other platforms (at
least on Win32).
2019-09-22 13:52:37 +02:00
luzpaz 44d10e458c Fix various typos
Found via `codespell` (v1.17.0.dev0)
2019-09-21 17:10:46 +00:00
Jehan 142002446e plug-ins: fix a type warning.
When cross-compiling for Windows, I had this warning:
> plug-ins/file-ico/ico-load.c:221:22: warning: format '%lu' expects
> argument of type 'long unsigned int', but argument 5 has type 'long
> long unsigned int' [-Wformat=]

I guess that on some platform sizeof may be a long long uint. Just cast
the result to long uint instead (I could have done the other way around,
but I doubt the struct type IcoFileEntry would ever get bigger than long
uint max!).
2019-09-21 18:32:09 +02:00
Michael Natterer 1bca89163d libgimpbase: remove gimp_personal_rc_file()
and port its remaining users to gimp_directory_file().
2019-09-21 18:08:13 +02:00
Jehan c77c903c8d plug-ins: fix C goat-exercise build/installation in meson.
It was installing in separate dirs `goat-exercise/goat-exercise` and
`goat-exercise-c/goat-exercise-c.c`. This is obviously wrong as the C
raw file is obviously not a plug-in of its own, it is just a data for
the built plug-in to be displayed as source.
Anyway now fixed to work like the autotools build.
2019-09-21 14:21:00 +02:00
Jehan b834fdb64a plug-ins: remove unused variable.
Fix:
> ifs-compose.c:1501:20: warning: unused variable ‘style’ [-Wunused-variable]

Unused since commit b347cc73a1.
2019-09-21 00:27:15 +02:00
Michael Natterer df8d5b02ae libgimp, plug-ins: remove the "preview" parameter from gimp_ui_init()
It's dead since a looong time.
2019-09-20 19:56:00 +02:00
Michael Natterer f62665ad31 plug-ins: use GimpProcedureDialog in despeckle 2019-09-20 19:26:07 +02:00
Michael Natterer df62d08798 plug-ins: as a proof-of-concept, port despeckle to GimpProcedureConfig
Its entire dialog and execution are now based on object properties and
widgets are views on the properties. Also add a "Reset" button.
2019-09-20 12:54:50 +02:00
Michael Natterer 0029760e2e plug-ins: add some missing types to script_fu_marshal_procedure_call()
Scripts must be able to pass values to procedures even if they have no
idea what the actual parameter type is (item, uchar, layer mask), to
the script it's all just numbers anyway.
2019-09-17 21:42:10 +02:00
Jehan 642e47efaa plug-ins: fix warning.
Fix the following warning for missing case values:
> enumeration value ‘WEBKIT_LOAD_REDIRECTED’ not handled in switch
(same for WEBKIT_LOAD_COMMITTED)
2019-09-17 11:21:19 +02:00
Jehan ccc8224aa9 plug-ins: mask the 3 "Converts *" procedure from file-dds plug-in.
They are semantically wrong anyway because they work on drawable,
assuming that the drawable is encoded in whatever non-RGB pixel (while
getting data in R'G'B'A format). This is just an internal trick of the
file-dds plug-in which converts DDS data internally instead of having
babl doing the job by making appropriate formats.

Anyway we should definitely not expose such procedure publicly. I am not
deleting the code directly, just hiding it away in `#if 0` for now.
2019-09-16 10:41:00 +02:00
Jehan 7777c5fa0c plug-ins: port gradients-save-as-css to Python 3 + new API. 2019-09-15 10:20:11 +02:00
lillolollo b942682280 fix
```
../../gimp/plug-ins/common/file-psp.c: In function 'load_image':
../../gimp/plug-ins/common/file-psp.c:1930:25: warning: passing argument 2 of 'g_stat' from incompatible pointer type [-Wincompatible-pointer-types]
 1930 |   if (g_stat (filename, &st) == -1)
      |                         ^~~
      |                         |
      |                         struct stat *
In file included from ../../gimp/plug-ins/common/file-psp.c:44:
C:/msys64/mingw64/include/glib-2.0/glib/gstdio.h:134:31: note: expected 'GStatBuf *' {aka 'struct _stat64 *'} but argument is of type 'struct stat *'
  134 |                  GStatBuf    *buf);
      |                  ~~~~~~~~~~~~~^~~

```
2019-09-14 22:21:11 +00:00
Jehan 5495689180 plug-ins: fix Python plug-ins installation.
They were installed under $libdir/gimp/2.99/ instead of
$libdir/gimp/2.99/plug-ins/.
2019-09-14 22:39:39 +02:00
Ell 65530b6aa7 Issue #3925 - Gimp from git master segfaults when showing preview of exported JPEG file
In file-jpeg-save, ref the file object when using a preview idle
to keep it alive.
2019-09-12 21:05:34 +03:00
Ell 077e596dfc plug-ins: fix wrong g_free() in jpeg-save
... after GFile port.
2019-09-12 19:40:35 +03:00
Michael Natterer 63e0e7679b plug-ins: fix "film" to not crash on repeat
Can't have objects in the last_vals struct, use image IDs again.
2019-09-12 12:42:09 +02:00
Ell f1a13b4904 plug-ins: fix optional common/ plug-ins in meson build
Align plug-ins/common/meson.build with plugin-defs.pl, avoiding
building optional plug-ins whose dependencies aren't met.

Fix the build condition of the mail plug-in.
2019-09-12 13:04:16 +03: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 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
lillolollo 5d365352ca Issue !125: avoid conflict with win32 macro.
jpeg-save.c:56: warning: "DEFAULT_QUALITY" redefined
   56 | #define DEFAULT_QUALITY          90.0
      |
In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:71,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/rpc.h:16,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/objbase.h:7,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/shlwapi.h:16,
                 from C:/msys64/mingw64/include/jmorecfg.h:19,
                 from C:/msys64/mingw64/include/jpeglib.h:31,
                 from jpeg-save.c:33:
C:/msys64/mingw64/x86_64-w64-mingw32/include/wingdi.h:1140: note: this is the location of the previous definition
 1140 | #define DEFAULT_QUALITY 0
2019-09-11 19:01:49 +00:00
Félix Piédallu eb229fe2dc disabling Twain plug-in until it's fixed 2019-09-11 16:42:04 +02:00
Félix Piédallu 65eff6f150 Meson port. 2019-09-11 16:42:04 +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 cc5149565a plug-ins: remove unused variables from plugin-browser.c 2019-09-10 19:47:12 +02:00
Michael Natterer 26a744f44d plug-ins: register thumbnail procedures before load procedures
so registering the thumbnail loader with the load procedure can
perform some checks for procedure existence and signature.
2019-09-10 19:36:54 +02:00
Jehan 49640ebfee plug-ins: fix warning on JavaScript goat exercise.
The exact warning was:
> (goat-exercise-gjs:26895): Gjs-WARNING **: 15:59:18.382: Some code
> called array.toString() on a Uint8Array instance. Previously this
> would have interpreted the bytes of the array as a string, but that is
> nonstandard. In the future this will return the bytes as
> comma-separated digits. For the time being, the old behavior has been
> preserved, but please fix your code anyway to explicitly call
> ByteArray.toString(array).  (Note that array.toString() may have been
> called implicitly.)
2019-09-10 16:06:48 +02:00
Sabri Ünal a60ac57207 Missing mnemonics on several file dialogs
This path corrects missing mnemonics on several save/open/export dialogs.

save: file
open: file, dds, fits, tiff
export: bmp, dds, fli, gbr, gih, mng, pat, pnm, pdf, raw, sunras, sgi, webp
2019-09-09 18:06:29 +00: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