Commit Graph

33 Commits

Author SHA1 Message Date
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
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 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 8a78203aed Properly prefix the values of enum GimpPDBProcType
to be GIMP_PDB_PROC_TYPE_PLUGIN, _EXTENSION etc.
2019-08-30 12:52:28 +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 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
Jehan 66ec467217 plug-ins: make various usage of g_file_replace() safer.
As I did on app/, finalizing an output stream also implicitly flushes
and closes it. Hence if an export ended with an error, we'd end up with
incomplete data file (possibly overwriting a previously exported image).
Only 2 plug-ins I haven't fixed yet are file-tiff-io and file-gif-save.
The later one don't even clean up its memory (which somehow is good here
as at least the output stream is never finalized hence sane files are
not overwritten in case of errors). As for the former (TIFF plug-in), it
doesn't even seem to have any error control AFAICS, apart from printing
error messages on standard error output.
2018-11-27 12:41:22 +01:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
luz.paz 69b2e84924 Source and trivial typos
Found via `codespell` and `grep`
2018-05-12 23:44:47 +02:00
Michael Natterer e16c8a2352 Move the new "default_new_layer_mode" APIs to the image...
...in both the core and libgimp.

Images now know what the default mode for new layers is:

- NORMAL for empty images
- NORMAL for images with any non-legacy layer
- NORMAL_LEGAVY for images with only legacy layers

This changes behavior when layers are created from the UI, but *also*
when created by plug-ins (yes there is a compat issue here):

- Most (all?) single-layer file importers now create NORMAL layers
- Screenshot, Webpage etc also create NORMAL layers

Scripts that create images from scratch (logos etc) should not be
affected because they usually have NORMAL_LEGACY hardcoded.

3rd party plug-ins and scripts will also behave old-style unless they
get ported to gimp_image_get_default_new_layer_mode().
2017-08-21 20:18:00 +02:00
Michael Natterer 838449254a plug-ins: use gimp_get_default_new_layer_mode() for most new layers
instead of hardcoding NORMAL_LEGACY.
2017-08-20 17:12:46 +02:00
Michael Natterer 3cf423f0cd *: rename NORMAL to NORMAL_LEGACY and NORMAL_LINEAR to NORMAL
and make NORMAL_LEGACY immutable.
2017-02-26 16:26:34 +01:00
Michael Natterer 66060e3307 app, libgimp*, plug-ins: replace enum GimpLayerModeEffects by GimpLayerMode
with proper value names. Mark most values as _BROKEN because they use
weird alpha compositing that has to die. Move GimpLayerModeEffects to
libgimpbase, deprecate it, and set it as compat enum for GimpLayerMode.
Add the GimpLayerModeEffects values as compat constants to script-fu
and pygimp.
2017-01-08 23:00:19 +01:00
Jehan ec27b539ea plug-ins: various s/save/export/ replacement on visible strings. 2016-02-16 02:35:43 +01:00
Michael Natterer 849481a861 Clean up code around calls to g_file_replace()
- use G_FILE_CREATE_NONE instead of 0
- don't put "Could not open <file> for writing: <error>" around the
  returned error, the returned message is already verbose
2014-10-04 02:44:54 +02:00
Michael Natterer 14978bfe5d Simplify calls to g_output_stream_write_all()
It returns TRUE only if all bytes were written, so there is no need to
get and check the bytes_written return value.
2014-09-07 20:30:14 +02:00
Michael Natterer f28878b6d3 plug-ins: start the progress before opening files for loading/saving
so the user gets feedback as early as possible.
2014-07-23 21:37:13 +02:00
Michael Natterer a5b92424b3 Bug 726761 - Alias PIX image encoding broken
save_image(): remove bogus "- 1" from the calculation of the height of
the row of tiles to save. Fixes garbage saved to the last line of all
PIX files.
2014-04-11 15:25:22 +02:00
Michael Natterer b9d587c7d2 Bug 726761 - Alias PIX image encoding broken
save_image(): use the chosen export format's bpp, not the drawable's.
Fixed exporting of > 8 bit images.

