Commit Graph

52 Commits

Author SHA1 Message Date
Alx Sa a0d040bddc libgimp: GimpSaveProcedure to GimpExportProcedure
This patch continues porting save API to
export for the 3.0 release.
2024-04-20 07:50:42 -04:00
Alx Sa c92cf7e8f2 plug-ins: Convert file_*_save to file_*_export
Resolves #10932

Since GIMP distinguishes between saving
XCF and exporting image like PNG,
we should change the PDB to show
export rather than save in the function
calls.
2024-04-16 16:07:10 +00:00
Jehan bf8ee69570 plug-ins: fix some broken macros with a massive search-and-replace.
If we leave a space between the macro name and opening parenthese for argument
lists, the args are not considered macro args (which will be discovered when
using it). I experienced this issue while testing code on some plug-in
yesterday, so thought I might as well fix all these broken macros for casting to
the specific GimpPlugIn subclass, so that we won't have a next time.
2023-10-18 18:29:37 +02:00
Jehan fcc810d7d3 libgimp, plug-ins: rename to gimp_save_procedure_new().
Also the mimetype is already set by gimp_file_procedure_set_mime_types() so
transform the mimetype argument into an export_metadata argument.
2023-10-01 20:52:02 +02:00
Jehan b23519a401 plug-ins: port to gimp_save_procedure_new2() all export procedures…
… which were using gimp_procedure_config_begin_export().
2023-10-01 20:52:01 +02:00
Alx Sa 24a1d34bba plug-ins: Porting to GimpSaveProcedureDialog
These five plug-ins already used GimpProcedureDialog when I originally
worked on them for !9250. However, their export GUI needs to
use GimpSaveProcedureDialog instead.
2023-05-20 14:30:41 +00:00
Alx Sa 958af23775 plug-ins: Restore mnemonics to file-csource 2023-03-30 04:07:33 +00:00
Alx Sa 7f74820b8d plug-ins: Port file-csource to use...
...GimpDialogProcedure functions rather than gimp_prop_* directly.
2023-03-30 02:04:00 +00:00
Jehan df074bfe09 plug-ins: label and documentation of plug-ins localized plug-in side.
This is the consequence of previous commit. Plug-ins' label and
documentation are now localized before sending these data to GIMP core.
In other words, we replace N_() macros with basic gettext calls.
2022-07-05 12:23:51 +02:00
Jehan 18c37f7084 plug-ins, libgimp: override set_i18n() for all our core plug-ins.
Hence avoiding the stderr messages. These are going to be localized with
centrally installed catalogs "gimp*-std-plugins", "gimp*-script-fu" and
"gimp*-python".

We now handle core plug-in localizations differently and in particular,
with kind of a reverse logic:

- We don't consider "gimp*-std-plugins" to be the default catalog
  anymore. It made sense in the old world where we would consider the
  core plug-ins to be the most important and numerous ones. But we want
  to push a world where people are even more encouraged to develop their
  own plug-ins. These won't use the standard catalog anymore (because
  there are nearly no reasons that the strings are the same, it's only a
  confusing logic). So let's explicitly set the standard catalogs with
  DEFINE_STD_SET_I18N macro (which maps to a different catalog for
  script-fu plug-ins).
- Doing something similar for Python plug-ins which have again their own
  catalog.
- Getting rid of the INIT_I18N macro since now all the locale domain
  binding is done automatically by libgimp when using the set_i18n()
  method infrastructure.
2022-06-05 01:57:02 +02:00
Michael Bazzinotti 4d528f297f Issue #5415: compensate for null byte
When exporting a C source file with runtime length encoding, the
C-string's array size does not accomodate for the null byte. However,
GIMP accomodates for the NULL byte in it's NON-RLE export, suggesting
that this has been a mere oversight for RLE.

This can cause at the worst a compile-time error and at least a warning
from the compiler.
2021-08-05 19:49:55 +02:00
Jehan 2ea5dec56e libgimpwidgets: improved gimp_prop_scale_entry_new(), new function…
… gimp_label_spin_set_digits() and deleted gimp_prop_opacity_entry_new()

- The "digits" argument for the number of decimal places in
  gimp_prop_scale_entry_new() is now mostly useless since GimpLabelSpin
  (hence GimpScaleEntry too) got a nice estimation algorithm of sensible
  values.
- Add gimp_label_spin_set_digits() function to manually set the digits
  property when we don't like the estimated value.
- Also add a new "factor" argument to gimp_prop_scale_entry_new(). Its
  role is to allow a GimpScaleEntry showing a factored range, typically
  a [0, 100] range for some types of [0, 1] properties.
- Remove gimp_prop_opacity_entry_new() which was basically a
  special-case of gimp_prop_scale_entry_new() and which can now be
  easily reproduced by simply set factor=100.0.
- Update all usage of gimp_prop_scale_entry_new() in app/ and plug-ins/
  with updated arguments. It is interesting to note that all existing
  usage were either integers (digits=1) or when double, the estimated
  decimal places are the same as the ones which were manually set (hence
  showing the generic estimation is not too bad). So the new function
  gimp_label_spin_set_digits() was not even needed once in current code.
2020-11-25 02:32:22 +01:00
Jehan 0f05825a29 app, libgimpwidgets, plug-ins: default increments for GimpScaleEntry.
Instead of setting always manually the step and page increments when
creating a GimpScaleEntry, let's just generate some common cases
automatically. Indeed the increments are rarely something you want to
care about. The algorithm used is:
- For a range under 1.0, use a hundredth and a tenth (typically a [0,
  1.0] range will step-increment of 0.01 and page-increment of 0.1).
