Commit Graph

5100 Commits

Author SHA1 Message Date
Ell 2523808e4a app: add gimp_paint_core_{set_show_all,get_image_pickable}()
GimpPaintCore operates indipendently of a display, and hence needs
to be explictly told when operating in "show all" mode, affecting
the result of paint tools operating in "sample merged" mode.  Add
gimp_paint_core_set_show_all() for that purpose, and call it,
passing the current display's "show all" mode, in GimpPaintTool.
This controls which pickable (the image itself, or its projection)
is used as the sampling source, as per
GimpPaintCore::saved_proj_buffer, and as returned by the new
gimp_paint_core_get_image_pickable() function.
2019-09-06 20:10:30 +03:00
Ell 17f8cff6f6 app: add "show all" support to the bucket-fill tool in "fill similar colors" mode
In the bucket-fill tool, allow using the tool outside the canvas
bounds with "sample merged" active in "fill similar colors" mode,
when the current display is in "show all" mode.  Additionally,
ignore "sample merged" in "fill whole selection" mode, on which it
has no effect.
2019-09-05 18:04:12 +03:00
Ell b7674faef8 app: fix transform-tool preview/bounds in show-all mode when transforming entire image
In the transform tools, when transforming the entire image in show-
all mode, don't crop the preview and the transform bounds to the
size of the canvas.
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 915bdffb5a app: in GimpEditSelectionTool, freeze moved items' previews
... to avoid unnecessarily updating their previews while dragging,
and, in particular, to avoid updating the image's GimpImageViewable
size in show-all mode.
2019-09-04 20:51:43 +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
Jehan 6391b2bcff Issue #3263: fix critical error on bucket fill tool.
Fixes the error:
> Critical error: gimp_line_art_thaw: assertion 'line_art->priv->frozen'

This may happen in cases when we didn't actually freeze the line art at
pointer click, because we were in an invalid case (for instance,
clicking out of selection), hence we must not thaw the line art either
at button release.
2019-08-27 12:41:49 +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
luz.paz 7e99aa59f5 Add other misc. typo fixes 2019-08-13 11:50:51 -04:00
Ell f651db52fb app: add gimp_transform_tool_set_type()
... which temporarily changes the transform-type of the tool,
restoring the original type once it's halted.  To be used when
activating a transform tool through an action for a specific
transform type.
2019-08-11 00:28:44 +03:00
Ell e4990bee7b app: add "Image" transform type to transform tools
Add a new "Image" transform type to the transform tools, in
addition to the existing "Layer", "Selection", and "Path" transform
types.  The "Image" mode transforms the entire image, rather than a
single item.  In tools with a preview, the preview shows the
transformed image projection.  The clipping mode controls how the
canvas is clipped during the transform; in particular, the ADJUST
clipping mode resizes the canvas to fit its transformed size.
2019-08-11 00:28:44 +03:00
Ell 9f823c396a app: indentation fixes in the transform tools 2019-08-11 00:28:43 +03: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 33a389cd0c app, pdb: use gimp_item_get_clip() everywhere
Remove the special clipping-mode handling for channels throughout
the transform (and drawable-filter) code, and rather use
gimp_item_get_clip(), added in the previous commit, instead.  As
mentioned in the previous commit, we only modify the clipping mode
in top-level code, while having lower-level code use the clipping
mode as-is.  This not only hides the actual clipping-mode logic
from the transform code, but, in particular, allows code performing
transformation internally to use arbitrary clipping modes.

Also, this commit fixes a bunch of PDB bugs all over the place :)
2019-08-09 22:23:17 +03:00
Michael Natterer 169f98f915 libgimpwidgets: add GDestroyNotify to gimp_int_combo_box_connect() 2019-08-08 00:22:15 +02:00
Michael Natterer 67455a4ea7 libgimpwidgets: add GDestroyNotify to all enum widgets callback_data 2019-08-08 00:01:10 +02: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
Ell eaec9443c3 app: in GimpFilterTool, add "clipping" option
In GimpFilterTool, add a new "clipping" option, which can be either
Adjust or Clip.  This option is controllable for layers, when
there's no selection mask.

