Commit Graph

4595 Commits

Author SHA1 Message Date
Michael Natterer 93787cd049 app: completely set up the filter in gimp_filter_tool_create_filter()
which got renamed from create_map() in this commit too. "Completely"
means including insane options like color_managed and gamma_hack, they
are confusing enough so they should at least work correctly.
2017-02-22 23:59:10 +01:00
Ell e30d235ede app: derive the layer-mode menu layout entirely from the info arrays
Replace the 'with-behind' and 'with-replace' properties with a
single 'context' property, and use it to select the included
layer modes, according to their context mask.

Add a dummy GIMP_LAYER_MODE_SEPARATOR value to the GimpLayerMode
enum, and use it to explicitly mark the menu separators in the
layer-mode group arrays; add separators to the layer-mode menu
accordingly.

Update the rest of the code to use 'context' instead of 'with-behind'
and 'with-replace'.  In particular, in the layers and layer options
dialogs, select the right context based on whether or not the
selected layer is a group.
2017-02-17 06:26:32 -05:00
Michael Natterer 8634b5cbc3 app: make layer blend color space and compositing color space configurable
...they say it's going to get worse before it gets better...
2017-02-12 23:49:26 +01:00
Michael Natterer 7da7bab09c app: get rid of icons in dialog buttons (use labels not stock IDs)
Nobody has them anymore, and they are deprecated in GTK+ 3.x. This
also fixes all conflicting mnemonics except those I missed, but we can
fix them now.
2017-02-12 16:18:54 +01:00
Michael Natterer 65485ae139 Bug 777096 - Curves line for Alpha channel invisible with default theme
Use style->text_aa instead of hardcoding gray, so the alpha curve
renders in the color between the curve widget's foreground and
background colors.
2017-02-09 22:41:05 +01:00
Michael Natterer 2bca4b25e0 Bug 777911 - Cage Transform edits locked, invisible and group layers
Fix cage transform to refuse to work on locked, invisible and group
layers. Add GimpTool::initialize() implementation so the generic
"drawable has changed" mechanism triggers the right response.
2017-02-08 19:28:14 +01:00
Michael Natterer 80f528a798 app: reorder and clean up stuff in the cage tool before starting fixes 2017-02-07 22:18:01 +01:00
Michael Natterer 891f85e805 app: move gimp-gegl-config.[ch] to operations/
and rename it to gimp-operation-config.[ch].
2017-02-05 20:17:31 +01:00
Michael Natterer c6f00eb87f app, menus, plug-ins: add new menu Color -> Tone Mapping
Move all related GEGL filters and the retinex plug-in there..
2017-02-02 20:42:58 +01:00
Michael Natterer 7c9a740b74 app, menus: add gegl:image-gradient and gegl:snn-mean to the menus 2017-02-02 19:54:23 +01:00
Michael Natterer d434c60161 app, menus: add some more GEGL filters to the menus
and blacklist some others in the GEGL tool.
2017-02-02 17:43:27 +01:00
Michael Natterer 2a96d598c3 app: add internal and PDB API and UI to control a layer's composite mode
Largely based on a patch by Ell, with the enum type renamed and
various small changes. Adds another axis of configurability to the
existing layer mode madness, and is WIP too.
2017-02-02 00:38:25 +01:00
Michael Natterer c58d471af7 app: remove gimp_paint_mode_menu_new() and use GimpLayerModeBox
I know this looks absolutely horrible, please spare me comments about
that. This commit has the purpose to let everybody experiment with the
new modes, and suggest improvements of the GimpLayerModeBox widget; we
need *some* way of controlling the new layer mode madness.
2017-01-30 13:24:35 +01:00
Thomas Manni 0d4dd11e2a Bug 777880 - better handling of sensitivity functions for channel combobox on threshold, levels and curves tools
- set the filter_tool->drawable before showing the tool gui.
- set the sensitivity functions for channel combobox of threshold,
  levels and curves tools dialogs only once during dialog creations.
