Commit Graph

1694 Commits

Author SHA1 Message Date
98e955aebf libgimpwidgets: check error return for gtk_icon_theme_load_icon().
In gimp_page_selector_add_frame(), if "gimp-frame" icon cannot be loaded
(which should not happen, but reality can always strike back!), we want
to abort from gimp_page_selector_add_frame() immediately.

Also as a consequence, its return value might be NULL, hence should be
freed with g_clear_object() instead.

This happened here because of broken meson rules (which didn't install
this icon) and ended up in forever looping errors when loading a
multi-page PDF (pages are shown in frames in a dialog):

> (file-pdf-load:12348): GdkPixbuf-CRITICAL **: 11:59:28.513: gdk_pixbuf_copy_area: assertion 'src_pixbuf != NULL' failed

(cherry picked from commit 9dcdf37ab3)
2019-10-12 17:11:52 +02:00
1af8d2a2c7 libgimp*: use more g_clear_pointer()
(cherry picked from commit c144cf69de)
2019-07-25 12:40:33 +02:00
50e6d6ae20 libgimpwidgets: fix docs for GimpBusyBox:message
(cherry picked from commit fe75ef28ad)
2019-07-25 10:26:11 +02:00
520c5f4b69 libgimpwidgets: add more docs
(cherry picked from commit 9e88105ee6)
2019-07-24 19:13:32 +02:00
65cda467d6 libgimpwidgets: declare GimpHintBox with public instance and class
like all other objects, so gtk-doc doesn't cripple its docs.

(cherry picked from commit f67e607395)
2019-07-24 15:17:15 +02:00
ff1e645c2f libgimp*: lots of doc fixes and new docs for structs and enums
(cherry picked from commit aca5f806c4)
2019-07-24 01:26:11 +02:00
5cf40570cf libgimpwidgets: don't use g_type_class_add_private() in GimpColorButton
and switch to using G_DEFINE_TYPE_WITH_CODE().

(cherry picked from commit 88188cba0c)
2019-06-29 16:27:05 +02:00
Ell
ca4612cc43 Issue #40 - Layer offset tool
Add a new Offset filter tool, as a front-end to gimp:offset.  The
tool replaces, and provides the same interface as, the drawable-
offset dialog, while also providing live preview and on-canvas
interaction.

Note that we don't simply use a custom propgui constructor for
gimp:offset, since we need a little more control.

(cherry picked from commit 3a4a00c71e)
2019-06-05 19:10:52 -04:00
dd3529c0e9 libgimpwidgets: keep gimpwidgetsenums.h in alphabetical order
(cherry picked from commit 2f925e7277)
2019-06-01 16:43:07 +02:00
5a3e9d1f00 Issue 1878: Eyedrop tool doesn't work when screen composing (KWin)...
... is enabled.

(cherry picked from commit b29d1ea6ff)
2019-05-07 19:09:56 +09:00
Ell
f19ebb6269 app: revert combo-box drop-down changes
Revert the use of gtk_combo_box_set_wrap_width() to change the
combo-box drop-down style, except for the status-bar unit combo.
See https://gitlab.gnome.org/GNOME/gimp/issues/2828#note_421312 for
the rationale.

This reverts commits 1d984542e9,
68a33ab5bd, and
6dfca83c2a.

(cherry picked from commit 846d242f30)
2019-03-27 20:14:45 -04:00
8f3da0e8c4 Allow compilation on MacOS 10.5 leopard: issues #2923, #2924 and #2925 2019-03-23 23:33:07 +00:00
Ell
3be1a98408 libgimpwidgets: fix arithmetic-expression supprot in GimpSizeEntry
... after commit 8b3c7ae193.

(cherry picked from commit 81a361be73)
2019-03-11 13:53:47 -04:00
Ell
f27bf95e05 Issue #2557 - Gimp Can't Rotate By More Than 180 Degree
When the "wrap" property of a GimpSpinButton is TRUE, wrap-around
out-of-range values entered through the spin-button's text entry,
instead of clamping them.  Since we're using GimpSpinButton
everywhere since last commit, this applies to all our angle-entry
spin buttons (including spin scales).

(cherry picked from commit 8b3c7ae193)
2019-03-09 07:43:17 -05:00
Ell
2dad85b84f libgimpwidgets, app, plug-ins: use GimpSpinButton everywhere
Replace all direct uses of GtkSpinButton with GimpSpinButton, so
that its modified behavior extends to all our spin buttons.
2019-03-09 07:43:13 -05:00
Ell
1705333141 libgimpwidgets: fix gimp_spin_button_new_with_range()
(cherry picked from commit 19eb9fb1bf)
2019-03-03 04:22:30 -05:00
Ell
0f727e4f2f libgimpwidgets: in GimpChainButton, emit "toggled" signal when "active" changes
In GimpChainButton, emit the "toggled" signal whenever the chain
button's "active" property changes, either due to user interaction,
or programatically.  Previously, it would only get emitted when the
button was actually clicked.

