Commit Graph

1792 Commits

Author SHA1 Message Date
Michael Natterer db6c2ea658 libgimpwidgets: move all GimpBrowser members to a private struct
The newly added API is ugly and will change.
2018-05-20 21:06:28 +02:00
Michael Natterer fd45ea2051 libgimpwidgets: move all GimpChainButton members to a private struct 2018-05-20 21:06:28 +02:00
Michael Natterer 482be36a00 libgimpwidgets: move all GimpCellRendererToggle members to a private struct 2018-05-20 21:06:28 +02:00
Michael Natterer 651e313f49 libgimpwidgets: move all GimpColorButton members to a private struct 2018-05-20 21:06:28 +02:00
Michael Natterer 281370dce2 libgimpwidgets: move all GimpCellRendererColor members to a private struct 2018-05-20 21:06:28 +02:00
Michael Natterer 0318ea9dfe libgimpwidgets: move all GimpButton members to a private struct 2018-05-20 21:06:28 +02:00
Michael Natterer 88ac850834 libgimpwidgets: move padding members from instance to class struct 2018-05-20 21:06:28 +02:00
Michael Natterer d2116f481b libgimpwidgets: move all GimpOffsetArea members to a private struct 2018-05-20 21:06:28 +02:00
Michael Natterer 271f94928f libgimpwidgets: move all GimpColorArea members to a private struct 2018-05-20 21:06:28 +02:00
Michael Natterer 3d4ef455d2 libgimpwidgets: move all GimpPickButton members to a private struct 2018-05-20 21:06:28 +02:00
Michael Natterer 6e982cd0a4 libgimpwidgets: use g_object_ref()/unref() for GdkCursors
The are GObjects now.
2018-05-20 21:06:28 +02:00
Michael Natterer f689ef7b16 libgimpwidgets: implement GtkWidget::style_updated() instead of style_set() 2018-05-20 21:06:28 +02:00
Michael Natterer 1264285cff libgimpwidgets: implement GtkWidget::state_flags_changed()
instead of GtkWidget::state_changed()
2018-05-20 21:06:28 +02:00
Michael Natterer 52af5f00c0 libgimpwidgets: port GimpNumberPairEntry to gtk_widget_override_font() 2018-05-20 21:06:28 +02:00
Michael Natterer 8c75151f39 llibgimpwidgets: port GimpScrolledPreview to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer 052ab454ae libgimpwidgets: port GimpRuler to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer 1cf85b9102 libgimpwidgets: port GimpOffsetArea to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer d9fac0ce6e libgimpwidgets: port GimpColorScale to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer 42252b3f6f libgimpwidgets: port GimpColorArea to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer c62075b4c0 libgimpwidgets: port GimpChainButton to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer 97da93d1ac libgimpwidgets: port GimpCellRendererToggle to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer b3ac92d0d6 libgimpwidgets: port to GtkStyleContext and gtk_render_foo() 2018-05-20 21:06:27 +02:00
Michael Natterer d9b56a5dbe Use gtk_widget_render_icon_pixbuf() instead of gtk_widget_render_icon()
because the latter is deprecated.
2018-05-20 21:06:27 +02:00
Michael Natterer 694e5ac9f6 libgimpwidgets: port to the new size request API 2018-05-20 21:06:27 +02:00
Michael Natterer 91d382608f libgimpwidgets: port to GtkWidget::draw() 2018-05-20 21:06:27 +02:00
Michael Natterer 4477ad84de libgimpwidgets: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer fa8c702229 libgimpwidgets: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 60036c9385 libgimpwidgets: port the ruler to GTK+ 3.0 2018-05-20 21:06:26 +02:00
Michael Natterer 05e5a1d1cd libgimpwidgets: get rid of (GtkObject **) casts 2018-05-20 21:06:26 +02:00
Michael Natterer 566a71ba7d libgimpwidgets: port GimpFrame to GTK+ 3.0 2018-05-20 21:06:26 +02:00
Michael Natterer 4ae7d4c825 libgimpwidgets: remove deprecated files completely 2018-05-20 21:06:26 +02:00
Michael Natterer e4ae1faf06 libgimpwidgets: remove deprecated functions and s/GtkObject/GtkAdjustment/ 2018-05-20 21:06:26 +02:00
Michael Natterer fe2241ebde libgimpwidgets: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 00a6597cd9 libgimpwidgets: s/GtkObject/GtkAdjustment/ 2018-05-20 21:06:26 +02:00
Michael Natterer 04c12550da libgimpwidgets: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 5fb95d09a1 libgimpwidgets: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer 7e6a2d270e libgimpwidgets: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer d0db9ec24d libgimpwidgets: port virtual functions to GTK+ 3.0 2018-05-20 21:06:26 +02:00
Michael Natterer 91c0dea0af libgimpwidgets: port virtual functions to GTK+ 3.0 2018-05-20 21:06:26 +02:00
Michael Natterer a562a0c798 libgimpwidgets: s/GtkObject/GtkAdjustment/ in gimpwidgets.[ch] 2018-05-20 21:06:26 +02:00
Michael Natterer dae87ee1c7 libgimpwidgets: remove deprecated files from the build 2018-05-20 21:06:26 +02:00
Michael Natterer dbd9797a13 Switch to version 2.99/3.0 in a lot of places and depend on GTK+ 3.22
and lots of other newer libraries.
2018-05-20 21:06:26 +02:00
Michael Natterer fe06539873 libgimpwidgets: fix value names in docs of GimpColorSelectorModel 2018-05-18 19:32:51 +02:00
Jehan 6c9ba16e11 configure, libgimpwidgets: customizable default color profile directory
We have this problem with flatpak that the common directory
("/usr/share/color/icc") is not visible from inside the sandbox. With
proper permissions, it is actually accessible, yet the host's /usr is
mounted at /run/host/usr/.
Since sandbox systems are getting more common, we need to make this path
customizable. I am therefore adding a --with-icc-directory configure
option to change the default color profile folder at build time.
See: https://github.com/flathub/org.gimp.GIMP/issues/15
2018-05-18 09:08:51 +02:00
Michael Natterer a69b8a25df libgimpwidgets: in GimpEnumLabel use the value's nick if there is no desc 2018-05-16 21:12:20 +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
Michael Natterer ebb9d83d63 Bug 795230 - Rename Blend tool and provide PDB compatibility
Step 1: rename the icon to GIMP_ICON_TOOL_GRADIENT (gimp-tool-gradient)
2018-04-13 23:07:08 +02:00
Ell 6ebc3f1b09 Makefiles: don't use -xobjective-c when linking files on Mac
Last commit caused -xobjective-c to be passed during linking on
Mac, causing object files to be treated as source files.  Add a
-xnone flag to AM_LDFLAGS, canceling the effect of -xobjective-c.

