Commit Graph

3245 Commits

Author SHA1 Message Date
Ell 2d6e80b8ed app: behave as if "show all" is disabled in scroll/zoom actions when keeping padding 2019-09-15 16:39:00 +03:00
Ell 235a20b65e app: add option to keep canvas padding in "show all" mode
Add an option to keep the normal canvas padding in "show all" mode,
instead of extending the checkerboard pattern indefinitely.  This
is useful when wanting to show the image content beyond the canvas,
while still keeping the focus on the canvas; further commits will
extend this mode to behave in more view-related cases as if "show
all" wasn't enabled.

Add a new 'View -> Padding Color -> Keep Padding in "Show All"
Mode" toggle, which controls this behavior, with a corresponding
default-value option in the preferences, under "Image Windows ->
Appearance".
2019-09-15 16:32:38 +03:00
Ell d710e96d81 Issue #3781 - Display artifacts on HiDPI when render cache is invalidated
In GimpDisplayShell, scale the render cache by the window's scale
factor, and render its content in device pixels, instead of scaled
application pixels.  When painting the cache to the screen, unscale
the cairo context by the same factor, so that it's painted in the
native resolution.  Note that the various
gimp_display_shell_render_foo() functions still speak in
application pixels, and the scaling happens internally in
gimp_display_shell_render().

Aside from rendering at native resolution on HiDPI, this also fixes
an issue where grid-like display artifacts would appear when the
render cache was not fully validated due to the non-native scaling.
2019-09-11 21:19:26 +03:00
Félix Piédallu 65eff6f150 Meson port. 2019-09-11 16:42:04 +02:00
Ell 1b3c1fb9cb app: fix CRITICAL in GimpNavigationEditor
... after commit 2c9a8a567b.  Don't
use the same function as a handler for GimpContext::display-changed
and GimpContext::image-changed -- their signatures are different.
2019-09-10 17:55:58 +03:00
Ell 2c9a8a567b app: clear navigation editor when last image is closed
In GimpNavigationEditor, make sure to clear the editor's shell when
the last image is closed, even though the corresponding display is
stil alive, so that we don't needlessly extend the lifetime of the
image.  This is necessary after the recent GimpImageViewable
changes, since the editor now (indirectly) holds a reference on the
image.
2019-09-10 15:15:42 +03:00
Félix Piédallu 46f706a403 [libgimp,app] add missing includes for windows 2019-09-09 18:15:13 +00:00
Ell 582930aa61 app: update image-projection priority rect when switching displays
Update the image-projection priority rect to the current display's
viewport when the display becomes active, so that the right region
is rendered first when switching between different displays of the
same image.
2019-09-05 13:55:56 +03:00
Ell 19817877a5 app: various fixes in gimp_display_shell_set_show_all() 2019-09-05 13:19:51 +03:00
Ell 32dd8d2d2e app: add support for show-all mode in GimpCanvasPassePartout
Don't clip the outer rect to the size of the canvas in show-all
mode.
2019-09-04 20:51:43 +03:00
Ell 1e621680f1 app: add support for show-all mode in GimpCanvasGrid
Don't crop the grid to the canvas size in show-all mode.
2019-09-04 20:51:43 +03:00
Ell 23617c943b app: add gimp_canvas_item_untransform_viewport()
... which untransforms the viewport from display space to the
item's coordinate space (i.e., scaled and translated image space).
2019-09-04 20:51:43 +03:00
Ell cf3638391d app: add support for color picking in "show all" mode
Add a show_all parameter to gimp_image_pick_color(), which, when
TRUE, allows picking colors outside the canvas bounds in sample-
merged mode.  Forward the display's "show all" mode through this
parameter where applicable (in particular, in the color-picker tool
and the pointer dockable).
2019-09-04 20:51:43 +03:00
Ell da701ffc3a app: fix out-of-bounds rendering when alpha channel is invisible
When the image's alpha channel is invisible, paint regions outside
the image contents as black, instead of using a checkboard pattern.
This is especially notable when viewing the image in "show all"
mode.
2019-09-04 20:51:43 +03:00
Ell a33f549896 app: show full image contents in GimpNavigationEditor
In GimpNavigation{Editor,View}, show the full image contents when
the corresponding display is in "show all" mode.  Additionally,
when the display's "show canvas boundary" is active, show the
canvas boundary in the navigation view as well.
2019-09-04 20:51:43 +03:00
Ell e2f31852fb app, menus: add "show canvas boundary" display option
Add a "show canvas boundary" display option, and a corresponding
"View" menu item and default-apperance preferences option.  When
enabled (the default), the canvas boundary is shown as an orange/
black dashed line in "show all" mode.
2019-09-04 20:47:25 +03:00
Ell a1717a90a9 app: improve display scroll/zoom-related behavior in "show all" mode
In "show all" mode, the image is thought to be "infinite"; this
commit improves the overall scrolling/zooming behavior in this mode
according to this assumption.  In cases where a specific image size
is needed (e.g., for the scrollbar bounds, fit-image-in-window,
etc.), the image's full bounding box is used; however, in cases
where a center point is needed (e.g., for the zoomed-out scrollbar
bounds, center-image-in-window), the canvas center, rather than the
bounding-box center, is still used.
2019-09-04 20:47:25 +03:00
Ell 788b136bbf app: add "clip" parameter to gimp_display_shell_untransform_viewport()
... which specifies whether to clip the viewport to the canvas
(previously, it would always be clipped).  Use the appropriate
value in all callers, depending on the shell's "show all" mode.  In
particular, this commit avoids clipping the image projection's
priority rect to the canvas in "show all" mode.
2019-09-04 20:47:25 +03:00
Ell 86dc451bce app, menus: add "show all" mode to GimpDisplayShell; "View -> Show All" toggle
Add a "show all" mode to GimpDisplayShell, controlled through a
corresponding "View -> Show All" menu item.  When enabled, the
entire image content is displayed, instead of cropping the image
to the canvas size.  More generally, the display behaves as if the
canvas were infinite.  The following commits improve the overall
behavior in this mode.

Add a prefernces option to control the default "show all" state.
2019-09-04 20:47:21 +03:00
Michael Natterer b92dd2c8e3 app: split GimpDisplay in two classes: GimpDisplay and GimpDisplayImpl
GimpDisplay contains only the ID logic and the "gimp" and "config"
pointers, and lives in the core.