In particular, this fixes an issue where the aspect ratio of a
coordinates size-entry won't get updated when its chain button got
toggled programatically, as can happen with the scale tool.

(cherry picked from commit c0c055b4e9)
2019-02-08 08:22:45 -05:00
Ell
a771662420 libgimpwidgets: add gimp_chain_button_{get,size}_icon_size() to gimpwidgets.def
(cherry picked from commit 0714510802)
2019-02-05 03:49:51 -05:00
Ell
b869f1bf5a libgimpwidgets: add GimpChainButton::active property
... which corresponds to the button's toggle state.

(cherry picked from commit 9c3f150e25)
2019-02-04 16:50:41 -05:00
Ell
fcfe6997cd libgimpwidgets: add GimpChainButton::icon-size property
... and corresponding gimp_chain_button_{get,size}_icon_size()
functions, which control the chain-button's icon size.

(cherry picked from commit 8d6c7e42bf)
2019-02-04 16:50:36 -05:00
10aa988afa Issue #2828: Scrolling up with a mouse within a drop-down list.
We were doing it all the wrong way, fixing one combo box object at a
time. So this commit basically reverses commits 68a33ab5bd, 6dfca83c2a
and a9a979b2d0 and instead runs the same code in the class code. This
way, all objects based on these base classes will have the fix from
scratch.
These improved various other drop-down lists (I found some of them, and
probably not all) as I fixed all GIMP custom widgets based on
GtkComboBox.

Note that it has to be run after filling the list apparently (I had the
problem especially with GimpIntComboBox if running in the _init() code,
then the list widget showed wrong).

(cherry picked from commit 1d984542e9)
2019-01-20 13:48:33 +01:00
a27f7c7724 Issue #1788 - Inconsistency between FG color and selected color in...
...palette views despite selected color being in the currently
selected pallette

As suggested by Massimo, changing the color comparison EPSILON in
gimppalette.c from 1e-10 to 1e-6 fixes this, and is really small
enough.

Also, generally clean up color comparison epsilons:

- use a #define, not hardcoded values for all uses of
  gimp_rgb[a]_distance()
- call the #defines RGB_EPSILON and RGBA_EPSILON
- make them all 1e-6 or larger

(cherry picked from commit abd7cbfc8d)
2019-01-02 01:53:02 +01:00
86b9738286 app: do not make line art bucket fill a GimpSelectCriterion anymore.
This was my initial choice, but the more I think about it, the less I am
sure this was the right choice. There was some common code (as I was
making a common composite bucket fill once the line art was generated),
but there is also a lot of different code and the functions were filled
of exception when we were doing a line art fill. Also though there is a
bit of color works (the way we decide whether a pixel is part of a
stroke or not, though currently this is basic grayscale threshold), this
is really not the same as other criterions. In particular this was made
obvious on the Select by Color tool where the line art criterion was
completely meaningless and would have had to be opted-out!

This commit split a bit the code. Instead of finding the line art in the
criterion list, I add a third choice to the "Fill whole selection"/"Fill
similar colors" radio. In turn I create a new GimpBucketFillArea type
with the 3 choices, and remove line art value from GimpSelectCriterion.

I am not fully happy yet of this code, as it creates a bit of duplicate
code, and I would appreciate to move some code away from gimpdrawable-*
and gimppickable-* files. This may happen later. I break the work in
pieces to not get too messy.
Also this removes access to the smart colorization from the API, but
that's probably ok as I prefer to not freeze options too early in the
process since API needs to be stable. Probably we should get a concept
of experimental API.

(cherry picked from commit cd924f453a)
2018-12-19 16:23:26 +01:00
bde56bdfdc app, libgimpbase: add GIMP_SELECT_CRITERION_LINE_ART selection type.
This commit implements part of the research paper "A Fast and Efficient
Semi-guided Algorithm for Flat Coloring Line-arts" from the GREYC (the
people from G'Mic). It is meant to select regions from drawn sketchs in
a "smart" way, in particular it tries to close non-perfectly closed
regions, which is a common headache for digital painters and colorists.

The implementation is not finished as it needs some watersheding as well
so that the selected area does not leave "holes" near stroke borders.
The research paper proposes a new watersheding algorithm, but I may not
have to implement it, as it is more focused on automatic colorization
with prepared spots (instead of bucket fill-type interaction).

This will be used in particular with the fuzzy select and bucket fill
tools.

Note that this first version is a bit slow once we get to big images,
but I hope to be able to optimize this.
Also no options from the algorithm are made available in the GUI yet.

