Commit Graph

5519 Commits

Author SHA1 Message Date
Ell 7c00cf498a app: use gimp_async_add_callback_for_object() in various places
Use gimp_async_add_callback_for_object(), added in the previous
commit, instead of gimp_async_add_callback(), in cases where the
destructor of the object owning the async doesn't wait for the
async to finish.  This avoids leaking such ongoing asyncs on
shutdown, during which gimp-parallel either finishes or aborts the
asyncs: if at this point an async has any registered callbacks, an
idle source is added for running the callbacks, extending the
lifetime of the async; however, since we're not getting back into
the main loop, the idle is never run, and the async (and any
associated resources) are never freed.
2018-11-30 04:14:10 -05:00
Jehan 613bf7c5ab app, libgimpconfig: make various usage of g_file_replace() safer.
When an error occurs, we want to prevent overwriting any previous
version of the file by incomplete contents. So run
g_output_stream_close() with a cancelled GCancellable to do so.
See also discussion in #2565.
2018-11-26 15:50:38 +01:00
Ell c7f1730702 app: in performance logs, add new-lines between variable definitions 2018-11-10 02:52:31 -05:00
Ell eec1e1f189 app: a few fixes to performance-log backtrace output
Fix delta-encoding of performance-log backtraces in certain cases,
and distinguish between empty call-stacks and removed threads.
2018-11-07 14:26:15 -05:00
Ell 963322fdd4 app: avoid allocating empty tempbuf for drawable previews
In gimp_view_renderer_drawable_render(), make sure the preview size
is always at least 1x1.

Fixes commit 8009ea342a.
2018-11-03 04:30:17 -04:00
Ell 646208eff0 app: include variable descriptions in performance logs
Include instrumentation-variable descriptions in the var-defs
section of performance logs, so that they can be displayed
alongside their names when viewing the log.
2018-11-03 04:17:48 -04:00
Ell 8009ea342a app: simplify drawable preview rendering
Simplify gimp_view_renderer_drawable_render(), by consolidating
common code paths.  In particular, when rendering the preview as
part of an image, always crop the preview to the bounds of the
image, even when downscaling, to avoid unnecessarily downscaling/
convering cropped-out regions.  We previously only did this when
upscaling the preview by a factor of 2 or more; whatever the reason
for this used to be, it's no longer there.
2018-11-03 04:06:13 -04:00
Ell 0cdbe91e5a Issue #2436 - Crash after downsizing canvas
In gimp_view_renderer_drawable_render(), avoid overflow in preview-
area calculation.  This prevents erroneously setting 'scaling_up'
to FALSE while upscaling the drawable by a very large amount, which
can lead to the creation of a very large GimpTempBuf for the
preview, causing memory allocation to fail.
2018-11-02 21:43:04 -04:00
Michael Natterer ae9d84dd22 Issue #2235 - Color reset/swap keyboard shortcuts not discoverable...
...via hover tooltips

Use the GtkWidget::query_tooltip() signal on GimpFgBgEditor to emit an
own signal "tooltip" that has the hovered widget area as parameter.

