Commit Graph

1610 Commits

Author SHA1 Message Date
Jehan 06bbf3e436 Bug 780375 - Color picker won't pick on Wayland.
Add support for KWin API, for KDE on Wayland.
Unfortunately though, KWin's "pick" API seems to have failures, so I
fallback to the default color picking when this happens. This will still
not work on Wayland, but at least won't cause regression for color
picking on KDE/X11.
See also KDE bug: https://bugs.kde.org/show_bug.cgi?id=387720
2017-12-08 23:37:24 +01:00
Ell 0830fe8923 libgimpwidgets, app: make ABBREVIATED default GimpIntComboBox layout
There's no real reason not to do it (has no visible effect if the
model has no abbreviations to begin with), and it means less
special casing.
2017-12-01 09:22:42 -05:00
Ell ed2fe2d2d1 libgimpbase, libgimpwidgets: add new functions to .def files 2017-12-01 05:27:55 -05:00
Ell 8e51e7c351 libgimpwidgets: fix return type of gimp_int_combo_box_get_layout()
... and a small cleanup.
2017-12-01 05:12:42 -05:00
Ell 0f43dedfb5 libgimpwidgets: use ABBREVIATED layout for GimpEnumComboBoxes ...
... using enum models with abbreviated labels
2017-11-30 03:10:14 -05:00
Ell 47ac6111de libgimpwidgets: add "layout" property to GimpIntComboBox
The "layout" proerty controls the combo-box layout (but not its
menu layout), and can be one of:

  - ICON_ONLY:  Only show icons.

  - ABBREVIATED:  Show icons and abbreviated labels (or full
    labels, when there is no abbreviation).

  - FULL:  Show icons and full labels.  Default.

Avoid reconstructing the combo's cell-layout when the menu is
shown/hidden, by maintaining the combo's cell-layout and the menu's
cell-layout separately (probably a terrible hack, but one we already
use :P).
2017-11-30 03:10:14 -05:00
Ell 658d07dffe libgimpwidgets: fill ABBREV column in GimpEnumStore
Use gimp_enum_value_get_abbrev() to fill the ABBREV column of
GimpEnumStore.
2017-11-30 03:10:14 -05:00
Ell 684c850196 libgimpwidgets: add ABBREV column to GimpIntStore
... which holds an abbreviated label, or NULL to use the normal
label.
2017-11-30 03:10:14 -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 fa25b476be icons, modules, libgimpwidgets: add clip-warning display filter icon
... and use it instead of gimp-warning.
2017-11-23 13:34:49 -05:00
Ell 0323541d86 Bug 780375 - Color picker won't pick on Wayland
In GimpPickButton, try to pick from the local window under the
cursor, before falling back to picking from the root window, so
that we can at least pick from local windows on Wayland.
2017-10-31 11:21:44 -04:00
Ell 9fee677b5c libgimpwidgets: use default unit for eevl ratio quantity in size boxes
Pass the ratio quantity to be used for eevl ratio expressions in
terms of the default unit of the size box, instead of as a
dimensionless value.
2017-10-05 08:54:10 -04:00
Ell f2a80a093a libgimpwidgets: enable ratio expressions for size entries with two fields
When a size entry has exactly two fields, enable ratio expressions
in eevl.  Set the reference value to the value of the field that is
not currently being evaluated, and invert the ratio when evaluating
the second field.
2017-10-04 14:25:01 -04:00
Ell 6caae9c53b libgimpwidgets: add ratio expressions to eevl
Ratio expressions have the form 'x : y' (the ':' operator has the
highest precedence for a binary operator, and is left-associative).
Given a reference value 'a', the expression evaluates to
'a * (x / y)'.

Ratio expressions can be controlled by the caller by:

  - Enabling or disabling them:  They're meant to be used when the
    eevl servers two paired entries, and can be disabled otherwise.

  - Setting the reference value:  That's normally the value of the
    "other" entry of the pair--the one not currently being
    evaluated.

  - Inverting the ratios:  Normally, one entry refers to the
    antecedent term of the ratio, and the other entry refers to the
    consequent term of the ratio.  When evaluating the latter one,
    the ratio should be inverted.