When set to Adjust, which is used by default, the filter's output
may extent past the drawable's boundary, and the drawable will be
resized to match the output when committed.
2019-08-02 00:40:01 +03: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
Ell 2d80d4d138 app: use gimp_gegl_buffer_dup() everywhere
... instead of gegl_buffer_dup().
2019-07-30 20:32:41 +03:00
Ell a1f676aabd app: in the gradient tool, set the graph's underlying node
... to the gimp:gradient node
2019-07-28 12:10:17 +03:00
Jehan 771d415b5f app: rename "On color" matting preview mode to "Color".
As discussed earlier with mitch and tmanni.
2019-07-25 22:44:41 +02:00
Michael Natterer ed64fda6e5 app: add gegl:mean-curvature-blur to Filters -> Blur 2019-07-19 14:41:19 +02:00
Michael Natterer d718da27a8 app: add gegl:newsprint to Filters -> Distorts
and add a custom GUI constructor that does nothing special (yet).
2019-07-17 18:24:33 +02:00
Jehan 8ccd49ac78 Issue #3597: Free selection: CRITICAL when double clicking on a handle.
GIMP_BUTTON_PRESS_DOUBLE press event would be called before the second
release event happens hence the tool control would not be properly
halted. Just pass through the gimp_selection_tool_start_edit() check for
any press events other than GIMP_BUTTON_PRESS_NORMAL.
2019-07-02 15:21:05 +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 928b85d25c app: add gegl:bayer-matrix and gegl:linear-sinusoid to the menus
in Filters -> Render -> Pattern. Also depend on GEGL from git.
2019-06-28 15:48:47 +02:00
Michael Natterer c3752ba743 Issue #3435 - GIMP encountered an error: GIMP-CRITICAL:...
...gimp_size_entry_set_resolution: assertion 'GIMP_IS_SIZE_ENTRY (gse)'
failed

