Commit Graph

17886 Commits

Author SHA1 Message Date
Michael Natterer f54197b680 app: use gimp_item_bounds() instead of gimp_channel_bounds() in actions/ 2015-07-03 19:38:07 +02:00
Michael Natterer 64e506a052 app: test-ui.c: use gimp_channel_is_empty() to check for a selection 2015-07-03 19:38:07 +02:00
Michael Natterer 731cfc7532 app: use gimp_item_bounds() in test-xcf.c 2015-07-03 19:38:07 +02:00
Michael Natterer e64e9d0599 app: use gimp_channel_is_empty() not gimp_channel_bounds() in xcf_save_image()
We are not interested in the selection bounds, only if there is a
selection at all.
2015-07-03 19:38:07 +02:00
Michael Natterer 1aa382e594 app: remove the GIMP_IS_CHANNEL() case from gimpimage-arrange.c
The object offset is calculated correctly for channels in the
GIMP_IS_ITEM() case using gimp_item_bounds().

Also did some general formatting cleanup in the entire file.
2015-07-03 19:38:07 +02:00
Michael Natterer 658a7834fe app: remove public function gimp_vectors_bounds()
and move its code into the GimpItem::bounds() implementation.
2015-07-03 19:38:06 +02:00
Michael Natterer 7e90a3e4e5 app: use gimp_item_bounds() instead of gimp_vectors_bounds() 2015-07-03 19:38:06 +02:00
Michael Natterer 4edf70f4f1 app: add virtual function GimpItem::bounds()
Which returns a boolean indicating if there is content at all, and the
bounds as double x, y, width, height because for most use cases that's
better than x1, y1, x2, y2. Wrap the method with two functions
gimp_item_bounds() which returns integer bounds and
gimp_item_bounds_f() which returns the original double bounds.
2015-07-03 19:38:06 +02:00
Michael Natterer bc525f39ee app: factor out a function in GimpEditSelectionTool, and move one around 2015-07-03 19:38:06 +02:00
Michael Natterer 4552319336 pdb: fix plug-in-autocrop compat wrapper to work like in 2.8
even if it's weird, compat is compat...
2015-07-03 17:59:08 +02:00
Michael Natterer fc0d253744 app: always return the rectangle values from gimp_pickable_auto_shrink()
If there is nothing to shrink, return the passed rectangle clamped
to the pickable's extents.
2015-07-03 17:52:34 +02:00
Michael Natterer a3437285ae app: #include "core/gimpimage-profile.h" in image-commands.c 2015-07-03 12:41:29 +02:00
Michael Natterer 3daa2ab96b app: #include "gimplayer-new.c" in tests/ where needed 2015-07-03 12:36:33 +02:00
Michael Natterer 7d220a56e0 app: free GimpEditSelectionTool's stuff in finalize() 2015-07-03 12:27:08 +02:00
Thomas Manni 82223783a3 plug-ins, pdb: remove the bump-map plug-in and add 2 PDB compat procs 2015-06-30 12:02:48 +02:00
Thomas Manni 3436ae4674 plug-ins, pdb: remove the displace plug-in and add 2 PDB compat procs 2015-06-30 10:02:28 +02:00
Michael Natterer e669c6dd05 Bug 750874 - Displayed colors look clipped after profile conversion...
...but they aren't clipped

gimp_display_shell_profile_can_convert_to_u8(): allow the shortcut of
converting directly to 8-bit for display only for GIMP_COMPONENT_TYPE_U8.

This might be an lcms bug, the code can be enabled again for U16 and
U32 if it's indeed an lcms bug and it gets fixed.
2015-06-29 10:22:22 +02:00
Michael Natterer 3d7af8a184 app: remove the "exclude" paameter from gimp_image_item_list_get_list()
and from gimp_image_item_list_filter(). After the fixes for bug 735906
it's no longer needed, and it was harmful.
2015-06-28 23:49:47 +02:00
Michael Natterer 358f13f5b8 Bug 735906 - Transform tools give unexpected results when transforming...
...certain sets of linked layers

Fix the move tool (GimpEditSelectionTool) using the same principle
as the other "linked item" features, just a bit more complicated...

Never translate the active item and its linked items separately,
always translate the entire list at once.

The linked logic was distributed across the entire file. Changed the
code to prepare lists of items that are translated live (layers and
vectors), and items that are translated at the end (channels, masks
and the selection). In the motion and button release functions, simply
use the prepared lists without any further duplicated checking.

