Commit Graph

21351 Commits

Author SHA1 Message Date
Jehan a03e52ea08 app: add "cairo-ARGB32" to "R'G'B'A u8" in gimp_babl_init_fishes().
This fish is used for text layers, so if we let it to be
lazy-initialized, the first time one writes text in a text layer, it
generates a few seconds delay, which is really not great.
2018-08-01 16:45:16 +02:00
Ell a826a19359 Issue #1884 - Incorrect font when export to png
In gimp_layer_convert(), avoid converting the drawable type when
the source and destination color profiles are equal, if otherwise
unnecessary.  Otherwise, text layers get unnecessarily re-rendered
during conversion, and, by extension, during image duplication
(which happens when exporting to any format that requires merging
down the image).  This may cause the text layer to appear
differently in the duplicated image, or even use a different font
if the original font doesn't exist.
2018-08-01 05:06:13 -04:00
Ell f38443f3b0 app: copy the is-color-managed status when duplicating an image
When duplicating an image, copy the source image's is-color-managed
status to the duplicated image, instead of having the duplicated
image always be color managed.  In particular, do this before
duplicating the layers, so that we don't convert the duplicated
layers from sRGB to the image's profile when duplicating an image
with a non-sRGB profile but with color management turned off.
2018-08-01 05:06:13 -04:00
ONO Yoshio b405b0364c Modified a comment in more detail. 2018-07-31 11:29:42 +00:00
luz.paz 949912f5d6 Misc. typos
Found via `codespell  -q 3 -I ../gimp-word-whitelist.txt --skip="*.po"`
2018-07-31 06:58:48 -04:00
ONO Yoshio 587d9bbb03 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 b07f60d06f
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
2018-07-30 19:14:49 +02:00
Michael Natterer 46f528131b Issue 1652 - Empty toolbox has very large minimum height in MWM
Adjust size negotiation of GimpToolPalette to take the monitor's
workarea into account: request space for enough columns so that the
widget's height is never more than 70% of the workarea height, and
enough rows so that it's never wider than 90% of the workarea.
2018-07-30 12:47:18 +02:00
Jehan 1e5cf10585 icons, app, libgimpwidgets: use Freedesktop standard icons.
Some icons were still using old gimp-namespaced names.
2018-07-28 12:27:10 +02:00
Jehan 6b4b3bad13 app: show relevant files only by default.
Just like it was until now, the default filtering should not be all
files, but only relevant files (i.e. XCF when saving, exportable images
when exporting and loadable images/XCF when opening).
Now all files will only be available through the "Show All Files"
checkbox.

This is simpler than previous implementations where the list was
proposing "All Files", "All Images" and "All XCF/export images". That is
just too much.

With this default, I get the "All Files" checkbox out of the expander so
that it is visible immediately even when the format list is unexpanded
(you don't want people to get pissed when not finding how to display all
their files).
2018-07-25 17:01:38 +02:00
Jehan 6369445874 Issue #1160: file dialog view filter getting confused with file...
... format selection.
Second step: add a "Show All Files" checkbox so that one can still
prevent view filtering even when forcing a load format.
This is useful when loading files with unusual extensions, for instance.
2018-07-25 15:31:25 +02:00
Jehan 193a49a6d1 app: force the extra widget to take as much place as possible.
I am separating this from previous commit since it cannot be backported
to GTK+2.
2018-07-25 15:31:25 +02:00
Jehan 9ae7827f9b Issue #1160: file dialog view filter getting confused with file...
... format selection.
As discussed, the first step is to get rid of the filter list. Our extra
widget now has both roles of filtering the file list and forcing a
loading procedure.
2018-07-25 15:31:25 +02:00
Ell a5102a7dba */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.
2018-07-24 14:05:08 -04:00
Michael Natterer 248199e997 app: make replacing a drawable's format use almost no undo memory
Add gimp_drawable_set_format() as low-level part of
gimp_layer_fix_format_space(), and add a special undo type for it that
only remembers the format and not the entire drawable buffer, because
all pixels stay the same.
2018-07-24 12:56:36 +02:00
Ell 78abe756f1 app: fix segafult when halting filter-tool with controller
In GimpFilterTool, bind the controller's lifetime to the lifetime
of the config object, rather than to the lifetime of the
corresponding tool widget; make the controller's widget pointer a
weak pointer to the widget, and bail out of the controller "set()"
functions when the widget pointer is NULL.