GimpDisplayImpl is a subclass and contains all the actual display
stuff. The subclass is only an implementation detail and doesn't
appear in any API.

Remove all hacks which pass displays as gpointer, GObject or
GimpObject through the core, or even lookup its type by name,
just use GimpDisplay.
2019-09-04 14:30:43 +02:00
Michael Natterer 7201d48231 Get rid of capitalized "ID" in function and variable names
and use "id" instead.
2019-08-23 22:23:23 +02:00
Jehan 9e9e6f0e9a app: fix a warning. 2019-08-17 10:53:29 +02:00
Ell 6023f97509 app: use a pickable instead of a drawable in GimpCanvasTransformPreview
In GimpCanvasTransformPreview, use a GimpPickable, instead of a
GimpDrawable, as the preview source, so that we can use it with the
image projection, rather than just with drawables.
2019-08-11 00:28:43 +03:00
Ell 539d666ae2 app: add gimp_display_shell_show_image()
... which controls whether or not the image is rendered by the
shell.  We'll use this to hide the image while showing its
transform preview in the next commits.
2019-08-11 00:28:41 +03:00
Michael Natterer 55940b733b libgimpwidgets: add a GDestroyNotify for gimp_help_connect()'s user_data 2019-08-09 13:11:30 +02:00
Niels De Graef 5f92ced1f3 Add (nullable) if applicable
Basically this commit makes sure that all return values that are marked
as "Returns:" also have a `(nullable)` annotation if it is mentioned on
the same line that NULL can also be returned.

This will prevent a few problems in GObject-introspection.
2019-08-03 07:53:47 +00:00
Niels De Graef 1dda60154c Use "Returns:" to annotate return values
To be able to annotate return values through GObject-introspection, you
need to make sure it is tagged with `Returns:` and not something else.
2019-08-03 07:53:47 +00:00
Niels De Graef 746a72b956 Make sure to use % for constants
Documentation-wise in C, this doesn't matter a lot, but it allows
GObject-Introspection based bindings to use their built-in versions when
they want to render any kind of documentation (for example, docs for
Python plugins can render `%NULL` as `None`).
2019-08-03 07:53:47 +00:00
Michael Natterer 63695b4b21 libgimbase: merge gimpparam.h into gimpparamspecs.h
which means that it's now included normally via gimpbase.h
and not any longer via gimpbasetypes.h which we only did out
of lazyness. A *lot* of files in libgimp* and app/ now need to
2019-07-31 10:16:21 +02:00
Michael Natterer 7ddf40b78b app: make sure the display is not rotated by a very small angle
gimp_display_shell_rotate_update_transform(): reliably set rotation to
0.0 using an epsilon of 1e-3.
2019-07-25 12:48:37 +02:00
Michael Natterer ec18b969a3 app: remove gimp_display_shell_filter_new(), it's empty and useless 2019-07-25 09:55:55 +02:00
Michael Natterer 42a7d17d1a app: add missing include to gimpdisplayshell-filter.c 2019-07-25 09:15:07 +02:00
Michael Natterer d88b90d026 app: fix render cache artifacts when resizing the canvas
Since introducing gimp_display_shell_canvas_tick() we were setting
shell->disp_width and shell->disp_height in the tick callback, which
was too late and caused redundant rendering and scrolling, but was
never noticed.

Now we clear the render cache and its valid region in
gimp_display_shell_canvas_size_allocate() directly and set
shell->disp_width and shell->disp_height immediately, so other places
that listen to the canvas' size-allocate get the right values.

The old size of the canvas gets to the tick callback using a small
struct as user data.
2019-07-21 18:18:31 +02:00
Jehan 03f645cd2d Issue #3070: CRITICAL when converting to Indexed image.
Revert the previous commit 786686a541 and comes up with a better fix.

Let's actually change the image base type and add its colormap as close
as possible without any GUI calls in-between. I also add an explicative
comment so that people are aware of this call proximity requirement to
avoid future problems when the code gets remixed.

It should be better than hacking around with exception in GUI code, and
should (hopefully) avoid other similar bugs.
2019-07-17 13:11:57 +02:00
Jehan 786686a541 Issue #3070: CRITICAL when converting to Indexed image.
Fixes the GIMP-CRITICAL:

> gimp_babl_format_get_trc: assertion 'format != NULL' failed".

During an indexed conversion, we are in a weird limbo state between the
time we changed the base-type to GIMP_INDEXED and when we actually set
the new palette. If during this time, we hit a context switch (which
typically happens during GUI code; in this specific cases, the various
progress updates would call gimp_widget_flush_expose() which does
trigger context switch), then gimp_display_shell_update_title_idle()
might be idly called. And when it does, it sees an indexed function with
neither format nor builtin profile.
2019-07-17 12:46:00 +02:00
Michael Natterer d93e928703 app: fix crash in the newly added GimpDisplayShell render_cache code
Must initialize shell->render_buf_width,height before realize(), so
move the code to gimp_display_shell_init(), it doesn't depend on the
shell being realized.
2019-07-17 12:16:57 +02:00
Michael Natterer c393eff089 app: use CAIRO_OPERATOR_SOURCE in gimp_display_shell_scroll()
to copy around the render cache when scrolling.
2019-07-17 00:18:00 +02:00
Michael Natterer 2061cc0077 app: fix gimp_display_shell_render() to draw alpha correctly
Drawing the image needs to replace the render cache's alpha, so draw
with CAIRO_OPERATOR_SOURCE.
2019-07-16 23:16:27 +02:00
Øyvind Kolås 85cf3630c2 app: make use of display_config->zoom_quality
When set to FAST we do nearest neighbor from the next bigger mipmap
level instead of linear or box filtering - this gives a slight and
permanent boost to painting, and all updates, having one that combines
best of both worlds and reblits in high quality after a timeout would
be even more desirable.
2019-07-16 19:03:06 +02:00
Michael Natterer 9aa6aa1f04 app: make display update much faster again
Introduce a render cache that keeps the result of scaling, color
management, display filters and shell mask (for tools like fuzzy
select).

Change gimpdisplayshell-render.[ch] to only render to the cache and
manage a cairo region of the cache's valid area. Call cache
invalidation functions form various places. Change the API of all
render functions to be in display coordinates.

Also get rid of gimpdisplayxfer.[ch] because we now have a
canvas-sized cairo surface which is a surface similar to the
destination surface.
2019-07-16 17:15:34 +02:00
Michael Natterer 86e07c16b5 app: start porting away from GtkAction and friends
Step one: get rid of all those deprecation warnings that make
it hard to see any other warnings:

