Commit Graph

22584 Commits

Author SHA1 Message Date
Ell 5646e03eb3 app, icons: add 3D Transform tool
Add a new 3D Transform tool, based on GimpToolTransform3DGrid,
added in the previous commit.  The tool UI provides a notbook with
three tabs, corresponding to the three GimpToolTransform3DGrid
modes:

  Camera - allows setting the primary vanishing point, as well as
  the camera's focal length, expressed either directly, or as the
  camera's angle of view, relative to the whole image or the
  transformed item.  By default, the vanishing point is aligned
  with the item's center, and the angle of view is fixed relative
  to the item; this essentially means that each item is transformed
  using a local perspective, independent of its position and size
  relative to the image.  A global perspective can be achieved by
  using a common vanishing point and focal length (or an image-
  relative angle of view).

  Move   - allows moving the item using X, Y, and Z offsets.

  Rotate - allows rotating the item using X, Y, and Z Euler angles.
  The order of rotation of the different axes can be controlled by
  a set of numbered buttons next to the sliders, and the rotation's
  pivot can be controlled using a pivot selector.
2020-01-06 21:52:54 +02:00
Ell 615035c101 app, cursors: add GimpToolTransform3DGrid tool widget
Add a new GimpToolTransform3DGrid tool widget, subclassed from
GimpToolTransformGrid, which can be used to perform 3D
transformations.

The widget can be in one of three modes:

  CAMERA - allows adjusting the primary vanishing point by moving a
  handle.

  MOVE   - allows moving the object through dragging.

  ROTATE - allows rotating the object through dragging.