This fixes an issue arising when the properties of a config object
that outlives the widget change after the widget had died,
triggering a call to the controller's set() function, resulting in
a segafult when trying to access the widget.
2018-07-24 02:25:25 -04:00
Ell 6976e87dac app: in prop-GUI, use "direction" UI-meta of angle props for dial
When constructing a prop-GUI widget for an angle property with a
dial, use the the property's "direction" UI-meta, if exists, to set
the direction of the dial.  Together with GEGL commit
7b0578073a0f20334b5a8a8fe57b649d9f302454, this fixes wrong dial
direction in certain ops that use clockwise angles.
2018-07-24 02:25:25 -04:00
Ell 0c477564ad app: in GimpDial, add "clockwise-angles" property ...
... and rename "clockwise" to "clockwise-delta"

Add a boolean "clockwise-angles" property to GimpDial, which, when
set, causes the dial legs' angles to be measured clockwise, rather
than counter-clockwise.  The property is FALSE by default.

Rename the "clockwise" property, which controls the direction of
the measured delta between the two angles, to "clockwise-delta", to
avoid confusion, and adapt the rest of the code.
2018-07-24 02:25:22 -04:00
Øyvind Kolås cb132d2a97 configure/app: depend on GEGL 0.4.6 2018-07-23 04:45:43 +02:00
Øyvind Kolås 5fdcc0dfbb configure/app: depend on babl 0.1.54 2018-07-23 04:44:58 +02:00
Michael Natterer e09e563a70 Initial space invasion commit in GIMP
All babl formats now have a space equivalent to a color profile,
determining the format's primaries and TRCs. This commit makes GIMP
aware of this.

libgimp:

- enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
  as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
  NON_LINEAR and PERCPTUAL for each encoding, matching the babl
  encoding variants RGB, R'G'B' and R~G~B~.

- gimp_color_transform_can_gegl_copy() now returns TRUE if both
  profiles can return a babl space, increasing the amount of fast babl
  color conversions significantly.

- TODO: no solution yet for getting libgimp drawable proxy buffers in
  the right format with space.

plug-ins:

- follow the GimpPrecision change.

- TODO: everything else unchanged and partly broken or sub-optimal,
  like setting a new image's color profile too late.

app:

- add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
  replacement for all "linear" booleans.

- change gimp-babl functions to take babl spaces and GimpTRCType
  parameters and support all sorts of new perceptual ~ formats.

- a lot of places changed in the early days of goat invasion didn't
  take advantage of gimp-babl utility functions and constructed
  formats manually. They all needed revisiting and many now use much
  simpler code calling gimp-babl API.

- change gimp_babl_format_get_color_profile() to really extract a
  newly allocated color profile from the format, and add
  gimp_babl_get_builtin_color_profile() which does the same as
  gimp_babl_format_get_color_profile() did before. Visited all callers
  to decide whether they are looking for the format's actual profile,
  or for one of the builtin profiles, simplifying code that only needs
  builtin profiles.

- drawables have a new get_space_api(), get_linear() is now get_trc().

- images now have a "layer space" and an API to get it,
  gimp_image_get_layer_format() returns formats in that space.

- an image's layer space is created from the image's color profile,
  change gimpimage-color-profile to deal with that correctly

- change many babl_format() calls to babl_format_with_space() and take
  the space from passed formats or drawables

- add function gimp_layer_fix_format_space() which replaces the
  layer's buffer with one that has the image's layer format, but
  doesn't change pixel values

- use gimp_layer_fix_format_space() to make sure layers loaded from
  XCF and created by plug-ins have the right space when added to the
  image, because it's impossible to always assign the right space upon
  layer creation