Also clean up the stuff a bit, there is more cleanup needed but first
the fix...
2015-06-27 12:34:19 +02:00
Michael Natterer a13c63a3f1 app: don't push an undo group if an item list transform has only one item
The fixes for bug 735906 made it push too many undo groups.
2015-06-26 13:37:18 +02:00
Michael Natterer 3c706d00c6 Bug 735906 - Transform tools give unexpected results when transforming...
...certain sets of linked layers

Fix for translating layers from the PDB, and with the cursor keys
for gimpeditselectiontool. Moving layers with the mouse is still broken.

The approach is exactly the same as in 25a696c7.
2015-06-26 12:00:45 +02:00
Michael Natterer 25a696c7f8 Bug 735906 - Transform tools give unexpected results when transforming...
...certain sets of linked layers

Fix this bug for flip, rotate and general transforms (not for move yet):

gimp_item_linked_flip,rotate,transform(): always transform the passed
item too (do not filter it out of the list of items), so these functions
do the entire job of transforming a linked group now. Transforming the
active item separately didn't work (and is not implementable) if both
a layer and its parent layer group were linked.

flip tool, transform tool, layer->transform callbacks: don't call
gimp_item_foo() *and* (if the item is linked) gimp_item_linked_foo().
Instead call gimp_item_linked_foo() if the item is linked, and
gimp_item_foo() otherwise.

This commit also kills the mis-feature of transforming the selected
pixels of the active layer, and then the linked items completely. We
now either only transform the selected area *or* the linked group.
2015-06-25 12:25:41 +02:00
Michael Natterer b12ecc7195 app: small fix for the previous patch in gimp_group_layer_update_size() 2015-06-24 19:40:54 +02:00
Michael Natterer 953fa220a9 app: emit signals *after* gimp_drawable_real_set_buffer() changed the graph
Fixes another group layer update problem. Also freeze/thaw notify
emissions around the whole function.
2015-06-24 16:26:45 +02:00
Michael Natterer 2f8476bd18 app: fix update of group layers when size changes only trigger an offset change
In gimp_group_layer_update_size(), when the new size happens to be the
same as the old size, we need to call gimp_pickable_flush() on the
group projection so it is ready to be used for rendering the image,
just like in gimp_group_layer_stack_update().
2015-06-23 10:27:47 +02:00
Michael Natterer e58bf5138f Bug 751333 - Crash when moving cursor with ibus "Hangul" input method
Had a closer look at GtkTextView again and implemented the IM
callbacks like there. I don't know if this fixes the bug, please test.
2015-06-22 22:54:16 +02:00
Massimo Valentini f0028624df Bug 751178: GIMP doesn't load fonts from folders...
which path contains Cyrillic characters
2015-06-22 19:40:25 +02:00
Michael Natterer 6d6efbbf8b app: remove "remove_children" parameter from gimp_image_item_list_filter()
It was always TRUE. The function should be renamed now, but not until
the merging of linked item fixes to 2-8 is done.
2015-06-20 21:59:37 +02:00
Michael Natterer 64b24d169d app: remove "remove_locked" parameter from gimp_image_item_list_filter()
This is just removal of unused code before fixing bug 735906.
2015-06-20 16:03:40 +02:00
Michael Natterer 09cd5f6720 app: add ICC data/length parameters to gimp_layer_new_from_gegl_buffer()
and pass them where we know the buffer could be from another image.
Pass "NULL, 0" if we know it's the same image.

Add gimp_layer_new_convert_profile() which takes the newly created
layer and the ICC data/length; call it from both
gimp_layer_new_from_gegl_buffer() and gimp_layer_new_from_pixbuf().

