Commit Graph

1944 Commits

Author SHA1 Message Date
Ell
b886dd1f46 Issue #4641 - Invalid PDB parameter names for data-selection functions
In the various libgimp data-selection functions, replace spaces
with hyphens in the callback-proc parameter names.  Spaces in
parameter names are invalid, which is now enforced by GIMP/GLib,
causing procedure registration to fail.
2020-03-05 20:21:42 +02:00
df850fa394 Return FALSE on gimp_osx_focus_window to avoid endless loop
(cherry picked from commit 3e78c674d8)
2020-01-15 17:44:53 +01:00
03491efa81 libgimp: fix a type cast warning (win32).
I had this warning when cross-building for Windows 64-bit:

> libgimp/gimpui.c:187:52: warning: passing argument 2 of
> 'gdk_win32_window_foreign_new_for_display' makes pointer from integer
> without a cast [-Wint-conversion]

> note: expected 'HWND' {aka 'struct HWND__ *'} but argument is of type 'guint32' {aka 'unsigned int'}

(cherry picked from commit cf6dae6f83)
2019-10-12 17:11:33 +02:00
871b9fedae libgimp: fix gimp_image_metadata_save_prepare()'s check for IPTC flags
it was checking gimp_export_xmp() not gimp_export_iptc(), probably a
copy/paste error.

(cherry picked from commit 70ac0e9d9a)
2019-09-24 12:14:28 +02:00
Ell
4e71435112 libgimpbase, libgimp, app: inherit swap-compression in plug-ins
Pass the swap-compression option set in the preferences down to
plug-ins, so that they use the same swap-compression algorithm as
the main app.

(cherry picked from commit 5cc289b642)
2019-09-22 18:07:11 +03:00
Ell
7c69bdad4f pdb: add $since info to gimp-image-merge-layer-group
(cherry picked from commit 85704c6c46)
2019-09-07 10:55:33 +03:00
Ell
0c85a0b3e4 Issue #3893 - Error message when exporting to to TIF if there is a layer mask on a group
When exporting to a format that supports layers, but doesn't
support layer masks, merge layer groups with a mask before applying
their mask, since masks can't be applied to layer groups.

(cherry picked from commit 643279bd31)
2019-09-07 10:43:30 +03:00
Ell
b4635741e6 pdb: add gimp-image-merge-layer-group procedure
Oddly, we didn't have this one yet :P

(cherry picked from commit 62a6023b27)
2019-09-07 10:42:32 +03:00
176219020a libgimpbase: remove the gimp protocol mutex and gp_lock()/gp_unlock()
The protocol is supposed to be used recursively, the locks just
deadlock in some situations. Threaded use of the wire protocol is
simply forbidden.
2019-08-04 22:49:25 +02:00
1af8d2a2c7 libgimp*: use more g_clear_pointer()
(cherry picked from commit c144cf69de)
2019-07-25 12:40:33 +02:00
ff1e645c2f libgimp*: lots of doc fixes and new docs for structs and enums
(cherry picked from commit aca5f806c4)
2019-07-24 01:26:11 +02:00
44d8580f46 pdb, libgimp, app: add gimp_drawable_get_thumbnail_format()
so plug-ins can allocate buffers and stuff before getting the actual
thumbnail data.

(cherry picked from commit fc89dfb09b)
2019-07-10 15:17:07 +02:00
29d765a0bd Issue #3610 - Documentation: missing item in built-in documentation...
...for gimp_context_set_antialias(antialias)

Mention gimp_context_set_antialias() in the stroke docs, and mention
the stroke functions in the antialias docs.

(cherry picked from commit 7a589951c9)
2019-07-04 13:37:18 +02:00
dc23facb17 libgimp, plug-ins: get rid of GIMP_EXPORT_NEEDS_OPAQUE_LAYERS capacity.
This new capacity was created just 3 commits ago (9933f46f85).
The point was that the real fix is to remove the implication
HANDLE_LAYERS => HANDLE_ALPHA, but this breaks public API behavior,
which is why I didn't go with it.

Still it just felt wrong to add a NEEP_OPAQUE capability when it should
be the same thing as not setting HANDLE_ALPHA. After discussion on IRC,
we decided that this implication was basically a bug, and since in all
core plug-ins, when HANDLE_LAYERS was set, we were also setting
HANDLE_ALPHA, no core plug-in code even has to be changed. As for
third-party plug-ins, let's assume that none has been relying on this
wrong assumption.

