Commit Graph

595 Commits

Author SHA1 Message Date
Ell 4dab0ac0ac libgimpbase: fix gettext invocation for enum/flags desc/abbrev 2017-12-04 09:58:50 -05:00
Ell ed2fe2d2d1 libgimpbase, libgimpwidgets: add new functions to .def files 2017-12-01 05:27:55 -05:00
Ell f80f33216f libgimpbase: use abbreviations for GimpGradientType
Move the abbreviated descriptions to the "abbrev" parameter, and
use full strings for the descriptions.
2017-11-30 04:45:08 -05:00
Ell d3e527a959 libgimpbase, app: add abbreviations to gradient enums
The value descriptions of GimpGradientColor,
GimpGradientSegmentColor, and GimpGradientSegmentType enums appear
in the on-canvas gradient editor UI, as combo-box items in the tool
GUI overlay.  Since we want to keep the overlay as small as
possible, we previously used abbreviations for these descriptions
(e.g., "FG (t)", instead of "Foreground (transparent)").

Replace the abbreviated descriptions with unabbreviated ones, and
move the abbreviations to the "abbrev" parameter.  This way we get
the abbreviated version in the combo-box, and the full version in
the combo-box's menu.
2017-11-30 03:10:15 -05:00
Ell f7d6805ebb */Makefile.am: add abbreviations to generated enum files
Update the dprod production of generated enum files to include
abbreviated value descriptions, as per the previous commits.

Add a comment for translators above the abbreviated descriptions,
specifying the full description they abbreviate.
2017-11-30 03:10:14 -05:00
Ell 7df427583f libgimpbase: add gimp_{enum,flags}_value_get_abbrev()
Add support for specifying an abbreviated description for enum/
flags values, which can be used in contexts where the full
description is too long.

Since the exact layout and size of Gimp{Enum,Flags}Desc is part of
the ABI, we can't simply add a field to these structs to hold the
abbreviated description.  Instead, we use the fact that entries
with a repeated value in the value descriptions array are ignored,
and that the array is NULL terminated (in particular, that all non-
NULL entries are followed by at least one additional entry), and
specify the abbreviation in the "value_desc" field of the entry
that immediately follows the initial entry for a given value,
setting the "value" field of both entries to the same value.

Right now this behavior is undocumented, so there is no proper way
to specify abbreviated descriptions in the API, and is only meant
to be used in generated enum files.
2017-11-30 03:10:13 -05:00
Michael Natterer d14f6647ad libgimp, libgimpbase: rename gimp_base_compat_enum_init()
to gimp_base_compat_enums_init() and move its prototype from
gimputils.h to gimpbase-private.h; it's not supposed to be
public API even though it's callable from the outside.
2017-10-29 18:37:18 +01:00
Ell 7a4d5385fd libgimpbase: add gimp_base_compat_enum_init() to gimpbase.def 2017-10-24 14:55:29 -04:00
Massimo Valentini 7c32451dfb Bug 784305 - Deprecated enum constants are not registered in python-fu. 2017-10-24 02:34:34 +02:00
Ell 9469ac26f0 app, libgimpbase: implement blend tool gui for gradient midpoints
Allows setting the midpoint's position, blending function, and
coloring type.

The midpoint can be converted to a stop, and centered, through
editor buttons.
2017-10-09 12:48:55 -04:00
Michael Natterer e2ddfdc391 libgimpbase: add #define GIMP_METADATA_ERROR gimp_metadata_error_quark () 2017-09-03 15:46:17 +02:00
Michael Natterer ac7d8aa98d Bug 787019 - Gimp 2.9.6 misses -lm in libgimpbase/Makefile.am
Apply patch from Sebastian Pipping which adds -lm.
2017-08-31 21:36:06 +02:00
Ell 58fdaae3ad enums: add intermediate generated enum files to .gitignore 2017-08-24 15:35:27 -04:00
Jehan 6ff1ffa688 libgimpbase: add gp_(un)?lock() calls to the def file. 2017-08-16 12:22:11 +02:00
Jehan 15f7344038 libgimp, libgimpbase: allow multi-threaded plugins by locking...
...protocol calls.
Some calls are waiting for answers, for instance plugin procedures, and
tiles which expects data and acknoledgement.
This would result in error messages such as:
"expected tile ack and received: 5" (5 is GP_PROC_RUN)
Typically because a thread would run a procedure while another would
receive tiles.
2017-08-16 12:09:56 +02:00
Mikael Magnusson cab45eebf0 libgimpbase: fix compilation error in gimpmetadata.c 2017-08-11 19:42:18 +02:00
Michael Natterer 3b1916654c libgimpbase: return a \0 terminated string from gimp_metadata_get_guid() 2017-07-17 08:20:46 +02:00
Michael Natterer 93d2f49c16 Bug 784961 - Undeclared identifier 'TIME_UTC' - GIMP fails to build...
...on macOS (with macports)