- add a lot of dummy API to GimpAction, GimpActionGroup, GimpUIManager
  etc. which simply forwards to the deprecated GTK functions, they
  will all go away again later
- rename GimpAction to GimpActionImpl
- add interface GimpAction that is implemented by all action classes,
  creates a common interface and allows to remove some duplicated
  logic from GimpToggleAction and GimpRadioAction, and at the same
  time adds more features
2019-07-02 14:21:32 +02:00
Michael Natterer a1aa179436 Issue #2643 - Conversion to grayscale fails with artifacts
Connect GimpDisplayShell to GimpImage::mode-changed and update its
cached color transforms. Also get rid of a duplicate conection to
GimpImage::precision-changed.
2019-06-01 14:19:05 +02:00
Michael Natterer 901350ba20 app: use g_clear_pointer() in more places 2019-05-27 17:47:55 +02:00
luz.paz 1c91b8d97e Add a few more misc. source comment typos 2019-05-09 09:13:37 -04:00
Ell 84e183e5ed Issue #3306 - Memory leak using Crop tool
In gimp_canvas_passe_partout_get_extents(), free the inner region
after XORing it with the outer region.
2019-04-30 16:47:00 -04:00
Ell 134ff92fe0 app: add GimpToolPolygon::change-complete signal
... which is emitted when finishing a change to the polygon,
similarly to GimpToolRectangle::change-complete.
2019-04-25 06:07:57 -04:00
Ell f84f1d89dc app: add gimp_tool_polygon_is_closed() 2019-04-25 06:07:56 -04:00
Ell e8c915af93 app: allow passing NULL pointers to gimp_tool_polygon_get_points() 2019-04-25 06:07:55 -04:00
Ell eda421e852 app: remove unused field from GimpPolygonSelectToolPrivate 2019-04-25 06:07:55 -04:00
Jehan 5c9114aedf app: allow core file procedure which don't return an image.
This is useful to be able to support file formats other than image
formats. In particular I will use this in the next commit to support a
"GIMP extension" format. When GIMP will open such file, it will
install an extension (not open an image on canvas).

This is an internal flag only, i.e. only usable from core GIMP. File
formats which a plug-in can register are still only image file formats.
2019-04-12 18:42:03 +02:00
Ell 50aaeef6a0 app: fix image-window UI-manager update while a projection is being rendered
Set the priority of the image window's UI-manager update idle
slightly higher than the projection idle priority, so that the
image actions are updated during projection rendering.
2019-03-30 19:31:23 -04:00
Ell be7906c05c Issue #2090 - Crash when using transform tools
In GimpTransformGridTool, avoid producing non-finite coordinate
and angle values.  In particular, this fixes a crash in
gimp_transform_grid_tool_get_cursor() as a result of a NaN angle
value being converted to a negative integer, hitting an assert.
2019-03-30 11:18:00 -04:00
Ell 846d242f30 app: revert combo-box drop-down changes
Revert the use of gtk_combo_box_set_wrap_width() to change the
combo-box drop-down style, except for the status-bar unit combo.
See https://gitlab.gnome.org/GNOME/gimp/issues/2828#note_421312 for
the rationale.

This reverts commits 1d984542e9,
68a33ab5bd, and
6dfca83c2a.
2019-03-27 20:14:10 -04:00
Ell 92216a635a app: in gimp_tool_gui_set_response_sensitive(), allow non-existent ID
In gimp_tool_gui_set_response_sensitive(), silently ignore non-
existent response IDs, instead of emitting a CRITICAL, to match the
behavior of GtkDialog and GimpOverlayDialog.  This simplifies code
with optional dialog responses.
2019-03-13 05:28:29 -04:00
Ell 8954d1f386 libgimpwidgets, app, plug-ins: use GimpSpinButton everywhere
Replace all direct uses of GtkSpinButton with GimpSpinButton, so
that its modified behavior extends to all our spin buttons.
2019-03-09 07:28:52 -05:00
Ell 46e16e175c app: take transform-grid handle size into account when readjusting
In the unified-transform, scale, and perspective tools, take the
maximal transform-grid handle size into account when readjusting
the transform, so that the handles themselves are fully within view
under arbitrary rotation, rather than just the corners.
2019-03-08 12:11:13 -05:00
Ell 7fb1d05ca4 app: fix unused variable warning in gimp_tool_gui_new()
... due to commit b23fae86f0.
2019-03-07 16:48:57 -05:00
Ell b23fae86f0 app: add gimp_tool_gui_add_button()
In GimpToolGui, add gimp_tool_gui_add_button() and
gimp_tool_gui_add_buttons_valist(), which allow adding dialog
buttons after construction.
2019-03-07 16:26:19 -05:00
Ell cdc5782b3c app: fix transform-grid center point for non-affine transforms; use as pivot
In GimpToolTransformGrid, use the transformed center-point of the
original polygon as the position of the center-point handle, and as
a snapping point for the pivot when "cornersnap" is TRUE, instead
of using the center-point of the transformed polygon.  These two
points are different for non-affine transformations.

Furthermore, when "use-pivot-handle" is FALSE, use the center-
point as the reference point when transforming around the pivot,
instead of the pivot itself, which might not be set.  In
particular, this fixes transformation around the pivot in the
perspective tool.

Don't explicitly set the center-point as the pivot in the scale
tool, since this commit makes it unnecessary.
2019-02-28 15:46:41 -05:00
Jehan 7f05ec00cd app: reimplement gimp_widget_flush_expose().
gimp_widget_flush_expose() has been removed since commit 3089a20167.
I now reimplemented it by simply checking if event sources are waiting
to be processed.
This was heavily needed as the statusbar was not showing any progress
(at least on highly demanding process, such as saving or loading files),
and therefore we were stuck with a seamingly frozen GUI.

Despite the name, this does not apply to a widget in particular anymore,
but to the whole program events.
2019-02-19 15:31:50 +01:00
Jehan 636b77f7d3 app: fix a "Floating point exception" crash.
`icon_space_width` is set when GtkWidget::style-updated signal is
emitted. In some cases, it was possible that gimp_statusbar_set_text()
is run before this happens, in which case, a division by zero would
crash the software.