Connect to GimpFgBgEditor::tooltip() in gimptoolbox-color-area.c and
set separate tooltips on the widget's areas, including the shortcuts
for "Swap colors" and "Default colors".
2018-10-25 14:45:55 +02:00
Oleksii Samorukov bd48996933 Fix compilation on Mac 10.6 and 10.7 (#2112) 2018-10-24 10:45:07 +02:00
Elle Stone 298cc57042 Issue #2345 - Add xyY to color sample readouts
Add xyY color space to the color spaces for sampling colors.

Also add code to xcf-load.c that makes sure the sample point loading
code handles unknown future GimpColorPickMode values (fall back to
PIXEL pick mode).
2018-10-23 17:37:28 +02:00
Sergio Jiménez Herena 1ca2d74411 app: Add option in the windows menu to hide the image tab bar.
(cherry picked from commit 360aee10d8)
2018-10-23 11:52:07 +02:00
luz.paz ac282f2045 Misc. typos
Found via `codespell`
2018-10-19 15:30:27 +00:00
Ell e26a220a6f Issue #2237 - export as, select file type (by extention) list problem
In gimp_file_proc_view_get_proc(), when there is no selected
procedure (which can happen, in particular, when searching the
list), return the "automatic" procedure and its corresponding name/
filter, if one exists, instead of bailing.

Additionally, in GimpFileDialog, use a match-all filter when
gimp_file_proc_view_get_proc() returns no filter, avoiding
CRITICALs/segfault.
2018-10-16 07:49:58 -04:00
Michael Natterer 7adb6c26e5 Issue #2210 - GIMP crashes on startup if usb mouse is present
In GimpDeviceInfo, make sure that the info->axes and info->keys arrays
always have info->n_axes and info->n_keys members. Also sync axes and
keys between GdkDevice and GimpDeviceInfo more often, and some
cleanup.
2018-10-12 19:55:56 +02:00
Michael Natterer 74efea7e34 app: fix tooltips on the toolbox' color and image areas
we started overwriting our own tooltips with a NULL string when
getting rid of GtkAlignment.
2018-10-08 12:39:34 +02:00
Michael Natterer c399b894a8 app: remove the image's "Enable Color Management" toggle
It was not doing anything right since space invasion. We now treat the
built-in sRGB profile like any other profile and never bypass
conversions based on some weird toggle.

Instead, introduce a "Use sRGB Profile" toggle which, when enabled,
hides whatever profile away so the image actually uses the built-in
sRGB profile.

This is different from discarding and then re-assigning the same
profile only by being faster and more convenient.
2018-10-07 16:16:21 +02:00
Ell c1347a7f26 app: construct tool-options GUI lazily
We currently construct the tool-options GUI for all the tools at
startup, which takes a significant amount of time.  Instead,
only register the GUI construction function with the tool-options
object, using the new gimp_tools_set_tool_options_gui_func()
function, and use the registered function to construct the GUI when
actually needed.
2018-09-27 02:41:59 -04:00
Ell a5c8dd5c73 app: fix incompatible pointer type warning in gimpviewrendererdrawable.c
... more GLib 2.58 fallout.
2018-09-18 16:23:19 -04:00
Ell 3b0040c043 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:39:56 -04:00
Marco Ciampa 7bfd22ca68 Fixed small typo 2018-09-17 19:34:41 +02:00
luz.paz 386587736f Misc. typo fixes
Found via `codespell`
2018-09-16 18:49:18 -04:00
Ell 2c6b5c371e app: add more information to performance logs
In addition to the verbose GIMP version, include in performance
logs the values of all environment variables beginning with BABL_,
GEGL_, or GIMP_, and of all the GEGL config options.
2018-09-16 09:00:03 -04:00
Jehan 573d817539 Issue #2055: make save dialog compatibility information understandable.
* The minimum GIMP version for this XCF is always written down when it
  is GIMP 2.8 or over.
* The list of features warrating the minimum version is now listed in an
  expander container rather than as tooltip (making the list actually
  discoverable!).
* The warning on compression is now displayed as its own text under the
  checkbox (only when checking the box actually changes anything
  compatibility-wise), and not as additional text to the minimum GIMP
  version label. Otherwise it had far too much weight on the minimum
  compatible GIMP version text and people were wondering what it meant.
  We should not tell people what the checkbox cannot do (it cannot
  improve compatibility in some cases), only what it can do (it can
  improve compatibility in other cases).
* Update the feature list real-time when checking the compression box
  (making it even more obvious that tile compression may have a say in
  compatibility).
* Metadata info is still added on the GIMP version label as it does not
  limit compatibility of the XCF file itself.
2018-09-11 13:14:54 +02:00
Ell 78adb7c900 app, tools: add "running" thread attribute to GimpBacktrace/performance-log
The "running" attribute (readable through
gimp_backtrace_is_thread_running(), and recorded in the performance
log) specifies if the thread was in a running or suspended state at
the time the backtrace was taken.  It is accurate on Linux, but
only approximated on Windows.

Adapt the performance-log-expand.py tool to maintain this attribute
(and any future thread attributes we might add).
2018-09-03 18:30:10 -04:00
Ell a6ec857123 app: add source-location information to GimpBacktrace
Add source filename and line number fields to the
GimpBacktraceAddressInfo struct, populated through
gimp_backtrace_get_address_info().  This is not currently supported
by the Linux backend, but is supported by the Windows backend,
which we'll be added in the next commit.
2018-09-03 15:57:53 -04:00
Ell 422f6a55e4 app: more GimpBacktrace tidying
... in preparation for the Windows backend.
2018-09-03 15:57:53 -04:00
Ell 7ac87dc01e app: rename gimp_backtrace_get_symbol_info() to ..._get_address_info()
This function returns information about the given address, which
is currently mostly limited to the corresponding symbol
information, but we might want to add address-specific information
in the future, such as a line number.
2018-09-02 13:25:53 -04:00
Ell 36477bb287 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:11:02 -04:00
Ell 1a20253b0c app: use gimp_gtk_container_clear() in GimpDashboard
... instead of doing the same thing ourselves.
2018-08-30 23:53:16 -04:00
Ell b3d27555ec app: remove unused function prototype in GimpDashboard 2018-08-30 23:46:41 -04:00
Ell d210199da5 app: fix dashboard swap read-throughput desc.; add translator comment 2018-08-26 15:13:40 -04:00
Ell fd64aae47b app: add gimp_gtk_container_clear()
... which removes all non-internal children of a GtkContainer.
2018-08-20 14:41:04 -04:00
Michael Natterer 717c183a3e app: make GimpDeviceInfo more rubust against broken device listings
gimp_device_info_set_device(): don't just bail out if a device with
the same name is added again, instead, simply continue and overwrite
the info's old device with the new one.

NOTE that this only happens if something is wrong on the USB or udev
or libinput or whatever side and the same device is present multiple
times. The only "safe" thing is to assume that devices listed earlier
are dead and dangling entities and that the last registered device is
the one actually delivering events.
2018-08-20 20:02:19 +02:00
Ell 5446163e1d app: show swap read/write throughput in the dashboard
Show the read/write throughput of swap data in the corresponding
swap-group fields.
2018-08-19 03:34:47 -04:00
Ell cd54457d46 app: add "queued" field to the dashboard swap group
... which reports the amount of data queued for writing to the
swap (see GEGL commit 64021786ee067cf66c038622719acc590e6341db.)
When the swap queue is full, a yellow color underlay is shown in
the history graph.
2018-08-19 03:34:19 -04:00
Ell b6e552a74b app: add "compression" field to the swap dashboard group
The "compression" field reports the ratio between the total size of
the data in the swap, and the total size the data would have had if
all tiles in the swap occupied a unique data block.

See GEGL commit 185f4450f2a51690b39112973c61f894c1ec3e41.
2018-08-19 03:34:19 -04:00
Ell 8313a40fb5 app: show horizontal scrollbar in dashboard when necessary 2018-08-19 03:34:19 -04:00
Jehan 8e453330c9 configure: GLIB_COMPILE_RESOURCES is wrong when cross-compiling.
AM_PATH_GLIB_2_0 m4 macro actually computes this value using
$PKG_CONFIG. Yet $PKG_CONFIG variable is the pkg-config tool looking for
target libraries (not host), hence it would return the executable
`glib-compile-resources` built for the target.

Also using the same variable name invalidates our test: our own
AC_PATH_PROG was never run as the variable was already set. And no
environment variable could override this test anymore either. This is
why I rename the test variable to HOST_GLIB_COMPILE_RESOURCES.

(cherry picked from commit d1d9eb17e5)
2018-08-12 22:52:45 +02:00
Ell 537bf4ec6a app: add gegl:long-shadow to the menus 2018-08-09 19:02:59 -04:00
Jehan 549d880847 app: display extension long description in the details widget.
AppStream spec says it can only contain <p>, <ol> and <ul> markups.
Unfortunately these are not pango markups (nor is there any equivalent).
So I just use newlines and spaces until I figure out anything fancier.

That's all still quite ugly, but whatever, I'm still in the start.
2018-08-07 18:22:47 +02:00
Jehan f6d1380fcd app: removing gimp_get_icon_size() now unused.
It was using deprecated functions regarding how icons used to work, such
as gtk_icon_set_get_sizes() or gtk_style_context_lookup_icon_set().
The last uses of this function disappeared in last commit.
2018-08-06 15:38:37 +02:00
Jehan d1372c6c24 libgimpwidgets, app: change "stock-size" property of...
... GimpCellRendererToggle into "icon-size".

In particular making it a pixel size instead of a GtkIconSize. This enum
is limited to a few presets (registering new values is deprecated since
GTK+ 3.10), with names completely semantically wrong. It is better to
specify icon sizes (before scaling) in pixels directly, which goes also
with named icons instead of stock ones.
2018-08-06 15:38:37 +02:00
Jehan b3c9089ea2 Issue #1974: and again another memory leak.
Thanks to Massimo for reporting all these!
2018-08-05 11:47:24 +02:00
Jehan 50221e1438 Issue #1974: another memory leak when saving a file. 2018-08-05 11:37:08 +02: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 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 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
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 c9a382f7bd app: connect the switch to start/stop the extension. 2018-07-18 12:11:14 +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
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
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 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
luz.paz 732bcb463e Misc. comment typos
Found via `codespell`
2018-07-14 19:07:43 +00:00
Michael Natterer bab75b7365 Change a bazillion URLs to https://
Including all user-visible link and links called from code, like
the help pages.
2018-07-14 14:19:27 +02:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Michael Natterer aeec0f7f49 app: small improvement to previous GimpPaletteEditor commit 2018-07-09 22:12:55 +02:00
Sergio Jiménez Herena ea27fd912c app: add color index label to the palette editor. 2018-07-09 20:04:09 +00:00
Michael Natterer 926dc070ef 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
2018-07-08 16:15:13 +02:00
Michael Natterer 370680f9bc Issue #1805 - Sample Points keep resetting themselves to "Pixel"
Don't destroy the color frames when the number of points changes.
Instead, simply hide them so they keep their color model, but add an
upper limit of an arbitrary number of 16 frames to keep around.
2018-07-07 19:17:58 +02:00
Jehan 22099db280 app: new GimpExtensionDetails widget.
The extension dialog will show details about an extension (long
description, screenshot, upstream URLs, etc.) with this widget.

Update the GimpExtensionList to send a "extension-activated" signal on
double click, and make the extensions dialog react on it to display the
extension details for the activated extension.

This is all still mostly a skeleton GUI, but it is starting to get into
shape.
2018-07-07 16:10:51 +02:00
Jehan 869f345ff0 app: new GimpExtensionList widget.
This is used to show the user/system or uninstalled extensions.
2018-07-07 16:10:51 +02:00
Jehan ff12c2d903 app: a skeleton for the extension GUI.
This is using GTK+3 widgets, so I make sure to keep it well separated
from core code. The gimp-2-10 version will have to rework the GUI, but
the GtkListBox and GtkSwitch are nice and make things easier, so it is
worth using them here).
2018-07-07 16:10:50 +02:00
Michael Natterer 1fc55c1572 app: switch off overlay scrollbars in tool options
and remove the viewport, GtkScrolledWindow adds one automatically now.
2018-07-06 14:24:43 +02:00
Ell 114d49510f app: log actions upon activation before emitting "selected" signal
In GimpAction, instead of connecting the action-history log
function to the action's "activate" signal as a user-provided
handler, call it directly from the default handler.