Changed gimp_metadata_get_guid() to use a GRand that automatically
seeds itself from /dev/urandom (if available) or the current time.
2017-07-16 14:01:18 +02:00
Michael Natterer 8294ca9d21 Bug 784502 - Multiple identical path entries for resources cause...
...resources to be loaded and shown multiple times

Change gimp_path_parse() to filter out duplicate paths. This is the
function at the bottom which is used by everything else, so should
generically catch all duplicates.
2017-07-08 12:50:37 +02:00
Michael Natterer 4789acfd1e libgimpbase: add new metadata symbols to gimpbase.def 2017-07-08 00:10:50 +02:00
Michael Natterer 747b3768ef libgimpbase: remove gimp_metadata_register_xmp_namespace[s]()
and do the same in gimp_metadata_class_init(). Also fix all compiler
warnings and other stuff.
2017-07-07 19:11:12 +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
Jehan 7999cfbeef libgimp*: tab cleaning. 2017-06-17 11:38:18 +02:00
Ell 3ca48a0b30 enums: don't use comments in generated enum recipes
Works in bash, but apparently not portable.
2017-06-02 11:15:43 -04:00
Jehan cb02326284 libgimpbase: minor tab cleaning. 2017-05-23 18:09:41 +02:00
Ell 5bcde32caf enums: run gimp-mkenums from the build dir
Commit 1e6acbd4e1 modified the
generated enum recipes to run gimp-mkenums from the source
directory, instead of the build directory, so that only the
basenames of the corresponding header files would appear in
the comment at the top of the generated files.  This was a
mistake -- $(GIMP_MKENUMS) is expecting to be invoked from the
build directory.

Switch back to running gimp-mkenums from the build directory.  To
avoid including the relative path from the build directory to the
source directory in the generated file, add a @basename@ production
variable to gimp-mkenums, which exapnds to the basename of the
input file, and use it instead of @filename@ in the recipes for the
generated enum files.
2017-05-22 20:29:18 -04:00
Ell f9fa0d1b18 enums: don't write generated enum files to src-dir if unchanged
When regenerating an enum file, don't copy it back to the source
directory if it hasn't actually changed.  This allows using a read-
only source directory where the enum header is newer than the
generated file, as long as they're not really out of sync.

OTOH, *do* touch the generated source-dir file even when unchanged,
in order to avoid re-running its recipe on the next build, however,
allow this to silently fail (which is harmless).
2017-05-22 17:58:04 -04:00
Michael Natterer d955b8c5b4 libgimpbase: change labels of GimpSelectCriterion values
so they are consistent with layer mode labels.
2017-05-10 11:45:34 +02:00
Michael Natterer 3f420614ff app, libgimpbase: allow to select colors by CIE L, C, and H
Add the additional enum values to enum GimpSelectCriterion, and
the few needed lines to gimppickable-contiguous-region.c.

It's horribly slow, but works.
2017-05-09 22:02:19 +02:00
Ell 1e6acbd4e1 enums: generate enum files in source dir
We check them into git, so this makes it easier to keep them in
sync when using a separate build directory.

