Commit Graph

52 Commits

Author SHA1 Message Date
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
Michael Natterer 4910c28957 libgimpcolor: rename the gimp_lcms_*() functions to gimp_color_profile_*()
because it doesn't make sense to call the typedef GimpColorProfile
but the function namespace gimp_lcms_*().
2015-06-03 09:41:23 +02:00
Michael Natterer 8005eea835 Remove the "GIMP" from all "Since: GIMP 2.x" API doc comments
because it confuses gtk-doc and breaks some links. Also change the
"Index of new symbols in GIMP 2.x" sections to be what seems to be the
modern standard (looked at the GLib and GTK+ docs), and update some
other stuff.
2015-05-31 21:18:09 +02:00
Michael Natterer 263fabbb9b libgimpwidgets: simplify gimp_widget_get_color_transform()
Make sure src_profile and dest_profile always exist. Also optimize
things by not returning a transform if the profiles are equal.
2015-05-30 01:07:34 +02:00
Michael Natterer d3e11c5b2c modules, libgimpwidgets: use gimp_color_managed_get_color_profile()
which always returns a profile, instead of code that uses the ICC
blob and falls back to GimpColorConfig's profile, then falls back
to the built-in profiles.
2015-05-27 12:53:46 +02:00
Michael Natterer d93ed29f45 libgimpwidgets: gimp_widget_get_color_transform: honor display-profile-from-gdk 2015-05-13 01:12:03 +02:00
Michael Natterer 394bc25be1 libgimpwidgets: return the formats from gimp_widget_get_color_transform()
Turn the src_format and dest_formats into "const Babl **" and make
them return the actually used formats. Change the lcms display module
accordingly.
2015-05-11 00:45:18 +02:00
Michael Henning af84148fed libgimpwidgets: Fix the order of #includes
Otherwise, G_OS_WIN32 and GDK_WINDOWING_QUARTZ will never be
defined by the time we reach the #ifdefs.
2015-05-08 22:53:49 -04:00