Additinally, add a -xobjective-c++ flag to AM_CXXFLAGS, so that we
can use Objective-C in C++ files on Mac, if we ever need to.
2018-04-08 04:03:55 -04:00
Ell 06950be7f0 Makefiles: don't use -xobjective-c when compiling C++ files on Mac
On Mac, pass -xobjective-c to the compiler through AM_CFLAGS, not
AM_CPPFLAGS, so that it's only used for C sources, and not C++
sources.  In the latter case, it clashes with the -std=... flag,
spewing an error.  Thanks, Partha :)
2018-04-07 16:57:52 -04:00
Kristian Rietveld ce3899e722 libgimpwidgets: gimppickbutton-quartz: do not release color_space
The color_space reference should not be released because it was obtained
with a Get-function, which means we do not have ownership.
2018-03-26 22:59:01 +02:00
Kristian Rietveld 0e9e167da8 libgimpwidgets: make pick button quartz work on macOS < 10.12
The symbol CGColorSpaceCopyICCData() is only available on macOS 10.12
and higher. We want GIMP to run from 10.9 onwards, so use the older
symbol CGColorSpaceCopyICCProfile() even though this one is deprecated.
2018-03-26 22:59:01 +02:00
Michael Natterer 8447e775ab Bug 783680 - Allow to hide color models in GimpColorScales
Redo the entire thing again:

- Rename the values of enum GimpColorSelectorModel to include "MODEL"
- Change GimpColorSelector API from set_model() to set_model_visible()
  so visibility of each model can be toggled individually and is not
  exclusive any longer
- The GUI is back to what it was before, except that the "GIMP" page
  now honors the model visibility and has a resonable minimum height