(cherry picked from commit 667b4d71c9)
2019-06-29 17:10:11 +02:00
390029020f libgimp: add GIMP_EXPORT_NEEDS_OPAQUE_LAYERS export capacity.
Currently capability GIMP_EXPORT_CAN_HANDLE_LAYERS implies
GIMP_EXPORT_CAN_HANDLE_ALPHA. Though in many cases, multi-layer implies
alpha for basic compositing, our export plug-ins sometimes use the
concept of "layer export" for multi-pages or collection files.
Additionally sometimes alpha may not even be supported at all whereas
layers are. This will be the case in the next commit which will make use
of this new capability.

(cherry picked from commit 9933f46f85)
2019-06-29 14:39:18 +02:00
9ef3ce4c90 libgimp: forgot to deprecate gimp_drawable_preview_draw_region()
(cherry picked from commit 382fe030ce)
2019-06-28 19:32:52 +02:00
e7d9344880 app, libgimp, pdb: s/procesures/procedures/
While we are at it, another typo was missed.

(cherry picked from commit 45f37b9b63)
2019-05-10 01:42:29 +09:00
9a60382f69 Misc. typos
Found via `codespell`

(cherry picked from commit 86edc31b11)
2019-05-10 01:42:12 +09:00
ee3bc11e61 Issue #3129: Split sentence on gimpexport.c.
(cherry picked from commit 4dcda7ffb8)
2019-04-25 00:35:53 +02:00
Ell
c9f4735669 libgimp: avoid libgimp tile-cache in the plug-in tile backend
In GimpTileBackendPlugin, avoid storing read/written tiles in the
libgimp tile-cache, since caching is already done by GEGL.

(cherry picked from commit 47dcd4b93a)
2019-02-05 17:26:23 -05:00
17e360e34b Issue #2863 - Improve error reporting for scripts
gimp_plug_in_handle_proc_install(): print the procedure name when
bailing out of a wrong proc install call. For an obsolete full-path
menu label, also print the label. Original patch by Liam Quin.

(cherry picked from commit 07e3c1c15b)

In libgimp, add a note to gimp_install_procedure() stating that
passing a full menu path as "menu_label" is deprecated.
2019-01-27 13:42:36 +01:00
951a388cc3 fixed typo in deprecation warning in gimpdrawable.h 2019-01-19 21:26:53 +00:00
Ell
2247fce313 libgimp: in GimpTileBackendPlugin, change default tile multiplier to 1
In GimpTileBackendPlugin, change the default tile multiplier,
specifying the ratio between the backend tile-size, and GIMP's
tile-size, from 2 to 1.  Since we're reading/writing each GIMP tile
using a separate command anyway, using a large multiplier doesn't
provide any benefits, while it does have drawbacks.  In particular,
it reduces the chance that a write operation will affect an entire
tile, which allows us to avoid reading the tile data from GIMP.

(cherry picked from commit a5e2945b68)
2019-01-15 02:48:43 -05:00
Ell
535fd3a041 libgimp: in GimpTileBackendPlugin, don't read tile data upon TILE_SET
Add an internal _gimp_tile_ref_noinit() function, which increases
the ref-count of a tile *without* initializing its data (in
particular, without reading its data from GIMP, or zeroing it.)
Use this function, instead of gimp_tile_ref(), when storing a tile
in GimpTileBackendPlugin, to avoid unnecessarily reading the tile
data from GIMP.

(cherry picked from commit 5ffdb9aa41)
2019-01-15 02:48:41 -05:00
Ell
cc59bce82e Issue #440 - libgimp/gimptilebackendplugin.c provides no pyramid
In GimpTileBackendPlugin, return NULL when fetching z>0 tiles,
instead of simply ignoring the z coordinate, so that the mipmapped
tile is rendered locally.  Likewise, avoid storing z>0 tiles.

Note that this is suboptimal, since all the necessary level-0 tiles
need to be sent to the buffer as a result.  Ideally, we should
extend the wire protocol to handle mipmapped tiles.

(cherry picked from commit d0ae39f017)
2019-01-12 05:51:58 -05:00
4f9bde3bad Issue #1437 - 2.10 Image Metadata "keywords" corrupt
We were not taking into account tags that can appear multiple times,
such as "keyword", they are handled by gexiv2 with the
get_tag_multiple() and set_tag_multiple() functions.

gimp_metadata_deserialize_text(): when deserializing our XML format,
check if a tag is already set on the metadata as "multiple" and if yes
retrieve it, append the new value and set it again.

gimp_image_metadata_save_finish(): take care of "multiple" values when
copying tags to new metadata created for saving.

This should preserve all values across an "import, edit, export".

Thing will still break when using the metadata editor, it doesn't
handle multiple values at all, but that code is very hard to
understand.

(cherry picked from commit d708ac0b21)
2019-01-06 17:53:41 +01:00
8dee1276f1 pdb: deprecate gimp_get_theme_dir() and gimp_get_icon_theme_dir()
They are unused in 2.10 and master, and we do this via the plug-in
config message anyway.
2019-01-04 15:55:47 +01:00
fca2e84f4f app, libgimpbase: move enum GimpBucketFillArea to the core
The whole bucket fill specific enum stuff is on its way out, so let's
keep this one out of libgimp for now until we decide how to present
line art filling in the PDB.