- use the filter_tool->drawable inside the sensitivity functions
2017-01-29 14:07:06 +01:00
Michael Natterer 3e3cdbae41 app: blacklist gegl:matting-levin in the GEGL tool 2017-01-25 22:32:11 +01:00
Jehan 2762662ca9 app: use gimp_unit_get_accurate_digits() in a few places. 2017-01-23 20:59:28 +01:00
Michael Natterer 40395b83a4 app: require gegl:wavelet-blur and blackist it in the GEGL tool 2017-01-23 02:33:59 +01:00
Michael Natterer d293a00995 app, menus: add gegl:edge-neon to Filters -> Edge Detect 2017-01-22 14:35:35 +01:00
Jehan 1835b2ae61 app: improve precision of paint tools' straight line distance...
... in status bar.
Follow-up of commits f836892 and d1c3c3d. With high resolutions, the
distance displayed in the status bar when shift-clicking in a paint tool
may lack digit precision and show the same value (in non-pixel unit) for
several consecutive pixels. Compute a more accurate precision than what
gimp_unit_get_digits() can provide in such cases.
2017-01-20 00:40:41 +01:00
Jehan d1c3c3deb0 app: improve Measure Tool digit precision.
When working with high resolution, you may have cases where measured
length won't be displayed with enough digits; i.e. several pixels length
would show up as 0. For instance at 4000 PPI, up to 7 pixels show up as
0 mm, then at 0.1 mm from the 8th pixel (actually reaching over 0.05 mm,
approximating as 0.1), then 0.2 at 24 pixels (actually: 0.152), and so
on. At such a resolution, 3 digits are needed for 'mm' instead of the
1 digit returned by gimp_unit_get_digits() so that we display reliable
lengths.
Therefore we need to compute ideal digit precision. Configured digits
for a given unit will now be used as a minimum value, but actually used
digits may be higher.
2017-01-20 00:40:27 +01:00
Michael Natterer 07600c6db6 libgimpbase: proper names for the GimpChannelType enum
Register the old value names as compat. Also add some forgotten
values and enums to gimpcompatenums.h
2017-01-09 19:40:30 +01:00
Michael Natterer 66060e3307 app, libgimp*, plug-ins: replace enum GimpLayerModeEffects by GimpLayerMode
with proper value names. Mark most values as _BROKEN because they use
weird alpha compositing that has to die. Move GimpLayerModeEffects to
libgimpbase, deprecate it, and set it as compat enum for GimpLayerMode.
Add the GimpLayerModeEffects values as compat constants to script-fu
and pygimp.
2017-01-08 23:00:19 +01:00
Jehan 8111ad62da Bug 776417 - improve Sample Average and Sample Merged description.
The "accumulated" (color value) adjective does not look like the best
word in both descriptions. Respectively, the first is an averaged
value whereas the second would be a "merged" or "composited" value.
If native speakers have comments or better propositions, they are
welcome to speak up.
2017-01-03 04:21:42 +01:00
Michael Natterer 237d83dc7f Bug 773462 - Color Picker should support range...
...regardless of image color precision

Split enum value GIMP_COLOR_FRAME_MODE_RGB into RGB_PERCENT and RGB_U8,
which display the current % values, and values in a range of 0..255.
2017-01-03 01:20:30 +01:00
Jehan c2665a2e43 app: tooltip of Color Picker's "Sample average" option mixed up.
This should be "Sample merge"'s tooltip.
2017-01-01 19:22:29 +01:00
Michael Natterer 3d986425b2 Bug 768058 - Color picker tool should be able to ignore snapping
Don't snap to anything when picking colors.
2017-01-01 17:59:26 +01:00
Michael Natterer adad7c651c Bug 167203 - color picker tools should always draw outline
Move the entire drawing control logic to gimp_color_tool_oper_update()
which gets invoked on hovering, and don't mess with it in
button_press() and button_release(). Tested to work with the color
picker, paint and filter tools.
2017-01-01 17:35:57 +01:00
Michael Natterer af02104365 app: s/gegl:color-reduction/gegl:dither/ in sanity.c and gimpgegltool.c 2016-12-26 18:55:08 +01:00
Michael Natterer 9d4fad1f18 Bug 776503 - brightness-contrast in split preview mode changes...
...parameters of the tool

Take GimpFilterTool's split preview guide into account when starting a
drag to change the tool's parameters.
2016-12-26 17:50:11 +01:00
Michael Natterer fc9da4c9a3 app: allow to toggle the histogram dialog between gamma and linear
Change GimpHistogram to take a "gboolean linear" parameter and always
honor that parameter, so both kinds of histograms can now be created
for all drawables.

Add a horrible "Linear" toggle to the histogram dockable which always
defaults to the active layer's actual pixel format, but can be
switched at any time. This UI is ugly and needs to change.

On the PDB, default to gamma-corrected if the plug-in is unaware of
higher precision, and to the drawable's native pixel format otherwise.

Other places using histograms (e.g. levels, curves) are unchanged.
2016-12-26 17:32:17 +01:00
Michael Natterer 75be560e2a app: make sure the blend tools doesn't stay around on removed drawables
Set gimp_tool_control_set_preserve() to TRUE and set an appropriate
dirty_mask, just like all tools which have a permanent on-canvas state
outside of a simple press-drag-release.
2016-12-24 18:40:25 +01:00
Jehan e31f8e1195 app: fix indentation. 2016-12-22 17:05:26 +01:00
Jehan 3fa016fb4b app: clean out tab indentations. 2016-12-21 04:05:32 +01:00
Jehan 3b41d16086 app: cleaned out tabs. 2016-12-20 16:20:42 +01:00
Michael Natterer 619a885696 Bug 775391 - Collapse "Radius" widget when "Sample average" is unchecked
Use gimp_prop_expanding_frame_new() for the widgets.
2016-12-07 12:51:48 +01:00
Michael Natterer 2e63533602 app: add GimpDockContainer::get_dialog_factory()
and use it where possible instead of gimp_dialog_factory_get_singleton().
Also reduce using this function in some other places.
2016-11-25 13:26:08 +01:00
Thomas Manni ecc49ed9c6 iscissors: ensure first and last isegments are distinct before closing the curve 2016-11-25 07:44:49 +01:00
Jehan 94a5b7c97a app: cleaning out tabs. 2016-11-25 01:42:47 +01:00
Jehan 3e85121eb9 Bug 774733 - segmentation fault when discarding text information.
Always check pointer before dereferencing it, when it can be NULL.
2016-11-21 20:42:56 +01:00
Jehan 0cccc20c0a app: delete duplicate accelerators.
Redundant accelerators were:
- <Primary><Shift>y on dialogs-mypaint-brushes and edit-strong-redo.
  Since the <Primary>z vs <Primary>y has quite a strong history for
  undo/redo actions, and dialogs-mypaint-brushes is quite new, let's
  unmap the latest.