- "assign color profile" and "discard color profile" now require use
  of gimp_layer_fix_format_space() too because the profile is now
  embedded in all formats via the space.  Add
  gimp_image_assign_color_profile() which does all that and call it
  instead of a simple gimp_image_set_color_profile(), also from the
  PDB set-color-profile functions, which are essentially "assign" and
  "discard" calls.

- generally, make sure a new image's color profile is set before
  adding layers to it, gimp_image_set_color_profile() is more than
  before considered know-what-you-are-doing API.

- take special precaution in all places that call
  gimp_drawable_convert_type(), we now must pass a new_profile from
  all callers that convert layers within the same image (such as
  image_convert_type, image_convert_precision), because the layer's
  new space can't be determined from the image's layer format during
  the call.

- change all "linear" properties to "trc", in all config objects like
  for levels and curves, in the histogram, in the widgets. This results
  in some GUI that now has three choices instead of two.
  TODO: we might want to reduce that back to two later.

- keep "linear" boolean properties around as compat if needed for file
  pasring, but always convert the parsed parsed boolean to
  GimpTRCType.

- TODO: the image's "enable color management" switch is currently
  broken, will fix that in another commit.
2018-07-21 16:42:57 +02:00
Jehan 955136e74b app: do not show close button to extensions dialog.
The "OK" button next to the close button is quite redundant.
2018-07-19 12:56:49 +02:00
Ell 6b1d77b11c Issue #1874 - Critical error after selecting "Edit Text on Canvas" ...
... from layer context menu

In gimp_text_tool_set_layer(), do nothing if the input layer is the
currently-edited layer, otherwise we get a CRITICAL.
2018-07-19 02:27:07 -04:00
Ell 534e8aa92c app: improve file-handler sorting
... by falling back to the procedure name as a last resort.
2018-07-18 09:27:22 -04:00
Jehan c9a382f7bd app: connect the switch to start/stop the extension. 2018-07-18 12:11:14 +02:00
Jehan d68a68c54d app: add "running" property to extension.
And connect to this property in the extension manager to allow dynamic
reload when starting/stopping an extension. It doesn't work yet for
extensions with plug-ins but works with other kinds of data.
2018-07-18 12:08:57 +02:00
Jehan acdf169d97 app: set overrided system extensions as unsensitive.
When a user extension with same id as a system extension is installed,
set the system extension unsensitive in the GUI (as well as extensions
with missing requirements, though it is not implemented yet).

The reason why I broke this change in 2 commits (with the previous
commit) is because it will allow to easily cherry-pick the core code
commits whereas the GTK+ code will have to be reimplemented for
gimp-2-10 since this widget uses GTK+3 API.
2018-07-17 19:45:51 +02:00
Jehan 4d745743e8 app: functions to manage running extensions.
Add gimp_extension_manager_can_run() and rename function:
s/gimp_extension_manager_is_active/gimp_extension_manager_is_running/

A system extension cannot be run if it has been overrided by a
user-installed extension of same ID. Moreover extensions can have GIMP
version requirements as well as have dependency on other extensions
(though these are not implemented yet).
2018-07-17 19:45:51 +02:00
Jehan 02aec4c3d6 app: serialize and deserialize extensionrc from GimpExtensionManager.
We only save the active state of extensions so that we can reload all
extensions same as they were at previous exit. All other data are saved
as per-extension metadata and should not be saved in the rc file.

If an extension is not listed in extensionrc, we run it by default if
this is a system extension (so that new core extensions by the GIMP team
are run when installed after an updated), but not when they are
user-installed extensions.
2018-07-17 19:45:51 +02:00
Ell b2a9bb4688 app: fix dynamics editor "fade" curve color
In the dynamics editor, use the neutral curve color, which depends
on the current theme, for the "fade" curve, instead of hard-coding
it to dark gray, which is hardly visible with dark themes.
2018-07-17 09:18:06 -04:00
Ell bfc2681753 app: indentation fix in gimppluginmanager-restore.c 2018-07-17 03:18:13 -04:00
Ell b4ac956859 app, pdb: add gimp-register-file-handler-priority procedure
Add a gimp-register-file-handler-priority procedure, which can be
used to set the priority of a file-handler procedure.  When more
than one file-handler procedure matches a file, the procedure with
the lowest priority is used; if more than one procedure has the
lowest priority, it is unspecified which one of them is used.  The
default priority of file-handler procedures is 0.