2018-03-19 23:11:27 +01:00
Jehan 6c8300923d Bug 779942 - Make GimpPickButton honor monitor profile.
Quartz/macOS implementation for the color picker.
This is untested but I am trying to advance our 2.10 blockers by
implementing the base code for this feature. Please anyone with macOS
machine access, review and fix if needed!
2018-03-16 17:17:54 +01:00
Lionel N 827d747fae Bug 400448 - ruler subdivision is wrong for inches
Add ruler subdivisions for feet and yards, the code is still disabled.
2018-02-27 23:27:00 +01:00
Ell cd8ea6b3ca libgimpwidgets: in GimpNumberPairEntry, add clear icon
Since the entry behaves differently based on whether the user
provided an explicit input or not, it makes sense to have a button
for clearing the entry.
2018-02-27 03:55:34 -05:00
Ell 45bfa168bf libgimpwidgets: in GimpNumberPairEntry, update font when updating text
... in particular, so that the font is updated correctly when
reverting an invalid string.
2018-02-27 03:55:34 -05:00
Ell 8d2381f6e7 libgimpwidgets: in GimpNumberPairEntry, fix parsing
... to classify strings beginning with a non-digit character as
INVALID, rather than CLEAR.
2018-02-27 03:55:33 -05:00
Ell 0de25a145a libgimpwidgets: in GimpNumberEntryPair, properly set user-override ...
... when focus is lost/enter is pressed

When a GimpNumberPairEntry loses focus, or when enter is pressed,
set its user-override property by calling
gimp_number_pair_entry_set_user_override(), instead of setting the
corresponding member directly, so that the entry's font is updated
correctly.
2018-02-25 03:09:25 -05:00
Jehan 56d0998e74 icons, libgimpwidgets: fixing indentation and cleaning out tabs. 2018-02-24 15:58:26 +01:00
Jehan 6a9c4f8ef1 icons, libgimpwidgets: now with proper gimp-attach + gimp-detach icons.
"gimp-detach" does not just use "gtk-convert" anymore and has its own
design. As for "gimp-attach", this is not used anywhere (yet), but it
could be soon as reverse action of gimp-detach. For instance, this icon
can be used for bug 791859 when we implement re-attaching overlay
dialogs.
2018-02-24 01:27:56 +01:00
Michael Natterer e93f458026 libgimpwidgets: change disabled code in GimpRuler to avoid a warning 2018-02-22 09:48:03 +01:00
Michael Natterer fd37737fe4 Bug 400448 - ruler subdivision is wrong for inches
This commit changes nothing, but contains disabled proof-of-concept
code to use different ruler subdivisions depending on the ruler's
unit.
2018-02-12 12:20:32 +01:00
Michael Natterer cc97a87257 libgimpwidgets: propwidgets: don't g_object_set() the same value again
Normally, the model would try to avoid notifications when a set()
doesn't change anything, but with g_object_set() that's not possible.

Do the same in the propwidgets' callbacks and avoid potentially
expensive notifications at the cost of a cheap g_object_get().