2017-10-04 14:25:01 -04:00
Ell 7362d47922 libgimpwidgets: use struct, not parameters, to pass eevl options
Pass the evaluation options to gimp_eevl_evaluate() using a single
parameter of type GimpEevlOptions, instead of using individual
parameters for each option.  Add a GIMP_EEVL_OPTIONS_INIT macro,
used to initialize a GimpEevlOptions struct to the default set of
options.  This would allow us to add evaluation options more
easily.
2017-10-04 14:25:01 -04:00
Michael Natterer 582c6edd54 libgimp*: use some g_clear_object() and g_clear_pointer() 2017-09-03 15:14:51 +02:00
Ell 188a82552b libgimpwidgets: fix double $(AM_V_GEN) in Makefile.am
Due to commit 0ef3795f0a.
2017-08-28 16:50:25 -04:00
Ell 0ef3795f0a */Makefile.am: work around a bug in the new glib-genmarshal
glib-genmarshal was rewritten in glib 2.53.4, and as of now (2.53.6)
it has a bug where it unconditionally generates marshaler bodies,
even for standard marshalers, even with --stdinc.  This causes
libgimpwidgets to define and export g_cclosure_marshal_VOID__INT()
and g_cclosure_marshal_VOID__OBJECT(), which upsets defcheck, and
breaks the build.

Work around this for now by using --header --body when generating
the marshal.c files, which includes the prototypes in the source,
instead of including the header ourselves.  This is the only code
path where the new glib-genmarshal doesn't generate bodies for
standard marshalers.  Note, however, that this usage is deprecated,
so we'll probably want to change it back once it's fixed.
2017-08-27 15:33:09 -04:00
Ell 58fdaae3ad enums: add intermediate generated enum files to .gitignore 2017-08-24 15:35:27 -04:00
Ell 722abb5c82 libgimpwidgets: init GimpColorHexEntry's text after construction
Initialize GimpColorHexEntry's text (to "000000") in constructed(),
instead of init().  Otherwise, it gets cleared during construction,
so that color entries set initially to black are empty.
2017-08-09 10:53:45 -04:00
Elle Stone d13fa3900a Bug 749902 - Add Hue-Chroma operation/tool and LCH color selector
This patch increases the LCH Chroma slider maximum value from 100 to
200 and also makes the Chroma slider properly display out of gamut
Chroma selections for any given Hue/Lightness combinations.

The current Chroma slider only runs to 100. But quite a few sRGB
colors have LCH chroma values that are greater than 100. For example
reddest red has a chroma of 107, and bluest blue has a chroma of 131.
So it's inconvenient to have to deal with a Chroma slider limit of
100.

Also, the current Chroma slider doesn't properly show out of gamut
areas on the Chroma slider. So for example picking a given LCH Hue and
then moving the Lightness slider doesn't allow to see which Lightness
value allows for choosing the maximum in-gamut chroma for the chosen
Hue.
2017-07-16 15:13:11 +02:00
Jehan e5bdaa3f0f libgimpwidgets: fix some weird indentation. 2017-06-27 21:31:10 +02:00
Jehan 28d3897086 libgimpwidgets: fix typo s/shold/should/. 2017-06-27 21:31:10 +02:00
Alexandre Prokoudine 0098eedb81 Fix gimpicons.c, reorder items 2017-06-12 03:38:36 +03:00
Alexandre Prokoudine 70b389a7b1 Cherry-pick template updates from icons-wip branch by Klaus Staedtler 2017-06-12 03:24:32 +03:00
Michael Natterer f9ee38ea33 libgimp: add blurbs to all object properties for the docs
and some minor doc fixes.
2017-06-06 21:19:17 +02:00
Michael Natterer caef6d0deb libgimp*: various doc fixes 2017-06-03 21:22:12 +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
Ell e64e61ca58 libgimpwidgets: call babl_exit() when unloading
If the compiler supports destructors (which should cover at least
GCC and Clang), pair the call to babl_init() in gimp_widgets_init()
with a call to babl_exit() when the library in unloaded.  This is
important in particular since the babl fish cache is constructed/
updated upon the last matched call to babl_exit().
2017-05-31 22:14:45 -04:00
Ell 1176482b4b libgimpwidgets: don't babl_init() in gimp_color_scale_class_init()
Woohoo!  We can actually inject this into the gtk-doc thingy!
2017-05-31 22:14:42 -04:00
Michael Natterer 6978094978 libgimpwidgets: make GimpColorButton set GimpColorConfig on the color dialog
it didn't even remember its GimpColorConfig, so had no chance of
setting it on the dialog's GimpColorSelection.
2017-05-28 16:41:01 +02:00
Michael Natterer 937900d618 Bug 783166 - Script-Fu color selector crashes
libgimpwidgets now needs an initialized babl if color selectors are
used, call babl_init() in gimp_widgets_init(). It can be safely called
redundantly.
2017-05-28 16:32:52 +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 49469091b8 libgimpwidgets: reorder some code in gimp_scale_entry_new_internal()
just to keep the diff small for an hack on the gtk3-port branch.
2017-05-22 22:53:50 +02:00
Michael Natterer c61500066c libgimpwidgets: a bit of s/GtkObject/GtkAdjustment/
only the GtkObjects in the public API left now, can't change these until 3.x
2017-05-22 22:39:28 +02:00
Michael Natterer 1ec2e2eb2f libgimpwidgets: a little s/GtkObject/GtkAdjustent/ in gimpscaleentry.c 2017-05-19 12:07:19 +02:00
Michael Natterer 331fc27f11 libgimpwidgets: draw GimpColorArea's border on top of the oog indicator
and reduce the indicator to 2/3 of the area's shorter side.
2017-05-19 11:54:59 +02:00
Michael Natterer c4dfef0779 libgimpwidgets: add an out-of-gamut indicator to GimpColorArea 2017-05-19 11:00:38 +02:00
Michael Natterer 6ab57a12cf Bug 749902 - Add Hue-Chroma operation/tool and LCH color selector
Last bit for now: allow GimpColorScales' spinbuttons to go further
than its color scales. Please review the new min/max values of the
individual channels.
2017-05-18 19:53:47 +02:00
Michael Natterer 0c2ec6ad86 libgimpwidgets: simplify gimp_scale_entry a lot by using GBindings
Always use separate GtkAdjustments for the scale and the spinbutton,
and link them with a GBinding, either 1:1 or using logarithmic
transform functions.

