Commit Graph

33 Commits

Author SHA1 Message Date
Anders Jonsson e4e3dcca6b plug-ins: readd translation context for tag values
Originally added in 55aa462faa
2023-12-31 13:14:00 +00:00
Jacob Boerema ec999ee193 plug-ins: make metadata-editor/viewer use gimp_image_procedure_new
These were using gimp_procedure_new, which was causing warnings like
LibGimpConfig-WARNING **: 13:56:33.270: couldn't serialize property
 GimpProcedureConfig-plug-in-metadata-editor::image of type GimpImage,
and
gimp_plug_in_destroy_proxies: ERROR: GimpImage proxy with ID 1 was
refed by plug-in, it MUST NOT do that!

This also saves us from having to define image and run-mode parameters
ourselves.
2023-11-27 14:08:26 -05: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 2b38a2df86 libgimp, plug-ins: rename gimp_procedure_new2() as gimp_procedure_new() and…
… remove the latter.

Now all GimpProcedure use this new implementation with use a config object.
2023-10-01 20:52:01 +02:00
Jehan e92ef9d45a plug-ins: port several of the easy plug-ins to gimp_procedure_new2(). 2023-10-01 20:52:01 +02:00
Jacob Boerema 9c11b40393 plug-ins: create metadata-viewer gui from code
The metadata-viewer uses a GtkBuilder .ui file to create the interface.
In GIMP we prefer our interfaces to be created in code and these builder
files are also not available anymore in GTK4.

This commit removes the .ui file and support code, and creates the
interface from code in our plug-in.
2023-04-30 16:01:40 -04: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
Jacob Boerema 6a8299d989 plug-ins: simplify adding tags to store in metadata-viewer
We were using parameter iter in metadata_dialog_add_tag and
metadata_dialog_add_translated_tag.

However, iter is only ever set inside metadata_dialog_add_tag by calling
gtk_list_store_append. So, there is no need to pass this parameter around.

For this reason, let's remove parameter iter from the above two functions
and replace with a local variable.
2022-06-02 21:45:27 -04:00
Jacob Boerema 477302fdab plug-ins: replace deprecated gexiv2 functions in metadata-viewer
Since we increased our minimum version of gexiv2 to 0.12.3, several
functions used in the metadata-viewer plug-in have been deprecated.

Replace these functions with the "try_" versions, which include an
error parameter. If this returns non NULL then we print the error
message to the console.
2022-03-09 11:30:56 -05:00
Jacob Boerema baaa1380cf plug-ins: in metadata-viewer improve how we show XMP tags.
XMP tags that have multiple values (usually of type XMpBag or XmpSeq) were
shown on one line. Which, especially for long text values, could make it
difficult to see the separate values for that tag.

Let's do the same as we do for IPTC tags that can occur multiple times and
show each value on a separate line.
2021-09-24 15:22:49 -04:00
Jacob Boerema e9ab89fa4f plug-ins: use separate function for adding multiple values per tag
In the metadata-viewer refactor the code that adds multiple values per tag
to the list store into a separate function.
Currently used for IPTC tags only but the intention is to reuse it for
XMP tags with multiple values.
2021-09-24 15:14:48 -04:00
Jacob Boerema e7f65e4b9f plug-ins: improve formatting in metadata-viewer 2021-09-24 15:11:03 -04:00
Jacob Boerema 165b50abcc plug-ins:fix #6624 metadata viewer default window size is too small
Let's increase the default size of the metadata viewer a bit.
Ideally we would add some logic to determine the width of
the first column since that one currently depends on the
length of the longest tag. However for now this change
will be enough for most cases.
2021-04-24 12:45:52 -04:00
Jacob Boerema 34463786b1 plug-ins: interpret Exif.Photo.UserComment before showing in metadata-viewer. 2021-03-22 16:07:13 -04:00
Jacob Boerema 0ffee001bf plug-ins: improve error handling and use GError in metadata-editor/viewer.
metadata-editor and metadata-viewer did return GIMP_PDB_SUCCESS when
loading the dialog ui failed, we changed this to GIMP_PDB_EXECUTION_ERROR
and now use a GError to report it back to GIMP.

In metadata-editor also improve the error handling when loading the calendar
dialog fails.

