Commit graph

83 commits

Author SHA1 Message Date
Ell
5b857dbb4b 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

(cherry picked from commit 053e5edc93)
2018-12-02 11:21:36 -05:00
Øyvind Kolås
a5bbf913a4 plug-ins: migrate screenshot-x11 to new iterator api
(cherry picked from commit cc10af72cc)
2018-09-18 12:36:13 +02:00
Jehan
79961a6545 plug-ins: install plug-ins in subfolder.
I am going to forbid plug-ins from being installed directly in the root
of the plug-ins/ directory. They will have to be installed in a
subdirectory named the same as the entry point binary.
This may seem useless for our core plug-ins which are nearly all
self-contained in single binaries, but this is actually a necessary
restriction to eliminate totally the DLL hell issue on Windows. Moving
core plug-ins in subfolders is only a necessary consequence for it.

(cherry picked from commit 870ca6334d)
2018-08-16 13:25:51 +02:00
luz.paz
2883b8fb40 Misc. comment typos
Found via `codespell`

(cherry picked from commit 732bcb463e)
2018-07-14 21:17:19 +02:00
Michael Natterer
a88c0ffb93 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:47:19 +02:00
Jehan
8df6f4c8a6 plug-ins: clearer plug-in-screenshot parameter description.
Our plug-ins have no "optional" parameters per-se. Clarify the
description to make explicit that the last 4 parameters are simply only
taken into account when the shoot type is SHOOT-REGION.

(cherry picked from commit 3a0c03a61c)
2018-06-17 22:17:22 +02:00
Michael Natterer
1779826da9 Issue #1611 - plug-in-screenshot does not work in non-interactive run mode
Turn the boolean "root" argument into enum ShootType and reorder that
enum to { WINDOW, ROOT, REGION } so that the "0", and "1" values match
the former boolean. Adapt parameter checking accordingly so that
callers without optional arguments (e.g. script-fu) can call all the
plug-ins's features.

(cherry picked from commit d94b954c2a)
2018-06-17 20:59:04 +02:00
Salamandar
a42746c71d Specify utf-8 for rc file.
(cherry picked from commit 02edd1c8eb)
2018-06-16 03:50:14 +02:00
Salamandar
c176b0888e Fix encoding. The world should be utf-8.
(cherry picked from commit 8feb51954b)
2018-06-16 03:50:14 +02:00
Jehan
0da0f8ff46 plug-ins: renaming Win32 implementation files to follow namespacing.
(cherry picked from commit ff6d7a7550)
2018-05-30 12:15:33 +02:00
Gil Eliyahu
1a5b28b51d Issue #1458 - Small border on side of single-window screenshot on...
... Windows.

Reviewer note (Jehan): I have not built on Windows because I need to
refresh my crossbuild environment, but it looks sane enough, and Gil
previously did good patches. I push as-is, hoping it still builds fine
on Windows. :-)

(cherry picked from commit 2caa400a96)
2018-05-30 12:15:27 +02:00
Jehan
a2902790cc plug-ins: fix Windows distribution.
"magnification-api-win32.h" was not included in the dist!
Note that I know that alphabetical order is wrong. I am planning to
actually change the name of the file (more in line with other filenames)
but I am waiting to finish a review of another patch from Gil before
doing so. So just let it as-is for now! ;-)
2018-05-20 23:19:44 +02:00
Jehan
9fb1c28687 plug-ins: properly free rectScreens after allocating it.
Also avoid global variables when possible. We can just use the data
variable of EnumDisplayMonitors() which will be passed on to the
callback. This is not perfect yet since rectScreensCount is still
global, but let's go for it for now.
2018-05-16 00:39:46 +02:00
Jehan
e357e7118c plug-ins: fixing various compilation warnings.
Mostly warnings about wrong types for some function parameters.
There is still a single warning remaining about ignoring the #pragma
macro, but I am not sure what to do about this warning. Apparently it is
something specifically for use with Visual Studio. We don't need this,
but since the contributor uses it, let's keep it.
2018-05-16 00:39:46 +02:00
Jehan
382d6c8ad5 plug-ins: put the initial foreground window back after a screenshot.
This was lost in commit 966843564d. It's not a big deal since this code
path would only happen when the capture using magnification API fails,
yet we may as well make it perfect.
Also taking the opportunity to change the return type to gboolean for
the various capture functions (though it is technically the same,
semantically we were returning success boolean).
And removing a comment which had been duplicated and left at a the wrong
place.
2018-05-16 00:39:10 +02:00
Jehan
a0b28589ac plug-ins: properly load user32.dll for SetProcessDPIAware().
Using similar code as other parts of Win32 code.
I hope I am not doing anything wrong. At least now it builds!
2018-05-16 00:39:10 +02:00
Gil Eliyahu
ae93b6db18 Plug-ins: fix screenshot bugs in windows.
This fixes bugs 793722 and 796121.
In particular it fixes:
- Single-window screenshot when partly off-screen or covered by another
  window.