By default, controlling the transformation through dragging applies
to the X and Y axes.  Holding Shift (or setting the "constrain-
axis" property) restricts the motion to only one of the axes.

For the MOVE and ROTATE mode, holding Ctrl (or setting the "z-axis"
property) allows controlling the Z axis instead.

For the same modes, holding Alt (or setting the "local-frame"
property), applies the adjustments in the object's local frame of
reference, instead of the display's global frame of reference.
2020-01-06 21:52:51 +02:00
Ell 4ddf1afb44 app: add a protected gimp_tool_transform_grid_get_handle() function
... which can be used by subclasses to retrieve the currently-
active handle.
2020-01-06 21:50:00 +02:00
Ell 0f697b897f app: add GimpTransformGridTool::dynamic-handle-size property
Add a boolean GimpTransformGridTool::dynamic-handle-size property,
which controls whether the handle sizes are adjustment dynamically
according to the grid's size, or remain fixed.  This property is
TRUE by default, to maintain the current behavior.
2020-01-06 21:50:00 +02:00
Ell 0eae8a47ea app: in GimpToolTransformGrid, add NONE function
In GimpToolTransformGrid, allow setting "inside-function" and
"outside-function" to a new NONE value, performing no
transformation when dragging the respective area.
2020-01-06 21:50:00 +02:00
Ell d84789dcb7 app: add gimp-transform-3d-utils.c
Add gimp-transform-3d-utils.c with various utility functions for
performing 3D transformations, in preparation for adding a 3D
transform tool.
2020-01-06 21:49:57 +02:00
Ell c0552de62b app: add a pivot selector to the Rotate tool
Add a GimpPivotSelector widget to the Rotate tool dialog, to allow
for quickly picking a pivot.
2020-01-06 21:49:54 +02:00
Ell 46e01d37db app, icons: add GimpPivotSelector widget
GimpPivotSelector is a 3x3 grid of toggle buttons, used for
selecting a natural pivot position (e.g., for a transform) relative
to an item: its center, its corners, and the midpoints of its
edges.
2020-01-06 21:35:52 +02:00
Ell ac74326ec7 app: reduce dialog size of Unified Transform tool and friends
The tool dialog of generic-transform tools (the Unified,
Perspective, and Handle Trasnform tools) shows the current
transformation matrix.  Although we might as well show *something*
in the dialog (we can't get rid of it altogether, as it provides
the common tool actions), this information is probably meaningless
for most users, and isn't directly editable anyway.

Reduce the size of the matrix, to make it less prominent, and free
up some space.
2020-01-06 21:35:52 +02:00
Ell b0e9639684 app: in GimpTransformGridTool, compress successive undo steps
Add a boolean 'compress' parameter to
gimp_transform_grid_tool_push_internal_undo().  When TRUE,
successive undo steps added rapidly are compressed into a single
step.

In the various subclasses, compress undo steps for dialog changes,
since we push an undo step for every intermediate change for those
(such as while dragging a spin-scale).  In contrast, we only push
tool-widget undo steps upon button release, hence there's no need
to compress them.
2020-01-06 21:35:52 +02:00
Ell ee425f88d8 app: in GimpTransformGridTool, avoid unnecessarily flushing image when pushing undo
In gimp_transform_grid_tool_push_internal_undo(), only flush the
image when undo/redo availability for the tool changes, instead of
for every undo step.  This speeds things up when many undo steps
are pushed in succession, which usually happens when using the tool
GUI.
2020-01-06 21:35:52 +02:00
Ell 24add95e0a app: fix indentation in gimptoolsheargrid.c 2020-01-06 21:35:52 +02:00
Massimo Valentini c39d8fde33 Issue 2862 - Error message. Unable to decode abr...
...format version 10.

Simply allow the parser to read version 10, seems to work
with the brushes in issue #2862.
2020-01-06 19:32:04 +01:00
Elle Stone bb660c5821 Issue #3588 - Add Yu'v' (CIE 1976 UCS) to GIMP color picker
Which is a linear transform of xyY that is more perceptually
uniform, and so well-suited for eventually adding chromaticity
diagrams to GIMP color tools. ACES documentation uses this color
space instead of xyY for showing chromaticity diagrams. Moving
forward I expect other venues also will start using Yu'v' as
the advantages over xyY chromaticity diagrams are fairly obvious.
2020-01-06 19:19:24 +01:00
woob a11ada4ce2 app: expand functionality of merge-down button
Adds a number of modifier keys to the layer dockable's new "Merge Down"
button to access further functions, and adds among them a new action to
merge visible layers using the dialog's last values, akin to those
accompanying the New Layer and Add Layer Mask dialogs.

Modifier keys are bound as follows:
  Shift -> Merge layer group
  Ctrl -> Merge visible layers
  Ctrl + Shift -> Merge visible layers from last used values

The Merge Down button is kept sensitive even when the current layer
can't be merged down to allow access to these functions
2020-01-06 17:28:46 +00:00
woob f539fc78c0 app: consolidate UI for merging down and anchoring layers (issue #1184)
As they are both mutually exclusive and serve an almost identical
purpose, the "Merge down" and "Anchor Layer" are given mutually
exclusive visibility in menus, and the anchor button is replaced
with a merge down button in the Layers dockable whenever there is
no active floating selection
2020-01-06 17:28:46 +00:00
Michael Natterer bffb753558 Issue #4458 - gimp-console-2.99 -b '(gimp-quit 1)' segfaults
Don't check for GIMP_IS_PARAM_SPEC_STRING(), it's internal
to the core and G_IS_PARAM_SPEC_STRING() is good enough in
most cases. Spotted by Massimo.
2020-01-05 17:31:45 +01:00
Michael Natterer 4dfcffe4f7 Remove all checks for finite() and isfinite()
and simply use isfinite() everywhere, it's part of C99.
2020-01-05 16:36:18 +01:00
Massimo Valentini 5adde64753 Issue 4456: CRITICAL **...: g_object_unref: assertion
...'G_IS_OBJECT (object)' failed
2020-01-05 12:36:01 +01:00
Jehan b2c41bc1f9 app: forgot to localize a string.
Thanks to Piotr Drąg for noticing.
2020-01-04 00:45:14 +01:00
Jehan 0a28534a90 app: fix a segmentation fault crash.
gtk_widget_get_window() may return NULL. I had the case when opening
some menus in bottom of tool options (like the "Save|Restore Tool
Preset" menus). We must check this before doing anything with it.
2020-01-03 21:26:21 +01:00
Jehan 5b664ecbec app: properly pass the last release version and date to gimp-debug-tool.
Previously we were only passing this information on the debug dialog
when debugging warnings and criticals. Now it will also have the
information for crashes, hence recommending people to update their GIMP
instead of reporting bugs on old versions.
2020-01-03 20:08:12 +01:00
Jehan 2f379494a7 app: debug dialog will now advise to update when relevant.
Instead of making the focus on bug reporting, the debug dialog will now
make the focus on updating the application if it is found that one is
not using the last version.
Debug data (backtraces and co.) will still be available and copiable,
but under an expander, and bug report button won't be displayed (i.e.
data will still be available upon request but we don't push anymore
people to submit it directly if they are using old versions of GIMP).

Of course, if you are using the last version (or version check was not
possible), the dialog still stays the same.
2020-01-02 23:36:46 +01:00
Jehan d5febf6e62 app: parse the release date for the last release.
I was mistakenly using the date of the last check, not the release date.
2020-01-02 23:09:23 +01:00
Michael Natterer ff32fe9f5d Issue #2227 - GIMP 2.10.6 crashes with assertion GIMP_IS_TAGGED in...
...MyPaint brushes dialog

In gimp_tag_entry_assign_tags(), don't add/remove tags while iterating
tag_entry->selected_items, because that might change the list. Instead,
make a temporary deep copy of the list and iterate the copy. Spotted
by Massimo.
2020-01-01 00:22:54 +01:00
Jehan 5ec22b6720 app: fix missing const qualifier.
Thanks to frogonia for noticing.
2019-12-30 00:25:06 +01:00
Jehan a4e65ac836 app: also localize LC_TIME to GUI language.
When we set the GUI language through Preferences, also set LC_TIME, so
that locale-aware date functions also produce the right formats.

For instance, I use this in the About dialog to format the release date
of the last version of GIMP.
2019-12-29 22:59:16 +01:00
woob 1f6629f4b6 app: allow snapping GimpPolar to 15 degree intervals
Similar to GimpDial, snaps GimpPolar's angle to the nearest fifteen
degree interval by holding the shift key while adjusting
2019-12-29 21:56:30 +00:00
woob 2367e985a4 app: allow snapping GimpDial to 15 degree intervals
The GimpDial widget can now be snapped to the nearest fifteen degree
interval by holding the shift key while adjusting. When adjusting both
an alpha and beta value, both will be snapped according to the alpha,
preserving the angle between them
2019-12-29 21:56:30 +00:00
Jehan 6b237b90fd app: show the About dialog at startup when a new version is available.
This about dialog will complain an explicit message about the new
version and a link button to go to the download page.
2019-12-29 13:41:59 +01:00
Jehan 827473fd88 app: add alternative "Check for updates" button in the About dialog.
When an update is available, a big frame is visible, proposing to go to
the download page. Now a button is also available to explicitly request
for an update check in other cases (bypassing the wait delay for a
future startup).
2019-12-29 13:24:20 +01:00
Jehan 826ece3b86 app: show new version availability in About dialog.
I was wondering which shape should take the new version notification
(again some ugly pop-up?!) and realized using the About dialog was a
good idea.
This is preparatory work for this to happen.
2019-12-29 10:36:12 +01:00
Jehan b874cadfad app: make gimp_versions.json parsing easier to test.
First, let's make the check happen at each startup on unstable (still
once a week on stable).
Second, make it parse gimp.org's gimp_versions.json on stable, but
testing's one on unstable and also check environment variable
GIMP_DEV_VERSIONS_JSON (unstable only) to allow setting a local path
(allowing to tweak the file and test various cases).

Unrelated to testing, some improvements:
- save a timestamp in seconds (really no need to keep microseconds
  precision here).
- just in case, check that the saved timestamp is not in the future.
2019-12-29 10:36:12 +01:00
Michael Natterer 45ad58dff4 Issue #2674 - File/Open Recent opens the wrong document
Must call gimp_action_init() from gimp_action_impl_init() or the
signal handlers to update label and tooltip will ever be installed.
Found by Massimo.
2019-12-28 21:39:11 +01:00
Jehan bb7f229b97 app: fixes int overflow warning.
This fixes the following warning when compiling with Mingw:
> warning: integer overflow in expression of type 'long int' results in '-694967296' [-Woverflow]
2019-12-25 22:01:33 +01:00
Jehan f89692c25f meson: add json-glib as dependency in meson files too.
Done on a separate commit to make cherry-picking easily to gimp-2-10
without all the meson changes.
2019-12-13 17:51:44 +01:00
Jehan 506a0476f4 app: check last GIMP release from gimp.org/gimp_versions.json.
GIMP will now process the remote gimp_versions json file to look if one
is using the last version of GIMP. This initial code doesn't act up yet
on this information. This will come in further commits.

Here are the characteristics:
- Since this requires internet access, a new checkbox is available in
  the Preferences dialog, allowing to disable version checks. Note that
  it is enabled by default as it is an important security feature, but
  it has to be deactivatable.
- The remote access is done as an async operation because we don't want
  it to block the startup in any way (for whatever reason). Also it
  doesn't output errors if it fails to not be a bother (you don't
  technically need internet access for an image program).