This change also enables modifying both widgets' ranges independently
after construction, thus enabling the "constrain" feature also for
gimp_color_scale_entry_new().
2017-05-18 18:24:35 +02:00
Michael Natterer 9d482309bb libgimpwidgets: mark out-of-gamut colors also in the RGB and HSV color areas
instead of showing weird clipped or wrapped RGB values.
2017-05-18 17:59:49 +02:00
Michael Natterer 2b167d6337 Bug 749902 - Add Hue-Chroma operation/tool and LCH color selector
Add LCH to the color selectors, patch by Elle Stone and myself.

- Extend enum GimpColorSelectorChannel by LCH channels
- Support them in GimpColorScale, GimpColorScales and GimpColorSelect
- Did not yet remove the HSV channels until things are working 100% ok
- Change drawing in GimpColorSelect to be much faster, to compensate
  for babl_process() making the LCH modes pretty slow
- Clean up stuff in GimpColorSelect

This is WIP and should not be considered finished, biggest TODO is
displaying out-of-gamut values in GimpColorScales' spinbuttons.
2017-05-17 19:28:40 +02:00
Michael Natterer 89641ec5ea libgimpwidgets: gimp_prop_enum_combo_box_new(): reorder GimpSelectCriterion
so Alpha is not between the HSV and LCH group; put it after R, G, B.
2017-05-10 11:48:31 +02:00
Michael Natterer db4e120b8b libgimpwidgets: fix code duplication in gimp_prop_enum_combo_box_new() 2017-05-09 19:07:39 +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
Michael Natterer ecb346a945 libgimpwidgets: gimp_prop_boolean_combo_box_new(): use a GimpIntComboBox
so we can set its "ellipsize" property. Except that this doesn't seem
to work, no idea why.
2017-05-01 00:41:28 +02:00
Éric Hoffman c585c99e80 Bug 740634 - Color picker crashes when there are multiple monitors
Use Windows API directly to get a screen pixel, works for all kinds of
monitor layouts.
2017-04-06 23:52:09 +02:00
Jehan 8322ffdac4 libgimpwidgets: some minor tab cleaning. 2017-03-24 15:16:15 +01:00
Jehan f861585051 libgimpwidgets: entry width of gimp_prop_size_entry_new() is too small.
One cannot just use the min/max values since the precision digits must
also be accounted for (as well as one additional character for the
decimal separator).
Current implementation is not perfect yet because GimpSizeEntry code
itself does not yet use gimp_unit_get_scaled_digits(). Moreover the
entry size could be updated when changing units (or the original size
be actually based of the bigger width considering every possible unit).
2017-03-23 02:45:47 +01:00