gimp_layer_new_convert_profile() is empty, this is just
infrastructure.
2015-06-20 00:39:44 +02:00
Michael Natterer 6446c007cf app: rename gimp_layer_new_from_buffer() to gimp_layer_new_from_gegl_buffer()
and add new function gimp_layer_new_from_buffer() which takes a
GimpBuffer. This will make sense soon :)
2015-06-20 00:02:11 +02:00
Michael Natterer 7d4948b190 app: use gimp_create_image_from_buffer() to create the debug image graph 2015-06-19 23:49:41 +02:00
Michael Natterer db09d0f3d3 app: move functions to create layers to new files gimplayer-new.[ch] 2015-06-17 13:21:01 +02:00
Michael Natterer fd86deb998 Bug 723392 - Pasting an image replaces color profile with default one
In gimpimage-new.c, tag new images with the source buffer's, pixbuf's
and drawable's color profile.
2015-06-17 09:55:08 +02:00
Jehan 123c605da7 app: trim out trailing whitespaces from item names.
Trailing whitespaces are a bother because they are not easily spotted
and there are no good reasons to have any on an item name.
2015-06-17 00:54:21 +02:00
Michael Natterer 3b88a346f1 app: use the new gimp_image_get_icc_profile() instead of _get_icc_parasite()
in gimp_image_color_managed_get_icc_profile().
2015-06-17 00:49:59 +02:00
Michael Natterer bf10da29fa app: remove GError** argument from gimp_image_get_color_profile()
we validate everything when setting it, so this function always
returns either a valid profile, or NULL.
2015-06-17 00:45:43 +02:00
Michael Natterer 8676fba635 app: add gimp_image_get,set,validate_icc_profile()
which use the ICC profile's data/size, without parasites involved.
2015-06-17 00:38:49 +02:00
Michael Natterer ee2f9ee846 app: rename gimp_image_get,set,validate_icc_profile() to _icc_parasite()
to make sure we don't have some _icc_profile() functions that deal
with raw data/size and some that deal with GimpParasite.
2015-06-16 23:56:53 +02:00
Michael Natterer a159740498 app: use the new function in gimp_buffer_new_from_pixbuf() 2015-06-16 23:44:49 +02:00
Michael Natterer 26e2ccbdf3 app: tag GimpBuffers with an ICC profile, if available
Set the profile when the buffer is copied from a layer, and when it's
created from a GdkPixbuf from the clipboard. The profile is not yet
used for anything.
2015-06-16 23:16:54 +02:00
Jehan 56b6dbaa87 app: item uniquefy algorithm allowing generic numbering schemes.
Any item ending with numbers (optionally followed by spaces) would
trigger incremental counting, not only hashed numbers.
2015-06-16 20:12:24 +02:00
Michael Natterer aeb2a6e4ff Bug 646511 - Having the possibility to remove ICC profiles
Add Image -> Color Management -> Discard Color Profile which simply
removes the profile without any conversion.

Also added actions and callbacks for "Assign" and "Convert" but these
are only stubs to be filled as replacement for the remaining code in
the lcms plug-in.
2015-06-15 20:19:32 +02:00
Michael Natterer ba1318dda9 app, menus, plug-ins: add new Submenu Image -> Color Management
and move the color profile menu entries there. Add a mapping so 3rd
party plug-ins get moved to the new location automatically.

Also, add a separator after "Duplicate" and move the "Transform"
submenu to the top of the group that has "Scale", "Resize" etc.
2015-06-15 13:20:04 +02:00
Michael Natterer 014cd08c5c Bug 750953 - The Curves dialog should present per channel lines...
...when opened by the "Edit these settings as Curves" button on the
Levels dialog

The code to configure the entire GUI correctly was not even called
when initially creating the curves dialog (the color bars probably
looked right just because of default values of their own).

Factor out gimp_curves_tool_update_channel() which properly updates
the GUI. Call it after the dialog has been created, and when the
active channel changes.
2015-06-15 00:11:13 +02:00
Michael Natterer 5422646d91 Bug 750674 - Stroke selection doesn't honor brush size set in paint tool options
Implement GimpConfigInterface::duplicate() and after duplicating the
paint options, copy the brush-related properties again, because they
might have been changed by setting the brush on the copy (if they are
set to be linked to the brush's native values).
2015-06-14 20:43:45 +02:00
Michael Natterer 797acd0027 app: don't leak the copied paint options in gimp_stroke_options_prepare() 2015-06-14 20:42:00 +02:00
Jehan 0aae50cfe2 Bug 750556 - validate a tree cell modification on focus out.
For instance, modifying a layer and going directly to draw in the canvas
should not cancel the layer name.
You can still cancel a layer renaming in progress with ESC.
2015-06-14 14:03:16 +02:00
Michael Natterer 6487d0a26a app: move the seamless clone tool to the playground
It's not release material unless somebody comes and fixes its bugs,
and its speed.
2015-06-14 13:02:31 +02:00
Michael Natterer c876e281b1 Bug 750874 - Displayed colors look clipped after profile conversion...
but they aren't clipped

Add gimp_display_shell_profile_can_convert_to_u8() which returns
whether the lcms transform can safely write directly into an u8 buffer
without destroying out-of-gammut pixel values, which we assume is the
case for all integer formats. If the function returns FALSE, always
convert via the R'G'B'A float filter_buffer.

Also connect to the image's "precision-changed" signal and update the
profile transform when it's emitted.
2015-06-13 00:27:21 +02:00