(cherry picked from commit 368f2e596a)
2019-01-02 15:54:20 +01:00
d7b9cb4e71 libgimp: use G_N_ELEMENTS() in gimp_image_metadata_save_finish()
intead of hardcoding the array length.

(cherry picked from commit d873290915)
2019-01-01 20:27:43 +01:00
86b9738286 app: do not make line art bucket fill a GimpSelectCriterion anymore.
This was my initial choice, but the more I think about it, the less I am
sure this was the right choice. There was some common code (as I was
making a common composite bucket fill once the line art was generated),
but there is also a lot of different code and the functions were filled
of exception when we were doing a line art fill. Also though there is a
bit of color works (the way we decide whether a pixel is part of a
stroke or not, though currently this is basic grayscale threshold), this
is really not the same as other criterions. In particular this was made
obvious on the Select by Color tool where the line art criterion was
completely meaningless and would have had to be opted-out!

This commit split a bit the code. Instead of finding the line art in the
criterion list, I add a third choice to the "Fill whole selection"/"Fill
similar colors" radio. In turn I create a new GimpBucketFillArea type
with the 3 choices, and remove line art value from GimpSelectCriterion.

I am not fully happy yet of this code, as it creates a bit of duplicate
code, and I would appreciate to move some code away from gimpdrawable-*
and gimppickable-* files. This may happen later. I break the work in
pieces to not get too messy.
Also this removes access to the smart colorization from the API, but
that's probably ok as I prefer to not freeze options too early in the
process since API needs to be stable. Probably we should get a concept
of experimental API.

(cherry picked from commit cd924f453a)
2018-12-19 16:23:26 +01:00
0a2aac7ce1 libgimp: actually use the path expanded in the previous commit
(cherry picked from commit 799f6b14bb)
2018-12-05 00:35:15 +01:00
f6350e1b5a libgimp: need to expand config->swap_path in gimp_config()
or the file system will be polluted with folders called
"${gimp_cache_path}".

(cherry picked from commit cc835e877d)
2018-12-04 19:45:21 +01:00
9baae75c5c Integrate the logic of profile saving with metadata saving
Add flag GIMP_METADATA_SAVE_COLOR_PROFILE to GimpMetadataSaveFlags and
initialize it from gimp_export_color_profile() in
gimp_image_metadata_save_prepare().

Adapt all plug-ins to use the bit from the suggested export flags and
pass the actually used value back to
gimp_image_metadata_save_finish().

This changes no behavior at all but creates hooks on the libgimp side
that are called with the context of an image before and after the
actual export, which might become useful later. Also, consistency
is good even though the color profile is not strictly "metadata".

(cherry picked from commit c667fdc5c0)
2018-12-04 17:40:12 +01:00
Ell
0a39f362b5 libgimpbase, libgimp, app: pass misc. GEGL config to plug-ins
Pass the GEGL tile-cache size, swap path, and thread-count to plug-
ins as part of their config, and have libgimp set the plug-in's
GeglConfig accordingly upon initialization.
2018-11-19 17:09:59 -05:00
3adf4a4861 Fix plugin focus issues on osx
GTK/OSX does not automatically assign focus to the new windows (upstream 
issue), so activateIgnoringOtherApps is called. However, if it is called 
before gtk initialized it may cause number of focus issues.
2018-10-18 09:26:05 +02:00
Ell
31b369d09f app, libgimp*, modules: don't use g_type_class_add_private() ...
... and G_TYPE_INSTANCE_GET_PRIVATE()

g_type_class_add_private() and G_TYPE_INSTANCE_GET_PRIVATE() were
deprecated in GLib 2.58.  Instead, use
G_DEFINE_[ABSTRACT_]TYPE_WITH_PRIVATE(), and
G_ADD_PRIVATE[_DYNAMIC](), and the implictly-defined
foo_get_instance_private() functions, all of which are available in
the GLib versions we depend on.

This commit only covers types registered using one of the
G_DEFINE_FOO() macros (i.e., most types), but not types with a
custom registration function, of which we still have a few -- GLib
currently only provides a (non-deprecated) public API for adding a
private struct using the G_DEFINE_FOO() macros.

Note that this commit was 99% auto-generated (because I'm not
*that* crazy :), so if there are any style mismatches... we'll have
to live with them for now.
2018-09-18 14:41:35 -04:00
Ell
d3cab633de libgimp: in GimpTileBackendPlugin, use gegl_tile_backend_command()
In the command handler of GimpTileBackendPlugin, forward unhandled
commands to gegl_tile_backend_command(), instead of asserting that
they're within range (which has already been disabled by commit
bc3b076caf).  See GEGL commit
30047e65723ebb44fcde9c6b5f60ceecb43b0895.

