Matthias Clasen
5206d02a0d
Support color profiles in pixbufs
...
When creating a GdkTexture from a GdkPixbuf,
see if it has an icc profile attached, and if
so, use it.
2021-10-28 03:41:09 +02:00
Matthias Clasen
e20c403f9b
jpeg: Handle color profiles
...
Read the profile when loading jpegs and embed the profile when saving
them.
2021-10-28 03:41:09 +02:00
Matthias Clasen
6b00c98c81
tiff: Handle color profiles
...
Apply an embedded icc profile when loading tiff
images, and save associated icc profile information
when saving tiff images.
2021-10-28 03:41:09 +02:00
Benjamin Otte
1c8cf6ae72
png: Handle color profiles
2021-10-28 03:41:09 +02:00
Benjamin Otte
755d5d5f14
widget-factory: Add tests for loading color profiles
...
I figured out how to generate them, yay:
cmsHPROFILE lcms_profile;
cmsToneCurve *curve[3];
curve[0] = cmsBuildParametricToneCurve (NULL, 4, (double[5]) { 1.0, 0, 0, 0, 0 });
curve[1] = cmsBuildParametricToneCurve (NULL, 4, (double[5]) { 2.4, 255.0 / 15 / 1.055, 0.055 / 1.055, 0, 15./255 });
curve[2] = cmsBuildGamma (NULL, 2.4);
lcms_profile = cmsCreateRGBProfile (&(cmsCIExyY) {
0.3127, 0.3290, 1.0
},
&(cmsCIExyYTRIPLE) {
{ 0.6400, 0.3300, 1.0 },
{ 0.3000, 0.6000, 1.0 },
{ 0.1500, 0.0600, 1.0 }
},
curve);
cmsSaveProfileToFile (lcms_profile, "foo.icc");
cmsFreeToneCurveTriple (curve);
cmsCloseProfile (lcms_profile);
2021-10-28 03:41:09 +02:00
Benjamin Otte
ea73fc2b31
widget-factory: Add gradient rendering test
...
Test how GTK draws gradients, by adding an sRGB and a linear colorspace
gradient and draw one with CSS.
Have a look which one (if any) matches.
2021-10-28 03:41:09 +02:00
Benjamin Otte
65f709f55e
memorytexture: Add colorspace argument to from_texture()
...
Make gdk_memory_texture_from_texture() take a colorspace instead of
implicitly using sRGB.
2021-10-28 03:41:09 +02:00
Benjamin Otte
e590014aff
texture: Make ::download() take a colorspace
...
By passing the colorspace down into the download function, we allow an
immediate conversion in the backend. This will make it possible for GL
renderers to do the conversion in a shader instead of having to use the
CPU.
2021-10-28 03:41:09 +02:00
Benjamin Otte
995a74e188
API: Add gdk_memory_texture_new_with_color_space()
...
A version of gdk_memory_texture_new() that allows passing a color
space. The old version just assumes sRGB.
2021-10-28 03:41:09 +02:00
Benjamin Otte
0b06e32efa
memoryformat: Take a color profile when converting
2021-10-28 03:41:09 +02:00
Benjamin Otte
7054181863
texture: Add a ::color-space property
...
Returns the associated color space. For now, this is always sRGB.
2021-10-28 03:41:09 +02:00
Benjamin Otte
d95353c1bc
gdk: Add GdkLcmsColorSpace
...
This is a colorspace implementation using LCMS to implement support
for random colorspaces from ICC profiles.
2021-10-28 03:41:09 +02:00
Benjamin Otte
ab4837d311
cms: Add lcms to the build
...
Since lcms2 is using autotools, this uses the
experimental 'external project' module of meson,
and adds a minimal meson.build file to lcms2.
It seems to work.
2021-10-28 03:41:09 +02:00
Benjamin Otte
b7630f26df
gdk: Add GdkColorSpace
...
The code doesn't do anything yet, this is just the boilerplate.
2021-10-28 03:41:09 +02:00
Benjamin Otte
c97a758aa7
cssparser: Remove unused argument
...
The base_directory argument is never used. So don't have it.
2021-10-28 03:19:08 +02:00
Matthias Clasen
68eb601194
Merge branch 'gtkeventcontroller.c-fix' into 'master'
...
master: premature controller unreferencing in gtk_event_controller_handle_event
See merge request GNOME/gtk!4099
2021-10-27 23:50:13 +00:00
Matthias Clasen
cadeca27de
Merge branch 'rgba-for-master' into 'master'
...
docs: standard names are CSS names, not X11 names
See merge request GNOME/gtk!4100
2021-10-27 23:27:42 +00:00
Maxim Zakharov
af2d0f188c
gtk: Hold reference on controller until events are fully handled
...
Fixes premature controller unreferencing in
gtk_event_controller_handle_event() if the controller itself is being
removed while handling the event.
2021-10-28 10:23:32 +11:00
Benjamin Otte
c11a43418e
docs: standard names are CSS names, not X11 names
...
We updated Pango a while ago to use these more common names, but apparently forgot the docs.
2021-10-27 22:12:58 +00:00
Matthias Clasen
d7d4cef66d
Merge branch 'wip/chergert/use-fabs-in-macos' into 'master'
...
macos: fix scale on macOS 12 beta
See merge request GNOME/gtk!4065
2021-10-27 19:37:01 +00:00
Benjamin Otte
9b71bbac3a
Merge branch 'wip/otte/for-master' into 'master'
...
gdktypes: Remove GDK_EXTERN_VAR
Closes #4373
See merge request GNOME/gtk!4097
2021-10-26 23:43:46 +00:00
Benjamin Otte
ac8c4245b2
css: Don't throw warnings on broken URL in image css
...
If a URL can't be loaded, we might end up with a NULL file. Handle that
case properly by creating an invalid image instead and don't crash or
complain to stderr when files are NULL.
This was broken since 0886ade182
A new reftest has been included. We need a reftest instead of a
CSS parser test, because the error only becomes visible when
compute()ing the actual image.
Fixes #4373
2021-10-26 23:52:38 +02:00
Benjamin Otte
d726ecdb5d
gdk: Split enums from types
...
Add gdkenums.h for enums and keep gdktypes.h for types.
Makes both files easier to read.
2021-10-26 20:59:37 +02:00
Benjamin Otte
41919158cc
gdktypes: Remove GDK_EXTERN_VAR
...
It is unused.
2021-10-26 20:42:22 +02:00
Matthias Clasen
4ea84d3144
Merge branch 'bilelmoussaoui/missing-since-annotations' into 'master'
...
since annotations cleanup
See merge request GNOME/gtk!4086
2021-10-26 17:53:06 +00:00
Benjamin Otte
3744cb24e2
Merge branch 'alatiera/gdk_create_context_nullable' into 'master'
...
gdkdisplay: Remove (nullable)
See merge request GNOME/gtk!4096
2021-10-25 17:42:00 +00:00
Rūdolfs Mazurs
a6cbeba5f6
Update Latvian translation
...
(cherry picked from commit 4f5264d1b7
)
2021-10-25 17:00:11 +00:00
Jordan Petridis
4cda2aec57
gdkdisplay: Remove (nullable)
...
gdk_display_create_gl_context only returns NULL when there is
an error set or asserts/aborts. So nullalbe annotation isn't needed.
Similar to 53312cf696
2021-10-25 18:40:40 +03:00
Emmanuele Bassi
33470fd872
Merge branch 'enterprisey-master-patch-53741' into 'master'
...
readme: Fix "Building GTK" docs link
See merge request GNOME/gtk!4095
2021-10-25 08:22:44 +00:00
enterprisey
75bba2b055
readme: Fix "Building GTK" docs link
2021-10-25 07:59:03 +00:00
Matthias Clasen
c953e3cc0f
Merge branch 'wip/exalm/polish' into 'master'
...
A few inspector papercut fixes
See merge request GNOME/gtk!4092
2021-10-24 19:04:48 +00:00
Alexander Mikhaylenko
83319a3ea6
inspector: Expand the controllers column view
2021-10-24 22:27:50 +05:00
Alexander Mikhaylenko
516dc79605
inspector: Use .list for property list as well
2021-10-24 22:27:50 +05:00
Alexander Mikhaylenko
2aa2b7f61e
inspector: Clean up the .list style
...
Make it work with the property list as well, handle spinbuttons, adjust
paddings so that buttons don't touch each other, don't override horizontal
padding unnecessarily.
2021-10-24 22:27:24 +05:00
Alexander Mikhaylenko
0053160f28
inspector: Stop using .sidebar for the recorder page
...
Those aren't sidebars. Add separators manually instead of misusing the
style class.
2021-10-24 04:01:35 +05:00
Alexander Mikhaylenko
2ac8132499
inspector: Use consistent GtkTextView margins
2021-10-24 03:58:21 +05:00
Alexander Mikhaylenko
7aa34cb3d2
inspector: Add a separator under toolbar in css editor
...
Same as object properties.
2021-10-24 03:55:26 +05:00
Alexander Mikhaylenko
3aee23c172
inspector: Use tabular figures for list position label
...
Avoid buttons jumping around while moving through list models.
2021-10-24 03:37:01 +05:00
Alexander Mikhaylenko
bec9141233
inspector: Use .toolbar for toolbars
...
Remove all of the manual margins, spacing and has-frame=0, be more
consistent.
2021-10-24 03:37:01 +05:00
Alexander Mikhaylenko
131683fdcf
inspector: Use a GtkSeparator for the object details toolbar
...
Remove a hardcoded light grey border from the sidebar that was used for
this.
2021-10-24 02:53:22 +05:00
Alexander Mikhaylenko
8176b0c2fc
inspector: Remove list header style
...
The one from the theme works just fine.
2021-10-24 02:51:07 +05:00
Piotr Drąg
513fe87391
Update POTFILES.skip
2021-10-23 13:08:47 +02:00
Benjamin Otte
a07e1bf336
Merge branch 'wip/otte/for-master' into 'master'
...
Fix a bunch of issues found by static analyzer
See merge request GNOME/gtk!4090
2021-10-23 00:00:32 +00:00
Benjamin Otte
ae117d0cfa
png: allocate data before sigsetjmp()
...
Makes the static analyzer not trip up when trying to analyze memory
leaks.
2021-10-23 00:03:51 +02:00
Benjamin Otte
a4e83ec584
demos: Remove unused code
2021-10-23 00:03:51 +02:00
Benjamin Otte
373ca2389a
glx: Remove unused assignment
2021-10-22 23:50:45 +02:00
Benjamin Otte
b2f9a907ce
tiff: Fix variable assignment
2021-10-22 23:50:45 +02:00
Benjamin Otte
2b2fd23815
Merge branch 'wip/otte/center-center-center' into 'master'
...
Add a bunch of reftests and fix their failures
Closes #4285
See merge request GNOME/gtk!4085
2021-10-22 16:35:41 +00:00
Benjamin Otte
2113a18a18
testsuite: Add lots of reftests for picture sizing
...
Have square images in the following sizes:
* 20
* 100
* 150
* 200
* 300
and place them in a can-shrink Picture allocated at the sizes:
* 200x100
* 100x200
and set align to center/center.
That's 10 combinations and they should all do the right thing.
2021-10-22 17:51:41 +02:00
Benjamin Otte
1606a41116
widget: adjust allocation even better
...
This fixes fallout from 3742fabae0
where
we would no longer allocate widgets to their natural size when
align flags where used.
GtkPicture wants to be allocated at 100% in that case, so a picture with
a 100x100 image inside a 200x200 window should be allocated 100x100.
The new adjustment code now does the following (for width-for-height
instead of height-for-width, swap width and height in the following):
1. query the minimum width for the allocated height
2. query the natural width
3. compute the maximum of (1) and (2)
4. set the widget width to the minimum of (3) and the allocated
width.
5. compute the natural height for (4)
6. set the widget height to the minimum of (5) and the allocated height.
2021-10-22 17:51:40 +02:00