I encountered this case in some rare occasions when duplicating an image
with ctrl-d, then as Ctrl was hold, the message "Click in any image to
pick the foreground color" was pushed on the brand new statusbar as it
is created (hence a race condition occurs with the signal handler and
this message). This was therefore not reproducible every time, but easy
enough to reproduce with multiple tests.
2019-02-13 21:06:08 +01:00
Ell 40c0913178 app: add GimpToolCompass::effective-orientation property
In GimpToolCompass, add a read-only "effective-orientation"
property, which returns the actual orientation of the compass; in
particular, if the "orientation" property is set to AUTO,
"effective-orientation" returns HORIZONTAL or VERTICAL, depending
on the current compass direction.  In 3-point mode, the property
always returns AUTO.
2019-02-04 15:59:53 -05:00
Ell a472696012 app: fix rectangle-select tool rounded-corners option
In GimpToolRectangle, fix the type of the cornder_radius field, so
that non-integer radii are properly displayed.

In GimpRectangleSelectOptions and GimpToolRectangle, increase the
maximal corner radius.
2019-01-21 11:39:25 -05:00
Jehan 1d984542e9 Issue #2828: Scrolling up with a mouse within a drop-down list.
We were doing it all the wrong way, fixing one combo box object at a
time. So this commit basically reverses commits 68a33ab5bd, 6dfca83c2a
and a9a979b2d0 and instead runs the same code in the class code. This
way, all objects based on these base classes will have the fix from
scratch.
These improved various other drop-down lists (I found some of them, and
probably not all) as I fixed all GIMP custom widgets based on
GtkComboBox.

Note that it has to be run after filling the list apparently (I had the
problem especially with GimpIntComboBox if running in the _init() code,
then the list widget showed wrong).
2019-01-20 13:08:36 +01:00
Ell f1a7abaef9 app: add gimp_tool_widget_{get,set}_visible()
Add mew gimp_tool_widget_{get,set}_visible() functions, which allow
setting the visibility of a tool widget.  While the widget is
invisible, it ignores all events.
2019-01-13 08:15:24 -05:00
Ell a9883e98e3 app: in GimpToolPath, use gimp_tool_message() instead of _set_status() ...
... when trying to edit a locked path.
2019-01-13 08:15:23 -05:00
Ell 00a06f94be app: handle GimpToolWidget::message in GimpToolWidgetGroup
... by forwarding the message, if the emitting widget has focus.
2019-01-13 08:15:22 -05:00
Ell 1ac4b85ce0 app: add gimp_tool_widget_message[_literal]()
Add a GimpToolWidget::message signal, which can be emitted by tool
widgets to display a message, instead of using the ::status signal.

Add corresponding gimp_tool_widget_message[_literal]() functions.
2019-01-13 08:15:21 -05:00
Jehan 496bc02b49 app: push a temporary status when picking layer with alt-midclick.
Though the layer list will also show updated, it is much easier to look
at the layer name in the status bar whose position never changes.
Anyway it makes sense to just show a temporary status info message
giving the picked layer name, making it all the easier to find the layer
you are looking for.
2019-01-09 00:11:37 +01:00
Ell 49e57f8d6e app: in gimp_display_empty(), clear image of matching contexts
In gimp_display_empty(), clear the image of all contexts whose
display is the current display, so that, in particular, when
subsequently updating the action groups, which causes certain
actions to be activated, the image that used to be bound to the
display is not found through the user context.  This avoids re-
validating the image projection when closing the last image,
postponing image destruction.
2019-01-08 10:05:50 -05:00
Jehan 4c337353a0 app: make layer picking a generic modifier of the shell.
Instead of having layer picking only on paint tools with alt-click, make
it available everywhere with alt-middle click. Moving through layers is
also a way to navigate an image, so it actually makes sense to be with
other modifiers (panning, zooming, rotating), while making the feature
more generic (this is definitely useful whatever the selected tool).
2019-01-07 23:08:51 +01:00
Michael Natterer fc4add7c2b Issue #1538 - Crash when adding file to already opened image and...
...closing this image while the file is being loaded

