Commit graph

59 commits

Author SHA1 Message Date
Luca Bacci
48c27770b6 Use unicode-aware color management API
* GetMonitorInfoW
* EnumDisplayDevicesW
* GetStandardColorSpaceProfileW
* GetColorDirectoryW
2023-01-24 14:48:44 +00:00
Alx Sa
0587a10543 core: Add simulation intent and BPC to GimpImage
Adds a simulation_bpc and simulation_intent to GimpImage to allow 
plug-ins to access it
for CMYK import/export.
Four pdb functions were added to enable this access:
image_get_simulation_bpc (), image_set_simulation_bpc (), 
image_get_simulation_intent (), and image_set_simulation_intent ().
Next, it updates menu options and code to support GimpImage's
internal simulation intent and bpc.
New 'simulation-intent-changed' and 'simulation-bpc-changed signal 
are emitted via
GimpColorManagedInterface so that relevant tools 
(such as the
CYMK color picker, GimpColorFrame, and future pop-overs)
 are aware of these changes.
2022-08-13 19:39:47 +00:00
Jehan
6a08fd6596 libgimpwidgets: fix segfaults on wrongly handled referencing.
gimp_color_config_get_simulation_color_profile() is returning a new
object, so we had 2 code paths giving either allocated data or not.

Therefore simply ref the passed softproof profile in the second code
path, and don't ref it anymore when caching it (especially as it might
also be NULL at that point).
2022-07-18 14:33:42 +02:00
Alx Sa
0d7fed93ae core: Add softproof profile to GimpImage
Adds a simulation_profile to GimpImage to allow plug-ins to access it
for CMYK import/export.
Two pdb functions were added to enable this access:
image_get_simulation_profile () and image_set_simulation_profile()
Next, it updates menu options and code to support GimpImage's
internal simulation profile. Menu items are moved from View to Image's
Color Management section.
New 'simulation-profile-changed' signal is emitted via
GimpColorManagedInterface so that relevant tools (such as the
CYMK color picker, GimpColorFrame, and future dockable
dialogue) are aware of these changes.
2022-07-02 15:26:19 +02:00
Jehan
4b681eb448 app, libgimpwidgets: new gimp_event_triggers_context_menu() and use it…
… for the container tree view contextual menu.

A very annoying point of contextual menus is that they happen on button
press whereas menu item selection happens on button release. When the
menu corner is positionned on the click position, nothing bad happens;
yet when place is missing on screen, the menu might get positionned over
the pointer position. And worse, the mouse position might be just over
an activatable menu item. So we end up in this weird situation where a
click implies: press, menu opens, release, random item (whatever is
below the pointer) is selected and menu closes.

To get rid of this weird case, let's have our contextual menu happen on
button release. In reality, I don't think anyone cares that it happens
on press or release, you just "click". But what you certainly don't want
is to click random menu items!
2021-12-23 12:55:11 +01:00
Yoshinori Yamakawa
2d1c447508 libgimpwidgets: Migration from GetICMProfile() to WcsGetDefaultColorProfile() 2021-12-17 21:58:03 +00:00
Jehan
e43d6217fa libgimpwidgets: fix warnings on Windows/macOS.
The variables `screen` and `display` are only for the GDK_WINDOWING_X11
code path.

Fixing the following warnings:

libgimpwidgets/gimpwidgetsutils.c: In function 'gimp_monitor_get_color_profile':
libgimpwidgets/gimpwidgetsutils.c:502:21: warning: unused variable 'screen' [-Wunused-variable]
  502 |   GdkScreen        *screen;
      |                     ^~~~~~
libgimpwidgets/gimpwidgetsutils.c:501:21: warning: variable 'display' set but not used [-Wunused-but-set-variable]
  501 |   GdkDisplay       *display;
      |                     ^~~~~~~
