Commit Graph

64 Commits

Author SHA1 Message Date
Michael Natterer f180a171cd pdb: remove all deprecated procedures 2018-05-20 21:06:29 +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
Michael Natterer 410e55c40c pdb: never pass bogus supersample values to gimp_drawable_gradient()
even when supersampling is not enabled, or we will get warnings about
out-of-range property values.
2018-04-16 01:18:05 +02:00
Michael Natterer 5ee67deea5 pdb: deprecate all non-clipboard functions in the "edit" group
Still have to port script-fu scripts...
2018-04-15 16:39:59 +02:00
Michael Natterer 50536e1c38 Bug 795230 - Rename Blend tool and provide PDB compatibility
Add new PDB group "drawable_edit" which has all procedures from the
"edit" group which are not cut/copy/paste.

The new group's procedures don't have opacity, paint_mode
etc. arguments but take them from the context instead. Unlike the old
gimp-edit-fill, gimp-drawable-edit-fill now uses the context's opacity
and paint_mode.

The new gimp-drawable-edit-gradient-fill procedure uses even more
context properties which are also newly added with this commit
(gradient_color_space, gradient_repeat_mode, gradient_reverse).

And some cleanup in context.pdb.

This is still WIP, nothing in the edit group is depcreated yet.
2018-04-15 15:28:50 +02:00
Michael Natterer 5f6dfc7617 app: add GimpGradientBlendColorSpace parameter to gimp_drawable_gradient() 2018-04-14 01:34:50 +02:00
Michael Natterer 4f2e078ccb Bug 795230 - Rename Blend tool and provide PDB compatibility
Rename gimpdrawable-blend.[ch] to gimpdrawable-gradient.[ch]
2018-04-13 23:43:27 +02:00
Jehan 1789f0fe2a app, libgimp, pdb: update gimp_edit_blend() description.
Make it known that gimp_context_set_distance_metric() influences the end
render of a shapeburst blend.
2018-03-18 13:21:05 +01:00
Jehan e164aee7a9 app, libgimp, pdb: add "distance-metric" property to GimpPDBContext.
This property is currently only used for gimp_edit_blend() to control
how are computed distances. In the future, it could be used for more
functions making use of "gegl:distance-transform" operation, or even for
other algorithms, if relevant.
This new property obviously comes with 2 new PDB calls:
gimp_context_get_distance_metric() & gimp_context_set_distance_metric()
2018-03-18 01:03:40 +01:00
Michael Natterer 0cfe550639 app, pdb: change a lot of GIMP_LAYER_MODE_NORMAL_LEGACY to just NORMAL
this commit changes just those which make no difference to
functionality: property and object member defaults that get overridden
anyway, return values of g_return_val_if_fail(), some other stuff.
2017-08-19 20:33:47 +02:00
Michael Natterer 722a1a1368 app: add gimp_edit_paste_as_new_image() and use it from GUI and PDB 2017-05-01 19:10:52 +02:00
Michael Natterer 536cc8531a app: keep the src image's resolution and unit in copied/cut GimpBuffers
and use them for the new image in "Paste as new image". We were using
the resolution and unit of the image the paste command was invoked
from, which is entirely random and useless.
2017-05-01 18:39:13 +02:00
Michael Natterer c2f0226f66 Bug 781408 - script fails due to error in edit-copy / edit-paste
Fix the edit-paste and edit-paste-as-new-image PDB wrappers to use
gimp_get_clipboard_object(), not just clipboard_buffer(), and deal
correctly with entire images in the clipboard.
2017-04-19 16:44:08 -03:00
Michael Natterer 3cf423f0cd *: rename NORMAL to NORMAL_LEGACY and NORMAL_LINEAR to NORMAL
and make NORMAL_LEGACY immutable.
2017-02-26 16:26:34 +01:00
Michael Natterer 5389e8e417 app, libgimp: rename GIMP_LAYER_MODE_NORMAL to NORMAL_LINEAR
and NORMAL_NON_LINEAR to NORMAL, so it's consistent with all other
modes.
2017-01-28 21:38:52 +01:00
Øyvind Kolås 735887286a app: do not let pixel encoding determine layer modes
See bug #757485 - woth noting that this also enables linear and thus correct
compositing when using 8bpc perceptual gamma as the layer storage format.
2017-01-09 20:09:50 +01:00
Michael Natterer 152adbb1bd Rename GIMP_LAYER_MODE_FOO_BROKEN to GIMP_LAYER_MODE_FOO_LEGACY
"Broken" sounds like it needs fixing, but it's legacy compat stuff
that will have to stay for all eternity.
2017-01-09 01:27:20 +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
Michael Natterer 109e01dbdd pdb, app, libgimp: rename *-paste-as-new to *-paste-as-new-image
Keep the old function names around as deprecated compat wrappers.
2016-09-20 20:20:25 +02:00
Michael Natterer be91db8107 pdb: fix typo in edit-paste's help 2016-09-20 18:54:34 +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 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 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 05b619cb8c pdb: also fix gimp-edit-bucket-fill-full, see below 2016-03-08 02:26:20 +01:00
Michael Natterer 8d3c6a4f38 pdb: fix gimp-edit-bucket-fill when there is a selection
use the passed opacity and paint mode instead of hardcoding OPAQUE and
NORMAL.
2016-03-08 01:17:35 +01:00
Ell 350c7ca338 app: Add "Diagonal neighbors" option to the bucket fill tool
When checked, diagonally neighboring pixels are considered connected
when calculating the affected area.