- We don't check at every startup. At each successful check, we save a
  timestamp to prevent too frequent useless checks (I set it the timer
  to a week or more for now).
2019-12-13 17:51:44 +01:00
Jehan 73c09ebb32 app, configure: add configure option for a build id and revision.
The point will be for a packager to create a unique build ID to identify
the build or provenance. I also add a revision number so that we can
identify 2 builds from the same version/commit, same maker and platform.

It will also be used later to check for new versions (see "phone home"
feature #2584).

Separating autotools and meson commits for easy backport.
2019-12-11 21:59:11 +01:00
lillolollo 468f3e84d8 Fix cast to pointer from integer of different size warning on gimpbacktrace-windows.c 2019-12-01 00:37:00 +00:00
Руслан Ижбулатов cd54a8fee9 Windows backtrace: VEH must use stdcall
Fixes issue #2794
2019-11-22 00:03:14 +01:00
Michael Natterer 05896b4e2f libgimpbase: rename and reorder the values of enum GimpSelectCriterion 2019-11-19 22:25:57 +01:00
Michael Natterer 0141a28419 libgimpbase: remove enum value GIMP_FOREGROUND_EXTRACT_SIOX 2019-11-19 21:25:26 +01:00
Jehan 9a043d0fc9 Issue #4251: (meson) dbus-glib-1 not required.
As written in previous commit, this is not a dependency since commit
c4460e84.
2019-11-16 19:26:58 +01:00
Jehan 5f2a6940e3 app, devel-docs: remove dangling DBUS_GLIB_* variables.
dbus-glib is no more a dependency since commit c4460e84, i.e. already
since 2013!
2019-11-16 19:19:02 +01:00
Ell 0e29fc1b21 Issue #4218 - Color>Invert doesn't work on saved selection channel ...
... or copied RGB channel

In gimp_drawable_merge_filter(), make sure the drawable's source
node is constructed before applying the operation.  The
construction of the source node connects the drawable's filter
stack to the udnerlying source node (usually, the buffer-source
node), which we rely on when calling
gimp_gegl_apply_cached_operation(), since we pass
connect_src_buffer == FALSE.  Otherwise, the operation is applied
to an empty input, instead of the drawable content.
2019-11-11 19:01:37 +02:00
Ell 2a292b02e3 app: in GimpHistogram, don't initialize n_bins to 256
... it's no longer needed, and breaks the type's invariants.
2019-11-11 18:16:53 +02:00
Ell 0c899394b4 Issue #4205 - The histogram dock scale is incorrect when an image is opened
In gimp_histogram_view_update_bins(), don't update the view's
range if there's no histogram or the histogram is empty, to avoid
discarding the existing range.  Additionally, improve the range
readjustment when the number of bins changes.
2019-11-11 18:16:52 +02:00
Jehan 417bf199c8 Issue #4194: resolution passes from 300ppi to 72ppi after saving.
We are running gimp_image_set_imported_file() when saving, with NULL to
drop the tie with the imported file. Let's only change the default
resolutions when we actually set an imported file.

Also set the `resolution_set` flag even when it doesn't change the
current values (hence no undo or signals), for instance setting from 300
to 300 PPI. In such case, even though nothing changes, the resolution
has to still be considered as explicitly set.

In the reporter case, any one of these 2 fixes is enough.
See also commit fef9b1d2a3 (set to 72 PPI as default for imported files
only) and commit a8f552da2f (set imported file to NULL).
2019-11-08 14:02:27 +01:00
Michael Natterer 7229b842bf app: image-cmds.c was regenerated 2019-11-08 10:14:30 +01:00
Alex Samorukov 2cb0493b2f Replace finite() with isfinite() by default
This is part of the C standard also also causing warning on macOS.

(cherry picked from commit 04997fc0ae)
2019-11-07 10:13:59 +01:00