(cherry picked from commit 8ed12b1b98)
2018-12-19 15:18:19 +01:00
40a08dcf48 tests: fix clang compilation error on test-eevl.c 2018-11-23 22:32:32 +01:00
Ell
46d4768699 libgimpwidgets: install gimpspinbutton.h
Added in commit 7ab9ee2686.

(cherry picked from commit 03a928409a)
2018-11-19 09:28:58 -05:00
Ell
3a584ca151 Issue #2470 - Spacing between grid lines does not stay at 1px ...
... as I would like it to.

Use GimpSpinButton, added in the previous commit, in GimpSizeEntry,
instead of GtkSpinButton.  This avoids updating the spin-buttons'
adjustment values when they lose focus, truncating the value if it
can't be accurately displayed using the corresponding spin-button's
digit count.  Since size-entries can have multiple spin-buttons
using different units, this prevents the value from changing when
entring a value using one unit, and then shifting the focus to, but
not changing, another unit.
2018-11-10 06:57:54 -05:00
Ell
d928ed7252 libgimpwidgets: add GimpSpinButton
GimpSpinButton is a drop-in replacement for (and a subclass of)
GtkSpinButton.  Unlike GtkSpinButton, it avoids updating the
adjustment value when losing focus, unless the entry text has
changed.  This prevents accidental loss of precision, when the
adjustment value can't be accurately displayed in the entry.