This commit also adds a corresponding diagonal_neighbors parameter to
gimp_drawable_bucket_fill(), and modifies the callers, other than the
bucket fill tool, to pass FALSE for this parameter, to retain the
current behavior.
2016-01-17 00:46:54 +01:00
Michael Natterer 8fa7bc3622 Bug 314379 - Allow stroking as outline (not with a paint tool) via the PDB
Add new PDB procedures gimp-context-get/set-stroke-method and honor
the new setting in gimp-edit-stroke and gimp-edit-stroke-vectors.

Internally, keep a GimpStrokeOptions around in GimpPDBContext to keep
track of the newly added PDB state, and use it for the stroke
operations instead of creating a scratch GimpStrokeOptions.
2015-11-09 01:46:07 +01:00
Michael Natterer e3ea383580 app, libgimpbase: move enum GimpStrokeMethod to libgimpbase
and rename its values.
2015-11-08 22:48:48 +01:00
Michael Natterer bc4cf9918f Bug 673501 - Issue with Overlay
GIMP's OVERLAY mode was identical to SOFTLIGHT. This commit fixes the
issue and introduces a NEW_OVERLAY mode and enum value.

- change gimp:overlay-mode to be a real (svg-ish) overlay mode
- when compositing, map OVERLAY to gimp:softlight-mode
- when compisiting, map NEW_OVERLAY to gimp:overlay-mode
- bump the XCF version when NEW_OVERLAY is used
- map OVERLAY to SOFTLIGHT when loading and saving XCF
- map OVERLAY to softlight in all PDB setters
- map OVERLAY to softlight when deserializing a GimpContext
- change all paint mode menus to show an entry for NEW_OVERLAY
  instead of OVERLAY
- change PSP, PSD and OpenRaster to use NEW_OVERLAY

These changes should (redundantly) make sure that no OVERLAY enum
value is used in the core any longer because it gets mapped to
SOFTLIGHT at all entry points, with the downside of introducing a
setter/getter asymmetry when OVERLAY was set in a PDB api.
2015-04-29 13:32:58 -04:00
Michael Natterer a6601d563b app: some GimpProgress cleanup
- change start() and set_text() to use "format" and "..." instead of
  "message", allowing to format progress messages in place