- For small ranges (under 40), step-increment by 1, page-increment by 2.
- For bigger ranges, step-increment by 1, page-increment by 10.

For use cases when you absolutely want specific increment values, I add
the gimp_scale_entry_set_increments() function. It is much better to
have a small and understandable constructor call followed by
configuration calls (only when needed) rather than a constructor with a
crazy amount of parameters. Hence gimp_scale_entry_new() went from 17
arguments (absolutely unreadable calls) to now 5.
2020-10-30 12:33:46 +01:00
Jehan d81b151e79 app, plug-ins: use the updated gimp_prop_scale_entry_new() API. 2020-10-30 11:02:20 +01:00
Michael Natterer 0d56bbb745 plug-ins: change "comment" arguments to "gimp-comment"
so they continue to be handled automatically.
2020-06-17 21:56:31 +02:00
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 c25778c882 plug-ins: use begin_export()/end_export() in file-csource
and remove all manual "gimp-comment" parasite code.
2019-10-23 19:08:34 +02:00
Michael Natterer 9326f4a76c plug-ins: rename all boolean comment arguments to "save-comment"
and let them default to gimp_export_comment(). Set the default value
of all "comment" arguments to gimp_get_default_comment().
2019-10-10 01:32:28 +02:00
Michael Natterer a59c13b724 plug-ins: port file-csource to GimpProcedureConfig 2019-10-05 19:29:20 +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 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 037e8a6e49 plug-ins: port file-csource to GimpPlugIn and libgimp objects 2019-08-24 13:33:54 +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 74c9d835e8 Issue #2617 - Export to C image artifacts
As correctly spotted by Royce Pipkins, the buffer for the drawable's
pixel lines was too small.

Also fix the plug-in to hardcode "R'G'B'[A] u8" so it won't misbehave
on high bit-depth images, and make it work on all sorts of drawables,
not only "RGB*" (it will still always export RGB images).
2019-01-02 21:28:24 +01: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
Simon Budig 7d64cf62c6 libgimpwidgets: rename the _grid()-Variants of gimp_scale_entry_*
Adjust all plugins to follow accordingly.

This concludes the GtkTable'ocide.
2018-05-20 21:06:35 +02:00
Simon Budig def4acc842 common: kill GtkTable in a ton of plugins 2018-05-20 21:06:33 +02:00
Michael Natterer 24924211f4 plug-ins: lots of trivial GTK+ 3.0 porting
Most of it simply s/GtkObject/GtkAdjustment/
2018-05-20 21:06:27 +02:00
Ell 98f7fc85ac plug-ins: in file-csource, add RLE support for RGB565
Currently, toggling RGB565 makes the RLE toggle insensitive, but
if RLE is checked beforehand RLE is used anyway, with incorrect
results.

Fix this by adding RLE support for RGB565 data.
2017-07-07 04:32:51 -04:00
Ell cd3ca47cc1 Bug 784462 - Export in C source format reports wrong BPP/buffer-size ...
... when using macros + RGB565
2017-07-07 04:32:50 -04:00
João S. O. Bueno 207e904d7a Bug 765685: Disambiguates octal-escaped output in c-source image output
Fixes the plug-in output to render decimal digit
characters as octal escaped, so they can't be acidentally
combined in preceding escaped sequences. (i.e. the sequence
of values '255, 49'  is now rendered as '\377\049' instead of
 '\3771')

Thanks Steve Baker for noticing and reporting the issue.
2016-04-27 23:46:19 -03: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 dae366bb6e configure.ac, *: require GLib 2.40.0
Remove gimp_output_stream_[v]printf() and use the new functions from
GLib instead. Use memmove() instead of the deprecated g_memmove().
2014-08-12 15:30:19 +02:00
Michael Natterer 297ff1ea0f plug-ins: port file-csource to GIO 2013-11-29 00:05:38 +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
Michael Natterer 88e4a462ba plug-ins: port file-csource to GEGL 2012-11-19 00:25:10 +01:00
Mukund Sivaraman b45868c081 file-csource: Remove dead assignments (and variable) 2011-10-04 14:23:58 +05:30
Michael Natterer dcb4c6e34a plug-ins: use gtk_box_new() 2011-09-30 12:18:24 +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 db6f3dfe89 plug-ins: fix glitch in image parasite function renaming 2011-03-08 14:21:57 +01:00
Michael Natterer 87646e9ace libgimp: deprecate and rename the image parasite functions
in exactly the way the drawable functios were turned into item ones.
2011-03-08 13:19:21 +01:00
Michael Natterer 97a73ea83f app: use gtk_box_pack_start() to pack a dialog's toplevel container
instead of gtk_container_add()'s because otherwise the widget will not
expand in GTK+ 3.x
2011-03-04 10:44:58 +01:00
Nelson A. de Oliveira 7666e5cf36 Fix memory and descriptor leaks 2010-11-12 21:56:17 +01:00
Sven Neumann 0d66ff0a31 plug-ins: move variables to local scope 2010-05-28 22:31:15 +02:00
Sven Neumann 754b556ea6 Bug 619189 - Add support for RGB565 in csource export filter
Apply patch from bug-report that adds support for RGB16 (RGB565).
Changed UI code to set the toggle buttons insensitive instead of
showing a warning.
2010-05-28 22:20:35 +02:00
Martin Nordholts 19fe919dce plug-ins: Port file plug-ins to new export API 2009-07-21 16:03:58 +02:00
Michael Natterer e805cb0cf4 Use gtk_dialog_get_content_area() instead of dialog->vbox 2009-07-15 18:57:12 +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