Ref the image around all calls to file_open_layers() and
gimp_image_add_layers() so it stays around even if the user closes the
display in the meantime.
2019-01-03 16:46:00 +01:00
Michael Natterer 291e84281a app: fix canvas jumping because of the status bar label being too wide
Set the label to ELLIPSIZE_END and add some packing options, and
switch from using pango attributes to simply prepending the right
number of spaces to leave enough room for the icon. The attributes
were somehow breaking ellipsation.
2019-01-02 17:49:53 +01:00
Michael Natterer e3e2cdcbd2 app: make GimpFgBgEditor and GimpStatusbar HiDPI-aware
so their icons look proper again on HiDPI monitors.
2018-12-31 19:12:00 +01:00
Jehan 182786b4fb app: fix type warning.
I missed this warning when reviewing commit a9a979b2d0.
My bad!
2018-12-19 16:01:06 +01:00
Kevin Stoffler a9a979b2d0 app: add gtk_combo_box_set_wrap_width for scale menu 2018-12-18 16:03:33 +00:00
Ell 637105b962 app: in all tools, blink lock box when the current item is locked
In all tools, when the current item can't be edited due to its lock
mask, use gimp_tools_blink_lock_box(), added in the previous
commit,to blink the lock box of the corresponding dockable, in
addition to showing an error message in the status bar, to hint at
the source of the error.
2018-12-10 08:55:17 -05:00
Ell ad831dbc6d Issue #2635 - Segfault when using measuring tool
In gimp_tool_compass_update_angle(), use fuzzy comparisson when
determining whether to update the angle properties, to avoid
infinite recursion due to floating-point inaccuracies.  In
partcicular, on x86, when using the x87 FPU rather than SSE, the
floating-point registers are 80-bit, while the properties are
stored as 64-bit, which can create small discrepancies between the
calculated angles and the stored values.
2018-12-08 06:03:51 -05:00
Oleksii Samorukov bd48996933 Fix compilation on Mac 10.6 and 10.7 (#2112) 2018-10-24 10:45:07 +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
Michael Natterer 1d43e2ff37 Issue #2332 - Marching ants from one image displayed on every tab
Seems we were drawing marching ants for hidden tabs ever since the
introduction of SWM, which is both a horrible waste of CPU time, and
also makes all selections visible on all displays on GTK+ 3.x.

Implement GtkWidget::unmap() in GimpDisplayShell and stop the ants
when the shell is unmapped.
2018-10-22 00:00:59 +02:00
Liam Quin 2e4b3ae05a Issue #1371 - Add title printf-like expando for export-clean and export-dirty
Add %Ex to print 'x' as export-clean indicator and %Nx for 'x' as
export-dirty indicator.
2018-10-20 11:22:50 +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 a21667821c app: avoid double-initialization of operation tools when changing layers
When re-activating an operation tool by clicking on a different
drawable while the tool is active, we re-call the corresponding
procedure to re-activate the tool, which implictly initializes it.
Avoid initializaing it explicitly in addition to that, since this
leads to the creation of a new config object by the filter tool,
while the GUI still refers to the old, now-dead, config object,
causing CRITICALs or segfaults when changing any parameter.
2018-09-29 14:31:48 -04:00
Ell ed20393f0e Issue #1180 - Warp tool aborts changes to layer A when ...
... changing layers and warping layer B

Add a new GimpToolControl::dirty_action field, which specifies the
tool action to perform when the a dirty event matching the tool
control's dirty mask occurs; this field defaults to HALT.  Apply
this action to the active tool in tool-manager in response to a
matching dirty event, instead of unconditionally halting the tool.
Likewise, use this action to stop the active tool in response to a
button-press event on a different drawable in the same image.

Set the dirty action of the gradient and warp tools to COMMIT, so
that they get comitted, rather than stopped, in cases such as
switching layers (including switching to/from quick-mask mode),
and, for the warp tool, changing the selection.
2018-09-29 12:38:45 -04:00
Ell 24fb597196 app: tweak focus behavior of GimpToolWidgetGroup when removing widget
When removing the focus widget of a GimpToolWidgetGroup, use the
last child, rather than the first child, as the new focus widget.
This plays nicer with auto-raise, and is probably better anyway.
2018-09-23 13:25:29 -04:00
Ell 95d2c92ff2 app: in GimpToolWidgetGroup, improve focus behavior when adding/removing widgets
When a focused widget is added to a group, make it the new focus-
widget of the group, instead of unsetting its focus if another
widget already has focus.

When removing the focused widget from a group, set a different
widget as the group's focus widget (if one exists), instead of
unsetting the focus widget, so that nonempty groups always have a
focus widget.
2018-09-23 12:58:45 -04:00
Ell 5b217b3ad4 app: in GimpToolWidgetGroup, calculate hover widget at button press
In gimp_tool_widget_group_button_press(), explicitly call
gimp_tool_widget_group_hover() before forwarding the event to the
group's hover widget, so that the hover widget gets recalculated.
If a widget is added to the group as a result of a button-press
event, this guarantees that it gets considered as a target for the
same event.
2018-09-23 12:58:45 -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
Ell 2ac91e0fc3 Issue #1125 - Transform tools temporarily disables layer mask
In GimpCanvasTransformPreview, add the necessary bits to the
preview graph so that, when transforming a layer, the layer's
opacity and mask are correctly applied to the preview.  Note that
since we're still not rendering the preview as part of the image
graph, the output is not always accurate, but it should be good
enough in most cases.
2018-08-06 04:21:42 -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
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
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
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 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 f676f2aa79 app: move GimpColorFrameMode to the core and name it GimpColorPickMode 2018-07-15 23:24:50 +02:00
luz.paz 719059fb4e gimptoolpolygon.c source typo
Found via `codespell`
2018-07-14 19:07:44 +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 0fa991fb5f app: undeprecate gimpdisplayshell-selection.c 2018-07-13 19:09:01 +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 17429c585f app: undeprecate GimpDisplayXfer, no more gdk_cairo_create() 2018-07-03 23:26:41 +02:00
Michael Natterer 716412a807 app: undeprecate GimpStatusbar
The call to gtk_container_resize_children() was probably completely
useless in GTK+ 3.x anyway.
2018-07-03 23:25:24 +02:00
Michael Natterer 7efb8576a1 app: prepare gimpdisplayshell-selection for undeprecation
with a patch that is mergable to 2-10.
2018-07-03 19:43:05 +02:00
Michael Natterer 67062a5867 app: undeprecate gimpdisplayshell-layer-select 2018-07-03 15:51:45 +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 c0480f502d app: don't do any queue_resize() in the canvas' size-allocate callback
which means we can't setup scrollbars there. Move the code to a
GtkTickCallback which runs before the next frame after the
size-allocate.

Also put the center_image_on_size_allocate() code there because it has
to run after the canvas' tick callback, and the order of tick
callbacks can't be controlled.

As a side effect we now have a flag in GimpDisplayShell which
indicates that there will be a size allocate before the next frame, so
simply skip drawing the canvas completely. This fixes new images
jumping around when they are first shown.
2018-06-28 00:52:08 +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
Salamandar 8feb51954b Fix encoding. The world should be utf-8. 2018-06-15 17:34:59 +00:00
Ell d3a3c35317 Issue #1646 - Transform preview looks wrong with selection
In GimpCanvasTransformPreview, when the image mask is not empty,
make sure to align it with the drawable using a gegl:translate
node, before combining both at the gegl:opacity node.  Otherwise,
the mask is applied at the wrong offset when the drawable's offset
is not (0, 0).
2018-06-15 01:59:40 -04:00
Ell 47b7e7be7d Issue #1602 - Numeric selection size wrong after switching tools
In GimpToolRectangle, call gimp_tool_rectangle_update_options()
when the "[xy][12]" properties change, so that the "x", "y",
"width", and "height" properties are updated accordingly.

In particular, we set these properties when committing an empty
rectangle select tool, to init the rectangle to the current
selection bounds, and this call is necessary so that the "x", "y",
"width", and "height" tool options are properly updated as well.
2018-06-14 12:33:41 -04:00
Michael Natterer 33d2595d22 app: make GimpCursorView fit narrow docks
Replace "Selection Bounding Box" by simply "Selection" and add a tooltip
to the frame that says it's the bounding box.
2018-06-14 12:32:40 +02:00
Michael Natterer 5a7925c5dc app: set CSS names on GimpToolDialog and GimpOverlayDialog 2018-06-10 23:56:17 +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
Ell 4ef06b9922 app: add GimpToolWidgetGroup
GimpToolWidgetGroup is a tool widget acting as a container for
child widgets, multiplexing widget events and demultiplexing tool
events.  It can be used by tools to display multiple widgets
simultaneously.

The group keeps track of the current focus widget, and hover
widget.  Certain events are only dispatched to/forwarded from these
widgets.

The hover widget is determined by performing a hit test for all the
children, starting from the last child.  The first widget returning
GIMP_HIT_DIRECT, if any, is selected as the hover widget;
otherwise, if the current focus widget returns GIMP_HIT_INDIRECT,
it's selected; otherwise, if exactly one widget returns
GIMP_HIT_INDIRECT, it's selected; otherwise, there is no hover
widget.

The focus widget is set when clicking on a widget (or
programatically, using gimp_tool_widget_set_focus()).
Additionally, the group can raise the clicked widget to the top of
the stack (see gimp_tool_widget_group_set_auto_raise().)
2018-06-05 04:04:47 -04:00
Ell 614cdcc0a8 app: add gimp_tool_widget_changed()
... which emits the "changed" signal, for use in subclasses to
notify the tool about widget changes not resulting from property
changes.
2018-06-05 04:04:47 -04:00
Ell 52a92a34d8 app: implement GimpToolWidget::hit() in all tool widgets
... and move the common functionality of their hit() and hover()
implementation to a separate function.
2018-06-05 04:04:47 -04:00
Ell 385203f4d6 app: add GimpToolWidget::hit() virtual function
... which takes the same arguments as GimpToolWidget::hover(), and
performs a hit-test, returning one of the following values:

  - GIMP_HIT_DIRECT:  The point corresponds to one of the widget's
    elements directly.

  - GIMP_HIT_INDIRECT:  The point does not correspond to one of the
    widget's elements directly, but the widget otherwise responds
    to press events at this point.

  - GIMP_HIT_NONE:  The widget does not respond to press events at
    this point.

Unlike hover(), hit() should not have any side effects.
2018-06-05 04:04:47 -04:00
Ell 5e736c697f app: implement GimpToolWidget::leave_notify() in various tool widgets
... by having them disable item highlights, and any other proximity
indication, when the cursor leaves the widget.
2018-06-05 04:04:47 -04:00
Ell be7eff980e app: add GimpToolWidget::leave_notify() vfunc
... which should be called on a widget when the cursor leaves the
widget, i.e., when it stops receiving hover events.

Have the default implementation clear the tool status.
2018-06-05 04:04:47 -04:00
Ell 49089fc427 app: respond to "focus-changed" signal in various tool widgets
... by disabling persistent item highlights when unfocused.
2018-06-05 04:04:47 -04:00
Ell eeed9c413b app: add gimp_tool_widget_{set,get}_focus(); "focus-changed" signal
The next few commits are going to add support for using multiple
tool widgets simultaneously.  As a first step, add a notion of a
focused tool widget, by adding gimp_tool_widget_{set,get}_focus(),
which tools/subclasses can use to control focus, and a
corresponding "focus-changed" signal, which tools/subclasses can
use to respond to focus changes.
2018-06-05 04:04:47 -04:00
Michael Natterer 1806b66c5a Issue #1560 - invisible canvas flip/rotation buttons...
...at the bottom of image window

Need to show/hide the event box, not just the labels/icons inside.
2018-06-04 15:13:23 +02:00
Michael Natterer 792cd581a2 Issue #1531 - Zooming with mouse movement should keep track of original point
When Control-Button2-Zooming, remember the start point, pass it to
gimp_display_shell_scale_drag() and force gimp_display_shell_scale()
to zoom around that point by passing GIMP_ZOOM_FOCUS_POINTER and
faking the point using gimp_display_shell_push_zoom_focus_pointer_pos().
2018-06-04 11:42:02 +02:00
Jehan 82f7e8c6c3 app: fix application icon compositing with the canvas on display scale.
This fixes this error on gdk_pixbuf_composite():
> assertion 'dest_x >= 0 && dest_x + dest_width <= dest->width' failed
2018-05-31 00:27:23 +02:00
Michael Natterer 0ecf0818a5 app: don't set a permanent size request on the canvas
Reset the canvas size request from gimp_display_shell_constructed() in
gimp_display_shell_canvas_size_allocate() so the image window can be
made smaller again. GTK+ 3.x always respects size requests.
2018-05-29 21:09:44 +02:00
Jehan e5c08832cb Issue #1509 - GIMP master Git zoom in/out scrolling is reversed. 2018-05-26 22:41:54 +02:00
Michael Natterer d9e016bd37 app: undeprecate gimpdisplayshell-scale.c and fix "unused variable" warning 2018-05-23 23:44:19 +02:00
Michael Natterer b33c6bc072 app: fix drawing of the canvas padding color
Remove all clipping hacks for drawing the canvas background, turns out
they never worked and we were relying on the pattern set on the
window, gah!

Also remove deprecated attempts to get a backgroud color and simply
don't show a color box in the menus for "from theme" cases.
2018-05-23 22:46:54 +02:00
Michael Natterer a628511a4e app: don't use gtk_window_parse_geometry() in GimpImageWindow 2018-05-22 12:33:58 +02:00
Timm Bäder f677a5abe8 app: remove RC style from GimpImageWindow
without replacement, we can always add CSS later if we don't like it
with whatever theme.
2018-05-22 11:14:50 +02:00
Michael Natterer 3c9272ef96 app: fix positioning of the text tool's style overlay 2018-05-22 01:59:26 +02:00
Michael Natterer 602dfb9a38 app: the last s/GdkDeviceManager/GdkSeat/ 2018-05-20 21:06:35 +02:00
Michael Natterer f3f61379f7 app: remove the option to enable tearoff menus 2018-05-20 21:06:35 +02:00
Michael Natterer e76c1305a5 app: derive GimpStatusbar from GtkFrame not GtkStatusbar
we were not using a single GtkStatusBar features, it was only in the
way. Remove broken size allocation logic and simply set a minimum
height of 3em in CSS. Also ellipsize the label, long labels had funny
effects since changing the overall GimpDisplayShell packing to pure
GtkGrid.
2018-05-20 21:06:35 +02:00
Michael Natterer 7f6b58d6ce app: kill the mess of boxes in GimpDisplayShell, use a grid for everything 2018-05-20 21:06:35 +02:00
Michael Natterer 0c9ac3bca9 app: use a cairo recording surface to measure GimpCanvasPath's extents
This gets rid of using the deprecated gdk_cairo_create().
2018-05-20 21:06:35 +02:00
Michael Natterer 4133a032de Undeprecate/improve GimpScaleComboBox and GimpUnitComboBox
Remove label-scale style properties and gtk_widget_modify_font()
hacks and theme them using CSS.
2018-05-20 21:06:35 +02:00
Michael Natterer 2dd2f1509b Enable and fix smooth scrolling and zooming
- Fix gimp_scroll_adjustment_values() for smooth scroll events
- Set GDK_SMOOTH_SCROLL_MASK on all widgets where we set GDK_SCROLL_MASK
- Add GIMP_ZOOM_SMOOTH to enum GimpZoomType
- Add "gdouble delta" to gimp_zoom_model_step()
- Change the meaning of the "scale" parameter to "scale or delta" in
  all functions that take GimpZoomType and a scale factor.
2018-05-20 21:06:34 +02:00
Michael Natterer e4d05a4758 app: use gimp_scroll_adjustment_values() in GimpNavigationEditor
and change signature of GimpNavigationView::scroll() to have
a GdkEventScroll instead of a GdkScrollDirection.
2018-05-20 21:06:34 +02:00
Michael Natterer fa3abc957b app: set GDK_SCROLL_MASK on widgets that need scroll events 2018-05-20 21:06:34 +02:00
Michael Natterer 613d02ca3a app: use gimp_scroll_adjustment_values() for scrolling the canvas 2018-05-20 21:06:34 +02:00
Michael Natterer bdbec7941c Use the new macros from the last commit in all files
...and gone are the annoying warnings.
2018-05-20 21:06:34 +02:00
Michael Natterer 4e7eead7e3 app: set all GtkPaned widgets to have wide handles
the narrow handles' event areas did overlap with our own widgets close
to the handle.
2018-05-20 21:06:34 +02:00
Michael Natterer 1d8696cd80 Get rid of gdk_flush() globally, use gdk_display_flush() 2018-05-20 21:06:34 +02:00
Ell 6e76cdf4d3 app: fix empty display unstable-version message 2018-05-20 21:06:33 +02:00
Ell ed46a405ae app: fix canvas motion compression
In gimp_display_shell_canvas_tool_events(), use
gdk_window_set_event_compression(), instead of implementing our own
motion compression, which used to introduce all sorts of weird
effects when combined with extended input devices, that we had to
hackishly work around.

For tools that use GIMP_MOTION_MODE_EXACT, we call
gdk_window_set_event_compression() to disable motion compression
for the canvas window upon initializing the tool in response to a
GDK_BUTTON_PRESS event, and again to re-eanble compression upon the
corresponding GDK_BUTTON_RELEASE event.

This commit also merges
gimp_display_shell_canvas_tool_events_internal() back into
gimp_display_shell_canvas_tool_events().  The split was a detail
of our custom motion compression implementation.
2018-05-20 21:06:33 +02:00
Michael Natterer 885f66158a app: kill all except one GtkAlignment, the tag popup one is a bit tricky 2018-05-20 21:06:33 +02:00
Michael Natterer c2763afd30 app: port gimp_display_shell_set_initial_scale() to the monitor's workarea 2018-05-20 21:06:33 +02:00
Michael Natterer 4a39edf241 app: disable motion compression, have to figure how to control GTK+'s 2018-05-20 21:06:33 +02:00
Michael Natterer 7f3f1afa28 app: port gimp_navigation_editor_popup() to GdkMonitor's workarea 2018-05-20 21:06:33 +02:00
Ell 75b9fa0aea app: take window scale-factor into account when rendering image
In gimp_display_shell_draw_image(), enable the code that adjusts
the scale-factor used for rendering the image by the window scale
factor, so that we make full use of the screen resolution even on
HiDPI displays.  This also fixes artifacts along render-chunk
borders.
2018-05-20 21:06:33 +02:00
Jehan 7642715c17 app: allow setting parent for dialogs created by GimpDialogFactory.
Fixes a bunch of:
> Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
2018-05-20 21:06:33 +02:00
Simon Budig 9d000f749f app/display: get rid of GtkTable 2018-05-20 21:06:33 +02:00
Michael Natterer d5c75afe2f app: honor the use-header-bar setting in GimpToolDialog 2018-05-20 21:06:32 +02:00
Michael Natterer 3571fc3ae2 app: port GimpCursorView to GtkGrid 2018-05-20 21:06:30 +02:00
Michael Natterer 65d4450b3e app, themes: move GimpDisplayShell styling to CSS
Looks half-decent again now.
2018-05-20 21:06:30 +02:00
Michael Natterer 03feaf39c3 app: port GimpDisplayShell to use GtkGrid 2018-05-20 21:06:30 +02:00
Michael Natterer 2f1a4fdc67 app: gimp_ui_manager_ui_popup_at_pointer() and use it where appropriate
Only one call to gimp_ui_manager_ui_popup() left...
2018-05-20 21:06:30 +02:00
Michael Natterer ab1edce8af app: use gimp_ui_menager_up_popup_at_widget() for the quick mask menu 2018-05-20 21:06:30 +02:00
Jehan 26710104ba Revert "Bug 794356 - Rulers always shown for subsequent image views"
This reverts commit ea48b9f31c.
Final revert of GTK+2 hack.
2018-05-20 21:06:30 +02:00
Jehan e7e7f00528 Revert "Bug 784480 - Clicking on-canvas GUI with a tablet stylus crashes..."
This reverts commit a8bc8d202c.
Continue removing the same GTK+2 hack.
2018-05-20 21:06:30 +02:00
Jehan 654ef12d58 Revert "Bug 794356 - Rulers always shown for subsequent image views"
This reverts commit 7230d5d777.
Remove GTK+2 only hack.
2018-05-20 21:06:30 +02:00
Michael Natterer b28228d911 app: add gimp_ui_manager_ui_popup_at_widget()
and use it where we used to pass gimp_button_menu_position() to
gimp_ui_manager_up_popup(), remove gimp_button_menu_position() because
it's now unused.
2018-05-20 21:06:30 +02:00
Michael Natterer 4c68fb70d4 app: use gtk_widget_get_preferred_size() in gimp_tool_gui_canvas_resized() 2018-05-20 21:06:30 +02:00
Michael Natterer 251d2f494e app: port some stuff to gdk_seat_grab/ungrab 2018-05-20 21:06:30 +02:00
Michael Natterer 5ece7a8d1f Port a lot of stuff from GdkScreen/monitor_number to GdkMonitor
including some fixes for getting pointer coords, and needed
API changes in libgimpwidgets.
2018-05-20 21:06:30 +02:00
Michael Natterer 09e6313c14 app: use gimp_color_display_stack_get_filters() instead of stack->filters 2018-05-20 21:06:29 +02:00
Michael Natterer 922f55ab85 app: s/GtkObject/GtkAdjustment/ in gimpdisplayhsell-rotate-dialog.c 2018-05-20 21:06:29 +02:00
Michael Natterer 1fdc472c68 app: make the statusbar's progress label visible again
and remove setting of removed align properties. The label alignment is
broken now until that feature comes back to gtk+.
2018-05-20 21:06:29 +02:00
Michael Natterer 8bb1637013 app: port GimpNavigationEditor to GtkStyleContext 2018-05-20 21:06:29 +02:00
Michael Natterer 76859c3c32 app: make input devices, grabs and therefore generally tools work again
- add new "device from event" apparatus that works on GTK+ 3.x
- fix the active device selection mechanism
- use the new device grabbing functions
- make sure we don't process events while we have a grab on
  another device
- compensate for some really obscure (and likely broken) behavior
  of XI2, it feels like we are the first real users...
2018-05-20 21:06:29 +02:00
Michael Natterer 4b322b8326 app: use GdkRGBA instead of GdkColor in some places 2018-05-20 21:06:29 +02:00
Michael Natterer 8c975484ab app: check whether child widgets exist in GtkWidget::style_updated()
because it is emitted repeatedly during widget construction, when not
everything is in place yet.
2018-05-20 21:06:28 +02:00
Michael Natterer e713ad4a43 app: implement GtkWidget::style_updated() instead of style_set() 2018-05-20 21:06:28 +02:00
Michael Natterer eb312ed55a app: remove calls to gtk_widget_get,set_extension_events() 2018-05-20 21:06:27 +02:00
Michael Natterer 5b3e3023cd app: port setting the canvas padding color to GtkStyleContext 2018-05-20 21:06:27 +02:00
Michael Natterer 64cde17687 app: don't connect to "size-requst" because that's deprecated
Instead, connect to "style-set" and calculate the widget's size
request there. Also fix the label's offsets after whatever GTK+ text
drawing changes.
2018-05-20 21:06:27 +02:00
Michael Natterer 27df9b617a app: didn't completely commit the display shell expose() -> draw() change 2018-05-20 21:06:26 +02:00
Michael Natterer 86e033d495 app: port to GtkWidget::draw() 2018-05-20 21:06:26 +02:00
Michael Natterer f8ef0c71c2 app: can't set the scale combo entry's properties in init() any longer
Set them in constructed() instead.
2018-05-20 21:06:26 +02:00
Michael Natterer a0a303bb42 app: remove call to gtk_statusbar_set_has_resize_grip() 2018-05-20 21:06:26 +02:00
Michael Natterer 9dfc455c12 app: port to GtkWidget::draw() (incompletely) 2018-05-20 21:06:26 +02:00
Michael Natterer 27659afa7c app: pass the cairo_region_t to gdk_window_invalidate_region() directly 2018-05-20 21:06:26 +02:00
Michael Natterer df65b0bdcd app: use gtk_widget_get_preferred_size() instead of size_request() 2018-05-20 21:06:26 +02:00
Michael Natterer e888be6a9a app: port GimpScalComboBox to GTK+ 3.0 2018-05-20 21:06:26 +02:00
Michael Natterer 3c8d9a1de8 app: use gtk_widget_get_preferred_size() instead of size_request() 2018-05-20 21:06:26 +02:00
Michael Natterer 1a04428815 app: remove obsolete (GtkObject **) casts 2018-05-20 21:06:26 +02:00
Michael Natterer 04961e056d app: no need to alloc colors any longer, GdkColormap is gone 2018-05-20 21:06:26 +02:00
Michael Natterer bb0eb4a7c3 Revert "app: Fix on canvas widgets ignoring clicks from tablets - bug 614441"
This reverts commit a059c0e7eb.
2018-05-20 21:06:26 +02:00
Michael Natterer ef2cf21f10 Bug 796252 - Mouse wheel zooming should center on cursor...
... _even at low zoom levels_

Pass GIMP_ZOOM_FOCUS_POINTER to gimp_display_shell_scale() when
wheel-scrolling, and change the scaling code to really honor
GIMP_ZOOM_FOCUS_POINTER and not apply magic image centering.

This keep the same point centered under the mouse for wheel-scrolling
and the zoom tool (== when the zooming is really triggered at a
certain mouse position).
2018-05-19 15:24:52 +02:00
Michael Natterer 2f629072f1 Bug 787919 - Tool options are lost when switching device
GimpDeviceInfo is the only way to store per-device settings like
color, brush etc. It used to be derived from GimpContext and therefore
limited to the context's properties, causing everything else (all
tool-individual options) to be lost on device change.

