Commit Graph

29 Commits

Author SHA1 Message Date
Alx Sa 6effe7d38c plug-ins: Port int_combo properties to GimpChoice
web-page.c was left as additional font
sizes besides the GUI choices could be set
via a PDB call. The export plug-ins int
combos will be updated in a separate
merge request.
Additionally, the region choice in screenshot.c
was hidden on Windows since it does not
yet implement that option.
2024-07-26 18:56:53 +00:00
Jehan f6da799c11 plug-ins: port screenshot to GimpProcedureDialog and gimp_procedure_new2().
A lot less lines for the same functionalities!
This includes improvements too:

* "include-pointer" as new PDB argument;
* settings storage thanks to GimpProcedureDialog;
* it should hopefully work better in non-interactive (though it's untested).

The macOS and Windows screenshots are untested after this change, though they
should still work the same. Please report if there is any problem!
2023-10-01 20:52:01 +02:00
Jehan ca8bc2bc1d app, libgimp, pdb, plug-ins: more functions moved to get|set().
The gimp_drawable_type() is an issue though as gimp_drawable_get_type()
is already defined as a common GObject API.
Though I'm actually wondering if GimpImageType is well called. Rather
than Type, shouldn't we go with ColorModel?

sed -i 's/\<gimp_drawable_bpp\>/gimp_drawable_get_bpp/g' "$@"
sed -i 's/\<gimp_drawable_width\>/gimp_drawable_get_width/g' "$@"
sed -i 's/\<gimp_drawable_height\>/gimp_drawable_get_height/g' "$@"
sed -i 's/\<gimp_drawable_offsets\>/gimp_drawable_get_offsets/g' "$@"
2021-04-06 14:34:31 +02:00
Jehan 72d1f9cb6d plug-ins: get rid of gimp_image_(s|g)et_active_layer().
No more usage of the single active layer concept in existing plug-in
code.
2021-02-24 12:09:15 +01:00
Jehan a29ece23b9 plug-ins: screenshot_x11_available() should not always return TRUE.
This was true in the "old world" where X11 support being built-in meant
that X11 screenshot would be usable. Now we must not only check it is
built, but also that we are actually running under X11. Otherwise with a
Wayland compositor, screenshot would fail. Also it meant that the
Freedesktop portal was never tried if both X11 and Wayland support were
built-in.
2020-12-30 16:14:13 +01:00
Jehan 9f0dbb5759 plug-ins: port screenshot to GimpImage/GimpDrawable. 2019-08-22 15:54:36 +02:00
Ell 053e5edc93 libgimpcolor, app, modules, plug-ins: remove GEGL_ITERATOR2 define
... it's no longer needed, since GEGL commit
gegl@9dcd2cde63f95a080bf16a58c10e9ffbdd99aace.

Partially reverts commits:

6fca9959c7
cc10af72cc
49c53568d7
8edbc0d491
29f63616d2
3a2014984d
ee48ec6877
4165a315d5
764085278f
b7633c722e
6ab12061b7
754a3c5b18
22b4b647bd
55b3438328
c6d23add65
f03a84d607
822f9f0d2b
95358ca1fa
cdda37f4ee
41e8035635
6761da42b2
fb5d7832a8
97ed7817d8
46e9036578
ea9c5e6a49
24fbdfb591
beb4ecb238
4b77831e03
fcf113a39c
567ffe94ff
2018-12-02 11:15:37 -05:00
Øyvind Kolås cc10af72cc plug-ins: migrate screenshot-x11 to new iterator api 2018-09-11 02:05:13 +02:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Michael Natterer 5ed713a367 plug-ins: undeprecate screenshot-x11.c 2018-05-31 20:38:41 +02:00
Michael Natterer 1d8696cd80 Get rid of gdk_flush() globally, use gdk_display_flush() 2018-05-20 21:06:34 +02:00
Michael Natterer 5ece7a8d1f Port a lot of stuff from GdkScreen/monitor_number to GdkMonitor
including some fixes for getting pointer coords, and needed
API changes in libgimpwidgets.
2018-05-20 21:06:30 +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
Jehan 80490a2c07 plug-ins: add a SCREENSHOT_CAN_SHOOT_WINDOW capability.
And add the relevant option for when such capability is absent. Right
now it is absent only from the new Freedesktop API.
2017-12-16 21:54:49 +01:00
Jehan f9076ae294 plug-ins: add SCREENSHOT_CAN_DELAY_WINDOW_SHOT capability to screenshot.
This indicates if a delay can be inserted in-between the window pick and
the actual shot. This is indeed not always possible, for instance using
KWin API. Obviously this feature is only meaningful if
SCREENSHOT_CAN_PICK_WINDOW feature is enabled as well. For instance X11
screenshot has the feature, but GNOME won't need it since there is no
window selection (it simply snaps whatever is the active window).
2017-12-10 01:33:44 +01:00
Jehan b57c89dd5d plug-ins: differentiate a delay before the area/window selection...
... and a delay before the screenshot.
Until now, there was only delay before selection, which I changed in
commits d9cd4b61bc and 614bcf6d0a. Actually a delay before selection may
also be useful, for instance when you use a tablet without keyboard (no
alt-tab possible) and the window/area you wish to capture is behind GIMP
window. Then you'd want to interact with the desktop with the pointer
before the cursor changes for selection interaction.
I add some logics so that the selection delay doesn't show when it is
unecessary (for instance for full-screen screenshot, or when the window
screenshot is based on the active window, not click selection, like with
GNOME shell API).
2017-12-10 01:07:15 +01:00
Jehan d9cd4b61bc Bug 791352 - Screenshot delay is broken for region-grab screenshot.
Fix first the delay in X11.
Actually both for region and window screenshots, it makes no sense to
delay *before* region or window selection. Usually when one uses a
delay, the point is to prepare in-between selection and shot. For
instance, I often used a delay to snap the contents of a menu because
PrintScreen key would not work when a menu is opened. So I would set a
delay, select my window/region, then quickly open the menu before the
delay is counting down. This would not be possible with the way delay
occurred (before selection), which just has no use that I can see of.
2017-12-09 01:44:46 +01:00
Michael Natterer e16c8a2352 Move the new "default_new_layer_mode" APIs to the image...
...in both the core and libgimp.

Images now know what the default mode for new layers is:

- NORMAL for empty images
- NORMAL for images with any non-legacy layer
- NORMAL_LEGAVY for images with only legacy layers

This changes behavior when layers are created from the UI, but *also*
when created by plug-ins (yes there is a compat issue here):

- Most (all?) single-layer file importers now create NORMAL layers
- Screenshot, Webpage etc also create NORMAL layers

Scripts that create images from scratch (logos etc) should not be
affected because they usually have NORMAL_LEGACY hardcoded.

3rd party plug-ins and scripts will also behave old-style unless they
get ported to gimp_image_get_default_new_layer_mode().
2017-08-21 20:18:00 +02:00
Michael Natterer 838449254a plug-ins: use gimp_get_default_new_layer_mode() for most new layers
instead of hardcoding NORMAL_LEGACY.
2017-08-20 17:12:46 +02:00
Jehan 24c2bdf61c Bug 784890 - Being able to take a screenshot of a single window and...
... include mouse pointer.
This is working find and tested under GNOME which already had the code
for it (was only missing the GUI). I added the feature in OSX and X11,
though it is untested. Windows does not seem to have the capability (at
least according to screenshot_win32_get_capabilities() in our code).
2017-07-18 15:04:09 +02: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 e518b9753d Bug 723498 - Gimp changes contrast and color of images
Add color management options to the screenshot plug-in:

By default, it tries to tag the image with the monitor profile;
alternatively, there is an option to convert the image to sRGB.

This works mostly fine on *one* monitor given its profile is
configured correctly. With more than one monitor, funny things happen
depending on the platform and on what we are shooting (window, screen,
area). There are some FIXMEs left in the code.
2017-01-31 21:26:44 +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 f67100f554 plug-ins: attach the default comment to all screenshots
not only to screenshots made with the X11 backend.
2016-05-31 22:29:49 +02:00
Michael Natterer bb9b899f37 plug-ins: set SCREENSHOT_CAN_SHOOT_REGION on backends that support it 2016-05-31 01:19:12 +02:00
Michael Natterer cb76253c67 Bug 764450 - Crash in screenshot's gnome-shell backend
Add error reporting to all screenshot backends, but only really use it
in the gnome-shell backend: check all DBus calls for errors instead of
crashing.

Also fix detection if gnome-shell is running: just creating the
GDBusProxy always succeeds, so call org.freedesktop.DBus.Peer.Ping
on the newly created proxy.
2016-04-02 01:28:34 +02:00
Michael Natterer 7a98b9e043 plug-ins: move screenshot delay function to the main screenshot.[ch]
so it can be used from all backends.
2016-03-29 23:34:51 +02:00
Michael Natterer a1785e9823 Bug 757687 - Screenshot functionality broken under Wayland
Some more abstraction in the screenshot plug-in, now allows for
runtime backend selection. Add stubs for the gnome-shell backend,
registers itself as unavailable because it's still unimplemented.
2016-03-29 22:08:27 +02:00
Michael Natterer e4ff6b40da Bug 757687 - Screenshot functionality broken under Wayland
Move OS X and X11 specific code to its own files, to prepare for more
shooting backends being added. Also remove unimplemented G_OS_WIN32
stubs, if anyone feels like implementing a Windows backend, by all
means go ahead.
2015-11-07 22:39:32 +01:00