Also make the plug-in export indexed images directly (without
requiring export conversion).
2014-04-11 15:08:49 +02:00
Michael Natterer d86f98c18a plug-ins: port file-pix to GIO 2013-11-17 18:18:18 +01:00
Michael Natterer 03df8c6af4 plug-ins: pass the format's name again in calls to gimp_export_image()
and clean up the formatting of the call and the lines around it. Now
we can check the various (disabled) export options for regressions
again by changing a single line in gimp_export_image().
2013-11-10 00:18:48 +01:00
Clayton Walker 264d09b417 Rename colour and greyscale to color and grayscale respectively 2013-06-06 23:26:16 +02:00
Michael Natterer 4c6c08e68d plug-ins: port file-pix to GEGL 2012-11-19 22:45:20 +01:00
Mikael Magnusson 8ff66342b8 plug-ins: set progress to 1.0 when done 2011-04-10 19:28:43 +02:00
Michael Natterer 8c4d99f883 Bug 645456 - Inconsistent window (role) naming scheme
Applied patch from Christoph Kappel which adds a "gimp-" prefix to all
plug-in dialog window roles.
2011-04-08 20:31:34 +02:00
Michael Natterer bbd7ec6b5c plug-ins: port from gimp_image_add_foo() to gimp_image_insert_foo()
I'm sure some plug-ins need to add their items *not* at the toplevel,
but since making plug-ins really tree-aware is a lot more work than
just fixing insert positions, I went for passing -1 as parent in
almost all cases. And because of laziness...
2010-09-06 11:40:46 +02:00
Michael Natterer 034bd0427f Bug 609056 - Exporting to Alias PIX format fails
Apply patch from Saul Goode which fixes a typo that made exporting to
PIX impossible.
2010-02-10 12:51:46 +01:00
Martin Nordholts 19fe919dce plug-ins: Port file plug-ins to new export API 2009-07-21 16:03:58 +02:00
Michael Natterer 4ea1437646 plug-ins/common/*.c plug-ins/color-rotate/color-rotate.c
2009-01-19  Michael Natterer  <mitch@gimp.org>

	* plug-ins/common/*.c
	* plug-ins/color-rotate/color-rotate.c
	* plug-ins/file-bmp/bmp.c
	* plug-ins/file-faxg3/faxg3.c
	* plug-ins/file-fits/fits.c
	* plug-ins/file-fli/fli-gimp.c
	* plug-ins/file-ico/ico.c
	* plug-ins/file-jpeg/jpeg.c
	* plug-ins/file-psd/psd-save.c
	* plug-ins/file-psd/psd.c
	* plug-ins/file-sgi/sgi.c
	* plug-ins/file-uri/uri.c
	* plug-ins/file-xjt/xjt.c
	* plug-ins/flame/flame.c
	* plug-ins/fractal-explorer/fractal-explorer.c
	* plug-ins/gfig/gfig.c
	* plug-ins/gimpressionist/gimp.c
	* plug-ins/gradient-flare/gradient-flare.c
	* plug-ins/help-browser/help-browser.c
	* plug-ins/ifs-compose/ifs-compose.c
	* plug-ins/imagemap/imap_main.c
	* plug-ins/lighting/lighting-main.c
	* plug-ins/map-object/map-object-main.c
	* plug-ins/maze/maze.c
	* plug-ins/metadata/metadata.c
	* plug-ins/pagecurl/pagecurl.c
	* plug-ins/print/print.c
	* plug-ins/pygimp/gimpfu.py
	* plug-ins/script-fu/script-fu-script.c
	* plug-ins/script-fu/script-fu.c
	* plug-ins/selection-to-path/selection-to-path.c
	* plug-ins/twain/twain.c
	* plug-ins/win-snap/winsnap.c: document the "run-mode" parameter
	as we document enums for core procedures.


svn path=/trunk/; revision=27922
2009-01-19 20:11:36 +00:00
Michael Natterer d9b5207aa2 Change licence to GPLv3 (and to LGPLv3 for libgimp).
2009-01-17  Michael Natterer  <mitch@gimp.org>

	* all files with a GPL header and all COPYING files:

	Change licence to GPLv3 (and to LGPLv3 for libgimp).

	Cleaned up some copyright headers and regenerated the parsers in
	the ImageMap plugin.


svn path=/trunk/; revision=27913
2009-01-17 22:28:01 +00:00
David Odin 83e631faf4 untabified
* plug-ins/common/*.c: untabified

svn path=/trunk/; revision=27335
2008-10-20 06:04:39 +00:00
Sven Neumann a1cbd58195 plug-ins/common/file-gbr.c plug-ins/common/file-gih.c
2008-08-18  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/file-gbr.c
	* plug-ins/common/file-gih.c
	* plug-ins/common/file-pat.c
	* plug-ins/common/file-pix.c
	* plug-ins/common/file-sunras.c: for the most common errors, 
pass
	the error message with the return values instead of calling
	g_message().


svn path=/trunk/; revision=26650
2008-08-18 19:35:55 +00:00
Michael Natterer 3d75c95f95 plug-ins/bmp/* plug-ins/faxg3/* plug-ins/fits/* plug-ins/fli/*
2008-08-11  Michael Natterer  <mitch@gimp.org>

	* plug-ins/bmp/*
	* plug-ins/faxg3/*
	* plug-ins/fits/*
	* plug-ins/fli/*
	* plug-ins/ico/*
	* plug-ins/jpeg/*
	* plug-ins/psd/*
	* plug-ins/sgi/*
	* plug-ins/uri/*
	* plug-ins/xjt/*: removed these...

	* plug-ins/file-bmp/*
	* plug-ins/file-faxg3/*
	* plug-ins/file-fits/*
	* plug-ins/file-fli/*
	* plug-ins/file-ico/*
	* plug-ins/file-jpeg/*
	* plug-ins/file-psd/*
	* plug-ins/file-sgi/*
	* plug-ins/file-uri/*
	* plug-ins/file-xjt/*: and moved them here. Changed executable
	names to "file-foo".

	* plug-ins/Makefile.am: changed accordingly.

	* plug-ins/common/*: rename all file plug-ins to file-foo.c. Get
	rid of the names "poppler" and "postscript" and call them
	"file-pdf" and "file-ps" because the conflict with standard
	autofoo targets is gone.

	* plug-ins/common/plugin-defs.pl: changed accordingly.

	* plug-ins/common/mkgen.pl: make sure cflags variables are named
	"PLUG_IN_NAME_CFLAGS" and not "PLUG-IN-NAME_CFLAGS"

	* plug-ins/common/Makefile.am: regenerated.

	* configure.in: change folders and variable names to match above
	changes.


svn path=/trunk/; revision=26494
2008-08-11 10:06:13 +00:00