Also fix the syntax of "Since:" and "Deprecated:" annotations.
2018-02-04 19:56:55 +01:00
Jehan de81e33340 libgimpwidgets: add missing gimp_color_selector_model_get_type in def...
... file.
2018-01-26 15:49:56 +01:00
Michael Natterer 13b640f84c libgimpwidgets: restore ABI of GimpColorSelectorClass
Public structs must not change, that's why we have padding at the
end for extension.
2018-01-22 13:04:54 +01:00
Jehan 54a1e8f2b1 libgimpwidgets: use g_return_if_reached() in unreachable code path.
This way, we get proper CRITICAL if ever there is a logic error (or in
this case, if we add new values to enums and forget to append them to
switch cases.
This will make these bugs much easier to debug if (when!) they happen.
2018-01-22 11:28:09 +01:00
Jehan 90037116e4 libgimpwidgets: oups, fix some stupid miswrite.
Unfortunately not very problematic, unless when setting alpha channel.
2018-01-22 01:08:32 +01:00
Jehan 4d84925db0 Bug 783680 - Allow to hide color models in GimpColorScales.
GimpColorSelect now using color models tabs too.
2018-01-21 19:00:20 +01:00
Jehan 37e9be3a4f libgimpwidgets: arrange color models in tabs in GimpColorScales.
This allows to have a smaller and cleaner color dock instead of just
listing all possible channels (which may only grow up as we may add more
color spaces).
The API gimp_color_scales_(set|get)_show_hsv() are removed in favor of
more generic gimp_color_selector_(set|get)_model(). I assume this is
ok since they have only been available in the dev version (commit
6258d525ae, a month ago).
2018-01-21 18:37:18 +01:00
Alexandre Prokoudine 940a5866a9 Add symbolic icons for linear/perceptual color spaces 2018-01-06 01:49:17 +03:00
Alexandre Prokoudine 78821b4cb9 Add icons for Shadows-Highlights 2018-01-05 21:03:42 +03:00
Michael Natterer 467a663f16 libgimpwidgets: return TRUE in GimpColorProfileChooserDialog's "delete-event"
Otherwise the dialog is automatically destroyed when e.g. pressing
Escape, which the code doesn't expect, leaving dangling (crashing)
ponters around.
2018-01-02 22:10:10 +01:00
Michael Natterer 6f7b1d6425 libgimpwidgets: add new GimpColorScales symbols to gimpwidgets.def 2018-01-02 03:59:28 +01:00
Michael Natterer 1e99b12aba libgimpwidgets: several GimpColorSelector cleanups / changes
- make RED the default channel and reorder RGB before LCH/HSV
- use more of the new getters
- also use more of the previously existing setters
2017-12-31 19:05:54 +01:00
Michael Natterer 6258d525ae Bug 770054 - High bit-depth color selection widgets
This is WIP in the middle of cleaning up GimpColorSelector subclasses:

Add the possibility to switch between LCH and LSV and between 0..100
and 0..255 RGB in to GimpColorScales. Works almost fine, but needs
different UI to change the options...
2017-12-31 17:53:13 +01:00
Michael Natterer 6263e25dd9 libgimpwidgets: don't add new stock IDs, they are all deprecated
Instead, add GIMP_ICON_* defines for new icons.
2017-12-31 16:10:14 +01:00
Michael Natterer dd06ebafa2 libgimpwidgets: add a getter for every setter of GimpColorSelector
Also add API docs, pretty basic ones.
2017-12-31 16:02:21 +01:00
Alexandre Prokoudine b7d2c5eab1 Add Exposure tool icon, remove erroneous stock entry for the colortemp icon 2017-12-28 04:11:55 +03:00
Alexandre Prokoudine c281fca1c0 Fix variables for the new icons 2017-12-27 07:49:52 +03:00
Alexandre Prokoudine 4d11e2b184 Add colortemp icons to the build 2017-12-27 07:49:52 +03:00
Ell 981e8dcdfe app, menus, icons: add dashboard dockable
The dashboard dockable shows the current GEGL cache and swap sizes,
and their recent history.  It has options to control the update
rate and history duration of the data, and an option to warn (by
raising/blinking the dialog) when the swap size approaches its
limit.
2017-12-18 19:42:23 -05:00
Jehan ef6559b38f libgimpwidgets: add private headers for GimpPickButton implementations.
Though forward declarations of the implementations are ok, it is cleaner
to have proper header files for each variant (default, kwin, quartz
right now). Of course these new header files are not installed and must
be kept private for build only.
2017-12-09 00:05:08 +01:00
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
Michael Natterer 461d807b05 libgimpwidgets: order enum combos of GimpDesaturateMode more logically
This is a bad hack that hardcodes a special case for
GIMP_TYPE_DESATURATE_MODE right into gimp_prop_enum_combo_box_new(),
we should think of something better if we get more special cases.
2017-03-17 22:50:12 +01:00
Michael Natterer e2ff186861 Bug 779942 - Make GimpPickButton honor monitor profile
Pass the right flags to gimp_color_transform_new(), and handle a NULL
return value.
2017-03-13 09:06:00 +01:00
Michael Natterer 064c4527cb Bug 779942 - Make GimpPickButton honor monitor profile
Convert the picked pixel from the monitor color profile to sRGB.
Only changed the default impl, not the quartz code.
2017-03-12 23:30:03 +01:00
Michael Natterer 4a75f33c07 libgimpwidgets: s/"document-open"/GIMP_ICON_DOCUMENT_OPEN/ in GimpFileEntry 2017-03-10 23:00:04 +01:00
Michael Natterer dda54c1df8 Deprecate stock items for good and change all icon defines to GIMP_ICON_*
Try to sort all GIMP_ICON_* defines into FDO categories like in
https://specifications.freedesktop.org/icon-naming-spec/latest/ar01s04.html

Add defines for all icons we override, rename some icons to their FDO
standard names, and mark the ones we duplicate with a comment so we
don't forget to rename those to standard names in 3.0.
2017-03-05 16:01:59 +01:00
Michael Natterer 91e861adcc libgimpwidgets, *: deprecating stock IDs for good, part one...
Remove all stock items added since 2.8, restore accidentially removed
ones, and rename the newly added GIMP_STOCK_* defines to GIMP_ICON_*.

(will move to having GIMP_ICON_* defines instead of magic hardcoded
strings for all icons).
2017-02-28 19:31:27 +01:00
Ell 2cb26a040a libgimpwidgets: invalidate the rulers' backdrop when the widget style is changed
... in particular, when swithcing themes.

Otherwise, the rulers keep their old, mismatched, style, until the
ticks are updated.
2017-02-27 05:03:59 -05:00
Michael Natterer b119fc995a libgimpwidgets: show help buttons in dialogs again
GimpDialog's "help-id" property didn't have G_PARAM_CONSTRUCT.

Broken since commit a940300525.
2017-02-12 16:32:41 +01:00
Michael Natterer 40981f43cf libgimp*: get rid of icons in dialog buttons (use labels not stock IDs) 2017-02-12 16:18:54 +01:00
Michael Natterer eb9981e5e4 libgimpwidgets: add gimp_screen_get_color_profile()
and use it in gimp_widget_get_color_profile(). Will soon be used in
screenshot too.
2017-01-31 18:58:27 +01:00
Hartmut Kuhse 66bc98d299 Revert "New GimpMetadata as subclass of GExiv2Metadata"
This reverts commit 3ab08c8bfd.
2017-01-03 19:36:22 +01:00
Hartmut Kuhse 3ab08c8bfd New GimpMetadata as subclass of GExiv2Metadata 2017-01-03 19:26:35 +01:00
Øyvind Kolås c9520bae6d libgimpwidgets: make color chooser scales range to 100.0 instead of 255
Still using perceptual TRC - making 50% middle gray.  This for all of 8bit and
16bit integer, as well as for floating point precisions. Also added a decimal point, to make use of more precision for both RGB and HSV entries.
2016-12-30 17:45:00 +01:00
Ell 3c2b4df6e6 libgimpwidgets: handle invalid enum values in gimp_enum_store_set_icon_prefix()
If the store has invalid enum values the function segfaults,
instead of just ignoring them.  We use -1 to represent separator
rows in the layer mode combo; if we end up adding icons to this
combo, we need it... not to segfault.  Since this is public API,
it should probably be prepared to handle such uses regardless.
2016-12-28 19:51:16 -05:00
Michael Natterer 956d45bf61 libgimpwidgets: add property GimpCellRendererToggle:override-background
which makes the cell paint its background color even when the row is
selected.
2016-10-29 16:47:36 +02:00
Michael Natterer 8e65aca452 Bug 773334 - GimpColorScale's scrolling behaviour is inverted...
...(scroll up decreases the value)

Implement GtkWidget::scroll_event() and turn GDK_SCROLL_UP into RIGHT
and DOWN into LEFT. The default behaviour or good for scrollbars but
not for widgets where "right" == "higher value" == "up" like
GimpColorScale.
2016-10-23 18:38:06 +02:00
Jehan 15d9f4a354 icons, libgimpwidgets: delete "gimp-path-(new|up|down|delete)" icons.
Commit 82737bf got rid of the only pieces of code where these icons were
used. Since they were never available in any version release of GIMP,
let's delete them from libgimpwidgets API as well.
2016-10-02 19:48:48 +02:00
Michael Natterer 12cb09836a Bug 772303 - preferences > folders don't have tooltips
Add tooltips to all buttons and indicators of GimpFileEntry and
GimpPathEditor.
2016-10-01 21:44:59 +02:00