2021-10-12 17:05:47 +02:00
Jehan
22f234e5b0 libgimpwidgets: do not free cache before using it for debug output.
Thanks to Massimo for noticing this use-after-free bug.
2021-10-01 12:25:34 +02:00
Niels De Graef
842dc7535f gir: (skip) functions with varargs
Bindings can't handle these, so they are not introspectable.
2020-05-21 13:49:38 +02:00
Michael Natterer
ea4fe02a6d libgimpwidgets: some docs fixes 2019-08-18 14:07:17 +02:00
Michael Natterer
8cfef5e60d libgimpwidgets: more docs and annotations 2019-08-09 12:32:09 +02:00
Michael Natterer
1afb7a8b32 libgimpwidgets: add GDestroyNotify to gimp_widget_track_monitor() 2019-08-07 23:44:18 +02:00
Jehan
ddd726e253 libgimpwidgets: add some annotations.
Fix some (transfer) warnings.
2019-08-05 17:13:59 +02:00
Niels De Graef
5f92ced1f3 Add (nullable) if applicable
Basically this commit makes sure that all return values that are marked
as "Returns:" also have a `(nullable)` annotation if it is mentioned on
the same line that NULL can also be returned.

This will prevent a few problems in GObject-introspection.
2019-08-03 07:53:47 +00:00
Niels De Graef
1dda60154c Use "Returns:" to annotate return values
To be able to annotate return values through GObject-introspection, you
need to make sure it is tagged with `Returns:` and not something else.
2019-08-03 07:53:47 +00:00
Jehan
6a1df5be31 libgimpwidgets: fix a copy-paste bug in function docs. 2019-08-03 09:38:46 +02:00
Jehan
19fbb1d9a8 libgimpwidgets: add documentation for many functions and fix...
... an annotation.
s/(transfer-none)/(transfer none)/
For the "Since:" value, I did some git log archeology. Hopefully I got
these right.
2019-08-02 11:46:39 +02:00
Jehan
ea53089545 libgimpwidgets: add a bunch of missing (transfer) annotations. 2019-08-01 13:10:39 +02:00
Alex Samorukov
450843baa7 Replace deprecated CGColorSpaceCopyICCProfile with CGColorSpaceCopyICCData
WARNING: this commit should not be backported to the gimp-2-10 branch because of macOS minimum supported version.
2018-10-19 15:22:08 +00:00
Michael Natterer
2ca55c8e36 libgimpwidgets: fix gimp_monitor_get_color_profile()
to actually return a profile on X11 and (hopefully) quartz again.
Got broken when porting from monitor_number to GdkMonitor.
2018-07-27 20:58:57 +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
d57ab7faf2 libgimpwidgets: move all GimpSizeEntry members to private 2018-05-25 19:15:00 +02:00
Simon Budig
f01a978627 libgimpwidgets: kill the last remaining occurencces of GtkTable 2018-05-20 21:06:35 +02:00
Michael Natterer
bb2a9d119f libgimpconfig: move all GimpColorConfig members to private 2018-05-20 21:06:33 +02:00
Michael Natterer
4afb7ca4c7 libgimpwidgets: set the widgets's hexpand in gimp_grid_attach_aligned() 2018-05-20 21:06:33 +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
7b6d42a443 libgimpwidgets: add gimp_grid_attach_aligned() 2018-05-20 21:06:30 +02:00
Michael Natterer
37e24d0059 libgimpwidgets: remove gimp3migration.[ch] 2018-05-20 21:06:29 +02:00
Michael Natterer
e8f0c14491 app: use gdk_device_get_position() inetad of gdk_display_get_pointer() 2018-05-20 21:06:29 +02:00
Michael Natterer
eb9981e5e4 libgimpwidgets: add gimp_screen_get_color_profile()
and use it in gimp_widget_get_color_profile(). Will soon be used in
screenshot too.
2017-01-31 18:58:27 +01:00
Michael Natterer
4df9a1d568 Get rid of gtk_misc_set_alignment(label) and use gtk_label_set_x,yalign() 2016-09-08 19:11:20 +02: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
a743ae712b libgimpconfig: add "optimize" options for display and softproofing
Honor them in gimp_widget_get_color_transform() and make them
configurable in prefs. The code and GUI avoid the negation in
the lcms "NOOPTIMIZE" flag.
2016-06-06 01:15:26 +02:00
Michael Natterer
8abf1aab5e libgimpconfig: add getters for all GimpColorConfig members
and use them instead of peeking the public object struct.
2016-06-05 23:58:02 +02:00
Michael Natterer
fcf5b708e5 libgimpwidgets: rename gimp_color_config_get_printer_color_profile()
to gimp_color_config_get_simulation_color_profile(), along with
various internal "printer" strings. Also reduce the number of
user-visible "print" stuff from the preferences color management page.
2016-06-05 18:00:24 +02:00
Michael Natterer
b4f34375b7 Bug 767062 - Lags when zooming or dragging zoomed image (cmsFLAGS_NOOPTIMIZE)
Use cmsFLAGS_NOOPTIMIZE only for actual image buffer or single color
transforms, but not for previews or the image display. Makes things a
lot more responsive again.
2016-06-05 16:50:02 +02:00
Jehan
2fae5d7d8b libgimpwidgets: fix some "incompatible pointer type" warnings on Win32.
Thanks nmat for reporting the warning.
2016-06-02 20:38:20 +02:00
Michael Natterer
71384a4115 app: add gimp_widget_track_monitor()
Which installs a callback that behaves as if GtkWidget had a
"monitor-changed" signal. Additionally, moving widgets around between
windows is handled automatically.
2016-06-01 20:40:42 +02:00
Michael Natterer
44f918af2d libgimpwidgets: always ask the toplevel window for its color profile
so all a window's widgets get their profile from the same monitor.
2016-05-31 21:57:31 +02:00
Michael Natterer
70463a74fa libgimpwidgets: don't unref a NULL transforms from the transform cache 2016-05-30 12:48:10 +02:00
Michael Natterer
d6ee1dc5cf libgimpwidgets: cache gimp_widget_get_color_transform()'s GimpColorTransforms
Now that more and more widgets are color managed, we need transforms
for all of them. Creating them is very expensive.