Add the necessary plumbing (plus some fixes) to the plug-in manager
to handle file-handler priorities.  In particular, use two
different lists for each type of file-handler procedures: one meant
for searching, and is sorted according to priority, and one meant
for display, and is sorted alphabetically.
2018-07-17 02:56:18 -04:00
Michael Natterer ac5f44eb74 app: opaque in gimp_layer_new() is 1.0 not 255
The value is later CLAMP()ed correctly, but fix the call in xcf-load.c
anyway.
2018-07-16 14:47:10 +02:00
Ell a810c6b60b app: update GimpToolCompass when display is scaled/rotated
In GimpToolCompass (and, as a consequence, in the measure tool),
update the measured angle when the shell is scaled, rotated, or
flipped, so that we always satisfy the compass's constrains, and
render correctly.
2018-07-16 04:44:47 -04:00
Ell 0f03f9e9f5 app: in GimpToolCompass, add visual distinction between angle lines
When using a GimpToolCompass in 3-point mode, add a small gap after
the angle arc to the line corresponding to the "second" non-origin
point, so that it's visually distinguishable from the line
corresponding to the "first" point.  This has significance for the
measure tool, since it determines the direction of the rotation
when straightening the image (the first point is rotated toward the
second point.)
2018-07-16 02:17:09 -04:00
Ell f026a3fc2d app: keep display-enums.h (sort-of) alphabetically sorted 2018-07-16 01:42:17 -04:00
Ell 2e08c9164a Issue #1850 - Undoing the "straighten" operation in the Measure tool ...
... does not restore the measure points

Halt the measure tool after straightening, thus removing the
expectation that undoing the operation should restore the original
points.

Halting the tool, rather than making undo work "as expected",
sidesteps several issues:

  - Implementing undo correctly is tricky, since image-undo and
    tool-undo are handled separately.

  - In fact, the measure tool doesn't provide tool-undo, so that
    image edits can be undone while the tool is active without
    affecting the tool, and it's not clear that we want to change
    this behavior.  However, this makes undoing a straighten
    operation a special case, and it's not entirely clear what the
    behavior should be when undoing other kinds of transformations,
    or when the measure points had changed since the straighten
    operation.

  - Perhaps most importantly, measure tool points are restricted to
    the pixel grid, which means that when measuring an angle
    against an orientation that's not fully horizontal or vertical
    in image space (either using a 3-point angle, or when the
    canvas is rotated), the resulting transformed point after
    straightening doesn't generally land on the pixel grid, causing
    it to be rounded, which can result in a non-zero angle after
    the rotation.  This is especially ugly, since clicking
    "straighten" again at this point would cause another non-
    trivial rotation.
2018-07-16 01:02:08 -04:00
Ell 7a91aabf37 app: bind "orientation" measure-tool option to compass
Bind the "orientation" property of the measure-tool options to the
tool's compass widget's "orientation" property, instead of manually
synchronizing their values.
2018-07-15 19:58:43 -04:00
Michael Natterer 47a008be97 Issue #1805 - Sample Points keep resetting themselves to "Pixel"
Rename XCF property PROP_SAMPLE_POINT to PROP_OLD_SAMPLE_POINT and add
new PROP_SAMPLE_POINT.