- <shift>l on tools-seamless-clone and tools-unified-transform.
  Since the Seamless clone tool is still in the playground and we
  don't even know if it will make it out quite soon, let's give
  priority to the Unified Transform tool.
2016-11-21 15:59:20 +01:00
Michael Natterer 014fdb87e5 app: make switching paint tools to color picker mode more robust
Don't rely on the exact modifier being pressed or released. Instead,
check if only the right modifier is pressed after *each* modifier
change, and switch to color picking if it is; disable color picking
otherwise. This greatly reduces the risk of missing the user's wish to
pick colors because of other modifiers being pressed and released in
whatever order.

Probably fixes bug #734743.
2016-11-16 13:16:24 +01:00
Michael Natterer 7c29077acd app: allow to remove the last added IScissors segment with backspace 2016-11-08 13:45:12 +01:00
Michael Natterer 483c282687 Bug 766988 - Colors applied to images are not color managed
Add color management to GimpDrawableFilter and GimpFilterTool, GEGL
ops applied to drawables can be applied in color managed space
now. Sadly, this is very slow, so disabled by default.

I'm sure the profile guessing based on the operation's format doesn't
always work, but this general bug counts as fixed now.
2016-11-07 15:39:48 +01:00
Michael Natterer 3cef404e20 app, pdb, libgimp: allow to choose the channel when thresholding
so the threshold can now be based on the GimpHistogramChannel enum.
Add a channel menu to the threshold dialog and a channel argument to
the PDB procedure (which is new in 2.10).

If I hadn't forgotten what the "RGB" channel is supposed to do I would
have implemented the RGB mode in GimpOperationThreshold correctly.
Right now I'm just guessing. Anyone?
2016-11-01 22:45:37 +01:00
Michael Natterer b4120e3f61 Bug 767650 - Uncommitted scissors selection is discarded on tool change
gimp_iscissors_tool_commit(): if the curve is not closed, close and
recalculate it.
2016-10-30 23:08:13 +01:00
Michael Natterer 5ce223b552 app: cleanup in GimpEditSelectionTool
Rename and reorder members to be more clear. Move variables to local
scopes. Minor code reorganization.
2016-10-23 17:49:47 +02:00
Michael Natterer f9170b667e Bug 647957 - GimpColorFrame's CMYK mode is not color managed
Convert GimpRGB to CMYK using a color transform to the configured CMYK
profile instead of the naive gimp_rgb_to_cmyk().

Add gimp_color_frame_set_color_config() and call it on all color
frames in the GUI (color picker tool, cursor info, sample point view).
Keep a GimpColorTransform around that does the conversion.

Also color manages the frame's color area now (visible in the sample
point view), which was forgotten earlier. Addresses bug #467930.
2016-10-18 22:48:04 +02:00
Michael Natterer d1e3d7c5c7 Bug 731279 - Tool Preset Editor not working correctly
This fixes restoring of brush properties (size, spacing angle etc.)
from presets, which was utterly broken before. The fix consists of
two parts:

- In tool_manager_preset_changed(), always copy the brush properties
  again after setting the preview on the tool options, in order to
  override brush properites that get copied from a linked brush when
  that brush gets set on the tool options.

But no amount of copying stuff again and again would help without:

- In gimp_context_set_by_type(), don't use g_object_set() to set the
  object (brush, pattern etc.). Instead, build a GValue and call
  gimp_context_set_property(). This may seem odd, but avoids a
  g_object_freeze_notify()/thaw_notify() around the g_object_set(),
  which was causing "notify" to be emitted at the very end, after
  everything this context change has triggered. GimpContext is an
  essential core object and there is an expectation of a reasonable
  order of signal emissions and callbacks being called. The "notify"
  at the end was keeping any callbacks of the context's "foo-changed"
  signals to override anything an earlier callback had done, if a
  "notify" callback was overriding that overriding again.

This was probably the reason for a lot of odd behavior observed over
the years. In fact, I have been searching for this for at least 5
years.
2016-10-12 20:33:23 +02:00
Michael Natterer 184f0929ce Bug 771678 - Parametric Brush Aspect Ratio and Angle values...
...are not submitted to respective Tool Options sliders

Treat brush angle and aspect ratio like all other paint options values
that can be linked to brush defaults and take their default values
from the brush. They were special casing their defaults to constants,
and GimpBrushGenerated was adding the passed dynamic radius and aspect
values to its own. This was totally incomprehensible.

Now GimpBrushGenerated's transform_size() and transform_mask()
implementations just translate between these APIs value ranges and the
brush's own value range and only use the passed values (not the
brush's native values), which makes the editor <-> tool options
interaction and the painted brush shape predictable.

Also connect the active brush's property notifications to the paint
options properties, so the paint options follow a brush edit live if
the respective "linked" toggles are checked.

