Commit Graph

4844 Commits

Author SHA1 Message Date
Michael Natterer 88b60e9947 app: make gimp_edit_paste() do what its told to do
Don't change the paste_type to NEW_LAYER just because there is a
complex thing in the clipboard. Instead, honor the request to paste
FLOATING or FLOATING_INTO and reduce the pasted thing to a simple flat
layer. Also remove the message and paste_type change from edit_paste()
in edit-commands.c, it had the same purpose, just with a user
notification.

In order to paste the full layer one needs to explicitly invoke
"Paste as new layer" now.

It still changes the paste_type to NEW_LAYER if it's impossible to
attach a floating selection to the target, the menu item was simply
insensitive before.
2016-09-23 16:49:11 +02:00
Ell 6da1775dd7 app: more performance improvements to fuzzy-select/bucket-fill
Not as dramatic this time...
2016-09-22 17:46:07 +00:00
Michael Natterer 21ec859c4a app: rename gimp_layer_flatten() to gimp_layer_remove_alpha() 2016-09-21 11:56:25 +02:00
Michael Natterer 1d76d085c9 app: fix position of pasted layers in gimp_edit_paste()
and make that code more readable.
2016-09-21 11:15:34 +02:00
Michael Natterer f677e156af app: special case empty layer groups in gimp_edit_get_paste_offset()
They have a size of 1x1, treat them a image-sized when pasting layers
on top of them.

(my commit below was also about gimp_edit_get_paste_offset(), not
 about gimp_edit_paste() as the log claims)
2016-09-21 09:22:30 +02:00
Michael Natterer 7b4895fd1e app: use x,y,width,height instead of x1,y1,x2,y2 in gimp_edit_paste()
and gimp_item_mask_intersect() instead of _bounds().
2016-09-21 00:53:42 +02:00
Michael Natterer 35588d79c8 app: add utility functions to get a generic paste GimpObject
to Gimp and GimpClipboard. The object is either an image or a buffer
or NULL.
2016-09-21 00:11:15 +02:00
Michael Natterer fa94ab03ca app: fix warning in gimp_edit_paste()
gimp_image_add_layer()'s "parent" parameter is a layer.
2016-09-21 00:09:38 +02:00
Michael Natterer 67863dabf9 Bug 637313 - Should be possible to copy/paste whole layers in a single step
Use the newly added clipboard for entire images to copy/paste layers
(we only create single-layer clipboard images, and use only the first
layer of any recieved image, the layers can be arbitrarily complex
though):

- change gimp_edit_copy,cut,paste() to return/take a GimpObject
  that can be a GimpImage or GimpBuffer
- cut/copy the whole layer if there is no selection
- always paste layers as new layers, not floating selections
- always paste news layers on top of the active layer, where
  we would attach a floating selection
- add enum GimpPasteType { FLOATING, FLOATING_INTO, NEW_LAYER }
- add GimpPasteType parameter to gimp_edit_paste() and handle all
  three cases there because there is now a lot of common code
  involved
- change all callers accordingly, use only legacy buffer pasting
  from the PDB for now
2016-09-20 00:20:07 +02:00
Michael Natterer 7130ba95e1 app: add gimp->clipboard_image and API to set/get it 2016-09-19 20:13:39 +02:00
Michael Natterer f0acb3301a app: factor gimp_edit_get_paste_offset() out of gimp_edit_paste()
and also use it for "paste as new layer", so we get the same
positioning logic for both paste variants.
2016-09-19 17:30:41 +02:00
Michael Natterer 557965e593 app, menus: rename everything "paste as new" to "paste as new image"
Actions, functions, variables, help IDs. Also added user profile
migration code for importing old menurc files.
2016-09-19 12:15:39 +02:00
Michael Natterer de5bbd637e app: don't call gimp_layer_set_lock_alpha() on layer groups
in gimp_image_new_from_drawable().
2016-09-17 19:19:30 +02:00
Michael Natterer d85157c376 app: rename gimp->global_buffer to gimp->clipboard_buffer
Also rename the "buffer-changed" signal and the setter, and add a
getter.
2016-09-17 17:39:54 +02:00
Michael Natterer 21f8a0fd1e app: clean up and simplify gimp_selection_extract()
It was ported to GEGL pretty much 1:1, leaving too many and even
one completely redundant if()s around.
2016-09-17 15:32:22 +02:00
Michael Natterer d5ffc50c2e app: rename w, h to width, height in gimp_item_mask_bounds() 2016-09-16 23:57:24 +02:00
Michael Natterer dba7d58b56 app: port gimp_drawable_bucket_fill() to x, y, width, height
because x1, y1, x2, y2 are evil.
2016-09-16 23:31:56 +02:00
Michael Natterer cbac0a4ddc app: don't show the "Fonts" startup status message if we don't loas fonts 2016-09-15 18:47:55 +02:00
Ell 7e6d67ac4b app: various performance improvements to fuzzy-select/bucket-fill
thru gimp_pickable_contiguous_region_by_seed()
2016-09-15 14:57:04 +00:00
Michael Natterer 3ee5df9ee8 Bug 771484 - text loading impossible, in version commit 4b4e1c8
gimp_restore(): the call to gimp_fonts_load() got lost in
commit 64a2c395d1.