- Screenshots when display scaling is not 100%.
2018-05-16 00:39:10 +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
40df83ad71 Bug 794023 - Bad/Double free bugs found by scan-build.
Thanks to Massimo for raising this issue.
2018-03-03 16:27:04 +01:00
Simon Mueller
653798146e Bug 789728 - Screenshot whole screen (Windows 10) only grabs screen...
... from first monitor

While researching the cause for the missing window contents (bug
793722), I noticed that the full screen capture mode was also not
working as expected. No matter how many monitors were connected, it only
ever captured the contents of the main monitor. This patch adjusts the
source rectangle for the BitBlt copy operation so that multiple monitors
are captured correctly.
2018-02-24 18:27:27 +01:00
Simon Mueller
14236761cd Bug 793722 - Capture screenshot of single window fails if...
... thewindow is IE 11.

The screenshot plugin for windows had a problem when capturing
applications that use hardware rendering acceleration (e.g.
Chromium-based Apps, IE11). Those applications seem to render their
content to a device context (DC) that is different from the one that can
be retrieved via GetDCEx(hWnd). So a screenshot that simply copies the
main window DC will be incomplete (see bug attachment) or just plain
black.

This patch removes the code that uses GetDCEx for single window
screenshots and always uses the display device context instead. This
makes sure that all window contents are actually visible in the
screenshot. With this change, we now have to set the source coordinates
in the call to BitBlt() to the window's coordinates to exclude
everything that isn't the window from the screenshot when doing a single
window screenshot.

Review comment by Jehan: as Simon notes in bug 793722, there is a
regression though, which is that this new code cannot capture any part
of a window which is not in any screen. This is still an improvement
because at least for what is on screen, we always get exactly the same
as what is displayed. This is especially true since hardware-accelerated
applications are more and more common. So let's push this first commit
and hope for further improvements.
2018-02-23 18:19:36 +01:00
Jehan
4849d41060 plug-ins: check pointer before freeing.
Thanks to Massimo for notifying about it.
2018-01-14 00:56:40 +01: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
53a03b38e5 plug-ins: implementation of the Freedesktop portal for screenshot.
I am told by the GNOME/Flatpak people that this is what we will
ultimately need to implement. Basically this portal is supposed to work
everywhere, in sandboxes (Flatpak, hopefully Snap too?), but also out
of sandboxes, i.e. in GNOME and KDE, whether Wayland or X11. So that
should be the unique API we will have to implement in the end, and every
desktop environment/sandbox will need to implement this API (which is
good!).
Apparently it is not part of default GNOME yet, but has to be installed
separately (on Fedora, package is xdg-desktop-portal-gtk for GNOME and
xdg-desktop-portal-kde for KDE).

Now there are currently many shortcomings, and in particular, the
screenshot API has apparently no advanced features (at all!). No window
snap, no rectangular selection, no delaying, no choice on including
cursor or decoration, nothing! Apparently this is normal that the API
presents no feature, because "the API itself is not meant to specify the
details how the screenshot is obtained. Instead the portal will present
the user a dialog to take a screenshot, and that screenshot will be
given back to the sandboxed app".
This is acceptable behavior, except that currently, the dialog has none
of the basic features so this is a very bad regression. This is why I
test the freedesktop API last, which basically means it will likely
never be actually used. That's on purpose. At least, the code is in and
will be easy to improve later. Of course, when the Freedesktop portal
for screenshot will finally be featureful, it is meant to be tested
first.