And some cleanup.
2016-10-12 00:21:12 +02:00
Michael Natterer dc0ffa4891 Bug 764024 - Allow to choose fill color when resizing layers and images
Add a fill type combo to the crop tool options, only visible
when "Allow enlarging" is checked.
2016-10-10 00:21:36 +02:00
Michael Natterer 997ae1e28b Bug 764024 - Allow to choose fill color when resizing layers and images
Add a GimpFillType argument to GimpItem::resize() and fill type
widgets to the canvas and layer resize dialogs. Fill the new parts of
the drawable according to fill type in gimp_drawable_resize(). Make
sure places that need the old behavior get GIMP_FILL_TRANSPARENT
passed by hardcoding it in the GimpItem::resize() implemetations of
channel, mask, selection etc.
2016-10-10 00:02:16 +02:00
Michael Natterer be6a47e750 app: some more cleanup in IScissors
Move quite some code to new functions of ICurve, preparation for
getting rid of a bunch of outstanding IScissors inconsistencies with
other tools.
2016-10-09 17:19:42 +02:00
Michael Natterer 6ca9ebdb95 app: remove the dynamic programming buffer from the GimpIscissorsTool struct
It's only used in one function and recreated each time, so create and
destroy it locally.
2016-10-07 01:58:37 +02:00
Michael Natterer 152c5a2c44 app: change most of Iscissors to use a GimpPickable not a GimpImage
This is just cleanup and enables adding a mode that doesn't behave like
"sample merged".
2016-10-07 01:18:16 +02:00
Michael Natterer fbb6b5d425 app: cleanup in GimpFreeSelectTool
Mainly reduction of excessive micro utility functions by folding them
into their single (or two) caller(s). A bit more readable now.
2016-10-06 22:44:07 +02:00
Simon Budig e1b31bd37e vectortool: one more explaining message. 2016-10-02 20:04:46 +02:00
Michael Natterer 713e4071b2 Bug 770911 - Move tool should display relative coordinates in statusbar...
...when moving guides

Show relative coordinates when moving guides and sample points, the
cursor display in the statusbar already shows absolute coordinates.
2016-10-01 22:45:51 +02:00
Michael Natterer 062df6bd09 Bug 772025 - Incomplete toolrc file causes GIMP to hang
gimp_tools_restore(): print the error message when parsing toolrc fails.
2016-09-28 14:53:42 +02:00
Michael Natterer 0932386d1b app: add a callback to the stroke dialog
and move the actual stroking code to select-commands.c,
vectors-commands.c and gimpvectorstool.c. Remember the active drawable
so the stroke always happens on the drawable the dialog was invoked
with.
2016-09-27 11:15:52 +02:00
Simon Budig 75853eec01 fix typo 2016-09-27 02:27:09 +02:00
Simon Budig c333a04f18 gimpwarptool: use the linear sampler for the warp tool to ensure crisp lines after an erase. 2016-09-27 00:37:42 +02:00
Michael Natterer ea98f9967e app: change gimp_pickable_auto_shrink()'s parameters
from x1, y1, x2, y2 to x, y, width, height.
2016-09-25 22:40:28 +02:00
Michael Natterer 9bb33914bf app: set tooltips on the tool options' brush, gradient etc edit buttons
Also make the tooltips of the edit buttons of the brush, gradient etc
dialogs consistent.
2016-09-17 17:10:20 +02:00
Michael Natterer 572d556643 Bug 553855 - Bucket fill colour is always blended with filled pixel colour...
...when threshold > 0

Add an "Antialias" toggle to the bucket fill options and set it on the
GimpFillOptions. In gimp_drawable_bucket_fill(), pass it to
gimp_pickable_contiguous_region_by_seed() instead of always defaulting
to TRUE.

The position of the toggle and its huge tooltip may need some
adjustment.
2016-09-15 12:24:37 +02:00
Michael Natterer 4df9a1d568 Get rid of gtk_misc_set_alignment(label) and use gtk_label_set_x,yalign() 2016-09-08 19:11:20 +02:00
Jehan 6c674e973c app, libgimp*, plug-ins, icons: revert icon names into freedesktop...
... standard icon names and GTK+ icon names as second choice.
We should only use GIMP specific icon names as last resort, when there
is no standard or GTK+ names dedicated to the function.
This is made possible thanks to commit 3cc77b0.

s/gimp-document-recent/document-open-recent/
s/gimp-indent/format-indent-more/
s/gimp-next/go-next/
s/gimp-previous/go-previous/
s/gimp-save/document-save/
s/gimp-save-as/document-save-as/
s/gimp-revert/document-revert/
s/gimp-open/document-open/
s/gimp-document-recent/document-open-recent/
s/gimp-quit/window-close/ ou s/gimp-quit/application-exit/
s/gimp-warning/dialog-warning/
s/gimp-edit-clear/edit-clear/

s/gimp-justify-.*/gtk-justify-.*/
s/gimp-font/gtk-select-font/
s/gimp-color-palette/gtk-select-color/
s/gimp-cancel/gtk-cancel/
2016-09-03 15:49:29 +02:00
Massimo Valentini fa621d60bb Bug 768952: Select by color works correctly only in srgb
pass to pickable_contiguous_region_by_color the
color in the same color space as the pickable.
2016-07-19 18:05:09 +02:00
Massimo Valentini aa293ae9a7 Bug 675748: Text tool: text editor inhibits text...
...selection on the canvas

if the editor dialog is active do not copy to the
clipboard the text selected, copy it instead when
selected with keys <Shift>-left/right.
2016-07-16 16:28:35 +02:00
Michael Natterer a96c273621 app: add smarter soft boundaries for GimpSpinScale widgets
Pass a GeglRectangle to all gimp_prop_gui_*() functions, and set
the soft limits to the rectangle's extents if the GParamSpec
metadata's "unit" is "pixel-coordinate" or "pixel-distance".