Also adjust init progress percentages again.
2016-09-15 14:48:51 +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 ea6946edf0 app: small whitespace fix in gimppickable-contiguous-region.h 2016-09-15 10:22:53 +02:00
Massimo Valentini 0ecd936f57 Bug 771208: 'Y' axis name of Flow Graph Parameter...
on Paint Dynamics curve is wrong
2016-09-14 18:32:16 +02:00
Michael Natterer 20a32d970d Bug 599573 - Remember dialog defaults between Gimp sessions
Add GimpFillOptions and GimpStrokeOptions to GimpDialogConfig and use
them in the Fill/Stroke Selection/Path dialogs and for the "with last
values" commands. Add GUI for them to Preferences -> Dialog Defaults.

This requires most of the stuff in my last few commits, and some
more changes:

GimpFillOptions is a GimpContext which has all sorts of connections to
everything, including a Gimp pointer. Hack around in GimpDialogConfig
to add a Gimp property, and add "gimp" parameters to quite some GimpRC
functions. Treat the Gimp* as a GObject* in all public API because
core/ stuff is not known in config/.
2016-09-14 01:27:42 +02:00
Michael Natterer 7daa7d080a app: implement GimpConfig::serialize() in GimpFillOptions
so it doesn't inherit GimpContext's changed implementation.
2016-09-14 00:27:31 +02:00
Michael Natterer f1897b655e app: free Gimp members in reverse order of creation 2016-09-13 12:44:10 +02:00
Michael Natterer 314027f0c9 app: create members of the Gimp instance earlier
Move fonts, data factories, document list, paint methods and user
context creation to gimp_init() or gimp_constructed() so that most
members are created when gimp_new() is done. This does not load any
data earlier, it just makes sure that all containers exist when
gimp_load_config() is called. It's also cleaner and less fragile,
2016-09-13 09:47:27 +02:00
Michael Natterer 631110e061 app: merge units.[ch] into core/gimp-units.[ch]
and initialize units in gimp_init(). This was completely
over-engineered but in the end boils down to a bad hack that needs a
static "the_unit_gimp" pointer anyway, so let's at least have the hacks
in one file.
2016-09-12 23:51:29 +02:00
Jehan 4b4e1c8e60 app: use Freedesktop standard "edit-paste" icon rather than "gtk-paste". 2016-09-12 03:59:53 +02:00
Michael Natterer 64a2c395d1 app: add gimp-data-factories.[ch] with some code from gimp.c
This should improve readability in gimp.c, and moves all data factory
handling code to a common place.
2016-09-12 02:55:49 +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
Michael Natterer 3a14a646f5 app: add new config class GimpDialogConfig
which will keep all settings of the "don't ask me again" kind. For
now, moved the "color-profile-policy" there.
2016-08-14 22:21:59 +02:00
Michael Natterer f06f691a92 Bug 768952 - Select by color works correctly only in srgb
Separate clearing/creating the image's cached color transforms from
clearing/creating its color profile. Clear the transforms when the
color profile changes, and when image type or precision change. Create
the transforms only on demand, so clearing them multiple times doesn't
trigger any redundant (and expensive) transform creations.
2016-07-25 00:04:12 +02:00
Jehan 7d5ebbe225 app: rename mirror properties to mirror-position-x|y.
As proposed by Mitch. This completes first renaming attempt (commit
08ffc10) with even less ambiguous names.
"horizontal-axis-position" and "vertical-axis-position" are now
respectively "mirror-position-y" and "mirror-position-x".
2016-07-19 14:24:54 +02:00
Jehan 65be37b37b Bug 768871: improve symmetry labels. 2016-07-19 12:34:01 +02:00
Jehan 08ffc1035b app: rename properties s/(horizontal|vertical)-position/\1-axis-position/.
"Horizontal position" and "Vertical position" could be mistaken as
meaning respectively the x and y coordinates, hence the vertical (resp.
horizontal) guide's positions.
The more accurate "horizontal-axis-position" and "vertical-axis-position"
namings are less misleading.
2016-07-18 02:52:37 +02:00
Massimo Valentini 23d5944ef8 Bug 768625: gimp-gradient-segment-range-move crashes...
...GIMP invoked with end-segment < 0