The error also only showed in the console so change that to show a dialog
or the error console.
2020-12-01 13:24:07 -05:00
Jacob Boerema 34407a6b7e plug-ins: improve formatting of gps data in metadata-viewer.
Adding metadata-tags to meson.build and Makefile.am for
the metadata-viewer since until now it was only used in
the metadata-editor.

The Exif gps metadata tags for longitude, latitude and
altitude get special handling to show them with more
precision and let the string parts be translated.
2020-12-01 13:24:06 -05:00
Jacob Boerema 3128047a0b plug-ins: in metadata editor and viewer only convert values to UTF-8 if they are not.
Certain metadata is already UTF-8. Converting them from locale
to UTF-8 again leads to incorrectly shown strings.
2020-11-19 23:25:27 +00:00
Jacob Boerema 26db975a84 plug-ins: fix incorrect reading of iptc tags that appear more than once.
This is one of the problems mentioned in issue #5863. This commit only fixes
this problem in the metadata-viewer.
2020-11-19 23:25:27 +00:00
Jacob Boerema 599d91db54 plug-ins: Refactor certain string handling into separate functions in metadata-viewer. 2020-11-19 23:25:27 +00: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 392f00baf5 app, libgimp: get rid of all ID GTypes and ID param specs
Turn all ID param specs into object param specs (e.g. GimpParamImageID
becomes GimpParamImage) and convert between IDs and objects in
gimpgpparams.c directly above the the wire protocol, so all of app/,
libgimp/ and plug-ins/ can deal directly with objects down to the
lowest level and not care about IDs.

Use the actual object param specs for procedure arguments and return
values again instead of a plain g_param_spec_object() and bring back
the none_ok parameter.

This implies changing the PDB type checking functions to work on pure
integers instead of IDs (one can't check whether object creation is
possible if performing that check requires the object to already
exist).

For example gimp_foo_is_valid() becomes gimp_foo_id_is_valid() and is
not involved in automatic object creation magic at the protocol
level. Added wrappers which still say gimp_foo_is_valid() and take the
respective objects.

Adapted all code, and it all becomes nicer and less convoluted, even
the generated PDB wrappers in app/ and libgimp/.
2019-08-29 11:39:34 +02:00
Michael Natterer b6b84f7afa plug-ins: port the metadata plug-ins to GimpPlugIn and object 2019-08-27 18:28:56 +02:00
Sabri Ünal e93a20e7ac Issue #3112 - Missing mnemonics.
(cherry picked from commit 30e4a7ee5e)
2019-08-05 22:44:36 +02:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Michael Natterer bdbec7941c Use the new macros from the last commit in all files
...and gone are the annoying warnings.
2018-05-20 21:06:34 +02:00
luz.paz 147c09f19e Bug 795161 - Misc. typo fixes in source comments and doxygen
Found via `codespell`
Follow-up to  commit 7fdb963e01
2018-04-18 21:06:57 +02:00
Ben Touchette 97c9a99339 Regression fix for metadata viewer allows to view all tags.
Partially revert commit 8c2ca36ac7, so
that unlabeled tags are not hidden.
2017-08-05 09:14:59 -04:00
Ell 8c2ca36ac7 Bug 769112 - The metadata windows takes a lot of CPU.
The new metadata viewer is based on a version of the old metadata
plugin that still contained this bug, and a few other bugs that've
been fixed since then.  Reapply those fixes to the new plugin.

This is essentially an adaptation of commits
f8e291bf31,
ce9e7feabd,
38c79600f1,
and 801bd8fb3f.
2017-07-08 08:55:02 -04:00
Alexandre Prokoudine c68239e937 Make new Metadata submenu and new dialogs' captions translatable.
Adjust the tooltip for the Edit Metadata menu item.
2017-07-08 03:16:41 +03:00
Michael Natterer a10b07e398 plug-ins: fix some warnings in metadata/ 2017-07-07 19:14:47 +02:00
Ben Touchette dc9856cfe1 Bug 769820 - Cannot enter Iptc information when no metadata is available...
...and fails to write it to file when it is

Completely redo metadata editor and viewer code, adds support for
Xmp.xmpMM.History and more.
2017-07-07 18:11:39 +02:00