See: https://github.com/flatpak/xdg-desktop-portal/blob/master/data/org.freedesktop.portal.Screenshot.xml
2017-12-16 02:36:15 +01:00
Jehan
1febb3327b plug-ins: update win32 screenshot to use the right delay as well. 2017-12-10 02:29:35 +01:00
Jehan
dbf97dbcce plug-ins: macOS screenshot has both window pick and delay-after-pick...
... capabilities.
This is untested, just reading the docs of "screencapture" tool we use
for macOS support. Hopefully it's all fine! :-)
2017-12-10 02:23:21 +01:00
Jehan
9b82bc3e76 plug-ins: force at least 0.5s delay to full-screen screenshots on KDE.
The plug-in dialog GUI was always visible in my full-screen screenshots
on KDE, when no delay. It seems the culprit is their fading out effect
which takes longer than the screenshot to happen, therefore the dialog
was showing up with transparency.
2017-12-10 01:50:07 +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
01c39c8fef plug-ins: oups duplicate select_delay with KWin screenshots.
Small fix on previous commit.
2017-12-10 01:28:23 +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
bf13c13e20 plug-ins: fix a bunch of coding style.
The screenshot-win32.c file was absolutely not following our coding
style. A lot of things are still wrong (like camelCase functions), but
at least I fixed a bunch of indentations, space between function and
arguments, alignments, curly brackets at start of lines, etc.
2017-12-09 18:52:51 +01:00
Jehan
614bcf6d0a Bug 791352 - Screenshot delay is broken for region shots in GNOME.
Delay should indeed happen before root and window screenshots, but must
happen in-between region selection and region screenshot.

One can notice that the logics is different for Windows screenshot in
X11. The reason is that X11 window screenshot has an additional window
selection step (and therefore delay must happen in between selection and
actual screenshot). Window screenshot in Wayland doesn't have this step
and simply screenshots whatever is the currently active Window.
2017-12-09 01:45:38 +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
Jehan
3f1dcaadf7 plug-ins: fix indentation.
The risk of search and replace. Bad me!
2017-12-08 22:25:10 +01:00
Jehan
b9034e26a9 Bug 791360 - Add Screenshot implementation for KDE/Wayland.
Only thing I could not properly figure out yet is how to select an area.
The "screenshotArea" method is there in KDE API, but it needs
coordinates and I can't find the API to grab coordinates in Wayland (as
in GNOME shell API).
2017-12-08 19:20:17 +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
894845fe43 plug-ins: actually use the remembered profile_policy in screenshot
Copy and paste coding made the default value the selected one in the
"Color Profile" frame, not the value from ScreenshotValues.
2017-05-30 22:22:40 +02:00
Jehan
bc344a9991 Bug 750180 - Fix different ways of writing Plug-in Plug-In Plugin.
It was agreed that we should write "plug-in" consistently. Only possibly
user-visible strings were updated.
Thanks to scootergrisen for a first patch which could not make it
after changing decision on the canonical writing.
2017-03-21 17:52:22 +01: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
801bd8fb3f plug-ins: get rid of icons in dialog buttons (use labels not stock IDs) 2017-02-12 16:18:54 +01:00
Jehan
f43092cbf5 plug-ins: make screenshot-win32 compile again.
Commit e518b97 broke Win32 compilation with a non-defined variable
"monitor". I made a dirty "fix" by using shootvals->monitor.
Apparently, seeing previous comment, that is probably not the right
value but Mitch is on it and I leave him work it out.
At least now it builds.
2017-02-01 18:52:14 +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
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
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
Hartmut Kuhse
4a7d1e59f9 plug-ins: convert screenshot-win32 to gegl
and do some repairs.
2016-05-28 17:56:14 +02:00
nmat
cf4d0cc40e Fix wrong reference to .ico .cur and resource.h for to fix compilation errors on windows. 2016-05-20 16:14:36 +02:00