Derive it from GimpToolPreset instead, so it's capable of storing
arbitrary tool options.

Adapt things to the new class hierarchy and add a bunch of signal
handlers that make sure the active device's GimpDeviceInfo is updated
properly when the tool changes. Also change device switching
accordingly.

Change GimpDeviceStatus to only show the stuff that is relevant to
each device's tool.

And various small changes to make things work properly...
2018-05-16 02:09:19 +02:00
luz.paz 69b2e84924 Source and trivial typos
Found via `codespell` and `grep`
2018-05-12 23:44:47 +02:00
Michael Natterer 48f6d1b8ee app: avoid scaling GimpCanvasArc to zero, it causes a non-invertable matrix 2018-05-04 11:48:44 +02:00
Michael Natterer 4cc8481b66 app: get rid of a few forgotten stock-ids and new_from_stock() 2018-04-29 04:50:17 +02:00
luz.paz 4a77ff2d3d Bug 795557 - Misc. typo fixes in source, comments and doxygen (pt3)
Found via `codespell` and grep.
2018-04-25 23:49:06 +02:00
Michael Natterer 01e5a6b133 app: improve drawing of sample points so they are always visible
Draw them a bit brighter and larger, and with a dark shadow like tool
lines so they are visible on all backgrounds.
2018-04-19 16:20:41 +02:00
Michael Natterer 428110f63f app: remove non-cut/copy/paste functions from gimp-edit.[ch]
Move them to the new files gimpdrawable-edit.[ch] and
gimpimage-fade.[ch].
2018-04-18 23:48:33 +02:00