(cherry picked from commit 668fee966a)
2018-08-19 19:46:22 -04:00
Ell
90ed3c8d3a libgimp: disable tile command range check in plug-in tile backend
In gimp_tile_backend_plugin_command(), disable the range check for
the input tile command.  This check prevents us from adding new
tile commands to GEGL without breaking the ABI; yet, the next GEGL
release will add a new command.  We're going to have to decide what
to do about this, but for now, let's just disable the check, so
that at least GIMP 2.10.6 is compatible with newer versions of
GEGL, no matter how we end up handling this.
2018-08-19 06:51:05 -04:00
Ell
efe72a8d56 */Makefile.am: add *marshal.h files to BUILT_SOURCES
In subdirs containing a generated foomarshal.h header, add the
generated sources to BUILT_SOURCES, so that they're generated
before the rest of the source files are built.  Otherwise, since
there is no rule specifying the dependency between the rest of the
source files and foomarshal.h, and since foomarshal.h is not
checked into git (and hence doesn't exist when doing a clean
build), compilation of the said source files may fail if they're
built before foomarshal.h is generated.

(cherry picked from commit a5102a7dba)
2018-07-24 14:05:23 -04:00
Ell
c5c0f87310 app, pdb: add gimp-register-file-handler-priority procedure
Add a gimp-register-file-handler-priority procedure, which can be
used to set the priority of a file-handler procedure.  When more
than one file-handler procedure matches a file, the procedure with
the lowest priority is used; if more than one procedure has the
lowest priority, it is unspecified which one of them is used.  The
default priority of file-handler procedures is 0.

Add the necessary plumbing (plus some fixes) to the plug-in manager
to handle file-handler priorities.  In particular, use two
different lists for each type of file-handler procedures: one meant
for searching, and is sorted according to priority, and one meant
for display, and is sorted alphabetically.

(cherry picked from commit b4ac956859)
2018-07-17 03:02:57 -04:00
9e71fc0983 Change a bazillion URLs to https://
Including all user-visible link and links called from code, like
the help pages.

(cherry picked from commit bab75b7365)
2018-07-14 14:23:42 +02:00
a88c0ffb93 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:47:19 +02:00
8aa0d5a401 Issue #1706 - Typo in gimpgradientselect.h include guard
Fix typo, spotted by Massimo.

(cherry picked from commit 627d58dce1)
2018-06-23 12:42:34 +02:00
1663e63717 libgimp: forgot to deprecate gimp_gamma() 2018-06-18 02:59:24 +02:00
113829fd14 Issue #701 - Add the ability to embed the GIMP built-in sRGB profile...
...upon exporting an image

Step 1: make it configurable just like "Export EXIF" etc.

app, libgimp: add "export-color-profile" config option

Add it to the preferences dialog, and pass it on to plug-ins in the
GPConfig message. Add gimp_export_color_profile() to libgimp.

Nothing uses this yet.

(cherry picked from commit 8c9c091021)
2018-06-18 02:47:36 +02:00
Ell
7f18eb467e pdb: change image freeze/thaw procs to "Since: 2.10.2" 2018-05-29 16:07:48 -04:00
Ell
de1084986c libgimpbase, libgimp, app: pass icon theme dir to plug-ins through config
Pass the current icon theme directory to plug-ins through the
config message, and add a gimp_icon_theme_dir() libgimp function
for retrieving it.  Note that we already have a similar
gimp_icon_get_theme_dir() PDB function, which we keep around, since
it can be used to dynamically query for the current icon dir,
unlike the former, and since it returns a dynamically-allocated
string, while the rest of the config-related functions return
statically allocated strings.

Use the new function, instead of gimp_get_icon_theme_dir(), in
gimp_ui_init().  This allows gimp_ui_init() to run without making
any PDB calls.  Consequently, this allows us to start plug-ins that
call gimp_ui_init() without entering the main loop in the main app.
We're going to add a plug-in that displays an interactive dialog
while the main app is blocking waiting for an operation to
complete, and we need to be able to start the plug-in without
entering the main loop, to avoid the possibility of arbitrary code
being executed during the wait.

Bump the protocol version.
2018-05-29 16:07:48 -04:00
90aa8ad040 libgimp: gimpimage_pdb.c got regenerated 2018-05-13 00:18:23 +02:00
69b2e84924 Source and trivial typos
Found via `codespell` and `grep`
2018-05-12 23:44:47 +02:00
b15f38d21f pdb: add "Since: 2.10" to the newly added freeze/thaw procedures 2018-05-07 10:16:52 +02:00