- s/cancelable/cancellable/
- move "cancellable" to be the second argument of start()
2014-07-12 23:45:20 +02:00
Michael Natterer 38c86da8e9 app: factor out utility function gimp_get_fill_params()
which returns an error if there is no pattern for GIMP_FILL_PATTERN.
Use it instead of having the same code in 3 variants, and make error
handling consistent with bucket fill.
2014-06-03 14:00:01 +02:00
Michael Natterer 1416743b5c app: use GimpFillType in gimp_drawable_bucket_fill()
GimpBucketFillMode is now tool- and pdb-only.
2014-06-03 01:34:51 +02:00
Michael Natterer 425748dab0 libgimpbase, *: rename GimpFillType values: GIMP_FOO_FILL -> GIMP_FILL_FOO
Change all users accordingly and add compat enum values and compat
constants to script-fu and pygimp.
2014-06-03 01:11:32 +02:00
Michael Natterer b60e1779cd app: pass a GimpGradient to gimp_drawable_blend(), not a GimpBlendMode
The blend mode is now only a PDB compat enum, translate between
GimpBlendMode and the built-in gradients in the gimp-edit-blend PDB
wrapper.
2014-04-30 09:17:42 +02:00
Michael Natterer 22c222291d libgimpbase,*: clean up enum values in gimpbaseenums.h
GIMP_ADD_foo_MASK -> GIMP_ADD_MASK_foo
GIMP_foo_MODE -> GIMP_BLEND_foo
GIMP_foo_CLONE -> GIMP_CLONE_foo
GIMP_foo -> GIMP_DODGE_BURN_TYPE_foo
GIMP_foo -> GIMP_TRANSFER_foo

Add compat values for the old names and compat code to script-fu
and pygimp.
2014-04-29 20:58:30 +02:00
Michael Natterer 8ce94d23b9 libgimpbase: move GIMP_REPEAT_TRUNCATE to the end of the enum
New values must go to the end to avoid ABI break.
2014-04-24 23:08:33 +02:00
João S. O. Bueno ad4862c60b Adds new blending mode 'Truncate blend'
Bring repeat behavior on par with GEGL and Cairo,
and sane ways of creating square or circular gradient
shapes.
2014-04-24 12:18:26 -03:00
Michael Natterer 4d6640ff79 Bug 721249 - pdb.gimp_context_set_brush_size() dont't work
Port selection/path stroking to using the PDB-controllable
paint options that live in GimpPDBContext.

Change gimp_item_stroke()'s "use_default_values" boolean which was
introduced at a time where we had no better way by a GimpPaintOptions
parameter. If a non-NULL paint_options is passed (when called from the
PDB), use it for stroking; if NULL is passed, use the actual paint
tool options from the GUI (when called from the menus or the stroke
dialog). In the PDB wrappers, get the right paint options object from
the PDB context associated with the calling plug-in.
2014-02-06 23:26:53 +01:00
Michael Natterer 5732088b0c pdb: replace gimppdb-utils' "writable" boolean by a bitmask
called GimpPDBItemModify that currently has one member
GIMP_PDB_ITEM_CONTENT, in order to be prepared for adding
the "lock position" feature from bug 674160.
2012-11-08 20:46:18 +01:00
Michael Natterer 1f9965879b pdb: add missing breaks in switch() so we don't always pattern-fill
Same as 439c5a7814, just missed
the other function.
2012-08-04 03:13:52 +02:00
Michael Natterer a3f12f7180 pdb: minor formatting fix in generated PDB wrappers 2012-05-28 19:55:28 +02:00
Michael Natterer 439c5a7814 pdb: add missing breaks in switch() so we don't always pattern-fill 2012-05-17 21:56:45 +02:00
Michael Natterer 7610e299ae Use GimpValueArray and GimpParamSpecValueArray
instead of the deprecated stuff from GLib.
2012-05-04 00:51:50 +02:00
Michael Natterer 3ad73b3658 libgimpcolor: add GdkPixbuf <-> GeglBuffer utility functions
and update tons of includes in libgimp and app.
2012-05-03 03:37:20 +02:00
Michael Natterer c57b4f0fa3 app: port by color select and fuzzy select to float
so it works nicely on all precisions, disable HSV color matching for
now, need to decide what to do with it.
2012-05-02 17:51:18 +02:00
Michael Natterer 1780cfc1e7 app: remove the !seed_fill case from gimp_drawable_bucket_fill()
We use gimp_edit_fill() for that now. Also remove bucket fill's
_full() variant because it's unused now.
2012-05-02 17:46:01 +02:00
Michael Natterer 3ec245a991 app: add opacity and paint_mode to gimp_edit_fill[_full]()
and use it instead of bucket-fill in the non-seed-fill case.
2012-05-02 17:46:01 +02:00