The new cache returns the same transform for a combination of (config,
src_profile, src_format, dest_format) and invalidates itself
automatically on config changes. The number of transforms goes down
from potentially hundreds to a handful, and the cost of a config
change from many seconds to virtually instant.
2016-05-27 21:58:46 +02:00
Michael Natterer
0bfa402c1a Argh, this was meant to be squashed into the previous commit... 2016-05-26 22:18:50 +02:00
Michael Natterer
cc92887908 libgimpcolor: add new object GimpColorTransform
which encapsulates a cmsHTRANSFORM and does all the pixel format
conversion magic. It has API to create transforms and proofing
transforms, and to convert pixels arrays and GeglBuffers.

Before, each place which has a transform had to keep around the
transform and its input and output Babl formats, and had to implement
lots of stuff itself. Now all that lives in GimpColorTransform,
removing lots of logic from many places, and pretty much removing lcms
from the public API entirely.

This removes including <lcms2.h>, LCMS_LIBS and LCMS_CFLAGS from
almost all directories and potentially allows to replace lcms by
something else.
2016-05-26 22:15:54 +02:00
Kristian Rietveld
61a1c877c1 libgimpwidgets: Mac OS X: read ICC profile from the correct buffer
Clearly, the buffer to read the ICC profile from is pointed to by
"buffer", not "data" which is a CFDataRef. I doubt the old code was
ever tested.
2016-05-06 20:53:41 +02:00
Kristian Rietveld
48721b5152 libgimpwidgets: update OS X code to get display profile to new API
The API that is currently used is deprecated since 10.6.
2016-05-06 20:53:09 +02:00
Michael Natterer
a33daf99fe libgimpcolor: rename RGB and GRAY gimp_color_profile_new_*() functions
to be more consistent, as discussed in bug #756389.
2015-12-15 20:42:21 +01:00
Michael Natterer
fd0203ce80 libgimpwidgets: change parameters of gimp_widget_get_color_transform()
Change GimpColorManaged to GimpColorProfile.
2015-09-01 23:40:57 +02:00
Michael Natterer
c102dde92b libgimpcolor, *: change GimpColorProfile to be a GObject
it used to be a typedef to gpointer and actually was a cmsHPROFILE.

Change its API to be more "standard", remove the public close()
function. The object caches both the cmsHPROFILE and the data/length
ICC blob, so conversions between the two become obsolete (simply call
get_lcms_profile() or get_icc_profile()).

Adapt everything to the new API, but port it in a naive way for now,
the code doesn't take advantage of the new possibilities yet (like
refcounting).
2015-07-10 22:53:59 +02:00
Michael Natterer
16971ff186 libgimpwidgets: formatting cleanup in gimp_widget_get_color_transform() 2015-06-16 23:43:04 +02:00
Michael Natterer
3565b33019 libgimpconfig: rename the new GimpColorConfig profile accessor functions
gimp_color_config_get_foo_profile() -> get_foo_color_profile()

because the old names clash with possible future accessors for the raw
filename properties.
2015-06-03 09:57:34 +02:00