In GimpSymmetryEditor, pass the image extents, in GimpOperationTool
pass the drawable extents.
2016-07-06 12:19:40 +02:00
Massimo Valentini b37ca78151 Bug 768086: Inconsistent text-layer focusing from text style editor
do not place cursor when it is already there
2016-06-28 18:15:52 +02:00
Massimo Valentini ee860a0c30 Bug 767935: Foreground Select Freezes Gimp if accidentally...
...clicking outside canvas
2016-06-27 17:25:01 +02:00
Massimo Valentini 1e07de1858 app: remove empty text layer when it becomes inactive
only if auto_rename is TRUE and text->box_mode is not
FIXED
2016-06-27 16:48:19 +02:00
klausstaedtler 022cd64105 icons: Bug 759904
add
gimp-intend

patch
gimptextoptions.c
gimpicons.c
gimpicons.h
2016-06-10 13:50:44 +02:00
Jehan a1f0197098 app: do not commit IM preedit text after switching text layer.
Whereas some IME would just cancel any preediting on IM context reset,
others would commit their preedit (for instance Ibus-Hangul).
Unfortunately it is not necessarily immediate, even after
gtk_im_context_reset() and gtk_im_context_focus_out(), so when switching
text layer, any preedit text is committed on the new layer.
Let's recreate the IM context on abort to make sure we don't share any
input between text layers.
2016-06-06 15:03:20 +02:00
Jehan 97b537d496 app: remove preedit text on abort.
The IM should be the one taking care of it by sending the proper
signals, and I would assume this should be done when we run:
gtk_im_context_focus_out ().
But it doesn't and leaves a dangling styled preedit text on leaving
a text layer, either because the IME is not properly implemented (not
reacting to the context leaving the focused widget), or GTK+2 is bugged,
or maybe we just don't understand exactly how this all works. Anyway
let's explicitly clean preedit text, not waiting for preedit-end or
commit signals on IM abort.
2016-06-06 15:03:20 +02:00
Jehan bea4b5e4db app: the preedit_end mark must be created with right gravity.
With left gravity, the mark is moved back 1 character to the left of the
cursor, whereas with right gravity, it is right after newly-inserted
text. This resulted sometimes into non-deleted preedit characters.
I don't understand all the subtleties since the problem only occurred
for the first character of a text layer, at least in my tests.
Anyway now it should be good.
2016-06-05 23:20:06 +02:00
Jehan 7b9a7439dc Bug 767269 - Japanese IM undoes too much.
Japanese IME emits the preedit-commit before preedit-end (Hangul or
Unicode don't, but we could assume other IMEs may be doing the same).
As a consequence, the undo step was not pushed, thus breaking undo
history and consistency.
The solution is to simulate preediting end then restart when a commit
happens during preediting.
2016-06-05 21:54:29 +02:00
Jehan acc570d929 app: code reorganization in gimptexttool.c.
Since commit b593462, gimp_text_tool_apply() is a semi-public function
(only to be used from gimptexttool-editor.c). Therefore move it to the
"public functions" section.
2016-06-05 21:06:29 +02:00
Jehan b5934625de Bug 751333 - Crash when moving cursor with ibus "Hangul" input method.
Commit cd147a4 reintroduced the crash. The culprit was the idle function
gimp_text_tool_apply_idle() which may not have been processed when
gimp_text_tool_move_cursor() is called, resulting in inconsistencies
between the text in the text tool's pango layout and its buffer.
Force any pending text commits to be applied before moving the cursor.
2016-06-05 21:04:18 +02:00
Michael Natterer cd147a4a48 app: fix various undo- and preedit-related text tool issues
In the text tool editor code, connect to GtkIMContext::preedit-start
and introduce a boolean text_tool->preedit_active which indicates that
a preedit is going on.

Remove the new preedit-removal code from gimp_text_tool_reset_im_context()
because it was not reflecting the IM's internal state and made things
worse. Instead, added gimp_text_tool_abort_im_context() which really
gets rid of any ongoing preedit by force.

In the main text tool code, check for preedit_active and if TRUE,
apply any edits directly widhout pushing undo steps. Factored out
gimp_text_tool_apply_list() for that purpose in order not do
duplicate a lot of code.

On undo and on button_press, force-abort any ongoing preedit. This is
the right thing to do on undo, but not really on button_press, but I
don't see another way to keep states consistent.
2016-06-05 16:36:56 +02:00
Michael Natterer fe12bc8ed1 app: factor out a bunch of code in gimptexttool-editor.c
The new gimp_text_tool_im_delete_preedit() also makes sure that
text_tool->preedit_string is non-NULL when modifying the buffer,
so it can be used as indication whether or not a preedit is
going on (in order to skip undo stuff while preediting).
2016-06-05 00:04:01 +02:00
Jehan 8a37c928eb app, plug-ins, libgimp*: clean out all remaining trailing spaces/tabs.
Rather than just discovering them by chance, a simple grep and some
search and replace are much more efficient! :-)
Cleaning only done on C and automake files.
2016-06-02 02:04:26 +02:00
Jehan cd641fa14f app: create separate tag lists for IME preedit colors.
In particular, I don't want the preedit foreground colors to be
displayed in the text style editor UI. They are only temporary hints
and should not be taken into account as user-chosen style.
2016-06-01 17:44:03 +02:00
Jehan a86b0cf0a2 app: create a different tag for underlined text during preedit.
It still shows up as underlined during preedit, but does not toggle the
underline button in the style editor.
2016-06-01 17:43:56 +02:00
Jehan 2cfed0cb52 app: IM preedit displayed as expected.
When gtk_im_context_get_preedit_string(), we have to inspect the
returned Pango attributes, so that the preedit string can be displayed
in the expected fashion (i.e. as in other programs).
Some input methods in particular would even break the preedit strings
in several chunks of text displayed differently (for instance Japanese),
depending on the cursor position within the preedit string.
2016-06-01 17:43:38 +02:00
Jonathan Tait 6e900c5bbb Bug 755005 - Align Tool > Distribute - vertical offset is missing 2016-06-01 00:31:03 +02:00
Michael Natterer ca990287a7 app: set the color config on the color picker tool dialog's color area 2016-05-31 12:51:14 +02:00
Michael Natterer 2ef8719cbe app: rename more stuff from "floating sel" to "floating selection" 2016-05-20 16:46:26 +02:00
Michael Natterer 201b11e230 app: add separate opacity and mode API to GimpDrawableFilter 2016-05-18 09:47:58 +02:00
Michael Natterer 13b1e6aafc app: clean up a lot of werid code in GimpColorOptions and GimpFilterOptions
First of all, derive GimpFilterOptions from GimpColorOptions, not the
other way around, which was a sick way of magically showing the right
options for various tools. That approach has failed and needed
additional hacks to do the right thing. Simply have the right class
hierarchy and call the right tool options GUI constructors and done.