correct a typo
2016-07-10 17:21:32 +02:00
Michael Natterer 954f50a097 app: fix description of GIMP_COLOR_PROFILE_POLICY_CONVERT in the header
it was only fixed in the generated .c file.
2016-07-08 15:07:41 +02:00
Michael Natterer d3de67a9de app: always return a profile from gimp_drawable_transform_buffer_*()
Assign the buffer_profile return value early, so it doesn't stay
uninitialized when we bail out half way through the functions.
2016-07-06 20:29:56 +02:00
Michael Natterer eae2261f16 app: tag the symmetry properties as pixel-coordinate/pixel-distance
so they get the proper soft limits in the generated GUI. Also rename
some properties for consisency, and add some blank lines for better
readability.
2016-07-06 12:37:10 +02:00
Michael Natterer 8c2c22ccb4 app: don't pass a NULL profile to gimp_image_convert_color_profile()
In gimp_image_import_color_profile(), when converting
non-interactively, pass the image's built-in profile.
2016-07-04 12:28:42 +02:00
Jehan 38f1b50a15 app: type s/Thia/This/. 2016-07-01 19:50:13 +02:00
Jehan e8aac6d5ac app: do not allow mandala center position out of the image dimensions. 2016-07-01 14:58:24 +02:00
Jehan 4e6d320591 app: remove current implementation of GimpSpinScale soft bounds.
Mitch gets a better idea to deal with soft limits (i.e. min/max values
different from the property min/max) applied to a spin scale created by
gimp_prop_spin_scale_new().
So let's just remove the current implementation (using locale data on
the GimpConfig object). The symmetry spin scales are back with crazy
huge maximums, which makes quite a horrible GUI, but this is only
temporary until Mitch commits his new implementation.
2016-07-01 13:58:55 +02:00
Ell f4e8cf29f2 app: add missing cleanup to the previous commit 2016-06-30 18:55:09 +00:00
Ell bd5544394b app: eliminate double application of the selection mask ...
... in gimp_drawable_bucket_fill()

gimp_drawable_apply_buffer() already takes the selection mask into
account.  Intersecting the selection mask with the fill region
prior to that leads to wrong (too low) alpha values, in general,
when partial selection is involved.

This commit eliminates the intersection of the fill region and
selection mask data before the apply_buffer() call, although it
does calculate the intersection of their bounds, to avoid
processing regions that won't be visible anyway.
2016-06-30 18:42:55 +00:00
Jehan a10b688b64 app: rename "update-ui" signal to "gui-param-changed".
Therefore having a signal name more in line with other signals. This
reflects the property flag's naming: GIMP_SYMMETRY_PARAM_GUI.
2016-06-28 20:04:38 +02:00
Jehan f713c86d9f app: disconnect symmetries' callbacks connected to image signals...
... on symmetry destruction.
Use g_signal_connect_object() which does this automatically.
2016-06-28 19:30:44 +02:00
Ell 8e9a89d0b9 app: always use the image's mask format for quick mask
Previously, activating quick mask while the selection was empty
would use the image's channel format for the mask, instead of its
mask format; these formats are different for sRGB images.
2016-06-28 13:30:49 +00:00
Richard Kreckel dd9b0fc55b Bug 768044 - Fix many typos
This fixes many typos in comments and one in a user-visible string (msgid
"center abscisse" changed to "center abscissa" in affected po files. too).
2016-06-26 00:35:24 +02:00