Note that libgimpwidgets already defines a (deprecated)
gimp_spin_button_new() function.  This commit stays compatible with
the old function, by defining GimpSpinButton's _new() function as
gimp_spin_button_new_(), and defining a variadic
gimp_spin_button_new() macro, which expands to either the old or
the new function, based on the number of arguments, so that either
function can be used transparently as gimp_spin_button_new().  This
is all gone in master.
2018-11-10 06:57:54 -05:00
7dbb9fee3d Fix compilation on Mac 10.6 and 10.7 (#2112) 2018-10-24 10:37:36 +02:00
Ell
31b369d09f app, libgimp*, modules: don't use g_type_class_add_private() ...
... and G_TYPE_INSTANCE_GET_PRIVATE()

g_type_class_add_private() and G_TYPE_INSTANCE_GET_PRIVATE() were
deprecated in GLib 2.58.  Instead, use
G_DEFINE_[ABSTRACT_]TYPE_WITH_PRIVATE(), and
G_ADD_PRIVATE[_DYNAMIC](), and the implictly-defined
foo_get_instance_private() functions, all of which are available in
the GLib versions we depend on.

This commit only covers types registered using one of the
G_DEFINE_FOO() macros (i.e., most types), but not types with a
custom registration function, of which we still have a few -- GLib
currently only provides a (non-deprecated) public API for adding a
private struct using the G_DEFINE_FOO() macros.

Note that this commit was 99% auto-generated (because I'm not
*that* crazy :), so if there are any style mismatches... we'll have
to live with them for now.
2018-09-18 14:41:35 -04:00
Ell
40ac4f7bc0 app, icons, menus: add performance-log recording to the dashboard
Add an option to record a performance log through the dashboard.
The log contains a series of samples of the dashboard variables, as
well as the full program backtrace, when available.  As such, it
essentially acts as a built-in profiler, which allows us to
correlate program execution with the information available through
the dashboard.  It is meant to be used for creating logs to
accompany perofrmance-related bug reports, as well as for profiling
GIMP during development.

The sample frequency defaults to 10 samples per second, but can be
overridden using the GIMP_PERFORMANCE_LOG_SAMPLE_FREQUENCY
environment variable.  Backtraces are included by default when
available, but can be suppressed using the
GIMP_PERFORMANCE_LOG_NO_BACKTRACE environment variable.

Logs are created through the new "record" button at the bottom of
the dashboard dialog.  When pressed, a file dialog is opened to
select the log file, and, once confirmed, data is being recorded to
the selected file.  Recording is stopped by pressing the "record"
button again (we use a highlight to indicate that recording is
active.)

While recording, the "reset" button is replaced with an "add marker"
button, which can be used to add event markers to the log.  These
can be used to mark events of interest, such as "started painting"
and "stopped painting", which then appear in the log as part of the
sample stream.  Markers are numbered sequentually, and the number
of the next (to-be-added) marker appears on the button.  Shift-
clicking the button adds an empty (description-less) marker, which
is only identified by its number; this can be used when markers
need to be added quickly.

The log is an XML file, containing some extra information (such as
the output of "$ gimp -v", and symbol information) in addition to
the samples.  The data in the file is delta-encoded to reduce the
file size, meaning that samples (as well as some other elements)
only specify the changes since the previous sample.  This adds a
necessary decoding step before data can be processed; the next
commit adds a tool that does that.

There are currently no tools to actually analyze the data -- that's
still TBD -- but at least we can start gathering it.
2018-09-02 03:26:11 -04:00
e2958714d9 MR !19: Add support for vertical text writing.
Squashed commit of the following:

commit ee1ff7d502658cfa1248a13a3f0348495db07eda
Author: ONO Yoshio <ohtsuka.yoshio@gmail.com>
Date:   Sun Jul 29 00:31:47 2018 +0900

    Fixed that gimp-text-dir-ttb-* icons are lacked in Symbolic.

commit d87d012d697628da28fe90199cc04b95b72ba8ef
Author: ONO Yoshio <ohtsuka.yoshio@gmail.com>
Date:   Sat Jul 28 16:23:10 2018 +0900

    Fix a typo.

commit cf0238bf7df56c384cdf3b7ec69557d14740f853
Author: ONO Yoshio <ohtsuka.yoshio@gmail.com>
Date:   Sat Jul 28 15:50:57 2018 +0900

    Fixed seg fault error.

commit b07f60d06fa1a753fda5b4d46af01698c344154e
Author: ONO Yoshio <ohtsuka.yoshio@gmail.com>
Date:   Fri Jul 27 17:15:34 2018 +0900

    Add support for vertical text writing.

    https://gitlab.gnome.org/GNOME/gimp/issues/641

(cherry picked from commit 587d9bbb03)
2018-07-30 23:10:11 +02:00
Ell
efe72a8d56 */Makefile.am: add *marshal.h files to BUILT_SOURCES
In subdirs containing a generated foomarshal.h header, add the
generated sources to BUILT_SOURCES, so that they're generated
before the rest of the source files are built.  Otherwise, since
there is no rule specifying the dependency between the rest of the
source files and foomarshal.h, and since foomarshal.h is not
checked into git (and hence doesn't exist when doing a clean
build), compilation of the said source files may fail if they're
built before foomarshal.h is generated.

(cherry picked from commit a5102a7dba)
2018-07-24 14:05:23 -04:00
77f3c8e404 libgimpwidgets, icons: add gimp-color-space-non-linear icon
For now just a copy of the "perceptual" icon.

(cherry picked from commit 5c94ebaed3)
2018-07-20 17:29:31 +02:00
9e71fc0983 Change a bazillion URLs to https://
Including all user-visible link and links called from code, like
the help pages.

(cherry picked from commit bab75b7365)
2018-07-14 14:23:42 +02:00
a88c0ffb93 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:47:19 +02:00
a09e016d32 libgimpwidgets: forgot one s/H/h/ in LCh
(cherry picked from commit a1f2464ed6)
2018-07-08 17:31:25 +02:00
cc20410e80 app, libgimp*: make user visible color model labels consistent
- "LCh" intead of "LCH"
- "CIE LCh" instead of "CIELCh"
- "HSV Hue" instead of "Hue (HSV)" for all models/components

(cherry picked from commit 926dc070ef)
2018-07-08 16:21:23 +02:00
94235e4447 app, libgimpwidgets: all GimpColorHexEntries should have the same tooltip
Set the tooltip in GimpColorHexEntry itself and remove all other
tooltip setting. This just moves the translatable string sround in
libgimpwidgets/, and even removes it from app/.

(cherry picked from commit 2b8b780b6a)
2018-06-24 14:30:09 +02:00
93025adf02 Issue #1435 - Add tooltips to GimpColorNotebook's tabs
(cherry picked from commit 8d6f023b41)
2018-06-08 19:46:29 +02:00
def91dfc59 libgimpwidgets: install gimpbusybox.h as public header
(cherry picked from commit b75cbcb417)
2018-06-08 18:59:41 +02:00
Ell
357c3d4b6b libgimpwidgets: add exponentiation support to eevl
Add support for exponentiation (using the ^ operator) to eevl.
This is occasionally useful, e.g., in geometrically-derived
quantities involving square roots.

(cherry picked from commit 8d35299410)
2018-06-01 10:53:51 -04:00
52e3eb32f3 Use g_set_object() in a lot of places, and splrinkle some g_clear_object()
This is mostly core code which we want to keep in sync with master as
long as possible, so I picked this one even though not strictly
neccessary.

(cherry picked from commit 1b7d63cce9)
2018-06-01 13:14:47 +02:00
Ell
aa22914568 libgimpwidgets: add GimpBusyBox
GimpBusyBox is used to show a message indicating an operation is in
progress.  It's basically just a spinner and a label, with some
styling.

We're going to use it both in app/ and in a plug-in.
2018-05-29 16:07:48 -04:00
fe06539873 libgimpwidgets: fix value names in docs of GimpColorSelectorModel 2018-05-18 19:32:51 +02:00
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
a69b8a25df libgimpwidgets: in GimpEnumLabel use the value's nick if there is no desc 2018-05-16 21:12:20 +02:00
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
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