In subclasses of GimpAction, chain to the parent's activate()
function before emitting the "selected" signal, so that we always
log the action in the history before responding to it.

This allows us to avoid the hack in commit
6544ce4301.
2018-07-06 00:08:00 -04:00
Ell 6544ce4301 app: fix potential segfault in gimp_action_history_activate_callback()
In gimp_action_history_activate_callback(), bail if history.gimp is
NULL, instead of dereferencing it.  This can happen if GIMP is shut
down during the execution of a temporary procedure, such as a
script-fu script.  See the code comment for details.
2018-07-05 13:35:25 -04:00
Ell a96264b1b7 app: add gegl:stereographic-projection (little planet) to the menus 2018-07-05 09:51:41 -04:00
Michael Natterer ab17727d44 app: use GdkRGBA instead of GdkColor for text tags 2018-07-03 22:31:32 +02:00
Michael Natterer b6c099c4b9 app: fix width of GimpThumbBox' thumbnail generation progressbar
using CSS and GTK_ALIGN_FILL. The progress is currently not visible,
there is a bug in Adwaita that is about to be fixed upstream.
2018-07-03 19:43:05 +02:00
Ell b8e08cddbc app: fix GimpMeter history-graph painting when clipped
In GimpMeter, use cairo_path_extents() for getting the history
graph's extents, rather than cairo_clip_extents(), since the latter
may also include clipping applied by GTK.
2018-07-03 10:31:07 -04:00
Ell e6a59eba08 app: fix drawable-preview offset 2018-07-03 00:23:47 -04:00
Ell aa382650a1 app: add active async-operations counter to the dashboard
Add an "async" field to the dashboard's "misc" group, showing the
number of async operations currently in the "running" state (i.e.,
all those GimpAsync objects for which gimp_async_finish[_full]() or
gimp_async_abort() haven't been called yet).
2018-07-01 13:52:21 -04:00
Ell 30cc85fd63 app: add config option to enable/disable layer-group previews
Preview generation for layer groups is more expensive than for
other types of drawables, mostly since we can't currently generate
layer-group previews asynchronously.  Add a preferences option for
enabling layer-group previews separately from the rest of the
layer/channel previews; both of these options are enabled by
default.  This can be desirable regardless of performance
considerations, since it makes layer groups easily distinguishable
from ordinary layers.
2018-07-01 13:52:21 -04:00
Ell 8a81bfd2f1 app: render drawable previews asynchronously
In GimpViewRendererDrawable, use
gimp_drawable_get_sub_preview_async(), added in the previous
commit, to render drawable previews asynchronously.  While the
preview is being rendered, either keep showing the previous
preview, or render a placeholder icon.

This commit also fixes an issue where, under certain conditions, a
drawable preview would be rendered, even when layer/channel
previews are disabled in the preferences.
2018-07-01 13:52:21 -04:00
Michael Natterer 8516aedade app: on make check, search menu XML files in both buildir and srcdir
Turn GIMP_TESTING_MENUS_DIR into GIMP_TESTING_MENUS_PATH and look in
all its dirs for the menu file.
2018-07-01 19:33:51 +02:00
Michael Natterer 3089a20167 app: remove all calls to gdk_window_process_updated()
- remove gimp_widget_flush_expose()
- remove the "now" argument to gimp_display_shell_flush() and make it
  only update widget states
- rename gimp_display_flush_whenever() to gimp_display_flush_update_region()
  and call gimp_display_shell_flush() separately in the only case we
  passed FALSE to flush_whenever()
- remove th flush_now interval logic from GimpDisplay, as soon as we
  have exposed the canvas, we are in the loop for the next frame clock
  tick anyway, so delaying a useless and removed process_updates serves
  no purpose
- in gimptool-progress.c, create the invisible grab widget also for
  non-cencelable cases, so we can always safely run the main loop
  manually to make the progress updates visible
- in gimp-gegl-apply-operation.c, always run the main loop manually
  to make the progress updates visible
- in gimpstatusbar.c, leave some FIXME comments as reminder that
  we might need the same logic as in gimptool-progress.c
2018-07-01 16:40:27 +02:00
Michael Natterer 188fd773a5 app: make sure the active tool options get saved in devicerc
gimp_devices_save(): call gimp_device_info_save_tool() on the current
device.
2018-06-29 03:00:45 +02:00
Michael Natterer f294d5e1af app: gimp_container_icon_view_select_item() must only select one item
Call gtk_icon_view_unselect_all() before gtk_icon_view_select_path()
or we end up with an unintended multi-selection.
2018-06-28 23:32:20 +02:00
Ell 716510cb83 app: allow multiple variables as input to dashboard group-meter LED
When defining a dashboard group, allow specifying multiple
variables as input to the group meter's LED.  The LED is active
when any of the specified variables evaluates to TRUE, and its
color is the combination of the active variable colors.

Remove the swap-busy variable, and use swap-reading and
swap-writing as inputs to the swap group's LED instead, so that the
LED's color indicates whether the swap is currently being read-
from, written-to, or both.
2018-06-28 11:39:27 -04:00
Ell 19f4abbbd6 app: even more Windows-specific fixes in gimpdashboard.c
... and app/Makefile.am
2018-06-28 11:03:46 -04:00
Ell 4914103b5f app: more Windows-specific fixes in gimpdashboard.c 2018-06-28 10:18:31 -04:00
Ell d75e599431 app: s/DAta/Data/ in gimpdashboard.c 2018-06-28 05:05:58 -04:00
Michael Natterer 0961ccf754 Issue #1340 - Critical when editing input controllers
Don't pass a NULL widget to gimp_controller_list_edit_clicked().
Spotted by Massimo.
2018-06-28 09:34:19 +02:00
Michael Natterer 478d18f6c5 app: remove gdk_window_process_updates() from gimp_overlay_box_scroll()
All calls have to go away finally, but removing it from other places
involves some refactoring I have not completed yet.
2018-06-27 23:14:22 +02:00
Timm Bäder 06282f28ed app: Make GimpThumbBox pretty again
calling queue_resize during size-allocate is a no-go.
2018-06-27 19:00:03 +02:00
Jehan 1b9729d46d app: replace Carbon/Carbon.h by CoreGraphics/CoreGraphics.h.
As asked by Samm and solid_black on IRC.
Apparently tested and the change is fine, while getting rid of
deprecated API. I cannot test myself.
2018-06-26 15:50:40 +02:00
Jehan aad82d1a9b app: add an assertion test on result of gimp_widget_load_icon().
Actually since we make this function so that it should never return
NULL, we may as well return a test at the end. If pixbuf is NULL, then
it is an implementation bug somewhere and we should fix it.
2018-06-25 16:15:25 +02:00
Jehan 80d2a02b58 app: reorganize a bit gimp_widget_load_icon().
Massimo spotted some warning with clang in #1608 about pixbuf being used
initialized. Rather than just initializing it, I am actually
reorganizing a bit more the function because there was a bit of a logics
bug. In some weird case, it would have still been possible for this
function to return NULL instead of a magenta square (the case was: the
icon was not present in the icon theme; then wilber-eek was either not
present or failed to load).

This new code organization is more clearer, as a step by step, should
better identify the various failure cases and always return an allocated
GdkPixbuf.
2018-06-25 16:01:46 +02:00
Oleksii Samorukov 5b6126146a Fix screen resolution detection on OSX
GTK always returns 72 dpi due to API used. This patch using Cocoa
directly instead. Tested on Retina and non-hidpi displays.
2018-06-25 10:01:48 +00:00
Piotr Drąg 6834af889e app: fix typo in a translatable string (trnasferred) 2018-06-24 19:31:59 +02:00
Jehan b7685cc579 app: remove check since gimp_widget_load_icon() now always non-NULL.
This is the only place where such a check occured. All other calls
seemed to expect the return value to be non-NULL already.

(cherry picked from commit a9d851070a)
2018-06-24 18:26:49 +02:00
Jehan a6e77355d8 Revert "Issue #1608: Gimp 2.10.0 and 2.10.2 crash immediately on start."
This reverts commit 7886bdc2a9.
Not needed anymore since commit cb7cae2fec.
Now gimp_widget_load_icon() always returns non-NULL.
2018-06-24 18:26:49 +02:00
Jehan 123dcc6f3f app: gimp_widget_load_icon() should actually always return a result.
When the "gimp-wilber-eek" fallback will fail to load, we just create an
ugly magenta square instead.
See Mitch's review at #1608.

Master adaptation for commit 32931c4606.
2018-06-24 18:26:49 +02:00
Michael Natterer 80997a8646 Remove most GTK_ADJUSTMENT() and (GtkAdjutment *) casts
they are obsolete in GTK+ 3.x because GtkAdjustment cannot be passed
around as GtkObject any longer, GtkObject is gone.
2018-06-24 18:15:16 +02:00
Jehan 877c20f420 app: even for fallback icons, it is better to check lookup success. 2018-06-24 17:27:36 +02:00
Jehan 352bc2160f app: add a doc-comment to gimp_widget_load_icon().
Mostly to make sure that calling code takes NULL as a possible return
value.

(cherry picked from commit 4d4ba34006)
2018-06-24 17:14:25 +02:00
Jehan ff9d41902e app: load "gimp-wilber-eek" as fallback when an icon fails to load.
We were already doing so when an icon was simply absent from the icon
theme. But we may still end up in cases where the icon is seemingly
present, yet it fails to load (for instance the image file is
corrupted). When this happens, let's also try to load the wilber-eek
fallback.

Note that it doesn't completely stops gimp_widget_load_icon() from
possibly returning NULL (in the case where "gimp-wilber-eek" is also
missing/corrupted for instance), so calling code must still account for
possible NULL return value.

Basically the same as commit 9c6237b182
except that I just redid it instead of cherry-picking because the code
was a bit too different.
2018-06-24 17:02:19 +02:00
Jehan 7886bdc2a9 Issue #1608: Gimp 2.10.0 and 2.10.2 crash immediately on start.
If "gimp-swap-colors" or "gimp-default-colors" are present in the theme,
yet broken somehow, GIMP would crash because it was not checking if the
icons had been successfully loaded.
Just make the relevant checks and output on standard error that the swap
and/or default color areas are invisible.

(cherry picked from commit d997b2b897 with
conflicts resolved)
2018-06-24 17:02:19 +02:00
Michael Natterer b8e75a0201 app: more GimpGradientEditor cleanup
Let the split and replicate segments dialogs keep their own data and
don't use GimpGradientEditor struct members. Remove redundant members
and indent the struct.
2018-06-24 16:24:16 +02:00
Michael Natterer 025a13b519 app: peek/poke much less in GimpGradientEditor internals
Add gimp_gradient_editor_get_selection() and set_selection()
and use them in gradient-editor-commands.c
2018-06-24 15:58:59 +02:00
Michael Natterer acd3a6f169 Clean up color selector styling
- remove redundant frames, 3d-frames are gone anyway, so no need to
  keep double out/in frames around
- give all color selector classes CSS names
- add/fix some theme CSS styles
2018-06-24 15:41:04 +02:00
Michael Natterer 2b8b780b6a 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/.
2018-06-24 14:19:25 +02:00
Michael Natterer 72bc216f4a app: make GimpFgBgEditor and GimpFgBgView honor border and padding
and give them CSS names. Set an appropriate padding for GimpFgBgView
in notebook tabs in the theme CSS.
2018-06-24 13:58:21 +02:00
Ell 51793b114a app: fix dashboard swap read/write variable order
... to satisfy the inter-variable dependencies, so that the READING/
WRITING variables are based on the READ/WRITTEN values of the
current sample, and not the previous one.
2018-06-21 12:31:31 -04:00
Michael Natterer 558641fe6c app: move the gradient editor color dialog code to GimpGradientEditor
Same as previous commits.
2018-06-21 17:23:09 +02:00
Michael Natterer 02b6ff24da app: make gimp_gradient_editor_update() private 2018-06-21 13:57:39 +02:00
Michael Natterer 5edc0306f9 app: move the colormap editor color dialog code to GimpColormapEditor
See commit below.
2018-06-21 13:43:25 +02:00
Ell fda671841c app: more fixes to last dashboard commit
Don't show percentage for the swap read/written fields, and make
sure their history underlays are displayed correctly even if the
swap limit changes.
2018-06-21 07:39:09 -04:00
Michael Natterer 1c1dd2038e app: move the palette editor color dialog code to GimpPaletteEditor
That's cleaner than having it in palette-editor-commands.c
2018-06-21 12:43:59 +02:00
Ell ab9f70d95c app: a few fixes to last commit 2018-06-21 04:12:36 -04:00
Ell 6b9aba3067 app: add swap read/write fields to the dashboard
Add "read" and "written" fields to the dashboard swap group, which
report the total amount of data read-from/written-to the tile swap,
respetively.  These fields are non-active by default.  When these
fields are active, show a color underlay in the swap group's meter,
indicating when data was beging read-from/written-to the swap.

Improve the swap busy indicator (used as the meter's LED), so that
it's active whenever data has been read-from/written-to the swap
during the last sampling interval, rather than at the point of
sampling.
2018-06-21 04:00:59 -04:00
Michael Natterer 1ae2b5d573 Issue #1093 - Color dialog appears in the first monitor...
...while other windows are on the second monitor if window positions
are saved at exit

Add some lines of code to color_area_color_clicked() which position
the already existing color dialog exactly like a newly created dialog
would be positioned by gimp_dialog_factory_add_dialog().

This should be part of GimpDialogFactory but let's wait for another
case before we generalize it.
2018-06-20 15:59:29 +02:00
Ell dc6ea0a977 app: in the dashboard, fix statm file-descriptor initialization
... in the unlikely case that getting the page-size fails.
2018-06-19 13:41:35 -04:00
Ell 9832f7129e app: make the dashboard scrollable
The dashboard is getting pretty crowded -- let's make it
scrollable.
2018-06-19 13:04:46 -04:00
Ell 8d0766c1fc app: add memory group to the dashboard
The memory group shows memory-usage information: the currently used
memory size, the available physical memory size, and the total
physical memory size.  It can also show the tile-cache size, for
comparison against the other memory stats.  The memory group is
active but contracted by default.

Note that the upper-bound of the meter is the physical memory size,
so the memory usage may be > 100% when GIMP uses the swap.

This is currently implemented for *nix systems with Linux-like
procfs, and Windows.
2018-06-19 13:04:46 -04:00
Michael Natterer 89776dbff5 app: fix drawing the focus around the selected color in GimpPaletteView
The grid lines are always black, so always draw a black/white focus
line and ignore theme colors.

(cherry picked from commit 4cc6f18cc9)
2018-06-18 19:22:22 +02:00
Michael Natterer e0f46d1dc9 app: cleanup in GimpClipboard
Mostly formatting and thortening variables. Only real change is adding
gimp_clipboard_new() and moving most init() code there.
2018-06-18 01:47:35 +02:00
Michael Natterer 5ee48e9ef3 app: undeprecate GimpTextStyleEditor, and set a CSS name for themeing 2018-06-18 00:59:11 +02:00
Michael Natterer 697ff4b423 app: show the added tab in gimp_dockbook_page_added()
and remove all other calls to gtk_widget_show(child). We used to do
this in gimp_dockbook_add() before (which is gone), and missed to add
a few show(). Since we have no invisible pages, simply show them
gemerically.
2018-06-17 15:14:15 +02:00
Michael Natterer f06d0485e6 app: don't g_return_if_fail() in gimp_device_info_set_device()
when the GimpDeviceInfo already has a device. This is not a programming
error that should trigger a bug report popup, it's something else about
non-uniqueness of device names, or whatever. Simply g_printerr() a more
useful message that can help to debug this and bail out.
2018-06-17 15:09:56 +02:00
Michael Natterer 0aa018dec2 Issue #1633 - Palette Editor is much too wide on GIMP 2.99
Make the bottom-left entry request only minimal width, it expands
anyway. Also replace the "Columns:" label by a "grid" icon and set a
tooltip on the columns spinbutton.
2018-06-14 12:27:29 +02:00
Jehan 035cef696a Issue #1612: Symmetry Painting dock needs a design tweak.
Make symmetry painting dock top-aligned.
2018-06-14 03:21:42 +02:00
Michael Natterer ffcd2a0366 app: undeprecate GimpGradientEditor, fix scrolling and drawing 2018-06-14 00:48:27 +02:00
Michael Natterer 5a7925c5dc app: set CSS names on GimpToolDialog and GimpOverlayDialog 2018-06-10 23:56:17 +02:00
Michael Natterer 4cdb579f29 app: fix styling in GimpEditor, put back GtkWidget::style_updated()
and some more styling cleanup. This got accidentially broken when
removing our own icon size hacks.
2018-06-10 16:41:36 +02:00
Michael Natterer 0c555efb7d app: set a CSS name on GimpColorHistory so it can be individually themed 2018-06-10 16:13:48 +02:00
Michael Natterer 7d3a129ddd Issue #1441 - Copy paste issue, internal clipboard blocks global clipboard
Never return an internal image/buffer/svg/curve from any
gimp_clipboard function if we are not the owner of the display's
clipboard. The clipboard is supposed to be a global thing, and we must
only offer to ourselves what would be pasted in any other app.
2018-06-08 11:39:53 +02:00
Michael Natterer 655b170619 app: remove more GimpDock and GimpDockbook API in favor of GtkNotebook
mostly adding/removing widgets, use the plain GTK+ APIs instead.
Also, cleanup and cruft removal.
2018-06-08 02:40:31 +02:00
Michael Natterer dd8f5acd9b app: cleanup, code reordring and cruft removal in GimpDockable 2018-06-08 01:53:46 +02:00
Michael Natterer 1de4e8a697 app: remove gimp_dock_temp_add() and _temp_remove()
and some leftover CSS prider cruft.
2018-06-08 01:41:44 +02:00
Michael Natterer 58d5cd2907 app: remove most of our own dockable DND code
and use GtkNotebook's implementation instead. This is mostly moving
dockable adding and removing code to GtkNotebook::page_added() and
::page_removed() and removing lots of code.
2018-06-08 01:37:19 +02:00
Michael Natterer a4061a6b0d Issue #1291 - Non-intrusive warning when saved XCF version...
...won't work with older GIMP?

Make gimp_image_get_xcf_version() return a "reason" string which lists
all reasons why the image can't be saved with compatibility for older
GIMP versions. Display the reason as tooltip on the compat hint label
in the save dialog.
2018-06-06 23:08:33 +02:00
Michael Natterer 247cc12cec app: use a GtkFlowBox for the toolbox' color/foo/image areas
not perfect but much better than before.
2018-06-05 18:43:46 +02:00
Michael Natterer 5fa8908c61 app: add missing include in GimpProcedureAction 2018-06-05 18:43:46 +02:00
Michael Natterer 07ae01aba8 app: remove unused variables in GimpEditor 2018-06-05 18:43:46 +02:00
Michael Natterer a20e926630 app: undeprecate styling of GimpComboTagEntry and GimpTagPopup
this looks correct now, but I doubt it still works 100% as with GTK+
2.x when the tag popup starts scrolling, we still measure the popup
size wrongly imo.
2018-06-04 21:10:12 +02:00
Michael Natterer 3f954350d9 app: don't let gtk_tree_store_clear() mess with our selected item
gimp_container_tree_view_clear_items(): GTK+ 3.x always keeps the row
with the cursor selected, so we get a gazillion selection changed
during gtk_tree_store_clear(), block our selection changed handler
during the clear.
2018-06-03 21:45:16 +02:00
Michael Natterer e88fb8e9c7 app: remove all old font management code, switch to GimpFontFactory[View]
Biggest change in this commit is reordering stuff in GimpContext
because GimpFont is now a first class citizen.
2018-06-03 01:27:06 +02:00
Michael Natterer d153c7489e app: add GimpFontFactoryView as replacement for GimpFontView 2018-06-03 01:25:25 +02:00
Michael Natterer 9dc5c7767d app: GimpDataFactoryView: don't add buttons for actions which don't exist 2018-06-03 01:25:25 +02:00
Michael Natterer 1b7d63cce9 Use g_set_object() in a lot of places, and splrinkle some g_clear_object() 2018-06-01 12:59:52 +02:00
Ell e5e998e9c5 app: hide container-editor busy box when clearing async-set binding 2018-05-31 05:00:28 -04:00
Ell f847796943 app, libgimpwidgets: add generated cursor files to CLEANFILES
Needed after commit a9592a59c8.
2018-05-31 02:56:07 -04:00