Remove gimp_histogram_options_gui(), we don't need histogram scale
controls in tool options when we already have them next to the
histograms in the tool dialogs.

Also remove gimp_histogram_options_connect_view() and use a simple
g_object_bind_property() instead.
2016-05-13 22:06:14 +02:00
Massimo Valentini 81e7cb6ba5 Bug 766342: EEEEeEeek! 4 GeglBuffers leaked 2016-05-13 13:13:22 +02:00
Michael Natterer 9fb70a44f2 app: rename GimpImageMap to GimpDrawableFilter
and gimpdrawable-filter.[ch] to gimpdrawable-filters.[ch] because of
the name clash.
2016-05-12 01:49:53 +02:00
Michael Natterer f7c104c6ae app: use gegl:distance-transform in the blend tool, it has a progress now
Also, don't start the progress in GimpBlendTool, let
gimp_gegl_progress_connect() do its job.
2016-05-12 00:14:35 +02:00
Michael Natterer e7d2edb665 app: connect to the new operation progress in GimpFilterTool 2016-05-11 22:51:58 +02:00
Michael Natterer b10fd2aa30 app: use the proper help ID in gimp_operation_tool_get_settings_ui()
GimpFilterTool has the right help ID since a while, no need to
use a dummy help ID aly longer.
2016-05-11 14:38:33 +02:00
Michael Natterer 9bb03073b6 app: turn the "Gamma Hack" into a non-serializable property
To make it at least behave like other widgets in the dialogs while it
exits.
2016-05-11 14:33:08 +02:00
Michael Natterer 7d1567cae0 app: move tool undo typedefs out of tools-types.h 2016-05-11 11:23:14 +02:00
Michael Natterer 059a92b4b6 app: rename "image_map" member of GimpFilterTool to "filter" 2016-05-11 10:19:50 +02:00
Michael Natterer 3bd783283e app: change the prefs property from image-map-tool-max-recent to filter-tool
but still parse the old property too.
2016-05-11 01:03:40 +02:00
Michael Natterer 67e192e77b app: remove gimp_filter_tool_preview()
Its remaining two callers are more obvious when doing a simple call to
gimp_image_map_apply() manually.
2016-05-10 15:57:49 +02:00
Michael Natterer 6a9ce551cb app: rename GimpImageMapTool to GimpFilterTool 2016-05-10 13:52:24 +02:00
Michael Natterer 68936e4cc2 app: don't preserve() GimpImageMapTool around most GimpImageMap calls
It's useles ever since we ported GimpImageMap to GEGL.
2016-05-09 21:48:16 +02:00
Michael Natterer 477987dce3 app: make GimpImageMap a subclass of GimpFilter
Reduces members and all sorts of duplication and is a much better
abstraction of what it does. Also make it a lot smarter and
self-updating, chop up the apply() function and move its parts where
they belong. Also, it's now aware of selection changes and does the
right thing.

Don't abort GimpImageMapTool on selection changes, it now nicely
handles that.
2016-05-09 21:40:20 +02:00
Michael Natterer 9bb6d19f6c app: remove a call to gimp_image_map_apply() from GimpBlendTool
It's not needed any longer after gimp_image_map_set_mode().
2016-05-09 01:49:32 +02:00
Michael Natterer 288cf2c0cc app: remove most calls to gimp_image_map_tool_preview()
see commit below, they are not needed any longer. Also call
gimp_image_map_tool_preview() from gimp_image_map_tool_create_map()
and remove more other calls to preview().
2016-05-09 01:41:02 +02:00
Michael Natterer c77357053c app: make gimp_image_map_tool_preview() private
- call it in gimp_image_map_tool_get_operation() so
  gimp_operation_tool_set_operation() doesn't need to call it