Case in point -- this commit also syncs a few enum files that went
out-of-sync with their headers.
2017-05-06 17:26:16 -04:00
Jehan 695a1c26aa libgimpbase: update gimp_unit_get_digits() description...
... to favor the usage of gimp_unit_get_scaled_digits() when
appropriate.
2017-05-06 22:36:23 +02:00
Jehan bc344a9991 Bug 750180 - Fix different ways of writing Plug-in Plug-In Plugin.
It was agreed that we should write "plug-in" consistently. Only possibly
user-visible strings were updated.
Thanks to scootergrisen for a first patch which could not make it
after changing decision on the canonical writing.
2017-03-21 17:52:22 +01:00
Elle Stone 48e4044672 Bug 780065 - Change default way to desaturate to Luminance
which unlike HSL Lightness is actually physically meaningful and
also generally speaking much more useful than HSL Lightness.

Change "Lightness" to "Lightness (HSL)" to make it clear that
the "Lightness" in the Colors/Desaturate/Desaturate menu is not the
same as "Lightness" in LAB/LCH.

For completeness add the option to desaturate to "Value (HSV)".

Add links in app/operations/gimpoperationdesaturate.c
to the Wikipedia article with definitions of L/I/V in HSL/HSI/HSV.
2017-03-17 17:16:03 -04:00
Ell 3f15db9207 libgimpbase: add missing compat enum get_type()s to gimpbase.def 2017-02-28 06:53:22 -05:00
Michael Natterer fb3d1e4508 app, pdb, libgimp: rename values of enum GimpConvertPaletteType 2017-02-26 20:55:00 +01:00
Michael Natterer ed1ab140fb app, pdb, libgimp: rename values of enum GimpConvertDitherType
being exported to libgimp, and having a non-exported value, this is a
horrible mess like with GimpLayerMode, but at least the cruft value
names are deprecated now.
2017-02-26 20:13:09 +01:00
Ell 8f362941a5 libgimpbase: avoid build-time race between the two generated enum files 2017-02-19 15:18:30 -05:00
Simon Budig 7fd76c9325 libgimpbase: make .def-file consistent again. 2017-01-30 18:53:20 +01:00
Simon Budig 0d073b943c libgimpbase: make the private data size > 0 to avoid critical warnings 2017-01-30 17:05:23 +01:00
Simon Budig 884edf56ca libgimpbase: make GimpMetadata its own type derived from GExiv2Metadata 2017-01-30 16:43:59 +01:00
Michael Natterer ebd3ab1b26 A more hackish way to use GimpLayerMode instead of GimpLayerModeEffects
C++ won't allow us to use GimpLayerMode in the API where we used to
have GimpLayerModeEffects.

Move GimpLayerModeEffects to libgimpbase/gimpcompatenums.h so it's
not in the API any longer, and instead typedef and define stuff in
libgimp/gimptypes.h, and adapt the compat enum registering code
accordingly.
2017-01-24 23:28:34 +01:00
Jehan 0c07ae3bbf libgimpbase: new gimp_unit_get_accurate_digits() API function. 2017-01-23 20:20:25 +01:00
Jehan 7a330dcf6a libgimpbase: update gimp_unit_get_digits() description.
Digit accuracy being "approximately the same as an inch with 2 digits"
is only true for built-in units, not user-defined ones.
2017-01-20 00:40:27 +01:00
Jehan 3ab25af742 libgimpbase: fix a few typos. 2017-01-20 00:40:27 +01:00
Michael Natterer e5ac28811e libgimpbase: add compat enum get_type() functions to gimpbase.def 2017-01-09 19:46:34 +01:00
Michael Natterer 07600c6db6 libgimpbase: proper names for the GimpChannelType enum
Register the old value names as compat. Also add some forgotten
values and enums to gimpcompatenums.h
2017-01-09 19:40:30 +01:00
Michael Natterer 178794f6f1 libgimpbase: rename enum GimpHueRange's values
and add compat cruft for the old names.
2017-01-09 02:45:16 +01:00
Michael Natterer a2006110eb libgimpbase: fix typo on Makefile.am 2017-01-09 02:04:01 +01:00
Michael Natterer e53b269f1c libgimpbase: add new files gimpcompatenums.[ch]
Which are entirely private (not installed). They contain compat values
for enums where values have been renamed in gimpbaseenums.h.  The old
names get the old nicks generated so the new values in gimpbaseenums.h
can have proper new nicks. Register them as compat enums using
mechanism introduced for the GimpLayerMode change.
2017-01-09 01:05:48 +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