Commit Graph

22559 Commits

Author SHA1 Message Date
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
Oleksii Samorukov 00106b1d45 Revert finite() fix as it needs to be done in pdb and configure
(cherry picked from commit 4cd23c64e9)
2019-11-06 21:22:17 +01:00
Oleksii Samorukov 669b4e92fc Fix "finite() is depricated" warning on macOS
(cherry picked from commit aff49550ee)
2019-11-06 17:07:32 +01:00
Niels De Graef cb0ae619d1 app: Use G_DEFINE_BOXED_TYPE()
This isn't any functional change, but allows us to get rid of some of
the GObject boilerplate.
2019-11-05 10:14:29 +00:00
Jehan c033b3498f app: reorder alphabetically file list in meson build.
Just fixing previous commit like this instead of wasting time in gitlab
with useless reviews for oneliners. When will gitlab allow us to amend
patches directly before merge?!
2019-11-04 14:48:52 +01:00
bartoszek 05f0f217e3 Propagate 0ddd3330b8 to meson build system. 2019-11-04 13:06:18 +00:00
Ell 43a1c33ecf app: add "show all" support to the Bucket Fill tool in line-art mode
In the Bucket Fill tool, when using line-art mode, use a
GimpImageProxy as input for the GimpLineArt object, instead of
using the image direclty, when the line-art source is "all visible
layers".  Set the proxy's show-all mode according to the active
shell, so that the line-art uses the full image projection,
including out-of-canvas regions, when in show-all mode.
2019-11-04 13:27:04 +02:00
Ell 02654b0ac0 app: (re-)add GimpDisplayShell::show-all property
... which corresponds to the shell's show-all mode.  We'll listen
to its "notify" signal in the bucket-fill tool.
2019-11-04 13:27:04 +02:00
Ell c8b5c81a41 app: in GimpLineArt, ref input pickable
... in particular, so that the GimpLineArt object can take
ownership over newly-created GimpImageProxy inputs.
2019-11-04 13:27:03 +02:00
Ell bce96eb690 app: in GimpLineArt, add support for arbitrary buffer extents
In GimpLineArt, add support for arbitrary input-buffer extents,
by shifting/unshifting the input/output buffers before/after
passing them to the main algorithm, so that the algorithm keeps
working with buffers whose top-left corner is at (0, 0).
2019-11-04 13:27:03 +02:00
Ell 0e02795128 app: in GimpImageProxy, implement GimpPickable
In GimpImageProxy, implement the GimpPickable interface, so that
the proxy can be used as both a viewable and a pickable for the
image projection, with direct control over the show-all mode.  This
will allow us to use a GimpImageProxy as input for a GimpLineArt.
2019-11-04 13:27:02 +02:00
Ell 8d8cc12f40 app: rename GimpImageViewable to GimpImageProxy
We're going to have GimpImageProxy implement GimpPickable, so that
it can be used as either a viewable or a pickable proxy for an
image.
2019-11-04 13:27:02 +02:00
Ell 0ddd3330b8 app: rename gimpimageviewable.[ch] to gimpimageproxy.[ch]
... in preparation for actually renaming the class, but as a
separate step to keep the history.
2019-11-04 13:27:01 +02:00
Ell 74009c8b1e app: add gimp_image_get_preview_format()
Add an internal gimp_image_get_preview_format(), which returns the
format to use for preview buffers, and use it in both
gimpimage-preview and GimpImageViewable, to reduce duplication.
2019-11-04 13:26:58 +02:00
Oleksii Samorukov 12bc46ce14 Set required variables if is running from Apple application bundle
(cherry picked with small changes from commit 
e13e7fd8b6)
2019-11-03 15:07:46 +01:00
Michael Natterer 1caff42c30 app: add missing space in gimp-mkenums command in config/ and display/ 2019-10-29 22:13:34 +01:00
Samuel Rats d217028032 app: fix typo in gimptoolrectangle.c
(cherry picked from commit f4c87c048e)
2019-10-27 16:58:42 +01:00
Øyvind Kolås f0077265b4 configure, meson, app: depend on gegl-0.4.18 2019-10-27 01:37:24 +02:00
Ell 549a606b2f app: don't use the deprecated GTimeVal in gimp-test-session-utils.c
GTimeVal, as well as g_file_info_get_modification_time(), have been
deprecated in GLib 2.62.  Use g_file_info_get_attribute_uint64()
instead.
2019-10-26 22:33:20 +03:00
Ell 211b7de729 app: add babl version info to $ gimp -v
... and any other users of gimp_version().
2019-10-24 14:00:48 +03:00
Ell 6adf77e13a app, menus: add gegl:normal-map to Filters -> Generic 2019-10-23 20:04:38 +03:00
Ell eb6f544c18 app: avoid spurious channel switch in histogram editor when switching drawbles
Add an n_components parameter to gimp_histogram_clear_values(),
which allows to set the new component count when clearing the
histogram.  This is useful to seed the histogram with the correct
number of channels, for display purposes, before starting an async
histogram calculation.  We use this in GimpHistogramEditor, to
avoid resetting the view's channel back to "Value" each time the
active drawable changes.
2019-10-22 16:12:48 +03:00
Ell 8bd4ae34f5 app: fix gimp_hisotgram_n_components() for empty histograms 2019-10-22 16:12:48 +03:00
Ell fc17f0ed0c app: streamline GimpHistogram; avoid spurious channel switch in histogram view
In GimpHistogram, get rid of the "n-channels" property and
corresponding gimp_histogram_n_channels() function.  The former
returned the actual number of channels, but this wasn't too useful,
as channel values may not be sequential; the latter returned the
number of components.  Instead, add an "n-components" property and
a corresponding gimp_histogram_n_components() function, both of
which return the number of components.  Furthermore, add a
gimp_histogram_has_channel() function, which determines if the
histogram has a given channel; this allows for simple testing for
channel availability, which was done wrong in various places.

Adjust the GimpHistogram code for the changes, and clean it up,
fixing a few bugs.

Adjust users of GimpHisotgram for the changes.  In particular,
in GimpHisotgramView, fix the channel-availability test when
setting the view's histogram (which happens whenever the active
drawable's preview is frozen), to avoid erroneously swithcing the
view's channel back to "Value" when a non-RGB channel is selected.
2019-10-22 15:50:13 +03:00
Jehan 2f01751907 Issue #4119: GIMP main window not restored from Taskbar under MS Windows
Tested in a VM. Minimized window is properly deiconified and showed to
the front. Though a window in the back (not minimized) is not moved to
the front.
2019-10-20 19:44:41 +02:00
Sabri Ünal 371f9578cb CID 225808 Arguments in wrong order
Swapped arguments: height is passed to width. width is passed to height.

Please check the function in /app/core/gimpbrush.c at line: 606

void
gimp_brush_transform_size (GimpBrush     *brush,
                           gdouble        scale,
                           gdouble        aspect_ratio,
                           gdouble        angle,
                           gboolean       reflect,
                           gint          *width,
                           gint          *height)

(cherry picked from commit aeadaaeb6c)
2019-10-20 15:27:37 +02:00