Commit Graph

27 Commits

Author SHA1 Message Date
732bcb463e Misc. comment typos
Found via `codespell`
2018-07-14 19:07:43 +00:00
5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
ff6d7a7550 plug-ins: renaming Win32 implementation files to follow namespacing. 2018-05-30 11:57:31 +02:00
2caa400a96 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. :-)
2018-05-30 11:57:31 +02:00
9f800b05b4 plug-ins: hopefully make it build after my GdkScreen/GdkMonitor b0rk 2018-05-28 18:40:38 +02:00
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
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
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
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
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
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
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
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
1febb3327b plug-ins: update win32 screenshot to use the right delay as well. 2017-12-10 02:29:35 +01:00
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
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
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
3cf423f0cd *: rename NORMAL to NORMAL_LEGACY and NORMAL_LINEAR to NORMAL
and make NORMAL_LEGACY immutable.
2017-02-26 16:26:34 +01:00
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
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
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
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
4a7d1e59f9 plug-ins: convert screenshot-win32 to gegl
and do some repairs.
2016-05-28 17:56:14 +02:00
a856fdab50 plug-ins: forgot to change an #include after renaming screenshot files 2016-05-01 19:25:52 +02:00
ed80db30c9 plug-ins: convert win-snap to screenshot
works as win-snap, lots of optimizing work to be done.
2016-05-01 19:10:57 +02:00
bbbc103d18 plug-ins: screenshot: #include <glib.h> early for G_OS_WIN32 2016-04-02 21:35:55 +02:00
d164850484 plug-ins: add an (empty) Win32 backend to screenshot
and buld it unconditionally. Somebody please move the code from
win-snap to the new file.
2016-04-02 15:02:00 +02:00