- gimp_image_map_tool_settings_import() doesn't need to call it because
  importing settings changes the config object anyway
2016-05-09 01:21:03 +02:00
Michael Natterer c6c458a2eb app: don't call gimp_image_map_tool_preview() in GimpOperationTool
Instead, emit "notify" in the config object, which is a hack,
but a temporary one. If should be the right code tho, if only
Gegl pads would be normal properties...
2016-05-09 01:07:21 +02:00
Michael Natterer 8eb6cdf488 app: pass profiles around along with the buffers in the transform code
"transform" as in flip, rotate, affine. Same reasoning as in the
gimp_selection_float() commit below.
2016-05-08 18:35:40 +02:00
Michael Natterer a659036b40 app: switch the list of tools to using "append" mode
and ret rid of registering tools in reverse order, and reversing the
list after deserializing it.
2016-05-01 16:05:44 +02:00
Michael Natterer 39909b6008 app: replace GimpList's internal GList with a GQueue
so we can easily iterate in reverse order, and access the last element
in O(1). Nothing makes use of this yet.
2016-05-01 15:22:44 +02:00
Thomas Manni f4cb2dd881 Bug 109161 - Improve Histogram with Luminance Channel
Add a luminance channel to GimpHistogram
2016-04-18 19:35:06 +01:00
Jehan f3d6dd356d app: indentation cleanup.
Replace tabs with spaces.
2016-04-16 19:08:13 +01:00
Jehan 0fcfd4f7b7 Bug 751333 - Crash when moving cursor with ibus "Hangul" input method...
... and improve input method UI. IM should not use some floating overlay
frame to display the preedit text. Instead it is now directly inserted
into the text tool box, as selected text. It permits redimensionning of
the text box while typing, and push the rest of the text when inserting
in the middle (instead of superimposing an overlay box over the current
text box, making everything unreadable).
Input methods still have a few more issues, but this fixes the main UI
weirdness as well as the crash with Hangul IM.
2016-04-16 14:24:54 +01:00
Michael Natterer 020b524e59 app: add gegl:gegl to Filters -> Generic
Also fix packing of the operation GUI in GimpOperationTool,
so the text box can expand.
2016-04-16 03:18:29 +01:00
Michael Natterer a638a30f8d app: use gimp_gegl_config_connect_node() in GimpImageMapTool
And remove all explicit node syncing, which also removes the need for
gimp_image_map_tool_map().
2016-04-16 03:02:05 +01:00
Michael Natterer 70a81412b4 app: keep the split preview guide always movable
Change things so the guide is preferred over any color picking
interaction of the parent GimpColorTool. Needs a minor change in the
GimpCurvesTool subclass too.
2016-04-14 19:25:59 +01:00
Michael Natterer 8f8da22389 Bug 764630 - Preview curtain: can there be a switch "left/right"...
...for the preview?

Change to allow for split previews in all 4 directions. Remove the
direction controls from the filter dialog, and instead implement
shift- and control-clicking on the split guide to switch
original/filtered sides, or orientation.
2016-04-14 02:34:45 +01:00
Michael Natterer 240fe3b16e app: allow to switch the split preview between horizontal and vertical 2016-04-06 21:09:57 +02:00
Michael Natterer 823fddfba3 app: remove some leftover empty function cruft from GimpImageMapTool 2016-04-05 20:44:43 +02:00
Michael Natterer 3e833b9a5c app: change the cursor when the mouse hovers the split view guide 2016-04-05 20:26:05 +02:00
Michael Natterer b81c725c6d Bug 764589 - Flip Tool: Use "Transform" and "Direction" instead...
...of "Affect" and "Flip Type"
2016-04-05 18:59:18 +02:00
Michael Natterer 112dd804bc app: add a "split preview" feature to GEGL ops that can be dragged around
We also commonly call this "preview curtain".
2016-04-04 22:19:30 +02:00
Michael Natterer 28a91b045f app: change GimpGuideTool to live-move custom guides
As in, move the guide along with the mouse, don't draw a tool line and
move the guide on button release.
2016-04-04 22:09:51 +02:00
Michael Natterer 7889ec08f7 Bug 668016 - Accidentally clicking ruler loses active tool's state
Add two new tools, GimpGuideTool and GimpSamplePointTool. They are
one-trick-ponies and can only create new or move existing guides and
sample points. They can't be selected from the toolbox, only
temporarily pushed as active tools on top of any active tool using
their public start() APIs.

Use that API to enable them when the rulers are clicked, and replace
the entire guide and sample point moving code in GimpMoveTool and
GimpColorTool by simple calls to that API.