In gimp_tool_options_manager_tool_changed() make sure the new tool's
tool options GUI always exists, so tools can access it even if the
tool options dockable is not currently open.
2019-06-26 18:53:22 +02:00
Michael Natterer 0afcaefec5 Issue #3503 - Display Preset names on Filter Dialogs
Don't clear the preset combo right after a preset was selected.
Instead, clear it as soon as any change is made to the settings in the
dialog. This way the last chosen preset's name stays in the combo as
long as the current settings are identical to the preset.
2019-06-26 14:53:43 +02:00
Michael Natterer e47936182e app: some formatting in the edit non-visible layers code 2019-06-24 15:57:21 +02:00
woob 39c71c6fb3 app: Add initial support for configurable editing of non-visible layers (Issue #2713)
Add a "edit-non-visible" configuration option, found under
Edit->Preferences->Tool Options as "Allow editing on non-visible layers"
2019-06-23 16:15:59 +03:00
Thomas Manni d6bcb16b0b Foreground-select Tool: new Preview Mode and color selector for "On color" preview
This commit adds a new preview called "Grayscale", allowing to see the
resulting mask in black and white. The previous preview is now called
"On color" and allow users to choose the color and opacity, instead of
imposing only 4 colors (red, green, blue, grey).
2019-06-18 17:59:41 +02:00
Jehan 50f8cb8542 app: commit the free selection before floating it.
When using a selection modifier Altr+Ctrl|Shift, we want to commit the
selection. If I do it too late though, and if the polygon was not closed
yet, the computed coordinates for the floating selection end up (0, 0)
because it is based on the selection coordinates (yet an unclosed
polygon does not create a selection yet). So commit the tool from within
GimpSelectionTool instead, as soon as we confirmed that the class is
going to take over with SELECTION_MOVE or SELECTION_MOVE_COPY.

Note: ability of quick copying|cuting an unclosed polygon is very useful
as it removes the additional step for a case where anyway committing the
selection was a prerequisite.
2019-06-16 20:37:07 +02:00
Jehan c9a91b32bc Issue #3514: Free Select tool: Alt-Ctrl|Shift not working unless...
... selection is committed;
Fast copy|cut-paste modifiers in selection tools were not working with
the Free Select tool, even when the polygon was closed. The reason was
that GimpPolygonSelectTool was not properly chaining up with the parent
implementation for oper_update(), and then upon a button press, we need
to check to call gimp_selection_tool_start_edit() to see if the action
should not be handled by GimpSelectionTool.
Of course, since we don't necessarily want all child class of
GimpPolygonSelectTool to support these modifiers (typically we may not
want these in the Foreground select tool), I set allow_move to FALSE,
then set it to TRUE only in the GimpFreeSelectTool subclass.
2019-06-16 20:10:06 +02:00
Alexandre Prokoudine 47d2b685a6 Offset tool: mark forgotten messages for translation 2019-06-12 22:56:31 +03:00
Ell 066827e23c app: add GimpFilterTool::region_changed() virtual function
Add a new GimpFilterTool::region_changed() virtual function, which
gets called whenever the filter region changes, either due to a
change to the tool's "region" option, or a change to the image
mask.

Override GimpFilterTool::region_changed() in GimpOperationTool and
GimpOffsetTool, instead of listening to a change to the "region"
option in GimpTool::options_notify(), so that the tools are
properly updated when the image mask changes.
2019-06-06 03:09:58 -04:00
Ell 428ee0e2ad app: in gimp_filter_tool_get_drawable_area(), don't return empty area
In gimp_filter_tool_get_drawable_area(), when the image mask
doesn't intersect the drawable, return a minimal area, instead of
an empty/invalid area.
2019-06-06 03:08:39 -04:00
Ell 3a4a00c71e Issue #40 - Layer offset tool
Add a new Offset filter tool, as a front-end to gimp:offset.  The
tool replaces, and provides the same interface as, the drawable-
offset dialog, while also providing live preview and on-canvas
interaction.

Note that we don't simply use a custom propgui constructor for
gimp:offset, since we need a little more control.
2019-06-05 19:06:56 -04:00
Ell 2da5cb562d app: update drawable when committing Warp tool
Make sure to update the drawable after committing the Warp tool, if
high-quality-preview is disabled, and we use a non-nearest sampler.

Necessary after commit d928a80b7f.
2019-06-03 09:58:42 -04:00
Michael Natterer a14834e336 Issue #2057 - All tool presets change FG, BG and Pallete color...
...even when not supposed to

Don't use gimp_config_copy() to set the tool options from the ones
stored in the preset. Instead, add utility function
tool_manager_copy_tool_options() that only copies properties of
GimpToolOptions and its subclasses.

Simply set the tool, copy the tool options' context properties, then
copy the tool options' own properties and done. Much more obvious and
works.
2019-06-02 15:13:27 +02:00
Ell 8ef461bb70 app: s/gimp_list_compare()/gimp_g_list_compare()/
... so we don't clash with the GimpList namespace.
2019-05-30 03:31:46 -04:00
Ell 08ebcce2fa app: fix memory leak in previous commit 2019-05-30 02:43:45 -04:00
Ell 1e95481feb app: allow moving an intersecting pair of guides with the Move tool
This commit adds support for moving together an intersecting pair
of guides using the Move tool, by dragging the guides at their
point of intersection.  This is useful when the guides are used to
mark a point, rather than a pair of lines (e.g., as is the case for
the mandala symmetry guides, which mark the symmetry's point of
origin).

Add gimp_image_pick_guides(), which can return a set of guides,
rather than a single guide.  The API allows an arbitrary set of
guides to be returned, but, in practice, at most two intersecting
guides are returned, as per the above.

In GimpMoveTool and GimpGuideTool, add support for moving multiple
guides together, and, in GimpMoveTool, use gimp_image_pick_guides()
to potentially pick multiple guides.
2019-05-30 01:51:06 -04:00
Michael Natterer 901350ba20 app: use g_clear_pointer() in more places 2019-05-27 17:47:55 +02:00
Massimo Valentini 1a691f77e6 Issue #1220 - Text tool has color from previous line...
...when overwriting existing text

gimp_text_tool_enter_text(): when replacing a selection, use the text
properties from the text style editor for the entered text, otherwise
the style of the text before the selection will be used.
2019-05-25 12:44:13 +02:00
Michael Natterer e249a42226 Issue #3343 - Some translated tooltips are appearing untranslated
Tool options properties must be translated with _() not N_().
2019-05-25 11:42:07 +02:00
Ell 068df34a27 Issue #3304 - Invalid write when halting filter tool with controller
In GimpFilterTool, properly clean up the controller's widget weak-
pointer and signal-handlers upon destruction, to avoid invalid
memory access when the widget is destroyed, if the widget outlives
the controller.
2019-04-30 16:46:59 -04:00
Ell 71c624c5ab app: flush image when committing free-select tool
In GimpFreeSelectTool, flush the image when committing the tool, if
the seletion is created at the time of the commit (i.e., if the
polygon is not closed prior to the commit).
2019-04-26 03:37:13 -04:00
Ell 3369958525 app: increase GimpSelectionTools idle priority to avoid flickering
In gimp_selection_tool_start_change(), increase the priority of the
idle source used for hiding the selection so that it's run before
the canvas is redrawn, to avoid flickering the previous selection.
2019-04-25 09:54:31 -04:00
Ell 6a2bea733b app: fix dirty mask/action in the rectangle- and free-select tools
In GimpRectangleSelectTool and GimpFreeSelectTool, make sure the
tool is committed when the selection is dirty.
2019-04-25 07:08:54 -04:00