The new property saves the sample point's pick mode plus some padding
for whatever else we might want to add. Always save the old property
too so nothing changes for older GIMP versions, and avoid loading the
old property if the new one was loaded before.
2018-07-16 01:42:19 +02:00
Ell cb3b7a1ba5 Issue #1851 - Measure tool straighten rotation is always to the horizontal.
Add an "orientation" option to the measure tool, corresponding to
the "orientation" property of GimpToolCompass (i.e., it controls
the orientation against which the angle is measured, when not in 3-
point mode.)  The orientation is "auto" by default, so that the
angle is always <= 45 deg.  Note that the "orientation" option
affects the tool's "straighten" function, so that the layer is
rotated toward the current orientation.

Use the "pixel-angle" and "unit-angle" properies of
GimpToolCompass to read the measured angle, instead of duplicating
the angle-measurement logic, in particular, so that we benefit from
the improvements/fixes of the previous commit.
2018-07-15 19:09:06 -04:00
Ell d2f33cf1be app: add "orientation" property to GimpToolCompass + improvements
Add an "orientation" property to GimpToolCompass, which can be one
of "auto", "horizontal", or "vertical", and which controls the
orientation of the line against which the angle is measured, when
not in 3-point mode (previously, the line would always be
horizontal.)  When "orientation" is "auto", the orientation is
automatically set to either horizontal or vertical, such that the
measured angle is <= 45 deg.

Keep the line horizontal, or vertical, in display-space, rather
than in image-space, so that the compass works correctly even when
the canvas is rotated and/or flipped.

Fix the compass's behavior when the image's horizontal and vertical
resolutions are different, both with and without dot-for-dot.

Add "pixel-angle" and "unit-angle" read-only properties, which
return the measured angle either with or without taking the image's
resolution into account, respectively.  These properties will be
used by the measure tool in the next commit, instead of having it
implement its own angle calculation.
2018-07-15 19:09:06 -04:00
Ell 4fefab1798 app: fix line-angle constraint when xres != yres
Fix gimp_constrain_line() and friends to properly constrain line
angles when the image's horizontal and vertical resolutions are
different, and dot-for-dot is disabled.
2018-07-15 19:09:06 -04:00
Michael Natterer a0129504c8 Issue #1805 - Sample Points keep resetting themselves to "Pixel"
Remember the sample point's GimpColorPickMode in the sample point
itself, so it is remembered across switching between images.

Not persistent in the XCF yet tho...
2018-07-16 00:43:31 +02:00
Michael Natterer f676f2aa79 app: move GimpColorFrameMode to the core and name it GimpColorPickMode 2018-07-15 23:24:50 +02:00
Michael Natterer a7a277efe7 app: sort core-enums.h alphabetically
Sorry for messing with git diffs, but this unsorted mess has been
annoying since forever.
2018-07-15 22:25:43 +02:00
Michael Natterer 827faa2a25 app: minor cleanup in gimpguide.c 2018-07-15 22:25:03 +02:00
Michael Natterer 2cd829eb85 app: add GimpAuxItem as base class for GimpGuide and GimpSamplePoint
and GimpAuxItemUndo for their respective undo classes.
2018-07-15 17:08:06 +02:00
Michael Natterer b4c244b839 app: turn GimpSamplePoint into a GObject, just like GimpGuide
In fact, they are so similar now, they should get a common abstract
parent class.
2018-07-15 15:58:24 +02:00
Michael Natterer e76eb736d4 app: some cosmetic cleanup in the guide code 2018-07-15 15:51:40 +02:00
Michael Natterer b140b283dc app: rename enum GimpColorPickMode to GimpColorPickTarget
This is just some preparation for fixing issue #1805, but actually
"target" is a much better name so I went the full way and also changed
GUI labels and the color picker tool options config property
accordingly.

If anyone notices at all, how horrible is it to lose your saved pick
target...
2018-07-15 14:32:53 +02:00
Michael Natterer 8b71d32659 app: fix GimpControllerWheel for smooth scrolling events
gimp_controller_wheel_scroll(): attempt to translate smooth scroll
deltas to GdkScrollDirection, controller events are always discrete
steps.

Works fine on X11, no idea how it behaves on other backends, please
check and report.
2018-07-15 13:56:44 +02:00