This might look like overkill but can easily be used for other
features like moving guides from within the paint tools (mirror
painting) or gegl filters (preview curtain).
2016-04-03 16:41:42 +02:00
Michael Natterer 7529fd987c app: change GEGL op GUI generation so widgets can expand vertically
Currently we only expand scrolled windows, which are used for
multiline text properties' GtkTextViews.
2016-03-26 20:28:24 +01:00
Michael Natterer 47ef3be145 Initialize GValues with G_VALUE_INIT instead of { 0, } 2016-03-26 15:59:26 +01:00
Massimo Valentini de4bc99448 Bug 763135 - Gimp cage tool doesn't work anymore
Fix various bugs, most importantly make sure the cage node is
properly updated when the config changes.
2016-03-23 23:00:48 +01:00
Michael Natterer 2229d0aed8 Bug 740939 - No shortcut actions for changing tool's spacing, hardness and force
Add generic tool actions for spacing, hardness and force, and the
GimpToolControl infrasctructure to redirect them to tool-specific
actions. Add tool-specific actions for GimpBrushTool, GimpMybrushTool
and GimpWarpTool as redirect targets. Also fix some existing tool
action callbacks to use the right increase/decrease steps.
2016-03-22 23:54:40 +01:00
Michael Natterer c6d5ca8977 app: remove GimpImageMapTool::get_operation() impl from GimpGeglTool
it was doing absolutely nothing any longer.
2016-03-19 22:29:31 +01:00
Michael Natterer 041659a2ab app: remove the recent_settings container from GimpImageMapToolClass
and use gimp_gegl_config_get_container() locally where needed. This
also removes some special code from gimpoperationtool.c.
2016-03-19 22:06:13 +01:00
Michael Natterer c09a724bda app: change parameters of gimp_fill_options_new()
to be the same as of gimp_stroke_options_new() because it's about to
be needed for the same purposes.
2016-03-15 20:10:16 +01:00
Michael Natterer 3b6ab62c1e app: remove boolean return value from gimp_edit_clear() and gimp_edit_fill() 2016-03-11 22:41:25 +01:00
Michael Natterer d71f53dfe9 app: change gimp_drawable_bucket_fill() to use GimpFillOptions
and get rid of gimp_drawable_bucket_fill_internal().
2016-03-11 22:05:33 +01:00
Michael Natterer e1e77f88fa app: change gimp_edit_fill() to take a GimpFillOptions
instead of a long list of parameters. Get rid of gimp_edit_fill_full().
2016-03-11 19:55:50 +01:00
Michael Natterer f2d581a536 Bug 761170 - Warnings building with clang
Fix a bunch of clang warnings.
2016-02-12 22:49:47 +01:00
Michael Natterer e5b6806fe2 app: port tons of files to the new GIMP_CONFIG_PROP_FOO() macros
and remove lots of labels from calls to gimp_prop_foo_new(). Also
had to manually remove some unwanted labels that are now added
automatically, fixes bug #761880.
2016-02-11 23:46:24 +01:00
Michael Natterer 3ac3dcde48 app: add a GParamFlags parameter to gimp_prop_gui_new()
If non-0 flags are passed, create widgets only if the GParamSpec flags
have all the passed flags.
2016-02-06 01:04:40 +01:00
Michael Natterer 46da951b85 app: add an offset to GimpDisplayShell's mask
and set that offset in GimpRegionSelectTool when not in sample_merged
mode. Fixes live selection mask display for layers with a non-zero
offset.
2016-02-05 21:21:52 +01:00
Jehan e01d56969d app: move all guide styling to gimpcanvas-style. 2016-02-03 19:38:32 +01:00
Michael Natterer 3415d22e58 app: some cleanup in the new symmetry code, mostly harmless 2016-02-03 14:29:23 +01:00
Michael Natterer 023a732a3e app: simply call gimp_image_map_commit() in gimp_blend_tool_commit()
so the already computed result is used and not completely regenerated.
2016-02-03 00:22:15 +01:00
Jehan b8fadf3ad7 app: add a "custom" guide concept.
With gimp_guide_custom_new(), you can create a custom guide with a different
style on canvas (other pattern/color/width). A custom guide won't be saved
and could be used, for instance, for specific GEGL op guiding.
2016-02-02 21:15:13 +01:00
Michael Natterer 589dd3d485 app: rename gimp_blend_tool_update_preview_coords() to _update_graph() 2016-02-02 01:25:42 +01:00
Michael Natterer 49b4d6a220 app: clean up the blend-tool-fun branch to be usable on master
which essentially means some cleanup and no more regressions:

- add state POINT_BOTH for moving the entire line
- use the move cursor for moving the entire line
- reorder some functions
- set the tool to handle click events
- make clicks and no-motion releases behave properly
- #if 0 the code for "shapeburst handles", they don't work yet
- return to gimp:shapeburst until we have figured progress for GEGL ops
- indentation, stuff...
2016-02-02 00:46:42 +01:00
Michael Henning f545b7fe72 app: Place shapeburst buffers at the right offset. 2016-02-01 21:20:19 +01:00
Michael Henning 2cee41aabd app: Add shapeburst handles to the blend tool. 2016-02-01 21:20:19 +01:00
Michael Natterer 92bd0fb7e4 app: change minimum value of GimpBlendOptions::supersample-depth to 1
The old minimum of 0 resulted in a "subpixel" size of 1 which doesn't
make much sense.
2016-02-01 20:29:39 +01:00
Michael Natterer 6aa6406416 app: clean up tool_manager_tool_changed() a bit 2016-01-25 12:18:44 +01:00
Michael Natterer d2d2920af6 app: fix changing tools to not prematurely change the old tool
Commit the old tool before even creating the new tool. Old and new
tool might be the same and share tool options, and we don't want
the new tool's initialization to mess up the old tool's state.

Fixes changing from one GEGL operation to another without explicitly
confirming the first operation. The bug only killed the cached filter
result, but that's bad enough.
2016-01-25 02:56:10 +01:00
Michael Natterer 6a2f200b34 app: rename more variables to "im_tool" in GimpImageMapTool 2016-01-25 02:56:10 +01:00